1window.dataLayer=window.dataLayer||[];(function(e="dataLayer"){window[e]=window[e]||[];const n=window[e],a=n.push.bind(n),t=new Set;function o(r){try{window.dispatchEvent(new CustomEvent("datalayer:event",{detail:r}))}catch{}t.forEach(i=>{try{i(r)}catch(s){console.error("DL subscriber error",s)}})}n.push=function(){for(let r=0;r<arguments.length;r++){const i=arguments[r];o(i)}return a.apply(n,arguments)},window.dataLayerListener={subscribe(r){return t.add(r),()=>t.delete(r)},getDataLayer(){return n},backlog(){n.length&&n.forEach(o)}}})();function u(){return([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}window._sendEvent=async function(e){_sendEvents([e])};window._sendEvents=async function(e){if(!Array.isArray(e)){console.error("_sendEvent expects an array of event objects");return}const n=["app_init","user_initialized","login","registration","demo_recalc_run","begin_checkout","purchase"],a=e.filter(t=>t&&typeof t.event=="string").filter(t=>!t.event.startsWith("gtm.")).filter(t=>n.includes(t.event));if(a.length!==0){a.forEach(t=>{try{if(t.event=="app_init"&&fbq("track","PageView",{},{eventID:t.event_id}),t.event=="registration"&&fbq("track","CompleteRegistration",{content_name:"User Registration"},{eventID:t.event_id}),t.event=="purchase"){const{value:o,currency:r}=t.ecommerce;fbq("track","Purchase",{value:o,currency:r})}}catch(o){console.error("Error sending events to FB:",o)}});try{const t=await fetch("/api/events",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({events:a})});t.ok||console.error("Failed to send events:",t.statusText)}catch(t){console.error("Error sending events:",t)}}};window.getFbpFromCookie=function(){const e=document.cookie.match(/_fbp=([^;]+)/);return e?e[1]:null};window.getFbcFromCookie=function(){const e=document.cookie.split("; ").find(n=>n.startsWith("_fbc="));return e?e.split("=")[1]:null};window.getClientIdFromCookie=function(){const e=document.cookie.split("; ").find(n=>n.startsWith("_ga="));if(e){const n=e.split(".");if(n.length>=4)return`${n[2]}.${n[3]}`}return null};window.addEventListener("business_logic_event",e=>{_sendEvent(e.detail)});function g(){var r;let e=0;const n=10,a=1e3;let t={};try{t={url:window.location.href,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone,browserLang:navigator.language||navigator.userLanguage,screenResolution:`${screen.width}x${screen.height}`,browser:((r=navigator.userAgent.match(/(Chrome|Firefox|Safari|Edge|Opera)/i))==null?void 0:r[0])||"Unknown",os:navigator.platform||"Unknown",isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}}catch{t={}}const o=setInterval(()=>{e++;const i=getClientIdFromCookie(),s=getFbpFromCookie(),d=getFbcFromCookie(),l=u();_sendEvent({event:"app_init",gclientid:i,fbp:s,fbc:d,event_id:l,...t}),(i&&s||e>=n)&&clearInterval(o)},a)}function c(){g(),window.dataLayerListener.subscribe(e=>{_sendEvent(e)}),window.dataLayerListener.backlog()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",c):c();
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.