1if (typeof memboGo === 'undefined') { 2 var memboGo = {}; 3} 4 5if (typeof memboGo.Web === 'undefined') { 6 memboGo.Web = {}; 7} 8 9memboGo.Web.Consent = { 10 ga4: '', 11 hotjarId: '', 12 facebookId: '', 13 ga: {}, 14 15 init: function (enable, translate, lang) { 16 var self = this; 17 this.prepareYaplaConsent(translate, lang); 18 if (enable) { 19 var s = document.createElement('script'); 20 s.src = 'https://cdn.kiprotect.com/klaro/v0.7.18/klaro.js'; 21 s.defer = true; 22 s.setAttribute('data-klaro-config', 'yaplaConsent'); 23 s.addEventListener('load', () => { 24 window.dispatchEvent(new Event('klaroLoaded')); 25 }); 26 document.head.appendChild(s); 27 } else { 28 self.rgpd(); 29 $.map(window.yaplaConsent.services, function (item) { 30 item.callback(true, item); 31 }); 32 } 33 }, 34 35 gtm: function (tags) { 36 try { 37 for (let layer in tags) { 38 this.addGtmScript(tags[layer], layer); 39 } 40 } catch (e) { 41 memboGo.core.dispatchException(e); 42 } 43 }, 44 45 rgpd: function () { 46 if (typeof RGPDContent !== 'undefined') { 47 window.addEventListener("load", function () { 48 window.cookieconsent.initialise({ 49 "palette": { 50 "popup": { 51 "background": "#858585F2" 52 }, 53 "button": { 54 "background": "transparent" 55 } 56 }, 57 "theme": "edgeless", 58 "content": RGPDContent, 59 "position": "bottom" 60 }) 61 }); 62 $(document).on('click', '.cc-link', function (e) { 63 e.preventDefault(); 64 e.stopPropagation(); 65 if ($('#modal-user-consent').length) { 66 modalUserConsent.open(); 67 } else { 68 $.get($(this).attr('href'), function (data) { 69 $('body').append(data); 70 }); 71 } 72 }); 73 } 74 }, 75 76 googleAnalytics: function (id) { 77 if (typeof this.ga[id] !== 'undefined') { 78 return; 79 } 80 const layer = 'gaLayer'; 81 this.ga[id] = 1; 82 this.addGtmScript(id, layer); 83 window.ga4 = function () { 84 window[layer].push(arguments) 85 }; 86 window.ga4('config', id); 87 }, 88 89 addGtmScript: function (id, layer, callback) { 90 $('body').append('<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=' + id + '" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>'); 91 92 (function (w, d, s, l, i) { 93 w[l] = w[l] || []; 94 w[l].push({'gtm.start': new Date().getTime(), event: 'gtm.js'}); 95 let f = d.getElementsByTagName(s)[0], 96 j = d.createElement(s), 97 dl = l !== 'dataLayer' ? '&l=' + l : ''; 98 j.async = true; 99 j.src = 'https://www.googletagmanager.com/gtm.js?id=' + i + dl; 100 f.parentNode.insertBefore(j, f); 101 102 if (typeof callback === 'function') { 103 callback(); 104 } 105 106 })(window, document, 'script', layer, id); 107 }, 108 109 fbPixel: function (id) { 110 if (window.fbq) return; 111 $('header').append('<noscript><img height="1" width="1" style="display:none" src="https://www.facebook.com/tr?id=' + id + '&ev=PageView&noscript=1" alt=""/></noscript>'); 112 var n = window.fbq = function () { 113 n.callMethod ? 114 n.callMethod.apply(n, arguments) : n.queue.push(arguments) 115 }; 116 if (!window._fbq) window._fbq = n; 117 n.push = n; 118 n.loaded = !0; 119 n.version = '2.0'; 120 n.queue = []; 121 var t = document.createElement('script'); 122 t.async = !0; 123 t.src = 'https://connect.facebook.net/en_US/fbevents.js'; 124 var s = document.getElementsByTagName('script')[0]; 125 s.parentNode.insertBefore(t, s);
126 window.fbq('init', id); 127 window.fbq('track', 'PageView'); 128 }, 129 130 gtmTrack: function (name) { 131 memboGo.core.trackEvent('Yapla-' + name + '-Accepted'); 132 }, 133 134 prepareYaplaConsent: function (translate, lang) { 135 window.yaplaConsent = { 136 lang: lang, 137 translations: {}, 138 version: 1, 139 elementID: 'yapla-consent-box', 140 styling: { 141 theme: ['light', 'top', 'wide'], 142 }, 143 noAutoLoad: true, 144 htmlTexts: true, 145 embedded: false, 146 groupByPurpose: false, 147 storageMethod: 'cookie', 148 cookieName: 'yapla-consent', 149 cookieExpiresAfterDays: 365, 150 default: false, 151 mustConsent: false, 152 acceptAll: true, 153 hideDeclineAll: false, 154 hideLearnMore: false, 155 noticeAsModal: false, 156 disablePoweredBy: true, 157 additionalClass: 'yapla-consent', 158 show: false, 159 services: [ 160 { 161 name: 'Google-Analytics', 162 contextualConsentOnly: false, 163 callback: function (c, s) { 164 if (c) { 165 memboGo.Web.Consent.gtmTrack(s.name); 166 167 if (memboGo.Web.Consent.ga4 !== '') { 168 memboGo.Web.Consent.googleAnalytics(memboGo.Web.Consent.ga4); 169 } 170 171 } else { 172 memboGo.Web.Consent.clearCookies(s.cookies); 173 } 174 memboGo.Web.Consent.gtmTrack('Drip') 175 }, 176 cookies: [ 177 { 178 pattern: '^_(ga|gid|dc_gtm_UA-)', 179 path: '/' 180 } 181 ] 182 183 }, 184 { 185 name: 'Google-Ads', 186 contextualConsentOnly: false, 187 callback: function (c, s) { 188 if (c) { 189 memboGo.Web.Consent.gtmTrack(s.name); 190 } else { 191 memboGo.Web.Consent.clearCookies(s.cookies); 192 } 193 }, 194 cookies: [ 195 { 196 pattern: '^_gcl_au', 197 path: '/' 198 } 199 ] 200 }, 201 { 202 name: 'Amplitude', 203 contextualConsentOnly: false, 204 callback: function (c, s) { 205 if (c) { 206 memboGo.Web.Consent.gtmTrack(s.name); 207 } else { 208 memboGo.Web.Consent.clearCookies(s.cookies); 209 } 210 }, 211 cookies: [ 212 { 213 pattern: '^amplitude_', 214 path: '/' 215 } 216 ] 217 }, 218 { 219 name: 'Hotjar', 220 contextualConsentOnly: false, 221 callback: function (c, s) { 222 if (c) { 223 memboGo.Web.Consent.gtmTrack(s.name); 224 memboGo.Web.Consent.hotjarId !== '' && memboGo.core.hotjar(memboGo.Web.Consent.hotjarId) 225 } else { 226 memboGo.Web.Consent.clearCookies(s.cookies); 227 } 228 }, 229 cookies: [ 230 { 231 pattern: '^_(hjid|hjAbsoluteSessionInProgress|hjTLDTest|hjSession|hjFirstSeen|hjIncludedInPageviewSample)', 232 path: '/' 233 } 234 ] 235 }, 236 { 237 name: 'Facebook', 238 contextualConsentOnly: false, 239 callback: function (c, s) { 240 if (c) { 241 memboGo.Web.Consent.gtmTrack(s.name); 242 memboGo.Web.Consent.facebookId !== '' && memboGo.Web.Consent.fbPixel(memboGo.Web.Consent.facebookId); 243 } else { 244 memboGo.Web.Consent.clearCookies(s.cookies); 245 } 246 }, 247 cookies: [ 248 { 249 pattern: '^_fbp', 250 path: '/' 251 } 252 ] 253 }, 254 { 255 name: 'Sentry', 256 contextualConsentOnly: false, 257 callback: function (c, s) { 258 if (c) { 259 window.dispatchEvent(new CustomEvent('consentGiven', {detail: 'sentry'})); 260 } 261 } 262 } 263 ] 264 }; 265 window.yaplaConsent.translations[lang] = translate; 266 }, 267 /* Note: We have to clear cookies for all domain variations which is something currently not supported by klaro. 268 See https://github.com/kiprotect/klaro/issues/51 269 */ 270 clearCookies: function (cookies) { 271 if (!cookies && typeof cookies[0].pattern === 'undefined') { 272 return; 273 } 274 var domain = window.location.hostname.split('.').slice(-2).join('.'), 275 r = new RegExp(cookies[0].pattern), 276 items = document.cookie.split(";"); 277 for (var i = 0; i < items.length; i++) { 278 var name = items[i].split('=')[0].trim(); 279 if (r.exec(name)) { 280 name += "=; Max-Age=-99999999; path=" + cookies[0].path + "; domain="; 281 document.cookie = name + domain + ";"; 282 document.cookie = name + "." + domain + ";"; 283 284 // Because some cookies saved in membogo.com domain 285 if (domain !== 'membogo.com') { 286 document.cookie = name + ".membogo.com;"; 287 } 288 } 289 } 290 } 291} 292
293memboGo.Web.Menu = { 294 vertical: function (ul) { 295 var children = document.querySelector(ul).querySelectorAll('.has-children'), self = this; 296 for (var i = 0; i < children.length; i++) { 297 children[i].addEventListener("click", function (e) { 298 e.stopPropagation(); 299 self.show(this, null); 300 }); 301 302 children[i].addEventListener("mouseenter", function (e) { 303 if (window.innerWidth > 992) { 304 e.stopPropagation(); 305 self.show(this, true); 306 } 307 }); 308 309 children[i].addEventListener("mouseleave", function (e) { 310 if (window.innerWidth > 992) { 311 e.stopPropagation(); 312 self.show(this, false); 313 } 314 }); 315 } 316 }, 317 show: function (that, state) { 318 var id = that.getAttribute('data-menu-id'), 319 submenu = document.getElementById('submenu_' + id); 320 if (state === null) { 321 state = submenu.style.display === 'none'; 322 } 323 submenu.style.display = state ? 'block' : 'none'; 324 325 // On desktop, we check if submenu is outside of right viewport. 326 // If it'ts the case, we display it on bottom. 327 if (window.innerWidth > 992) { 328 var submenuIsOutOfRightViewport = memboGo.core.utils.elementIsOutOfViewport(submenu).right, 329 dropdownToggle = submenu.previousElementSibling, 330 caret = dropdownToggle.querySelector(".caret"); 331 332 if (submenuIsOutOfRightViewport) { 333 submenu.classList.add("bottom"); 334 dropdownToggle.classList.add("bottom"); 335 submenu.parentNode.style.display = "inline-block"; 336 } else { 337 submenu.classList.remove("bottom"); 338 dropdownToggle.classList.remove("bottom"); 339 submenu.parentNode.style.display = "flex"; 340 } 341 342 // Fix caret 343 caret.className = submenuIsOutOfRightViewport ? "caret" : "caret caret-right"; 344 } else { 345 submenu.parentNode.style.display = "inline-block"; 346 } 347 }, 348}
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.