PageSourceSearch

https://tradeintelx.com/assets/DeepDivesTab-CwegziEh.js

js tradeintelx.com collected 2026-09-24 14:58:15 UTC 24,405 bytes, 1 lines download raw bytes

1import{o as _}from"./rolldown-runtime-ChpBd9eV.js";import{Gt as q,La as O,Ta as z,Yt as H,cn as V,da as $,ha as G,lt as T,mt as K,pn as S,rn as D,un as Q}from"./chat-page-evUfHQgD.js";import{Qn as I}from"./community-page-CrngAMw5.js";import{Z as F,g as E}from"./icons-vendor-Td9zWZcy.js";import{r as W}from"./trading-charts-lGr1u8E1.js";var u=_(O(),1),e=z(),p=i=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(i||0),P=i=>i?i instanceof Date?i:typeof i?.toDate=="function"?i.toDate():new Date(i):new Date,N=({title:i,icon:m,children:y,defaultExpanded:f=!0,badge:v,gradient:o="from-blue-600/20 to-indigo-600/20"})=>{const[x,h]=(0,u.useState)(f);return(0,e.jsxs)("div",{className:`bg-gradient-to-br ${o} rounded-2xl border border-slate-700/40 overflow-hidden`,children:[(0,e.jsxs)("button",{onClick:()=>h(!x),className:"w-full p-4 flex items-center justify-between hover:bg-white/5 transition",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[m&&(0,e.jsx)("div",{className:"p-1.5 bg-white/10 rounded-lg flex-shrink-0",children:(0,e.jsx)(m,{className:"w-4 h-4 text-white/80"})}),(0,e.jsx)("span",{className:"font-bold text-white",children:i}),v&&(0,e.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs bg-white/15 text-white/90 font-semibold",children:v})]}),(0,e.jsx)(V,{className:`w-4 h-4 text-white/50 transition-transform ${x?"rotate-180":""}`})]}),(0,e.jsx)(G,{initial:!1,children:x&&(0,e.jsx)($.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2,ease:"easeInOut"},children:(0,e.jsx)("div",{className:"px-4 pb-4 pt-0 border-t border-white/10",children:y})})})]})},Y=({type:i,title:m,description:y,value:f,trend:v})=>{const o={success:{bg:"bg-emerald-500/20",border:"border-emerald-500/30",icon:Q,iconColor:"text-emerald-400"},warning:{bg:"bg-amber-500/20",border:"border-amber-500/30",icon:H,iconColor:"text-amber-400"},danger:{bg:"bg-red-500/20",border:"border-red-500/30",icon:q,iconColor:"text-red-400"},info:{bg:"bg-blue-500/20",border:"border-blue-500/30",icon:I,iconColor:"text-blue-400"}},x=o[i]||o.info,h=x.icon;return(0,e.jsx)("div",{className:`${x.bg} border ${x.border} rounded-xl p-4 hover:brightness-110 transition`,children:(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)("div",{className:`p-1.5 rounded-lg ${x.bg} flex-shrink-0 mt-0.5`,children:(0,e.jsx)(h,{className:`w-4 h-4 ${x.iconColor}`})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,e.jsx)("h4",{className:"font-bold text-white text-sm",children:m}),f&&(0,e.jsx)("span",{className:`font-black text-sm ${v==="up"?"text-emerald-400":v==="down"?"text-red-400":"text-white"}`,children:f})]}),(0,e.jsx)("p",{className:"text-xs text-slate-400 mt-1 leading-relaxed",children:y})]})]})})},se=({trades:i})=>{const[m,y]=(0,u.useState)("overview"),[f,v]=(0,u.useState)("all"),o=t=>Number.isFinite(t)?t:0,x=(0,u.useMemo)(()=>{const t=new Map;return i.forEach(s=>{const a=[];Array.isArray(s.tags)&&a.push(...s.tags),s.setup&&s.setup!=="Unknown"&&a.push(`setup:${s.setup}`),s.entryEmotion&&a.push(`emotion:${s.entryEmotion}`),s.marketCondition&&a.push(`market:${s.marketCondition}`),a.length===0&&a.push("untagged"),a.forEach(l=>{const d=String(l).toLowerCase().trim();t.has(d)||t.set(d,{name:d,trades:[],totalPL:0,wins:0,losses:0});const c=t.get(d);c.trades.push(s),c.totalPL+=o(s.pl),o(s.pl)>0?c.wins++:o(s.pl)<0&&c.losses++})}),Array.from(t.values()).map(s=>({...s,count:s.trades.length,winRate:s.trades.length>0?s.wins/s.trades.length:0,avgPL:s.trades.length>0?s.totalPL/s.trades.length:0,category:s.name.includes(":")?s.name.split(":")[0]:"tag"})).sort((s,a)=>Math.abs(a.totalPL)-Math.abs(s.totalPL))},[i]),h=(0,u.useMemo)(()=>{const t=new Map;for(let s=0;s<24;s++)t.set(s,{hour:s,trades:[],totalPL:0,wins:0,losses:0});return i.forEach(s=>{const a=P(s.entryTime).getHours(),l=t.get(a);l&&(l.trades.push(s),l.totalPL+=o(s.pl),o(s.pl)>0?l.wins++:o(s.pl)<0&&l.losses++)}),Array.from(t.values()).map(s=>({...s,count:s.trades.length,winRate:s.trades.length>0?s.wins/s.trades.length:0,label:`${s.hour}:00`}))},[i]),n=(0,u.useMemo)(()=>{const t=[...i].sort((r,g)=>
1P(r.entryTime)-P(g.entryTime)),s=t.filter(r=>o(r.pl)<0),a=s.length>0?Math.abs(s.reduce((r,g)=>r+o(g.pl),0)/s.length):100;let l=0;const d=t.map((r,g)=>{const M=parseFloat(r.entryPrice)||parseFloat(r.entry)||0,U=parseFloat(r.stopLoss)||parseFloat(r.stop)||M,B=Math.abs(parseFloat(r.positionSize)||parseFloat(r.quantity)||1);let L=Math.abs(M-U)*B;(L===0||!Number.isFinite(L))&&(L=a);const A=o(r.pl)/L;return l+=A,{index:g+1,rMultiple:A,cumulativeR:l,date:P(r.entryTime).toLocaleDateString(),symbol:r.ticker||r.symbol||"N/A",pl:o(r.pl)}}),c=d.length>0?l/d.length:0,b=d.filter(r=>r.rMultiple>0),k=d.filter(r=>r.rMultiple<0);return{data:d,avgR:c,totalR:l,bigWins:d.filter(r=>r.rMultiple>=2).length,bigLosses:d.filter(r=>r.rMultiple<=-1.5).length,avgWinR:b.length>0?b.reduce((r,g)=>r+g.rMultiple,0)/b.length:0,avgLossR:k.length>0?k.reduce((r,g)=>r+g.rMultiple,0)/k.length:0}},[i]),j=(0,u.useMemo)(()=>{const t=new Map;return i.forEach(s=>{const a=(s.ticker||s.symbol||"Unknown").toUpperCase();t.has(a)||t.set(a,{symbol:a,trades:[],totalPL:0,wins:0,losses:0});const l=t.get(a);l.trades.push(s),l.totalPL+=o(s.pl),o(s.pl)>0?l.wins++:o(s.pl)<0&&l.losses++}),Array.from(t.values()).map(s=>({...s,count:s.trades.length,winRate:s.trades.length>0?s.wins/s.trades.length:0,avgPL:s.trades.length>0?s.totalPL/s.trades.length:0})).sort((s,a)=>a.count-s.count)},[i]),w=(0,u.useMemo)(()=>{const t=new Map;return i.forEach(s=>{const a=s.setup||"Unknown";t.has(a)||t.set(a,{setup:a,trades:[],totalPL:0,wins:0,losses:0});const l=t.get(a);l.trades.push(s),l.totalPL+=o(s.pl),o(s.pl)>0?l.wins++:o(s.pl)<0&&l.losses++}),Array.from(t.values()).map(s=>({...s,count:s.trades.length,winRate:s.trades.length>0?s.wins/s.trades.length:0,avgPL:s.trades.length>0?s.totalPL/s.trades.length:0,profitFactor:s.losses>0?s.totalPL>0?s.totalPL/Math.abs(s.trades.filter(a=>o(a.pl)<0).reduce((a,l)=>a+o(l.pl),0)):0:s.totalPL>0?999:0})).filter(s=>s.count>=2).sort((s,a)=>a.winRate-s.winRate)},[i]),C=(0,u.useMemo)(()=>{const t=[],s=x.filter(c=>c.count>=3&&c.category!=="tag").sort((c,b)=>b.totalPL-c.totalPL)[0];s&&s.totalPL>0&&t.push({type:"success",title:`"${s.name}" is profitable`,description:`${s.count} trades with ${(s.winRate*100).toFixed(0)}% win rate`,value:p(s.totalPL),trend:"up"});const a=x.filter(c=>c.count>=3&&c.category!=="tag").sort((c,b)=>c.totalPL-b.totalPL)[0];a&&a.totalPL<0&&t.push({type:"danger",title:`"${a.name}" is losing money`,description:"Consider avoiding or reviewing this pattern",value:p(a.totalPL),trend:"down"});const l=h.filter(c=>c.count>=3).sort((c,b)=>b.winRate-c.winRate)[0];l&&l.winRate>.5&&t.push({type:"info",title:`Best hour: ${l.label}`,description:`${(l.winRate*100).toFixed(0)}% win rate with ${l.count} trades`,value:p(l.totalPL)}),n.bigWins>n.bigLosses?t.push({type:"success",title:"Good risk management",description:`${n.bigWins} big wins (2R+) vs ${n.bigLosses} big losses`,value:`${n.totalR.toFixed(1)}R total`}):n.bigLosses>0&&t.push({type:"warning",title:"Watch your big losses",description:`${n.bigLosses} trades lost more than 1.5R`,value:`Avg loss: ${n.avgLossR.toFixed(2)}R`});const d=j[0];return d&&d.count>=5&&t.push({type:d.totalPL>0?"success":"warning",title:`${d.symbol} is your most traded`,description:`${d.count} trades, ${(d.winRate*100).toFixed(0)}% win rate`,value:p(d.totalPL),trend:d.totalPL>0?"up":"down"}),t},[x,h,n,j]),R=({value:t,icon:s,children:a})=>(0,e.jsxs)("button",{onClick:()=>y(t),className:`flex items-center gap-2 px-3 py-2 rounded-xl text-sm font-semibold transition-all ${m===t?"bg-blue-600 text-white shadow-lg shadow-blue-500/25":"bg-slate-800/80 text-slate-400 hover:bg-slate-700/80 border border-slate-700/50"}`,children:[s&&(0,e.jsx)("div",{className:`p-1 rounded-md ${m===t?"bg-white/20":"bg-slate-700/60"}`,children:(0,e.jsx)(s,{className:"w-3 h-3"})}),a]});return!i||i.length===0?(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[400px] text-center p-8",children:[(0,e.jsx)("div",{className:"w-20 h-20 rounded-2xl bg-gradient-to-br from-blue-500/20 to-indigo-500/20 border border-blue-500/20 flex items-center justify-center mb-4",children:(0,e.jsx)(S,{className:"w-10 h-10 text-blue-400"})}),(0,e.jsx)("h3",{className:"text-xl font-bold text-white mb-2",children:"No Trades to Analyze"}),(0,e.jsx)("p",{className:"text-slate-400 max-w-sm",children:"Log some trades to see deep dive analytics including R-multiples, tag analysis, and time-of-day performance."})]}):(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsxs)("div",{className:"relative overflow-hidden bg-gradient-to-br from-blue-900/30 via-slate-900/50 to-indigo-900/20 border border-blue-500/20 rounded-2xl p-5",children:[(0,e.jsx)("div",{className:"absolute top-0 right-0 w-64 h-64 bg-blue-600/8 rounded-full blur-3xl -translate-y-1/3 translate-x-1/4 pointer-events-none"}),(0,e.jsxs)("div",{className:"relative flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-500/20 rounded-xl border border-blue-500/30",children:(0,e.jsx)(S,{className:"w-5 h-5 text-blue-400"})}),(0,e.jsx)("h2",{className:"text-2xl font-black text-white tracking-tight",children:"Deep Dives"}),(0,e.jsxs)("div",{className:"hidden sm:flex items-center gap-1 px-2 py-0.5 bg-blue-500/15 border border-blue-500/25 rounded-full",children:[(0,e.jsx)("div",{className:"w-1.5 h-1.5 rounded-full bg-blue-400 animate-pulse"}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-blue-400 uppercase tracking-wider",children:"Live"})]})]}),(0,e.jsxs)("p",{className:"text-slate-400 text-sm",children:[i.length," trades · ",j.length," symbols · ",w.length," setups"]})]}),(0,e.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:[{label:"Total R",value:`${n.totalR.toFixed(1)}R`,colorClass:n.totalR>=0?"text-emerald-400":"text-red-400"},{label:"Unique Tags",value:x.length,colorClass:"text-blue-400"},{label:"Symbols",value:j.length,colorClass:"text-purple-400"}
1,{label:"Best Setup",value:w[0]?.setup||"N/A",colorClass:"text-amber-400"}].map((t,s)=>(0,e.jsxs)("div",{className:"bg-slate-900/60 rounded-xl p-2.5 border border-slate-700/40 text-center",children:[(0,e.jsx)("div",{className:"text-[9px] font-bold uppercase tracking-widest text-slate-500 mb-0.5",children:t.label}),(0,e.jsx)("div",{className:`text-lg font-black truncate ${t.colorClass}`,children:t.value})]},s))})]})]}),(0,e.jsx)("div",{className:"bg-slate-900/60 rounded-2xl p-4 border border-slate-700/50",children:(0,e.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,e.jsx)(R,{value:"overview",icon:K,children:"Overview"}),(0,e.jsx)(R,{value:"tags",icon:T,children:"Tag Analysis"}),(0,e.jsx)(R,{value:"rmultiple",icon:F,children:"R-Multiple"}),(0,e.jsx)(R,{value:"time",icon:D,children:"Time Analysis"}),(0,e.jsx)(R,{value:"symbols",icon:E,children:"Symbols"})]})}),m==="overview"&&(0,e.jsxs)("div",{className:"space-y-6",children:[(0,e.jsx)(N,{title:"Key Insights",icon:I,badge:`${C.length} findings`,gradient:"from-purple-600/20 to-indigo-600/20",children:(0,e.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:C.map((t,s)=>(0,e.jsx)(Y,{...t},s))})}),(0,e.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3",children:[(0,e.jsxs)($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:0},className:"bg-slate-900/60 rounded-2xl p-4 border border-slate-700/40",children:[(0,e.jsx)("div",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest mb-2",children:"Total R Earned"}),(0,e.jsxs)("div",{className:`text-2xl font-black ${n.totalR>=0?"text-emerald-400":"text-red-400"}`,children:[n.totalR.toFixed(1),"R"]})]}),(0,e.jsxs)($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.05},className:"bg-slate-900/60 rounded-2xl p-4 border border-slate-700/40",children:[(0,e.jsx)("div",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest mb-2",children:"Unique Tags"}),(0,e.jsx)("div",{className:"text-2xl font-black text-blue-400",children:x.length})]}),(0,e.jsxs)($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.1},className:"bg-slate-900/60 rounded-2xl p-4 border border-slate-700/40",children:[(0,e.jsx)("div",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest mb-2",children:"Symbols Traded"}),(0,e.jsx)("div",{className:"text-2xl font-black text-purple-400",children:j.length})]}),(0,e.jsxs)($.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:.15},className:"bg-slate-900/60 rounded-2xl p-4 border border-slate-700/40",children:[(0,e.jsx)("div",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest mb-2",children:"Best Setup"}),(0,e.jsx)("div",{className:"text-lg font-black text-amber-400 truncate",children:w[0]?.setup||"N/A"})]})]}),w.length>0&&(0,e.jsx)(N,{title:"Setup Effectiveness",icon:F,badge:`${w.length} setups`,gradient:"from-amber-600/20 to-orange-600/20",children:(0,e.jsx)("div",{className:"overflow-x-auto",children:(0,e.jsxs)("table",{className:"w-full text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"border-b border-slate-700/50",children:[(0,e.jsx)("th",{className:"text-left p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Setup"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Trades"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Win Rate"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Avg P/L"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Total P/L"})]})}),(0,e.jsx)("tbody",{children:w.slice(0,8).map((t,s)=>(0,e.jsxs)("tr",{className:"border-b border-slate-700/30 hover:bg-white/3 transition group",children:[(0,e.jsx)("td",{className:"p-3",children:(0,e.jsx)("span",{className:"font-semibold text-white text-sm",children:t.setup})}),(0,e.jsx)("td",{className:"p-3 text-right",children:(0,e.jsx)("span",{className:"text-xs text-slate-400 bg-slate-800/60 px-2 py-0.5 rounded-lg",children:t.count})}),(0,e.jsx)("td",{className:"p-3 text-right",children:(0,e.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,e.jsx)("div",{className:"w-14 h-1.5 bg-slate-700/50 rounded-full overflow-hidden hidden sm:block",children:(0,e.jsx)("div",{className:`h-full rounded-full ${t.winRate>=.5?"bg-emerald-500":"bg-red-500"}`,style:{width:`${(t.winRate*100).toFixed(0)}%`}})}),(0,e.jsxs)("span",{className:`text-xs font-bold ${t.winRate>=.5?"text-emerald-400":"text-red-400"}`,children:[(t.winRate*100).toFixed(0),"%"]})]})}),(0,e.jsx)("td",{className:`p-3 text-right text-sm ${t.avgPL>=0?"text-emerald-400":"text-red-400"}`,children:p(t.avgPL)}),(0,e.jsx)("td",{className:`p-3 text-right font-bold ${t.totalPL>=0?"text-emerald-400":"text-red-400"}`,children:p(t.totalPL)})]},s))})]})})})]}),m==="tags"&&(0,e.jsxs)(N,{title:"Tag-Based P&L Analysis",icon:T,badge:`${x.length} tags`,gradient:"from-purple-600/20 to-pink-600/20",defaultExpanded:!0,children:[(0,e.jsx)("div",{className:"flex flex-wrap gap-2 mb-4 pt-3",children:["all","setup","emotion","market","tag"].map(t=>(0,e.jsx)("button",{onClick:()=>v(t),className:`px-3 py-1.5 text-xs font-semibold rounded-lg transition ${f===t?"bg-purple-600 text-white shadow-md shadow-purple-500/25":"bg-slate-800/60 text-slate-400 hover:bg-slate-700/80 border border-slate-700/50"}`,children:t.charAt(0).toUpperCase()+t.slice(1)},t))}),(0,e.jsx)("div",{className:"overflow-x-auto",children:(0,e.jsxs)("table",{className:"w-full text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"border-b border-slate-700/50",children:[(0,e.jsx)("th",{className:"text-left p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Tag"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Trades"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Win Rate"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Avg P/L"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Total P/L"})]})}),(0,e.jsx)("tbody",{children:x.filter(t=>f==="all"||t.category===f).slice(0,20).map((t,s)=>(0,e.jsxs)("tr",{className:"border-b border-slate-700/30 hover:bg-white/3 transition",children:[(0,e.jsxs)("td",{className:"p-3",children:[(0,e.jsx)("span",{className:"text-[10px] bg-slate-700/80 text-slate-400 px-2 py-0.5 rounded-md mr-2 font-semibold",children:t.category}),(0,e.jsx)("span",{className:"font-semibold text-white text-sm",children:t.name.split(":").pop()})]}),(0,e.jsx)("td",{className:"p-3 text-right",children:(0,e.jsx)("span",{className:"text-xs text-slate-400 bg-slate-800/60 px-2 py-0.5 rounded-lg",children:t.count})}),(0,e.jsx)("td",{className:"p-3 text-right",children:(0,e.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,e.jsx)("div",{className:"w-14 h-1.5 bg-slate-700/50 rounded-full overflow-hidden hidden sm:block",children:(0,e.jsx)("div",{className:`h-full rounded-full ${t.winRate>=.5?"bg-emerald-500":"bg-red-500"}`,style:{width:`${(t.winRate*100).toFixed(0)}%`}})}),(0,e.jsxs)("span",{className:`text-xs font-bold ${t.winRate>=.5?"text-emerald-400":"text-red-400"}`,children:[(t.winRate*100).toFixed(0),"%"]})]})}),(0,e.jsx)("td",{className:`p-3 text-right text-sm ${t.avgPL>=0?"text-emerald-400":"text-red-400"}`,children:p(t.avgPL)}),(0,e.jsx)("td",{className:`p-3 text-right font-bold ${t.totalPL>=0?"text-emerald-400":"text-red-400"}`,children:p(t.totalPL)})]},s))})]})})]}),m==="rmultiple"&&(0,e.jsxs)(N,{title:"R-Multiple Over Time",icon:F,badge:`${n.totalR.toFixed(1)}
1R total`,gradient:"from-amber-600/20 to-yellow-600/20",defaultExpanded:!0,children:[(0,e.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-3 mb-6 pt-2",children:[{label:"Average R",value:`${n.avgR.toFixed(2)}R`,colorClass:n.avgR>=0?"text-emerald-400":"text-red-400"},{label:"Big Wins (2R+)",value:n.bigWins,colorClass:"text-emerald-400"},{label:"Big Losses (-1.5R)",value:n.bigLosses,colorClass:"text-red-400"},{label:"Avg Win R",value:`${n.avgWinR.toFixed(2)}R`,colorClass:"text-emerald-400"}].map((t,s)=>(0,e.jsxs)("div",{className:"bg-slate-900/60 rounded-xl p-3 border border-slate-700/40 text-center",children:[(0,e.jsx)("div",{className:"text-[10px] font-bold text-slate-500 uppercase tracking-widest mb-1",children:t.label}),(0,e.jsx)("div",{className:`text-xl font-black ${t.colorClass}`,children:t.value})]},s))}),(0,e.jsx)("div",{className:"h-80",children:(0,e.jsx)(W,{data:{labels:n.data.map(t=>t.index),datasets:[{type:"bar",label:"Individual R",data:n.data.map(t=>t.rMultiple),backgroundColor:n.data.map(t=>t.rMultiple>0?"rgba(34, 197, 94, 0.6)":"rgba(239, 68, 68, 0.6)"),borderRadius:4,yAxisID:"y"},{type:"line",label:"Cumulative R",data:n.data.map(t=>t.cumulativeR),borderColor:"rgb(251, 191, 36)",backgroundColor:"rgba(251, 191, 36, 0.1)",fill:!0,tension:.4,yAxisID:"y1"}]},options:{responsive:!0,maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},scales:{x:{title:{display:!0,text:"Trade #",color:"#94a3b8"},grid:{color:"rgba(75, 85, 99, 0.3)"}},y:{type:"linear",position:"left",title:{display:!0,text:"Individual R",color:"#94a3b8"},grid:{color:"rgba(75, 85, 99, 0.3)"}},y1:{type:"linear",position:"right",title:{display:!0,text:"Cumulative R",color:"#fbbf24"},grid:{drawOnChartArea:!1}}},plugins:{tooltip:{callbacks:{title:t=>`Trade #${t[0].dataIndex+1}`,label:t=>{const s=n.data[t.dataIndex];return t.datasetIndex===0?[`R: ${s.rMultiple.toFixed(2)}`,`P/L: ${p(s.pl)}`,`Symbol: ${s.symbol}`]:`Cumulative: ${s.cumulativeR.toFixed(2)}R`}}}}}})})]}),m==="time"&&(0,e.jsxs)(N,{title:"Time of Day Analysis",icon:D,badge:"24-hour breakdown",gradient:"from-cyan-600/20 to-blue-600/20",defaultExpanded:!0,children:[(0,e.jsx)("div",{className:"h-64 mb-6",children:(0,e.jsx)(W,{data:{labels:h.filter(t=>t.count>0).map(t=>t.label),datasets:[{label:"P/L by Hour",data:h.filter(t=>t.count>0).map(t=>t.totalPL),backgroundColor:h.filter(t=>t.count>0).map(t=>t.totalPL>0?"rgba(34, 197, 94, 0.6)":"rgba(239, 68, 68, 0.6)"),borderRadius:4}]},options:{responsive:!0,maintainAspectRatio:!1,plugins:{legend:{display:!1}},scales:{y:{ticks:{callback:t=>p(t)},grid:{color:"rgba(75, 85, 99, 0.3)"}},x:{grid:{color:"rgba(75, 85, 99, 0.3)"}}}}})}),(0,e.jsx)("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2",children:h.filter(t=>t.count>0).map((t,s)=>(0,e.jsxs)("div",{className:`p-3 rounded-xl border transition hover:brightness-110 ${t.totalPL>=0?"bg-emerald-500/8 border-emerald-500/25":"bg-red-500/8 border-red-500/25"}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,e.jsx)("div",{className:"font-bold text-white text-sm",children:t.label}),(0,e.jsxs)("span",{className:"text-[10px] text-slate-500 bg-slate-800/60 px-1.5 py-0.5 rounded",children:[t.count,"t"]})]}),(0,e.jsx)("div",{className:`text-base font-black ${t.totalPL>=0?"text-emerald-400":"text-red-400"}`,children:p(t.totalPL)}),(0,e.jsxs)("div",{className:"mt-1.5",children:[(0,e.jsx)("div",{className:"h-1 bg-slate-700/50 rounded-full overflow-hidden",children:(0,e.jsx)("div",{className:`h-full rounded-full ${t.winRate>=.5?"bg-emerald-500/60":"bg-red-500/60"}`,style:{width:`${(t.winRate*100).toFixed(0)}%`}})}),(0,e.jsxs)("div",{className:"text-[9px] text-slate-500 mt-0.5",children:[(t.winRate*100).toFixed(0),"% WR"]})]})]},s))})]}),m==="symbols"&&(0,e.jsx)(N,{title:"Symbol Performance",icon:E,badge:`${j.length} symbols`,gradient:"from-green-600/20 to-emerald-600/20",defaultExpanded:!0,children:(0,e.jsx)("div",{className:"overflow-x-auto",children:(0,e.jsxs)("table",{className:"w-full text-sm",children:[(0,e.jsx)("thead",{children:(0,e.jsxs)("tr",{className:"border-b border-slate-700/50",children:[(0,e.jsx)("th",{className:"text-left p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Symbol"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Trades"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Win Rate"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Avg P/L"}),(0,e.jsx)("th",{className:"text-right p-3 text-[10px] font-bold text-slate-500 uppercase tracking-widest",children:"Total P/L"})]})}),(0,e.jsx)("tbody",{children:j.slice(0,20).map((t,s)=>(0,e.jsxs)("tr",{className:"border-b border-slate-700/30 hover:bg-white/3 transition",children:[(0,e.jsx)("td",{className:"p-3",children:(0,e.jsx)("span",{className:"font-black text-white",children:t.symbol})}),(0,e.jsx)("td",{className:"p-3 text-right",children:(0,e.jsx)("span",{className:"text-xs text-slate-400 bg-slate-800/60 px-2 py-0.5 rounded-lg",children:t.count})}),(0,e.jsx)("td",{className:"p-3 text-right",children:(0,e.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,e.jsx)("div",{className:"w-14 h-1.5 bg-slate-700/50 rounded-full overflow-hidden hidden sm:block",children:(0,e.jsx)("div",{className:`h-full rounded-full ${t.winRate>=.5?"bg-emerald-500":"bg-red-500"}`,style:{width:`${(t.winRate*100).toFixed(0)}%`}})}),(0,e.jsxs)("span",{className:`text-xs font-bold ${t.winRate>=.5?"text-emerald-400":"text-red-400"}`,children:[(t.winRate*100).toFixed(0),"%"]})]})}),(0,e.jsx)("td",{className:`p-3 text-right text-sm ${t.avgPL>=0?"text-emerald-400":"text-red-400"}`,children:p(t.avgPL)}),(0,e.jsx)("td",{className:`p-3 text-right font-bold ${t.totalPL>=0?"text-emerald-400":"text-red-400"}`,children:p(t.totalPL)})]},s))})]})})})]})};export{se 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.