if (!window.componentMetaData) { window.componentMetaData = {}; } window.componentMetaData["c63ea763-58f7-49d2-8c55-2336f8897302"] = {}; window.componentMetaData["c63ea763-58f7-49d2-8c55-2336f8897302"].nodeId = 111; window.componentMetaData["c63ea763-58f7-49d2-8c55-2336f8897302"].componentId = 69; window.componentMetaData["c63ea763-58f7-49d2-8c55-2336f8897302"].embebed = true; window.componentMetaData["c63ea763-58f7-49d2-8c55-2336f8897302"].campaignId = 20; window['uiocc63ea763-58f7-49d2-8c55-2336f8897302'] = true; var elem = document.createElement('div'); elem.classList.add('wrapper'); elem.classList.add('YzYzZWE3NjMtNThmNy00OWQyLThjNTUtMjMzNmY4ODk3MzAy'); elem.style.cssText = "display: flex;flex-flow: row wrap;justify-content: center;align-content: center;align-items:center;width:100%;"; elem.innerHTML = `

📩 Suscribite a la newsletter GPS PM 🌆 En 5 minutos, toda la información que necesitás para terminar el día. De lunes a viernes, por Chani Guyot.

Hubo un error al enviar tu respuesta. Esperá un momento y volvé a intentarlo.
`; if (false) { var tempDiv = document.querySelector('script[src*="api/v1/component/script/69/1"]'); if (tempDiv) { tempDiv.parentNode.appendChild(elem); } else { tempDiv = document.querySelector('script.campaign-20'); if (tempDiv) { tempDiv.parentNode.appendChild(elem); } else { tempDiv = document.querySelector('script.modulo-69'); if (tempDiv) { tempDiv.parentNode.appendChild(elem); } } } } else { document.querySelector('script.campaign-20').parentNode.appendChild(elem); } window['c63ea763-58f7-49d2-8c55-2336f8897302_rlei'] = setInterval(() => { if (window.rleParticipation) { clearInterval(window['c63ea763-58f7-49d2-8c55-2336f8897302_rlei']); window.rleParticipation.logEvent('showNode', "{}", 111); } }, 500); window.componentLogEvent = function(option, type, formId) { var data = {}; var formData = new FormData(); data.value = {}; var optionId = option; var nodeId = window.componentMetaData[formId].nodeId; var componentId = window.componentMetaData[formId].componentId; var embebedFlow = window.componentMetaData[formId].embebed; var campaignId = window.componentMetaData[formId].campaignId; document.querySelectorAll('#form__' + formId + ' [name]').forEach(function(elem) { var type = elem.type; var key = elem.id.split('__'); var newKey = key[0] + '__' + key[1]; if (type === 'file') { formData.append("image_" + newKey, elem.files[0]); } else if (type === 'radio') { if (elem.checked) { data.value[newKey] = elem.value; optionId = key[2]; } } else if (type === 'checkbox') { if (elem.checked) { if (!data.value[newKey]) data.value[newKey] = []; data.value[newKey].push(elem.value); optionId = key[2]; } } else if (type === 'text' && elem.classList.contains('address')) { if (!data.value[newKey]) data.value[newKey] = []; data.value[newKey].push({ [key[2]]: elem.value}); optionId = key[2]; } else { data.value[newKey] = elem.value; } }); formData.append("value", JSON.stringify(data.value)); formData.append("optionId", optionId); formData.append("type", type); formData.append("nodeId", nodeId); formData.append("componentId", componentId); formData.append("embebedFlow", embebedFlow); formData.append("campaignId", campaignId); if (window.rleParticipation) { formData.append("cookieId", window.rleParticipation.getCookieId()); } else { var button = document.querySelector('.rl_submit'); if (button) { button.style = 'background: #cecece'; button.disabled = true; } var _formData = {}; for(var pair of formData.entries()) { _formData[pair[0]] = pair[1]; } return window.parent.postMessage(['postIframeSubmition', JSON.stringify(_formData), "https://www.redaccion.com.ar/api/v1/", componentId], '*'); } document.querySelectorAll('.fieldError').forEach(function(elem) { elem.style.display = 'none' }); var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4) { if (this.status == 200) { var c = document.querySelector('.' + btoa(formId)); if (c) c.parentNode.removeChild(c); } else if (this.status == 422) { var errors = JSON.parse(this.response); for (var key in errors) { var errEl = document.getElementById(key + "__error"); errEl.innerHTML = errors[key]; errEl.style.display = "block"; } return; } else { var c = document.getElementById(componentId + '__error'); c.style.display = "block"; return; } var response = JSON.parse(this.response); response.flowCampaignId = campaignId; if (response.allowCookies && window.rleParticipation) window.rleParticipation.allowCookies(); if (response.nodeId && window.rleParticipation) { if(window["uioc" + formId]){ window.rleParticipation.nodeCallback(response.nodeId,response); }else{ window.rleParticipation.nodeCallback(response.node); } } else { var c = document.querySelector('.' + btoa(formId)); if (c) c.parentNode.removeChild(c); } } }; if(false){ xmlhttp.open("GET", "https://www.redaccion.com.ar/api/v1/campania/preview/null/cookie/"+nodeId+"/"+option); xmlhttp.send(null); }else{ xmlhttp.open("POST", "https://www.redaccion.com.ar/api/v1/answer"); xmlhttp.send(formData); } }; window.addEventListener("message", function (e) { if (e.data === "success69") { document.querySelector('form').innerHTML = '

Recibimos tu respuesta.

¡Gracias por participar!

' } });