(window["webpackJsonp"] = window["webpackJsonp"] || []).push([["app-pages-veiculo-agendamento-veiculo-agendamento-veiculo-module"],{

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-compartimentos/agendamento-veiculo-compartimentos.component.html":
/*!******************************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-compartimentos/agendamento-veiculo-compartimentos.component.html ***!
  \******************************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<form #formCompartimentos=\"ngForm\" (ngSubmit)=\"onSubmit(formCompartimentos)\">\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n            <div class=\"form-group form-group-sm\">\r\n                <label for=\"nPlanejamento\" [class.required]=\"service.requiredRegPlanejCarga\">{{'labels.nPlanejamento' |\r\n                    translate}}</label>\r\n                <div class=\"input-group\">\r\n                    <input id=\"nPlanejamento\" name=\"nPlanejamento\" [(ngModel)]=\"regPlanejCarga\"\r\n                        class=\"form-control form-control-sm\" type=\"text\" [required]=\"service.requiredRegPlanejCarga\"\r\n                        disabled>\r\n                    <div class=\"input-group-prepend\">\r\n                        <button type=\"button\" class=\"input-group-text\" data-toggle=\"modal\" disabled>\r\n                            <i class=\"fa fa-search\"></i>\r\n                        </button>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n    <div class=\"row\">\r\n        <div class=\"col-12 mt-4\">\r\n            <table class=\"table rownowrap form-control-sm\">\r\n                <tbody>\r\n                    <tr *ngFor=\"let d of dados; let i = index\">\r\n                        <td>\r\n                            <label class=\"form-label mb-1 d-block\">\r\n                                {{ \"labels.placaContainer\" | translate }}\r\n                            </label>\r\n                            {{ d.placa ? d.placa + (d.numCompartimento != null ? \" - Compartimento \" +\r\n                            d.numCompartimento : \"\") :\r\n                            \"\" }}\r\n                        </td>\r\n                        <td>\r\n                            <label class=\"form-label mb-1 d-block\" [class.required]=\"isVolumeRequired(d)\">\r\n                                {{ \"labels.capacLts\" | translate }}\r\n                            </label>\r\n                            <select class=\"form-control form-control-sm\" [id]=\"'volume' + i\" [name]=\"'volume' + i\"\r\n                                [disabled]=\"disabled\" [(ngModel)]=\"d.volume\" [required]=\"isVolumeRequired(d)\">\r\n                                <option value=\"{{ v }}\" *ngFor=\"let v of d.volumes\">\r\n                                    {{ v | formatCurrency: 0 }}\r\n                                </option>\r\n                            </select>\r\n                        </td>\r\n                        <td>\r\n                            <label class=\"form-label mb-0 d-block\">\r\n                            </label>\r\n                            <app-pesquisa-material [id]=\"'materialIdItens' + i\" [name]=\"'materialId' + i\"\r\n                                (outModel)=\"trataMaterial($event, i)\" [(ngModel)]=\"d.materialId\"\r\n                                [inSelected]=\"d.material\" modalTitle=\"pesquisaDeProduto\" [disabled]=\"disabled\"\r\n                                [required]=\"isMaterialRequired(d)\" label=\"produto\">\r\n                            </app-pesquisa-material>\r\n                        </td>\r\n                    </tr>\r\n                    <tr *ngIf=\"dados && dados.length === 0\">\r\n                        <td colspan=\"3\">\r\n                            {{ \"messages.nenhumRegistroEncontrado\" | translate }}\r\n                        </td>\r\n                    </tr>\r\n                </tbody>\r\n            </table>\r\n        </div>\r\n    </div>\r\n    <!-- TABELA DE RESUMO -->\r\n    <div class=\"row\">\r\n        <div class=\"col-12\">\r\n            <table class=\"table table-bordered table-sm mt-3\">\r\n                <thead>\r\n                    <tr>\r\n                        <th>{{ 'labels.produto' | translate }}</th>\r\n                        <th>{{ 'labels.volume' | translate }}</th>\r\n                    </tr>\r\n                </thead>\r\n                <tbody>\r\n                    <tr *ngFor=\"let r of resumo\">\r\n                        <td>{{ r.nome }}</td>\r\n                        <td>{{ r.volume | formatCurrency: 0 }}</td>\r\n                    </tr>\r\n                    <tr>\r\n                        <td><strong>VOLUME TOTAL</strong></td>\r\n                        <td><strong>{{ volumeTotalResumo | formatCurrency: 0 }}</strong></td>\r\n                    </tr>\r\n                </tbody>\r\n            </table>\r\n        </div>\r\n    </div>\r\n    <div class=\"row mt-3\">\r\n        <div class=\"col-12 d-flex justify-content-end gap-2\">\r\n            <button type=\"submit\" class=\"btn btn-success mr-2\" [disabled]=\"disabled\"> {{\r\n                'buttons.ok' | translate }}\r\n            </button>\r\n        </div>\r\n    </div>\r\n</form>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-filter/agendamento-veiculo-filter.component.html":
/*!**************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-filter/agendamento-veiculo-filter.component.html ***!
  \**************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"modal fade\" id=\"agendamento-veiculo-filter-dialog\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\n    <div class=\"uni-modal-dialog-md-40\">\n        <div class=\"modal-content\">\n            <div class=\"modal-header\">\n                <h5 class=\"modal-title\">{{ 'titles.agendamentoVeiculo' | translate }}</h5>\n            </div>\n            <form class=\"form filter-veiculo\" #form=\"ngForm\" (ngSubmit)=\"onSubmit(form)\" autocomplete=\"off\">\n                <app-validacoes></app-validacoes>\n                <div class=\"modal-body\">\n                    <div class=\"row\">\n                        <div class=\"col-lg-6 col-sm-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"dataI\" class=\"required\">{{'labels.periodoDe' |\n                                    translate}}</label>\n                                <app-data id=\"dataI\" name=\"periodoDe\" [(ngModel)]=\"service.filter.dataI\" required\n                                    autofocus (executa)=\"validaData()\">\n                                </app-data>\n                            </div>\n                        </div>\n                        <div class=\"col-lg-6 col-sm-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"dataF\" class=\"required\">{{'labels.ate' | translate}}</label>\n                                <app-data id=\"dataF\" name=\"ate\" [(ngModel)]=\"service.filter.dataF\" required\n                                    (executa)=\"validaData()\">\n                                </app-data>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <app-pesquisa-destinatario id=\"cliente\" name=\"cliente\" label=\"cliente\"\n                                    modalTitle=\"pesquisaDeCliente\" [(ngModel)]=\"service.filter.destinatarioIdCliente\"\n                                    [inSelected]=\"service.filter.cliente\" tipoDestinatario=\"C\" showCgcCpf=\"false\"\n                                    showInscricao=\"false\" (outModel)=\"trataCliente($event)\">\n                                </app-pesquisa-destinatario>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <app-pesquisa-material id=\"materialId\" name=\"produto\" label=\"produto\"\n                                    modalTitle=\"pesquisaDeProduto\" [(ngModel)]=\"service.filter.materialId\"\n                                    (outModel)=\"outMaterial($event)\" [inSelected]=\"service.filter.material\">\n                                </app-pesquisa-material>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <app-pesquisa-destinatario id=\"destinatarioIdTransportadora\"\n                                    name=\"destinatarioIdTransportadora\" label=\"transportadora\"\n                                    modalTitle=\"pesquisaDeTransportadora\"\n                                    [(ngModel)]=\"service.filter.destinatarioIdTransportadora\" tipoDestinatario=\"T\"\n                                    showCgcCpf=\"false\" showInscricao=\"false\"\n                                    [inSelected]=\"service.filter.transportadora\"\n                                    (outSelected)=\"service.filter.transportadora = $event\">\n                                </app-pesquisa-destinatario>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-12\">\n                            <div class=\"form-group form-group-sm\">\n                                <app-pesquisa-motorista id=\"motoristaId\" name=\"motoristaId\" label=\"motorista\"\n                                    modalTitle=\"pesquisaMotorista\" [(ngModel)]=\"service.filter.motoristaId\"\n                                    [showCpf]=\"true\" showCursos=\"false\" showDocumentos=\"false\"\n                                    (outSelected)=\"service.filter.motorista = $event\">\n                                </app-pesquisa-motorista>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-lg-4\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"cadastroPlacaId\">{{ 'labels.placa' | translate}}</label>\n                                <input id=\"cadastroPlacaId\" name=\"cadastroPlacaId\" maxlength=\"18\"\n                                    [(ngModel)]=\"service.filter.cadastroPlacaId\" class=\"form-control form-control-sm\">\n                            </div>\n                        </div>\n                        <div class=\"col-lg-4\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"webStoPlanejaVeiculoId\">{{ 'labels.codigo' | translate}}</label>\n                                <input id=\"webStoPlanejaVeiculoId\" name=\"webStoPlanejaVeiculoId\" maxlength=\"11\"\n                                    mask=\"999999999\" [(ngModel)]=\"service.filter.webStoPlanejaVeiculoId\"\n                                    class=\"form-control form-control-sm\">\n                            </div>\n                        </div>\n                        <div class=\"col-lg-4\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"status\">{{\"labels.status\" | translate}}</label>\n                                <select id=\"status\" name=\"status\" data-title=\"{{ 'labels.status' | translate }}\"\n                                    class=\"form-control form-control-sm\" [(ngModel)]=\"service.filter.status\">\n                                    <option value=\"A\">{{ 'labels.emAberto' | translate}}</option>\n                                    <option value=\"C\">{{ 'labels.concluido' | translate}}</option>\n                                    <option value=\"E\">{{ 'labels.canceladoEncerrado' | translate}}</option>\n                                    <option value=\"T\">{{ 'labels.todos' | translate}}</option>\n                                </select>\n                            </div>\n                        </div>\n                    </div>\n                    <div class=\"row\">\n                        <div class=\"col-lg-4\">\n                            <div class=\"form-group form-group-sm\">\n                                <label for=\"agendamento\">{{\"labels.agendamento\" | translate}}</label>\n                                <select id=\"agendamento\" name=\"agendamento\"\n                                    data-title=\"{{ 'labels.agendamento' | translate }}\"\n                                    class=\"form-control form-control-sm\" [(ngModel)]=\"service.filter.situacao\">\n                                    <option value=\"E\">{{ 'labels.aguardandoEnvio' | translate}}</option>\n                                    <option value=\"G\">{{ 'labels.aguardandoAutorizacao' | translate}}</option>\n                                    <option value=\"A\">{{ 'labels.autorizado' | translate}}</option>\n                                    <option value=\"R\">{{ 'labels.recusado' | translate}}</option>\n                                    <option value=\"T\">{{ 'labels.todos' | translate}}</option>\n                                </select>\n                            </div>\n                        </div>\n                    </div>\n                </div>\n                <div class=\"modal-footer\">\n                    <button class=\"btn btn-success mr-1\" type=\"submit\">{{ 'buttons.pesquisar' | translate }}\n                    </button>\n                    <button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">Sair</button>\n                </div>\n            </form>\n        </div>\n    </div>\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-form.component.html":
/*!**********************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-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\" [sisFormularioId]=\"constantes.sisFormularioId\"\r\n    [formAction]=\"actionForm\" [itemData]=\"service.data.webStoPlanejaVeiculoId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"col-lg-12 col-12 section-comand-bar\">\r\n    <div class=\"clearfix\">\r\n        <ul class=\"nav nav-tabs\">\r\n            <li class=\"nav-item\">\r\n                <a class=\"nav-link active\" data-toggle=\"tab\" href=\"#tDados\">{{\"labels.dados\" | translate }}</a>\r\n            </li>\r\n            <li class=\"nav-item\" *ngIf=\"showAbaItens\">\r\n                <a class=\"nav-link\" data-toggle=\"tab\" href=\"#tItens\">{{\"labels.itens\" | translate }}</a>\r\n            </li>\r\n            <li class=\"nav-item\">\r\n                <a class=\"nav-link\" data-toggle=\"tab\" href=\"#tNotas\">{{\"labels.notas\" | translate }}</a>\r\n            </li>\r\n            <li class=\"nav-item\">\r\n                <a class=\"nav-link\" data-toggle=\"tab\" href=\"#tSitAgendamento\">{{\"labels.situacaoAgendamento\" | translate\r\n                    }}</a>\r\n            </li>\r\n            <li class=\"nav-item\" *ngIf=\"showAbaCompartimentos\">\r\n                <a class=\"nav-link\" data-toggle=\"tab\" href=\"#tCompartimentos\"\r\n                    (click)=\"carregarDadosCompartimentos()\">{{\"labels.compartimentos\" | translate\r\n                    }}</a>\r\n            </li>\r\n        </ul>\r\n    </div>\r\n    <div class=\"tab-content top\">\r\n        <div class=\"tab-pane active\" id=\"tDados\">\r\n            <app-form-legenda></app-form-legenda>\r\n            <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n                <app-validacoes formErrorId=\"msgDados\"></app-validacoes>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"numAgendamento\">{{'labels.numAgendamento' | translate}}</label>\r\n                            <input id=\"numAgendamento\" name=\"numAgendamento\" type=\"text\" [disabled]=\"true\"\r\n                                [(ngModel)]=\"service.data.webStoPlanejaVeiculoId\" (blur)=\"buscaPlanejamento();\"\r\n                                class=\"form-control form-control-sm\" />\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"nPlanejamento\"\r\n                                [class.required]=\"service.requiredRegPlanejCarga\">{{'labels.nPlanejamento' |\r\n                                translate}}</label>\r\n                            <div class=\"input-group\">\r\n                                <input id=\"nPlanejamento\" name=\"nPlanejamento\" [(ngModel)]=\"service.data.regPlanejCarga\"\r\n                                    class=\"form-control form-control-sm\" type=\"text\"\r\n                                    [required]=\"service.requiredRegPlanejCarga\"\r\n                                    [disabled]=\"!funcoesService.isCreate(actionForm)\">\r\n                                <div class=\"input-group-prepend\">\r\n                                    <button type=\"button\" class=\"input-group-text\" data-toggle=\"modal\"\r\n                                        [disabled]=\"!funcoesService.isCreate(actionForm)\" (click)=\"opnModal();\">\r\n                                        <i class=\"fa fa-search\"></i>\r\n                                    </button>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 mt-4\" *ngIf=\"showCarregarAgendamento\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <button type=\"button\" class=\"btn btn-default\" [disabled]=\"!habilitaBtnCarregarAgendamento\"\r\n                                (click)=\"onClickCarregarAgendamento()\">\r\n                                {{ \"labels.carregarAgendamento\" | translate }}\r\n                            </button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-8 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"cliente\" name=\"cliente\" tipoDestinatario=\"C\"\r\n                                modalTitle=\"pesquisaDeCliente\" label=\"cliente\"\r\n                                [(ngModel)]=\"service.data.destinatarioIdCliente\" showInscricao=\"false\" showCgcCpf=\"true\"\r\n                                [required]=\"true\" [inSelected]=\"service.data.cliente\" (outModel)=\"trataCliente($event)\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-4 col-md-6 col-sm-12 mt-4\" *ngIf=\"mostraDescSituacao\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label>{{lblDescSituacao}}</label>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"tipoDeOperacao\" class=\"required\">{{\"labels.tipoDeOperacao\" | translate\r\n                                }}</label>\r\n                            <select id=\"tipoDeOperacao\" name=\"tipoDeOperacao\" [(ngModel)]=\"service.data.tipoMov\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" (change)=\"trataTipoMov()\" required\r\n                                class=\"form-control form-control-sm\">\r\n                                <option value=\"C\">{{ 'labels.carga' | translate }}</option>\r\n                                <option value=\"D\">{{ 'labels.descarga' | translate }}</option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"flagTransferencia\"></label>\r\n                            <div class=\"custom-control custom-checkbox\">\r\n                                <input id=\"flagTransferencia\" type=\"checkbox\" name=\"flagTransferencia\"\r\n                                    class=\"custom-control-input checkbox-success\"\r\n                                    [ngModel]=\"service.data.flagTransferencia === 'S'\"\r\n                                    (ngModelChange)=\"service.data.flagTransferencia=$event?'S':'N'\"\r\n                                    [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                    (click)=\"checkLocalTrasferencia($event)\">\r\n                                <label class=\"custom-control-label\" for=\"flagTransferencia\">{{'labels.transferencia' |\r\n                                    translate}}</label>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"modal\" class=\"required\">{{\"labels.modal\" | translate\r\n                                }}</label>\r\n                            <select id=\"modal\" name=\"modal\" [(ngModel)]=\"service.data.modal\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" (change)=\"trataModal()\" required\r\n                                class=\"form-control form-control-sm\">\r\n                                <option value=\"R\">{{ 'labels.rodoviario' | translate }}</option>\r\n                                <option value=\"F\">{{ 'labels.ferroviario' | translate }}</option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label [class.required]=\"requiredTipoFrete\" for=\"tipoDeFrete\">{{'labels.tipoDeFrete' |\r\n                                translate}}</label>\r\n                            <app-combo-padrao name=\"tipoDeFrete\" id=\"tipoDeFrete\" chave=\"TipoFrete\"\r\n                                descricao=\"DescrTipoFrete\" [required]=\"requiredTipoFrete\" tabela=\"TipoFrete\"\r\n                                [(ngModel)]=\"service.data.tipoFreteId\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                (outSelected)=\"trataTipoFrete($event)\">\r\n                            </app-combo-padrao>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"sequencia\">{{'labels.sequencia' | translate}}</label>\r\n                            <input id=\"sequencia\" name=\"sequencia\" type=\"text\" disabled\r\n                                [(ngModel)]=\"service.data.sequencia\" class=\"form-control form-control-sm\" />\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"tipoCarga\">{{\"labels.tipoCarga\" | translate }}</label>\r\n                            <app-combo-padrao name=\"tipoCarga\" id=\"tipoCarga\" chave=\"TipoCarga\"\r\n                                descricao=\"DescrTipoCarga\" ativo=\"true\" tabela=\"TipoCarga\"\r\n                                [condicionais]=\"condicionaisOptions\" [(ngModel)]=\"service.data.tipoCarga\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-combo-padrao>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"emissao\">{{'labels.emissao' |\r\n                                translate}}</label>\r\n                            <app-data-h-m-s id=\"emissao\" name=\"emissao\" [(ngModel)]=\"service.data.dtEmissao\" disabled>\r\n                            </app-data-h-m-s>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label [class.required]=\"requiredRequisicao\" for=\"ordemDeCargaNf\">{{'labels.ordemDeCargaNf'|\r\n                                translate}} </label>\r\n                            <input type=\"text\" id=\"ordemDeCargaNf\" name=\"ordemDeCargaNf\"\r\n                                class=\"form-control form-control-sm\" [(ngModel)]=\"service.data.requisicao\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" [required]=\"requiredRequisicao\"\r\n                                mask=\"999999999\" maxlength=\"9\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"pedido15\">{{'labels.pedido' | translate}}</label>\r\n                            <input id=\"pedido15\" name=\"pedido15\" [(ngModel)]=\"service.data.pedido15\"\r\n                                class=\"form-control form-control-sm\" type=\"text\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" maxlength=\"28\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"docNacionalizacao\">{{'labels.docNacionalizacao' | translate}}</label>\r\n                            <input id=\"docNacionalizacao\" name=\"docNacionalizacao\"\r\n                                [(ngModel)]=\"service.data.docNacionalizacao\" class=\"form-control form-control-sm\"\r\n                                type=\"text\" [disabled]=\"funcoesService.isDetail(actionForm)\" maxlength=\"28\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"atracacao\">{{'labels.atracacao' | translate}}</label>\r\n                            <input id=\"atracacao\" name=\"atracacao\" [(ngModel)]=\"service.data.atracacao\"\r\n                                class=\"form-control form-control-sm\" type=\"text\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" maxlength=\"50\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"observacoes\">{{'labels.observacoes' | translate}}</label>\r\n                            <input id=\"observacoes\" name=\"observacoes\" [(ngModel)]=\"service.data.observ\"\r\n                                class=\"form-control form-control-sm\" type=\"text\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" maxlength=\"30\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-6 col-sm-12\">\r\n                        <label for=\"obsComp\">{{'labels.obsComp' | translate}}</label>\r\n                        <textarea id=\"obsComp\" name=\"obsComp\" [(ngModel)]=\"service.data.observCompl\"\r\n                            class=\"form-control\" rows=\"3\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                            data-title=\"{{'labels.obsComp' | translate}}\"></textarea>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label class=\"required\" for=\"cadastroPlacaIdCavalo\">{{ lblPlaca1 |\r\n                                translate }}</label>\r\n                            <input type=\"text\" id=\"cadastroPlacaIdCavalo\" name=\"cadastroPlacaIdCavalo\"\r\n                                class=\"form-control form-control-sm uppercase\" required [maxlength]=\"maxLengthPlaca\"\r\n                                [(ngModel)]=\"service.data.cadastroPlacaIdCavalo\"\r\n                                [disabled]=\"funcoes.isDetail(actionForm)\" (change)=\"removerCompartimentosTipoMov()\"\r\n                                (blur)=\"validation.validaPlaca(0, true); trataVeiculo();\" [mask]=\"mascaraPlaca\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"tipoDeVeiculo\" class=\"required\">\r\n                                {{'labels.tipoDeVeiculo' | translate }}\r\n                            </label>\r\n                            <select id=\"tipoDeVeiculo\" name=\"tipoDeVeiculo\" class=\"form-control form-control-sm\"\r\n                                [(ngModel)]=\"service.data.tipoVeiculoId\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" required=\"true\"\r\n                                data-title=\"{{ 'labels.tipoVeiculo' | translate }}\" (change)=\"trataTipoVeiculo()\">\r\n                                <option value=\"\">{{ \"labels.selecione\" | translate }}</option>\r\n                                <option *ngFor=\"let t of tiposVeiculos\" value=\"{{ t.tipoVeiculoId }}\">\r\n                                    {{ t.descrTipoVeiculo }}\r\n                                </option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"renavam\">{{'labels.renavam' | translate}}</label>\r\n                            <input id=\"renavam\" name=\"renavam\" [(ngModel)]=\"service.data.renavam\"\r\n                                class=\"form-control form-control-sm\" type=\"text\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" maxlength=\"11\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-2 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"estado\" class=\"required\">{{\r\n                                \"labels.estado\" | translate\r\n                                }}</label>\r\n                            <select class=\"form-control form-control-sm\" id=\"estado\" name=\"estadoIdCavalo\"\r\n                                [(ngModel)]=\"service.data.estadoIdCavalo\" [disabled]=\"disabledEstado\" required>\r\n                                <option value=\"\">{{ 'labels.selecione' | translate }}</option>\r\n                                <option *ngFor=\"let item of estados\" value=\"{{ item.estadoId }}\">{{\r\n                                    item.estadoId\r\n                                    }}</option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"cadastroPlacaIdCarreta1\">\r\n                                {{lblPlaca2 | translate}}</label>\r\n                            <input type=\"text\" [maxlength]=\"maxLengthPlaca\" id=\"cadastroPlacaIdCarreta1\"\r\n                                name=\"cadastroPlacaIdCarreta1\" class=\"form-control form-control-sm uppercase\"\r\n                                [(ngModel)]=\"service.data.cadastroPlacaIdCarreta1\"\r\n                                [disabled]=\"funcoes.isDetail(actionForm)\" [mask]=\"mascaraPlaca\"\r\n                                (blur)=\"validation.validaPlaca(1, true)\" (change)=\"removerCompartimentosTipoMov()\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"cadastroPlacaIdCarreta2\">\r\n                                {{lblPlaca3 | translate}}</label>\r\n                            <input type=\"text\" [maxlength]=\"maxLengthPlaca\" id=\"cadastroPlacaIdCarreta2\"\r\n                                name=\"cadastroPlacaIdCarreta2\" class=\"form-control form-control-sm uppercase\"\r\n                                [(ngModel)]=\"service.data.cadastroPlacaIdCarreta2\"\r\n                                [disabled]=\"funcoes.isDetail(actionForm)\" [mask]=\"mascaraPlaca\"\r\n                                (blur)=\"validation.validaPlaca(2, true)\" (change)=\"removerCompartimentosTipoMov()\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"tipoCarregamento\"\r\n                                [class.required]=\"obrigatorioTipoCarregamento\">{{\"labels.tipoCarregamento\" | translate\r\n                                }}</label>\r\n                            <select id=\"tipoCarregamento\" name=\"tipoCarregamento\"\r\n                                [(ngModel)]=\"service.data.tipoCarregamento\" [disabled]=\"disabledTipoCarregamento\"\r\n                                [required]=\"obrigatorioTipoCarregamento\" class=\"form-control form-control-sm\">\r\n                                <option value=\"\">{{ 'labels.selecione' | translate }}</option>\r\n                                <option value=\"1\">TOP</option>\r\n                                <option value=\"2\">BOTTOM</option>\r\n                                <option value=\"3\">TOP/BOTTOM</option>\r\n                                <option value=\"4\">BOTTOM/TOP</option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-8 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"destinatarioIdTransportadora\"\r\n                                name=\"destinatarioIdTransportadora\" label=\"transportadora\"\r\n                                modalTitle=\"pesquisaTransportadora\" required=\"true\" showInscricao=\"false\"\r\n                                showCgcCpf=\"true\" [(ngModel)]=\"service.data.destinatarioIdTransportadora\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                [inSelected]=\"service.data.transportadora\" (outModel)=\"trataTransportadora($event)\"\r\n                                tipoDestinatario=\"T\" permiteInativos=\"false\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-8 col-sm-12\">\r\n                        <app-pesquisa-motorista id=\"motorista\" name=\"motorista\" label=\"motorista\"\r\n                            modalTitle=\"pesquisaMotorista\" [(ngModel)]=\"service.data.motoristaId\" [showCpf]=\"true\"\r\n                            [disabled]=\"funcoesService.isDetail(actionForm)\" [inputMotorista]=\"service.data.motorista\"\r\n                            required=\"true\" (outMotorista)=\"validation.trataMotorista($event)\">\r\n                        </app-pesquisa-motorista>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"motoristaCnh\">{{'labels.cnh' | translate }}</label>\r\n                            <input id=\"motoristaCnh\" type=\"text\" name=\"motoristaCnh\"\r\n                                class=\"form-control form-control-sm\" value=\"{{service.data?.motorista?.cnh}}\" disabled>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"motoristaCnhValidade\">{{'labels.validade' | translate }}</label>\r\n                            <input id=\"motoristaCnhValidade\" type=\"text\" name=\"motoristaCnhValidade\"\r\n                                class=\"form-control form-control-sm\"\r\n                                value=\"{{service.data?.motorista?.cnhValidade | date:'dd/MM/yyyy'}}\" disabled>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-8 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"oriCodigo\" name=\"oriCodigo\" [label]=\"lblOrigemDestino\"\r\n                                modalTitle=\"pesquisaDeTerceiro\" showInscricao=\"false\" showCgcCpf=\"true\"\r\n                                [(ngModel)]=\"service.data.oriCodigo\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                [inSelected]=\"service.data.origem\" (outModel)=\"trataOrigem($event)\"\r\n                                tipoDestinatario=\"CFOPEUSIAG\" permiteInativos=\"false\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-8 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-pesquisa-destinatario id=\"destinatarioIdClienteVenda\" name=\"destinatarioIdClienteVenda\"\r\n                                [label]=\"lblCodCliente\" modalTitle=\"pesquisaDeTerceiro\" showInscricao=\"false\"\r\n                                showCgcCpf=\"true\" [(ngModel)]=\"service.data.destinatarioIdClienteVenda\"\r\n                                [disabled]=\"disabledClienteVenda\" [inSelected]=\"service.data.clienteVenda\"\r\n                                tipoDestinatario=\"C\" permiteInativos=\"false\" (outModel)=\"trataClienteVenda($event)\">\r\n                            </app-pesquisa-destinatario>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\" *ngIf=\"service.isCarga\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"notaDeVenda\">{{'labels.notaDeVenda' | translate}}</label>\r\n                            <input id=\"notaDeVenda\" name=\"notaDeVenda\" type=\"text\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" [(ngModel)]=\"service.data.destVendNota\"\r\n                                mask=\"999999999\" class=\"form-control form-control-sm\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\" *ngIf=\"service.isDescarga\">\r\n                    <div class=\"col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <app-chave-nfe id=\"chaveDaNFE\" name=\"chaveDaNFE\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm) || disabledChaveNfe()\"\r\n                                [required]=\"requiredDadosNfe\" [docto]=\"service.data?.numeroNfe\"\r\n                                [serie]=\"service.data?.serieNfe\" [emitente]=\"service.data.clienteVenda\"\r\n                                [(ngModel)]=\"service.data.chaveNfe\" (validaChaveNfe)=\"validation.validaChaveNfe($event)\"\r\n                                (importaDanfe)=\"importaDanfe($event)\"></app-chave-nfe>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"numNfe\" [class.required]=\"requiredDadosNfe\">\r\n                                {{'labels.numNfe' | translate}}\r\n                            </label>\r\n                            <input id=\"numNfe\" name=\"numNfe\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                [(ngModel)]=\"service.data.numeroNfe\" [required]=\"requiredDadosNfe\"\r\n                                [disabled]=\"disabledDadosNf\" required maxlength=\"9\"\r\n                                data-title=\"{{'labels.numNfe' | translate}}\">\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label [class.required]=\"requiredDadosNfe\">{{'labels.serie' | translate}}</label>\r\n                            <app-combo-serie-nota id=\"serie\" name=\"serie\" flagAtivo=\"S\"\r\n                                [(ngModel)]=\"service.data.serieNfe\" [disabled]=\"disabledDadosNf\"\r\n                                [required]=\"requiredDadosNfe\" [hasItemOption]=\"false\">\r\n                            </app-combo-serie-nota>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"data\" [class.required]=\"requiredDadosNfe\">{{'labels.data' | translate}}</label>\r\n                            <app-data id=\"data\" name=\"data\" [(ngModel)]=\"service.data.dataNfe\"\r\n                                [disabled]=\"disabledDadosNf\" data-title=\"{{'labels.emissao' | translate}}\"\r\n                                [required]=\"requiredDadosNfe\" (executa)=\"validation.validarDataDocumento()\">\r\n                            </app-data>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label [class.required]=\"requiredDadosNfe\" for=\"hora\">{{'labels.hora'|translate}}</label>\r\n                            <input type=\"text\" id=\"hora\" [(ngModel)]=\"service.data.horaNfe\" name=\"hora\"\r\n                                [dropSpecialCharacters]=\"false\" [mask]=\"maskHora\" (input)=\"onHoraInput($event)\"\r\n                                class=\"form-control form-control-sm\" [disabled]=\"disabledDadosNf\"\r\n                                [required]=\"requiredDadosNfe\">\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"localTransferencia\"\r\n                                [class.required]=\"requiredLocalTransferencia\">{{'labels.localTransferencia'\r\n                                | translate}}</label>\r\n                            <app-combo-local-transferencia id=\"localTransferencia\" name=\"localTransferencia\"\r\n                                [(ngModel)]=\"service.data.localTransferenciaId\" [required]=\"requiredLocalTransferencia\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm) || !requiredLocalTransferencia\">\r\n                            </app-combo-local-transferencia>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"previsaoChegada\" [class.required]=\"requiredprevisaoChegada\">{{\r\n                                \"labels.previsaoChegada\" | translate\r\n                                }}</label>\r\n                            <select #previsaoChegadaSelect id=\"previsaoChegada\" name=\"previsaoChegada\"\r\n                                [(ngModel)]=\"service.data.dtPrevisaoChegada\" [required]=\"requiredprevisaoChegada\"\r\n                                [compareWith]=\"compararDatas\" (ngModelChange)=\"onChangePrevisaoChegada($event)\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\" class=\"form-control form-control-sm\">\r\n                                <option *ngFor=\"let data of listaPrevisoes\" [ngValue]=\"data\">\r\n                                    {{ data | date: 'dd/MM/yyyy' }}\r\n                                </option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"horario\" [class.required]=\"requiredprevisaoChegada\">{{ \"labels.horario\" |\r\n                                translate }}</label>\r\n                            <select id=\"horario\" name=\"horario\" [(ngModel)]=\"service.data.horario\"\r\n                                [required]=\"requiredprevisaoChegada\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                class=\"form-control form-control-sm\">\r\n                                <option *ngFor=\"let hora of service.listaHorarios\" [value]=\"hora\">\r\n                                    {{ hora }}\r\n                                </option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12 mt-4\">\r\n                        <div class=\"custom-control custom-checkbox\">\r\n                            <input id=\"encaixarHorario\" name=\"encaixarHorario\"\r\n                                [(ngModel)]=\"service.data.encaixarHorario\"\r\n                                (click)=\"validation.verificaPermissaoEncaixaHorario($event)\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                class=\"custom-control-input checkbox-success\" type=\"checkbox\">\r\n                            <label class=\"custom-control-label\" for=\"encaixarHorario\">{{'labels.encaixarHorario' |\r\n                                translate}}</label>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 mt-4\" *ngIf=\"disabledVerificaDisponibilidade\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <button type=\"button\" class=\"btn btn-default\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                (click)=\"onClickVerificarDisponibilidade()\">\r\n                                {{ \"labels.verificaDisponibilidade\" | translate }}\r\n                            </button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"natDaOperacao\">{{\"labels.natDaOperacao\" | translate\r\n                                }}</label>\r\n                            <app-combo-padrao name=\"natDaOperacao\" id=\"natDaOperacao\" chave=\"PtlTipoOperacaoPortologId\"\r\n                                descricao=\"Descricao\" ativo=\"true\" tabela=\"PtlTipoOperacaoPortolog\"\r\n                                [(ngModel)]=\"service.data.ptlTipoOperacaoPortologId\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-combo-padrao>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"tipoCargaPortolog\">{{\"labels.tipoCargaPortolog\" | translate\r\n                                }}</label>\r\n                            <app-combo-padrao name=\"tipoCargaPortolog\" id=\"tipoCargaPortolog\"\r\n                                chave=\"PtlTipoCargaPortologId\" descricao=\"Descricao\" ativo=\"true\"\r\n                                tabela=\"PtlTipoCargaPortolog\" [(ngModel)]=\"service.data.ptlTipoCargaPortologId\"\r\n                                (outSelected)=\"outTipoCarga($event)\" [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-combo-padrao>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"regGrupoProduto\">{{\r\n                                \"labels.regGrupoProduto\" | translate\r\n                                }}</label>\r\n                            <select class=\"form-control form-control-sm\" id=\"regGrupoProduto\" name=\"regGrupoProduto\"\r\n                                [(ngModel)]=\"service.data.ptlGrupoDeProdutosId\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                <option value=\"\">{{ 'labels.selecione' | translate}}\r\n                                </option>\r\n                                <option *ngFor=\"let item of grupoDeProdutos\" value=\"{{ item.ptlGrupoDeProdutosId }}\">{{\r\n                                    item.descrGrupoProduto }}\r\n                                </option>\r\n                            </select>\r\n                        </div>\r\n                    </div>\r\n                    <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                        <div class=\"form-group form-group-sm\">\r\n                            <label for=\"dtAtraca\">{{\"labels.dtAtraca\" | translate }}</label>\r\n                            <app-data-h-m id=\"dtAtracacao\" name=\"dtAtracacao\" [(ngModel)]=\"service.data.dtAtracacao\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                            </app-data-h-m>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row mt-2\">\r\n                    <div class=\"col-12\">\r\n                        <div class=\"form-group\">\r\n                            <button class=\"btn btn-success mr-2\" type=\"submit\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                {{ 'buttons.salvar' | translate }}\r\n                            </button>\r\n                            <button class=\"btn btn-default mr-2\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                (click)=\"onCancelar()\" type=\"button\">{{ 'buttons.cancelar' | translate }}\r\n                            </button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </form>\r\n        </div>\r\n        <div class=\"tab-pane\" id=\"tItens\">\r\n            <app-agendamento-veiculo-item [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n            </app-agendamento-veiculo-item>\r\n        </div>\r\n        <div class=\"tab-pane\" id=\"tNotas\">\r\n            <app-agendamento-veiculo-nota [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n            </app-agendamento-veiculo-nota>\r\n        </div>\r\n        <div class=\"tab-pane\" id=\"tSitAgendamento\">\r\n            <app-agendamento-veiculo-situacao [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n            </app-agendamento-veiculo-situacao>\r\n        </div>\r\n        <div class=\"tab-pane\" id=\"tCompartimentos\">\r\n            <app-agendamento-veiculo-compartimentos [dados]=\"service.data.agendamentoVeiculoCompartimentos\"\r\n                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n            </app-agendamento-veiculo-compartimentos>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\r\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\r\n<app-propriedades></app-propriedades>\r\n<app-agendamento-veiculo-seleciona-planejamento #childAgendamentoVeiculoSelecionaPlanejamentoComponent\r\n    (dataResult)=\"outSelecionaPlanejamento($event)\"></app-agendamento-veiculo-seleciona-planejamento>\r\n<app-agendamento-veiculo-pesquisa\r\n    (outSelected)=\"outPesquisaCarregarAgendamento($event)\"></app-agendamento-veiculo-pesquisa>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-index/agendamento-veiculo-index.component.html":
/*!************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-index/agendamento-veiculo-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\"\r\n    [itemData]=\"data.webStoPlanejaVeiculoId\" [sisFormularioId]=\"constantes.sisFormularioId\">\r\n</app-menu-command-bar>\r\n\r\n<div class=\"section-comand-bar\">\r\n    <table id=\"dtAgendamentoVeiculo\" class=\"table table-striped table-bordered table-hover nowrap table-sm\"></table>\r\n</div>\r\n\r\n<app-propriedades></app-propriedades>\r\n<app-liberar-acesso-supervisor></app-liberar-acesso-supervisor>\r\n<app-permissoes-rotina [constantes]=\"constantes\"></app-permissoes-rotina>\r\n<app-agendamento-veiculo-filter (filtrar)=\"executarFiltro()\">\r\n</app-agendamento-veiculo-filter>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-item/agendamento-veiculo-item.component.html":
/*!**********************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-item/agendamento-veiculo-item.component.html ***!
  \**********************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div *ngIf=\"!showAdd\">\r\n    <div class=\"container-buttons\">\r\n        <div class=\"btn-group\">\r\n            <app-menu-button title=\"{{ 'buttons.novo' | translate }}\" [icon]=\"'icon-plus'\" (click)=\"create()\"\r\n                [disabled]=\"disabled\">\r\n            </app-menu-button>\r\n            <app-menu-button title=\"{{ 'buttons.visualizar' | translate }}\" [icon]=\"'icon-eye'\" (click)=\"detail()\"\r\n                [disabled]=\"funcoesService.showButtons.detail(actionForm, dataAux.webStoPlanejaVeiculoItemId)\">\r\n            </app-menu-button>\r\n            <app-menu-button title=\"{{ 'buttons.editar' | translate }}\" [icon]=\"'icon-pencil'\" (click)=\"edit()\"\r\n                [disabled]=\"disabled || funcoesService.showButtons.edit(actionForm, dataAux.webStoPlanejaVeiculoItemId)\">\r\n            </app-menu-button>\r\n            <app-menu-button title=\"{{ 'buttons.excluir' | translate }}\" [icon]=\"'icon-close'\" (click)=\"remove()\"\r\n                [disabled]=\"disabled || funcoesService.showButtons.remove(actionForm, dataAux.webStoPlanejaVeiculoItemId)\">\r\n            </app-menu-button>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-12 mt-4\">\r\n            <table class=\"table table-striped table-bordered table-hover rownowrap form-control-sm\">\r\n                <thead>\r\n                    <tr>\r\n                        <th>{{ \"labels.material\" | translate }}</th>\r\n                        <th>{{ \"labels.produto\" | translate }}</th>\r\n                        <th>{{ \"labels.quantid\" | translate }}</th>\r\n                        <th>{{ \"labels.unidade\" | translate }}</th>\r\n                    </tr>\r\n                </thead>\r\n                <tbody>\r\n                    <tr *ngFor=\"let c of (service.data.agendamentoVeiculoItems | removeExcluidos)\" class=\"clickable\"\r\n                        [ngClass]=\"{ info: c === dataAux }\" (click)=\"dataAux = c\">\r\n                        <td>{{ c.materialId }}</td>\r\n                        <td>{{ c.produto }}</td>\r\n                        <td>{{ c.quantid | formatCurrency: 0 }}</td>\r\n                        <td>{{ c.descrUnidade }}</td>\r\n                    </tr>\r\n                    <tr *ngIf=\"!hasDados\">\r\n                        <th colspan=\"4\">\r\n                            {{ \"messages.nenhumRegistroEncontrado\" | translate }}\r\n                        </th>\r\n                    </tr>\r\n                </tbody>\r\n            </table>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<div *ngIf=\"showAdd\">\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-6 container-buttons\">\r\n            <div class=\"btn-group\">\r\n                <app-menu-button title=\"{{ 'buttons.editar' | translate }}\" [icon]=\"'fa fa-edit'\" (click)=\"edit()\"\r\n                    [disabled]=\"disabled || funcoesService.showButtons.edit(actionForm, data.webStoPlanejaVeiculoItemId)\">\r\n                </app-menu-button>\r\n                <app-menu-button title=\"{{ 'buttons.voltar' | translate }}\" [icon]=\"'fa fa-arrow-left'\"\r\n                    (click)=\"back()\"></app-menu-button>\r\n            </div>\r\n        </div>\r\n        <div class=\"col-lg-6\">\r\n            <app-form-legenda></app-form-legenda>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"clearfix\">&nbsp;</div>\r\n\r\n    <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n        <div class=\"row\">\r\n            <div class=\"col-12\">\r\n                <div class=\"card\">\r\n                    <div class=\"card-body widget-body\">\r\n                        <app-validacoes></app-validacoes>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"nPlanejamento\"\r\n                                        [class.required]=\"service.requiredRegPlanejCarga\">{{'labels.nPlanejamento' |\r\n                                        translate}}</label>\r\n                                    <div class=\"input-group\">\r\n                                        <input id=\"nPlanejamento\" name=\"nPlanejamento\" [(ngModel)]=\"data.regPlanejCarga\"\r\n                                            class=\"form-control form-control-sm\" type=\"text\"\r\n                                            [required]=\"service.requiredRegPlanejCarga\"\r\n                                            [disabled]=\"!funcoesService.isCreate(actionForm)\">\r\n                                        <div class=\"input-group-prepend\">\r\n                                            <button type=\"button\" class=\"input-group-text\" data-toggle=\"modal\"\r\n                                                [disabled]=\"!funcoesService.isCreate(actionForm)\" (click)=\"opnModal();\">\r\n                                                <i class=\"fa fa-search\"></i>\r\n                                            </button>\r\n                                        </div>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <app-pesquisa-material id=\"materialIdItens\" name=\"materialId\"\r\n                                        (outModel)=\"trataMaterial($event)\" [(ngModel)]=\"data.materialId\"\r\n                                        [inSelected]=\"data.material\" modalTitle=\"pesquisaDeProduto\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                        required=\"true\" label=\"produto\">\r\n                                    </app-pesquisa-material>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-3 col-md-8 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"quantidade\">{{ \"labels.quantidade\" |\r\n                                        translate }}</label>\r\n                                    <div class=\"input-group\">\r\n                                        <input type=\"text\" id=\"quantidade\" name=\"quantidade\" [(ngModel)]=\"data.quantid\"\r\n                                            class=\"form-control form-control-sm\"\r\n                                            [disabled]=\"funcoesService.isDetail(actionForm)\" currencyMask\r\n                                            [options]=\"{ prefix: '', thousands: '.', decimal: ',', precision: 0 }\"\r\n                                            (blur)=\"onQuantidBlur()\" />\r\n                                        <span class=\"input-group-btn d-flex align-items-center\">\r\n                                            &nbsp;&nbsp;<label>{{lblUnidade}}</label>\r\n                                        </span>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\" *ngIf=\"showCamposPortolog\">\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"duv\"> {{ 'labels.duv' | translate }}\r\n                                    </label>\r\n                                    <input type=\"text\" class=\"form-control-sm form-control\" id=\"duv\" name=\"duv\"\r\n                                        maxlength=\"20\" [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                        [(ngModel)]=\"data.duv\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"manifestoCarga\"> {{ 'labels.manifestoCarga' |\r\n                                        translate }}\r\n                                    </label>\r\n                                    <input type=\"text\" class=\"form-control-sm form-control\" id=\"manifestoCarga\"\r\n                                        name=\"manifestoCarga\" maxlength=\"20\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                        [(ngModel)]=\"data.manifestoCarga\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"conhecimentoEmbarque\"> {{\r\n                                        'labels.conhecimentoEmbarque' | translate }}\r\n                                    </label>\r\n                                    <input type=\"text\" class=\"form-control-sm form-control\" id=\"conhecimentoEmbarque\"\r\n                                        name=\"conhecimentoEmbarque\" maxlength=\"20\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\"\r\n                                        [(ngModel)]=\"data.conhecimentoEmbarque\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"notaFiscal\"> {{ 'labels.notaFiscal' | translate }}\r\n                                    </label>\r\n                                    <input id=\"NotaFiscalPortolog\" name=\"NotaFiscalPortolog\" maxlength=\"9\"\r\n                                        mask=\"999999999\" [(ngModel)]=\"data.notaFiscalPortolog\"\r\n                                        class=\"form-control form-control-sm\" type=\"text\"\r\n                                        data-title=\"{{'labels.notaFiscal' | translate}}\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"form-group\">\r\n                            <button class=\"btn btn-success\" type=\"submit\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                {{ \"buttons.salvar\" | translate }}\r\n                            </button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </form>\r\n</div>\r\n\r\n<app-agendamento-veiculo-seleciona-planejamento\r\n    (dataResult)=\"outSelecionaPlanejamentoItem($event)\"></app-agendamento-veiculo-seleciona-planejamento>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-nota/agendamento-veiculo-nota.component.html":
/*!**********************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-nota/agendamento-veiculo-nota.component.html ***!
  \**********************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div *ngIf=\"!showAdd\">\r\n    <div class=\"container-buttons\">\r\n        <div class=\"btn-group\">\r\n            <app-menu-button title=\"{{ 'buttons.novo' | translate }}\" [icon]=\"'icon-plus'\" (click)=\"create()\"\r\n                [disabled]=\"disabled\">\r\n            </app-menu-button>\r\n            <app-menu-button title=\"{{ 'buttons.visualizar' | translate }}\" [icon]=\"'icon-eye'\" (click)=\"detail()\"\r\n                [disabled]=\"funcoesService.showButtons.detail(actionForm, dataAux.webStoPlanejaVeiculoNotaItemId)\">\r\n            </app-menu-button>\r\n            <app-menu-button title=\"{{ 'buttons.editar' | translate }}\" [icon]=\"'icon-pencil'\" (click)=\"edit()\"\r\n                [disabled]=\"disabled || funcoesService.showButtons.edit(actionForm, dataAux.webStoPlanejaVeiculoNotaItemId)\">\r\n            </app-menu-button>\r\n            <app-menu-button title=\"{{ 'buttons.excluir' | translate }}\" [icon]=\"'icon-close'\" (click)=\"remove()\"\r\n                [disabled]=\"disabled || funcoesService.showButtons.remove(actionForm, dataAux.webStoPlanejaVeiculoNotaItemId)\">\r\n            </app-menu-button>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-12 mt-4\">\r\n            <table class=\"table table-striped table-bordered table-hover rownowrap form-control-sm\">\r\n                <thead>\r\n                    <tr>\r\n                        <th>{{ \"labels.chaveNFE\" | translate }}</th>\r\n                        <th>{{ \"labels.nrNotaFiscal\" | translate }}</th>\r\n                        <th>{{ \"labels.serie\" | translate }}</th>\r\n                        <th>{{ \"labels.dataEmissao\" | translate }}</th>\r\n                        <th>{{ \"labels.unidade\" | translate }}</th>\r\n                        <th>{{ \"labels.quantidade\" | translate }}</th>\r\n                        <th>{{ \"labels.pesoNF\" | translate }}</th>\r\n                        <th>{{ \"labels.valorNF\" | translate }}</th>\r\n                        <th>{{ \"labels.cfop\" | translate }}</th>\r\n                    </tr>\r\n                </thead>\r\n                <tbody>\r\n                    <tr *ngFor=\"let c of (service.data.agendamentoVeiculoNotas | removeExcluidos)\" class=\"clickable\"\r\n                        [ngClass]=\"{ info: c === dataAux }\" (click)=\"dataAux = c\">\r\n                        <td>{{ c.chaveNfe }}</td>\r\n                        <td>{{ c.notaFiscalId }}</td>\r\n                        <td>{{ c.serieId }}</td>\r\n                        <td>{{ c.dtEmissao | date:'dd/MM/yyyy HH:mm:ss' }}</td>\r\n                        <td>{{ c.unidadeId }}</td>\r\n                        <td>{{ c.quantidade | formatCurrency: 0 }}</td>\r\n                        <td>{{ c.pesoDoc | formatCurrency: 0 }}</td>\r\n                        <td>{{ c.vlItem | formatCurrency: 2 }}</td>\r\n                        <td>{{ c.cfop }}</td>\r\n                    </tr>\r\n                    <tr *ngIf=\"!hasDados\">\r\n                        <th colspan=\"9\">\r\n                            {{ \"messages.nenhumRegistroEncontrado\" | translate }}\r\n                        </th>\r\n                    </tr>\r\n                </tbody>\r\n            </table>\r\n        </div>\r\n    </div>\r\n</div>\r\n\r\n<div *ngIf=\"showAdd\">\r\n    <div class=\"row\">\r\n        <div class=\"col-lg-6 container-buttons\">\r\n            <div class=\"btn-group\">\r\n                <app-menu-button title=\"{{ 'buttons.editar' | translate }}\" [icon]=\"'fa fa-edit'\" (click)=\"edit()\"\r\n                    [disabled]=\"disabled || funcoesService.showButtons.edit(actionForm, data.webStoPlanejaVeiculoNotaItemId)\">\r\n                </app-menu-button>\r\n                <app-menu-button title=\"{{ 'buttons.voltar' | translate }}\" [icon]=\"'fa fa-arrow-left'\"\r\n                    (click)=\"back()\"></app-menu-button>\r\n            </div>\r\n        </div>\r\n        <div class=\"col-lg-6\">\r\n            <app-form-legenda></app-form-legenda>\r\n        </div>\r\n    </div>\r\n\r\n    <div class=\"clearfix\">&nbsp;</div>\r\n\r\n    <form class=\"form\" #f=\"ngForm\" (ngSubmit)=\"onSubmit(f)\">\r\n        <div class=\"row\">\r\n            <div class=\"col-12\">\r\n                <div class=\"card\">\r\n                    <div class=\"card-body widget-body\">\r\n                        <app-validacoes formErrorId=\"msgNota\"></app-validacoes>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-md-6\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <app-chave-nfe id=\"chaveDaNFE\" name=\"chaveDaNFE\"\r\n                                        [disabled]=\"funcoesService.isDetail(actionForm) || disabledChaveNfe()\"\r\n                                        [docto]=\"data?.notaFiscalId\" [serie]=\"data?.serieId\" [emitente]=\"emitente\"\r\n                                        [(ngModel)]=\"data.chaveNfe\" (validaChaveNfe)=\"validaChaveNfe($event)\"\r\n                                        (importaDanfe)=\"importaDanfe($event)\"></app-chave-nfe>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"nrNotaFiscal\">{{\"labels.nrNotaFiscal\" |\r\n                                        translate}}</label>\r\n                                    <input type=\"text\" id=\"nrNotaFiscal\" name=\"nrNotaFiscal\"\r\n                                        [(ngModel)]=\"data.notaFiscalId\" maxlength=\"9\"\r\n                                        (keypress)=\"funcoesService.apenasNumeros($event)\"\r\n                                        class=\"form-control form-control-sm text-right\" [disabled]=\"disabledDadosNf\" />\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"serie\">{{ \"labels.serie\" |\r\n                                        translate\r\n                                        }}</label>\r\n                                    <app-combo-serie-nota id=\"serie\" name=\"serie\" [flagAtivo]=\"'S'\"\r\n                                        [(ngModel)]=\"data.serieId\" [disabled]=\"disabledDadosNf\">\r\n                                    </app-combo-serie-nota>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"dataEmissao\">{{ \"labels.dataEmissao\" | translate\r\n                                        }}</label>\r\n                                    <app-data-h-m-s id=\"dataEmissao\" name=\"dataEmissao\" [(ngModel)]=\"data.dtEmissao\"\r\n                                        [disabled]=\"disabledDadosNf\">\r\n                                    </app-data-h-m-s>\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"unidade\">{{ 'labels.unidade' |\r\n                                        translate}}</label>\r\n                                    <select id=\"unidade\" [(ngModel)]=\"data.unidadeId\"\r\n                                        class=\"form-control form-control-sm\" name=\"unidade\"\r\n                                        data-title=\"{{ 'labels.unidade' | translate }}\" [disabled]=\"disabledDadosNf\">\r\n                                        <option value=\"\">{{ \"labels.selecione\" | translate }}</option>\r\n                                        <option *ngFor=\"let t of unidades\" value=\"{{ t.unidadeId }}\">\r\n                                            {{ t.descricao }}\r\n                                        </option>\r\n                                    </select>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"row\">\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"quantidade\">{{ \"labels.quantidade\" | translate}}</label>\r\n                                    <input id=\"quantidade\" name=\"quantidade\" [(ngModel)]=\"data.quantidade\"\r\n                                        [disabled]=\"disabledDadosNf\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                        currencyMask [options]=\"funcoesService.optionCurrency(0)\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"pesoNF\">{{'labels.pesoNF' | translate}}</label>\r\n                                    <input id=\"pesoNF\" name=\"pesoNF\" [(ngModel)]=\"data.pesoDoc\"\r\n                                        [disabled]=\"disabledDadosNf\" class=\"form-control form-control-sm\" type=\"text\"\r\n                                        currencyMask [options]=\"funcoesService.optionCurrency(0)\">\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"valorNF\">{{\"labels.valorNF\" |\r\n                                        translate}}</label>\r\n                                    <input type=\"text\" id=\"valorNF\" name=\"valorNF\" [(ngModel)]=\"data.vlItem\"\r\n                                        class=\"form-control form-control-sm valor\" [disabled]=\"disabledDadosNf\"\r\n                                        currencyMask [options]=\"funcoesService.optionCurrency(2)\" />\r\n                                </div>\r\n                            </div>\r\n                            <div class=\"col-lg-3 col-md-6 col-sm-12\">\r\n                                <div class=\"form-group form-group-sm\">\r\n                                    <label for=\"cfop\">{{\"labels.cfop\" |\r\n                                        translate}}</label>\r\n                                    <app-pesquisa-natureza id=\"cfop\" name=\"cfop\" flagVeiculo=\"S\" [(ngModel)]=\"data.cfop\"\r\n                                        [disabled]=\"disabledDadosNf\">\r\n                                    </app-pesquisa-natureza>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"form-group\">\r\n                            <button class=\"btn btn-success\" type=\"submit\"\r\n                                [disabled]=\"funcoesService.isDetail(actionForm)\">\r\n                                {{ \"buttons.salvar\" | translate }}\r\n                            </button>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </form>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-pesquisa/agendamento-veiculo-pesquisa.component.html":
/*!******************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-pesquisa/agendamento-veiculo-pesquisa.component.html ***!
  \******************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"modal fade\" id=\"modalPesquisaCarregarAgendamento\" tabindex=\"-1\" role=\"dialog\" data-backdrop=\"static\">\r\n    <div class=\"modal-dialog modal-lg\">\r\n        <div class=\"modal-content\">\r\n            <div class=\"modal-header\">\r\n                <h5 class=\"modal-title\">{{ 'titles.pesquisa' | translate }}</h5>\r\n            </div>\r\n            <div class=\"modal-body\">\r\n                <div class=\"panel-body\">\r\n                    <div class=\"row\">\r\n                        <div class=\"col-lg-9 mr-2\">\r\n                            <div class=\"form-group\">\r\n                                <div class=\"input-group\">\r\n                                    <div class=\"input-group-prepend\">\r\n                                        <button class=\"btn btn-secondary btn-sm dropdown-toggle\" type=\"button\"\r\n                                            data-toggle=\"dropdown\" aria-haspopup=\"true\" aria-expanded=\"false\">{{\r\n                                            labelFiltro }}\r\n                                        </button>\r\n                                        <div class=\"dropdown-menu\">\r\n                                            <a class=\"dropdown-item\" (click)=\"selectFiltro('material')\">{{\r\n                                                'labels.produto' | translate }}</a>\r\n                                            <a class=\"dropdown-item\" (click)=\"selectFiltro('descrMater')\">{{\r\n                                                'labels.descricao' | translate }}</a>\r\n                                            <a class=\"dropdown-item\" (click)=\"selectFiltro('fantasia')\">{{\r\n                                                'labels.fantasia' | translate }}</a>\r\n                                        </div>\r\n                                    </div>\r\n                                    <input type=\"text\" minlength=\"4\" required class=\"form-control form-control-sm\"\r\n                                        aria-label=\"...\" [(ngModel)]=\"filtro.pesquisa\" #buscaId=\"ngModel\">\r\n                                    <div class=\"input-group-prepend\">\r\n                                        <button type=\"button\" class=\"input-group-text\" (click)=\"onSubmit()\"\r\n                                            data-loading-text=\"Consultando...\">\r\n                                            <i class=\"fa fa-search\"></i>\r\n                                        </button>\r\n                                    </div>\r\n                                </div>\r\n                            </div>\r\n                        </div>\r\n                        <div class=\"col-lg-2\">\r\n                            <div class=\"custom-control custom-checkbox\">\r\n                                <input id=\"contido\" name=\"contido\" [(ngModel)]=\"filtro.contido\"\r\n                                    class=\"custom-control-input checkbox-success\" type=\"checkbox\">\r\n                                <label class=\"custom-control-label\" for=\"contido\">{{'labels.contido' |\r\n                                    translate}}</label>\r\n                            </div>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n                <div class=\"row\">\r\n                    <div class=\"col-lg-12\">\r\n                        <div class=\"table-overflow\">\r\n                            <table class=\"table table-striped table-bordered table-hover rownowrap form-control-sm\">\r\n                                <thead>\r\n                                    <tr>\r\n                                        <th class=\"text-center\">{{ 'labels.regPlaneja' | translate }}</th>\r\n                                        <th class=\"text-center\">{{ 'labels.dtPrevisaoChegada' | translate }}</th>\r\n                                        <th class=\"text-center\">{{ 'labels.placaCavalo' | translate }}</th>\r\n                                        <th class=\"text-center\">{{ 'labels.nomeTransportadora' | translate }}</th>\r\n                                        <th class=\"text-center\">{{ 'labels.nomeMotorista' | translate }}</th>\r\n                                    </tr>\r\n                                </thead>\r\n                                <tbody>\r\n                                    <tr *ngFor=\"let c of dados\" class=\"clickable\"\r\n                                        [ngClass]=\"{ 'info' : c.regPlaneja == dataAux.regPlaneja }\"\r\n                                        (click)=\"(dataAux = c)\">\r\n                                        <td class=\"text-center\">{{c.regPlaneja}}</td>\r\n                                        <td class=\"text-center\">{{c.dtPrevisaoChegada| date:'dd/MM/yyyy'}}</td>\r\n                                        <td class=\"text-center\">{{c.placaCavalo}}</td>\r\n                                        <td class=\"text-center\">{{c.razaoTransp}}</td>\r\n                                        <td class=\"text-center\">{{c.nomeMotorista}}</td>\r\n                                    </tr>\r\n                                    <tr *ngIf=\"!hasDados\">\r\n                                        <th colspan=\"5\">\r\n                                            {{'messages.nenhumRegistroEncontrado' | translate }}\r\n                                        </th>\r\n                                    </tr>\r\n                                </tbody>\r\n                            </table>\r\n                        </div>\r\n                    </div>\r\n                </div>\r\n            </div>\r\n            <div class=\"modal-footer\">\r\n                <div class=\"col-lg-12 text-right\">\r\n                    <button type=\"button\" class=\"btn btn-success btn-sm mr-2\" (click)=\"select()\">{{ 'buttons.selecionar'\r\n                        | translate}}</button>\r\n                    <button type=\"button\" class=\"btn btn-default btn-sm\" (click)=\"closeModal()\">{{\r\n                        'buttons.sair' | translate }}</button>\r\n                </div>\r\n            </div>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

/***/ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-situacao/agendamento-veiculo-situacao.component.html":
/*!******************************************************************************************************************************************************************!*\
  !*** ./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-situacao/agendamento-veiculo-situacao.component.html ***!
  \******************************************************************************************************************************************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony default export */ __webpack_exports__["default"] = ("<div class=\"row\">\r\n    <div class=\"col-lg-12 mt-4\">\r\n        <table class=\"table table-striped table-bordered table-hover rownowrap form-control-sm\">\r\n            <thead>\r\n                <tr>\r\n                    <th>{{ \"labels.data\" | translate }}</th>\r\n                    <th>{{ \"labels.situacao\" | translate }}</th>\r\n                </tr>\r\n            </thead>\r\n            <tbody>\r\n                <tr *ngFor=\"let c of (service.data.agendamentoVeiculoSituacoes | removeExcluidos)\" class=\"clickable\"\r\n                    [ngClass]=\"{ info: c === dataAux }\" (click)=\"dataAux = c\">\r\n                    <td>{{ c.dtOcorrencia | date:'dd/MM/yyyy HH:mm:ss' }}</td>\r\n                    <td>{{ c.situacao }}</td>\r\n                </tr>\r\n                <tr *ngIf=\"!hasDados\">\r\n                    <th colspan=\"2\">\r\n                        {{ \"messages.nenhumRegistroEncontrado\" | translate }}\r\n                    </th>\r\n                </tr>\r\n            </tbody>\r\n        </table>\r\n    </div>\r\n</div>\r\n<div class=\"row\">\r\n    <div class=\"col-lg-12\">\r\n        <div class=\"form-group form-group-sm\">\r\n            <label for=\"observacoes\">{{'labels.observacoes' |\r\n                translate}}</label>\r\n            <textarea class=\"form-control\" rows=\"10\" maxlength=\"250\" readonly>{{ dataAux.obsMemo }}</textarea>\r\n        </div>\r\n    </div>\r\n</div>");

/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-compartimentos/agendamento-veiculo-compartimentos.component.ts":
/*!**************************************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-compartimentos/agendamento-veiculo-compartimentos.component.ts ***!
  \**************************************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoCompartimentosComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoCompartimentosComponent", function() { return AgendamentoVeiculoCompartimentosComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../agendamento-veiculo.service */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/pages/cadastro/material/material.model */ "./src/app/pages/cadastro/material/material.model.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.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 __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};








var AgendamentoVeiculoCompartimentosComponent = /** @class */ (function () {
    function AgendamentoVeiculoCompartimentosComponent(service, message, funcoesService, materialService) {
        this.service = service;
        this.message = message;
        this.funcoesService = funcoesService;
        this.materialService = materialService;
        this.dados = [];
        this.resumo = [];
        this.erros = [];
        this.mascara = new app_config_enumerables__WEBPACK_IMPORTED_MODULE_1__["Mascaras"]();
    }
    AgendamentoVeiculoCompartimentosComponent.prototype.ngOnInit = function () { };
    AgendamentoVeiculoCompartimentosComponent.prototype.ngOnChanges = function (changes) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        this.resumo = [];
                        if (!(changes['dados'] && changes['dados'].currentValue && changes['dados'].currentValue.length > 0)) return [3 /*break*/, 2];
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_7__["ArrayUtilsStaticService"].any(this.dados)) {
                            this.regPlanejCarga = this.dados[0].regPlanejCarga;
                        }
                        return [4 /*yield*/, this.preencherMateriais()];
                    case 1:
                        _a.sent();
                        this.montarResumo();
                        _a.label = 2;
                    case 2: return [2 /*return*/];
                }
            });
        });
    };
    AgendamentoVeiculoCompartimentosComponent.prototype.preencherMateriais = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _i, _a, d, _b;
            return __generator(this, function (_c) {
                switch (_c.label) {
                    case 0:
                        _i = 0, _a = this.dados;
                        _c.label = 1;
                    case 1:
                        if (!(_i < _a.length)) return [3 /*break*/, 4];
                        d = _a[_i];
                        if (!(d.materialId && !d.material)) return [3 /*break*/, 3];
                        _b = d;
                        return [4 /*yield*/, this.materialService.getById(d.materialId).toPromise()];
                    case 2:
                        _b.material = _c.sent();
                        _c.label = 3;
                    case 3:
                        _i++;
                        return [3 /*break*/, 1];
                    case 4: return [2 /*return*/];
                }
            });
        });
    };
    AgendamentoVeiculoCompartimentosComponent.prototype.trataMaterial = function (materialSelecionado, index) {
        var material = !!materialSelecionado ? materialSelecionado : new app_pages_cadastro_material_material_model__WEBPACK_IMPORTED_MODULE_6__["Material"]();
        this.dados[index].material = material;
        this.dados[index].materialId = material.materialId;
    };
    AgendamentoVeiculoCompartimentosComponent.prototype.isVolumeRequired = function (d) {
        return !!d.materialId;
    };
    AgendamentoVeiculoCompartimentosComponent.prototype.isMaterialRequired = function (d) {
        return !!d.volume && d.volume > 0;
    };
    Object.defineProperty(AgendamentoVeiculoCompartimentosComponent.prototype, "volumeTotalResumo", {
        get: function () {
            return this.resumo.reduce(function (acc, r) { return acc + r.volume; }, 0);
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoCompartimentosComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var _this = this;
            return __generator(this, function (_a) {
                if (!this.validarCampos()) {
                    this.erros.forEach(function (m) { return _this.message.warning('titles.agendamentoVeiculo', m); });
                    return [2 /*return*/];
                }
                this.montarResumo();
                this.service.carregarHorariosDisponiveis();
                return [2 /*return*/];
            });
        });
    };
    AgendamentoVeiculoCompartimentosComponent.prototype.validarCampos = function () {
        var valido = true;
        this.erros = [];
        for (var i = 0; i < this.dados.length; i++) {
            var d = this.dados[i];
            var capacidadeInformada = !!d.volume && d.volume > 0;
            var materialInformado = !!d.materialId;
            if (materialInformado && !capacidadeInformada) {
                var msg = this.message.getTranslates("messages", "capacidadeObrigatoriaComMaterial").replace("{{linha}}", (i + 1).toString());
                this.erros.push(msg);
                valido = false;
            }
            if (capacidadeInformada && !materialInformado) {
                var msg = this.message.getTranslates("messages", "materialObrigatorioComCapacidade").replace("{{linha}}", (i + 1).toString());
                this.erros.push(msg);
                valido = false;
            }
        }
        return valido;
    };
    AgendamentoVeiculoCompartimentosComponent.prototype.montarResumo = function () {
        var mapa = new Map();
        for (var _i = 0, _a = this.dados; _i < _a.length; _i++) {
            var d = _a[_i];
            if (d.materialId && d.volume > 0) {
                var id = d.materialId;
                var volume = Number(d.volume);
                var nomeProduto = d.material && d.material.fantasia ? d.material.fantasia : "Produto " + id;
                if (mapa.has(id)) {
                    mapa.get(id).volume += volume;
                }
                else {
                    mapa.set(id, {
                        materialId: id,
                        nome: nomeProduto,
                        volume: volume
                    });
                }
            }
        }
        this.resumo = Array.from(mapa.values());
    };
    AgendamentoVeiculoCompartimentosComponent.ctorParameters = function () { return [
        { type: _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_2__["AgendamentoVeiculoService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_5__["MaterialService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Array)
    ], AgendamentoVeiculoCompartimentosComponent.prototype, "dados", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Boolean)
    ], AgendamentoVeiculoCompartimentosComponent.prototype, "disabled", void 0);
    AgendamentoVeiculoCompartimentosComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: 'app-agendamento-veiculo-compartimentos',
            template: __importDefault(__webpack_require__(/*! raw-loader!./agendamento-veiculo-compartimentos.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-compartimentos/agendamento-veiculo-compartimentos.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_2__["AgendamentoVeiculoService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_5__["MaterialService"]])
    ], AgendamentoVeiculoCompartimentosComponent);
    return AgendamentoVeiculoCompartimentosComponent;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-filter/agendamento-veiculo-filter.component.ts":
/*!**********************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-filter/agendamento-veiculo-filter.component.ts ***!
  \**********************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoFilterComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoFilterComponent", function() { return AgendamentoVeiculoFilterComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
/* harmony import */ var _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../agendamento-veiculo.service */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.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 __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 AgendamentoVeiculoFilterComponent = /** @class */ (function () {
    function AgendamentoVeiculoFilterComponent(messageService, service, funcoesService) {
        this.messageService = messageService;
        this.service = service;
        this.funcoesService = funcoesService;
        this.filtrar = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
    }
    AgendamentoVeiculoFilterComponent.prototype.ngOnInit = function () {
    };
    AgendamentoVeiculoFilterComponent.prototype.onSubmit = function (form) {
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_3__["EventEmitterService"].get('formError').emit(form);
        if (form.invalid) {
            return;
        }
        if (!this.validaData(true)) {
            return;
        }
        this.filtrar.emit();
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ModalUtilsStaticService"].closeModal('agendamento-veiculo-filter-dialog');
    };
    AgendamentoVeiculoFilterComponent.prototype.outMaterial = function (material) {
        if (!material)
            return;
        this.service.filter.material = material;
    };
    AgendamentoVeiculoFilterComponent.prototype.validaData = function (all) {
        if (all === void 0) { all = false; }
        if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_5__["DateTimeUtilsStaticService"].menorA(this.service.filter.dataF, this.service.filter.dataI, ['H', 'M', 'S'])) {
            this.messageService.warning("titles.agendamentoVeiculo", "messages.periodoDeMenorQueAte");
            return false;
        }
        if (all) {
            if (!this.service.filter.dataF || !this.service.filter.dataI || (this.service.filter.dataF.toString() === "Invalid Date") || (this.service.filter.dataI.toString() === "Invalid Date")) {
                this.messageService.warning("titles.agendamentoVeiculo", "messages.periodoNaoPreenchidoOuInvalido");
                return false;
            }
        }
        return true;
    };
    AgendamentoVeiculoFilterComponent.prototype.trataCliente = function (cliente) {
        this.service.filter.cliente = cliente;
    };
    AgendamentoVeiculoFilterComponent.ctorParameters = function () { return [
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"] },
        { type: _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_6__["AgendamentoVeiculoService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], AgendamentoVeiculoFilterComponent.prototype, "filtrar", void 0);
    AgendamentoVeiculoFilterComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-agendamento-veiculo-filter",
            template: __importDefault(__webpack_require__(/*! raw-loader!./agendamento-veiculo-filter.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-filter/agendamento-veiculo-filter.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"],
            _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_6__["AgendamentoVeiculoService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"]])
    ], AgendamentoVeiculoFilterComponent);
    return AgendamentoVeiculoFilterComponent;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-form.component.ts":
/*!******************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-form.component.ts ***!
  \******************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoFormComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoFormComponent", function() { return AgendamentoVeiculoFormComponent; });
/* 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 _pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../../../pages/cadastro/cadastro-placa/cadastro-placa.service */ "./src/app/pages/cadastro/cadastro-placa/cadastro-placa.service.ts");
/* harmony import */ var _pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../../../pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.ts");
/* harmony import */ var _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.ts");
/* harmony import */ var _pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../pages/cadastro/motorista/motorista.service */ "./src/app/pages/cadastro/motorista/motorista.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_7__ = __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_8__ = __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_9__ = __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_10__ = __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_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../../../shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./../../../../pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.ts");
/* harmony import */ var _login_login_service__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./../../../login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../agendamento-veiculo.constants */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.constants.ts");
/* harmony import */ var _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../agendamento-veiculo.service */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.ts");
/* harmony import */ var _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../agendamento-veiculo.model */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.model.ts");
/* harmony import */ var _agendamento_veiculo_form_validation__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./agendamento-veiculo-form.validation */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-form.validation.ts");
/* harmony import */ var app_pages_cadastro_tipo_operacao_veiculo_tipo_operacao_veiculo_service__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! app/pages/cadastro/tipo-operacao-veiculo/tipo-operacao-veiculo.service */ "./src/app/pages/cadastro/tipo-operacao-veiculo/tipo-operacao-veiculo.service.ts");
/* harmony import */ var _entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../../entrada-veiculo/entrada-veiculo.service */ "./src/app/pages/veiculo/entrada-veiculo/entrada-veiculo.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! app/pages/cadastro/tipo-veiculo/tipo-veiculo.service */ "./src/app/pages/cadastro/tipo-veiculo/tipo-veiculo.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_23__ = __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 app_pages_cadastro_estados_estados_service__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! app/pages/cadastro/estados/estados.service */ "./src/app/pages/cadastro/estados/estados.service.ts");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! app/shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var _planejamento_carga_descarga_planejamento_carga_descarga_service__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../../planejamento-carga-descarga/planejamento-carga-descarga.service */ "./src/app/pages/veiculo/planejamento-carga-descarga/planejamento-carga-descarga.service.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var _agendamento_veiculo_seleciona_planejamento_agendamento_veiculo_seleciona_planejamento_component__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../agendamento-veiculo-seleciona-planejamento/agendamento-veiculo-seleciona-planejamento.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-seleciona-planejamento/agendamento-veiculo-seleciona-planejamento.component.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 __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};






























var AgendamentoVeiculoFormComponent = /** @class */ (function (_super) {
    __extends(AgendamentoVeiculoFormComponent, _super);
    function AgendamentoVeiculoFormComponent(router, activatedRoute, message, service, permissoesUtils, configuracao, funcoes, loginService, cadastroPlacaService, materialService, motoristaService, destinatarioService, tipoOperacaoVeiculoService, entradaVeiculoService, serviceTipoVeiculo, estadosService, planejamentoCargaDescarga) {
        var _this = _super.call(this, new _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_15__["AgendamentoVeiculoConstants"](), funcoes) || this;
        _this.router = router;
        _this.activatedRoute = activatedRoute;
        _this.message = message;
        _this.service = service;
        _this.permissoesUtils = permissoesUtils;
        _this.configuracao = configuracao;
        _this.funcoes = funcoes;
        _this.loginService = loginService;
        _this.cadastroPlacaService = cadastroPlacaService;
        _this.materialService = materialService;
        _this.motoristaService = motoristaService;
        _this.destinatarioService = destinatarioService;
        _this.tipoOperacaoVeiculoService = tipoOperacaoVeiculoService;
        _this.entradaVeiculoService = entradaVeiculoService;
        _this.serviceTipoVeiculo = serviceTipoVeiculo;
        _this.estadosService = estadosService;
        _this.planejamentoCargaDescarga = planejamentoCargaDescarga;
        _this.mensagens = [];
        _this.constantes = new _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_15__["AgendamentoVeiculoConstants"]();
        _this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_2__["Mascaras"]();
        _this.lblDescSituacao = "";
        _this.lblOrigemDestino = "";
        _this.lblCodCliente = "";
        _this.lblDestVendNota = "";
        _this.lblPlaca1 = "";
        _this.lblPlaca2 = "";
        _this.lblPlaca3 = "";
        _this.placaCadastrada = false;
        _this.flagObrigaDocAgendamento = false;
        _this.listaPrevisoes = [];
        _this.grupoDeProdutos = [];
        _this.disabledGrupoDeProduto = false;
        _this.compartimentosReiniciados = false;
        _this.maskHora = '00:00';
        _this.compartimentosOriginais = [];
        _this.target = _this.funcoes.getTargetLocation();
        _this.loadConfig = function () {
            if (_this.configuracao.isLoadConfig()) {
                _this.service.configsPTL.vrfPlanejDescarga = _this.configuracao.boolean("PTL", "VrfPlanejDescarga");
                _this.service.configsPTL.vrfPlanejCarga = _this.configuracao.boolean("PTL", "VrfPlanejCarga");
                _this.service.configsUNI.utilizDivCliAgend = _this.configuracao.boolean("UNI", "UtilizDivCliAgend");
                _this.service.configsCTV.obrRequisicaoCarga = _this.configuracao.boolean("CTV", "ObrRequisicaoCarga");
                _this.service.configsBAL.maskPlaca = _this.configuracao.lerConfig("BAL", "MaskPlaca");
                _this.service.configsBAL.maskTrem = _this.configuracao.lerConfig("BAL", "MaskTrem");
                _this.service.configsPTL.obrigaTipoCarreg = _this.configuracao.boolean("PTL", "ObrigaTipoCarreg");
                _this.service.configsPTL.solDestMerc = _this.configuracao.boolean("PTL", "SolDestMerc");
                _this.service.configsPTL.agQtDiasAgendamento = _this.configuracao.number("PTL", "AgQtDiasAgendamento");
                _this.service.configsPTL.gradeAgendamento = _this.configuracao.boolean("PTL", "GradeAgendamento");
                _this.service.configsPTL.cargaCompartimentada = _this.configuracao.boolean("PTL", "CargaCompartimentada");
                _this.service.configsPTL.tipoAgCapacQuant = _this.configuracao.lerConfig("PTL", "TipoAgCapacQuant");
                _this.service.configsPTL.agCapacLitrosQuilos = _this.configuracao.lerConfig("PTL", "AgCapacLitrosQuilos");
                _this.service.configsPTL.integracaoPortolog = _this.configuracao.boolean("PTL", "IntegracaoPortolog");
                _this.service.configsPTL.agUtilizarTipofrete = _this.configuracao.boolean("PTL", "AgUtilizarTipofrete");
                _this.service.configsPTL.obrTipoFrete = _this.configuracao.boolean("PTL", "ObrTipoFrete");
            }
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        _this.validation = new _agendamento_veiculo_form_validation__WEBPACK_IMPORTED_MODULE_18__["AgendamentoVeiculoFormValidation"](message, funcoes, tipoOperacaoVeiculoService, entradaVeiculoService, service, motoristaService, permissoesUtils);
        return _this;
    }
    AgendamentoVeiculoFormComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.showButton = true;
        this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, this.permissoesUtils.getLibRotina(this.actionForm), function () { return __awaiter(_this, void 0, void 0, function () {
            var id;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        id = this.activatedRoute.snapshot.paramMap.get("id");
                        Object(rxjs__WEBPACK_IMPORTED_MODULE_25__["forkJoin"])([
                            this.estadosService.get(),
                        ]).subscribe(function (resp) {
                            _this.estados = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["ArrayUtilsStaticService"].any(resp[0]) ? resp[0].filter(function (val) { return val.sitReg != "E"; }) : [];
                        });
                        return [4 /*yield*/, this.getTipoVeiculo()];
                    case 1:
                        _a.sent();
                        if (id) {
                            this.preEditOrDetail(+id);
                        }
                        else {
                            this.preCreate();
                        }
                        return [2 /*return*/];
                }
            });
        }); }, function () {
            _this.permissoesUtils.back();
        });
    };
    AgendamentoVeiculoFormComponent.prototype.preCreate = function () {
        this.service.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_17__["AgendamentoVeiculo"]();
        this.maskHora = null;
        this.descSituacao();
        this.trataModal();
        this.trataTipoMov();
        this.carregaComboPrevisaoChegada();
        this.atualizarHorarioDaDataSelecionada();
        this.showComponents = true;
    };
    AgendamentoVeiculoFormComponent.prototype.preEditOrDetail = function (id) {
        this.carregaDadosAgendamento(id);
    };
    AgendamentoVeiculoFormComponent.prototype.carregaDadosAgendamento = function (id) {
        return __awaiter(this, void 0, void 0, function () {
            var resp, dataHora, horas, minutos;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.service.getAgendamentoVeiculoById({ webStoPlanejaVeiculoId: id }).toPromise()];
                    case 1:
                        resp = _a.sent();
                        this.service.data = resp;
                        this.service.data.tipoCarregamento = resp.tipoCarregamento === 0 ? "" : resp.tipoCarregamento;
                        if (resp.horaNfe) {
                            dataHora = new Date(resp.horaNfe);
                            horas = dataHora.getUTCHours().toString().padStart(2, '0');
                            minutos = dataHora.getUTCMinutes().toString().padStart(2, '0');
                            this.service.data.horaNfe = horas + ":" + minutos;
                            this.maskHora = '00:00';
                        }
                        else {
                            this.service.data.horaNfe = "";
                            this.maskHora = null;
                        }
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["ArrayUtilsStaticService"].any(this.service.data.agendamentoVeiculoCompartimentos)) {
                            this.compartimentosOriginais = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["ArrayUtilsStaticService"].clone(this.service.data.agendamentoVeiculoCompartimentos);
                        }
                        if (this.service.configsPTL.cargaCompartimentada && this.service.isCarga) {
                            this.carregarDadosCompartimentos();
                        }
                        Object(rxjs__WEBPACK_IMPORTED_MODULE_25__["forkJoin"])({
                            destinatario: this.destinatarioService.getById(resp.destinatarioIdCliente),
                            motorista: this.motoristaService.getMotoristaId(resp.motoristaId),
                            origem: this.service.isCarga ? this.destinatarioService.getById(resp.destCodigo) : this.destinatarioService.getById(resp.oriCodigo),
                            transportadora: this.destinatarioService.getById(resp.destinatarioIdTransportadora),
                            clienteVenda: this.destinatarioService.getById(resp.destinatarioIdClienteVenda)
                        }).subscribe(function (_a) {
                            var destinatario = _a.destinatario, motorista = _a.motorista, origem = _a.origem, transportadora = _a.transportadora, clienteVenda = _a.clienteVenda;
                            _this.loadCliente(destinatario);
                            _this.loadMotorista(motorista);
                            _this.loadOrigem(origem);
                            _this.loadTransportadora(transportadora);
                            _this.loadClienteVenda(clienteVenda);
                        });
                        this.descSituacao();
                        this.trataModal();
                        this.trataTipoMov();
                        this.carregaComboPrevisaoChegada();
                        this.atualizarHorarioDaDataSelecionada();
                        this.service.carregarHorariosDisponiveis();
                        this.showComponents = true;
                        return [2 /*return*/];
                }
            });
        });
    };
    AgendamentoVeiculoFormComponent.prototype.preSave = function () {
        var horaNfe = this.service.data.horaNfe;
        if (typeof horaNfe === 'string' && horaNfe.includes(':')) {
            var _a = horaNfe.split(':').map(Number), hora = _a[0], minuto = _a[1];
            var dataComHora = new Date();
            dataComHora.setHours(hora, minuto, 0, 0);
            this.service.data.horaNfe = dataComHora;
        }
    };
    AgendamentoVeiculoFormComponent.prototype.onSubmit = function (form, create) {
        if (create === void 0) { create = false; }
        return __awaiter(this, void 0, void 0, function () {
            var validationResult, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get("msgDados").emit(form);
                        if (form.invalid) {
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        this.preSave();
                        this.service.data.logRotina = "Agendamento Veículos";
                        return [4 /*yield*/, this.service._save(this.service.data).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (!validationResult.isValid) {
                            mensagens = this.message.validationResult(validationResult);
                            mensagens.forEach(function (m) { return _this.message.warning("titles.agendamentoVeiculo", m); });
                            return [2 /*return*/];
                        }
                        else {
                            this.message.saveSuccess("titles.agendamentoVeiculo");
                            this.back();
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    AgendamentoVeiculoFormComponent.prototype.detail = function () {
        this.router.navigate([this.target + "/veiculo/agendamentoVeiculo", "detail", this.service.data.webStoPlanejaVeiculoId]);
    };
    AgendamentoVeiculoFormComponent.prototype.edit = function () {
        if (!this.service.podeEditar(this.service.data))
            return;
        this.router.navigate([this.target + "/veiculo/agendamentoVeiculo", "edit", this.service.data.webStoPlanejaVeiculoId]);
    };
    AgendamentoVeiculoFormComponent.prototype.back = function () {
        this.funcoesService.desabilitarFiltro();
        this.router.navigate([this.target + "/veiculo/agendamentoVeiculo"]);
    };
    AgendamentoVeiculoFormComponent.prototype.onCancelar = function () {
        this.service.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_17__["AgendamentoVeiculo"]();
        this.back();
    };
    AgendamentoVeiculoFormComponent.prototype.updateShowButtom = function (event) {
        this.showButton = event;
    };
    AgendamentoVeiculoFormComponent.prototype.trataCliente = function (cliente) {
        if (!cliente)
            return;
        this.service.data.cliente = cliente;
    };
    AgendamentoVeiculoFormComponent.prototype.trataTransportadora = function (transportadora) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (!transportadora)
                    return [2 /*return*/];
                this.service.data.transportadora = transportadora;
                this.service.data.tipoPessoa = transportadora.tipoPessoa;
                return [2 /*return*/];
            });
        });
    };
    AgendamentoVeiculoFormComponent.prototype.trataOrigem = function (origem) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (!origem)
                    return [2 /*return*/];
                this.service.data.origem = origem;
                return [2 /*return*/];
            });
        });
    };
    AgendamentoVeiculoFormComponent.prototype.trataClienteVenda = function (clienteVenda) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (!clienteVenda)
                    return [2 /*return*/];
                this.service.data.origem = clienteVenda;
                return [2 /*return*/];
            });
        });
    };
    AgendamentoVeiculoFormComponent.prototype.loadCliente = function (data) {
        if (!data)
            return;
        this.service.data.destinatarioIdCliente = data.destinatarioId;
        this.service.data.cliente = data;
        this.flagObrigaDocAgendamento = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(data.flagObrigaDocAgendamento);
    };
    AgendamentoVeiculoFormComponent.prototype.loadOrigem = function (data) {
        if (!data)
            return;
        this.service.data.oriCodigo = data.destinatarioId;
        this.service.data.origem = data;
    };
    AgendamentoVeiculoFormComponent.prototype.loadTransportadora = function (data) {
        if (!data)
            return;
        this.service.data.destinatarioIdTransportadora = data.destinatarioId;
        this.service.data.transportadora = data;
    };
    AgendamentoVeiculoFormComponent.prototype.loadClienteVenda = function (data) {
        if (!data)
            return;
        this.service.data.destinatarioIdClienteVenda = data.destinatarioId;
        this.service.data.clienteVenda = data;
    };
    AgendamentoVeiculoFormComponent.prototype.loadMotorista = function (data) {
        if (!data)
            return;
        this.service.data.motoristaId = data.motoristaId;
        this.service.data.motorista = data;
    };
    AgendamentoVeiculoFormComponent.prototype.opnModal = function () {
        var _this = this;
        if (_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["StringUtilsStaticService"].isNotEmpty(this.service.data.tipoMov)) {
            this.service.getSelecionaPlanejamento({ tipoMov: this.service.data.tipoMov }).subscribe(function (resp) {
                console.log(resp);
                _this.childAgendamentoVeiculoSelecionaPlanejamentoComponent.objectSelect(resp);
                app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_28__["ModalUtilsStaticService"].openModal("modalSelecionaPlanejamento");
            });
        }
    };
    AgendamentoVeiculoFormComponent.prototype.descSituacao = function () {
        var map = {
            A: "Autorizado",
            E: "Aguardando Envio",
            G: "Ag. Autorização",
            R: "Recusado",
        };
        this.lblDescSituacao = map[this.service.data.sitReg] || "";
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "mostraDescSituacao", {
        get: function () {
            return _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["StringUtilsStaticService"].isNotEmpty(this.lblDescSituacao);
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.prototype.trataTipoMov = function () {
        if (this.service.isCarga) {
            this.lblOrigemDestino = "destino";
            this.lblCodCliente = "clienteDeVenda";
            this.lblDestVendNota = "notaDeVenda";
        }
        else if (this.service.isDescarga) {
            this.lblOrigemDestino = "origem";
            this.lblCodCliente = "emitente";
            this.lblDestVendNota = "chaveDaNFE";
        }
    };
    AgendamentoVeiculoFormComponent.prototype.limparDataPrevisao = function () {
        if (this.service.configsUNI.utilizDivCliAgend) {
            // Limpar os itens da listagem da combo de Horários.
        }
    };
    AgendamentoVeiculoFormComponent.prototype.checkLocalTrasferencia = function (event) {
        if (!event.target.checked)
            this.service.data.localTransferenciaId = null;
    };
    AgendamentoVeiculoFormComponent.prototype.trataModal = function () {
        if (this.service.isFerroviario) {
            this.lblPlaca1 = "labels.placa1";
            this.lblPlaca2 = "labels.placa2";
            this.lblPlaca3 = "labels.placa3";
        }
        else if (this.service.isRodoviario) {
            this.lblPlaca1 = "labels.placaCavalo";
            this.lblPlaca2 = "labels.cadastroPlacaIdCarreta1";
            this.lblPlaca3 = "labels.cadastroPlacaIdCarreta2";
        }
    };
    AgendamentoVeiculoFormComponent.prototype.trataTipoFrete = function (tipoFrete) {
        this.limparDataPrevisao();
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "requiredRequisicao", {
        get: function () {
            return this.service.configsCTV.obrRequisicaoCarga;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "mascaraPlaca", {
        get: function () {
            if (this.service.isFerroviario) {
                return this.mascara.mapMascaraCutomizada(this.service.configsBAL.maskTrem);
            }
            else if (this.service.isRodoviario) {
                return this.mascara.mapMascaraCutomizada(this.service.configsBAL.maskPlaca);
            }
            else {
                return '';
            }
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "maxLengthPlaca", {
        get: function () {
            return !!this.mascaraPlaca ? this.mascaraPlaca.length : 18;
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.prototype.trataVeiculo = function () {
        return __awaiter(this, void 0, void 0, function () {
            var placa;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["StringUtilsStaticService"].isNotEmpty(this.service.data.cadastroPlacaIdCavalo)) return [3 /*break*/, 2];
                        return [4 /*yield*/, this.cadastroPlacaService.getById(this.service.data.cadastroPlacaIdCavalo).toPromise()];
                    case 1:
                        placa = _a.sent();
                        this.placaCadastrada = !!placa;
                        if (!!placa) {
                            this.service.data.estadoIdCavalo = placa.estadoId;
                        }
                        _a.label = 2;
                    case 2: return [2 /*return*/];
                }
            });
        });
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "tiposVeiculos", {
        get: function () {
            if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["ArrayUtilsStaticService"].any(this.tiposVeiculosT))
                return [];
            return this.tiposVeiculosT.filter(function (f) { return f.flagVagao !== "S"; });
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.prototype.getTipoVeiculo = function () {
        return __awaiter(this, void 0, void 0, function () {
            var _a;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        _a = this;
                        return [4 /*yield*/, this.serviceTipoVeiculo.get(false, false).toPromise()];
                    case 1:
                        _a.tiposVeiculosT = _b.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["ArrayUtilsStaticService"].any(this.tiposVeiculos)) {
                            this.tiposVeiculosT = this.tiposVeiculosT.filter(function (val) { return val.flagAtivo === "S" && val.sitReg !== 'E'; });
                            this.tiposVeiculosT.forEach(function (item) {
                                if (_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["StringUtilsStaticService"].isNotEmpty(item.descrTipoVeiculoCompleta))
                                    item.descrTipoVeiculo + " - " + item.descrTipoVeiculoCompleta;
                                else
                                    "" + item.descrTipoVeiculo;
                            });
                        }
                        else {
                            this.tiposVeiculosT = [];
                        }
                        return [2 /*return*/];
                }
            });
        });
    };
    AgendamentoVeiculoFormComponent.prototype.trataTipoVeiculo = function () {
        var _this = this;
        if (!!this.service.data.tipoVeiculoId) {
            var tv = this.tiposVeiculosT.find(function (c) { return c.tipoVeiculoId === app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["NumberUtilsStaticService"].toNumber(_this.service.data.tipoVeiculoId); });
            if (!!tv) {
                this.service.data.tipoVeiculo = tv;
                if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["NumberUtilsStaticService"].toNumber(tv.qtdePlacas) === 1) {
                    this.service.data.cadastroPlacaIdCarreta1 = "";
                    this.service.data.cadastroPlacaIdCarreta2 = "";
                }
                else if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["NumberUtilsStaticService"].toNumber(tv.qtdePlacas) === 2) {
                    this.service.data.cadastroPlacaIdCarreta2 = "";
                }
            }
        }
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "disabledEstado", {
        get: function () {
            var result = this.funcoes.isDetail(this.actionForm);
            if (result)
                return true;
            if (this.placaCadastrada)
                return true;
            return result;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "disabledTipoCarregamento", {
        get: function () {
            if (this.funcoes.isDetail(this.actionForm))
                return true;
            if (!this.service.data)
                return true;
            return this.service.isDescarga;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "obrigatorioTipoCarregamento", {
        get: function () {
            var obrigaTipoCarreg = this.service.configsPTL.obrigaTipoCarreg;
            var placa1Preenchida = _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["StringUtilsStaticService"].isNotEmpty(this.service.data.cadastroPlacaIdCarreta1);
            var placa2Preenchida = _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["StringUtilsStaticService"].isNotEmpty(this.service.data.cadastroPlacaIdCarreta2);
            return obrigaTipoCarreg && (placa1Preenchida || placa2Preenchida);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "obrigatorioOriCodigo", {
        get: function () {
            return this.service.configsPTL.solDestMerc;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "requiredDadosNfe", {
        get: function () {
            return app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.flagObrigaDocAgendamento) &&
                this.service.isDescarga &&
                app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["NumberUtilsStaticService"].isPositive(this.service.data.destinatarioIdClienteVenda) &&
                app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["NumberUtilsStaticService"].isPositive(this.service.data.destinatarioIdCliente) &&
                (this.service.data.destinatarioIdCliente !== this.service.data.destinatarioIdClienteVenda) &&
                app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["ArrayUtilsStaticService"].any(this.service.data.agendamentoVeiculoNotas);
        },
        enumerable: true,
        configurable: true
    });
    /*Desabilitar os campos:
      @NumeroNfe
      @SerieNfe
      @DataNfe
      @HoraNfe */
    AgendamentoVeiculoFormComponent.prototype.disabledChaveNfe = function () {
        if (this.funcoes.isDetail(this.actionForm))
            return true;
        return this.service.isCarga;
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "disabledDadosNf", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (this.service.isCarga)
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.prototype.importaDanfe = function (e) {
        if (!!e) {
            if (!e.validationResult.isValid) {
                this.mensagens = this.message.validationResult(e.validationResult);
                _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get("msgDados").emit(this.mensagens);
                this.funcoesService.backToTop();
                return;
            }
            this.service.data.nfeAuto = true;
            this.service.data.serieNfe = e.serie;
            this.service.data.numeroNfe = e.numero;
            this.service.data.dataNfe = e.dtEmissao;
        }
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "requiredLocalTransferencia", {
        get: function () {
            return app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_26__["BooleanUtilsStaticService"].toBoolean(this.service.data.flagTransferencia);
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.prototype.carregaComboPrevisaoChegada = function () {
        var _this = this;
        var dataAtual = new Date();
        dataAtual.setHours(0, 0, 0, 0);
        if (this.funcoesService.isCreate(this.actionForm)) {
            for (var i = 0; i < this.service.configsPTL.agQtDiasAgendamento; i++) {
                var data = new Date(dataAtual);
                data.setDate(dataAtual.getDate() + i);
                this.listaPrevisoes.push(data);
            }
        }
        else {
            for (var i = 0; i < this.service.configsPTL.agQtDiasAgendamento; i++) {
                var data = new Date(dataAtual);
                data.setDate(dataAtual.getDate() + i);
                this.listaPrevisoes.push(data);
            }
            if (!(this.service.data.dtPrevisaoChegada instanceof Date)) {
                this.service.data.dtPrevisaoChegada = new Date(this.service.data.dtPrevisaoChegada);
            }
            var existe = this.listaPrevisoes.some(function (d) {
                return _this.compararDatas(d, _this.service.data.dtPrevisaoChegada);
            });
            if (!existe) {
                this.listaPrevisoes.push(this.service.data.dtPrevisaoChegada);
            }
            this.listaPrevisoes.sort(function (a, b) { return a.getTime() - b.getTime(); });
        }
    };
    AgendamentoVeiculoFormComponent.prototype.compararDatas = function (d1, d2) {
        if (!d1 || !d2)
            return d1 === d2;
        var date1 = new Date(d1);
        var date2 = new Date(d2);
        return (date1.getFullYear() === date2.getFullYear() &&
            date1.getMonth() === date2.getMonth() &&
            date1.getDate() === date2.getDate());
    };
    AgendamentoVeiculoFormComponent.prototype.onChangePrevisaoChegada = function (data) {
        var dataSelecionada = new Date(data);
        if (dataSelecionada instanceof Date && !isNaN(dataSelecionada.getTime())) {
            this.service.data.dtPrevisaoChegada = dataSelecionada;
            this.service.carregarHorariosDisponiveis();
        }
        else {
            this.service.listaHorarios = [];
            this.service.data.horario = null;
        }
    };
    AgendamentoVeiculoFormComponent.prototype.atualizarHorarioDaDataSelecionada = function () {
        var data = this.service.data.dtPrevisaoChegada;
        if (data instanceof Date && !isNaN(data.getTime())) {
            var horas = data.getHours();
            var minutos = data.getMinutes();
            if (horas !== 0 || minutos !== 0) {
                var horarioFormatado = horas.toString().padStart(2, '0') + ":" + minutos.toString().padStart(2, '0');
                this.service.listaHorarios = [horarioFormatado];
                this.service.data.horario = horarioFormatado;
            }
            else {
                this.service.listaHorarios = [];
                this.service.data.horario = null;
            }
        }
        else {
            this.service.listaHorarios = [];
            this.service.data.horario = null;
        }
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "disabledVerificaDisponibilidade", {
        get: function () {
            if (this.funcoes.isDetail(this.actionForm))
                return true;
            return this.service.configsPTL.gradeAgendamento;
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.prototype.valDisponibilidade = function () {
        if (!this.validation.valVerificarDisponibilidade()) {
            return false;
        }
        if (!this.validation.valUnidadeProdutos()) {
            return false;
        }
        return true;
    };
    AgendamentoVeiculoFormComponent.prototype.onClickVerificarDisponibilidade = function () {
        if (this.valDisponibilidade()) {
            this.previsaoChegadaSelect.nativeElement.focus();
        }
    };
    AgendamentoVeiculoFormComponent.prototype.outTipoCarga = function (tipoCarga) {
        var _this = this;
        var tipoCargaSelecionado = tipoCarga.chave;
        this.planejamentoCargaDescarga.getPtlGrupoDeProdutos({ tipoCarga: app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["NumberUtilsStaticService"].toNumber(tipoCargaSelecionado) }).subscribe(function (resp) {
            _this.grupoDeProdutos = resp;
            _this.disabledGrupoDeProduto = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["ArrayUtilsStaticService"].any(resp);
        });
    };
    AgendamentoVeiculoFormComponent.prototype.buscaPlanejamento = function () {
        var _this = this;
        this.service.executarRotinaRegPlaneja({ webStoPlanejaVeiculoId: this.service.data.webStoPlanejaVeiculoId }).subscribe(function (resp) {
            _this.mensagens = _this.message.validationResult(resp.validationResult);
            if (!resp.validationResult.isValid) {
                _shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_8__["EventEmitterService"].get("backError").emit(_this.mensagens);
                _this.funcoes.backToTop();
            }
            else {
                _this.service.data.webStoPlanejaVeiculoId = resp.planejCargaId;
                _this.service.data.tipoMov = resp.tipoMov;
                _this.service.data.pedido15 = resp.pedidoVenda;
                _this.service.data.destinatarioIdClienteVenda = resp.destinatarioIdClienteVenda;
                _this.temSaldo = resp.temSaldo;
                _this.service.data.kilos = resp.kilos;
                _this.service.data.litros = resp.litros;
                _this.service.data.loteId = resp.loteId;
            }
        });
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "disabledClienteVenda", {
        get: function () {
            if (this.funcoes.isDetail(this.actionForm))
                return true;
            if (!this.service.data)
                return true;
            return app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["NumberUtilsStaticService"].isPositive(this.service.data.destinatarioIdClienteVenda) && this.temSaldo;
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.prototype.outSelecionaPlanejamento = function (planejamento) {
        this.service.data.webStoPlanejaVeiculoId = planejamento.regPlanej;
        this.service.data.loteId = planejamento.lote;
    };
    AgendamentoVeiculoFormComponent.prototype.onClickCarregarAgendamento = function () {
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_28__["ModalUtilsStaticService"].openModal("modalPesquisaCarregarAgendamento");
    };
    AgendamentoVeiculoFormComponent.prototype.outPesquisaCarregarAgendamento = function (data) {
        var regPlaneja = data.regPlaneja;
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_23__["NumberUtilsStaticService"].isPositive(regPlaneja)) {
            this.carregaDadosAgendamento(regPlaneja);
        }
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "showCarregarAgendamento", {
        get: function () {
            return this.service.configsUNI.utilizDivCliAgend && this.service.configsPTL.cargaCompartimentada;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "habilitaBtnCarregarAgendamento", {
        get: function () {
            return this.funcoesService.isCreate(this.actionForm);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "showAbaItens", {
        get: function () {
            return !this.service.configsPTL.cargaCompartimentada || this.service.isDescarga;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "showAbaCompartimentos", {
        get: function () {
            return this.service.configsPTL.cargaCompartimentada && this.service.isCarga;
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.prototype.removerCompartimentosTipoMov = function () {
        if (this.service.data.tipoMov === "C") {
            this.service.data.agendamentoVeiculoCompartimentos = [];
            this.compartimentosReiniciados = true;
        }
    };
    AgendamentoVeiculoFormComponent.prototype.carregarDadosCompartimentos = function () {
        var _this = this;
        this.service.carregarVolumesCompartimentos({
            cadastroPlacaIdCavalo: this.service.data.cadastroPlacaIdCavalo,
            cadastroPlacaIdCarreta1: this.service.data.cadastroPlacaIdCarreta1,
            cadastroPlacaIdCarreta2: this.service.data.cadastroPlacaIdCarreta2
        }).subscribe(function (resp) {
            if (!_this.compartimentosReiniciados) {
                resp.forEach(function (r) {
                    var compartimento = _this.compartimentosOriginais.find(function (c) {
                        return c.placa === r.placa && c.numCompartimento === r.numCompartimento;
                    });
                    if (compartimento) {
                        r.volume = compartimento.volume;
                        r.materialId = compartimento.materialId;
                    }
                });
            }
            var idPlanejamento = _this.service.data.webStoPlanejaVeiculoId;
            resp.forEach(function (r, index) {
                r.webStoPlanejaVeiculoId = idPlanejamento;
                r.webStoPlanejaVeiculoPlacaItemId = index + 1;
                r.regPlanejCarga = _this.service.data.regPlanejCarga;
            });
            _this.service.data.agendamentoVeiculoCompartimentos = resp;
        });
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "requiredprevisaoChegada", {
        get: function () {
            return this.service.configsPTL.cargaCompartimentada && this.service.isCarga && app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_21__["ArrayUtilsStaticService"].any(this.service.data.agendamentoVeiculoCompartimentos);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "requiredTipoFrete", {
        get: function () {
            return this.service.configsPTL.agUtilizarTipofrete || this.service.configsPTL.obrTipoFrete;
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.prototype.onHoraInput = function (event) {
        var input = event.target.value;
        if (!this.maskHora && input && input.length > 0) {
            this.maskHora = '00:00';
        }
    };
    Object.defineProperty(AgendamentoVeiculoFormComponent.prototype, "condicionaisOptions", {
        get: function () {
            return [
                {
                    operadorLogico: "AND",
                    campo: "FlagAtivo",
                    operador: "=",
                    valor: "S"
                }
            ];
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoFormComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"] },
        { type: _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_16__["AgendamentoVeiculoService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"] },
        { type: _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__["ConfiguracaoFacade"] },
        { type: _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_14__["LoginService"] },
        { type: _pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_3__["CadastroPlacaService"] },
        { type: _pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_13__["MaterialService"] },
        { type: _pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_6__["MotoristaService"] },
        { type: _pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_4__["DestinatarioService"] },
        { type: app_pages_cadastro_tipo_operacao_veiculo_tipo_operacao_veiculo_service__WEBPACK_IMPORTED_MODULE_19__["TipoOperacaoVeiculoService"] },
        { type: _entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_20__["EntradaVeiculoService"] },
        { type: app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_22__["TipoVeiculoService"] },
        { type: app_pages_cadastro_estados_estados_service__WEBPACK_IMPORTED_MODULE_24__["EstadosService"] },
        { type: _planejamento_carga_descarga_planejamento_carga_descarga_service__WEBPACK_IMPORTED_MODULE_27__["PlanejamentoCargaDescargaService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"])('previsaoChegadaSelect', { static: false }),
        __metadata("design:type", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ElementRef"])
    ], AgendamentoVeiculoFormComponent.prototype, "previsaoChegadaSelect", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"])(_agendamento_veiculo_seleciona_planejamento_agendamento_veiculo_seleciona_planejamento_component__WEBPACK_IMPORTED_MODULE_29__["AgendamentoVeiculoSelecionaPlanejamentoComponent"], { static: false }),
        __metadata("design:type", _agendamento_veiculo_seleciona_planejamento_agendamento_veiculo_seleciona_planejamento_component__WEBPACK_IMPORTED_MODULE_29__["AgendamentoVeiculoSelecionaPlanejamentoComponent"])
    ], AgendamentoVeiculoFormComponent.prototype, "childAgendamentoVeiculoSelecionaPlanejamentoComponent", void 0);
    AgendamentoVeiculoFormComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-agendamento-veiculo-form",
            template: __importDefault(__webpack_require__(/*! raw-loader!./agendamento-veiculo-form.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-form.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _angular_router__WEBPACK_IMPORTED_MODULE_1__["ActivatedRoute"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_12__["MessageService"],
            _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_16__["AgendamentoVeiculoService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_10__["PermissoesUtilsService"],
            _shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_5__["ConfiguracaoFacade"],
            _shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_9__["FuncoesService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_14__["LoginService"],
            _pages_cadastro_cadastro_placa_cadastro_placa_service__WEBPACK_IMPORTED_MODULE_3__["CadastroPlacaService"],
            _pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_13__["MaterialService"],
            _pages_cadastro_motorista_motorista_service__WEBPACK_IMPORTED_MODULE_6__["MotoristaService"],
            _pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_4__["DestinatarioService"],
            app_pages_cadastro_tipo_operacao_veiculo_tipo_operacao_veiculo_service__WEBPACK_IMPORTED_MODULE_19__["TipoOperacaoVeiculoService"],
            _entrada_veiculo_entrada_veiculo_service__WEBPACK_IMPORTED_MODULE_20__["EntradaVeiculoService"],
            app_pages_cadastro_tipo_veiculo_tipo_veiculo_service__WEBPACK_IMPORTED_MODULE_22__["TipoVeiculoService"],
            app_pages_cadastro_estados_estados_service__WEBPACK_IMPORTED_MODULE_24__["EstadosService"],
            _planejamento_carga_descarga_planejamento_carga_descarga_service__WEBPACK_IMPORTED_MODULE_27__["PlanejamentoCargaDescargaService"]])
    ], AgendamentoVeiculoFormComponent);
    return AgendamentoVeiculoFormComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_7__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-form.validation.ts":
/*!*******************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-form.validation.ts ***!
  \*******************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoFormValidation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoFormValidation", function() { return AgendamentoVeiculoFormValidation; });
/* harmony import */ var _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/number-utils/number-utils.static.service */ "./src/app/shared/services/funcoes/number-utils/number-utils.static.service.ts");
/* harmony import */ var _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./../../../../shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ "./node_modules/rxjs/_esm5/index.js");
/* harmony import */ var app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/funcoes/boolean-utils/boolean-utils.static.service */ "./src/app/shared/services/funcoes/boolean-utils/boolean-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! moment */ "./node_modules/moment/moment.js");
/* harmony import */ var moment__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(moment__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../agendamento-veiculo.constants */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.constants.ts");
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};







var AgendamentoVeiculoFormValidation = /** @class */ (function () {
    function AgendamentoVeiculoFormValidation(message, funcoes, tipoOperacaoVeiculoService, entradaVeiculoService, service, motoristaService, permissoesUtils) {
        this.message = message;
        this.funcoes = funcoes;
        this.tipoOperacaoVeiculoService = tipoOperacaoVeiculoService;
        this.entradaVeiculoService = entradaVeiculoService;
        this.service = service;
        this.motoristaService = motoristaService;
        this.permissoesUtils = permissoesUtils;
        this.errosDocMotorista = [
            { tipoDoc: 'CNH', isValid: true, message: "", data: undefined, question: false, modal: true },
            { tipoDoc: 'RESTRICAO', isValid: true, message: "", data: undefined, question: true, modal: false },
        ];
        this.constantes = new _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_6__["AgendamentoVeiculoConstants"]();
    }
    AgendamentoVeiculoFormValidation.prototype.validaPlaca = function (ordem, showError) {
        var _this = this;
        if (showError === void 0) { showError = false; }
        var placas = [
            _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].removeCaracteres(this.service.data.cadastroPlacaIdCavalo),
            _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].removeCaracteres(this.service.data.cadastroPlacaIdCarreta1),
            _shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].removeCaracteres(this.service.data.cadastroPlacaIdCarreta2)
        ];
        var rs = [];
        if (_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_1__["StringUtilsStaticService"].isEmpty(placas[ordem])) {
            return rs;
        }
        else {
            this.entradaVeiculoService.validaPlaca(0, this.service.data.modal, placas[+ordem], +ordem, _shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].toNumber(this.service.data.motoristaId)).subscribe(function (resp) { return __awaiter(_this, void 0, void 0, function () {
                var isValid, messages, ret_1, messages_1;
                var _this = this;
                return __generator(this, function (_a) {
                    switch (_a.label) {
                        case 0:
                            isValid = resp.isValid;
                            messages = this.message.validationResult(resp);
                            if (!!isValid) return [3 /*break*/, 1];
                            messages.forEach(function (e) { return rs.push({ "isValid": isValid, "message": messages[0] }); });
                            if (showError) {
                                this.message.warning("titles.agendamentoVeiculo", messages[0]);
                            }
                            if (+ordem === 0)
                                this.service.data.cadastroPlacaIdCavalo = "";
                            if (+ordem === 1)
                                this.service.data.cadastroPlacaIdCarreta1 = "";
                            if (+ordem === 2)
                                this.service.data.cadastroPlacaIdCarreta2 = "";
                            return [3 /*break*/, 3];
                        case 1: return [4 /*yield*/, this.entradaVeiculoService.verificaSePlacaTemEVAberta({
                                regControle: 0,
                                placa1: +ordem === 0 ? placas[0] : "",
                                placa2: +ordem === 1 ? placas[1] : "",
                                placa3: +ordem === 2 ? placas[2] : "",
                                placa4: +ordem === 3 ? placas[3] : "",
                                continua: "",
                                msg: ""
                            }).toPromise()];
                        case 2:
                            ret_1 = _a.sent();
                            if (!!resp.validationResult) {
                                messages_1 = this.message.validationResult(resp);
                                if (!isValid) {
                                    messages_1.forEach(function (e) { return rs.push({ "isValid": false, "message": e }); });
                                    if (showError) {
                                        messages_1.forEach(function (e) { return _this.message.warning("titles.agendamentoVeiculo", e); });
                                    }
                                }
                            }
                            messages.forEach(function (e) { return rs.push({ "isValid": isValid, "message": ret_1.msg }); });
                            if (ret_1.outContinua === "N" && showError) {
                                this.message.warning("titles.agendamentoVeiculo", ret_1.msg);
                                return [2 /*return*/];
                            }
                            if (ret_1.outContinua === "P") {
                                this.message.confirm('titles.agendamentoVeiculo', ret_1.msg, null, function () { }, false, function () {
                                    if (+ordem === 0)
                                        _this.service.data.cadastroPlacaIdCavalo = "";
                                    if (+ordem === 1)
                                        _this.service.data.cadastroPlacaIdCarreta1 = "";
                                    if (+ordem === 2)
                                        _this.service.data.cadastroPlacaIdCarreta2 = "";
                                });
                            }
                            _a.label = 3;
                        case 3: return [2 /*return*/];
                    }
                });
            }); });
        }
    };
    AgendamentoVeiculoFormValidation.prototype.trataMotorista = function (motorista) {
        return __awaiter(this, void 0, void 0, function () {
            var _a, valDocsMotorista;
            return __generator(this, function (_b) {
                switch (_b.label) {
                    case 0:
                        if (!motorista)
                            return [2 /*return*/];
                        _a = this.service.data;
                        return [4 /*yield*/, this.motoristaService.getMotoristaId(motorista.motoristaId).toPromise()];
                    case 1:
                        _a.motorista = _b.sent();
                        return [4 /*yield*/, this.validaDocumentosMotorista()];
                    case 2:
                        valDocsMotorista = _b.sent();
                        return [2 /*return*/];
                }
            });
        });
    };
    AgendamentoVeiculoFormValidation.prototype.validaDocumentosMotorista = function () {
        return __awaiter(this, void 0, void 0, function () {
            var cnh$, restricao$, resp;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        cnh$ = this.entradaVeiculoService.validaVencimentoCnhMotorista(+this.service.data.motoristaId);
                        restricao$ = this.entradaVeiculoService.getVerifSeExisteRestricaoMotoristaPlaca({
                            "regControle": 0,
                            "motorista": this.service.data.motoristaId,
                            "tipoVerif": 'M',
                            "placa": this.service.data.cadastroPlacaIdCavalo
                        });
                        return [4 /*yield*/, Object(rxjs__WEBPACK_IMPORTED_MODULE_2__["forkJoin"])([cnh$, restricao$]).toPromise()];
                    case 1:
                        resp = _a.sent();
                        this.errosDocMotorista[0].isValid = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["BooleanUtilsStaticService"].toBoolean(resp[0].isValid);
                        this.errosDocMotorista[0].message = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ArrayUtilsStaticService"].any(resp[0].erros) ? this.message.validationResult(resp[0])[0] : "";
                        this.errosDocMotorista[0].data = undefined;
                        this.errosDocMotorista[0].question = resp[0].message === 'PERGUNTAR';
                        this.errosDocMotorista[1].isValid = app_shared_services_funcoes_boolean_utils_boolean_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["BooleanUtilsStaticService"].toBoolean(resp[1].isValid);
                        this.errosDocMotorista[1].message = app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ArrayUtilsStaticService"].any(resp[1].erros) ? this.message.validationResult(resp[1])[0] : "";
                        this.errosDocMotorista[1].data = undefined;
                        return [2 /*return*/, true];
                }
            });
        });
    };
    AgendamentoVeiculoFormValidation.prototype.validarDataDocumento = function () {
        var dtDocumento = moment__WEBPACK_IMPORTED_MODULE_5__(this.service.data.dataNfe);
        if (dtDocumento.isAfter(moment__WEBPACK_IMPORTED_MODULE_5__())) {
            this.message.warning('titles.agendamentoVeiculo', "messages.dataNfeNaoPodeSerMaiorDataAtual");
            return;
        }
    };
    AgendamentoVeiculoFormValidation.prototype.verificaPermissaoEncaixaHorario = function (event) {
        var _this = this;
        event.preventDefault();
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 7, function () {
            _this.service.data.encaixarHorario = !_this.service.data.encaixarHorario;
        }, function () {
            _this.message.warning('titles.agendamentoVeiculo', "messages.semPermissaoEncaixarHorarios");
        });
    };
    AgendamentoVeiculoFormValidation.prototype.validaChaveNfe = function (e) {
        return __awaiter(this, void 0, void 0, function () {
            var validationResult, mensagens;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!(!!e && e.isValid)) return [3 /*break*/, 2];
                        this.service.data.numeroNfe = e.data.docto;
                        this.service.data.serieNfe = e.data.serie;
                        return [4 /*yield*/, this.service.getValidaNfeDuplicada({
                                webStoPlanejaVeiculoId: this.service.data.webStoPlanejaVeiculoId,
                                destinatarioIdEmitente: this.service.data.destinatarioIdClienteVenda,
                                nota: this.service.data.numeroNfe,
                                serie: this.service.data.serieNfe,
                                chaveNfe: this.service.data.chaveNfe
                            }).toPromise()];
                    case 1:
                        validationResult = _a.sent();
                        if (!validationResult.isValid) {
                            mensagens = this.message.validationResult(validationResult);
                            mensagens.forEach(function (m) { return _this.message.warning("titles.agendamentoVeiculo", m); });
                            return [2 /*return*/];
                        }
                        _a.label = 2;
                    case 2: return [2 /*return*/];
                }
            });
        });
    };
    AgendamentoVeiculoFormValidation.prototype.valVerificarDisponibilidade = function () {
        if (_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isNotPositive(this.service.data.destinatarioIdCliente)) {
            this.message.warning("titles.agendamentoVeiculo", "messages.informeCliente");
            return false;
        }
        if (!this.service.data.dtPrevisaoChegada || (this.service.data.dtPrevisaoChegada.toString() === "Invalid Date")) {
            this.message.warning("titles.agendamentoVeiculo", "messages.selecioneUmaDataPrevisao");
            return false;
        }
        if (this.service.configsPTL.agUtilizarTipofrete || this.service.configsPTL.obrTipoFrete) {
            if (this.service.data.tipoFreteId < -1) {
                this.message.warning("titles.agendamentoVeiculo", "messages.informeTipoFrete");
                return false;
            }
        }
        if (!this.service.configsPTL.cargaCompartimentada && this.service.isCarga && !app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ArrayUtilsStaticService"].any(this.service.data.agendamentoVeiculoCompartimentos)) {
            this.message.warning("titles.agendamentoVeiculo", "messages.informarProdutosVerificaDispHorarios");
            return false;
        }
        if (this.service.isDescarga) {
            if (!app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ArrayUtilsStaticService"].any(this.service.data.agendamentoVeiculoItems)) {
                this.message.warning("titles.agendamentoVeiculo", "messages.informarProdutosVerificaDispHorarios");
                return false;
            }
        }
        return true;
    };
    AgendamentoVeiculoFormValidation.prototype.valUnidadeProdutos = function () {
        var isValidarUnidade = !this.service.configsPTL.cargaCompartimentada &&
            !this.service.isCarga &&
            this.service.configsPTL.tipoAgCapacQuant === 'C';
        if (isValidarUnidade) {
            var unidade = this.service.configsPTL.agCapacLitrosQuilos === 'L' ? 'LT' : 'KG';
            for (var _i = 0, _a = this.service.data.agendamentoVeiculoItems; _i < _a.length; _i++) {
                var item = _a[_i];
                var unidadeItem = (item.material && item.material.unidade ? item.material.unidade : '').toUpperCase();
                var nomeProduto = item.material && item.material.fantasia ? item.material.fantasia : 'Produto';
                if (unidadeItem !== unidade) {
                    this.message.warning('titles.agendamentoVeiculo', "Unidade do Produto " + nomeProduto + " diferente da Unidade de Agendamento da Grade.");
                    return false;
                }
            }
        }
        return true;
    };
    return AgendamentoVeiculoFormValidation;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-index/agendamento-veiculo-index.component.ts":
/*!********************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-index/agendamento-veiculo-index.component.ts ***!
  \********************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoIndexComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoIndexComponent", function() { return AgendamentoVeiculoIndexComponent; });
/* 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 app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/datatables/datatables.service */ "./src/app/shared/services/datatables/datatables.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../../../shared/components/corporate/base/base.permissoes */ "./src/app/shared/components/corporate/base/base.permissoes.ts");
/* harmony import */ var _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../../../shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.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 _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../agendamento-veiculo.model */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.model.ts");
/* harmony import */ var _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../agendamento-veiculo.constants */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.constants.ts");
/* harmony import */ var _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../agendamento-veiculo.service */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__ = __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 app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/shared/services/funcoes/configuracao/configuracao.facade */ "./src/app/shared/services/funcoes/configuracao/configuracao.facade.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 __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};














var AgendamentoVeiculoIndexComponent = /** @class */ (function (_super) {
    __extends(AgendamentoVeiculoIndexComponent, _super);
    function AgendamentoVeiculoIndexComponent(router, service, datatables, message, funcoes, permissoesUtils, loginService, configuracao) {
        var _this = _super.call(this, new _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_9__["AgendamentoVeiculoConstants"](), funcoes) || this;
        _this.router = router;
        _this.service = service;
        _this.datatables = datatables;
        _this.message = message;
        _this.funcoes = funcoes;
        _this.permissoesUtils = permissoesUtils;
        _this.loginService = loginService;
        _this.configuracao = configuracao;
        _this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_8__["AgendamentoVeiculo"]();
        _this.constantes = new _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_9__["AgendamentoVeiculoConstants"]();
        _this.mensagens = [];
        _this.target = _this.funcoes.getTargetLocation();
        _this.loadConfig = function () {
            if (!_this.configuracao.isLoadConfig())
                return;
            _this.service.configsWEB.cWebModProgramVeic = _this.configuracao.lerConfig("WEB", "CWebModProgramVeic");
            _this.service.configsPTL.integracaoPortolog = _this.configuracao.boolean("PTL", "IntegracaoPortolog");
            _this.service.configsPTL.integracaoCodesp = _this.configuracao.boolean("PTL", "IntegracaoCodesp");
            _this.service.configsPTL.integracaoSAP = _this.configuracao.boolean("PTL", "IntegracaoSAP");
        };
        _this._print = function () {
            if (!_this.itemSelecionado())
                return;
            if (_this.data.flagStatus === "E") {
                _this.message.warning("titles.agendamentoVeiculo", "messages.acaoNaoPermitidaAgendamentoCancEncerrado");
                return;
            }
            var reportTitulo = { titulo: '', subTitulo: '' };
            var modRel = _this.service.configsWEB.cWebModProgramVeic;
            console.log(modRel);
            _this.funcoesService.reportInvoc.invocaRelatorio(modRel, reportTitulo, {
                filialId: _this.loginService.getLogin().filialId,
                regPlaneja: _this.funcoesService.getValue(_this.data.webStoPlanejaVeiculoId, "I")
            });
        };
        router.events.subscribe(function (event) {
            var params = _this.funcoes.formParams.getParams(router, event);
            if (params) {
                _this.actionForm = params.action;
            }
        });
        if (!_this.service.filter) {
            _this.service.filter = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_8__["AgendamentoVeiculoFilter"]();
        }
        _this.service.filter.filialId = loginService.getLogin().filialId;
        return _this;
    }
    AgendamentoVeiculoIndexComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.configuracao.getConfig(this.constantes.listaParam, this.loadConfig);
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 4, function () { return __awaiter(_this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!!this.loginService.isTokenExpired()) return [3 /*break*/, 3];
                        if (!this.funcoesService.abrirFiltro) return [3 /*break*/, 1];
                        this.service.filter = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_8__["AgendamentoVeiculoFilter"]();
                        this.filtrar();
                        return [3 /*break*/, 3];
                    case 1: return [4 /*yield*/, this.refresh()];
                    case 2:
                        _a.sent();
                        _a.label = 3;
                    case 3: return [2 /*return*/];
                }
            });
        }); }, function () {
            _this.permissoesUtils.back();
        }, true);
        _super.prototype.addFuncoes.call(this, [
            { action: "_print", func: function () { return _this._print; } },
        ]);
    };
    AgendamentoVeiculoIndexComponent.prototype.refresh = function () {
        var _this = this;
        this.service.getByFiltro(this.service.filter).subscribe(function (data) {
            var columns = [
                _this.datatables.getDataString("webStoPlanejaVeiculoId", "codigo", "10%"),
                _this.datatables.getDataDateTime("dtPrevisaoChegada", "previsao", "DD/MM/YYYY HH:mm", "15%"),
                _this.datatables.getDataString("requisicao", "Requisicao", "10%"),
                _this.datatables.getDataString("sequencia", "sequencia", "10%"),
                _this.datatables.getDataString("tipoMov", "tipo"),
                _this.datatables.getDataString("modal", "modal"),
                _this.datatables.getDataString("razaoTransp", "transportadora"),
                _this.datatables.getDataString("nomeMotorista", "motorista"),
                _this.datatables.getDataString("cadastroPlacaIdCavalo", "placaCavalo"),
                _this.datatables.getDataString("cadastroPlacaIdCarreta1", "placaCarreta1"),
                _this.datatables.getDataString("cadastroPlacaIdCarreta2", "placaCarreta2"),
                _this.datatables.getDataString("destVendDescr", "clienteVendaEmitente"),
                _this.datatables.getDataString("status", "status"),
                _this.datatables.getDataString("situacao", "agendamento"),
            ];
            _this.datatables.toDataTable({ tableId: "dtAgendamentoVeiculo", columns: columns, data: data, columnOrder: 0, orientationOrder: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_2__["EOrientationOrder"].ASC }, function (aData) {
                _this.data = aData;
            });
        });
    };
    AgendamentoVeiculoIndexComponent.prototype.properties = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 6, function () {
            _super.prototype.properties.call(_this, _this.data);
        });
    };
    AgendamentoVeiculoIndexComponent.prototype.permissoes = function () {
        var _this = this;
        this.permissoesUtils.verificaRotina(this.constantes.sisFormularioId, 5, function () {
            _super.prototype.permissoes.call(_this, _this.constantes);
        });
    };
    AgendamentoVeiculoIndexComponent.prototype.filtrar = function () {
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_11__["ModalUtilsStaticService"].openModal('agendamento-veiculo-filter-dialog');
    };
    AgendamentoVeiculoIndexComponent.prototype.executarFiltro = function () {
        this.refresh();
    };
    AgendamentoVeiculoIndexComponent.prototype.detail = function () {
        if (!!this.data.webStoPlanejaVeiculoId) {
            this.router.navigate([this.target + "/veiculo/agendamentoVeiculo", "detail", this.data.webStoPlanejaVeiculoId]);
        }
    };
    AgendamentoVeiculoIndexComponent.prototype.edit = function () {
        if (!!this.data.webStoPlanejaVeiculoId) {
            if (!this.service.podeEditar(this.data))
                return;
            this.router.navigate([this.target + "/veiculo/agendamentoVeiculo", "edit", this.data.webStoPlanejaVeiculoId]);
        }
    };
    AgendamentoVeiculoIndexComponent.prototype.create = function () {
        this.router.navigate([this.target + "/veiculo/agendamentoVeiculo", "create"]);
    };
    AgendamentoVeiculoIndexComponent.prototype._refresh = function (event) {
        if (event) {
            this.refresh();
        }
    };
    AgendamentoVeiculoIndexComponent.prototype.remove = function () {
        var _this = this;
        var podeProsseguir = this.service.podeExcluir(this.data);
        if (!podeProsseguir) {
            return;
        }
        this.message.removeConfirm(function () {
            _this.service._remove({ webStoPlanejaVeiculoId: _this.data.webStoPlanejaVeiculoId }).subscribe(function (validationResult) {
                if (!validationResult.isValid) {
                    var mensagens = _this.message.validationResult(validationResult);
                    mensagens.forEach(function (m) { return _this.message.warning("titles.agendamentoVeiculo", m); });
                    return;
                }
                _this.datatables.remove("dtAgendamentoVeiculo");
                _this.refresh();
            });
        });
    };
    AgendamentoVeiculoIndexComponent.prototype.itemSelecionado = function () {
        if (app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["NumberUtilsStaticService"].isNotPositive(this.data.webStoPlanejaVeiculoId)) {
            this.message.warning("titles.agendamentoVeiculo", "messages.selecioneUmRegistro");
            return false;
        }
        return true;
    };
    AgendamentoVeiculoIndexComponent.ctorParameters = function () { return [
        { type: _angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"] },
        { type: _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_10__["AgendamentoVeiculoService"] },
        { type: app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_2__["DatatablesService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_4__["MessageService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"] },
        { type: _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_6__["PermissoesUtilsService"] },
        { type: _login_login_service__WEBPACK_IMPORTED_MODULE_7__["LoginService"] },
        { type: app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_13__["ConfiguracaoFacade"] }
    ]; };
    AgendamentoVeiculoIndexComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-agendamento-veiculo-index",
            template: __importDefault(__webpack_require__(/*! raw-loader!./agendamento-veiculo-index.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-index/agendamento-veiculo-index.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [_angular_router__WEBPACK_IMPORTED_MODULE_1__["Router"],
            _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_10__["AgendamentoVeiculoService"],
            app_shared_services_datatables_datatables_service__WEBPACK_IMPORTED_MODULE_2__["DatatablesService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_4__["MessageService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"],
            _shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_6__["PermissoesUtilsService"],
            _login_login_service__WEBPACK_IMPORTED_MODULE_7__["LoginService"],
            app_shared_services_funcoes_configuracao_configuracao_facade__WEBPACK_IMPORTED_MODULE_13__["ConfiguracaoFacade"]])
    ], AgendamentoVeiculoIndexComponent);
    return AgendamentoVeiculoIndexComponent;
}(_shared_components_corporate_base_base_permissoes__WEBPACK_IMPORTED_MODULE_5__["BasePermissoes"]));



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-item/agendamento-veiculo-item.component.ts":
/*!******************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-item/agendamento-veiculo-item.component.ts ***!
  \******************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoItemComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoItemComponent", function() { return AgendamentoVeiculoItemComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../agendamento-veiculo.model */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.model.ts");
/* harmony import */ var _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../agendamento-veiculo.service */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.ts");
/* harmony import */ var _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../agendamento-veiculo.constants */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.constants.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var _agendamento_veiculo_seleciona_planejamento_agendamento_veiculo_seleciona_planejamento_component__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../agendamento-veiculo-seleciona-planejamento/agendamento-veiculo-seleciona-planejamento.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-seleciona-planejamento/agendamento-veiculo-seleciona-planejamento.component.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/pages/cadastro/material/material.service */ "./src/app/pages/cadastro/material/material.service.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 __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};














var AgendamentoVeiculoItemComponent = /** @class */ (function () {
    function AgendamentoVeiculoItemComponent(messageService, service, funcoesService, loginService, permissoesUtils, materialService) {
        this.messageService = messageService;
        this.service = service;
        this.funcoesService = funcoesService;
        this.loginService = loginService;
        this.permissoesUtils = permissoesUtils;
        this.materialService = materialService;
        this.dataResult = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoItem"]();
        this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoItem"]();
        this.mensagens = [];
        this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["Mascaras"]();
        this.showAdd = false;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].index;
        this.hasDados = false;
        this.now = new Date();
        this.constantes = new _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_9__["AgendamentoVeiculoConstants"]();
    }
    AgendamentoVeiculoItemComponent.prototype.ngDoCheck = function () {
        this.hasDados =
            this.service.data.agendamentoVeiculoItems &&
                this.service.data.agendamentoVeiculoItems.length > 0 &&
                this.service.data.agendamentoVeiculoItems.filter(function (v) {
                    if (v["sitReg"] !== "E") {
                        return true;
                    }
                    return false;
                }).length > 0;
    };
    AgendamentoVeiculoItemComponent.prototype.create = function () {
        this.showAdd = true;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].create;
        this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoItem"]();
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoItem"]();
        this.data.webStoPlanejaVeiculoId = this.service.data.webStoPlanejaVeiculoId;
        if (!this.service.data.agendamentoVeiculoItems) {
            this.service.data.agendamentoVeiculoItems = [];
        }
    };
    AgendamentoVeiculoItemComponent.prototype.edit = function () {
        var _this = this;
        this.showAdd = true;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].edit;
        this.data = Object.assign({}, this.dataAux);
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoItem"]();
        this.materialService.getById(this.data.materialId).subscribe(function (resp) {
            _this.data.materialId = resp.materialId;
            _this.data.material = resp;
            _this.densidade = resp.densidadePadrao;
            _this.unidade = resp.unidade;
            _this.pesoLiq = resp.pesoLiq;
        });
    };
    AgendamentoVeiculoItemComponent.prototype.detail = function () {
        var _this = this;
        this.showAdd = true;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].detail;
        this.data = Object.assign({}, this.dataAux);
        this.materialService.getById(this.data.materialId).subscribe(function (resp) {
            _this.data.materialId = resp.materialId;
            _this.data.material = resp;
            _this.densidade = resp.densidadePadrao;
            _this.unidade = resp.unidade;
            _this.pesoLiq = resp.pesoLiq;
        });
    };
    AgendamentoVeiculoItemComponent.prototype.back = function (refresh) {
        if (refresh === void 0) { refresh = false; }
        this.showAdd = false;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].index;
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoItem"]();
    };
    AgendamentoVeiculoItemComponent.prototype.remove = function () {
        var _this = this;
        var idx = this.service.data.agendamentoVeiculoItems.findIndex(function (x) { return x.webStoPlanejaVeiculoItemId === _this.dataAux.webStoPlanejaVeiculoItemId; });
        this.messageService.removeConfirm(function () {
            if (_this.funcoesService.isUndefinedOrNull(_this.service.data.agendamentoVeiculoItems[idx].webStoPlanejaVeiculoItemId)) {
                _this.service.data.agendamentoVeiculoItems.splice(idx, 1);
            }
            else {
                _this.service.data.agendamentoVeiculoItems[idx].sitReg = "E";
            }
            _this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoItem"]();
        });
    };
    AgendamentoVeiculoItemComponent.prototype.onSubmit = function (form) {
        var _this = this;
        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__["EventEmitterService"].get("formError").emit(form);
        if (form.invalid) {
            return;
        }
        if (this.data.material) {
            this.data.descrMater = this.data.material.descrMater;
            this.data.materialId = this.data.material.materialId;
            this.data.produto = this.data.material.fantasia;
            this.data.unidadeId = this.data.material.unidadeWeb;
            this.data.descrUnidade = this.lblUnidade;
        }
        this.data.logRotina = "Manutenção de AgendamentoVeiculoItem";
        if (this.actionForm === _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].create) {
            this.data.webStoPlanejaVeiculoItemId = this.service.data.agendamentoVeiculoItems.length + 1;
            this.service.data.agendamentoVeiculoItems.push(this.data);
        }
        else {
            var idx = this.service.data.agendamentoVeiculoItems.findIndex(function (x) { return x.webStoPlanejaVeiculoItemId === _this.data.webStoPlanejaVeiculoItemId; });
            this.service.data.agendamentoVeiculoItems[idx] = this.data;
        }
        this.service.carregarHorariosDisponiveis();
        this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoItem"]();
        this.data.webStoPlanejaVeiculoId = this.service.data.webStoPlanejaVeiculoId;
        this.data.regPlanejCarga = this.service.data.regPlanejCarga;
        this.dataResult.emit(this.service.data.agendamentoVeiculoItems);
        this.back();
    };
    AgendamentoVeiculoItemComponent.prototype.opnModal = function () {
        var _this = this;
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_10__["StringUtilsStaticService"].isNotEmpty(this.service.data.tipoMov)) {
            this.service.getSelecionaPlanejamento({ tipoMov: this.service.data.tipoMov }).subscribe(function (resp) {
                _this.childAgendamentoVeiculoSelecionaPlanejamentoComponent.objectSelect(resp);
                app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["ModalUtilsStaticService"].openModal("modalSelecionaPlanejamento");
            });
        }
    };
    AgendamentoVeiculoItemComponent.prototype.outSelecionaPlanejamentoItem = function (planejamento) {
        this.data.webStoPlanejaVeiculoId = planejamento.regPlanej;
    };
    AgendamentoVeiculoItemComponent.prototype.trataMaterial = function (material) {
        return __awaiter(this, void 0, void 0, function () {
            var resp;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        if (!material)
                            return [2 /*return*/];
                        return [4 /*yield*/, this.materialService.getById(material.materialId).toPromise()];
                    case 1:
                        resp = _a.sent();
                        return [4 /*yield*/, this.loadMaterial(resp)];
                    case 2:
                        _a.sent();
                        return [2 /*return*/];
                }
            });
        });
    };
    AgendamentoVeiculoItemComponent.prototype.loadMaterial = function (data) {
        if (!data)
            return;
        this.data.materialId = data.materialId;
        this.data.material = data;
        this.densidade = data.densidadePadrao;
        this.unidade = data.unidade;
        this.pesoLiq = data.pesoLiq;
        var regPlanej = this.data && this.data.webStoPlanejaVeiculoId != null ? this.data.webStoPlanejaVeiculoId : 0;
        var litrosAbaDados = this.service.data && this.service.data.litros != null ? this.service.data.litros : 0;
        var kilosAbaDados = this.service.data && this.service.data.kilos != null ? this.service.data.kilos : 0;
        var litrosItem = this.data && this.data.litros != null ? this.data.litros : 0;
        var kilosItem = this.data && this.data.kilos != null ? this.data.kilos : 0;
        this.readUni();
        if (this.unidade === 'LT' || this.unidade === 'CC') {
            this.data.quantid = regPlanej > 0 ? litrosItem : litrosAbaDados;
        }
        else {
            this.data.quantid = regPlanej > 0 ? kilosItem : kilosAbaDados;
        }
    };
    Object.defineProperty(AgendamentoVeiculoItemComponent.prototype, "showCamposPortolog", {
        get: function () {
            return this.service.configsPTL.integracaoPortolog;
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoItemComponent.prototype.onQuantidBlur = function () {
        var kilos = 0;
        var litros = 0;
        var quantid = this.data && this.data.quantid != null ? this.data.quantid : 0;
        var unidade = this.unidade;
        var densidade = this.densidade != null ? this.densidade : 0;
        var pesoLiq = this.pesoLiq != null ? this.pesoLiq : 0;
        if (unidade === 'KG') {
            kilos = quantid;
        }
        else if (unidade === 'LT') {
            if (densidade === 0) {
                densidade = 1;
            }
            kilos = quantid * densidade;
            litros = quantid;
        }
        else if (unidade === 'UN') {
            if (pesoLiq === 0) {
                this.messageService.error('titles.agendamentoVeiculo', 'messages.eNecessarioInformarPesoLiquidoNoCadastroProduto');
                return;
            }
            kilos = quantid * pesoLiq;
        }
        this.data.kilos = kilos;
        this.data.litros = litros;
    };
    AgendamentoVeiculoItemComponent.prototype.readUni = function () {
        if (this.data.material.unidadeWeb === 'LT') {
            this.lblUnidade = 'LITRO';
        }
        else {
            this.lblUnidade = 'KILO';
        }
    };
    AgendamentoVeiculoItemComponent.ctorParameters = function () { return [
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"] },
        { type: _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["AgendamentoVeiculoService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_6__["LoginService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__["PermissoesUtilsService"] },
        { type: app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_13__["MaterialService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], AgendamentoVeiculoItemComponent.prototype, "disabled", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], AgendamentoVeiculoItemComponent.prototype, "dataResult", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewChild"])(_agendamento_veiculo_seleciona_planejamento_agendamento_veiculo_seleciona_planejamento_component__WEBPACK_IMPORTED_MODULE_11__["AgendamentoVeiculoSelecionaPlanejamentoComponent"], { static: false }),
        __metadata("design:type", _agendamento_veiculo_seleciona_planejamento_agendamento_veiculo_seleciona_planejamento_component__WEBPACK_IMPORTED_MODULE_11__["AgendamentoVeiculoSelecionaPlanejamentoComponent"])
    ], AgendamentoVeiculoItemComponent.prototype, "childAgendamentoVeiculoSelecionaPlanejamentoComponent", void 0);
    AgendamentoVeiculoItemComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-agendamento-veiculo-item",
            template: __importDefault(__webpack_require__(/*! raw-loader!./agendamento-veiculo-item.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-item/agendamento-veiculo-item.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"],
            _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["AgendamentoVeiculoService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_6__["LoginService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__["PermissoesUtilsService"],
            app_pages_cadastro_material_material_service__WEBPACK_IMPORTED_MODULE_13__["MaterialService"]])
    ], AgendamentoVeiculoItemComponent);
    return AgendamentoVeiculoItemComponent;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-nota/agendamento-veiculo-nota.component.ts":
/*!******************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-nota/agendamento-veiculo-nota.component.ts ***!
  \******************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoNotaComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoNotaComponent", function() { return AgendamentoVeiculoNotaComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/event-emitter/event-emitter.service */ "./src/app/shared/services/event-emitter/event-emitter.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../agendamento-veiculo.model */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.model.ts");
/* harmony import */ var _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../agendamento-veiculo.service */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.ts");
/* harmony import */ var _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../agendamento-veiculo.constants */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.constants.ts");
/* harmony import */ var app_pages_cadastro_unidade_unidade_service__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! app/pages/cadastro/unidade/unidade.service */ "./src/app/pages/cadastro/unidade/unidade.service.ts");
/* harmony import */ var _agendamento_veiculo_nota_validation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./agendamento-veiculo-nota.validation */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-nota/agendamento-veiculo-nota.validation.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.ts");
/* harmony import */ var app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! app/pages/cadastro/destinatario/destinatario.service */ "./src/app/pages/cadastro/destinatario/destinatario.service.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 __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};














var AgendamentoVeiculoNotaComponent = /** @class */ (function () {
    function AgendamentoVeiculoNotaComponent(messageService, service, funcoesService, loginService, permissoesUtils, unidadeService, destinatarioService) {
        this.messageService = messageService;
        this.service = service;
        this.funcoesService = funcoesService;
        this.loginService = loginService;
        this.permissoesUtils = permissoesUtils;
        this.unidadeService = unidadeService;
        this.destinatarioService = destinatarioService;
        this.dataResult = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoNota"]();
        this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoNota"]();
        this.mensagens = [];
        this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["Mascaras"]();
        this.showAdd = false;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].index;
        this.hasDados = false;
        this.constantes = new _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_9__["AgendamentoVeiculoConstants"]();
        this.validation = new _agendamento_veiculo_nota_validation__WEBPACK_IMPORTED_MODULE_11__["AgendamentoVeiculoNotaValidation"](messageService, funcoesService, service);
    }
    AgendamentoVeiculoNotaComponent.prototype.ngDoCheck = function () {
        this.hasDados =
            this.service.data.agendamentoVeiculoNotas &&
                this.service.data.agendamentoVeiculoNotas.length > 0 &&
                this.service.data.agendamentoVeiculoNotas.filter(function (v) {
                    if (v["sitReg"] !== "E") {
                        return true;
                    }
                    return false;
                }).length > 0;
    };
    AgendamentoVeiculoNotaComponent.prototype.create = function () {
        this.showAdd = true;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].create;
        this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoNota"]();
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoNota"]();
        this.data.webStoPlanejaVeiculoId = this.service.data.webStoPlanejaVeiculoId;
        if (!this.service.data.agendamentoVeiculoNotas) {
            this.service.data.agendamentoVeiculoNotas = [];
        }
        this.preencheComboUnidade("KG, LT, UN, CC");
    };
    AgendamentoVeiculoNotaComponent.prototype.edit = function () {
        this.showAdd = true;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].edit;
        this.data = Object.assign({}, this.dataAux);
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoNota"]();
        this.preencheComboUnidade("KG, LT, UN, CC");
    };
    AgendamentoVeiculoNotaComponent.prototype.detail = function () {
        this.showAdd = true;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].detail;
        this.data = Object.assign({}, this.dataAux);
        this.preencheComboUnidade("KG, LT, UN, CC");
    };
    AgendamentoVeiculoNotaComponent.prototype.back = function (refresh) {
        if (refresh === void 0) { refresh = false; }
        this.showAdd = false;
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].index;
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoNota"]();
    };
    AgendamentoVeiculoNotaComponent.prototype.remove = function () {
        var _this = this;
        var idx = this.service.data.agendamentoVeiculoNotas.findIndex(function (x) { return x.webStoPlanejaVeiculoNotaItemId === _this.dataAux.webStoPlanejaVeiculoNotaItemId; });
        this.messageService.removeConfirm(function () {
            if (_this.funcoesService.isUndefinedOrNull(_this.service.data.agendamentoVeiculoNotas[idx].webStoPlanejaVeiculoNotaItemId)) {
                _this.service.data.agendamentoVeiculoNotas.splice(idx, 1);
            }
            else {
                _this.service.data.agendamentoVeiculoNotas[idx].sitReg = "E";
            }
            _this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoNota"]();
        });
    };
    AgendamentoVeiculoNotaComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () {
            var validations, idx;
            var _this = this;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0:
                        app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__["EventEmitterService"].get("msgNota").emit(form);
                        if (form.invalid) {
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        return [4 /*yield*/, this.validation.getValidations(this.data)];
                    case 1:
                        validations = _a.sent();
                        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_12__["ArrayUtilsStaticService"].any(validations)) {
                            app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__["EventEmitterService"].get("backError").emit(validations.map(function (c) { return c.message; }));
                            this.funcoesService.backToTop();
                            return [2 /*return*/];
                        }
                        ;
                        this.data.logRotina = "Manutenção de AgendamentoVeiculoNota";
                        if (this.actionForm === _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].create) {
                            this.service.data.agendamentoVeiculoNotas.push(this.data);
                        }
                        else {
                            idx = this.service.data.agendamentoVeiculoNotas.findIndex(function (x) { return x.webStoPlanejaVeiculoNotaItemId === _this.data.webStoPlanejaVeiculoNotaItemId; });
                            this.service.data.agendamentoVeiculoNotas[idx] = this.data;
                        }
                        this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoNota"]();
                        this.data.webStoPlanejaVeiculoId = this.service.data.webStoPlanejaVeiculoId;
                        this.dataResult.emit(this.service.data.agendamentoVeiculoNotas);
                        this.back();
                        return [2 /*return*/];
                }
            });
        });
    };
    AgendamentoVeiculoNotaComponent.prototype.disabledChaveNfe = function () {
        return this.funcoesService.isDetail(this.actionForm);
    };
    AgendamentoVeiculoNotaComponent.prototype.validaChaveNfe = function (e) {
        if (!!e && e.isValid) {
            this.data.notaFiscalId = e.data.docto;
            this.data.serieId = e.data.serie;
        }
    };
    AgendamentoVeiculoNotaComponent.prototype.importaDanfe = function (e) {
        if (!!e) {
            if (!e.validationResult.isValid) {
                this.mensagens = this.messageService.validationResult(e.validationResult);
                app_shared_services_event_emitter_event_emitter_service__WEBPACK_IMPORTED_MODULE_2__["EventEmitterService"].get("msgNota").emit(this.mensagens);
                this.funcoesService.backToTop();
                return;
            }
            this.data.nfeAuto = true;
            this.data.serieId = e.serie;
            this.data.notaFiscalId = e.numero;
            this.data.dtEmissao = e.dtEmissao;
            this.data.quantidade = e.qtde;
            this.data.pesoDoc = e.peso;
            this.data.vlItem = e.vlNota;
            this.data.cfop = e.cfop;
        }
    };
    AgendamentoVeiculoNotaComponent.prototype.onTrataDtDocumento = function () {
        this.validation.onTrataDtDocumento(this.data);
    };
    AgendamentoVeiculoNotaComponent.prototype.preencheComboUnidade = function (unidades) {
        var _this = this;
        this.unidades = [];
        var uni = unidades;
        this.unidadeService.getOpcoesValidas(uni).subscribe(function (resp) {
            resp.forEach(function (e) {
                if (e !== undefined) {
                    _this.unidades.push(e);
                }
            });
        });
    };
    Object.defineProperty(AgendamentoVeiculoNotaComponent.prototype, "disabledDadosNf", {
        get: function () {
            if (this.funcoesService.isDetail(this.actionForm))
                return true;
            if (this.data.nfeAuto)
                return true;
            return false;
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoNotaComponent.ctorParameters = function () { return [
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"] },
        { type: _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["AgendamentoVeiculoService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_6__["LoginService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__["PermissoesUtilsService"] },
        { type: app_pages_cadastro_unidade_unidade_service__WEBPACK_IMPORTED_MODULE_10__["UnidadeService"] },
        { type: app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__["DestinatarioService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], AgendamentoVeiculoNotaComponent.prototype, "disabled", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], AgendamentoVeiculoNotaComponent.prototype, "dataResult", void 0);
    AgendamentoVeiculoNotaComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-agendamento-veiculo-nota",
            template: __importDefault(__webpack_require__(/*! raw-loader!./agendamento-veiculo-nota.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-nota/agendamento-veiculo-nota.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"],
            _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_8__["AgendamentoVeiculoService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_4__["FuncoesService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_6__["LoginService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_5__["PermissoesUtilsService"],
            app_pages_cadastro_unidade_unidade_service__WEBPACK_IMPORTED_MODULE_10__["UnidadeService"],
            app_pages_cadastro_destinatario_destinatario_service__WEBPACK_IMPORTED_MODULE_13__["DestinatarioService"]])
    ], AgendamentoVeiculoNotaComponent);
    return AgendamentoVeiculoNotaComponent;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-nota/agendamento-veiculo-nota.validation.ts":
/*!*******************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-nota/agendamento-veiculo-nota.validation.ts ***!
  \*******************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoNotaValidation */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoNotaValidation", function() { return AgendamentoVeiculoNotaValidation; });
/* harmony import */ var app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__ = __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 _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../agendamento-veiculo.model */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.model.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/funcoes/object-utils/object-utils.static.service */ "./src/app/shared/services/funcoes/object-utils/object-utils.static.service.ts");
/* harmony import */ var app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/date-time-utils/date-time-utils.static.service */ "./src/app/shared/services/funcoes/date-time-utils/date-time-utils.static.service.ts");
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};





var AgendamentoVeiculoNotaValidation = /** @class */ (function () {
    function AgendamentoVeiculoNotaValidation(message, funcoes, service) {
        this.message = message;
        this.funcoes = funcoes;
        this.service = service;
        this.mensagens = [];
        this.dataNota = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_1__["AgendamentoVeiculoNota"]();
        this.rs = [];
    }
    AgendamentoVeiculoNotaValidation.prototype.getValidations = function (item) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                this.rs = [];
                this.dataNota = item;
                this.test(this.validaChaveNfe(item));
                this.test(this.validaDtDocumento(item));
                return [2 /*return*/, this.rs.filter(function (v) { return v["isValid"] === false; })];
            });
        });
    };
    AgendamentoVeiculoNotaValidation.prototype.test = function (f) {
        return __awaiter(this, void 0, void 0, function () {
            return __generator(this, function (_a) {
                if (!!f)
                    this.rs.push(f);
                return [2 /*return*/];
            });
        });
    };
    AgendamentoVeiculoNotaValidation.prototype.onValidaChaveNfe = function (item) {
        return this.validaChaveNfe(item, true)['isValid'];
    };
    AgendamentoVeiculoNotaValidation.prototype.validaChaveNfe = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!item.chaveNfe)
            return;
        item.notaFiscalId = app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isPositive(item.notaFiscalId) ? item.notaFiscalId : +this.funcoes.getNumeroNota(item.chaveNfe);
        item.serieId = app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["StringUtilsStaticService"].isNotEmpty(item.serieId) ? item.serieId : this.funcoes.getSerieNota(item.chaveNfe);
        var emitente = app_shared_services_funcoes_object_utils_object_utils_static_service__WEBPACK_IMPORTED_MODULE_3__["ObjectUtilsStaticService"].defined(this.service.data.clienteVenda) && app_shared_services_funcoes_number_utils_number_utils_static_service__WEBPACK_IMPORTED_MODULE_0__["NumberUtilsStaticService"].isPositive(this.service.data.destinatarioIdClienteVenda) ? this.service.data.clienteVenda : null;
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_2__["StringUtilsStaticService"].isEmpty(item.chaveNfe)) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.chaveDaNFE") });
        }
        else if (!this.funcoes.validaChaveNFe(item.chaveNfe, emitente, item.notaFiscalId, item.serieId)) {
            r.isValid = false;
            r.message = "messages.chaveNfeInvalida";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.agendamentoVeiculo", r.message);
        }
        return r;
    };
    AgendamentoVeiculoNotaValidation.prototype.onTrataDtDocumento = function (item) {
        return this.validaDtDocumento(item, true)['isValid'];
    };
    AgendamentoVeiculoNotaValidation.prototype.validaDtDocumento = function (item, showError) {
        if (showError === void 0) { showError = false; }
        var r = { "isValid": true, "message": "" };
        if (!item.dtEmissao) {
            r.isValid = false;
            r.message = this.message.translate("messages.campoObrigatorio", { name: this.message.translate("labels.dataEmissao") });
        }
        else if (app_shared_services_funcoes_date_time_utils_date_time_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["DateTimeUtilsStaticService"].maiorAHoje(item.dtEmissao)) {
            r.isValid = false;
            r.message = "messages.dataEmissaoNaoPodeSerMaiorQueDataAtual";
        }
        if (!r.isValid && showError) {
            this.message.warning("titles.agendamentoVeiculo", r.message);
        }
        return r;
    };
    return AgendamentoVeiculoNotaValidation;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-pesquisa/agendamento-veiculo-pesquisa.component.ts":
/*!**************************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-pesquisa/agendamento-veiculo-pesquisa.component.ts ***!
  \**************************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoPesquisaComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoPesquisaComponent", function() { return AgendamentoVeiculoPesquisaComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../agendamento-veiculo.model */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.model.ts");
/* harmony import */ var _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../agendamento-veiculo.service */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.ts");
/* harmony import */ var app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/modal-utils/modal-utils.static.service */ "./src/app/shared/services/funcoes/modal-utils/modal-utils.static.service.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/shared/services/funcoes/string-utils/string-utils.static.service */ "./src/app/shared/services/funcoes/string-utils/string-utils.static.service.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 __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 AgendamentoVeiculoPesquisaComponent = /** @class */ (function () {
    function AgendamentoVeiculoPesquisaComponent(funcoesService, service, message) {
        this.funcoesService = funcoesService;
        this.service = service;
        this.message = message;
        this.outSelected = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_2__["PesquisaCarregarAgendamento"]();
        this.dados = [];
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_2__["PesquisaCarregarAgendamento"]();
        this.hasDados = false;
        this.filtro = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_2__["PesquisaCarregarAgendamentoFilter"]();
        this.showFiltro = true;
        this.selectedRow = false;
    }
    AgendamentoVeiculoPesquisaComponent.prototype.ngOnInit = function () {
        this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_2__["PesquisaCarregarAgendamento"]();
        this.filtroSelected = this.message.getTranslates("labels", "produto");
    };
    AgendamentoVeiculoPesquisaComponent.prototype.selectFiltro = function (e) {
        this.filtroSelected = this.message.getTranslates("labels", e);
        this.filtro.campo = e;
    };
    AgendamentoVeiculoPesquisaComponent.prototype.onSubmit = function () {
        var _this = this;
        this.dados = [];
        this.service.pesquisaCarregarAgendamento(this.filtro).subscribe(function (resp) {
            _this.dados = resp;
            _this.hasDados = resp && resp.length > 0;
            _this.showFiltro = false;
        });
    };
    AgendamentoVeiculoPesquisaComponent.prototype.ngDoCheck = function () {
        if (app_shared_services_funcoes_string_utils_string_utils_static_service__WEBPACK_IMPORTED_MODULE_6__["StringUtilsStaticService"].isNotEmpty(this.filtroSelected)) {
            if (this.filtroSelected === "material") {
                this.labelFiltro = this.message.getTranslates("labels", "id");
            }
            else {
                this.labelFiltro = this.filtroSelected;
            }
        }
    };
    AgendamentoVeiculoPesquisaComponent.prototype.select = function () {
        this.data = this.dataAux;
        this.outSelected.emit(this.data);
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_2__["PesquisaCarregarAgendamento"]();
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ModalUtilsStaticService"].closeModal("modalPesquisaCarregarAgendamento");
    };
    AgendamentoVeiculoPesquisaComponent.prototype.onShowFiltro = function () {
        this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_2__["PesquisaCarregarAgendamento"]();
        this.selectedRow = false;
        this.showFiltro = !this.showFiltro;
    };
    AgendamentoVeiculoPesquisaComponent.prototype.closeModal = function () {
        this.showFiltro = true;
        this.filtro = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_2__["PesquisaCarregarAgendamentoFilter"]();
        app_shared_services_funcoes_modal_utils_modal_utils_static_service__WEBPACK_IMPORTED_MODULE_4__["ModalUtilsStaticService"].closeModal("modalPesquisaCarregarAgendamento");
    };
    AgendamentoVeiculoPesquisaComponent.ctorParameters = function () { return [
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"] },
        { type: _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_3__["AgendamentoVeiculoService"] },
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], AgendamentoVeiculoPesquisaComponent.prototype, "outSelected", void 0);
    AgendamentoVeiculoPesquisaComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-agendamento-veiculo-pesquisa",
            template: __importDefault(__webpack_require__(/*! raw-loader!./agendamento-veiculo-pesquisa.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-pesquisa/agendamento-veiculo-pesquisa.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_1__["FuncoesService"],
            _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_3__["AgendamentoVeiculoService"],
            app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_5__["MessageService"]])
    ], AgendamentoVeiculoPesquisaComponent);
    return AgendamentoVeiculoPesquisaComponent;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-situacao/agendamento-veiculo-situacao.component.ts":
/*!**************************************************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-situacao/agendamento-veiculo-situacao.component.ts ***!
  \**************************************************************************************************************************/
/*! exports provided: AgendamentoVeiculoSituacaoComponent */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoSituacaoComponent", function() { return AgendamentoVeiculoSituacaoComponent; });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ "./node_modules/@angular/core/fesm5/core.js");
/* harmony import */ var _config_enumerables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! app/shared/services/funcoes/funcoes.service */ "./src/app/shared/services/funcoes/funcoes.service.ts");
/* harmony import */ var app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! app/shared/services/funcoes/permissoes-utils/permissoes-utils.service */ "./src/app/shared/services/funcoes/permissoes-utils/permissoes-utils.service.ts");
/* harmony import */ var app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! app/pages/login/login.service */ "./src/app/pages/login/login.service.ts");
/* harmony import */ var _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../agendamento-veiculo.model */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.model.ts");
/* harmony import */ var _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../agendamento-veiculo.service */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.ts");
/* harmony import */ var _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../agendamento-veiculo.constants */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.constants.ts");
/* harmony import */ var app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! app/shared/services/funcoes/array-utils/array-utils.static.service */ "./src/app/shared/services/funcoes/array-utils/array-utils.static.service.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 __metadata = (undefined && undefined.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};










var AgendamentoVeiculoSituacaoComponent = /** @class */ (function () {
    function AgendamentoVeiculoSituacaoComponent(messageService, service, funcoesService, loginService, permissoesUtils) {
        this.messageService = messageService;
        this.service = service;
        this.funcoesService = funcoesService;
        this.loginService = loginService;
        this.permissoesUtils = permissoesUtils;
        this.dataResult = new _angular_core__WEBPACK_IMPORTED_MODULE_0__["EventEmitter"]();
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_6__["AgendamentoVeiculoSituacao"]();
        this.mensagens = [];
        this.mascara = new _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["Mascaras"]();
        this.actionForm = _config_enumerables__WEBPACK_IMPORTED_MODULE_1__["ActionForm"].index;
        this.hasDados = false;
        this.constantes = new _agendamento_veiculo_constants__WEBPACK_IMPORTED_MODULE_8__["AgendamentoVeiculoConstants"]();
    }
    AgendamentoVeiculoSituacaoComponent.prototype.ngOnInit = function () {
        this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_6__["AgendamentoVeiculoSituacao"]();
    };
    AgendamentoVeiculoSituacaoComponent.prototype.ngDoCheck = function () {
        var situacoes = this.service.data.agendamentoVeiculoSituacoes;
        if (app_shared_services_funcoes_array_utils_array_utils_static_service__WEBPACK_IMPORTED_MODULE_9__["ArrayUtilsStaticService"].any(situacoes)) {
            var ativos = situacoes.filter(function (v) { return v["sitReg"] !== "E"; });
            if (ativos.length > 0) {
                this.dataAux = ativos[0];
            }
        }
        this.hasDados = situacoes && situacoes.length > 0 && situacoes.some(function (v) { return v["sitReg"] !== "E"; });
        if (!this.hasDados) {
            this.dataAux = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_6__["AgendamentoVeiculoSituacao"]();
        }
    };
    AgendamentoVeiculoSituacaoComponent.prototype.onSubmit = function (form) {
        return __awaiter(this, void 0, void 0, function () { return __generator(this, function (_a) {
            return [2 /*return*/];
        }); });
    };
    AgendamentoVeiculoSituacaoComponent.ctorParameters = function () { return [
        { type: app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"] },
        { type: _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoService"] },
        { type: app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"] },
        { type: app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_5__["LoginService"] },
        { type: app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_4__["PermissoesUtilsService"] }
    ]; };
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Input"])(),
        __metadata("design:type", Object)
    ], AgendamentoVeiculoSituacaoComponent.prototype, "disabled", void 0);
    __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Output"])(),
        __metadata("design:type", Object)
    ], AgendamentoVeiculoSituacaoComponent.prototype, "dataResult", void 0);
    AgendamentoVeiculoSituacaoComponent = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["Component"])({
            selector: "app-agendamento-veiculo-situacao",
            template: __importDefault(__webpack_require__(/*! raw-loader!./agendamento-veiculo-situacao.component.html */ "./node_modules/raw-loader/dist/cjs.js!./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-situacao/agendamento-veiculo-situacao.component.html")).default,
            encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__["ViewEncapsulation"].None
        }),
        __metadata("design:paramtypes", [app_shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_2__["MessageService"],
            _agendamento_veiculo_service__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoService"],
            app_shared_services_funcoes_funcoes_service__WEBPACK_IMPORTED_MODULE_3__["FuncoesService"],
            app_pages_login_login_service__WEBPACK_IMPORTED_MODULE_5__["LoginService"],
            app_shared_services_funcoes_permissoes_utils_permissoes_utils_service__WEBPACK_IMPORTED_MODULE_4__["PermissoesUtilsService"]])
    ], AgendamentoVeiculoSituacaoComponent);
    return AgendamentoVeiculoSituacaoComponent;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.constants.ts":
/*!************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.constants.ts ***!
  \************************************************************************************/
/*! exports provided: AgendamentoVeiculoConstants */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoConstants", function() { return AgendamentoVeiculoConstants; });
var __importDefault = (undefined && undefined.__importDefault) || function (mod) {
  return (mod && mod.__esModule) ? mod : { "default": mod };
};
var AgendamentoVeiculoConstants = /** @class */ (function () {
    function AgendamentoVeiculoConstants() {
        this.sisFormularioId = 65755;
        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.permissoes" },
            { sisFormularioId: this.sisFormularioId, libRotina: 6, acao: "labels.propriedades" },
            { sisFormularioId: this.sisFormularioId, libRotina: 7, acao: "labels.encaixaHorario" },
        ];
        this.sisSistemaId = "CAD";
        this.nomeForm = "titles.agendamentoVeiculo";
        this.reportId = "";
        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: 'Pesquisar', action: 'filtrar', icon: "icon-search", exibeButton: true, eximeMenu: true, menuName: 'Movimento' },
            { 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' },
        ];
        this.listaParam = [
            {
                sistema: 'PTL', parametros: ['VrfPlanejDescarga',
                    'VrfPlanejCarga',
                    'ObrigaTipoCarreg',
                    'SolDestMerc',
                    'AgQtDiasAgendamento',
                    'GradeAgendamento',
                    'CargaCompartimentada',
                    'TipoAgCapacQuant',
                    'AgCapacLitrosQuilos',
                    'IntegracaoPortolog',
                    'AgUtilizarTipofrete',
                    'ObrTipoFrete',
                    'IntegracaoCodesp',
                    'IntegracaoSAP']
            },
            { sistema: 'UNI', parametros: ['UtilizDivCliAgend'] },
            { sistema: 'CTV', parametros: ['ObrRequisicaoCarga'] },
            { sistema: 'BAL', parametros: ['MaskTrem', 'MaskPlaca'] },
            { sistema: 'WEB', parametros: ['CWebModProgramVeic'] },
        ];
    }
    return AgendamentoVeiculoConstants;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.module.ts":
/*!*********************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.module.ts ***!
  \*********************************************************************************/
/*! exports provided: AgendamentoVeiculoModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoModule", function() { return AgendamentoVeiculoModule; });
/* 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 _agendamento_veiculo_routing_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./agendamento-veiculo.routing.module */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.routing.module.ts");
/* harmony import */ var _agendamento_veiculo_index_agendamento_veiculo_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./agendamento-veiculo-index/agendamento-veiculo-index.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-index/agendamento-veiculo-index.component.ts");
/* harmony import */ var _agendamento_veiculo_filter_agendamento_veiculo_filter_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./agendamento-veiculo-filter/agendamento-veiculo-filter.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-filter/agendamento-veiculo-filter.component.ts");
/* harmony import */ var _agendamento_veiculo_form_agendamento_veiculo_form_component__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./agendamento-veiculo-form/agendamento-veiculo-form.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-form.component.ts");
/* harmony import */ var _agendamento_veiculo_seleciona_planejamento_agendamento_veiculo_seleciona_planejamento_component__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./agendamento-veiculo-seleciona-planejamento/agendamento-veiculo-seleciona-planejamento.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-seleciona-planejamento/agendamento-veiculo-seleciona-planejamento.component.ts");
/* harmony import */ var _agendamento_veiculo_pesquisa_agendamento_veiculo_pesquisa_component__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./agendamento-veiculo-pesquisa/agendamento-veiculo-pesquisa.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-pesquisa/agendamento-veiculo-pesquisa.component.ts");
/* harmony import */ var _agendamento_veiculo_item_agendamento_veiculo_item_component__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./agendamento-veiculo-item/agendamento-veiculo-item.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-item/agendamento-veiculo-item.component.ts");
/* harmony import */ var _agendamento_veiculo_nota_agendamento_veiculo_nota_component__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./agendamento-veiculo-nota/agendamento-veiculo-nota.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-nota/agendamento-veiculo-nota.component.ts");
/* harmony import */ var _agendamento_veiculo_situacao_agendamento_veiculo_situacao_component__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./agendamento-veiculo-situacao/agendamento-veiculo-situacao.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-situacao/agendamento-veiculo-situacao.component.ts");
/* harmony import */ var _agendamento_veiculo_compartimentos_agendamento_veiculo_compartimentos_component__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./agendamento-veiculo-compartimentos/agendamento-veiculo-compartimentos.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-compartimentos/agendamento-veiculo-compartimentos.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 AgendamentoVeiculoModule = /** @class */ (function () {
    function AgendamentoVeiculoModule() {
    }
    AgendamentoVeiculoModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_shared_shared_module__WEBPACK_IMPORTED_MODULE_1__["SharedModule"], _agendamento_veiculo_routing_module__WEBPACK_IMPORTED_MODULE_2__["AgendamentoVeiculoRoutingModule"]],
            declarations: [_agendamento_veiculo_form_agendamento_veiculo_form_component__WEBPACK_IMPORTED_MODULE_5__["AgendamentoVeiculoFormComponent"],
                _agendamento_veiculo_index_agendamento_veiculo_index_component__WEBPACK_IMPORTED_MODULE_3__["AgendamentoVeiculoIndexComponent"],
                _agendamento_veiculo_filter_agendamento_veiculo_filter_component__WEBPACK_IMPORTED_MODULE_4__["AgendamentoVeiculoFilterComponent"],
                _agendamento_veiculo_seleciona_planejamento_agendamento_veiculo_seleciona_planejamento_component__WEBPACK_IMPORTED_MODULE_6__["AgendamentoVeiculoSelecionaPlanejamentoComponent"],
                _agendamento_veiculo_pesquisa_agendamento_veiculo_pesquisa_component__WEBPACK_IMPORTED_MODULE_7__["AgendamentoVeiculoPesquisaComponent"],
                _agendamento_veiculo_item_agendamento_veiculo_item_component__WEBPACK_IMPORTED_MODULE_8__["AgendamentoVeiculoItemComponent"],
                _agendamento_veiculo_nota_agendamento_veiculo_nota_component__WEBPACK_IMPORTED_MODULE_9__["AgendamentoVeiculoNotaComponent"],
                _agendamento_veiculo_situacao_agendamento_veiculo_situacao_component__WEBPACK_IMPORTED_MODULE_10__["AgendamentoVeiculoSituacaoComponent"],
                _agendamento_veiculo_compartimentos_agendamento_veiculo_compartimentos_component__WEBPACK_IMPORTED_MODULE_11__["AgendamentoVeiculoCompartimentosComponent"]
            ]
        })
    ], AgendamentoVeiculoModule);
    return AgendamentoVeiculoModule;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.routing.module.ts":
/*!*****************************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.routing.module.ts ***!
  \*****************************************************************************************/
/*! exports provided: AgendamentoVeiculoRoutingModule */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoRoutingModule", function() { return AgendamentoVeiculoRoutingModule; });
/* 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 app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! app/config/enumerables */ "./src/app/config/enumerables.ts");
/* harmony import */ var _agendamento_veiculo_index_agendamento_veiculo_index_component__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./agendamento-veiculo-index/agendamento-veiculo-index.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-index/agendamento-veiculo-index.component.ts");
/* harmony import */ var _agendamento_veiculo_form_agendamento_veiculo_form_component__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./agendamento-veiculo-form/agendamento-veiculo-form.component */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo-form/agendamento-veiculo-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 MRoutes = [
    {
        path: "",
        component: _agendamento_veiculo_index_agendamento_veiculo_index_component__WEBPACK_IMPORTED_MODULE_3__["AgendamentoVeiculoIndexComponent"],
        data: { breadcrumb: "agendamentoVeiculo", formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].index } }
    },
    {
        path: "create",
        component: _agendamento_veiculo_form_agendamento_veiculo_form_component__WEBPACK_IMPORTED_MODULE_4__["AgendamentoVeiculoFormComponent"],
        data: {
            breadcrumb: "agendamentoVeiculo",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].create }
        }
    },
    {
        path: "detail/:id",
        component: _agendamento_veiculo_form_agendamento_veiculo_form_component__WEBPACK_IMPORTED_MODULE_4__["AgendamentoVeiculoFormComponent"],
        data: {
            breadcrumb: "agendamentoVeiculo",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].detail }
        }
    },
    {
        path: "edit/:id",
        component: _agendamento_veiculo_form_agendamento_veiculo_form_component__WEBPACK_IMPORTED_MODULE_4__["AgendamentoVeiculoFormComponent"],
        data: {
            breadcrumb: "agendamentoVeiculo",
            formParams: { action: app_config_enumerables__WEBPACK_IMPORTED_MODULE_2__["ActionForm"].edit }
        }
    }
];
var AgendamentoVeiculoRoutingModule = /** @class */ (function () {
    function AgendamentoVeiculoRoutingModule() {
    }
    AgendamentoVeiculoRoutingModule = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_0__["NgModule"])({
            imports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"].forChild(MRoutes)],
            exports: [_angular_router__WEBPACK_IMPORTED_MODULE_1__["RouterModule"]]
        })
    ], AgendamentoVeiculoRoutingModule);
    return AgendamentoVeiculoRoutingModule;
}());



