{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_suzano_custom/cartridge/client/default/js/util.js","webpack:///./cartridges/app_suzano_custom/cartridge/client/default/js/loginModal.js","webpack:///./cartridges/app_suzano_custom/cartridge/client/default/js/account/registrationFields.js","webpack:///./cartridges/app_suzano_custom/cartridge/client/default/js/components/passwordVisibility.js","webpack:///./cartridges/app_suzano_custom/cartridge/client/default/js/account/login.js","webpack:///./cartridges/app_storefront_base/cartridge/client/default/js/components/formValidation.js","webpack:///./cartridges/app_suzano_custom/cartridge/client/default/js/account/loginFormFields.js"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;;;;;;;AClFa;;AAEb;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;;;;;;;;;;;;;ACnBa;;AAEb,qBAAqB,mBAAO,CAAC,oBAAQ;;AAErC;AACA,mBAAmB,mBAAO,CAAC,6BAAiB;AAC5C,mBAAmB,mBAAO,CAAC,uCAA2B;AACtD,mBAAmB,mBAAO,CAAC,6CAAiC;AAC5D,CAAC,E;;;;;;;;;;;;;ACRY;;;AAGb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;AACD;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,eAAe,aAAa;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,WAAW;AACX;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA,KAAK;;AAEL;AACA;AACA;AACA;AACA;AACA,KAAK;;;AAGL;;AAEA,CAAC;AACD;AACA;AACA;;;;;;;;;;;;;;ACtJa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA,SAAS;AACT;AACA;;;;;;;;;;;;;;ACnBa;;AAEb,qBAAqB,mBAAO,CAAC,4CAAgC;AAC7D,2BAA2B,mBAAO,CAAC,2CAA+B;;AAElE;;AAEA;AACA;AACA;AACA;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA,aAAa;AACb;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,qBAAqB;AACrB;;AAEA,qBAAqB;AACrB;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA,qBAAqB;AACrB;AACA;;AAEA;AACA;AACA,aAAa;AACb;AACA,SAAS;;AAET;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB;AACrB;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA;AACA;AACA;AACA;AACA;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","file":"./cartridges/app_suzano_custom/cartridge/static/default/js/loginModal.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"TbfV\");\n","'use strict';\n\nmodule.exports = function (include) {\n if (typeof include === 'function') {\n include();\n } else if (typeof include === 'object') {\n Object.keys(include).forEach(function (key) {\n if (typeof include[key] === 'function') {\n include[key]();\n }\n });\n }\n $('.phoneNumberCheckout').mask('(00) 0000-00009', {\n translation: {\n 9: {\n pattern: /[0-9]/\n }\n }\n });\n};\n","'use strict';\n\nvar processInclude = require('./util');\n\n$(document).ready(function () {\n processInclude(require('./account/login'));\n processInclude(require('./account/loginFormFields'));\n processInclude(require('./components/passwordVisibility'));\n});","'use strict';\n\n\n//mudança entre formulário dos dados do usuário e endereço\nfunction toggleFormRegistration(){\n $('.address-formRegistration').toggleClass('d-none');\n $('.tabAccount-formRegistration').toggleClass('d-none');\n $('.stepBar.address').toggleClass('active');\n $('.progress-count.firstStep').toggleClass('icon-check');\n $('.stepBar.registration').toggleClass('step-confirmed')\n}\n\n//limpa todos formulários de registro\nfunction resetAllForms(){\n $('form.registration').trigger('reset');\n $('form.address-formRegistration').trigger('reset');\n $('#registration-form-stateRegistration').prop('disabled', false).attr('required', true);\n $('.address-formRegistration input').removeAttr('readonly');\n $('.address-formRegistration select').removeAttr('style')\n $('form.registration input').removeClass('is-invalid');\n}\n\n//submit para criação da conta\nfunction submitRegistration(){\n $('form.address-formRegistration').submit(function (e) {\n e.preventDefault();\n var $form = $(this);\n var url = $form.attr('action');\n $form.spinner().start();\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: $form.serialize(),\n success: function (data) {\n $form.spinner().stop();\n if (!data.success) {\n formValidation($form, data);\n } else {\n location.href = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n }\n $form.spinner().stop();\n }\n });\n return false;\n});\n}\n\n$('#registration-form-cnpj').on('blur', function (e) {\n const cnpjInputed = e.target.value;\n const url = $('.midas-url')[0].value;\n const cnpj = cnpjInputed.replace(/\\.|\\/|-/g, \"\");\n const previousCnpj = sessionStorage.getItem('cnpjSession');\n \n if (cnpj !== previousCnpj) {\n $('#registration-form-corporateName').val('');\n $('#registration-form-stateRegistration').val('');\n $('#registration-form-phone2').val('');\n $('#registration-form-email').val('');\n $('#registration-form-NFemail').val('');\n // $('#registration-form-corporateName, #registration-form-stateRegistration, #registration-form-phone2, #registration-form-email').prop('readonly', false);\n $('#registration-form-corporateName, #registration-form-stateRegistration').prop('readonly', false);\n\n //second form step\n $('#zipCode').val('');\n $('#address1').val('');\n $('#addressNumber').val('');\n $('#district').val('');\n $('#city').val('');\n $('#state').val('').change();\n $('#zipCode, #address1, #addressNumber, #district, #city, #state').prop('readonly', false);\n }\n\n if (url && cnpjInputed) {\n\n $.ajax({\n url: url,\n type: 'get',\n dataType: 'json',\n data: { cnpj: cnpj },\n success: function (data) {\n if (data) {\n sessionStorage.setItem('cnpjSession', cnpj);\n $('#registration-form-corporateName').val(data.RazaoSocial);\n $('#registration-form-stateRegistration').val(data.InscricaoEstadual);\n $('#registration-form-phone2').val(data.Telefone);\n $('#registration-form-email').val(data.EnderecoEletronico.toLowerCase());\n $('#registration-form-NFemail').val(data.EnderecoEletronico.toLowerCase());\n // $('#registration-form-corporateName, #registration-form-stateRegistration, #registration-form-phone2, #registration-form-email').prop('readonly', true);\n $('#registration-form-corporateName, #registration-form-stateRegistration').prop('readonly', true);\n \n //form second step\n $('#zipCode').val(data.Endereco.CEP);\n $('#address1').val(data.Endereco.Logradouro);\n $('#addressNumber').val(data.Endereco.Numero);\n $('#district').val(data.Endereco.Bairro);\n $('#city').val(data.Endereco.Municipio);\n $('#state').val(data.Endereco.UF).change();\n $('#zipCode, #address1, #addressNumber, #district, #city, #state').prop('readonly', true);\n\n $('#registration-form-cnpj').removeClass('is-invalid');\n $('#form-cnpj-error').text('').hide();\n \n } else {\n $('#registration-form-cnpj').addClass('is-invalid');\n $('#form-cnpj-error').text('O CNPJ informado não foi localizado').show();\n }\n },\n error: function (err) {\n sessionStorage.setItem('cnpjSession', cnpj)\n $('#registration-form-cnpj').addClass('is-invalid');\n $('#form-cnpj-error').text('Erro na consulta do CNPJ').show();\n }\n });\n }\n})\n\n$(document).ready(function() {\n //CNPJ isento de inscrição estadual\n $('#exemptStateRegistration').on('change', function() {\n if ($(this).is(':checked')) {\n $('#registration-form-stateRegistration').val('').prop('disabled', true).removeAttr('required');\n } else {\n $('#registration-form-stateRegistration').prop('disabled', false).attr('required', true);\n }\n });\n\n $('.stepBar.registration,.endButtons-registration .js-goback-btn').on('click', function(){\n if($('.stepBar.registration').hasClass('step-confirmed'))\n toggleFormRegistration();\n })\n\n $('#nav-accountBusiness-tab, #nav-accountPersonal-tab').on('click',function(){\n if(!$(this).hasClass('active')){\n resetAllForms();\n $('.stepBar.registration').trigger('click').removeAttr('readonly');\n }\n })\n \n\n submitRegistration();\n\n})\nmodule.exports={\n toggleFormRegistration,\n}\n","'use strict';\n\nmodule.exports = {\n toggleChangePasswordVisibility: function () {\n $('img.password-visibility-icon').on('click', function () {\n var passwordInput = $(this).prev();\n console.log(passwordInput)\n var visibleImg = $(this).attr('data-visible');\n var notVisibleImg = $(this).attr('data-notvisible');\n\n if (passwordInput.attr('type') === 'password') {\n passwordInput.attr('type', 'text');\n $(this).attr('src', notVisibleImg);\n } else {\n passwordInput.attr('type', 'password');\n $(this).attr('src', visibleImg);\n }\n });\n }\n};\n","'use strict';\n\nvar formValidation = require('base/components/formValidation');\nvar registrationNextStep = require('../account/registrationFields');\n\n$(window).on('load', function () {\n\n setTimeout(function () {\n $('form.login').removeClass('d-none');\n $('form.registration').removeClass('d-none');\n $('.myAccountHeader-unlogged .form-group input').on('input', function() {\n $('form.login .alert-danger').fadeOut();\n });\n \n // submit login\n $('form.login').on('submit', function (e) {\n e.preventDefault();\n var form = $(this);\n var url = form.attr('action');\n var currentUrl = window.location.href;\n\n form.spinner().start();\n $('form.login').trigger('login:submit', e);\n\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n // console.log(data);\n form.spinner().stop();\n if (!data.success) {\n // console.log('data.success', data.success);\n formValidation(form, data);\n $('form.login').trigger('login:error', data);\n } else {\n // console.log('data.success', data.success);\n $('form.login').trigger('login:success', data);\n //location.href = data.redirectUrl;\n location.href = currentUrl;\n }\n },\n error: function (data) {\n // console.log(data);\n if (data.responseJSON.redirectUrl) {\n window.location.href = data.responseJSON.redirectUrl;\n } else {\n $('form.login').trigger('login:error', data);\n form.spinner().stop();\n }\n }\n });\n return false;\n });\n\n // submit register\n $('form.registration').submit(function (e) {\n e.preventDefault();\n var form = $(this);\n var url = form.attr('action');\n form.spinner().start();\n $('form.registration').trigger('login:register', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n $('form.registration').trigger('login:register:error', data);\n formValidation(form, data);\n \n }else if (data.nextStep){\n registrationNextStep.toggleFormRegistration()\n\n } else {\n $('form.registration').trigger('login:register:success', data);\n location.href = data.redirectUrl;\n }\n },\n error: function (err) {\n if (err.responseJSON.redirectUrl) {\n window.location.href = err.responseJSON.redirectUrl;\n } else {\n createErrorNotification($('.error-messaging'), err.responseJSON.errorMessage);\n }\n\n form.spinner().stop();\n }\n });\n return false;\n });\n\n // submit reset password\n $('.reset-password-form').submit(function (e) {\n var form = $(this);\n e.preventDefault();\n var url = form.attr('action');\n form.spinner().start();\n $('.reset-password-form').trigger('login:register', e);\n $.ajax({\n url: url,\n type: 'post',\n dataType: 'json',\n data: form.serialize(),\n success: function (data) {\n form.spinner().stop();\n if (!data.success) {\n formValidation(form, data);\n } else {\n $('.request-password-title').text(data.receivedMsgHeading);\n $('.request-password-body').empty()\n .append('
' + data.receivedMsgBody + '
');\n if (!data.mobile) {\n $('#submitEmailButton').text(data.buttonText)\n .attr('data-dismiss', 'modal');\n } else {\n $('.send-email-btn').empty()\n .html(''\n + data.buttonText + ''\n );\n }\n }\n },\n error: function () {\n form.spinner().stop();\n }\n });\n return false;\n });\n //remove skeleton login page\n $('.myAccountHeader-unlogged .skeleton-loader').remove();\n }, 100);\n \n});","'use strict';\n\n/**\n * Remove all validation. Should be called every time before revalidating form\n * @param {element} form - Form to be cleared\n * @returns {void}\n */\nfunction clearFormErrors(form) {\n $(form).find('.form-control.is-invalid').removeClass('is-invalid');\n}\n\nmodule.exports = function (formElement, payload) {\n // clear form validation first\n clearFormErrors(formElement);\n $('.alert', formElement).remove();\n\n if (typeof payload === 'object' && payload.fields) {\n Object.keys(payload.fields).forEach(function (key) {\n if (payload.fields[key]) {\n var feedbackElement = $(formElement).find('[name=\"' + key + '\"]')\n .parent()\n .children('.invalid-feedback');\n\n if (feedbackElement.length > 0) {\n if (Array.isArray(payload[key])) {\n feedbackElement.html(payload.fields[key].join('