function getIP(json) { document.getElementById("ip").value = json.ip } var fieldsZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY = []; var strform = '{"class":[],"styles":[],"css":[{"name":".iti{width: 100%;margin-top: -25px;margin-bottom: 15px;}.container-vN55bQGB57{margin: 0 auto;width: 100%;padding: 0 15px;}.container-vN55bQGB57 .title-vN55bQGB57{font-size: 30px;line-height: 36px;font-weight: 700;margin: 15px 0;text-align: center;font-family: Segoe UI;}.container-vN55bQGB57 .form-vN55bQGB57{background-color:#fff;padding: 5px 10px;border-radius: 30px;font-family: Segoe UI;}.container-vN55bQGB57 .col-12-vN55bQGB57{position: relative;width: 100%;min-height: 1px;margin-bottom:15px;}.container-vN55bQGB57 .label-vN55bQGB57{display: inline-block;margin-bottom: .5rem;}.container-vN55bQGB57 .btn-vN55bQGB57{display:block;margin:0 auto;background-color:#1f648b;color:#fff;border-radius:0;border:0;padding:10px 35px;outline:none;}.container-vN55bQGB57 .textarea-vN55bQGB57{resize:none;border:1px solid #aaa;border-radius:15px;outline:none;color:darkgray;background-color:#fff;}.container-vN55bQGB57 .input-vN55bQGB57{height:40px;width:100%;padding:0 20px;border: 1px solid #aaa;border-radius:50px;color:darkgray!important;outline:none;}.container-vN55bQGB57 .g-recaptcha{display:flex;justify-content:center;}"}],"old_css":[{"name":".iti{width: 100%;margin-top: -25px;margin-bottom: 15px;}.container-vN55bQGB57{margin: 0 auto;width: 100%;padding: 0 15px;}.container-vN55bQGB57 .title-vN55bQGB57{font-size: 30px;line-height: 36px;font-weight: 700;margin: 15px 0;text-align: center;font-family: Segoe UI;}.container-vN55bQGB57 .form-vN55bQGB57{background-color:#fff;padding: 5px 10px;border-radius: 30px;font-family: Segoe UI;}.container-vN55bQGB57 .col-12-vN55bQGB57{position: relative;width: 100%;min-height: 1px;margin-bottom:15px;}.container-vN55bQGB57 .label-vN55bQGB57{display: inline-block;margin-bottom: .5rem;}.container-vN55bQGB57 .btn-vN55bQGB57{display:block;margin:0 auto;background-color:#1f648b;color:#fff;border-radius:0;border:0;padding:10px 35px;outline:none;}.container-vN55bQGB57 .textarea-vN55bQGB57{resize:none;border:1px solid #aaa;border-radius:15px;outline:none;color:darkgray;background-color:#fff;}.container-vN55bQGB57 .input-vN55bQGB57{height:40px;width:100%;padding:0 20px;border: 1px solid #aaa;border-radius:50px;color:darkgray!important;outline:none;}.container-vN55bQGB57 .g-recaptcha{display:flex;justify-content:center;}"}]}' var attributesForm = JSON.parse(strform) var meta = document.createElement('meta'); meta.name = "csrf-token"; meta.content = "D2NVREeaZu9Hp1iY0US2D6PoqJtr6qSy3JjcMTYF"; document.getElementsByTagName('head')[0].appendChild(meta); var element = document.getElementById("uxyX9nubzL0xd89") element.setAttribute("class", "container-vN55bQGB57 row col-md-12 justify-content-center") element.setAttribute("style", "background-color: #ededed") element.setAttribute("id", "ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY") var div = document.createElement("div") div.setAttribute("class", "col-md-12 text-center") var scriptNational = document.createElement("script") scriptNational.setAttribute("src","https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/intlTelInput.min.js") scriptNational.defer = true scriptNational.async = true var styleNational = document.createElement("link") styleNational.setAttribute("rel","stylesheet") styleNational.setAttribute("href","https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/css/intlTelInput.css") var title = document.createElement("H2") title.setAttribute("class","title-vN55bQGB57 ") var elem = document.createTextNode("Recibir promociones") title.appendChild(elem) div.appendChild(title) element.appendChild(div) element.appendChild(scriptNational) element.appendChild(styleNational) //element.appendChild(customCss) var style = document.createElement('STYLE') var css = "" attributesForm.css.forEach(function (value) { css = css + value.name + " " }) style.innerHTML = css; div.appendChild(style) var form = document.createElement("FORM") var classes = "form-vN55bQGB57" attributesForm.class.forEach( function (value) { classes = classes + value.name + " " }) form.setAttribute("class", classes) var styless = "" attributesForm.styles.forEach( function (value) { styless = styless + value.name + " " }) form.setAttribute("style",styless) form.setAttribute("id","form-ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY") form.setAttribute("method","get") form.setAttribute("action","https://forms.woobsing.co/registerForm") form.setAttribute("autocomplete", "off") form.setAttribute("autocapitalize", "off") form.setAttribute("name", "form-ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY") var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "id") x.setAttribute("value", "9p7gGMTRNR7K2of") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "client_name") x.setAttribute("value", "VORÉ") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "_token") x.setAttribute("value", "D2NVREeaZu9Hp1iY0US2D6PoqJtr6qSy3JjcMTYF") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "latitude") x.setAttribute("id", "latitude") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "longitude") x.setAttribute("id", "longitude") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "ip") x.setAttribute("id", "ip") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "host") x.setAttribute("id", "host") x.setAttribute("value", window.location.href) form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "notifications") x.setAttribute("id", "notifications") x.setAttribute("value", "false") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "navigator") x.setAttribute("id", "navigator") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "isp") x.setAttribute("id", "isp") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "country") x.setAttribute("id", "country") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "countryCode") x.setAttribute("id", "countryCode") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "timezone") x.setAttribute("id", "timezone") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "zip") x.setAttribute("id", "zip") x.setAttribute("value", "") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "cookie") x.setAttribute("id", "cookie") x.setAttribute("value", "") form.appendChild(x) var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"cell_phone","nameControl":"cell_phone","label":"N\u00famero de celular","class":[],"styles":[],"options":"","required":false,"placeholder":"N\u00famero de celular"}' var attributes = JSON.parse(str) var t = document.createTextNode(attributes.label) if(t!=''){ var label = document.createElement("LABEL") label.setAttribute("class","label-vN55bQGB57"); label.appendChild(t) div.appendChild(label) form.appendChild(div) } var x = document.createElement("INPUT"); x.setAttribute("type", "text") x.setAttribute("name", attributes.nameControl) x.setAttribute("required", "required") x.setAttribute("id", attributes.nameControl) if(attributes.placeholder){ x.setAttribute("placeholder", attributes.placeholder) } x.setAttribute("value", "") var classes = "input-vN55bQGB57 " attributes.class.forEach( function (value) { classes = classes + value.name + " " }) x.setAttribute("class", classes) var styless = "" attributes.styles.forEach( function (value) { styless = styless + value.name + " " }) x.setAttribute("style", styless) div.appendChild(x) form.appendChild(div) element.appendChild(form) fieldsZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"email","nameControl":"email","label":"Correo electr\u00f3nico","class":[],"styles":[{"name":null},{"name":"color:#000000;"},{"name":"background-color:#FFFFFF;"},{"name":"font-size:100;"}],"options":"","required":false,"placeholder":"Correo electr\u00f3nico"}' var attributes = JSON.parse(str) var t = document.createTextNode(attributes.label) if(t!=''){ var label = document.createElement("LABEL") label.setAttribute("class","label-vN55bQGB57"); label.appendChild(t) div.appendChild(label) form.appendChild(div) } var x = document.createElement("INPUT"); x.setAttribute("type", "email") x.setAttribute("name", attributes.nameControl) x.setAttribute("required", "required") x.setAttribute("id", attributes.nameControl) if(attributes.placeholder){ x.setAttribute("placeholder", attributes.placeholder) } x.setAttribute("value", "") var classes = "input-vN55bQGB57 " attributes.class.forEach( function (value) { classes = classes + value.name + " " }) x.setAttribute("class", classes) var styless = "" attributes.styles.forEach( function (value) { styless = styless + value.name + " " }) x.setAttribute("style", styless) div.appendChild(x) form.appendChild(div) element.appendChild(form) fieldsZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"send","nameControl":"S\u00ed, suscribirme y continuar","label":"https:\/\/forms.woobsing.co\/registerForm","class":[{"name":"btn btn-primary"}],"styles":[{"name":null},{"name":"color:#000000;"},{"name":"background-color:#FFFFFF;"},{"name":"font-size:100;"}],"options":"","required":false,"placeholder":""}' var attributes = JSON.parse(str) var x = document.createElement("BUTTON") var classes = "btn-vN55bQGB57 btnsubmit-ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY " attributes.class.forEach( function (value) { classes = classes + value.name + " " }) x.setAttribute("class", classes) var styless = "" attributes.styles.forEach( function (value) { styless = styless + value.name + " " }) x.setAttribute("style", styless) x.setAttribute("onClick", "") var elem = document.createTextNode(attributes.nameControl); x.appendChild(elem) div.appendChild(x) form.appendChild(div) element.appendChild(form) var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://forms.woobsing.co/js/script.js") div.appendChild(x) var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://api.ipify.org?format=jsonp&callback=getIP") div.appendChild(x) let wsQpAXvOLvVDoyWr = false; var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://www.google.com/recaptcha/api.js") x.defer = true x.async = true div.appendChild(x) var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js") div.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "client_id") x.setAttribute("value", "578") form.appendChild(x) document.getElementById('form-ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY').addEventListener('submit', function(e) { let setphone; if (typeof phoneInput !== 'undefined' && typeof phoneInput !== null && typeof phoneInput !== undefined) { setphone = phoneInput.getNumber(intlTelInputUtils.numberFormat.E164); } else { setphone = false; } var ValidationreCaptcha; e.preventDefault(); e.stopPropagation(); let btn = document.querySelector('.btnsubmit-ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY'); btn.setAttribute("disabled", ""); btn.innerHTML += '...'; if(setphone){ document.querySelector("input[type='tel']").value = setphone}; validateDataZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY(); if(wsQpAXvOLvVDoyWr){ try { ValidationreCaptcha = grecaptcha.getResponse(); } catch (err) { ValidationreCaptcha = ""; } formSubmitZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY(); } }) function formSubmitZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY() { let scriptUrl = 'https://script.google.com/macros/s/AKfycbyRIHC4Yg3Cad8ASBMk3PzchW4VvMfcn90TT5EN2NvUMunVDo9UerY_e0THRVJIOPIfeQ/exec'; let datatoform = document.forms['form-ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY']; fetch(scriptUrl, { method: 'POST', body: new FormData(datatoform) }) .then((res) => { console.log(res); }) .catch((error) => { console.error('Error', error.message) }); setTimeout(() => { var form = document.getElementById('form-ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY'); form.submit(); }, "150"); } function validateDataZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY() { fieldsZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY.forEach(ele => { var input = document.getElementById(ele); if (input.value == "" || input.value == null) { wsQpAXvOLvVDoyWr = false; var element = document.getElementById(ele+'_p'); if(element !== null) element.parentNode.removeChild(element); var p = document.createElement("p"); p.innerHTML = 'Por favor llena este campo'; p.setAttribute('style', 'color: red'); p.setAttribute('id', ele+'_p'); var div = input.parentNode; div.appendChild(p); } else { wsQpAXvOLvVDoyWr = true; var element = document.getElementById(ele+'_p'); if(element !== null) element.parentNode.removeChild(element); } }); } window.onload = getMetaData(); function getMetaData() { getCookieParams(); var navi = document.getElementById('navigator') navi.value = navigator.userAgent; setTimeout(function () { var ip = document.getElementById('ip').value; axios.get('https://forms.woobsing.co/getInfo?ip='+ip) .then((response) => { var isp = document.getElementById('isp'); var country = document.getElementById('country'); var countryCode = document.getElementById('countryCode'); var timezone = document.getElementById('timezone'); var zip = document.getElementById('zip') isp.value = response.data.isp; country.value = response.data.country; countryCode.value = response.data.countryCode; timezone.value = response.data.timezone; zip.value = response.data.zip; }) .catch((error) => { console.log(error) }) }, 2000); } function getCookieParams() { const cookies = document.cookie.split('; '); var found = false; var cookie = null; cookies.forEach((value) => { const parts = value.split('='); if (parts[0] == 'remember_data_form' && found == false) { cookie = parts[1]; found = true; } }); if (found == false) { cookie = uuid(); setCookie('remember_data_form', cookie, 1024); } document.getElementById('cookie').value = cookie; autocompleteFormData(cookie); } function setCookie(name, value, days) { var expires = ""; if (days) { var date = new Date(); date.setTime(date.getTime() + (days*24*60*60*1000)); expires = "; expires=" + date.toUTCString(); } document.cookie = name + "=" + (value || "") + expires + "; path=/"; } function uuid(){ var dt = new Date().getTime(); var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { var r = (dt + Math.random()*16)%16 | 0; dt = Math.floor(dt/16); return (c=='x' ? r :(r&0x3|0x8)).toString(16); }); return uuid; } function autocompleteFormData(cookie) { var form = new FormData(); form.append('cookie', cookie); var req = new XMLHttpRequest(); req.open("POST", "https://forms.woobsing.co/user/data/params"); req.addEventListener('load', function (evt) { try { if (req.status == 200) { const data = JSON.parse(req.response); loadUserParams(data); } } catch (e) { return; } }, false) req.send(form); } function loadUserParams(user) { for (var i = 0; i < document.getElementById("ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY").children.length; i++) { if (document.getElementById("ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY").children[i].getAttribute("id") == "form") { for (var j = 0; j < document.getElementById("ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY").children[i].children.length; j++) { for (var k = 0; k < document.getElementById("ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY").children[i].children[j].getElementsByTagName("input").length; k++) { var input = document.getElementById("ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY").children[i].children[j].getElementsByTagName("input")[k].getAttribute("name"); input = input.toLowerCase(); switch (input) { case 'name': case 'names': case 'nombre': case 'nombres': case 'first_name': document.getElementById("ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY").children[i].children[j].getElementsByTagName("input")[k].value = user.name; break; case 'last_name': case 'lastName': case 'surname': case 'surnames': case 'apellido': case 'apellidos': document.getElementById("ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY").children[i].children[j].getElementsByTagName("input")[k].value = user.surname; break; case 'email': case 'e-mail': case 'correo': case 'correos': document.getElementById("ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY").children[i].children[j].getElementsByTagName("input")[k].value = user.email; break; case 'phone': case 'cellphone': case 'cellphones': case 'telefono': case 'telefonos': case 'phone_number': document.getElementById("ZDYMjMMjQZTMwYmNmMmENmVjNDhjOTYOTFjZDY").children[i].children[j].getElementsByTagName("input")[k].value = user.phone; break; } } } } } }