PageSourceSearch

https://rtrankings-web.vercel.app/_next/static/chunks/app/(public)…?dpl=dpl_3J9HTrr82MV74Fxhwv6xUPFpQJEV

js rtrankings-web.vercel.app collected 2026-10-03 07:39:03 UTC 16,822 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9368],{2215:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var r=s(4568),a=s(7620),n=s(7541),l=s(9242),i=s(1674),o=s(4577),c=s(9664),d=s.n(c);function x(){return(0,r.jsx)(a.Suspense,{fallback:(0,r.jsx)("div",{className:"flex justify-center py-20",children:(0,r.jsx)("img",{src:"/logo.svg",alt:"Loading",className:"h-10 w-auto animate-pulse"})}),children:(0,r.jsx)(m,{})})}function m(){let e=(0,n.useSearchParams)(),t=(0,n.useRouter)(),s=e.get("q")||"",{user:c}=(0,i.A)(),[x,m]=(0,a.useState)(s),u=(0,o.P)(),p=u.venue?"&venue=".concat(u.venue):"",[h,f]=(0,a.useState)([]),[b,g]=(0,a.useState)(!1),[y,j]=(0,a.useState)(!1),[v,N]=(0,a.useState)(!1),[w,k]=(0,a.useState)(0),[S,C]=(0,a.useState)(1),[P,R]=(0,a.useState)(new Set),[z,q]=(0,a.useState)(null),[I,D]=(0,a.useState)(!1),[F,U]=(0,a.useState)(null),[_,A]=(0,a.useState)(new Set),[E,O]=(0,a.useState)(null),M=(0,a.useRef)(null),T=async e=>{if(!c){window.location.href="/login?returnUrl=/search?q=".concat(encodeURIComponent(x));return}U(e),O(null);try{await (0,l.FH)("/profiles/".concat(e,"/claim"),{method:"POST",body:JSON.stringify({})}),A(t=>new Set(t).add(e)),O({id:e,type:"success",text:"Claim request submitted — pending admin review"})}catch(t){O({id:e,type:"error",text:t instanceof Error?t.message:"Failed to submit claim"})}U(null),setTimeout(()=>O(null),1e4)},H=async e=>{if(e&&!(e.length<2)){g(!0),N(!0),C(1),t.replace("/search?q=".concat(encodeURIComponent(e)),{scroll:!1});try{var s,r;let t=await fetch("".concat("https://api.runthroughrankings.com/api/v1\n","/profiles/search?q=").concat(encodeURIComponent(e),"&limit=").concat(50,"&page=1&includeAll=true").concat(p)),a=await t.json();f(a.data||[]),k(null!=(r=null==(s=a.pagination)?void 0:s.total)?r:(a.data||[]).length)}catch(e){f([]),k(0)}g(!1)}},L=async()=>{if(y)return;j(!0);let e=S+1;try{let t=await fetch("".concat("https://api.runthroughrankings.com/api/v1\n","/profiles/search?q=").concat(encodeURIComponent(x),"&limit=").concat(50,"&page=").concat(e,"&includeAll=true").concat(p)),s=(await t.json()).data||[];f(e=>{let t=new Set(e.map(e=>e.id));return[...e,...s.filter(e=>!t.has(e.id))]}),C(e)}catch(e){}j(!1)};(0,a.useEffect)(()=>{var e;s&&H(s),null==(e=M.current)||e.focus()},[]);let J=async()=>{if(P.size<2)return;if(!c){window.location.href="/login?returnUrl=/search?q=".concat(encodeURIComponent(x));return}D(!0),q(null);let e=Array.from(P).sort((e,t)=>{var s,r,a,n,l,i;let o=null!=(l=null==(r=h.find(t=>t.id===e))||null==(s=r.rankingsDetail)?void 0:s.totalRaces)?l:0;return(null!=(i=null==(n=h.find(e=>e.id===t))||null==(a=n.rankingsDetail)?void 0:a.totalRaces)?i:0)-o}),t=e[0],s=0,r=[];for(let a=1;a<e.length;a++)try{await (0,l.FH)("/profiles/".concat(t,"/merge-request"),{method:"POST",body:JSON.stringify({targetProfileId:e[a],reason:"Same person - merge ".concat(e.length," profiles from search page")})}),s++}catch(e){r.push(e instanceof Error?e.message:"Unknown error")}0===r.length?(q({type:"success",text:"".concat(s," merge request").concat(1!==s?"s":""," submitted for admin review")}),R(new Set),setTimeout(()=>q(null),1e4)):0===s?q({type:"error",text:"0 submitted, ".concat(r.length," failed. First error: ").concat(r[0])}):q({type:"error",text:"".concat(s," submitted, ").concat(r.length," failed. First error: ").concat(r[0])}),D(!1)};return(0,r.jsxs)("div",{className:"max-w-3xl mx-auto px-4 lg:px-8 py-8",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,r.jsx)("div",{className:"h-[2px] w-6 bg-primary rounded-full"}),(0,r.jsx)("span",{className:"font-headline text-[11px] font-bold uppercase tracking-wide text-primary-text",children:"Find a Runner"})]}),(0,r.jsx)("h1",{className:"font-headline text-3xl lg:text-4xl font-extrabold tracking-tight text-on-surface mb-6",children:"Search Profiles"}),(0,r.jsxs)("div",{className:"bg-primary/5 border border-primary/20 rounded-xl px-5 py-4 mb-6",children:[(0,r.jsxs)("div",{className:"flex items-start gap-2 mb-3",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0 mt-0.5",style:{fontSize:16},children:"info"}),(0,r.jsx)("p",{className:"text-xs font-bold text-on-surface font-body",children:"Is your profile split across multiple entries?"})]}),(0,r.jsx)("p",{className:"text-xs text-secondary font-body leading-relaxed mb-4",children:"If your results appear under several different profiles (e.g. different spellings or clubs), you can merge them into one. Here's how:"}),(0,r.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[(0,r.jsxs)("div",{className:"bg-white/70 rounded-lg px-3 py-2.5 flex gap-2.5 items-start",children:[(0,r.jsx)("span",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-primary text-on-primary text-[10px] font-extrabold flex items-center justify-center font-body",children:"1"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[11px] font-bold text-on-surface font-body mb-0.5",children:"Register & log in"}),(0,r.jsxs)("p",{className:"text-[10px] text-secondary font-body leading-relaxed",children:["Create a free account or log in if you already have one. ",(0,r.jsx)("a",{href:"/register",className:"text-primary font-semibold hover:underline",children:"Register here."})]})]})]}),(0,r.jsxs)("div",{className:"bg-white/70 rounded-lg px-3 py-2.5 flex gap-2.5 items-start",children:[(0,r.jsx)("span",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-primary text-on-primary text-[10px] font-extrabold flex items-center justify-center font-body",children:"2"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[11px] font-bold text-on-surface font-body mb-0.5",children:"Claim your profile"}),(0,r.jsxs)("p",{className:"text-[10px] text-secondary font-body leading-relaxed",children:["Find your name in the search results below and click ",(0,r.jsx)("strong",{children:"Claim"}),". An admin will verify and approve the claim."]})]})]}),(0,r.jsxs)("div",{className:"bg-white/70 rounded-lg px-3 py-2.5 flex gap-2.5 items-start",children:[(0,r.jsx)("span",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-primary text-on-primary text-[10px] font-extrabold flex items-center justify-center font-body",children:"3"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[11px] font-bold text-on-surface font-body mb-0.5",children:"Select profiles to merge"}),(0,r.jsxs)("p",{className:"text-[10px] text-secondary font-body leading-relaxed",children:["Tick the checkboxes next to any duplicate profiles in the results list, then click ",(0,r.jsx)("strong",{children:"Request Merge"}),"."]})]})]}),(0,r.jsxs)("div",{className:"bg-white/70 rounded-lg px-3 py-2.5 flex gap-2.5 items-start",children:[(0,r.jsx)("span",{className:"flex-shrink-0 w-5 h-5 rounded-full bg-primary text-on-primary text-[10px] font-extrabold flex items-center justify-center font-body",children:"4"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[11px] font-bold text-on-surface font-body mb-0.5",children:"Admin approves"}),(0,r.jsx)("p",{className:"text-[10px] text-secondary font-body leading-relaxed",children:"Your merge request goes to an admin for review. Once approved, all your results will appear under one profile."})]})]})]})]}),(0,r.jsxs)("form",{onSubmit:e=>{e.preventDefault(),H(x)},className:"flex gap-2 mb-8",children:[(0,r.jsxs)("div",{className:"flex-1 relative",children:[(0,r.jsx)("span",{className:"material-symbols-outlined absolute left-3 top-1/2 -translate-y-1/2 text-outline",style:{fontSize:20},children:"search"}),(0,r.jsx)("input",{"aria-label":"Search by runner name",ref:M,type:"text",value:x,onChange:e=>m(e.target.value),placeholder:"Search by runner name...",className:"w-full border border-outline-variant/40 rounded-xl pl-10 pr-4 py-3 text-sm font-body bg-white focus:outline-none focus:ring-2 focus:ring-primary focus:border-primary"})]}),(0,r.jsx)("button",{type:"submit",className:"px-6 py-3 bg-primary text-on-primary rounded-xl text-[10px] font-extrabold uppercase tracking-wider font-body hover:bg-primary-container transition-colors",children:"Search"})]}),b&&(0,r.jsxs)("div",{className:"bg-white rounded-2xl border border-outline-variant shadow-sm overflow-hidden","aria-busy":"true","aria-label":"Searching",children:[(0,r.jsx)("div",{className:"px-5 py-3 bg-surface-container-low border-b border-slate-100",children:(0,r.jsx)("div",{className:"h-2 w-32 bg-slate-200 rounded animate-pulse"})}),(0,r.jsx)("div",{className:"divide-y divide-slate-50",children:[0,1,2,3].map(e=>(0,r.jsxs)("div",{className:"flex items-center px-3 py-4 gap-3",children:[(0,r.jsx)("div",{className:"w-5 h-5 rounded border-2 border-slate-200 animate-pulse"}),(0,r.jsx)("div",{className:"w-10 h-10 rounded-lg bg-slate-100 animate-pulse"}),(0,r.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,r.jsx)("div",{className:"h-3 w-40 bg-slate-200 rounded animate-pulse"}),(0,r.jsx)("div",{className:"h-2 w-28 bg-slate-100 rounded animate-pulse"})]}),(0,r.jsx)("div",{className:"h-6 w-14 bg-slate-100 rounded animate-pulse"})]},e))})]}),!b&&v&&0===h.length&&(0,r.jsxs)("div",{className:"text-center py-16",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-outline mb-2",style:{fontSize:48},children:"person_search"}),(0,r.jsxs)("p",{className:"text-sm text-on-surface font-body font-semibold",children:['No runners found for "',x,'"']}),(0,r.jsx)("p",{className:"text-xs text-secondary font-body mt-1 max-w-sm mx-auto",children:"Try a different spelling, search by first name only, or by their running club."})]}),P.size>0&&(0,r.jsx)("div",{className:"fixed bottom-0 left-0 right-0 z-50 bg-white border-t border-slate-200 shadow-lg px-4 py-3 md:bottom-auto md:sticky md:top-14 md:mb-4 md:rounded-xl md:border md:shadow-sm",children:(0,r.jsxs)("div",{className:"max-w-3xl mx-auto flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-primary",style:{fontSize:20},children:"merge"}),(0,r.jsxs)("span",{className:"text-sm font-body font-semibold text-on-surface",children:[P.size," profile",1!==P.size?"s":""," selected",P.size<2?" — select more to merge":""]})]}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)("button",{onClick:()=>R(new Set),className:"px-3 py-1.5 text-[10px] font-bold uppercase text-secondary font-body hover:text-on-surface transition-colors",children:"Clear"}),P.size>=2&&(0,r.jsx)("button",{onClick:J,disabled:I,className:"px-4 py-1.5 bg-primary text-on-primary rounded-lg text-[10px] font-bold uppercase font-body hover:bg-primary-container transition-colors disabled:opacity-50",children:I?"Submitting...":"Request Merge"})]})]})}),z&&(0,r.jsxs)("div",{className:"mb-4 px-4 py-3 rounded-xl text-sm font-body flex items-start justify-between gap-3 ".concat("success"===z.type?"bg-green-50 text-green-700 ring-1 ring-green-200":"bg-red-50 text-red-700 ring-1 ring-red-200"),children:[(0,r.jsx)("span",{className:"flex-1",children:z.text}),(0,r.jsx)("button",{onClick:()=>q(null),"aria-label":"Dismiss",className:"shrink-0 -my-1 -mr-1 px-2 py-1 rounded hover:bg-black/5 transition-colors text-xs",children:"✕"})]}),!b&&h.length>0&&(0,r.jsxs)("div",{className:"bg-white rounded-2xl border border-outline-variant shadow-sm overflow-hidden",children:[(0,r.jsxs)("div",{className:"px-5 py-3 bg-surface-container-low border-b border-slate-100 flex items-center justify-between",children:[(0,r.jsx)("span",{className:"text-[9px] font-extrabold uppercase tracking-widest text-outline font-body",children:w>h.length?"Showing ".concat(h.length," of ").concat(w," runners"):"".concat(h.length," runner").concat(1!==h.length?"s":""," found")}),(0,r.jsx)("span",{className:"text-[9px] text-outline font-body",children:"Select multiple profiles to merge"})]}),(0,r.jsx)("div",{className:"divide-y divide-slate-50",children:h.map(e=>(0,r.jsxs)("div",{className:"flex items-center hover:bg-surface-container-low/50 transition-colors ".concat(P.has(e.id)?"bg-primary/5 ring-1 ring-primary/20":""),children:[(0,r.jsx)("button",{onClick:()=>{var t;return t=e.id,void R(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},role:"checkbox","aria-checked":P.has(e.id),"aria-label":"".concat(P.has(e.id)?"Deselect":"Select"," ").concat(e.name," for merge"),className:"px-3 py-4 flex items-center justify-center shrink-0",children:(0,r.jsx)("div",{className:"w-5 h-5 rounded border-2 flex items-center justify-center transition-colors ".concat(P.has(e.id)?"bg-primary border-primary":"border-slate-300"),children:P.has(e.id)&&(0,r.jsx)("span",{className:"material-symbols-outlined text-white",style:{fontSize:14},children:"check"})})}),(0,r.jsxs)(d(),{href:"/rankings/profile/".concat(e.id,"?back=").concat(encodeURIComponent("/search?q=".concat(x))),className:"flex-1 px-2 py-4 flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"w-10 h-10 rounded-lg bg-surface-container-low flex items-center justify-center",children:(0,r.jsx)("span",{className:"material-symbols-outlined text-outline",style:{fontSize:20},children:"person"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"font-headline font-bold text-sm text-on-surface block",children:e.name}),(0,r.jsxs)("span",{className:"text-[10px] text-outline font-body",children:[e.club||"No club",e.gender?" • ".concat("MA
1LE"===e.gender?"Male":"Female"):""]}),(null==E?void 0:E.id)===e.id&&(0,r.jsx)("span",{className:"text-[9px] font-semibold font-body block mt-0.5 ".concat("success"===E.type?"text-green-600":"text-red-600"),children:E.text})]})]}),(0,r.jsxs)("div",{className:"text-right flex items-center gap-3",children:[e.rankingsDetail&&(0,r.jsxs)("div",{className:"hidden sm:block",children:[(0,r.jsxs)("span",{className:"text-xs font-semibold text-on-surface font-body block",children:[e.rankingsDetail.totalRaces," races"]}),(0,r.jsxs)("span",{className:"text-[10px] text-outline font-body",children:[Number(e.rankingsDetail.totalDistanceKm||0).toFixed(0)," km"]})]}),(0,r.jsx)("span",{className:"material-symbols-outlined text-outline",style:{fontSize:18},children:"chevron_right"})]})]}),(null==c?void 0:c.role)==="ADMIN"&&(0,r.jsxs)(d(),{href:"/admin/profiles/".concat(e.id),onClick:e=>e.stopPropagation(),className:"mr-2 shrink-0 flex items-center gap-1 px-2.5 py-1.5 text-[9px] font-bold uppercase tracking-wider rounded-lg bg-slate-100 text-slate-700 hover:bg-slate-200 transition-colors font-body",children:[(0,r.jsx)("span",{className:"material-symbols-outlined",style:{fontSize:11},children:"settings"}),"Manage"]}),null===e.userId&&!_.has(e.id)&&(0,r.jsx)("button",{onClick:t=>{t.stopPropagation(),T(e.id)},disabled:F===e.id,className:"mr-3 shrink-0 px-3 py-1.5 text-[9px] font-bold uppercase tracking-wider rounded-lg bg-primary text-on-primary hover:bg-primary-container transition-colors font-body disabled:opacity-50",children:F===e.id?"...":"Claim"}),(null!==e.userId||_.has(e.id))&&_.has(e.id)&&(0,r.jsx)("span",{className:"mr-3 shrink-0 px-3 py-1.5 text-[9px] font-bold uppercase tracking-wider rounded-lg bg-green-50 text-green-700 font-body",children:"Claimed ✓"})]},e.id))}),w>h.length&&(0,r.jsx)("div",{className:"px-5 py-3 border-t border-slate-100 flex items-center justify-center",children:(0,r.jsx)("button",{onClick:L,disabled:y,className:"px-4 py-2 text-[10px] font-bold uppercase tracking-wider rounded-lg bg-primary/10 text-primary hover:bg-primary/15 transition-colors font-body disabled:opacity-50",children:y?"Loading…":"Show more (".concat(w-h.length," remaining)")})})]}),!v&&!b&&(0,r.jsxs)("div",{className:"text-center py-16",children:[(0,r.jsx)("span",{className:"material-symbols-outlined text-outline mb-2",style:{fontSize:48},children:"person_search"}),(0,r.jsx)("p",{className:"text-sm text-secondary font-body",children:"Search for any runner by name"}),(0,r.jsx)("p",{className:"text-xs text-outline font-body mt-1",children:"Find profiles, compare runners, and view race histories"})]})]})}},4577:(e,t,s)=>{"use strict";s.d(t,{BrandProvider:()=>i,P:()=>o});var r=s(4568),a=s(7620),n=s(6383);let l=(0,a.createContext)(n.Cy);function i(e){let{brand:t,children:s}=e;return(0,r.jsx)(l.Provider,{value:t,children:s})}function o(){return(0,a.useContext)(l)}},4751:(e,t,s)=>{Promise.resolve().then(s.bind(s,2215))},7541:(e,t,s)=>{"use strict";var r=s(3041);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})}},e=>{e.O(0,[5385,4188,9664,1674,587,18,7358],()=>e(e.s=4751)),_N_E=e.O()}]);

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.