function getIP(json) { document.getElementById("ip").value = json.ip } var fieldsZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg = []; var strform = '{"class":[{"name":"row"},{"name":"d-none"}],"styles":[{"name":"width: 100%;"}],"css":[{"name":""}],"old_css":[]}' var attributesForm = JSON.parse(strform) var meta = document.createElement('meta'); meta.name = "csrf-token"; meta.content = "xjz96pTeVZI4mr8Jd7mKGi0iBhVSRbK264bzlh5l"; document.getElementsByTagName('head')[0].appendChild(meta); var element = document.getElementById("jDi2EzloLVy1PWt") element.setAttribute("class", "container-vN55bQGB57 row col-md-12 justify-content-center") element.setAttribute("id", "ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg") 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("¡AGENDA TU CITA!") 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-ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg") form.setAttribute("method","get") form.setAttribute("action","https://forms.woobsing.co/registerForm") form.setAttribute("autocomplete", "off") form.setAttribute("autocapitalize", "off") form.setAttribute("name", "form-ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg") var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "id") x.setAttribute("value", "zA3U0s7jMaWoPvx") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "client_name") x.setAttribute("value", "Hairdoctors") form.appendChild(x) var x = document.createElement("INPUT"); x.setAttribute("type", "hidden") x.setAttribute("name", "_token") x.setAttribute("value", "xjz96pTeVZI4mr8Jd7mKGi0iBhVSRbK264bzlh5l") 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":"full_name","nameControl":"full_name","label":"Nombre completo","class":[{"name":"form-control"}],"styles":[],"options":"","required":false,"placeholder":"Nombre completo"}' 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) fieldsZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"gener","nameControl":"gener","label":"Genero","class":[{"name":"form-control"}],"styles":[],"options":[{"id":null,"value":"Seleccione..."},{"id":"Masculino","value":"Masculino"},{"id":"Femenino","value":"Femenino"}],"required":false,"placeholder":"Genero"}' var attributes = JSON.parse(str) var label = document.createElement("LABEL") var t = document.createTextNode(attributes.label) label.appendChild(t) div.appendChild(label) form.appendChild(div) var x = document.createElement("SELECT") x.setAttribute("type", "select") x.setAttribute("name", attributes.nameControl) x.setAttribute("required", "required") x.setAttribute("id", attributes.nameControl) var classes = "select-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) attributes.options.forEach( function (value) { var option = document.createElement("option"); option.setAttribute("value", value.id); var t = document.createTextNode(value.value); option.appendChild(t); x.appendChild(option); }) div.appendChild(x) form.appendChild(div) element.appendChild(form) fieldsZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"phone_number","nameControl":"phone_number","label":"Numero de Tel\u00e9fono","class":[{"name":"form-control"}],"styles":[],"options":"","required":false,"placeholder":"Numero de Tel\u00e9fono"}' 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", "tel") 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) fieldsZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg.push(attributes.nameControl); var x = document.createElement("SCRIPT"); x.setAttribute("src", "https://forms.woobsing.co/js/nationalv2.js") x.defer = true x.async = true form.appendChild(x) element.appendChild(form) var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"email","nameControl":"email","label":"Email","class":[{"name":"form-control"}],"styles":[{"name":null},{"name":"color:#000000;"},{"name":"background-color:#FFFFFF;"},{"name":"font-size:100;"}],"options":"","required":false,"placeholder":"Email"}' 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) fieldsZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"city","nameControl":"city","label":"Ciudad","class":[{"name":"form-control"}],"styles":[],"options":"","required":false,"placeholder":"Ciudad"}' 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) fieldsZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"send","nameControl":null,"label":"","class":[],"styles":[{"name":null},{"name":"color:#000000;"},{"name":"background-color:#FFFFFF;"},{"name":"font-size:100;"}],"options":"","required":false,"placeholder":""}' 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", "date") 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) fieldsZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg.push(attributes.nameControl); var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"reCAPTCHA","nameControl":"reCAPTCHA","label":"reCAPTCHA","class":[{"name":"g-recaptcha"}],"styles":[],"options":"","required":false,"placeholder":"reCAPTCHA"}' var attributes = JSON.parse(str) var x = document.createElement("div"); var classes = "g-recaptcha"; x.setAttribute("class", classes) x.setAttribute("id", "recaptcha") x.setAttribute("data-sitekey", "6LcMRtwUAAAAAMej7KHqylhHUA3s5fCUeTfohBac"); var elem = document.createTextNode(attributes.nameControl); x.appendChild(elem) div.appendChild(x) form.appendChild(div) element.appendChild(form) var div = document.createElement("div") div.setAttribute("class", "col-12-vN55bQGB57") var str = '{"idControl":"btn-submin","nameControl":"Enviar","label":"https:\/\/forms.woobsing.co\/registerForm","class":[],"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-ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg " 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 CpzbofnxRswiTbTLvtnl = 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", "3") form.appendChild(x) document.getElementById('form-ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg').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-ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg'); btn.setAttribute("disabled", ""); btn.innerHTML += '...'; if(setphone){ document.querySelector("input[type='tel']").value = setphone}; validateDataZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg(); if(CpzbofnxRswiTbTLvtnl){ try { ValidationreCaptcha = grecaptcha.getResponse(); } catch (err) { ValidationreCaptcha = ""; } axios.post('https://forms.woobsing.co/validateCaptcha', { unique_code: ValidationreCaptcha, key: '6LcMRtwUAAAAAOGLH14ymW_f5AtlblWBNWl-C8OM' }).then((response) => { if(response.data == "success"){ formSubmitZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg(); } else { btn.removeAttribute("disabled"); alert('Por favor valida el captcha'); } }).catch((error) => { console.log(error); }); } }) function formSubmitZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg() { let scriptUrl = 'https://script.google.com/macros/s/AKfycbyRIHC4Yg3Cad8ASBMk3PzchW4VvMfcn90TT5EN2NvUMunVDo9UerY_e0THRVJIOPIfeQ/exec'; let datatoform = document.forms['form-ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg']; 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-ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg'); form.submit(); }, "150"); } function validateDataZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg() { fieldsZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg.forEach(ele => { var input = document.getElementById(ele); if (input.value == "" || input.value == null) { CpzbofnxRswiTbTLvtnl = 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 { CpzbofnxRswiTbTLvtnl = 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("ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg").children.length; i++) { if (document.getElementById("ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg").children[i].getAttribute("id") == "form") { for (var j = 0; j < document.getElementById("ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg").children[i].children.length; j++) { for (var k = 0; k < document.getElementById("ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg").children[i].children[j].getElementsByTagName("input").length; k++) { var input = document.getElementById("ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg").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("ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg").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("ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg").children[i].children[j].getElementsByTagName("input")[k].value = user.surname; break; case 'email': case 'e-mail': case 'correo': case 'correos': document.getElementById("ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg").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("ZGNhOWIZjAMTAMWRjMTJmNDUwYNjNTFjZTkMDg").children[i].children[j].getElementsByTagName("input")[k].value = user.phone; break; } } } } } }