PageSourceSearch

https://tugr.org/static/js/492.62062b6f.chunk.js

js tugr.org collected 2026-10-08 21:41:55 UTC 31,039 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkion_golf_ranking=globalThis.webpackChunkion_golf_ranking||[]).push([[492,658],{2658(e,t,r){r.r(t),r.d(t,{default:()=>f});r(9950);var n=r(5840),l=r(4279),i=r(1644),o=r(3685),s=r(4414);function a(e){var t,r,a;let{t:d,lines:c,inputStyle:u={}}=e;return(0,s.jsxs)(n.uz,{lines:c,style:u,children:[(0,s.jsxs)(n.he,{class:"ion-text-wrap",style:{marginRight:2},children:[(0,s.jsx)("p",{style:{fontSize:12,marginTop:0,color:"grey"},children:null===d||void 0===d||null===(t=d.rounds)||void 0===t?void 0:t.map((e,t)=>0===t?d.rounds.length>1?(0,i.iu)(new Date((null===e||void 0===e?void 0:e.round_date)||(null===e||void 0===e?void 0:e.wd_date))):(0,i.c6)(new Date((null===e||void 0===e?void 0:e.round_date)||(null===e||void 0===e?void 0:e.wd_date))):t===d.rounds.length-1?" - "+(0,i.c6)(new Date((null===e||void 0===e?void 0:e.round_date)||(null===e||void 0===e?void 0:e.wd_date))):null)}),(0,s.jsx)("div",{children:null===d||void 0===d||null===(r=d.rounds)||void 0===r?void 0:r.map((e,t)=>{var r;return 0===t?(0,s.jsx)("div",{style:{display:"inline-block",fontSize:12,marginTop:0,paddingLeft:8,paddingRight:8,color:"white",backgroundColor:(0,i.LH)(null===e||void 0===e?void 0:e.tour),borderRadius:14},children:null===e||void 0===e||null===(r=e.tour)||void 0===r?void 0:r.toUpperCase()},t):null})})]}),(0,s.jsx)(n.he,{slot:"end",style:{marginRight:2,marginLeft:6},children:(0,s.jsxs)(o.A,{children:[(0,s.jsx)("span",{style:{minWidth:50,display:"block"}}),(0,s.jsx)("span",{style:{marginBottom:6,fontSize:24,color:(null===d||void 0===d?void 0:d.tournamentScore)<0?"red":0===(null===d||void 0===d?void 0:d.tournamentScore)?"green":"black",display:"block"},children:null!==d&&void 0!==d&&d.withdrawal?(0,s.jsx)("span",{style:{color:l.T.red},children:"WD"}):(0,s.jsxs)(s.Fragment,{children:[(null===d||void 0===d?void 0:d.tournamentScore)>0?"+":"",0===(null===d||void 0===d?void 0:d.tournamentScore)?"E":null===d||void 0===d?void 0:d.tournamentScore]})}),(0,s.jsx)("span",{style:{display:"block",fontSize:14},children:null===d||void 0===d||null===(a=d.rounds)||void 0===a?void 0:a.map((e,t)=>(t>0?"-":"")+(e.st18||(e.withdrawal?"WD":"")))})]})})]})}var d=r(8392);let c={height:20,width:20,justifyContent:"center",alignItems:"center",display:"flex",borderRadius:4},u={backgroundColor:l.T.blue50},h={backgroundColor:l.T.green25},x={backgroundColor:l.T.red25},p={backgroundColor:l.T.orange75};function m(e){let{score:t,par:r,name:n}=e,l={},i=t-r;return"sf9"===n||"sb9"===n||"st18"===n?l={fontWeight:"600"}:i<-1?l={...c,...u}:-1===i?l={...c,...h}:1===i?l={...c,...x}:i>1&&(l={...c,...p}),(0,s.jsx)("div",{style:l,children:t})}const v={display:"flex",alignItems:"center",marginRight:"10px"},g={width:12,height:12,borderRadius:4,marginRight:"5px"};function j(){let e=[{label:"Eagle or less",color:l.T.blue50},{label:"Birdie",color:l.T.green25},{label:"Bogey",color:l.T.red25},{label:"Double or more",color:l.T.orange75}];return(0,s.jsx)("div",{style:{marginTop:"10px",display:"flex",flexWrap:"wrap",marginLeft:4},children:e.map(e=>0===e.value?null:(0,s.jsxs)("div",{style:v,children:[(0,s.jsx)("div",{style:{...g,backgroundColor:e.color}}),(0,s.jsx)("span",{style:{fontSize:11,color:"grey"},children:e.label.toUpperCase()})]},`${e.label}-legend`))})}const f=e=>{var t,r,c;let{tournament:u,player:h,showProfileLink:x,navigateToLink:p,showNavigateToTournament:v,navigateToTournament:g}=e;console.log(u);const f=[1,2,3,4,5,6,7,8,9,"F9",10,11,12,13,14,15,16,17,18,"B9","TOT"],y=[1,2,3,4,5,6,7,8,9,"f9",10,11,12,13,14,15,16,17,18,"b9","t18"],b={overflowX:"auto",whiteSpace:"nowrap"},w={flexWrap:"nowrap"},_={flexWrap:"nowrap",fontWeight:"600"},N={flexWrap:"nowrap"},S={width:"auto",flex:"0 0 auto",display:"flex",justifyContent:"center",alignItems:"center",height:30,fontSize:12};if(!u)return null;let C=!1;return null===u||void 0===u||null===(t=u.rounds)||void 0===t||t.forEach((e,t)=>{var r;0===t&&("AJGA"===(null===e||void 0===e||null===(r=e.tour)||void 0===r?void 0:r.toUpperCase())&&(C=!0))}),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("br",{}),(0,s.jsx)("h3",{style:{margin:4,textAlign:"center"},children:null===u||void 0===u||null===(r=u.name)||void 0===r?void 0:r.toUpperCase()}),(0,s.jsxs)("h5",{style:{margin:4,color:l.T.green,textAlign:"center"},children:[null===h||void 0===h?void 0:h.first_name," ",null===h||void 0===h?void 0:h.last_name]}),x&&(0,s.jsx)("div",{style:{textAlign:"center",marginBottom:"10px"},children:(0,s.jsx)(n.Jm,{fill:"outline",color:"primary",onClick:()=>{p(h.player_id)},children:"View Full Profile"})}),(0,s.jsx)(a,{t:u,lines:"none",inputStyle:{marginRight:10}}),v&&(0,s.jsx)("div",{style:{textAlign:"center",marginBottom:10},children:(0,s.jsx)(n.Jm,{onClick:()=>g(u),children:"View Tournament"})}),C&&(0,s.jsx)("div",{style:{backgroundColor:l.T.green05,margin:20,borderRadius:12,border:`1px solid ${l.T.green25}
1`,boxShadow:"0 2px 8px rgba(18, 120, 75, 0.1)"},children:(0,s.jsx)(o.A,{children:(0,s.jsxs)("div",{style:{margin:24,textAlign:"center",maxWidth:400},children:[(0,s.jsx)(n.iq,{icon:d.Yv$,style:{fontSize:48,marginBottom:16,color:l.T.green}}),(0,s.jsx)("h3",{style:{fontSize:18,fontWeight:600,color:l.T.green,margin:"0 0 8px 0",lineHeight:1.3},children:"AJGA Tournament"}),(0,s.jsx)("p",{style:{fontSize:14,color:"#666",margin:0,lineHeight:1.4},children:"Hole-by-hole scoring is not available for AJGA tournaments. Only round totals are provided."})]})})}),!C&&(null===u||void 0===u||null===(c=u.rounds)||void 0===c?void 0:c.map((e,t)=>e.withdrawal?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("br",{}),(0,s.jsxs)("h6",{children:["Round ",t+1]}),(0,s.jsx)("div",{style:{backgroundColor:l.T.grey25,margin:20,borderRadius:10},children:(0,s.jsx)(o.A,{children:(0,s.jsx)("div",{style:{margin:20,fontSize:20,color:"grey"},children:(0,s.jsx)("h2",{children:"WD"})})})})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("br",{}),(0,s.jsxs)("div",{style:{marginLeft:4},children:[(0,s.jsxs)("h6",{children:["Round ",null===e||void 0===e?void 0:e.round]}),(0,s.jsx)("p",{style:{marginTop:-10,fontSize:11,color:"grey",marginLeft:1},children:(0,i.c6)(new Date(null===e||void 0===e?void 0:e.round_date))})]}),(0,s.jsxs)(n.lO,{style:b,children:[(0,s.jsxs)(n.ln,{style:_,children:[(0,s.jsx)(n.hU,{style:{...S,aspectRatio:"1 / 1",width:55,borderBottom:"2px solid #d6d6d6",borderTop:"2px solid #d6d6d6",borderRight:"1px solid #d6d6d6",justifyContent:"left"},children:"HOLE"},"hole"),f.map((e,t)=>(0,s.jsx)(n.hU,{style:{...S,aspectRatio:"1 / 1",borderBottom:"2px solid #d6d6d6",borderTop:"2px solid #d6d6d6"},children:e},t))]}),(0,s.jsxs)(n.ln,{style:w,children:[(0,s.jsx)(n.hU,{style:{...S,aspectRatio:"1 / 1",width:55,borderRight:"1px solid #d6d6d6",justifyContent:"left"},children:"Par"},"par"),y.map((t,r)=>(0,s.jsx)(n.hU,{style:{...S,aspectRatio:"1 / 1"},children:e[`p${t}`]||""},r))]}),(0,s.jsxs)(n.ln,{style:N,children:[(0,s.jsx)(n.hU,{style:{...S,aspectRatio:"1 / 1",width:55,borderRight:"1px solid #d6d6d6",borderBottom:"1px solid #d6d6d6",justifyContent:"left",backgroundColor:l.T.grey25},children:"Score"},"score"),y.map((t,r)=>(0,s.jsx)(n.hU,{style:{...S,aspectRatio:"1 / 1",borderBottom:"1px solid #d6d6d6",backgroundColor:l.T.grey25},children:(0,s.jsx)(m,{score:e[`s${t}`]||"",par:e[`p${t}`],name:`s${t}`})},r))]})]}),(0,s.jsx)(j,{})]},(null===e||void 0===e?void 0:e.round)+"-round"))),(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),(0,s.jsx)("br",{})]})}},4492(e,t,r){r.d(t,{A:()=>w});var n=r(9950),l=r(5840),i=r(8392),o=r(6673),s=r(5374),a=r(6266),d=r(2658),c=r(9246),u=r(4619),h=r(4414);const x=e=>{let{isOpen:t,setIsOpen:r,tournament:i,playerId:o,category:s,navigateToLink:x}=e;
1const[p,m]=(0,n.useState)(null),[v,g]=(0,n.useState)(null),[j,f]=(0,n.useState)(!0),[y,b]=(0,n.useState)(null),[w,_]=(0,n.useState)(window.innerWidth);(0,n.useEffect)(()=>{const e=()=>_(window.innerWidth);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const N=w<=768?{"--width":"100%","--height":"100%","--border-radius":"0px"}:{"--width":"90%","--height":"90%","--max-width":"1200px","--border-radius":"10px"};function S(){r(!1),m(null),b(null)}(0,n.useEffect)(()=>{t&&(async()=>{if(o&&s)try{f(!0);const[e,t]=await Promise.all([c.A.get("/plus2/player",{params:{player_id:o,category:s}}),c.A.post("/plus-tournaments/player/scores",{tournamentId:i.link,player_id:o,category:s})]);if(!e.data)throw new Error("Failed to fetch player details");if(!t.data)throw new Error("Failed to fetch tournament scores");const r=e.data,n=t.data;m(r.player),g(n),b(null)}catch(e){console.error("Error fetching player data:",e),b(e.message)}finally{f(!1)}})()},[t,o,s,null===i||void 0===i?void 0:i._id,null===i||void 0===i?void 0:i.link]);const C=(()=>{if(null===i||void 0===i||!i.tournament_results||!o)return null;const e=i.tournament_results[o];if(null===e||void 0===e||!e.round_sequence)return null;const t=e.round_sequence.filter(e=>null!==e&&void 0!==e&&!isNaN(e));return 0===t.length?null:{series:[{name:`${(null===p||void 0===p?void 0:p.first_name)||""} ${(null===p||void 0===p?void 0:p.last_name)||""}`,data:t}],categories:t.map((e,t)=>`${t+1}`)}})(),T={chart:{type:"line",height:350,toolbar:{show:!1}},stroke:{width:3,curve:"smooth"},markers:{size:6},xaxis:{categories:(null===C||void 0===C?void 0:C.categories)||[],title:{text:"Tournament Hole"}},yaxis:{title:{text:"Score Relative to Par"},reversed:!0,labels:{formatter:function(e){return 0===e?"E":e>0?`+${e}`:e}}},title:{text:"Score Progression",align:"center",style:{fontSize:"16px",fontWeight:600}},colors:["#3B82F6"],tooltip:{y:{formatter:function(e){return 0===e?"Even":e>0?`+${e}`:e}}}};return(0,h.jsxs)(l.Sb,{isOpen:t,onDidDismiss:S,presentingElement:void 0,style:N,children:[(0,h.jsx)(l.eU,{children:(0,h.jsxs)(l.ai,{children:[(0,h.jsx)(l.BC,{children:"Player Details"}),(0,h.jsx)(l.QW,{slot:"end",children:(0,h.jsx)(l.Jm,{onClick:S,children:"Close"})})]})}),(0,h.jsx)(l.W9,{children:(0,h.jsx)(a.A,{children:(()=>{if(j)return(0,h.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"20px"},children:(0,h.jsx)(l.w2,{})});if(y)return(0,h.jsx)(l.b_,{children:(0,h.jsx)(l.I9,{children:(0,h.jsxs)("div",{style:{textAlign:"center",color:"var(--ion-color-danger)"},children:["Error loading player data: ",y]})})});let e=p,t=!0;if(console.log(e),!e){const[r=""]=(o||"").split(" : "),n=r.split(" "),l=(n[0]||"").charAt(0).toUpperCase()+(n[0]||"").slice(1),i=n.slice(1).join(" ").replace(/\(\d{4}\)/,"").trim()||"";e={first_name:l,last_name:i.charAt(0).toUpperCase()+i.slice(1),player_id:o,category:s},t=!1}return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(d.default,{tournament:v,player:e,showProfileLink:t,navigateToLink:x}),C&&(0,h.jsx)("div",{style:{marginTop:"20px"},children:(0,h.jsx)(u.A,{options:T,series:C.series,type:"line",height:380})})]})})()})})]})};var p=r(6506),m=r(1644);const v={900:"WD",901:"DQ",902:"NS"},g=e=>{var t,r;let{tournament:n,onPlayerClick:i,formatLocation:o,capitalizeFirst:s,formatPlayerName:a,formatPlayerLocation:d,formatScoreRelativeToPar:c}=e;if(!n.tournament_results)return null;if(null===(t=n.round_data)||void 0===t||!t.round1)return null;const u=Object.entries(n.tournament_results).map(e=>{var t;let[r,n]=e;const[l,i]=r.split(" : ");return{playerId:r,name:a(l),location:d(null===i||void 0===i?void 0:i.split(";")[0]),gradYear:null===(t=r.match(/\((\d{4})\)/))||void 0===t?void 0:t[1],...n}}).sort((e,t)=>e.place-t.place);return(0,h.jsxs)(p.k,{componentName:"JuniorTournaments",children:[(0,h.jsx)("div",{className:"course-info-section",children:(0,h.jsx)("div",{className:"course-cards",children:(0,h.jsxs)(l.I9,{children:[(0,h.jsx)("h2",{children:null===n||void 0===n||null===(r=n.tournament_name)||void 0===r?void 0:r.toUpperCase()}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Date:"}),(0,h.jsx)("span",{className:"value",children:(0,m.z$)(n.start_date,!0)})]}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Location:"}),(0,h.jsx)("span",{className:"value",children:o(n.location)})]}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Tour:"}),(0,h.jsx)("span",{className:"value",children:s(n.tour_name)})]})]})})}),(0,h.jsxs)("div",{className:"leaderboard-section",children:[(0,h.jsx)("h2",{children:"Leaderboard"}),(0,h.jsx)("div",{className:"leaderboard-table",children:(0,h.jsxs)("table",{children:[(0,h.jsx)("thead",{children:(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:"Pos"}),(0,h.jsx)("th",{children:"Player"}),(0,h.jsx)("th",{children:"Hometown"}),(0,h.jsx)("th",{children:"Class"}),(0,h.jsx)("th",{children:"Score"}),(0,h.jsx)("th",{children:"Total"})]})}),(0,h.jsx)("tbody",{children:u.map(e=>{return(0,h.jsxs)("tr",{onClick:()=>i(e.playerId),style:{cursor:"pointer"},className:"player-row",children:[(0,h.jsx)("td",{children:(t=e.place,v[t]||t)}),(0,h.jsx)("td",{className:"player-name",children:e.name}),(0,h.jsx)("td",{children:e.location}),(0,h.jsx)("td",{children:e.gradYear||"-"}),(0,h.jsx)("td",{children:e.results_string}),(0,h.jsx)("td",{children:c(e.total_rel_par)})]},e.name);var t})})]})})]})]})},j=e=>{var t,r,n,i;let{tournament:o,formatLocation:s,capitalizeFirst:a,capitalizeWords:d}=e;if(null===(t=o.round_data)||void 0===t||!t.round1)return null;
1const c=o.round_data.round1[Object.keys(o.round_data.round1)[0]];return console.log(c),console.log(o),(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("h2",{children:"Information"}),(0,h.jsxs)("div",{className:"course-info-section",children:[(0,h.jsx)("div",{className:"course-cards",children:(0,h.jsx)(l.b_,{children:(0,h.jsxs)(l.I9,{children:[(0,h.jsx)("h3",{children:"Tournament Information"}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Date:"}),(0,h.jsx)("span",{className:"value",children:(0,m.z$)(null===o||void 0===o?void 0:o.start_date)})]}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Location:"}),(0,h.jsx)("span",{className:"value",children:s(null===o||void 0===o?void 0:o.location)})]}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Tour:"}),(0,h.jsx)("span",{className:"value",children:a(null===o||void 0===o?void 0:o.tour_name)})]})]})})}),(0,h.jsxs)("div",{className:"course-cards",children:[(0,h.jsx)(l.b_,{children:(0,h.jsxs)(l.I9,{children:[(0,h.jsx)("h3",{children:"Course Details"}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Course:"}),(0,h.jsx)("span",{className:"value",children:a(null===(r=o.course)||void 0===r?void 0:r.course1)})]}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Total Yardage:"}),(0,h.jsxs)("span",{className:"value",children:[null===c||void 0===c||null===(n=c.hole_yardages)||void 0===n?void 0:n.yt18," yards"]})]}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Par:"}),(0,h.jsx)("span",{className:"value",children:null===c||void 0===c||null===(i=c.hole_pars)||void 0===i?void 0:i.pt18})]})]})}),(0,h.jsx)(l.b_,{children:(0,h.jsxs)(l.I9,{children:[(0,h.jsx)("h3",{children:"Weather Conditions"}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Temperature:"}),(0,h.jsxs)("span",{className:"value",children:[Math.round(null===c||void 0===c?void 0:c.avg_temp),"\xb0F"]})]}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Wind:"}),(0,h.jsxs)("span",{className:"value",children:[null===c||void 0===c?void 0:c.wind," mph"]})]}),(0,h.jsxs)("div",{className:"info-row",children:[(0,h.jsx)("span",{className:"label",children:"Conditions:"}),(0,h.jsx)("span",{className:"value",children:d(null===c||void 0===c?void 0:c.conditions)})]})]})})]})]})]})},f=e=>{let{tournament:t,capitalizeFirst:r}=e;if(!t.all_rounds_data)return null;const{seriesData:n,categories:i}=(()=>{if(!t.tournament_results)return null;const e={};Object.entries(t.tournament_results).forEach(t=>{let[r,n]=t;const l=n.total_rel_par,i=r.split(" : ")[0];e[l]||(e[l]=[]),e[l].push(i)});const r=Object.values(t.tournament_results).map(e=>e.total_rel_par).sort((e,t)=>e-t),n=r.reduce((e,t)=>(e[t]=(e[t]||0)+1,e),{}),l=Math.min(...r),i=Math.max(...r),o=[],s=[];for(let t=l;t<=i;t++)s.push(t),o.push({y:n[t]||0,players:e[t]||[]});return{seriesData:o,categories:s}})()||{seriesData:[],categories:[]},o={chart:{type:"bar",height:350,toolbar:{show:!1}},annotations:{xaxis:[{x:0,borderColor:"#bbb",borderWidth:2,strokeDashArray:0,zIndex:0,opacity:.3,label:{text:"Even Par",position:"top",offsetY:-10,style:{background:"#fff",color:"#555",fontSize:"12px",fontWeight:400}}}]},plotOptions:{bar:{borderRadius:4,columnWidth:"60%",distributed:!0}},colors:["#1b6dff"],dataLabels:{enabled:!1},legend:{show:!1},xaxis:{categories:i,title:{text:"Score Relative to Par"},labels:{formatter:function(e){const t=e=>e>0?`+${e}`:e;return i.length>50?e%10===0?t(e):"":i.length>20?e%5===0?t(e):"":i.length>10?e%2===0?t(e):"":t(e)}}},yaxis:{title:{text:"Number of Players"},labels:{formatter:function(e){return Math.round(e)}},min:0,forceNiceScale:!0},title:{text:"Scoring Distribution",style:{fontSize:"16px",fontWeight:600}},tooltip:{enabled:!0,custom:function(e){let{dataPointIndex:t}=e;const l=i[t],o=n[t].players;return o&&0!==o.length?`\n                    <div style="padding: 8px; background: white; border-radius: 4px;">\n                        <div style="font-weight: 600; margin-bottom: 8px; color: #333;">\n                            Score: ${l}\n                        </div>\n                        <div style="color: #666;">\n                            ${o.map(e=>`<div style="padding: 2px 0;">${r(e)}</div>`).join("")}\n                        </div>\n                    </div>\n                `:""},followCursor:!0,intersect:!0,shared:!1}},{series:s,labels:a}=(()=>
1{if(!t.tournament_results)return{series:[],labels:[]};const e={};Object.keys(t.tournament_results).forEach(t=>{const r=t.match(/\((\d{4})\)/);if(r){const t=r[1];e[t]=(e[t]||0)+1}});const r=Object.keys(e).sort();return{series:r.map(t=>e[t]),labels:r.map(e=>`Class of ${e}`)}})(),d={chart:{type:"donut"},labels:a,plotOptions:{pie:{donut:{size:"65%"}}},legend:{position:"bottom",horizontalAlign:"center"},title:{text:"Graduation Year Distribution",style:{fontSize:"16px",fontWeight:600}},colors:["#36D399","#3B82F6","#F87272","#FBBD23","#6B7280","#8B5CF6"],dataLabels:{enabled:!0,formatter:function(e,t){return t.w.config.series[t.seriesIndex]}},tooltip:{y:{formatter:function(e){return`${e} players`}}}},c=(()=>{if(!t.tournament_results)return null;const e=Object.entries(t.tournament_results).map(e=>{let[t,n]=e;const[l]=t.split(" : ");return{name:r(l),scores:n.round_sequence||[]}}).filter(e=>e.scores.length>0&&e.scores.every(e=>null!==e&&!isNaN(e)&&void 0!==e)).sort((e,t)=>e.scores[e.scores.length-1]-t.scores[t.scores.length-1]).slice(0,10);if(0===e.length)return null;const n=Math.max(...e.map(e=>e.scores.length)),l=Array.from({length:n},(e,t)=>`${t+1}`);return{series:e.map(e=>({name:e.name,data:e.scores})),categories:l}})(),x={chart:{type:"line",height:400,toolbar:{show:!1}},stroke:{width:2,curve:"smooth"},xaxis:{categories:(null===c||void 0===c?void 0:c.categories)||[],title:{text:"Tournament Hole"},labels:{formatter:function(e){const t=e=>e>0?`+${e}`:e;return i.length>50?e%10===0?t(e):"":i.length>20?e%5===0?t(e):"":i.length>10?e%2===0?t(e):"":t(e)},rotateAlways:!1,hideOverlappingLabels:!0,maxHeight:100,tickAmount:10},tickPlacement:"on"},yaxis:{title:{text:"Score Relative to Par"},reversed:!0,labels:{formatter:function(e){return e>0?`+${e}`:e}}},title:{text:"Score Progression (Top 10 Players)",style:{fontSize:"16px",fontWeight:600}},legend:{position:"bottom",horizontalAlign:"center"},markers:{size:3},tooltip:{shared:!0,intersect:!1,y:{formatter:function(e){return 0===e?"Even":e>0?`+${e}`:e}}}},m=e=>{let{courseData:t}=e;const r=Array.from({length:9},(e,t)=>t+1),n=Array.from({length:9},(e,t)=>t+10),l=()=>{var e,r,n,l;return{par:(null===t||void 0===t||null===(e=t.hole_pars)||void 0===e?void 0:e.pf9)||"",yards:(null===t||void 0===t||null===(r=t.hole_yardages)||void 0===r?void 0:r.yf9)||"",avgScore:(null===t||void 0===t||null===(n=t.avg_score_by_hole)||void 0===n||null===(l=n.sf9)||void 0===l?void 0:l.toFixed(1))||""}},i=()=>{var e,r,n,l;return{par:(null===t||void 0===t||null===(e=t.hole_pars)||void 0===e?void 0:e.pb9)||"",yards:(null===t||void 0===t||null===(r=t.hole_yardages)||void 0===r?void 0:r.yb9)||"",avgScore:(null===t||void 0===t||null===(n=t.avg_score_by_hole)||void 0===n||null===(l=n.sb9)||void 0===l?void 0:l.toFixed(1))||""}},o=()=>{var e,r,n,l;return{par:(null===t||void 0===t||null===(e=t.hole_pars)||void 0===e?void 0:e.pt18)||"",yards:(null===t||void 0===t||null===(r=t.hole_yardages)||void 0===r?void 0:r.yt18)||"",avgScore:(null===t||void 0===t||null===(n=t.avg_score_by_hole)||void 0===n||null===(l=n.st18)||void 0===l?void 0:l.toFixed(1))||""}};return(0,h.jsx)("div",{className:"scorecard-section",children:(0,h.jsx)("div",{style:{overflowX:"auto"},children:(0,h.jsxs)("table",{style:v.scorecard,children:[(0,h.jsx)("thead",{children:(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{children:"Hole"}),r.map(e=>(0,h.jsx)("th",{children:e},e)),(0,h.jsx)("th",{children:"OUT"}),n.map(e=>(0,h.jsx)("th",{children:e},e)),(0,h.jsx)("th",{children:"IN"}),(0,h.jsx)("th",{children:"TOT"})]})}),(0,h.jsxs)("tbody",{children:[(0,h.jsxs)("tr",{children:[(0,h.jsx)("td",{children:"Par"}),r.map(e=>{var r;return(0,h.jsx)("td",{children:null===t||void 0===t||null===(r=t.hole_pars)||void 0===r?void 0:r[`p${e}`]},e)}),(0,h.jsx)("td",{children:l().par}),n.map(e=>{var r;return(0,h.jsx)("td",{children:null===t||void 0===t||null===(r=t.hole_pars)||void 0===r?void 0:r[`p${e}`]},e)}),(0,h.jsx)("td",{children:i().par}),(0,h.jsx)("td",{children:o().par})]}),(0,h.jsxs)("tr",{children:[(0,h.jsx)("td",{children:"Yards"}),r.map(e=>{var r;return(0,h.jsx)("td",{children:null===t||void 0===t||null===(r=t.hole_yardages)||void 0===r?void 0:r[`y${e}`]},e)}),(0,h.jsx)("td",{children:l().yards}),n.map(e=>{var r;return(0,h.jsx)("td",{children:null===t||void 0===t||null===(r=t.hole_yardages)||void 0===r?void 0:r[`y${e}`]},e)}),(0,h.jsx)("td",{children:i().yards}),(0,h.jsx)("td",{children:o().yards})]}),(0,h.jsxs)("tr",{children:[(0,h.jsx)("td",{children:"Avg"}),r.map(e=>{var r,n;return(0,h.jsx)("td",{children:null===t||void 0===t||null===(r=t.avg_score_by_hole)||void 0===r||null===(n=r[`s${e}`])||void 0===n?void 0:n.toFixed(1)},e)}),(0,h.jsx)("td",{children:l().avgScore}),n.map(e=>{var r,n;return(0,h.jsx)("td",{children:null===t||void 0===t||null===(r=t.avg_score_by_hole)||void 0===r||null===(n=r[`s${e}`])||void 0===n?void 0:n.toFixed(1)},e)}),(0,h.jsx)("td",{children:i().avgScore}),(0,h.jsx)("td",{children:o().avgScore})]})]})]})})})},v={scorecard:{width:"100%",borderCollapse:"collapse",fontSize:"14px",textAlign:"center"}};return(0,h.jsx)(p.k,{componentName:"JuniorTournamentStatsTab",children:(0,h.jsxs)("div",{children:[(0,h.jsx)("h2",{children:"Tourn
1ament Stats"}),Object.entries(t.all_rounds_data).map(e=>{let[t,r]=e;const i=Array.from({length:18},(e,t)=>t+1),s=i.map(e=>{const t=r.avg_score_by_hole[`s${e}`],n=r.hole_pars[`p${e}`];return Number((t-n).toFixed(2))}),a={chart:{type:"bar",height:350,toolbar:{show:!1},annotations:{yaxis:[{y:0,strokeDashArray:0,borderColor:"#666",borderWidth:1,opacity:.3}]}},plotOptions:{bar:{borderRadius:4,colors:{ranges:[{from:-10,to:0,color:"#36D399"},{from:.01,to:10,color:"#F87272"}]},columnWidth:"60%"},annotations:{yaxis:[{y:0,strokeDashArray:0,borderColor:"#666",borderWidth:1,opacity:.3}]}},dataLabels:{enabled:!0,formatter:function(e){const t=Number(e.toFixed(2));return t>0?`+${t}`:t},style:{fontSize:"10px",fontWeight:600,colors:["#333"]},offsetY:-4},xaxis:{categories:i.map(e=>`${e}`),title:{text:"Holes"}},yaxis:{title:{text:"Strokes Relative to Par"},reversed:!0,labels:{formatter:function(e){return e>0?`+${null===e||void 0===e?void 0:e.toFixed(2)}`:null===e||void 0===e?void 0:e.toFixed(2)}},tickAmount:8},title:{text:"Average Scores Relative to Par",style:{fontSize:"16px",fontWeight:600}}};return(0,h.jsxs)("div",{children:[(0,h.jsx)(m,{courseData:r}),(0,h.jsx)("div",{className:"scoring-graph-section",children:(0,h.jsx)(l.b_,{style:{marginLeft:-10,marginRight:-10},children:(0,h.jsx)(l.I9,{children:(0,h.jsx)(u.A,{options:a,series:[{name:"Strokes Relative to Par",data:s}],type:"bar",height:350})})})}),(0,h.jsx)("div",{className:"scoring-graph-section",children:(0,h.jsx)(l.b_,{style:{marginLeft:-10,marginRight:-10},children:(0,h.jsx)(l.I9,{children:(0,h.jsx)(u.A,{options:o,series:[{name:"Players",data:n.map(e=>e.y),players:n.map(e=>e.players)}],type:"bar",height:350})})})})]},t)}),(0,h.jsx)("div",{className:"scoring-graph-section",children:(0,h.jsx)(l.b_,{style:{marginLeft:-10,marginRight:-10},children:(0,h.jsx)(l.I9,{children:(0,h.jsx)(u.A,{options:d,series:s,type:"donut",height:350})})})}),c&&(0,h.jsx)("div",{className:"scoring-graph-section",children:(0,h.jsx)(l.b_,{style:{marginLeft:-10,marginRight:-10},children:(0,h.jsx)(l.I9,{children:(0,h.jsx)(u.A,{options:x,series:c.series,type:"line",height:400})})})})]})})};var y=r(8949);r(7043);const b={fixedHeader:{position:"fixed",top:0,left:0,right:0,backgroundColor:"white",zIndex:1e3,borderBottom:"1px solid #e4e4e4"},headerContent:{padding:"12px 20px",display:"flex",alignItems:"center",gap:"12px"},backButton:{margin:0,"--padding-start":"8px","--padding-end":"8px"},title:{margin:0,fontSize:"18px",fontWeight:600,flex:1,whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"}},w=e=>{var t,r;let{match:d,fromJuniorSection:u=!1}=e;const{userData:p}=(0,n.useContext)(y.c),[m,v]=(0,n.useState)(null),[w,_]=(0,n.use
1State)(!0),[N,S]=(0,n.useState)(null),[C,T]=(0,n.useState)(null),[k,A]=(0,n.useState)(!1),[W,z]=(0,n.useState)("Leaderboard"),I=(0,o.zy)(),L=new URLSearchParams(I.search).get("category")||"JUNIOR_BOYS",$=(0,o.W6)(),R=null===d||void 0===d||null===(t=d.params)||void 0===t?void 0:t.id;(0,n.useEffect)(()=>{if(null===p||void 0===p||!p._id)return S("Please log in to view tournament details"),void _(!1);(async()=>{if(!R)return S("Tournament ID is missing"),void _(!1);try{const e=await c.A.get(`/plus-tournaments/${R}`,{params:{category:L}});if(!e.data)throw new Error("No tournament data received");v(e.data),S(null)}catch(N){var e,t;console.error("Error fetching tournament details:",N),S((null===(e=N.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.message)||"Failed to load tournament details")}finally{_(!1)}})()},[R,L,p]);const D=e=>0===e?"E":e>0?`+${e}`:e,F=e=>e?e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "):"",P=e=>["AL","AK","AZ","AR","CA","CO","CT","DE","FL","GA","HI","ID","IL","IN","IA","KS","KY","LA","ME","MD","MA","MI","MN","MS","MO","MT","NE","NV","NH","NJ","NM","NY","NC","ND","OH","OK","OR","PA","RI","SC","SD","TN","TX","UT","VT","VA","WA","WV","WI","WY"].includes(e.toUpperCase()),O=e=>e?e.split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "):"",B=e=>{if(!e)return"TBA";return[...new Set([e.location1,e.location2])].filter(Boolean).map(e=>{if(!e)return"";return e.split(",").map(e=>e.trim()).map(e=>2===e.length&&P(e)?e.toUpperCase():O(e)).join(", ")}).join(", ")},E=e=>{if(!e)return"";return e.split(",").map(e=>e.trim()).map(e=>2===e.length&&P(e)?e.toUpperCase():O(e)).join(", ")},U=e=>e.split(" ").map(e=>O(e)).join(" "),H=e=>{T(e),A(!0)};return w?(0,h.jsx)("div",{style:{display:"flex",justifyContent:"center",padding:"20px"},children:(0,h.jsx)(l.w2,{})}):N?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{style:{...b.fixedHeader,top:u?50:0},children:(0,h.jsxs)("div",{style:b.headerContent,children:[(0,h.jsxs)(l.Jm,{fill:"clear",onClick:()=>$.push(u?`/junior/tournaments?category=${L}`:`/recruiting/tournaments?category=${L}`),style:b.backButton,children:[(0,h.jsx)(l.iq,{icon:i.fKZ,slot:"start"}),"Back"]}),(0,h.jsx)("h1",{style:b.title,children:"Tournament Details"})]})}),(0,h.jsxs)("div",{style:{padding:"40px 20px",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"16px",maxWidth:"600px",margin:"100px auto"},children:[(0,h.jsx)(l.IO,{color:"dark",style:{fontSize:"16px"},children:(0,h.jsx)("p",{children:N})}),null!==p&&void 0!==p&&p._id?null:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(l.IO,{color:"danger",style:{fontSize:"20px",fontWeight:"500"},children:(0,h.jsx)("p",{children:"You must be logged in to view tournament details"})}),(0,h.jsx)(l.Jm,{fill:"solid",onClick:()=>$.push("/login"),style:{marginTop:"8px"},children:"Go to Login"})]})]})]}):m?(0,h.jsxs)(l.W9,{children:[(0,h.jsxs)("div",{style:{...b.fixedHeader,top:u?50:0},children:[(0,h.jsxs)("div",{style:b.headerContent,children:[(0,h.jsxs)(l.Jm,{fill:"clear",onClick:()=>$.push(u?`/junior/tournaments?category=${L}`:`/recruiting/tournaments?category=${L}`),style:b.backButton,children:[(0,h.jsx)(l.iq,{icon:i.fKZ,slot:"start"}),"Back"]}),(0,h.jsx)("h1",{style:b.title,children:null===m||void 0===m||null===(r=m.tournament_name)||void 0===r?void 0:r.toUpperCase()})]}),(0,h.jsx)(s.A,{buttons:[{name:"Leaderboard"},{name:"Tournament Stats"},{name:"Information"}],tabNameUpdated:z})]}),(0,h.jsx)("div",{style:{height:u?"130px":"80px"}}),(0,h.jsx)(a.A,{maxWidth:1e3,padding:0,children:(()=>{switch(W){case"Leaderboard":return(0,h.jsx)(g,{tournament:m,onPlayerClick:H,formatLocation:B,capitalizeFirst:O,capitalizeWords:F,formatPlayerName:U,formatPlayerLocation:E,formatScoreRelativeToPar:D});case"Information":return(0,h.jsx)(j,{tournament:m,formatLocation:B,capitalizeFirst:O,capitalizeWords:F});case"Tournament Stats":return(0,h.jsx)(f,{tournament:m,capitalizeWords:F,capitalizeFirst:O});default:return(0,h.jsx)("div",{children:W})}})()}),(0,h.jsx)(x,{isOpen:k,setIsOpen:A,tournament:m,playerId:C,category:L,navigateToLink:e=>{A(!1),setTimeout(()=>{$.push(`/junior/player/${e}||${L}`)},100)}})]}):(0,h.jsx)("div",{style:{padding:"20px",textAlign:"center"},children:(0,h.jsx)(l.IO,{children:(0,h.jsx)("p",{children:"Tourn
1ament not found"})})})}},5374(e,t,r){r.d(t,{A:()=>o});r(9950);var n=r(4414);let l={height:40,backgroundColor:"white",paddingLeft:10,paddingRight:10,justifyContent:"center",alignItems:"center",display:"flex",cursor:"pointer",minWidth:"fit-content"};function i(e){let{name:t,isActive:r,index:i,handleClick:o}=e;return(0,n.jsx)("div",{style:{...l,borderBottom:"3px solid "+(r?"#439683":"transparent")},onClick:()=>{o(i)},children:t})}function o(e){let{buttons:t,tabNameUpdated:r,activeTab:l}=e;const o=l?t.findIndex(e=>e.name===l):0;function s(e){r(t[e].name)}return(0,n.jsx)("div",{style:{overflowX:"auto",backgroundColor:"white",boxShadow:"0px 4px 6px -2px rgba(0, 0, 0, 0.1)"},children:(0,n.jsx)("div",{style:{display:"flex",flexDirection:"row",maxWidth:"100%"},children:null===t||void 0===t?void 0:t.map((e,t)=>(0,n.jsx)(i,{name:e.name,index:t,isActive:t===o,handleClick:s},t))})})}},7043(){}}]);

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.