1'use strict'; 2 3// Umami analytics: https://github.com/mikecao/umami 4 5console.log('STATS', window.location); 6 7const statsDataKey = 'statsData'; 8const statsData = window.sessionStorage.getItem(statsDataKey); 9 10const apiUrl = window.location.origin + '/stats'; 11 12if (statsData) { 13 setStats(JSON.parse(statsData)); 14} else { 15 fetch(apiUrl) 16 .then((response) => { 17 if (!response.ok) { 18 throw new Error('Network response was not ok'); 19 } 20 return response.json(); 21 }) 22 .then((data) => { 23 setStats(data); 24 window.sessionStorage.setItem(statsDataKey, JSON.stringify(data)); 25 }) 26 .catch((error) => { 27 console.error('Stats fetch error:', error); 28 }); 29} 30 31function setStats(data) { 32 console.log('STATS', data); 33 const { enabled, src, id } = data; 34 if (enabled) { 35 const script = document.createElement('script'); 36 script.setAttribute('async', ''); 37 script.setAttribute('src', src); 38 script.setAttribute('data-website-id', id); 39 document.head.appendChild(script); 40 } 41}
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.