{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./cartridges/app_suzano_custom/cartridge/client/default/js/sellUsForm.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;AACA,sDAAsD,gBAAgB;;AAEtE;AACA;;AAEA;;AAEA,sCAAsC,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG;;AAE/F,sCAAsC,EAAE,IAAI,EAAE;;AAE9C,uCAAuC,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,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A;;AAEA;;AAEA;AACA;AACA;AACA;AACA,aAAa;;AAEb;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,SAAS;;AAET;AACA;AACA;AACA,SAAS;AACT;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,CAAC","file":"./cartridges/app_suzano_custom/cartridge/static/default/js/sellUsForm.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 = \"NAaw\");\n","$(document).ready(function () {\n $('#00NU6000002b9km').mask('00.000.000/0000-00', { reverse: true });\n\n var maskBehavior = function (val) {\n var numericVal = val.replace(/\\D/g, '')\n\n var hasInvalidPattern = /^(11)1111-1111|^(22)2222-2222|^(33)3333-3333|^(44)4444-4444|^(55)5555-5555|^(66)6666-6666|^(77)7777-7777|^(88)8888-8888|^(99)9999-9999/.test(val);\n\n var hasRepeatingNumbers = /(0{6,}|1{6,}|2{6,}|3{6,}|4{6,}|5{6,}|6{6,}|7{6,}|8{6,}|9{6,})/.test(numericVal);\n\n var hasSpecificPattern = /^\\d{5}-\\d{4}$/.test(val);\n\n var hasRepeatedPairs = /(\\d)\\1{5,}|(01){4,}|(10){4,}|(02){4,}|(20){4,}|(03){4,}|(30){4,}|(04){4,}|(40){4,}|(05){4,}|(50){4,}|(06){4,}|(60){4,}|(07){4,}|(70){4,}|(08){4,}|(80){4,}|(09){4,}|(90){4,}|(12){4,}|(21){4,}|(13){4,}|(31){4,}|(14){4,}|(41){4,}|(15){4,}|(51){4,}|(16){4,}|(61){4,}|(17){4,}|(71){4,}|(18){4,}|(81){4,}|(19){4,}|(91){4,}|(23){4,}|(32){4,}|(24){4,}|(42){4,}|(25){4,}|(52){4,}|(26){4,}|(62){4,}|(27){4,}|(72){4,}|(28){4,}|(82){4,}|(29){4,}|(92){4,}|(34){4,}|(43){4,}|(35){4,}|(53){4,}|(36){4,}|(63){4,}|(37){4,}|(73){4,}|(38){4,}|(83){4,}|(39){4,}|(93){4,}|(45){4,}|(54){4,}|(46){4,}|(64){4,}|(47){4,}|(74){4,}|(48){4,}|(84){4,}|(49){4,}|(94){4,}|(56){4,}|(65){4,}|(57){4,}|(75){4,}|(58){4,}|(85){4,}|(59){4,}|(95){4,}|(67){4,}|(76){4,}|(68){4,}|(86){4,}|(69){4,}|(96){4,}|(78){4,}|(87){4,}|(79){4,}|(97){4,}|(89){4,}|(98){4,}/.test(numericVal);\n\n var isValidMobile = numericVal.length === 11;\n var isValidLandline = numericVal.length === 10 && numericVal[2] !== '9';\n\n var isValidDDD = /^(11|12|13|14|15|16|17|18|19|21|22|24|27|28|31|32|33|34|35|37|38|41|42|43|44|45|46|47|48|49|51|53|54|55|61|62|63|64|65|66|67|68|69|71|73|74|75|77|79|81|82|83|84|85|86|87|88|89|91|92|93|94|95|96|97|98|99)/.test(numericVal.substring(0, 2));\n\n if (!isValidLandline && isValidMobile && isValidDDD && !hasInvalidPattern && !hasRepeatingNumbers && !hasSpecificPattern && !hasRepeatedPairs) {\n return '(00) 00000-0000'\n\n }else if (isValidLandline && !isValidMobile && isValidDDD && !hasInvalidPattern && !hasRepeatingNumbers && !hasSpecificPattern && !hasRepeatedPairs){\n return '(00) 0000-0000'\n }\n else {\n return '(00) 0000-00000'\n }\n }\n\n var telOptions = {\n onKeyPress: function (val, e, field, options) {\n field.mask(maskBehavior.apply({}, arguments), options);\n }\n };\n\n $('#phone').mask(maskBehavior, telOptions);\n $('#00NU6000002b9kv').mask(maskBehavior, telOptions);\n\n\n function setAddressFieldsReadOnly(readonly) {\n $('#street').prop('readonly', readonly);\n $('#district').prop('readonly', readonly);\n $('#city').prop('readonly', readonly);\n if (readonly) {\n $('#state').css('pointer-events', 'none');\n $('#state').css('background-color', '#e9ecef'); \n } else {\n $('#state').css('pointer-events', 'auto');\n $('#state').css('background-color', ''); \n }\n }\n\n $('#zip').on('input', function () {\n let zipCode = $(this).val().replace(/\\D/g, '');\n if (zipCode.length > 5) {\n zipCode = zipCode.substring(0, 5) + '-' + zipCode.substring(5, 8);\n }\n $(this).val(zipCode);\n \n if ($(this).val().length === 9) {\n $.ajax({\n url: 'https://viacep.com.br/ws/' + $('#zip').val() + '/json/',\n type: 'GET',\n success: function (data) {\n if (data.erro) {\n $('#zip')\n .addClass('is-invalid')\n .siblings('.invalid-feedback')\n .html('CEP inválido')\n setAddressFieldsReadOnly(false)\n cepIsValid = false;\n } else {\n $('#street').val(data.logradouro)\n $('#district').val(data.bairro)\n $('#state').val(data.uf).change()\n $('#city').val(data.localidade)\n $('form .form-group input').trigger('keypress')\n setAddressFieldsReadOnly(true)\n cepIsValid = true;\n }\n },\n error: function () {\n setAddressFieldsReadOnly(false)\n cepIsValid = false;\n }\n })\n } else {\n setAddressFieldsReadOnly(false)\n cepIsValid = false;\n }\n })\n\n $('#email').on('input', function() {\n const email = $(this).val();\n const emailRegex = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n \n if (emailRegex.test(email)) {\n $(this).css('border-color', 'green');\n } else {\n $(this).css('border-color', 'red');\n }\n });\n \n});\n\ndocument.addEventListener('DOMContentLoaded', function () {\n const form = document.querySelector('.sellUsForm');\n\n if (form) {\n form.addEventListener('submit', function (e) {\n e.preventDefault();\n\n let isValid = true;\n\n form.querySelectorAll('input[required]').forEach((input) => {\n if (!validarCampo(input)) {\n isValid = false;\n }\n });\n\n if (isValid) {\n console.log('Formulário válido! Enviando...');\n form.submit();\n } else {\n console.log('Formulário inválido! Corrija os erros.');\n }\n });\n\n form.querySelectorAll('input[required]').forEach((input) => {\n input.addEventListener('input', () => validarCampo(input));\n input.addEventListener('change', () => validarCampo(input));\n });\n }\n\n function validarCampo(input) {\n const errorMessage = input.nextElementSibling;\n const isEmpty = !input.value.trim();\n\n if (isEmpty) {\n input.classList.add('is-invalid');\n if (errorMessage) errorMessage.textContent = 'Campo obrigatório';\n return false;\n } else {\n input.classList.remove('is-invalid');\n if (errorMessage) errorMessage.textContent = '';\n return true;\n }\n }\n});\n\n"],"sourceRoot":""}