1(function () { 2 var scriptLoaded = false; 3 var loadScript = function() { 4 if (scriptLoaded) return; 5 6 scriptLoaded = true; 7 8 var script = document.createElement('script'); 9 script.src = '/modules/custom/visitnc_search/assets/dist/bundle.js'; 10 script.defer = true; 11 script.async = true; 12 13 script.onerror = function() { 14 scriptLoaded = false; 15 }; 16 17 script.onload = function() { 18 console.log('visitnc bundle.js loaded successfully'); 19 }; 20 21 document.head.appendChild(script); 22 }; 23 24 var loadWithTimeout = function(delay) { 25 setTimeout(function() { 26 loadScript(); 27 }, delay); 28 }; 29 30 var specificElement = document.getElementById('card_slider_automatic_3300'); 31 32 if (specificElement) { 33 if ('IntersectionObserver' in window) { 34 var observer = new IntersectionObserver(function(entries) { 35 entries.forEach(function(entry) { 36 if (entry.isIntersecting && !scriptLoaded) { 37 console.log('#card_slider_automatic_3300 entering viewport, loading bundle.js'); 38 loadScript(); 39 observer.disconnect(); 40 } 41 }); 42 }, { 43 rootMargin: '100px', 44 threshold: 0.1, 45 }); 46 47 observer.observe(specificElement); 48 49 if (document.readyState === 'loading') { 50 document.addEventListener('DOMContentLoaded', function() { 51 observer.observe(specificElement); 52 }); 53 } 54 55 } else { 56 setTimeout(loadScript, 1000); 57 } 58 59 } else { 60 if (window.innerWidth > 992) { 61 loadWithTimeout(2000); 62 } 63 if (window.innerWidth < 992) { 64 loadWithTimeout(7000); 65 } 66 67 if (window.innerWidth <= 992 && window.innerWidth >= 992) { 68 loadWithTimeout(3000); 69 } 70 } 71 72 window.visitncLoadBundle = function() { 73 loadScript(); 74 }; 75})();
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.