1/*! For license information please see 332.94a0e188.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[332],{27899(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("arrow-down-right",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]])},28646(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},50332(e,t,s){s.r(t),s.d(t,{default:()=>Y});var a=s(65043),c=s(45685),l=s(79722),r=s(69284),i=s(13390),d=s(56328),n=s(27033),o=s(24137),x=s(77819),m=s(82054),h=s(76245),p=s(22024),b=s(56099),j=s(37719),u=s(34537),g=s(27899),y=s(65469),v=s(67010),N=s(85347),f=s(14939),w=s(56382),A=s(28646),_=s(38326),k=s(75088),R=s(73062),S=s(87147),L=s(64830),C=s(50516),T=s(23165),V=s(63507),I=s(73782),M=s(44919),z=s(31130),P=s(20073),E=s(70579);const H=e=>{let{onBack:t}=e;return(0,E.jsx)("nav",{className:"fixed bg-slate-900/90 backdrop-blur-xl border-b border-white/10 top-0 left-0 right-0 z-50 px-4 py-3",children:(0,E.jsxs)("div",{className:"flex items-center justify-between max-w-7xl mx-auto",children:[(0,E.jsxs)("div",{className:"flex items-center gap-4",children:[(0,E.jsx)(i.$,{variant:"ghost",size:"icon",onClick:t,className:"text-slate-400 hover:text-white",children:(0,E.jsx)(y.A,{className:"w-5 h-5"})}),(0,E.jsxs)("div",{className:"flex items-center gap-2",children:[(0,E.jsx)("div",{className:"w-8 h-8 bg-gradient-to-r from-emerald-500 to-cyan-600 rounded-lg flex items-center justify-center",children:(0,E.jsx)(T.A,{className:"w-4 h-4 text-white"})}),(0,E.jsx)("span",{className:"font-display text-lg font-semibold text-white",children:"AI Accuracy Dashboard"}),(0,E.jsx)("span",{className:"text-xs px-2 py-0.5 bg-emerald-500/20 text-emerald-300 rounded-full animate-pulse",children:"LIVE"})]})]}),(0,E.jsx)(c.N_,{to:"/admin",children:(0,E.jsx)(i.$,{variant:"outline",size:"sm",className:"border-white/10",children:"Admin Panel"})})]})})},O=e=>{let{achieved:t,currentAccuracy:s,targetAccuracy:a}=e;return(0,E.jsxs)("div",{className:"p-6 rounded-xl border ".concat(t?"bg-gradient-to-r from-emerald-500/20 to-cyan-500/20 border-emerald-500/30":"bg-gradient-to-r from-amber-500/20 to-orange-500/20 border-amber-500/30"),children:[(0,E.jsxs)("div",{className:"flex items-center justify-between",children:[(0,E.jsxs)("div",{className:"flex items-center gap-4",children:[(0,E.jsx)("div",{className:"w-16 h-16 rounded-2xl flex items-center justify-center ".concat(t?"bg-emerald-500/30":"bg-amber-500/30"),children:t?(0,E.jsx)(z.A,{className:"w-8 h-8 text-emerald-400"}):(0,E.jsx)(T.A,{className:"w-8 h-8 text-amber-400"})}),(0,E.jsxs)("div",{children:[(0,E.jsx)("h2",{className:"text-xl font-bold text-white flex items-center gap-2",children:t?(0,E.jsxs)(E.Fragment,{children:[(0,E.jsx)("span",{className:"text-emerald-400",children:"Target Achieved!"}),(0,E.jsx)(b.A,{className:"w-5 h-5 text-amber-400"})]}):(0,E.jsx)("span",{className:"text-amber-400",children:"Working Towards Target"})}),(0,E.jsx)("p",{className:"text-slate-400 text-sm mt-1",children:t?"Institutional-grade accuracy of ".concat(s,"% achieved (Target: ").concat(a,"%)"):"Current accuracy: ".concat(s,"% (Target: ").concat(a,"%)")})]})]}),(0,E.jsxs)("div",{className:"text-right",children:[(0,E.jsxs)("p",{className:"text-4xl font-bold bg-gradient-to-r from-emerald-400 to-cyan-400 bg-clip-text text-transparent",children:[s,"%"]}),(0,E.jsx)("p",{className:"text-sm text-slate-500",children:"Current Accuracy"})]})]}),!t&&(0,E.jsxs)("div",{className:"mt-4",children:[(0,E.jsxs)("div",{className:"flex justify-between text-xs text-slate-400 mb-1",children:[(0,E.jsxs)("span",{children:["Progress to ",a,"% target"]}),(0,E.jsxs)("span",{children:[Math.round(s/a*100),"%"]})]}),(0,E.jsx)("div",{className:"h-2 bg-slate-800 rounded-full overflow-hidden",children:(0,E.jsx)("div",{className:"h-full bg-gradient-to-r from-amber-500 to-emerald-500 rounded-full transition-all duration-500",style:{width:"".concat(Math.min(100,s/a*100),"%")}})})]})]})},B=e=>{let{icon:t,label:s,value:a,subValue:c,trend:l,color:r="cyan",highlight:i=!1}=e;return(0,E.jsxs)("div",{className:"p-4 rounded-xl bg-gradient-to-br ".concat({cyan:"from-cyan-500/20 to-cyan-600/20 border-cyan-500/30",emerald:"from-emerald-500/20 to-emerald-600/20 border-emerald-500/30",amber:"from-amber-500/20 to-amber-600/20 border-amber-500/30",red:"from-red-500/20 to-red-600/20 border-red-500/30",purple:"from-purple-500/20 to-purple-600/20 border-purple-500/30"}[r]," border ").concat(i?"ring-2 ring-cyan-500/50":""),children:[(0,E.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,E.jsx)(t,{className:"w-4 h-4 text-".concat(r,"-400")}),(0,E.jsx)("span",{className:"text-sm text-slate-400",children:s})]}),(0,E.jsx)("p",{className:"text-2xl font-bold text-white",children:a}),c&&(0,E.jsx)("p",{className:"text-xs text-slate-500 mt-1",children:c}),void 0!==l&&(0,E.jsxs)("div",{className:"flex items-center gap-1 mt-2 text-xs ".concat(l>=0?"text-emerald-400":"text-red-400"),children:[l>=0?(0,E.jsx)(M.A,{className:"w-3 h-3"}):(0,E.jsx)(I.A,{className:"w-3 h-3"}),(0,E.jsxs)("span",{children:[l>=0?"+":"",l,"%"]})]})]})},$=e=>{let{data24h:t,data48h:s,onRunValidation:a,validating:c}=e;return(0,E.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-white/10 rounded-xl p-6",children:[(0,E.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,E.jsxs)("h2",{className:"text-lg font-semibold text-white flex items-center gap-2",children:[(0,E.jsx)(V.A,{className:"w-5 h-5 text-cyan-400"}),"Real-Time Validation"]}),(0,E.jsxs)(i.$,{onClick:a,disabled:c,size:"sm",className:"bg-cyan-600 hover:bg-cyan-700",children:[c?(0,E.jsx)(p.A,{className:"w-4 h-4 mr-2 animate-spin"}):(0,E.jsx)(L.A,{className:"w-4 h-4 mr-2"}),"Run Validation"]})]}),(0,E.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,E.jsxs)("div",{className:"p-4 bg-slate-800/50 rounded-xl border border-slate-700/50",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,E.jsx)("div",{className:"w-8 h-8 bg-cyan-500/20 rounded-lg flex items-center justify-center",children:(0,E.jsx)(k.A,{className:"w-4 h-4 text-cyan-400"})}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"font-medium text-white",children:"24-Hour Window"}),(0,E.jsx)("p",{className:"text-xs text-slate-500",children:"Predictions made 24h ago"})]})]}),(0,E.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,E.jsxs)("div",{children:[(0,E.jsxs)("p",{className:"text-2xl font-bold text-white",children:[(null===t||void 0===t?void 0:t.accuracy_rate)||0,"%"]}),(0,E.jsx)("p",{className:"text-xs text-slate-500",children:"Accuracy"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-2xl font-bold text-white",children:(null===t||void 0===t?void 0:t.validated)||0}),(0,E.jsx)("p",{className:"text-xs text-slate-500",children:"Validated"})]})]}),(null===t||void 0===t?void 0:t.by_confidence)&&(0,E.jsx)("div",{className:"mt-3 pt-3 border-t border-slate-700/50 space-y-1",children:Object.entries(t.by_confidence).map(e=>{let[t,s]=e;return(0,E.jsxs)("div",{className:"flex justify-between text-xs",children:[(0,E.jsx)("span",{className:"text-slate-400 capitalize",children:t}),(0,E.jsxs)("span",{className:"text-white",children:[s.accuracy_pct||0,"% (",s.total,")"]})]},t)})})]}),(0,E.jsxs)("div",{className:"p-4 bg-slate-800/50 rounded-xl border border-slate-700/50",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,E.jsx)("div",{className:"w-8 h-8 bg-purple-500/20 rounded-lg flex items-center justify-center",children:(0,E.jsx)(A.A,{className:"w-4 h-4 text-purple-400"})}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"font-medium text-white",children:"48-Hour Window"}),(0,E.jsx)("p",{className:"text-xs text-slate-500",children:"Longer-term validation"})]})]}),(0,E.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,E.jsxs)("div",{children:[(0,E.jsxs)("p",{className:"text-2xl font-bold text-white",children:[(null===s||void 0===s?void 0:s.accuracy_rate)||0,"%"]}),(0,E.jsx)("p",{className:"text-xs text-slate-500",children:"Accuracy"})]}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"text-2xl font-bold text-white",children:(null===s||void 0===s?void 0:s.validated)||0}),(0,E.jsx)("p",{className:"text-xs text-slate-500",children:"Validated"})]})]})]})]})]})},q=e=>{let{bySource:t}=e;const s={unified_ai:{icon:w.A,color:"cyan"},ml_prediction:{icon:P.A,color:"purple"},finbert_sentiment:{icon:o.A,color:"emerald"},pattern_matching:{icon:n.A,color:"amber"},bot_scheduler:{icon:f.A,color:"blue"}};return(0,E.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-white/10 rounded-xl p-6",children:[(0,E.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,E.jsx)(w.A,{className:"w-5 h-5 text-purple-400"}),"Accuracy by AI Model"]}),(0,E.jsxs)("div",{className:"space-y-3",children:[Object.entries(t||{}).map(e=>
2{let[t,a]=e;const c=s[t]||{icon:u.A,color:"slate"},l=c.icon,r=a.accuracy_pct>=70?"text-emerald-400":a.accuracy_pct>=50?"text-amber-400":"text-red-400";return(0,E.jsxs)("div",{className:"flex items-center justify-between p-3 bg-slate-800/50 rounded-lg",children:[(0,E.jsxs)("div",{className:"flex items-center gap-3",children:[(0,E.jsx)("div",{className:"w-10 h-10 bg-".concat(c.color,"-500/20 rounded-lg flex items-center justify-center"),children:(0,E.jsx)(l,{className:"w-5 h-5 text-".concat(c.color,"-400")})}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"font-medium text-white capitalize",children:t.replace(/_/g," ")}),(0,E.jsxs)("p",{className:"text-xs text-slate-500",children:[a.total," predictions"]})]})]}),(0,E.jsxs)("div",{className:"text-right",children:[(0,E.jsxs)("p",{className:"text-xl font-bold ".concat(r),children:[a.accuracy_pct,"%"]}),(0,E.jsxs)("p",{className:"text-xs text-slate-500",children:[a.correct," correct"]})]})]},t)}),0===Object.keys(t||{}).length&&(0,E.jsx)("p",{className:"text-slate-500 text-center py-4",children:"No model data available"})]})]})},D=e=>{let{weeklyTrend:t}=e;return(0,E.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-white/10 rounded-xl p-6",children:[(0,E.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,E.jsx)(o.A,{className:"w-5 h-5 text-cyan-400"}),"Weekly Accuracy Trend"]}),(0,E.jsxs)("div",{className:"space-y-3",children:[(t||[]).map((e,t)=>{e.accuracy_pct>=70||e.accuracy_pct;const s=Math.max(10,e.accuracy_pct);return(0,E.jsxs)("div",{className:"flex items-center gap-4",children:[(0,E.jsx)("span",{className:"text-sm text-slate-400 w-20",children:e.week}),(0,E.jsxs)("div",{className:"flex-1 h-6 bg-slate-800 rounded-full overflow-hidden relative",children:[(0,E.jsx)("div",{className:"h-full rounded-full transition-all duration-500 ".concat(e.accuracy_pct>=80?"bg-gradient-to-r from-emerald-500 to-cyan-500":e.accuracy_pct>=60?"bg-gradient-to-r from-amber-500 to-yellow-500":"bg-gradient-to-r from-red-500 to-orange-500"),style:{width:"".concat(s,"%")}}),(0,E.jsxs)("span",{className:"absolute inset-0 flex items-center justify-center text-xs font-medium text-white",children:[e.accuracy_pct,"%"]})]}),(0,E.jsxs)("span",{className:"text-xs text-slate-500 w-16",children:[e.total," signals"]})]},e.week)}),0===(t||[]).length&&(0,E.jsx)("p",{className:"text-slate-500 text-center py-4",children:"No weekly data available"})]})]})},W=e=>{let{best:t,worst:s}=e;return(0,E.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[(0,E.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-emerald-500/20 rounded-xl p-6",children:[(0,E.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,E.jsx)(M.A,{className:"w-5 h-5 text-emerald-400"}),"Best Performers"]}),(0,E.jsxs)("div",{className:"space-y-2",children:[(t||[]).slice(0,5).map((e,t)=>(0,E.jsxs)("div",{className:"flex items-center justify-between p-2 bg-emerald-500/10 rounded-lg",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2",children:[(0,E.jsx)("span",{className:"w-6 h-6 bg-emerald-500/30 rounded text-xs font-bold text-emerald-300 flex items-center justify-center",children:t+1}),(0,E.jsx)("span",{className:"font-medium text-white",children:e.symbol})]}),(0,E.jsxs)("div",{className:"flex items-center gap-2",children:[(0,E.jsxs)("span",{className:"text-emerald-400 font-bold",children:[e.accuracy_pct,"%"]}),(0,E.jsx)(v.A,{className:"w-4 h-4 text-emerald-400"})]})]},e.symbol)),0===(t||[]).length&&(0,E.jsx)("p",{className:"text-slate-500 text-center py-4",children:"No data yet"})]})]}),(0,E.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-red-500/20 rounded-xl p-6",children:[(0,E.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,E.jsx)(I.A,{className:"w-5 h-5 text-red-400"}),"Needs Improvement"]}),(0,E.jsxs)("div",{className:"space-y-2",children:[(s||[]).slice(0,5).map((e,t)=>(0,E.jsxs)("div",{className:"flex items-center justify-between p-2 bg-red-500/10 rounded-lg",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2",children:[(0,E.jsx)("span",{className:"w-6 h-6 bg-red-500/30 rounded text-xs font-bold text-red-300 flex items-center justify-center",children:t+1}),(0,E.jsx)("span",{className:"font-medium text-white",children:e.symbol})]}),(0,E.jsxs)("div",{className:"flex items-center gap-2",children:[(0,E.jsxs)("span",{className:"text-red-400 font-bold",children:[e.accuracy_pct,"%"]}),(0,E.jsx)(g.A,{className:"w-4 h-4 text-red-400"})]})]},e.symbol)),0===(s||[]).length&&(0,E.jsx)("p",{className:"text-slate-500 text-center py-4",children:"No data yet"})]})]})]})},U=e=>{let{recommendations:t}=e;return(0,E.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-white/10 rounded-xl p-6",children:[(0,E.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,E.jsx)(b.A,{className:"w-5 h-5 text-amber-400"}),"AI Recommendations"]}),(0,E.jsxs)("div",{className:"space-y-3",children:[(t||[]).map((e,t)=>(0,E.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-slate-800/50 rounded-lg",children:[(0,E.jsx)(_.A,{className:"w-4 h-4 text-cyan-400 mt-0.5 flex-shrink-0"}),(0,E.jsx)("p",{className:"text-slate-300 text-sm",children:e})]},t)),0===(t||[]).length&&(0,E.jsx)("p",{className:"text-slate-500 text-center py-4",children:"No recommendations available"})]})]})},F=e=>{let{tier:t,data:s}=e;const a={very_high:{label:"80%+",color:"emerald",icon:z.A},high:{label:"70-79%",color:"cyan",icon:N.A},medium:{label:"60-69%",color:"amber",icon:T.A},low:{label:"50-59%",color:"orange",icon:j.A},very_low:{label:"<50%",color:"red",icon:x.A}}[t]||{label:t,color:"slate",icon:u.A},c=a.icon,l=s.accuracy_pct>=70?"text-emerald-400":s.accuracy_pct>=50?"text-amber-400":"text-red-400";return(0,E.jsxs)("div",{className:"p-4 bg-slate-800/50 rounded-xl border border-slate-700/50",children:[(0,E.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,E.jsxs)("div",{className:"flex items-center gap-2",children:[(0,E.jsx)(c,{className:"w-5 h-5 text-".concat(a.color,"-400")}),(0,E.jsx)("span",{className:"text-sm font-medium text-white",children:a.label})]}),(0,E.jsxs)("span",{className:"text-xl font-bold ".concat(l),children:[s.accuracy_pct,"%"]})]}),(0,E.jsxs)("div",{className:"flex items-center justify-between text-xs text-slate-400",children:[(0,E.jsxs)("span",{children:[s.total," predictions"]}),(0,E.jsxs)("span",{children:[s.correct," correct"]}),(0,E.jsxs)("span",{className:s.avg_profit_pct>=0?"text-emerald-400":"text-red-400",children:[s.avg_profit_pct>=0?"+":"",s.avg_profit_pct,"%"]})]})]})},G=e=>{var t,s;let{prediction:a}=e;const c={STRONG_BUY:"text-emerald-400 bg-emerald-500/20",BUY:"text-emerald-400 bg-emerald-500/20",BULLISH:"text-emerald-400 bg-emerald-500/20",STRONG_SELL:"text-red-400 bg-red-500/20",SELL:"text-red-400 bg-red-500/20",BEARISH:"text-red-400 bg-red-500/20",HOLD:"text-amber-400 bg-amber-500/20",NEUTRAL:"text-amber-400 bg-amber-500/20"}[a.signal]||"text-slate-400 bg-slate-500/20";return(0,E.jsxs)("div",{className:"flex items-center justify-between p-3 bg-slate-800/30 rounded-lg hover:bg-slate-800/50 transition-colors",children:[(0,E.jsxs)("div",{className:"flex items-center gap-3",children:[(0,E.jsx)("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center ".concat(a.validated?a.correct?"bg-emerald-500/20":"bg-red-500/20":"bg-slate-700/50"),children:a.validated?a.correct?(0,E.jsx)(m.A,{className:"w-4 h-4 text-emerald-400"}):(0,E.jsx)(h.A,{className:"w-4 h-4 text-red-400"}):(0,E.jsx)(k.A,{className:"w-4 h-4 text-slate-400"})}),(0,E.jsxs)("div",{children:[(0,E.jsx)("p",{className:"font-medium text-white",children:a.symbol}),(0,E.jsx)("p",{className:"text-xs text-slate-500",children:new Date(a.created_at).toLocaleStr
2ing()})]})]}),(0,E.jsxs)("div",{className:"flex items-center gap-4",children:[(0,E.jsx)("span",{className:"text-xs px-2 py-1 rounded font-medium ".concat(c),children:a.signal}),(0,E.jsxs)("div",{className:"text-center",children:[(0,E.jsxs)("p",{className:"text-sm text-slate-300",children:[a.confidence,"%"]}),(0,E.jsx)("p",{className:"text-xs text-slate-500",children:"conf"})]}),(0,E.jsxs)("div",{className:"text-center",children:[(0,E.jsxs)("p",{className:"text-sm text-slate-300",children:["$",null===(t=a.entry_price)||void 0===t?void 0:t.toLocaleString()]}),a.exit_price&&(0,E.jsxs)("p",{className:"text-xs text-slate-500",children:["\u2192 $",null===(s=a.exit_price)||void 0===s?void 0:s.toLocaleString()]})]}),null!==a.profit_pct&&(0,E.jsxs)("div",{className:"text-center font-bold ".concat(a.profit_pct>=0?"text-emerald-400":"text-red-400"),children:[a.profit_pct>=0?"+":"",a.profit_pct,"%"]}),(0,E.jsx)("span",{className:"text-xs px-2 py-1 rounded ".concat(a.validated?"bg-emerald-500/20 text-emerald-300":"bg-slate-700 text-slate-400"),children:a.validated?"Validated":"Pending"})]})]})};function Y(e){var t;let{auth:s}=e;const n=(0,c.Zp)(),[o,x]=(0,a.useState)(!0),[b,j]=(0,a.useState)(!1),[g,y]=(0,a.useState)(!1),[v,f]=(0,a.useState)(null),[w,A]=(0,a.useState)(null),[_,k]=(0,a.useState)(null),[L,V]=(0,a.useState)([]),[I,M]=(0,a.useState)(30),z=async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];e?y(!0):x(!0);try{const[t,s,a,c]=await Promise.all([l.A.get("".concat(r.nC,"/analytics/accuracy/dashboard?days=").concat(I)),l.A.get("".concat(r.nC,"/analytics/accuracy/report")),l.A.get("".concat(r.nC,"/analytics/accuracy/historical?days=").concat(I)),l.A.get("".concat(r.nC,"/analytics/accuracy/predictions?limit=20"))]);f(t.data),A(s.data),k(a.data),V(c.data.predictions||[]),e&&d.oR.success("Data refreshed successfully!")}catch(t){console.error("Error fetching accuracy data:",t),d.oR.error("Failed to fetch accuracy data")}finally{x(!1),y(!1)}};if((0,a.useEffect)(()=>{z()},[I]),o)return(0,E.jsx)("div",{className:"min-h-screen bg-slate-950 flex items-center justify-center",children:(0,E.jsxs)("div",{className:"text-center",children:[(0,E.jsx)(p.A,{className:"w-10 h-10 text-cyan-400 animate-spin mx-auto mb-4"}),(0,E.jsx)("p",{className:"text-slate-400",children:"Loading accuracy data..."})]})});const P=(null===v||void 0===v?void 0:v.overall)||{},Y=(null===v||void 0===v?void 0:v.by_confidence_tier)||{},Z=(null===v||void 0===v?void 0:v.by_source)||{},J=w||{},K=_||{};return(0,E.jsxs)("div",{className:"min-h-screen bg-slate-950 text-white",children:[(0,E.jsx)(H,{onBack:()=>n("/admin")}),(0,E.jsxs)("div",{className:"max-w-7xl mx-auto px-4 pt-24 pb-12",children:[(0,E.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,E.jsxs)("div",{children:[(0,E.jsx)("h1",{className:"text-3xl font-bold bg-gradient-to-r from-emerald-400 to-cyan-400 bg-clip-text text-transparent",children:"AI Accuracy Dashboard"}),(0,E.jsx)("p",{className:"text-slate-400 mt-1",children:"Real-time monitoring & validation of AI predictions"})]}),(0,E.jsxs)("div",{className:"flex items-center gap-3",children:[(0,E.jsxs)("select",{value:I,onChange:e=>M(Number(e.target.value)),className:"px-3 py-2 bg-slate-800 border border-white/10 rounded-lg text-white text-sm",children:[(0,E.jsx)("option",{value:7,children:"Last 7 days"}),(0,E.jsx)("option",{value:14,children:"Last 14 days"}),(0,E.jsx)("option",{value:30,children:"Last 30 days"}),(0,E.jsx)("option",{value:60,children:"Last 60 days"})]}),(0,E.jsxs)(i.$,{onClick:()=>z(!0),variant:"outline",className:"border-white/10",disabled:g,children:[g?(0,E.jsx)(p.A,{className:"w-4 h-4 mr-2 animate-spin"}):(0,E.jsx)(C.A,{className:"w-4 h-4 mr-2"}),g?"Refreshing...":"Refresh"]})]})]}),(0,E.jsx)("div",{className:"mb-6",children:(0,E.jsx)(O,{achieved:J.target_achieved||!1,currentAccuracy:(null===K||void 0===K||null===(t=K.overall)||void 0===t?void 0:t.accuracy_rate)||P.accuracy_pct||0,targetAccuracy:J.target_accuracy||80})}),(0,E.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-6 gap-4 mb-6",children:[(0,E.jsx)(B,{icon:T.A,label:"Accuracy Rate",value:"".concat(P.accuracy_pct||0,"%"),subValue:"".concat(P.correct_predictions||0,"/").concat(P.total_predictions||0),color:P.accuracy_pct>=70?"emerald":P.accuracy_pct>=50?"amber":"red",highlight:P.accuracy_pct>=80}),(0,E.jsx)(B,{icon:S.A,label:"Win Rate",value:"".concat(P.win_rate_pct||0,"%"),subValue:"".concat(P.winning_trades||0," wins"),color:P.win_rate_pct>=60?"emerald":"amber"}),(0,E.jsx)(B,{icon:R.A,label:"Avg Profit",value:"".concat(P.avg_profit_pct>=0?"+":"").concat(P.avg_profit_pct||0,"%"),color:P.avg_profit_pct>=0?"emerald":"red"}),(0,E.jsx)(B,{icon:u.A,label:"Total Predictions",value:P.total_predictions||0,color:"cyan"}),(0,E.jsx)(B,{icon:m.A,label:"Correct",value:P.correct_predictions||0,color:"emerald"}),(0,E.jsx)(B,{icon:h.A,label:"Incorrect",value:P.losing_trades||0,color:"red"})]}),(0,E.jsx)("div",{className:"mb-6",children:(0,E.jsx)($,{data24h:J.realtime_metrics,data48h:J.realtime_metrics,onRunValidation:async()=>{j(!0);try{var e,t;const s=await l.A.post("".concat(r.nC,"/analytics/accuracy/run-validation-cycle")),a=(null===(e=s.data.validations)||void 0===e?void 0:e["24h"])||{},c=(null===(t=s.data.validations)||void 0===t?void 0:t["48h"])||{};d.oR.success("Validation complete: 24h=".concat(a.validated||0,", 48h=").concat(c.validated||0)),z()}catch(s){console.error("Error running validation:",s),d.oR.error("Failed to run validation cycle")}finally{j(!1)}},validating:b})}),(0,E.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6",children:[(0,E.jsx)(q,{bySource:Z}),(0,E.jsx)(D,{weeklyTrend:null===K||void 0===K?void 0:K.weekly_trend})]}),(0,E.jsx)("div",{className:"mb-6",children:(0,E.jsx)(W,{best:null===K||void 0===K?void 0:K.best_performing_symbols,worst:null===K||void 0===K?void 0:K.worst_performing_symbols})}),(0,E.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6 mb-6",children:[(0,E.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-white/10 rounded-xl p-6",children:[(0,E.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,E.jsx)(N.A,{className:"w-5 h-5 text-amber-400"}),"Accuracy by Confidence Tier"]}),(0,E.jsxs)("div",{className:"space-y-3",children:[Object.entries(Y).map(e=>{let[t,s]=e;return(0,E.jsx)(F,{tier:t,data:s},t)}),0===Object.keys(Y).length&&(0,E.jsx)("p",{className:"text-slate-500 text-center py-4",children:"No tier data available"})]})]}),(0,E.jsx)(U,{recommendations:J.recommendations})]}),(0,E.jsxs)("div",{className:"backdrop-blur-xl bg-slate-900/60 border border-white/10 rounded-xl p-6",children:[(0,E.jsxs)("h2",{className:"text-lg font-semibold text-white mb-4 flex items-center gap-2",children:[(0,E.jsx)(u.A,{className:"w-5 h-5 text-emerald-400"}),"Recent Predictions"]}),(0,E.jsxs)("div",{className:"space-y-2",children:[L.slice(0,15).map(e=>(0,E.jsx)(G,{prediction:e},e.id)),0===L.length&&(0,E.jsx)("p",{className:"text-slate-500 text-center py-8",children:"No predictions recorded yet"})]})]})]})]})}},67010(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]])}
2,73062(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},76245(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},77819(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},85347(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]])},87147(e,t,s){s.d(t,{A:()=>a});const a=(0,s(77784).A)("percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]])}}]); 3//# sourceMappingURL=332.94a0e188.chunk.js.map
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.