1import{r as o}from"./chunk-rtlSGV0HlPFTb.js";import{j as p}from"./chunk-BUmnHJrbSQCzs.js";import{t as m}from"./chunk-BuXEeQCh5kExK.js";import{u as d}from"./chunk-Cr1thAwDmElSC.js";import{b as f,i as g}from"./chunk-B1MXwVn5wYZ4B.js";function y(t,e){const n={},r=Object.keys(t);for(let s=0;s<r.length;s++){const a=r[s],i=t[a];n[e(i,a,t)]=i}return n}function v(t,e=g){return t==null?{}:y(t,f(e))}const h=o.createContext(null);function V({value:t,children:e}){return p.jsx(h.Provider,{value:t,children:e})}function w(){return o.useContext(h)}function $(t){const e=t.toLowerCase();if(e.includes("windows nt")){const n=e.match(/windows nt ([\d.]+)/);return{os:"Windows",os_version:n?n[1]:null}}if(e.includes("mac os x")){const n=e.match(/mac os x ([\d_.]+)/);return{os:"macOS",os_version:n?n[1].replace(/_/g,"."):null}}if(e.includes("iphone")||e.includes("ipad")||e.includes("ipod")){const n=e.match(/os ([\d_.]+)/);return{os:"iOS",os_version:n?n[1].replace(/_/g,"."):null}}if(e.includes("android")){const n=e.match(/android ([\d.]+)/);return{os:"Android",os_version:n?n[1]:null}}return e.includes("linux")?{os:"Linux",os_version:null}:e.includes("cros")?{os:"Chrome OS",os_version:null}:{os:null,os_version:null}}function P(t){const e=t.toLowerCase();return e.includes("iphone")||e.includes("ipod")?"mobile":e.includes("ipad")?"tablet":e.includes("android")?e.includes("tablet")||!e.includes("mobile")?"tablet":"mobile":"web"}function _(){var t,e;if(typeof window>"u")return{width:null,height:null};try{return{width:((t=window.screen)==null?void 0:t.width)||null,height:((e=window.screen)==null?void 0:e.height)||null}}catch{return{width:null,height:null}}}function S(){if(typeof navigator>"u"||!("connection"in navigator))return null;try{const t=navigator.connection;if(t&&t.type)return t.type==="wifi"}catch{}return null}function k(){return"1.0.0"}function E(){const t=typeof navigator<"u"?navigator.userAgent:"",{os:e,os_version:n}=$(t),r=P(t),{width:s,height:a}=_(),i=S();return{platform:r,os:e,os_version:n,user_agent:t,screen_width:s,screen_height:a,lib_version:k(),wifi:i}}let c=null;function b(){return c===null&&(c=E()),c}const C=new Set(["utm_source","utm_medium","utm_campaign","utm_term","utm_content","campaign_id","campaignId","tab","page","sort","view","ref","source","lang","round","layout","q","filter"]),L="[REDACTED]";function u(t){const e=t.startsWith("?")?"?":"",n=new URLSearchParams(t),r=new URLSearchParams;for(const[a,i]of n)r.append(a,C.has(a)?i:L);const s=r.toString();return s?e+s:""}function R(t){const e=t.replace(/^\/|\/$/g,"");return e===""?"Home Page":e.split("/").map(s=>s.replace(/[-_]/g," ").split(" ").map(a=>a.charAt(0).toUpperCase()+a.slice(1).toLowerCase()).join(" ")).join(" - ")}const x=[{path:/^\/events\/[^/]+\/manage\/?.*$/},{path:/^\/leagues\/[^/]+\/manage\/?.*$/},{path:/^\/leagues\/apply$/},{path:/^\/events\/[^/]+\/duplicate$/},{path:/^\/events$/,trackQueryParamChanges:!0},{path:/^\/events\/[^/]+$/},{path:/^\/f\/leagues$/},{path:/^\/f\/course-ambassador$/},{path:/^\/$/},{path:/^\/sign-up$/},{path:/^\/login$/},{path:/^\/subscribe$/},{path:/^\/f\/community$/},{path:/^\/replay$/},{path:/^\/courses\/?.*$/,trackQueryParamChanges:!0},{path:/^\/stores\/?.*$/},{path:/^\/places$/},{path:/^\/places\/?.*$/},{path:/^\/dashboard$/},{path:/^\/disc-golf-growth-report$/},{path:/^\/grow$/},{path:/^\/health$/},{path:/^\/players\/share$/},{path:/^\/players\/[^/]+\/claim$/},{path:/^\/designers$/,trackQueryParamChanges:!0},{path:/^\/designers\/[^/]+$/},{path:/^\/impact\/[^/]+$/},{path:/^\/try-disc-golf$/}];async function T(t,e){const n=m.keyof().Enum;try{if(t.pathname){const r=new URLSearchParams(u(t.search??"")),s=v(Object.fromEntries(r.entries()),(D,l)=>`URL Search Param - ${l}`),a=b(),i={[n.pageTitle]:R(t.pathname),[n.domain]:t.host,[n.protocol]:t.protocol,[n.pathname]:t.pathname,[n.search]:u(t.search??""),...s,...e&&{entityType:e.entityType,entityId:e.entityId,entityLegacyId:e.entityLegacyId,entitySlug:e.entitySlug,entityName:e.entityName,entityMetadata:e.entityMetadata},screenWidth:a.screen_width,screenHeight:a.screen_height,wifi:a.wifi};await fetch("/api/track-page-view",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})}}catch{}}function I({matchedRoute:t,location:e,previousPathname:n,previousQueryParams:r}){if(!t)return!1;const s=n!==e.pathname,a=t.trackQueryParamChanges&&r!==e.search||!1,i=!t.filter||t.filter({pathname:e.pathname??"",queryParams:e.search??""});return(s||a)&&i}function F(){const t=d(),e=w(),n=o.useRef(),r=o.useRef(),s=t.pathname??"";return o.useEffect(()=>{const a=x.find(i=>i.path.test(s));I({matchedRoute:a,location:t,previousPathname:n.current,previousQueryParams:r.current})&&T(t,e).catch(()=>{}),n.current=t.pathname,r.current=t.search},[t.pathname,t.search,e]),null}export{V as E,F as P,u as r};
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.