1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7954,6384],{57954:function(e,r,t){t.r(r),t.d(r,{ReferralTracker:function(){return i}});var n=t(64090),a=t(36384);function i(){return(0,n.useEffect)(()=>{try{(0,a.Jz)()}catch(e){console.warn("Referral tracking failed to initialize:",e)}},[]),null}},36384:function(e,r,t){t.d(r,{Jz:function(){return l},getReferralData:function(){return o}}),t(23663).Buffer;let n="lighthouse_referral_data";function a(e){let r={};return e.referral_source&&"string"==typeof e.referral_source&&(r.referral_source=e.referral_source.substring(0,255).trim()),e.referral_medium&&"string"==typeof e.referral_medium&&(r.referral_medium=e.referral_medium.substring(0,255).trim()),e.referral_campaign&&"string"==typeof e.referral_campaign&&(r.referral_campaign=e.referral_campaign.substring(0,255).trim()),e.referral_content&&"string"==typeof e.referral_content&&(r.referral_content=e.referral_content.substring(0,255).trim()),e.referral_term&&"string"==typeof e.referral_term&&(r.referral_term=e.referral_term.substring(0,255).trim()),e.initial_referrer&&"string"==typeof e.initial_referrer&&(r.initial_referrer=e.initial_referrer.substring(0,500).trim()),e.landing_page&&"string"==typeof e.landing_page&&(r.landing_page=e.landing_page.substring(0,500).trim()),r}function i(){try{if(!window.localStorage)return{};let e=localStorage.getItem(n);if(!e)return{};let r=JSON.parse(e);if(r.expires&&Date.now()>r.expires)return localStorage.removeItem(n),{};let{timestamp:t,expires:a,...i}=r;return i}catch(e){return console.warn("Failed to retrieve referral data:",e),{}}}function o(){try{let e=i();return a(e)}catch(e){return console.warn("Failed to get referral data:",e),{}}}function l(){try{let e=i();if(e&&Object.keys(e).length>0)return;let r=function(){try{let e=new URLSearchParams(window.location.search),r=document.referrer,t=window.location.href,n=e.get("utm_source"),a=e.get("utm_medium"),i=e.get("utm_campaign"),o=e.get("utm_content"),l=e.get("utm_term"),c=n,s=a;if(!c&&r)try{let e=new URL(r).hostname.toLowerCase();c=e.includes("facebook.com")||e.includes("fb.com")?"facebook":e.includes("instagram.com")?"instagram":e.includes("google.com")||e.includes("google.")?"google":e.includes("linkedin.com")?"linkedin":e.includes("twitter.com")||e.includes("t.co")?"twitter":e.includes("youtube.com")||e.includes("youtu.be")?"youtube":e.includes("tiktok.com")?"tiktok":e.includes("pinterest.com")?"pinterest":e.includes("reddit.com")?"reddit":e,s||(s=["facebook","instagram","linkedin","twitter","youtube","tiktok","pinterest","reddit"].includes(c)?"social":"google"===c?r.includes("ads")||r.includes("aclk")?"cpc":"organic":"referral")}catch(e){console.warn("Failed to parse referrer URL:",e)}let u={};return c&&(u.referral_source=c),s&&(u.referral_medium=s),i&&(u.referral_campaign=i),o&&(u.referral_content=o),l&&(u.referral_term=l),r&&(u.initial_referrer=r),t&&(u.landing_page=t),u}catch(e){return console.warn("Error extracting referral data:",e),{}}}();Object.keys(r).length>0&&function(e){try{if(!window.localStorage){console.warn("localStorage not available, skipping referral data storage");return}let r=i();if(r&&Object.keys(r).length>0||0===Object.keys(e).length)return;let t=a(e),o=Date.now(),l={...t,timestamp:o,expires:o+2592e6};localStorage.setItem(n,JSON.stringify(l)),function(e){try{if("undefined"==typeof document||0===Object.keys(e).length)return;let r=new Date;r.setDate(r.getDate()+30);let t=btoa(JSON.stringify(e));document.cookie="".concat("lighthouse_referral","=").concat(t,"; expires=").concat(r.toUTCString(),"; path=/; SameSite=Lax")}catch(e){console.warn("Failed to store referral cookie:",e)}}(t)}catch(e){console.warn("Failed to store referral data:",e)}}(r)}catch(e){console.warn("Referral tracking initialization failed:",e)}}}}]);
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.