From 56bda38acdf7ceb42176d7d48823ddad311b1df0 Mon Sep 17 00:00:00 2001 From: Marcelo Machado Date: Wed, 18 Oct 2023 14:15:52 -0300 Subject: [PATCH] style: Melhoria na responsividade --- efi.php | 38 +- efi/gerencianet_lib/css/viewInvoiceModal.css | 87 ++- efi/gerencianet_lib/functions/gateway/PIX.php | 1 - .../html/viewInvoiceModal.html | 123 +--- .../scripts/js/autoComplete/autoComplete.js | 512 ++++++------- efi/gerencianet_lib/scripts/js/copyQrCode.js | 10 +- efi/gerencianet_lib/scripts/js/efi.min.js | 85 +++ .../scripts/js/validation/validation.js | 683 +++++++++--------- .../scripts/js/viewInvoiceModal.js | 218 +----- 9 files changed, 842 insertions(+), 915 deletions(-) create mode 100644 efi/gerencianet_lib/scripts/js/efi.min.js diff --git a/efi.php b/efi.php index 6e57c03..973bab5 100644 --- a/efi.php +++ b/efi.php @@ -619,27 +619,31 @@ function efi_link($gatewayParams) $apiEnvironment = ($gatewayParams['sandbox'] == 'on') ? "sandbox" : "api"; - $scriptGetPaymentToken = ""; - - - - - $paymentOptionsScript = " + - $scriptGetPaymentToken - - - - - - - - $autoCompleteFields - - $autoCompletetotal + "; diff --git a/efi/gerencianet_lib/css/viewInvoiceModal.css b/efi/gerencianet_lib/css/viewInvoiceModal.css index 35470b4..449be46 100644 --- a/efi/gerencianet_lib/css/viewInvoiceModal.css +++ b/efi/gerencianet_lib/css/viewInvoiceModal.css @@ -1,3 +1,17 @@ +.optionPaymentGerencianet::-webkit-scrollbar, +.optionPaymentGerencianet *::-webkit-scrollbar { + width: 4px; + /* Largura da barra de rolagem vertical */ +} + +.optionPaymentGerencianet::-webkit-scrollbar-thumb, +.optionPaymentGerencianet *::-webkit-scrollbar-thumb { + background-color: #FF8C52; + /* Cor de fundo da barra de rolagem */ + border-radius: 5px; + /* Raio das bordas da barra de rolagem */ +} + .botao { background-color: #f26522; background-image: url("../images/gn-cinza.png"); @@ -43,10 +57,6 @@ left: 0; } -.obrigatorio { - color: red !important; -} - .optionsPaymentsMethods { display: flex !important; } @@ -72,6 +82,7 @@ .pay_option_container img { width: 1.5em !important; + margin: 0; } .pay_option_container input { @@ -95,7 +106,7 @@ display: flex !important; flex-direction: column !important; justify-content: space-around !important; - padding-left: 5px !important; + align-items: baseline; } .labelPayment label { @@ -121,6 +132,7 @@ .optionSelected input { height: 30px !important; + border: 1px solid #ccc !important; border-radius: 5px!important; padding: 5px !important; } @@ -152,6 +164,7 @@ .meuPopUp h3 { margin-top: 5% !important; + font-size: 23px !important; } .optionPaymentGerencianet { @@ -173,6 +186,7 @@ .meuPopUp { background-color: white !important; min-width: 55% !important; + height: 99%; padding: 30px !important; z-index: 200000 !important; display: flex; @@ -185,7 +199,29 @@ .meuPopUp form { display: flex !important; flex-direction: column !important; - height: 100%; + overflow-y: scroll !important; + overflow-x: hidden; + padding: 2px; +} + +@keyframes modal { + from { + opacity: 0; + transform: translate3d(0, -60px, 0); + } + to { + opacity: 1; + transform: translate3d(0, 0, 0); + } +} + +.mostrar .meuPopUp { + animation: modal .6s; +} + +.optionPaymentGerencianet, +.optionPaymentGerencianet * { + color: black !important; } .button { @@ -204,26 +240,24 @@ border-radius: 5px !important; } -@keyframes modal { - from { - opacity: 0; - transform: translate3d(0, -60px, 0); - } - to { - opacity: 1; - transform: translate3d(0, 0, 0); - } +.button:hover { + background-color: #ff9c4d !important; } -.mostrar .meuPopUp { - animation: modal .6s; +.obrigatorio { + color: red !important; +} + +.form-group label, +.form-group input, +.form-group select { + font-size: 15px !important; } @media screen and (max-width: 1401px) { .meuPopUp { width: 80% !important; } - .labelPayment label, .formularios span { font-weight: 600 !important; @@ -236,10 +270,9 @@ font-size: 1rem !important; } .meuPopUp { - width: 95% !important; + width: 100% !important; border: 4px solid #f3722c !important; } - .labelPayment label, .formularios span { font-weight: 600 !important; @@ -248,6 +281,9 @@ } @media screen and (max-width: 450px) { + .button { + width: 100% !important; + } .optionPaymentGerencianet { padding: 0; width: 100vw !important; @@ -289,12 +325,16 @@ font-weight: 600 !important; font-size: 4.2vw !important; } - .labelPayment { - padding-left: 10px !important; - } .labelPayment label { gap: 12px; } + .meuPopUp h3 { + font-size: 1.75rem !important; + } + .form-group label, + .form-group input { + font-size: 3.7vw !important; + } } #labelCartao { @@ -321,6 +361,7 @@ .optionSelected .checkNormal { height: auto !important; + position: initial; } .fechar:hover { diff --git a/efi/gerencianet_lib/functions/gateway/PIX.php b/efi/gerencianet_lib/functions/gateway/PIX.php index c9249bd..ff62cba 100644 --- a/efi/gerencianet_lib/functions/gateway/PIX.php +++ b/efi/gerencianet_lib/functions/gateway/PIX.php @@ -426,7 +426,6 @@ function btnConfirm() { padding: 10px; border: none; border-radius: 5px; - font-size: 16px; margin-top: 3px; font-weight: bold; width:240px; diff --git a/efi/gerencianet_lib/html/viewInvoiceModal.html b/efi/gerencianet_lib/html/viewInvoiceModal.html index 3208902..d5bdb7e 100644 --- a/efi/gerencianet_lib/html/viewInvoiceModal.html +++ b/efi/gerencianet_lib/html/viewInvoiceModal.html @@ -1,9 +1,9 @@ -
+
-
+
-
+
@@ -62,56 +62,11 @@

Escolha um método de pagamento:

- -
+
@@ -121,30 +76,30 @@

Escolha um método de pagamento:

-
+
-
+
-
+
-
- +
+
-
+
Dados do titular do cartão: @@ -153,29 +108,29 @@

Escolha um método de pagamento:

-
+
-
+
-
+
-
+
-
+
@@ -183,34 +138,34 @@

Escolha um método de pagamento:

-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -296,7 +251,7 @@

Escolha um método de pagamento:

-
+
icon billet @@ -318,7 +273,7 @@

Escolha um método de pagamento:

-
+
@@ -367,7 +322,7 @@

Escolha um método de pagamento:

-
+
Optando por pagar via Pix, o pagamento é processado e a confirmação ocorrerá em alguns segundos. @@ -376,11 +331,11 @@

Escolha um método de pagamento:

-
+
-
+
@@ -388,7 +343,7 @@

Escolha um método de pagamento:

-
+
@@ -400,33 +355,31 @@

Escolha um método de pagamento:

-
+
-
+
-
+
- -
- -
+ +
-
-
- +
+
+
diff --git a/efi/gerencianet_lib/scripts/js/autoComplete/autoComplete.js b/efi/gerencianet_lib/scripts/js/autoComplete/autoComplete.js index ceeaf61..8f82055 100644 --- a/efi/gerencianet_lib/scripts/js/autoComplete/autoComplete.js +++ b/efi/gerencianet_lib/scripts/js/autoComplete/autoComplete.js @@ -1,262 +1,264 @@ -//---------------------------------Envia as funções Autocomplete para o arquivo viewInvoiceModal.js ---- -function getClientDocument(attributes) { - let documentoEncontrado = null; - $(attributes.customFields).each(function(indexInArray, field) { - let documento = field.value.replace(/\D/g, ''); - - if (verifyCPF(documento) || verifyCNPJ(documento)) { - documentoEncontrado = documento; - return false; // interrompe o loop - } - }); - return documentoEncontrado; -} - -function autoComplete() { - $.get('modules/gateways/efi/gerencianet_lib/functions/frontend/ajax/ClientDataAjaxHandler.php', function(data) { - let cliente = {}; - const attributes = JSON.parse(data); - cliente.telefone = attributes.phoneNumber.split('.')[1]; - cliente.fullName = `${attributes.firstName} ${attributes.lastName}`; - cliente.email = attributes.email; - cliente.rua = attributes.address1.split(',')[0]; - cliente.numero = attributes.address1.split(',')[1]; - cliente.cidade = attributes.city; - cliente.cep = attributes.postcode.replace('-', ''); - cliente.estado = attributes.state; - cliente.documento = getClientDocument(attributes); - - - autocompleteBillet(cliente); - autocompleteCredit(cliente); - autocompletePix(cliente); - autocompleteOpenFinance(cliente); - - }); -} - -function autocompleteOpenFinance(cliente) { - const inputsAnimation = [ - cliente.documento.length == 11 ? { - inputName: "#documentClientOF", +(function() { + function getClientDocument(attributes) { + let documentoEncontrado = null; + $(attributes.customFields).each(function(indexInArray, field) { + let documento = field.value.replace(/\D/g, ''); + + if (verifyCPF(documento) || verifyCNPJ(documento)) { + documentoEncontrado = documento; + return false; // interrompe o loop + } + }); + return documentoEncontrado; + } + + function autoComplete() { + $.get('modules/gateways/efi/gerencianet_lib/functions/frontend/ajax/ClientDataAjaxHandler.php', function(data) { + let cliente = {}; + const attributes = JSON.parse(data); + cliente.telefone = attributes.phoneNumber.split('.')[1]; + cliente.fullName = `${attributes.firstName} ${attributes.lastName}`; + cliente.email = attributes.email; + cliente.rua = attributes.address1.split(',')[0]; + cliente.numero = attributes.address1.split(',')[1]; + cliente.cidade = attributes.city; + cliente.cep = attributes.postcode.replace('-', ''); + cliente.estado = attributes.state; + cliente.documento = getClientDocument(attributes); + + + autocompleteBillet(cliente); + autocompleteCredit(cliente); + autocompletePix(cliente); + autocompleteOpenFinance(cliente); + + }); + } + + function autocompleteOpenFinance(cliente) { + const inputsAnimation = [ + cliente.documento.length == 11 ? { + inputName: "#documentClientOF", + inputValue: cliente.documento + } : { + inputName: "#documentPJClientOF", + inputValue: cliente.documento + } + ]; + + applyAnimations(inputsAnimation) + $('#autocompleteOpenFinance').click(() => { + if ($('#autocompleteOpenFinance').is(':checked')) { + applyAnimations(inputsAnimation) + } else { + const inputsDefaultValue = [{ + inputName: "#documentClientOF", + inputValue: '' + }, + { + inputName: "#documentPJClientOF", + inputValue: '' + }, + ]; + applyAnimations(inputsDefaultValue) + } + + }) + + $('#autocompleteOpenFinance').prop('checked', true); + + } + + // ------------------------------------- Auto Complete Boleto --------------------------------------------- + + function autocompleteBillet(cliente) { + const inputsAnimation = [{ + inputName: "#nameBillet", + inputValue: cliente.fullName + }, { + inputName: "#clientEmailBillet", + inputValue: cliente.email + }, { + inputName: "#documentClientBillet", inputValue: cliente.documento - } : { - inputName: "#documentPJClientOF", + }, { + inputName: "#telephoneBillet", + inputValue: cliente.telefone + }]; + applyAnimations(inputsAnimation) + + $('#autocompleteBillet').click(() => { + if ($('#autocompleteBillet').is(':checked')) { + applyAnimations(inputsAnimation) + } else { + const inputsDefaultValue = [{ + inputName: "#nameBillet", + inputValue: '' + }, { + inputName: "#clientEmailBillet", + inputValue: '' + }, { + inputName: "#documentClientBillet", + inputValue: '' + }, { + inputName: "#telephoneBillet", + inputValue: '' + }]; + applyAnimations(inputsDefaultValue) + } + + }) + + + + $('#autocompleteBillet').prop('checked', true); + + } + // ------------------------------------- Autocomplete Pix --------------------------------------------- + + function autocompletePix(cliente) { + const inputsAnimation = [{ + inputName: "#clientNamePix", + inputValue: cliente.fullName + }, { + inputName: "#documentClientPix", inputValue: cliente.documento - } - ]; - - applyAnimations(inputsAnimation) - $('#autocompleteOpenFinance').click(() => { - if ($('#autocompleteOpenFinance').is(':checked')) { - applyAnimations(inputsAnimation) - } else { - const inputsDefaultValue = [{ - inputName: "#documentClientOF", + }]; + applyAnimations(inputsAnimation) + $('#autocompletePix').prop('checked', true); + + + $('#autocompletePix').click(() => { + if ($('#autocompletePix').is(':checked')) { + applyAnimations(inputsAnimation) + + } else { + const inputsDefaultValue = [{ + inputName: "#clientNamePix", inputValue: '' - }, - { - inputName: "#documentPJClientOF", + }, { + inputName: "#documentClientPix", + inputValue: '' + }]; + applyAnimations(inputsDefaultValue) + } + + }) + } + + // ------------------------------------- Autocomplete Cartão --------------------------------------------- + + function autocompleteCredit(cliente) { + const inputsAnimation = [{ + inputName: "#nameCredit", + inputValue: cliente.fullName + }, { + inputName: "#clientEmailCredit", + inputValue: cliente.email + }, { + inputName: "#documentClientCredit", + inputValue: cliente.documento + }, { + inputName: "#telephoneCredit", + inputValue: cliente.telefone + }, { + inputName: "#rua", + inputValue: cliente.rua + }, { + inputName: "#numero", + inputValue: cliente.numero + }, { + inputName: "#cidade", + inputValue: cliente.cidade + }, { + inputName: "#bairro", + inputValue: cliente.bairro + }, { + inputName: "#cep", + inputValue: cliente.cep + }, { + inputName: "#estado", + inputValue: cliente.estado + }, { + inputName: "#dataNasce", + inputValue: '' + }]; + + applyAnimations(inputsAnimation) + + + + $('#autocompleteCredit').prop('checked', true); + + $('#autocompleteCredit').click(() => { + + if ($('#autocompleteCredit').is(':checked')) { + applyAnimations(inputsAnimation) + + + + } else { + const inputsDefaultValue = [{ + inputName: "#nameCredit", inputValue: '' - }, - ]; - applyAnimations(inputsDefaultValue) - } - - }) - - $('#autocompleteOpenFinance').prop('checked', true); - -} - -// ------------------------------------- Auto Complete Boleto --------------------------------------------- - -function autocompleteBillet(cliente) { - const inputsAnimation = [{ - inputName: "#nameBillet", - inputValue: cliente.fullName - }, { - inputName: "#clientEmailBillet", - inputValue: cliente.email - }, { - inputName: "#documentClientBillet", - inputValue: cliente.documento - }, { - inputName: "#telephoneBillet", - inputValue: cliente.telefone - }]; - applyAnimations(inputsAnimation) - - $('#autocompleteBillet').click(() => { - if ($('#autocompleteBillet').is(':checked')) { - applyAnimations(inputsAnimation) - } else { - const inputsDefaultValue = [{ - inputName: "#nameBillet", - inputValue: '' - }, { - inputName: "#clientEmailBillet", - inputValue: '' - }, { - inputName: "#documentClientBillet", - inputValue: '' - }, { - inputName: "#telephoneBillet", - inputValue: '' - }]; - applyAnimations(inputsDefaultValue) - } - - }) - - - - $('#autocompleteBillet').prop('checked', true); - -} -// ------------------------------------- Autocomplete Pix --------------------------------------------- - -function autocompletePix(cliente) { - const inputsAnimation = [{ - inputName: "#clientNamePix", - inputValue: cliente.fullName - }, { - inputName: "#documentClientPix", - inputValue: cliente.documento - }]; - applyAnimations(inputsAnimation) - $('#autocompletePix').prop('checked', true); - - - $('#autocompletePix').click(() => { - if ($('#autocompletePix').is(':checked')) { - applyAnimations(inputsAnimation) - - } else { - const inputsDefaultValue = [{ - inputName: "#clientNamePix", - inputValue: '' - }, { - inputName: "#documentClientPix", - inputValue: '' - }]; - applyAnimations(inputsDefaultValue) - } - - }) -} - -// ------------------------------------- Autocomplete Cartão --------------------------------------------- - -function autocompleteCredit(cliente) { - const inputsAnimation = [{ - inputName: "#nameCredit", - inputValue: cliente.fullName - }, { - inputName: "#clientEmailCredit", - inputValue: cliente.email - }, { - inputName: "#documentClientCredit", - inputValue: cliente.documento - }, { - inputName: "#telephoneCredit", - inputValue: cliente.telefone - }, { - inputName: "#rua", - inputValue: cliente.rua - }, { - inputName: "#numero", - inputValue: cliente.numero - }, { - inputName: "#cidade", - inputValue: cliente.cidade - }, { - inputName: "#bairro", - inputValue: cliente.bairro - }, { - inputName: "#cep", - inputValue: cliente.cep - }, { - inputName: "#estado", - inputValue: cliente.estado - }, { - inputName: "#dataNasce", - inputValue: '' - }]; - - applyAnimations(inputsAnimation) - - - - $('#autocompleteCredit').prop('checked', true); - - $('#autocompleteCredit').click(() => { - - if ($('#autocompleteCredit').is(':checked')) { - applyAnimations(inputsAnimation) - - - - } else { - const inputsDefaultValue = [{ - inputName: "#nameCredit", - inputValue: '' - }, { - inputName: "#clientEmailCredit", - inputValue: '' - }, { - inputName: "#documentClientCredit", - inputValue: '' - }, { - inputName: "#telephoneCredit", - inputValue: '' - }, { - inputName: "#rua", - inputValue: '' - }, { - inputName: "#numero", - inputValue: '' - }, { - inputName: "#cidade", - inputValue: '' - }, { - inputName: "#bairro", - inputValue: '' - }, { - inputName: "#cep", - inputValue: '' - }, { - inputName: "#estado", - inputValue: '' - }, { - inputName: "#dataNasce", - inputValue: '' - }]; - applyAnimations(inputsDefaultValue) - - - - } - - }) -} - -function applyAnimations(inputs) { - inputs.forEach((inputObj) => { - // Seleciona o elemento input - let input = $(`${inputObj.inputName}`); - - // Anima a opacidade do elemento para zero - input.animate({ opacity: 0 }, 500, function() { - // Quando a animação terminar, atualiza o valor do input - input.val(inputObj.inputValue); - input.trigger('keydown'); - input.trigger('input'); - - // Anima a opacidade do elemento de volta para 1 - input.animate({ opacity: 1 }, 500); + }, { + inputName: "#clientEmailCredit", + inputValue: '' + }, { + inputName: "#documentClientCredit", + inputValue: '' + }, { + inputName: "#telephoneCredit", + inputValue: '' + }, { + inputName: "#rua", + inputValue: '' + }, { + inputName: "#numero", + inputValue: '' + }, { + inputName: "#cidade", + inputValue: '' + }, { + inputName: "#bairro", + inputValue: '' + }, { + inputName: "#cep", + inputValue: '' + }, { + inputName: "#estado", + inputValue: '' + }, { + inputName: "#dataNasce", + inputValue: '' + }]; + applyAnimations(inputsDefaultValue) + + + + } + + }) + } + + function applyAnimations(inputs) { + inputs.forEach((inputObj) => { + // Seleciona o elemento input + let input = $(`${inputObj.inputName}`); + + // Anima a opacidade do elemento para zero + input.animate({ opacity: 0 }, 500, function() { + // Quando a animação terminar, atualiza o valor do input + input.val(inputObj.inputValue); + input.trigger('keydown'); + input.trigger('input'); + + // Anima a opacidade do elemento de volta para 1 + input.animate({ opacity: 1 }, 500); + }); }); - }); -} \ No newline at end of file + } + window.autoComplete = autoComplete; +})(); \ No newline at end of file diff --git a/efi/gerencianet_lib/scripts/js/copyQrCode.js b/efi/gerencianet_lib/scripts/js/copyQrCode.js index d8ba7a2..b9f8e30 100644 --- a/efi/gerencianet_lib/scripts/js/copyQrCode.js +++ b/efi/gerencianet_lib/scripts/js/copyQrCode.js @@ -20,8 +20,12 @@ function copyQrCode(textToCopy) { setTimeout(() => (button.innerHTML = "Copiar QR Code"), 1e3); } // Displays the QRCode in PDF printing -$( ".payment-btn-container" ).removeClass( "d-print-none" ); +$(".payment-btn-container").removeClass("d-print-none"); + +window.onload = function() { + let element = document.querySelector("body > div.container-fluid.invoice-container > div:nth-child(4) > div.col-12.col-sm-6.order-sm-last.text-sm-right.invoice-col.right"); + if (element != null) { + element.innerHTML = ""; + } -window.onload = function () { - document.querySelector("body > div.container-fluid.invoice-container > div:nth-child(4) > div.col-12.col-sm-6.order-sm-last.text-sm-right.invoice-col.right").innerHTML = "" }; \ No newline at end of file diff --git a/efi/gerencianet_lib/scripts/js/efi.min.js b/efi/gerencianet_lib/scripts/js/efi.min.js new file mode 100644 index 0000000..7de3ec7 --- /dev/null +++ b/efi/gerencianet_lib/scripts/js/efi.min.js @@ -0,0 +1,85 @@ +(()=>{var a={939:()=>{function l(e){e.forEach(e=>{let t=$(""+e.inputName);t.animate({opacity:0},500,function(){t.val(e.inputValue),t.trigger("keydown"),t.trigger("input"),t.animate({opacity:1},500)})})}window.autoComplete=function(){$.get("modules/gateways/efi/gerencianet_lib/functions/frontend/ajax/ClientDataAjaxHandler.php",function(e){var t={},e=JSON.parse(e);t.telefone=e.phoneNumber.split(".")[1],t.fullName=e.firstName+" "+e.lastName,t.email=e.email,t.rua=e.address1.split(",")[0],t.numero=e.address1.split(",")[1],t.cidade=e.city,t.cep=e.postcode.replace("-",""),t.estado=e.state,t.documento=function(e){let a=null;return $(e.customFields).each(function(e,t){t=t.value.replace(/\D/g,"");if(verifyCPF(t)||verifyCNPJ(t))return a=t,!1}),a}(e);{const a=[{inputName:"#nameBillet",inputValue:(e=t).fullName},{inputName:"#clientEmailBillet",inputValue:e.email},{inputName:"#documentClientBillet",inputValue:e.documento},{inputName:"#telephoneBillet",inputValue:e.telefone}];l(a),$("#autocompleteBillet").click(()=>{$("#autocompleteBillet").is(":checked")?l(a):l([{inputName:"#nameBillet",inputValue:""},{inputName:"#clientEmailBillet",inputValue:""},{inputName:"#documentClientBillet",inputValue:""},{inputName:"#telephoneBillet",inputValue:""}])}),$("#autocompleteBillet").prop("checked",!0)}{const n=[{inputName:"#nameCredit",inputValue:(e=t).fullName},{inputName:"#clientEmailCredit",inputValue:e.email},{inputName:"#documentClientCredit",inputValue:e.documento},{inputName:"#telephoneCredit",inputValue:e.telefone},{inputName:"#rua",inputValue:e.rua},{inputName:"#numero",inputValue:e.numero},{inputName:"#cidade",inputValue:e.cidade},{inputName:"#bairro",inputValue:e.bairro},{inputName:"#cep",inputValue:e.cep},{inputName:"#estado",inputValue:e.estado},{inputName:"#dataNasce",inputValue:""}];l(n),$("#autocompleteCredit").prop("checked",!0),$("#autocompleteCredit").click(()=>{$("#autocompleteCredit").is(":checked")?l(n):l([{inputName:"#nameCredit",inputValue:""},{inputName:"#clientEmailCredit",inputValue:""},{inputName:"#documentClientCredit",inputValue:""},{inputName:"#telephoneCredit",inputValue:""},{inputName:"#rua",inputValue:""},{inputName:"#numero",inputValue:""},{inputName:"#cidade",inputValue:""},{inputName:"#bairro",inputValue:""},{inputName:"#cep",inputValue:""},{inputName:"#estado",inputValue:""},{inputName:"#dataNasce",inputValue:""}])})}{const o=[{inputName:"#clientNamePix",inputValue:(e=t).fullName},{inputName:"#documentClientPix",inputValue:e.documento}];l(o),$("#autocompletePix").prop("checked",!0),$("#autocompletePix").click(()=>{$("#autocompletePix").is(":checked")?l(o):l([{inputName:"#clientNamePix",inputValue:""},{inputName:"#documentClientPix",inputValue:""}])})}{const i=[11==(e=t).documento.length?{inputName:"#documentClientOF",inputValue:e.documento}:{inputName:"#documentPJClientOF",inputValue:e.documento}];l(i),$("#autocompleteOpenFinance").click(()=>{$("#autocompleteOpenFinance").is(":checked")?l(i):l([{inputName:"#documentClientOF",inputValue:""},{inputName:"#documentPJClientOF",inputValue:""}])}),$("#autocompleteOpenFinance").prop("checked",!0)}})}},929:function(e,t,a){var n,o,i={scope:{},findInternal:function(e,t,a){for(var n=(e=e instanceof String?String(e):e).length,o=0;oo?a=10*t:n>=a&&n!==o?y.maskDigitPosMapOld[a]||(n=a,a=a-(r-l)-e,y.maskDigitPosMap[a]&&(a=n)):a>n&&(a=a+(l-r)+i)}return a},behaviour:function(e){e=e||window.event;y.invalid=[];var t=c.data("mask-keycode");if(-1===l.inArray(t,k.byPassKeys)){var t=y.getMasked(),a=y.getCaret();setTimeout(function(){y.setCaret(y.calculateCaretPosition())},l.jMaskGlobals.keyStrokeCompensation);y.val(t);y.setCaret(a);return y.callbacks(e)}},getMasked:function(e,t){var a=[],n=void 0===t?y.val():t+"",o=0,i=b.length,l=0,r=n.length,s=1,c="push",d=-1,u=0,p=[],m,$;C.reverse?(c="unshift",s=-1,m=0,o=i-1,l=r-1,$=function(){return-1{function y(...t){let a="";for(let e=0;e + O campo ${t[e].nome} não foi preenchido. +
+ `);return a}function k(e){if(""==(e=e.replace(/[^\d]+/g,""))||11!=e.length)return!1;var t,a=0;if("00000000000"==e||"11111111111"==e||"22222222222"==e||"33333333333"==e||"44444444444"==e||"55555555555"==e||"66666666666"==e||"77777777777"==e||"88888888888"==e||"99999999999"==e||"12345678909"==e)return!1;for(i=1;i<=9;i++)a+=parseInt(e.substring(i-1,i))*(11-i);if((t=10!=(t=10*a%11)&&11!=t?t:0)!=parseInt(e.substring(9,10)))return!1;for(a=0,i=1;i<=10;i++)a+=parseInt(e.substring(i-1,i))*(12-i);return(t=10!=(t=10*a%11)&&11!=t?t:0)==parseInt(e.substring(10,11))}function F(e){if(""==(e=e.replace(/[^\d]+/g,""))||14!=e.length)return!1;if("00000000000000"==e||"11111111111111"==e||"22222222222222"==e||"33333333333333"==e||"44444444444444"==e||"55555555555555"==e||"66666666666666"==e||"77777777777777"==e||"88888888888888"==e||"99999999999999"==e)return!1;var t=e.length-2,a=e.substring(0,t),n=e.substring(t),o=0,l=t-7;for(i=t;1<=i;i--)o+=a.charAt(t-i)*l--,l<2&&(l=9);if((o%11<2?0:11-o%11)!=n.charAt(0))return!1;for(a=e.substring(0,t+=1),o=0,l=t-7,i=t;1<=i;i--)o+=a.charAt(t-i)*l--,l<2&&(l=9);return(o%11<2?0:11-o%11)==n.charAt(1)}function x(e){return!!new RegExp(/^[1-9]{2}9?[0-9]{8}$/).test(e.replace(/[^\d]+/g,""))}function w(e){return new RegExp(/^([a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+(\.[a-z\d!#$%&'*+\-\/=?^_`{|}~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+)*|"((([ \t]*\r\n)?[ \t]+)?([\x01-\x08\x0b\x0c\x0e-\x1f\x7f\x21\x23-\x5b\x5d-\x7e\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|\\[\x01-\x09\x0b\x0c\x0d-\x7f\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))*(([ \t]*\r\n)?[ \t]+)?")@(([a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\d\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.)+([a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]|[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF][a-z\d\-._~\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]*[a-z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])\.?$/).test(e)}function P(){$(".optionPaymentGerencianet,.meuPopUp").animate({scrollTop:0},800)}function A(){$(".spinner1").animate({width:"100%"},800)}window.verifyCPF=k,window.verifyCNPJ=F,window.validationForm=function(e,g){switch(e){case"billet":{var b=g;let e="",t=$("#documentClientBillet").val().replaceAll(".","").replace("-","").replace("/",""),a=$("#clientEmailBillet").val(),n=$("#telephoneBillet").val().replace("(","").replace(")","").replace(" ","").replace("-",""),o={value:$("#nameBillet").val(),nome:"Nome/Razão Social"};11==t.length?k(t)||(b.preventDefault(),P(),e+=` + + `):14==t.length?F(t)||(b.preventDefault(),P(),e+=` + + `):(b.preventDefault(),e+=` + + `);w(a)||(b.preventDefault(),e+=` + + `);0 + O campo telefone não foi preenchido corretamente. +
+ `);0 + O campo Nome/Razão Social não foi preenchido corretamente. +
+ `);P(),""==e&&(A(),$(".meuPopUp").css("opacity","0.3"),$(".meuPopUp").addClass("desabilitar"));$(".messageValidationBillet").html(e)}break;case"credit":{b=g;let e="",t=$("#documentClientCredit").val().replaceAll(".","").replace("-","").replace("/",""),a=$("#clientEmailCredit").val(),n=$("#telephoneCredit").val().replace("(","").replace(")","").replace(" ","").replace("-",""),o=$("#dataNasce").val(),i=$("#cep").val(),l=$("#nameCredit").val(),r=$("#rua").val(),s=$("#numero").val(),c=$("#bairro").val(),d=$("#cidade").val(),u="",p="",m="",v="",h="",f=$("#estado option:selected").val();h=(767<$(document).width()?(u=$("#numCartao").val(),p=$("#codSeguranca").val(),m=$("#mesVencimento option:selected").val(),v=$("#anoVencimento option:selected").val(),$("#numParcelas option:selected")):(u=$("#numCartaoMobile").val(),p=$("#codSegurancaMobile").val(),m=$("#mesVencimentoMobile option:selected").val(),v=$("#anoVencimentoMobile option:selected").val(),$("#numParcelasMobile option:selected"))).val();var C=y({value:l,nome:"Nome/Razão Social"},{value:r,nome:"Rua"},{value:s,nome:"Número"},{value:c,nome:"Bairro"},{value:d,nome:"Cidade"},{value:u,nome:"Número do cartão"},{value:p,nome:"Código de Segurança"},{value:f,nome:"Estado"},{value:m,nome:"Mês de Vencimento"},{value:v,nome:"Ano de Vencimento"},{value:h,nome:"Parcelas"});0 + O campo CPF não foi preenchido corretamente. +
+ `):14==t.length?F(t)||(b.preventDefault(),e+=` + + `):(b.preventDefault(),e+=` + + `);w(a)||(b.preventDefault(),e+=` + + `);(!x(n)||n.length<10)&&(b.preventDefault(),e+=` + + `);!function(e){var t=new Date,a=t.getFullYear(),e=e.split("-"),n=e[2],o=e[1],e=e[0],a=""==e?0:a-e,e=t.getMonth()+1;(e + O campo data de nascimento não foi preenchido corretamente. +
+ `);!function(e){return 0 + O campo CEP não foi preenchido corretamente. +
+ `);P(),""==e&&(A(),$(".meuPopUp").css("opacity","0.3"),$(".meuPopUp").addClass("desabilitar"));$(".messageValidationCredit").html(e)}break;case"pix":{C=g;let e="",t=$("#documentClientPix").val().replaceAll(".","").replace("-","").replace("/",""),a={value:$("#clientNamePix").val(),nome:"Nome/Razão Social"};11==t.length?k(t)||(C.preventDefault(),e+=` + + `):14==t.length?F(t)||(C.preventDefault(),e+=` + + `):(C.preventDefault(),e+=` + + `);0 + O campo Nome/Razão Social não foi preenchido corretamente. +
+ `);P(),""==e&&(A(),$(".meuPopUp").css("opacity","0.3"),$(".meuPopUp").addClass("desabilitar"));$(".messageValidationPix").html(e)}break;case"openfinance":{var o=g;let e="",t=$("#documentClientOF").val().replaceAll(".","").replace("-","").replace("/",""),a=$("#documentPJClientOF").val().replaceAll(".","").replace("-","").replace("/",""),n=$("#bankOF option:selected").val();""==n&&(e+=` + + `);k(t)||(e+=` + + `);""==a||F(a)||(e+=` + + `);P(),""==e?(A(),$(".meuPopUp").css("opacity","0.3"),$(".meuPopUp").addClass("desabilitar")):(o.preventDefault(),$(".messageValidationOpenFinance").html(e))}}}},486:()=>{window.onload=function(){var e=$("#apiEnvironment").val(),t=$("#identificadorDaConta").val(),a=document.createElement("script"),n=(a.type="text/javascript",parseInt(1e6*Math.random()));a.src=`https://${e}.gerencianet.com.br/v1/cdn/${t}/`+n,a.async=!1,a.id=t,document.getElementById(""+t)||document.getElementsByTagName("head")[0].appendChild(a),$gn={validForm:!0,processed:!1,done:{},ready:function(e){$gn.done=e}};document.body.insertAdjacentHTML("beforeend",''),$gn.ready(function(e){var n;n=e,$.ajax({url:"modules/gateways/efi/gerencianet_lib/html/btnViewModal.html",dataType:"html",cache:!1,success:function(t){{var a=n;document.getElementById("modal_content").insertAdjacentHTML("beforeend",t);let e=$(".botao");$(e).css("display","inline-block"),$(e).prop("disabled",!0),$(e).addClass("disabled"),setTimeout(()=>{$(e).removeAttr("disabled"),$(e).removeClass("disabled")},3e3),$(e).click(function(){$.ajax({url:"modules/gateways/efi/gerencianet_lib/css/bootstrap.min.css",dataType:"text",cache:!1,success:function(e){style=$("