1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3012],{4516:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(19946).A)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]])},6654:(e,t,l)=>{Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useMergedRef",{enumerable:!0,get:function(){return n}});let r=l(12115);function n(e,t){let l=(0,r.useRef)(null),n=(0,r.useRef)(null);return(0,r.useCallback)(r=>{if(null===r){let e=l.current;e&&(l.current=null,e());let t=n.current;t&&(n.current=null,t())}else e&&(l.current=a(e,r)),t&&(n.current=a(t,r))},[e,t])}function a(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let l=e(t);return"function"==typeof l?l:()=>e(null)}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},28883:(e,t,l)=>{l.d(t,{A:()=>r});let r=(0,l(19946).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])},92970:(e,t,l)=>{l.r(t),l.d(t,{default:()=>h});var r=l(95155),n=l(12115),a=l(49101),o=l.n(a);l(66467);var i=l(66766),s=l(89074),u=l(99600),d=l(99783),c=l(73238),f=l(59434);let p=["#1E40AF","#10B981","#E11D48","#6366F1","#F59E0B"];function h(e){let{routes:t,messages:l}=e,a=(0,n.useRef)(null),h=(0,n.useRef)(null),[m,v]=(0,n.useState)(!1),[g,y]=(0,n.useState)([]),[x,b]=(0,n.useState)("all"),[w,k]=(0,n.useState)(null),[j,E]=(0,n.useState)(null),C=(0,n.useMemo)(()=>t?t.filter(e=>{var t,l;let r=null==(l=e.filters)||null==(t=l.type)?void 0:t.toLowerCase();return"all"===x||r===x}).map((e,t)=>({...e,color:p[t%p.length]})):[],[t,x]),P=(0,n.useRef)(C);P.current=C,(0,n.useEffect)(()=>{(async()=>{try{let e=await (0,d.fV)();y(e)}catch(e){console.error("Failed to fetch events",e)}})()},[]);let N=(0,n.useCallback)(e=>{var t;let l=h.current;l&&(null==(t=l.getStyle().layers)||t.forEach(t=>{t.id.startsWith("poly-line-")&&(t.id.startsWith("poly-line-".concat(e))?(l.setPaintProperty(t.id,"line-width",5),l.setPaintProperty(t.id,"line-opacity",1)):(l.setPaintProperty(t.id,"line-width",2),l.setPaintProperty(t.id,"line-opacity",.2)))}))},[]),_=(0,n.useCallback)(()=>{var e;let t=h.current;t&&(null==(e=t.getStyle().layers)||e.forEach(e=>{e.id.startsWith("poly-line-")&&(t.setPaintProperty(e.id,"line-width",3),t.setPaintProperty(e.id,"line-opacity",1))}))},[]),M=(0,n.useCallback)(e=>{let t=h.current;if(t&&(null==e?void 0:e.polyline3d))try{let l=(0,f.W0)(e.polyline3d);if(0===l.length)return;let r=new(o()).LngLatBounds;for(let[e,t]of l)r.extend([e,t]);E(e),N(e.id),t.fitBounds(r,{padding:100,duration:1e3,linear:!1})}catch(e){console.error("Error fitting bounds for track:",e)}},[N]);(0,n.useEffect)(()=>{if(!a.current||h.current)return;let e=new(o()).Map({container:a.current,style:"https://slostr-main.s3.fr-par.scw.cloud/europe-tiles/outdoors.json",center:[6,46.5],zoom:6});return e.addControl(new(o()).NavigationControl,"top-right"),e.on("load",()=>v(!0)),e.on("moveend",()=>k(e.getBounds())),h.current=e,()=>{e.remove(),h.current=null,v(!1)}},[]),(0,n.useEffect)(()=>{var e;let t=h.current;if(!t||!m||0===C.length)return;(0,c.jv)(t,C);let l=(null==(e=t.getStyle().layers)?void 0:e.filter(e=>e.id.startsWith("poly-line-")))||[],r=[],n=[],a=[];return l.forEach(e=>{let l=e.id,o=()=>{t.getCanvas().style.cursor="pointer"},i=()=>{t.getCanvas().style.cursor=""},s=e=>{var t,l,r;let n=null==(r=e.features)||null==(l=r[0])||null==(t=l.properties)?void 0:t.trackId;if(!n)return;let a=P.current.find(e=>e.id===n);a&&M(a)};t.on("mouseenter",l,o),t.on("mouseleave",l,i),t.on("click",l,s),n.push({layerId:l,handler:o}),a.push({layerId:l,handler:i}),r.push({layerId:l,handler:s}
1)}),()=>{n.forEach(e=>{let{layerId:l,handler:r}=e;return t.off("mouseenter",l,r)}),a.forEach(e=>{let{layerId:l,handler:r}=e;return t.off("mouseleave",l,r)}),r.forEach(e=>{let{layerId:l,handler:r}=e;return t.off("click",l,r)})}},[C,m,M]);let S=(0,n.useMemo)(()=>{if(!(null==t?void 0:t.length)||!g.length)return[];let e=new Set(t.flatMap(e=>{var t,l;return[null==(t=e.organization)?void 0:t.id,null==(l=e.club)?void 0:l.id].filter(Boolean)}));return g.filter(t=>{var l;return e.has(t.id)||e.has(null==(l=t.partner)?void 0:l.id)})},[g,t]);(0,n.useEffect)(()=>{let e=h.current;if(!e||!m||!S.length)return;let t=[];return S.forEach(l=>{var r,n;let a=l.partner,i=null==a||null==(n=a.locations)||null==(r=n[0].point)?void 0:r.coordinates,s=null==a?void 0:a.logo_round,u=null==a?void 0:a.name,d=null==a?void 0:a.slug;if(!i||!s)return;let c=document.createElement("div");c.className="partner-logo-marker",c.style.width="42px",c.style.height="42px",c.style.borderRadius="50%",c.style.overflow="hidden",c.style.border="2px solid #FC9252",c.style.boxShadow="0 0 6px rgba(0, 0, 0, 0.3)",c.style.backgroundColor="#fff",c.style.cursor="pointer";let f=document.createElement("img");f.src=s,f.alt=u||"Partner",f.style.width="100%",f.style.height="100%",f.style.objectFit="cover",c.appendChild(f),c.addEventListener("click",()=>{window.location.href="/partners/".concat(d)});let p=new(o()).Marker({element:c}).setLngLat([i[0],i[1]]).addTo(e);t.push(p)}),()=>{t.forEach(e=>e.remove())}},[S,m]);let L=(0,n.useMemo)(()=>w&&C.length?C.filter(e=>(0,c.i3)(e,w)):C,[w,C]);return(0,r.jsxs)("main",{className:"h-full bg-white",children:[(0,r.jsx)("section",{className:"mx-auto w-full px-0 mt-8",children:(0,r.jsxs)("div",{className:"mx-auto w-full mt-4 grid grid-cols-1 md:grid-cols-[1fr_auto] gap-6",children:[(0,r.jsx)("div",{className:"relative md:sticky md:top-20 rounded-2xl overflow-hidden shadow ring-1 ring-black/5",children:(0,r.jsx)("div",{ref:a,className:"w-full h-[50vh] md:h-[calc(100vh-70px)]"})}),(0,r.jsxs)("div",{className:"w-full px-2 md:w-[600px] max-w-full md:max-w-[600px] md:pr-6",children:[(0,r.jsx)("div",{className:"mb-6 flex flex-wrap gap-2",children:[{id:"all",label:"All",img:null},{id:"gravel",label:"Gravel",img:"/images/gravel_bike.png"},{id:"road",label:"Road",img:"/images/road_bike.png"}].map(e=>{let{id:t,label:l,img:n}=e;return(0,r.jsxs)("button",{className:"\n group relative flex items-center gap-2 px-4 py-2.5 rounded-full\n font-medium text-sm transition-all duration-200\n ".concat(x===t?"bg-primary text-primary-foreground shadow-md scale-105 ":"bg-muted text-muted-foreground hover:bg-muted/80 hover:scale-105","\n "),onClick:()=>b(t),children:[n&&(0,r.jsx)(i.default,{src:n,alt:l,width:18,height:18,style:{filter:x===t?"brightness(0) invert(1)":""},className:"w-full object-cover"}),(0,r.jsx)("span",{children:l}),x===t&&(0,r.jsx)("div",{className:"absolute inset-0 rounded-full bg-primary/20 animate-pulse"})]},t)})}),(0,r.jsx)("div",{className:"overflow-y-auto px-2 mx-auto scrollbar-thin scrollbar-track-muted scrollbar-thumb-border md:max-h-[calc(100vh-160px)]",children:(0,r.jsx)(u.b,{tracks:L,onHoverTrack:N,onLeaveTrack:_,onSelectTrack:M,setExpandedTrack:E,expandedTrack:j,messages:l})})]})]})}),(0,r.jsx)(s.Toaster,{position:"bottom-center",duration:5e3,richColors:!0})]})}}}]);
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.