1import{r as g,j as e,z as G,h as W,B as $,C as R,a as E,H,q as U,t as X}from"./index-BhkFFJhI.js";import{L as S}from"./Layout-DXqOhSQt.js";import{B as Y}from"./badge-DI-dQD01.js";import{S as k}from"./skeleton-D7S9EM-C.js";import{u as q}from"./useFighterByName-CsnzJ9P_.js";import{u as I}from"./useMedianStats-DsBTk5oC.js";import{n as J,p as Q,b as j,a as n,c,f as Z}from"./fighterStatsUtils-BEciEbF1.js";import{G as u}from"./GlassmorphCard-Dglb1Bie.js";import{u as ee}from"./use-mobile-C6ksjOla.js";import{R as M,T as C,B as se,C as O,a as ae}from"./generateCategoricalChart-DEo4uLrN.js";import{R as te,P as re,a as ie}from"./RadarChart-DCGh2jBy.js";import{P as ne,a as le}from"./PolarAngleAxis-B47I6AKF.js";import{S as oe}from"./StrikeTargetBody-swYWJfOE.js";import{B as de}from"./BarChart-COt7u7ER.js";import{X as ce,Y as me}from"./YAxis-BpIqA9-3.js";import{A as V}from"./arrow-left-DhyD0fPT.js";import{P as xe,a as ue}from"./PieChart-DHgI7SxA.js";import"./TopNavBar-CuGBkokk.js";import"./chevron-right-BNEpyvDI.js";import"./check-CUooA387.js";import"./circle-Bekv0DPV.js";import"./bell-BT-2nqs-.js";import"./crown-BWx0pjvb.js";import"./collapsible-BMc50eBD.js";import"./index-KDj8zMxG.js";import"./search-eXG_0Rby.js";import"./sheet-C_sPcSyP.js";import"./useSoccerOdds-DS4kKLgl.js";import"./clock-Di6ZRoGg.js";import"./trending-up-DBUhjzY6.js";import"./chevron-down-BB8etlAy.js";import"./user-Cuh4PDyl.js";function _({data:m,fillColor:h="hsl(var(--primary))",strokeColor:f="hsl(var(--primary))",fillOpacity:l=.3}){const x=g.useMemo(()=>m,[m]),d=ee();return e.jsx(M,{width:"100%",height:d?260:300,children:e.jsxs(te,{data:x,margin:d?{top:20,right:20,bottom:20,left:20}:{top:30,right:30,bottom:30,left:30},children:[e.jsx("defs",{children:e.jsxs("filter",{id:"glow",children:[e.jsx("feGaussianBlur",{stdDeviation:"2",result:"coloredBlur"}),e.jsxs("feMerge",{children:[e.jsx("feMergeNode",{in:"coloredBlur"}),e.jsx("feMergeNode",{in:"SourceGraphic"})]})]})}),e.jsx(re,{stroke:"hsl(var(--muted-foreground))",strokeOpacity:.3}),e.jsx(ne,{dataKey:"metric",tick:{fill:"hsl(var(--foreground))",fontSize:d?10:12}}),e.jsx(le,{angle:90,domain:[0,100],tickCount:5,tick:{fill:"hsl(var(--muted-foreground))",fontSize:10}}),e.jsx(ie,{name:"Performance",dataKey:"value",stroke:f,fill:h,fillOpacity:l,strokeWidth:2,filter:"url(#glow)"}),e.jsx(C,{content:({active:a,payload:p})=>{if(a&&p&&p.length){const s=p[0].payload;return e.jsxs("div",{className:"bg-card border border-border rounded-lg p-3 shadow-lg",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:[e.jsx("p",{className:"font-semibold text-foreground mb-1",children:s.metric}),e.jsxs("p",{className:"text-primary text-lg font-bold",children:[Math.round(s.value),"th percentile"]}),s.rawValue!==void 0&&s.median!==void 0&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Value: ",s.rawValue.toFixed(2),s.unit||"",e.jsxs("span",{className:"text-muted-foreground/70",children:[" (median: ",s.median.toFixed(2),s.unit||"",")"]})]})]})}return null}})]})})}function ge({standingPercentage:m,clinchPercentage:h,groundPercentage:f}){const l=[{position:"Standing",value:m,color:"hsl(var(--primary))"},{position:"Clinch",value:h,color:"#f97316"},{position:"Ground",value:f,color:"#8b5cf6"}];return e.jsx("div",{className:"h-[200px] md:h-[240px]",children:e.jsx(M,{width:"100%",height:"100%",children:e.jsxs(de,{data:l,margin:{top:10,right:10,left:-20,bottom:20},children:[e.jsx(ce,{dataKey:"position",stroke:"hsl(var(--muted-foreground))",fontSize:12,tickLine:!1,axisLine:!1}),e.jsx(me,{stroke:"hsl(var(--muted-foreground))",fontSize:12,tickLine:!1,axisLine:!1}),e.jsx(C,{cursor:{fill:"hsl(var(--muted) / 0.3)"},content:({active:x,payload:d})=>{if(x&&d&&d.length){const a=d[0];return e.jsxs("div",{className:"bg-card border border-border rounded-lg p-2 md:p-3 shadow-lg",children:[e.jsx("p",{className:"font-semibold text-foreground text-sm",children:a.payload.position}),e.jsxs("p",{className:"text-primary text-base md:text-lg",children:[a.value," strikes"]})]})}return null}}),e.jsx(se,{dataKey:"value",radius:[8,8,0,0],children:l.map((x,d)=>e.jsx(O,{fill:x.color,fillOpacity:.8},`cell-${d}`))})]})})})}function Xe(){const{fighterName:m}=G(),h=W(),f=m?J(m):"",{data:l,isLoading:x,error:d}=q(f),{data:a,isLoading:p}=I();g.useEffect(()=>{window.scrollTo(0,0)},[]);const s=l==null?void 0:l.stats;l!=null&&l.fightHistory;const o=g.useMemo(()=>s!=null&&s.record?Q(s.record):{wins:0,losses:0,draws:0},[s==null?void 0:s.record]),A=o.wins+o.losses+o.draws,v=A>0?(o.wins/A*100).toFixed(1):"0",P=g.useMemo(()=>
1{if(!s||!a)return[];const t=j(s["Striking accuracy (%)"]),r=n(s["Sig. Str. Landed (per min)"]),i=n(s["Takedown avg (per 15 min)"]),b=n(s["Submission avg (per 15 min)"]),w=s["Sig. Str. Defense (%)"],F=s["Sig. Str. Absorbed (per min)"],N=s["Knockdown Avg"],z=w&&w!=="Stats not found"&&F&&F!=="Stats not found"&&N&&N!=="Stats not found",L=[{metric:"Strike Acc",value:c(t,a.median_striking_accuracy),rawValue:t,median:a.median_striking_accuracy,unit:"%",fullMark:100},{metric:"Str Landed",value:c(r,a.median_sig_str_landed),rawValue:r,median:a.median_sig_str_landed,unit:"/min",fullMark:100},{metric:"TD Avg",value:c(i,a.median_td_avg),rawValue:i,median:a.median_td_avg,unit:"/15min",fullMark:100},{metric:"Sub Avg",value:c(b,a.median_sub_avg),rawValue:b,median:a.median_sub_avg,unit:"/15min",fullMark:100}];if(z){const B=j(w),T=n(N);L.push({metric:"Str Defense",value:c(B,a.median_strike_defense||50),rawValue:B,median:a.median_strike_defense||50,unit:"%",fullMark:100},{metric:"Knockdown",value:c(T,a.median_knockdown||.5),rawValue:T,median:a.median_knockdown||.5,unit:"/fight",fullMark:100})}return L},[s,a]),K=g.useMemo(()=>s?[{metric:"Str/Min",value:Math.min(100,n(s["Sig. Str. Landed (per min)"])/8*100),fullMark:100},{metric:"Accuracy",value:j(s["Striking accuracy (%)"]),fullMark:100}]:[],[s]),D=g.useMemo(()=>{if(!s||!a)return[];const t=n(s["Takedown avg (per 15 min)"]),r=j(s["Takedown Defense (%)"]),i=n(s["Submission avg (per 15 min)"]);return[{metric:"TD/15min",value:c(t,a.median_td_avg),rawValue:t,median:a.median_td_avg,unit:"/15min",fullMark:100},{metric:"TD Defense",value:c(r,a.median_td_defense),rawValue:r,median:a.median_td_defense,unit:"%",fullMark:100},{metric:"Sub/15min",value:c(i,a.median_sub_avg),rawValue:i,median:a.median_sub_avg,unit:"/15min",fullMark:100}]},[s,a]),y=g.useMemo(()=>s?[{name:"KO/TKO",value:n(s["Win by Method - KO/TKO (abs)"]),color:"#ef4444"},{name:"Submission",value:n(s["Win by Method - SUB (abs)"]),color:"#8b5cf6"},{name:"Decision",value:n(s["Win by Method - DEC (abs)"]),color:"#3b82f6"}].filter(r=>r.value>0):[],[s]);return x||p?e.jsx(S,{children:e.jsxs("div",{className:"container py-8 space-y-6",children:[e.jsx(k,{className:"h-10 w-32"}),e.jsx(k,{className:"h-16 w-full"}),e.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:[...Array(6)].map((t,r)=>e.jsx(k,{className:"h-64"},r))})]})}):d||!(l!=null&&l.stats)?e.jsx(S,{children:e.jsxs("div",{className:"container py-8",children:[e.jsxs($,{variant:"outline",onClick:()=>h("/ufc-fighters"),className:"mb-4",children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),"Back to Fighters"]}),e.jsx(R,{children:e.jsx(E,{className:"py-12 text-center",children:e.jsx("p",{className:"text-muted-foreground",children:"Fighter not found"})})})]})}
1):e.jsxs(S,{children:[e.jsxs(H,{children:[e.jsxs("title",{children:[s.fighter_name," - UFC Stats & Analysis | Oddify"]}),e.jsx("meta",{name:"description",content:`${s.fighter_name} UFC stats: ${o.wins}-${o.losses}-${o.draws} record, ${v}% win rate. Division: ${s.division||"N/A"}. Full striking, grappling, and fight history analytics.`}),e.jsx("meta",{property:"og:title",content:`${s.fighter_name} - UFC Stats & Analysis | Oddify`}),e.jsx("meta",{property:"og:description",content:`${s.fighter_name} - ${o.wins}-${o.losses}-${o.draws} record, ${v}% win rate.`}),e.jsx("meta",{property:"og:type",content:"profile"}),e.jsx("link",{rel:"canonical",href:`https://oddify.ai/fighters/${m}`})]}),e.jsxs("div",{className:"container py-4 md:py-8 space-y-4 md:space-y-6 px-2 md:px-4",children:[e.jsxs($,{variant:"outline",onClick:()=>h("/ufc-fighters"),className:"w-full md:w-auto",children:[e.jsx(V,{className:"h-4 w-4 mr-2"}),"Back to Fighters"]}),e.jsx(R,{children:e.jsx(U,{className:"p-4 md:p-6",children:e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(X,{className:"text-2xl md:text-3xl",children:s.fighter_name}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 md:gap-4 text-base md:text-lg",children:[e.jsxs("span",{className:"font-semibold",children:[o.wins,"-",o.losses,"-",o.draws]}),s.division&&e.jsx(Y,{variant:"outline",className:"text-xs md:text-sm",children:s.division}),e.jsxs("span",{className:"text-muted-foreground text-sm md:text-base",children:["Win Rate: ",v,"%"]})]})]})})}),e.jsx(u,{title:"Overall Performance Percentiles",children:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("div",{className:"w-full max-w-md mx-auto",children:e.jsx("div",{className:"h-[200px] md:h-[250px]",children:e.jsx(_,{data:P,fillColor:"hsl(var(--primary))",strokeColor:"hsl(var(--primary))",fillOpacity:.3})})}),e.jsx("div",{className:"mt-6 space-y-2 text-sm",children:P.map((t,r)=>{var i;return e.jsxs("div",{className:"flex justify-between items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground text-xs md:text-sm truncate flex-shrink-0 max-w-[120px]",children:t.metric}),e.jsxs("span",{className:"font-semibold text-foreground text-xs md:text-sm whitespace-nowrap",children:[(i=t.rawValue)==null?void 0:i.toFixed(t.unit==="%"?0:2),t.unit]})]},r)})})]})}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6 animate-fade-in",style:{animationDelay:"0.1s"},children:[e.jsxs(u,{title:"Striking Statistics",children:[e.jsx("div",{className:"h-[200px] md:h-[250px]",children:e.jsx(_,{data:K,fillColor:"#ef4444",strokeColor:"#ef4444",fillOpacity:.4})}),e.jsxs("div",{className:"mt-6 space-y-2 text-xs md:text-sm",children:[e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground truncate",children:"Sig. Str. Landed/Min"}),e.jsx("span",{className:"font-semibold whitespace-nowrap",children:s["Sig. Str. Landed (per min)"]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsx("span",{className:"text-muted-foreground truncate",children:"Striking Accuracy"}),e.jsxs("span",{className:"font-semibold whitespace-nowrap",children:[s["Striking accuracy (%)"],"%"]})]})]})]}),e.jsxs(u,{title:"Grappling Statistics",children:[e.jsx("div",{className:"h-[200px] md:h-[250px]",children:e.jsx(_,{data:D,fillColor:"#8b5cf6",strokeColor:"#8b5cf6",fillOpacity:.4})}),e.jsx("div",{className:"mt-6 space-y-2 text-xs md:text-sm",children:D.map((t,r)=>{var i;return e.jsxs("div",{className:"flex justify-between items-center gap-2",children:[e.jsx("span",{className:"text-muted-foreground truncate",children:t.metric}),e.jsxs("span",{className:"font-semibold text-foreground whitespace-nowrap",children:[(i=t.rawValue)==null?void 0:i.toFixed(t.unit==="%"?0:2),t.unit]})]},r)})})]})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6 animate-fade-in",style:{animationDelay:"0.2s"},children:[e.jsx(u,{title:"Total Strikes by Position",children:e.jsx(ge,{standingPercentage:n(s["Sig. Str. By Position - Standing (%)"]),clinchPercentage:n(s["Sig. Str. By Position - Clinch (%)"]),groundPercentage:n(s["Sig. Str. By Position - Ground (%)"])})}
1),e.jsx(u,{title:"Strikes by Target",children:e.jsx("div",{className:"max-w-sm mx-auto",children:e.jsx(oe,{headPercentage:n(s["Sig. Str. Target - Head (%)"]),bodyPercentage:n(s["Sig. Str. Target - Body (%)"]),legPercentage:n(s["Sig. Str. Target - Leg (%)"])})})})]}),e.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6 animate-fade-in",style:{animationDelay:"0.3s"},children:e.jsxs("div",{className:"space-y-4 md:space-y-6",children:[e.jsx(u,{title:"Win Methods",children:y.length>0?e.jsx("div",{className:"h-[200px] md:h-[240px]",children:e.jsx(M,{width:"100%",height:"100%",children:e.jsxs(xe,{children:[e.jsx(ue,{data:y,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",outerRadius:"60%",paddingAngle:2,label:({name:t,value:r,percent:i})=>`${(i*100).toFixed(0)}%`,labelLine:!1,children:y.map((t,r)=>e.jsx(O,{fill:t.color,fillOpacity:.7,stroke:"hsl(var(--card))",strokeWidth:3},`cell-${r}`))}),e.jsx(C,{content:({active:t,payload:r})=>{if(t&&r&&r.length){const i=r[0];return e.jsxs("div",{className:"bg-card border border-border rounded-lg p-2 md:p-3 shadow-lg",children:[e.jsx("p",{className:"font-semibold text-foreground text-sm",children:i.name}),e.jsxs("p",{className:"text-primary text-base md:text-lg",children:[i.value," wins"]})]})}return null}}),e.jsx(ae,{verticalAlign:"bottom",height:36,iconType:"circle",iconSize:6,wrapperStyle:{fontSize:"12px"},formatter:t=>e.jsx("span",{className:"text-xs md:text-sm text-foreground",children:t})})]})})}):e.jsx("div",{className:"flex items-center justify-center h-[200px] md:h-[240px] text-muted-foreground text-sm",children:"No win data available"})}),e.jsx(u,{title:"Average Fight Duration",children:e.jsxs("div",{className:"text-center py-6 md:py-8",children:[e.jsx("div",{className:"text-3xl md:text-4xl font-bold text-primary mb-2",children:Z(s["Average fight time (seconds)"])}),e.jsx("div",{className:"text-muted-foreground text-sm",children:"Minutes:Seconds"})]})})]})})]})]})}export{Xe as default};
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.