1var cartWidth; 2var continueWidth; 3var cart; 4var continueButtons; 5var backButtons; 6var url = window.location.hash.substr(1); 7 8document.addEventListener('DOMContentLoaded', function () { 9 continueButtons = document.querySelectorAll('.continue.ca01_button'); 10 backButtons = document.querySelectorAll('.back.ca01_button'); 11 12 if (window.innerWidth > 820 && document.querySelector('.cf02_cart')) { 13 cartWidth = document.querySelector('.cf02_cart').offsetWidth; 14 continueWidth = continueButtons[0] ? continueButtons[0].offsetWidth : undefined; 15 } 16 if (url.length > 0) { 17 continueButtons.forEach(function(continueButton) { 18 continueButton.querySelector('.cmp-button').setAttribute('href', continueCmpBtn.getAttribute('href') + '#' + url); 19 }); 20 } 21 if (document.querySelector('.cf11_tickets') && typeof statusPaymentValid !== "undefined" && statusPaymentValid != "BARCODE_PENDING") { 22 var controlButtons = document.querySelectorAll('.cf05_controlbuttons'); 23 controlButtons.forEach(function(el) { el.style.display = 'none'; }); 24 } 25 var typeFunnel = cart != undefined && cart.saleType; 26 if (typeFunnel === 'PASSES') { 27 backButtons.forEach(function(el) { el.classList.add('backAnnual'); el.style.display = ''; }); 28 continueButtons.forEach(function(el) { el.classList.add('continueAnnual'); }); 29 } 30 funnelButtonsAnalitycsInteraction(); 31}); 32 33function funnelButtonsAnalitycsInteraction() { 34 var funnelMsg; 35 let analyticpathname = window.location.pathname; 36 let action; 37 let variant; 38 39 var metaTemplate = document.querySelector('meta[name=template]'); 40 var metaOgUrl = document.querySelector('meta[property="og:url"]'); 41 if (metaTemplate && metaTemplate.getAttribute('content') == 'funnel-page' && metaOgUrl && metaOgUrl.getAttribute('content').indexOf('vip') > 0) { 42 sessionStorage.setItem('funnelVariant', 'VIPFunnel'); 43 variant = sessionStorage.getItem('funnelVariant'); 44 } else if (!sessionStorage.getItem('funnelVariant') || sessionStorage.getItem('funnelVariant') == 'SingleTicketFunnel') { 45 sessionStorage.setItem('funnelVariant', 'SingleTicketFunnel'); 46 variant = sessionStorage.getItem('funnelVariant'); 47 } 48 if (sessionStorage.getItem('funnelVariant') == 'SingleTicketFunnel') { 49 action = "Funnel"; 50 } else if (sessionStorage.getItem('funnelVariant') == 'ExtrasFunnel') { 51 action = "Funnel2"; 52 } else if (sessionStorage.getItem('funnelVariant') == 'AnnualPass') { 53 action = "Funnel3"; 54 } else if (sessionStorage.getItem('funnelVariant') == 'VIPFunnel') { 55 action = "Funnel6"; 56 } else if (sessionStorage.getItem('funnelVariant') == 'CloseOpen') { 57 action = "Funnel7"; 58 } 59 var typeVisitor = document.querySelector('.typeVisitor'); 60 if (typeVisitor && typeVisitor.value == 'OPEN_DAY') { 61 action = "Funnel8"; 62 sessionStorage.setItem('funnelVariant', 'OpenTicketFunnel'); 63 variant = sessionStorage.getItem('funnelVariant'); 64 } 65 var secondGate = document.querySelector('.secondGate'); 66 if (secondGate && secondGate.value == 'true') { 67 action = "Funnel4"; 68 sessionStorage.setItem('funnelVariant', 'SecondGate'); 69 variant = sessionStorage.getItem('funnelVariant'); 70 } 71 if (analyticpathname.indexOf('/half-day/') > 0) { 72 action = "Funnel5"; 73 sessionStorage.setItem('funnelVariant', 'HalfDay'); 74 variant = sessionStorage.getItem('funnelVariant'); 75 } 76 //Analytics 77 //Landing 78 var slidername; 79 document.querySelectorAll('meta').forEach(function(meta) { 80 if (meta.getAttribute('property') == 'og:title') { 81 slidername = meta.getAttribute('content'); 82 } 83 }); 84 85 backButtons.forEach(function(btn) { 86 btn.addEventListener('click', function () { 87 // funnelButtonsAnalitycsInteraction 88 sessionStorage.setItem("funnelDirection", "BACKWARDS"); 89 var funnelstep = document.querySelector(".stepperContent.active .stepperStep")?.textContent; 90 dataLayer.push({ 91 'category': 'Interaccion', 92 'action': action, 93 'label': 'backtoStep' + (parseInt(funnelstep) - 1), 94 "slidername": slidername, 95 'event': 'eventga' 96 }); 97 98 // Check if the funnel is not expired 99 if (!checkCookiesExpired() && document.querySelector('meta[name=template]')?.getAttribute('content') != 'funnel-mews-page') { 100 var stepperStep = document.querySelector(".stepperContent.active .stepperStep"); 101 if (stepperStep && stepperStep.textContent.trim() != "1") { 102 e.preventDefault(); 103 return false;
104 } 105 } 106 }); 107 }); 108 109 continueButtons.forEach(function(continueButton) { 110 continueButton.addEventListener('click', function () { 111 sessionStorage.setItem("funnelDirection", "FORWARD"); 112 if(typeof dataCart !== 'undefined'){ 113 var objetoModificado = Object.assign({}, cart, { dataCart }); 114 var cartDataJSON = JSON.stringify(objetoModificado); 115 localStorage.setItem("CookieCartInfo", cartDataJSON); 116 } 117 var funnelstep = document.querySelector(".stepperContent.active .stepperStep")?.textContent; 118 if (funnelstep == 6) { 119 funnelMsg = 'continuetoPurchase'; 120 } else if (funnelstep == 4 && document.querySelector('.cf13_extrasoptions')) { 121 funnelMsg = 'continuetoStep' + funnelstep + 'Extras'; 122 var upsellChecked = document.querySelector("fieldset.upselling :checked"); 123 if (upsellChecked && upsellChecked.value == "yes") { 124 dataLayer.push({ 125 'category': 'Conversion', 126 'action': action, 127 'label': "S4 Agregado al carrito", 128 'event': 'eventga', 129 'sliderName': "Upsell", 130 'gate': 'MainGate', 131 'products': dataLayer[1].ecommerce.checkout.products, 132 }); 133 } 134 } else { 135 funnelMsg = 'continuetoStep' + (parseInt(funnelstep) + 1); 136 } 137 138 if (funnelstep == 2) { 139 let totalDate = document.querySelector('tbody td.ui-datepicker-selected .day')?.getAttribute('data-dates'); 140 const cf04CalendarMobileExists = document.querySelector(".ui-datepicker-calendarMobile"); 141 if (cf04CalendarMobileExists == null) { 142 dataLayer.push({ 143 'category': 'Interaccion', 144 'action': action, 145 'label': funnelMsg, 146 "slidername": slidername, 147 'event': 'eventga', 148 "searchSelectedDate": totalDate, 149 "initialdateuser": totalDate, 150 }); 151 } 152 } else if (funnelstep == 3) { 153 let totalDate = document.querySelector('tbody td.ui-datepicker-selected .day')?.getAttribute('data-dates'); 154 dataLayer.push({ 155 'category': 'Interaccion', 156 'action': action, 157 'label': funnelMsg, 158 "slidername": slidername, 159 'event': 'eventga', 160 "searchSelectedDate": totalDate, 161 "initialdateuser": totalDate, 162 }); 163 } else { 164 const cf06ExistInHtml = document.querySelector(".cf06_method_pays"); 165 if (cf06ExistInHtml == null) { 166 dataLayer.push({ 167 'category': 'Interaccion', 168 'action': action, 169 'label': funnelMsg, 170 "slidername": slidername, 171 'event': 'eventga' 172 }); 173 } 174 } 175 }); 176 }); 177} 178 179window.addEventListener('load', function (e) { 180 setTimeout(() => { 181 let searchParams = new URLSearchParams(window.location.search); 182 let param = searchParams.get('cookieConsent'); 183 if (param == 'false' || param == 'true') { 184 var date = new Date(); 185 var newArr = []; 186 var cookieOptanon = (document.cookie.match('(^|;)\\s*OptanonConsent\\s*=\\s*([^;]+)') || [])[2];
187 var items = cookieOptanon ? cookieOptanon.split(/&/) : []; 188 items.forEach(function(valueOfElement) { 189 var comp = valueOfElement.substring(0, 6); 190 if (comp == 'groups') { 191 var valueTrue = param == 'false' 192 ? 'groups=C0001:1!C0002:0!C0004:0!C0003:0&' 193 : 'groups=C0001:1!C0002:1!C0004:1!C0003:1&'; 194 newArr.push(valueTrue); 195 } else if (comp == 'intera') { 196 var valueIntera = 'interactionCount = 1&'; 197 newArr.push(valueIntera); 198 } else { 199 newArr.push(valueOfElement + '&'); 200 } 201 }); 202 var newArrB = newArr.join(''); 203 newArrB = newArrB.replace(/\,/g, ''); 204 newArrB = newArrB.replace(/\!/g, ','); 205 newArrB = newArrB.substring(0, newArrB.length - 1); 206 // Remove cookie 207 document.cookie = 'OptanonConsent=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;'; 208 // Set cookie 209 document.cookie = 'OptanonConsent=' + newArrB + '; Path=/;'; 210 if (param == 'true') { 211 // Marcando los checks 212 document.querySelectorAll('#onetrust-consent-sdk .ot-acc-hdr .ot-tgl').forEach(function(element) { 213 var input = element.querySelector('input'); 214 if (input) { 215 input.checked = true; 216 input.setAttribute('aria-checked', 'true'); 217 } 218 }); 219 } 220 } 221 }, 1000); 222});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.