/***/ }),

/***/ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.ts":
/*!**********************************************************************************!*\
  !*** ./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.service.ts ***!
  \**********************************************************************************/
/*! exports provided: AgendamentoVeiculoService */
/***/ (function(module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AgendamentoVeiculoService", function() { return AgendamentoVeiculoService; });
/* 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_base_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../shared/services/base/base.service */ "./src/app/shared/services/base/base.service.ts");
/* harmony import */ var _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./../../../shared/services/message/message.service */ "./src/app/shared/services/message/message.service.ts");
/* harmony import */ var _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./agendamento-veiculo.model */ "./src/app/pages/veiculo/agendamento-veiculo/agendamento-veiculo.model.ts");
/* harmony import */ var environments_environment__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! environments/environment */ "./src/environments/environment.ts");
/* harmony import */ var app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! app/app.error-handler */ "./src/app/app.error-handler.ts");
/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ "./node_modules/rxjs/_esm5/operators/index.js");
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 AgendamentoVeiculoService = /** @class */ (function (_super) {
    __extends(AgendamentoVeiculoService, _super);
    function AgendamentoVeiculoService(http, message) {
        var _this = _super.call(this, http, "veiculos/agendamentoVeiculo") || this;
        _this.http = http;
        _this.message = message;
        _this.data = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_4__["AgendamentoVeiculo"]();
        _this.filter = new _agendamento_veiculo_model__WEBPACK_IMPORTED_MODULE_4__["AgendamentoVeiculoFilter"]();
        _this.listaHorarios = [];
        _this.configsPTL = {
            vrfPlanejDescarga: false,
            vrfPlanejCarga: false,
            obrigaTipoCarreg: false,
            solDestMerc: false,
            agQtDiasAgendamento: 0,
            gradeAgendamento: false,
            cargaCompartimentada: false,
            tipoAgCapacQuant: "",
            agCapacLitrosQuilos: "",
            integracaoPortolog: false,
            agUtilizarTipofrete: false,
            obrTipoFrete: false,
            integracaoCodesp: false,
            integracaoSAP: false
        };
        _this.configsUNI = {
            utilizDivCliAgend: false,
        };
        _this.configsCTV = {
            obrRequisicaoCarga: false,
        };
        _this.configsBAL = {
            maskTrem: "",
            maskPlaca: "",
        };
        _this.configsWEB = {
            cWebModProgramVeic: "",
        };
        return _this;
    }
    Object.defineProperty(AgendamentoVeiculoService.prototype, "isDescarga", {
        get: function () {
            return !!this.data && this.data.tipoMov === "D";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoService.prototype, "isCarga", {
        get: function () {
            return !!this.data && this.data.tipoMov === "C";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoService.prototype, "isRodoviario", {
        get: function () {
            return !!this.data && this.data.modal === "R";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoService.prototype, "isFerroviario", {
        get: function () {
            return !!this.data && this.data.modal === "F";
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(AgendamentoVeiculoService.prototype, "requiredRegPlanejCarga", {
        get: function () {
            return (this.configsPTL.vrfPlanejDescarga && this.isDescarga) || (this.configsPTL.vrfPlanejCarga && this.isCarga);
        },
        enumerable: true,
        configurable: true
    });
    AgendamentoVeiculoService.prototype.carregarHorariosDisponiveis = function () {
        var _this = this;
        var data = this.data;
        if (!data.dtPrevisaoChegada || !(data.dtPrevisaoChegada instanceof Date)) {
            this.data.horario = null;
            return;
        }
        this.getHorarioDisponivelAgenda(this.data).subscribe({
            next: function (horarios) {
                var novosHorarios = horarios.map(function (h) { return h.horario; });
                // Mesclar com os existentes, sem duplicar
                var todosHorarios = _this.listaHorarios.concat(novosHorarios);
                var horariosUnicos = Array.from(new Set(todosHorarios));
                // Ordenar horários (assumindo formato 'HH:mm')
                horariosUnicos.sort(function (a, b) { return a.localeCompare(b); });
                _this.listaHorarios = horariosUnicos;
                // Se o horário atual não estiver mais na lista, define o primeiro
                if (!_this.listaHorarios.includes(_this.data.horario)) {
                    _this.data.horario = _this.listaHorarios.length > 0 ? _this.listaHorarios[0] : null;
                }
            },
            error: function () { }
        });
    };
    AgendamentoVeiculoService.prototype.verificaStatus = function (dados) {
        if (dados.flagStatus === 'C') {
            this.message.warning("titles.agendamentoVeiculo", "messages.agendamentoConcluido");
            return false;
        }
        if (this.configsPTL.integracaoPortolog) {
            if (dados.flagStatus === '2') {
                this.message.warning("titles.agendamentoVeiculo", "messages.agendamentoAguardandoAprovacaoPortolog");
                return false;
            }
        }
        if (dados.flagStatus === 'A' && dados.numeroDLe > 0) {
            this.message.warning("titles.agendamentoVeiculo", "messages.agendamentoAprovadoPortolog");
            return false;
        }
        if (dados.regLogXmlGeraDLePortolog > 0) {
            this.message.warning("titles.agendamentoVeiculo", "messages.agendamentoEnviadoPortolog");
            return false;
        }
        if (this.configsPTL.integracaoCodesp) {
            if (dados.sitReg === 'G') {
                this.message.warning("titles.agendamentoVeiculo", "messages.agendamentoAguardandoAutorizacao");
                return false;
            }
        }
        if (this.configsPTL.integracaoSAP) {
            if (dados.flagStatus !== 'N' && dados.flagIntegracao !== 'N') {
                this.message.warning("titles.agendamentoVeiculo", "messages.agendamentoIntegradoSAP");
                return false;
            }
        }
        return true;
    };
    AgendamentoVeiculoService.prototype.podeEditar = function (dados) {
        if (!this.verificaStatus(dados)) {
            return false;
        }
        if (dados.flagStatus === 'E') {
            this.message.warning("titles.agendamentoVeiculo", "messages.acaoNaoPermitidaConcluidoCanceladoEncerrado");
            return false;
        }
        return true;
    };
    AgendamentoVeiculoService.prototype.podeExcluir = function (dados) {
        return this.verificaStatus(dados);
    };
    AgendamentoVeiculoService.prototype.getByFiltro = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/filter", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.prototype.getAgendamentoVeiculoById = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/getAgendamentoVeiculoById", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.prototype.getValidaNfeDuplicada = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/getValidaNfeDuplicada", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.prototype.executarRotinaRegPlaneja = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/executarRotinaRegPlaneja", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.prototype.getSelecionaPlanejamento = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/getSelecionaPlanejamento", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.prototype.pesquisaCarregarAgendamento = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/pesquisaCarregarAgendamento", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.prototype.carregarVolumesCompartimentos = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/carregarVolumesCompartimentos", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.prototype._save = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/grava", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.prototype._remove = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/cancela", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.prototype.getHorarioDisponivelAgenda = function (data) {
        return this.http
            .post(environments_environment__WEBPACK_IMPORTED_MODULE_5__["environment"].service_url + "/api/v1/veiculos/agendamentoVeiculo/getHorarioDisponivelAgenda", data)
            .pipe(Object(rxjs_operators__WEBPACK_IMPORTED_MODULE_7__["catchError"])(app_app_error_handler__WEBPACK_IMPORTED_MODULE_6__["ErrorHandler"].handleError));
    };
    AgendamentoVeiculoService.ctorParameters = function () { return [
        { type: _angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"] },
        { type: _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"] }
    ]; };
    AgendamentoVeiculoService = __decorate([
        Object(_angular_core__WEBPACK_IMPORTED_MODULE_1__["Injectable"])({
            providedIn: 'root'
        }),
        __metadata("design:paramtypes", [_angular_common_http__WEBPACK_IMPORTED_MODULE_0__["HttpClient"],
            _shared_services_message_message_service__WEBPACK_IMPORTED_MODULE_3__["MessageService"]])
    ], AgendamentoVeiculoService);
    return AgendamentoVeiculoService;
}(_shared_services_base_base_service__WEBPACK_IMPORTED_MODULE_2__["BaseService"]));



/***/ })

}]);
//# sourceMappingURL=app-pages-veiculo-agendamento-veiculo-agendamento-veiculo-module.js.map