1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/pdf-vendor-DEz_NppF.js","assets/chartjs-vendor-CJ58C3gX.js","assets/rolldown-runtime-ChpBd9eV.js","assets/chat-page-C-flp553.js","assets/chat-page-BXqTKTIP.css","assets/date-vendor-BjneNXXN.js"])))=>i.map(i=>d[i]); 2import{o as de}from"./rolldown-runtime-ChpBd9eV.js";import{An as ke,Ar as Ce,Cn as Re,Di as Te,En as ne,Et as Le,Ka as $e,Pa as Pe,Pi as Ie,Tr as Ae,Va as Fe,Wa as Ee,Yt as _e,ba as Z,ki as Me,kn as Oe,mt as We,nt as De,rn as ze,tt as ce,un as B,vt as xe,wa as me,wn as Be,zi as Ue}from"./chat-page-C-flp553.js";import{Qr as Ve,Xr as He,Yr as qe,Zr as Ye}from"./market-core-B8Bfud51.js";import{Wn as Ge,fr as W,sr as Ke}from"./community-page-dub7UFXa.js";import{wt as Qe}from"./education-page-Buqr-MLV.js";var d=de($e(),1),e=Pe(),pe=390,Xe=693,q=(i,g=2)=>i==null?"â":Number(i).toFixed(g),Ze=i=>i>=0?`+${q(i)}%`:`${q(i)}%`,he=i=>i==null?"â":i>=0?`+$${q(Math.abs(i))}`:`-$${q(Math.abs(i))}`,oe=i=>i>=80?"#22c55e":i>=60?"#f59e0b":"#ef4444",Je=(i={})=>{const g=String(i.accountType||i.type||"").toLowerCase();if(g==="paper"||i.provider==="paper")return"PAPER ACCOUNT";if(g==="evaluation_account")return"EVALUATION ACCOUNT";if(g==="funded_account")return"FUNDED ACCOUNT";const $=String(i.env||i.environment||"").toLowerCase();return["live","prod","production"].includes($)?"LIVE ACCOUNT":["demo","staging","stg"].includes($)?"DEMO ACCOUNT":"ACCOUNT TYPE NOT IDENTIFIED"};function et({session:i,username:g}){const{date:$=new Date,pnl:n=0,pnlPct:b=0,wins:h=0,losses:j=0,disciplineScore:p=100,violations:k=[],topSetup:C,accountContext:E}=i,R=h+j,y=R>0?Math.round(h/R*100):0,v=n>=0,D=new Date($).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"});return(0,e.jsxs)("div",{style:{width:pe,height:Xe,background:"linear-gradient(160deg, #0d0d12 0%, #111118 60%, #130a14 100%)",borderRadius:24,overflow:"hidden",fontFamily:'-apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif',position:"relative",display:"flex",flexDirection:"column",padding:28,boxSizing:"border-box"},children:[(0,e.jsx)("div",{style:{position:"absolute",top:-60,right:-60,width:240,height:240,background:"radial-gradient(circle, rgba(218,11,63,0.18) 0%, transparent 70%)",pointerEvents:"none"}}),(0,e.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:24},children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:4},children:[(0,e.jsx)("div",{style:{width:8,height:8,borderRadius:"50%",background:"#da0b3f"}}),(0,e.jsx)("span",{style:{color:"#da0b3f",fontSize:13,fontWeight:700,letterSpacing:"0.08em",textTransform:"uppercase"},children:"Redline"})]}),(0,e.jsx)("div",{style:{color:"rgba(255,255,255,0.35)",fontSize:12},children:D})]}),(0,e.jsx)("div",{style:{background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.08)",borderRadius:10,padding:"4px 12px",color:"rgba(255,255,255,0.5)",fontSize:12},children:g||"Redline Trader"})]}),(0,e.jsxs)("div",{style:{marginBottom:28},children:[(0,e.jsx)("div",{style:{color:"rgba(255,255,255,0.55)",fontSize:11,fontWeight:700,letterSpacing:"0.08em",marginBottom:8},children:Je(E)}),(0,e.jsx)("div",{style:{color:"rgba(255,255,255,0.4)",fontSize:13,marginBottom:6},children:"Session P/L"}),(0,e.jsx)("div",{style:{fontSize:52,fontWeight:800,letterSpacing:"-0.02em",color:v?"#22c55e":"#ef4444",lineHeight:1.1},children:he(n)}),(0,e.jsx)("div",{style:{color:v?"#22c55e":"#ef4444",fontSize:18,fontWeight:600,marginTop:4},children:Ze(b)})]}),(0,e.jsx)("div",{style:{display:"flex",gap:12,marginBottom:24},children:[{label:"Trades",value:R},{label:"Win Rate",value:`${y}%`},{label:"Wins",value:h,color:"#22c55e"},{label:"Losses",value:j,color:"#ef4444"}].map(T=>(0,e.jsxs)("div",{style:{flex:1,background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.07)",borderRadius:14,padding:"12px 8px",textAlign:"center"},children:[(0,e.jsx)("div",{style:{color:T.color||"#fff",fontSize:20,fontWeight:700},children:T.value}),(0,e.jsx)("div",{style:{color:"rgba(255,255,255,0.35)",fontSize:11,marginTop:3},children:T.label})]},T.label))}),(0,e.jsxs)("div",{style:{background:"rgba(255,255,255,0.03)",border:"1px solid rgba(255,255,255,0.07)",borderRadius:16,padding:"16px 20px",marginBottom:16,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{style:{color:"rgba(255,255,255,0.45)",fontSize:12,marginBottom:4},children:"Discipline Score"}),(0,e.jsxs)("div",{style:{fontSize:32,fontWeight:800,color:oe(p)},children:[p,(0,e.jsx)("span",{style:{fontSize:16,fontWeight:500,color:"rgba(255,255,255,0.4)",marginLeft:4},children:"/100"})]})]}),(0,e.jsxs)("svg",{width:56,height:56,viewBox:"0 0 56 56",children:[(0,e.jsx)("circle",{cx:28,cy:28,r:23,fill:"none",stroke:"rgba(255,255,255,0.08)",strokeWidth:5}),(0,e.jsx)("circle",{cx:28,cy:28,r:23,fill:"none",stroke:oe(p),strokeWidth:5,strokeDasharray:`${p/100*144.5} 144.5`,strokeDashoffset:36,strokeLinecap:"round",transform:"rotate(-90 28 28)"})]})]}),k.length>0&&(0,e.jsxs)("div",{style:{marginBottom:16},children:[(0,e.jsx)("div",{style:{color:"rgba(255,255,255,0.35)",fontSize:11,marginBottom:8,textTransform:"uppercase",letterSpacing:"0.06em"},children:"Violations today"}),(0,e.jsxs)("div",{style:{display:"flex",flexWrap:"wrap",gap:6},children:[k.slice(0,4).map((T,U)=>(0,e.jsx)("div",{style:{background:"rgba(239,68,68,0.12)",border:"1px solid rgba(239,68,68,0.25)",borderRadius:20,padding:"4px 10px",color:"#f87171",fontSize:11,fontWeight:500},children:typeof T=="string"?T:T.type||T.violationType||"Violation"},U)),k.length>4&&(0,e.jsxs)("div",{style:{background:"rgba(255,255,255,0.05)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:20,padding:"4px 10px",color:"rgba(255,255,255,0.4)",fontSize:11},children:["+",k.length-4," more"]})]})]}),C&&(0,e.jsxs)("div",{style:{background:"rgba(34,197,94,0.06)",border:"1px solid rgba(34,197,94,0.15)",borderRadius:14,padding:"12px 16px",marginBottom:16,display:"flex",alignItems:"center",gap:10},children:[(0,e.jsx)("div",{style:{fontSize:18},children:"ð¯"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{style:{color:"rgba(255,255,255,0.4)",fontSize:11,marginBottom:2},children:"Best setup today"}),(0,e.jsx)("div",{style:{color:"#fff",fontSize:13,fontWeight:600},children:C})]})]}),(0,e.jsxs)("div",{style:{marginTop:"auto",display:"flex",justifyContent:"center",alignItems:"center",gap:6},children:[(0,e.jsx)("div",{style:{width:6,height:6,borderRadius:"50%",background:"rgba(218,11,63,0.6)"}}),(0,e.jsx)("span",{style:{color:"rgba(255,255,255,0.2)",fontSize:11,letterSpacing:"0.04em"},children:"redlineos.com · Trading with discipline"})]})]})}function tt({session:i,username:g,onClose:$}){const n=(0,d.useRef)(null),[b,h]=(0,d.useState)("idle"),j=async(p=!1)=>
2{if(n.current){h("generating");try{const{default:k}=await Ee(async()=>{const{default:y}=await import("./pdf-vendor-DEz_NppF.js").then(v=>de(v.r(),1));return{default:y}},__vite__mapDeps([0,1,2,3,4,5])),C=await k(n.current,{backgroundColor:null,scale:2,useCORS:!0,logging:!1}),E=await new Promise(y=>C.toBlob(y,"image/png",1));if(!E)throw new Error("Canvas to blob failed");const R=`redline-session-${new Date().toISOString().slice(0,10)}.png`;if(p||!navigator.share){const y=URL.createObjectURL(E),v=document.createElement("a");v.href=y,v.download=R,v.click(),URL.revokeObjectURL(y)}else{const y=new File([E],R,{type:"image/png"});await navigator.share({title:"My Redline session",text:`${i?.pnl>=0?"ð":"ð"} ${he(i?.pnl)} session on Redline. Discipline score: ${i?.disciplineScore??100}/100`,files:[y]})}h("done")}catch(k){console.error("[ShareCard] Capture failed:",k),h("error")}}};return(0,e.jsx)(me,{children:(0,e.jsx)(Z.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-[9999] flex items-end justify-center pb-6 pt-4",style:{background:"rgba(0,0,0,0.85)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",paddingBottom:"max(1.5rem, env(safe-area-inset-bottom))"},children:(0,e.jsxs)(Z.div,{initial:{y:60,opacity:0},animate:{y:0,opacity:1},exit:{y:60,opacity:0},transition:{type:"spring",stiffness:320,damping:30},className:"flex flex-col items-center gap-4 w-full max-w-sm px-4",children:[(0,e.jsx)("div",{ref:n,style:{borderRadius:24,overflow:"hidden",boxShadow:"0 32px 80px rgba(0,0,0,0.7)",width:pe,maxWidth:"100%",transform:"scale(0.88)",transformOrigin:"top center",marginBottom:-40},children:(0,e.jsx)(et,{session:i,username:g})}),(0,e.jsxs)("div",{className:"flex gap-3 w-full",children:["share"in navigator?(0,e.jsxs)("button",{onClick:()=>j(!1),disabled:b==="generating",className:"flex-1 flex items-center justify-center gap-2 py-4 rounded-2xl bg-[#da0b3f] hover:bg-[#c0082f] text-white font-semibold text-sm transition-all disabled:opacity-60",children:[b==="generating"?(0,e.jsx)("div",{className:"w-4 h-4 border-2 border-white/40 border-t-white rounded-full animate-spin"}):(0,e.jsx)(xe,{className:"w-4 h-4"}),b==="generating"?"Renderingâ¦":"Share"]}):null,(0,e.jsxs)("button",{onClick:()=>j(!0),disabled:b==="generating",className:"flex items-center justify-center gap-2 px-5 py-4 rounded-2xl bg-white/[0.06] hover:bg-white/[0.1] border border-white/[0.1] text-white font-semibold text-sm transition-all disabled:opacity-60",children:[(0,e.jsx)(Oe,{className:"w-4 h-4"}),"Save"]}),(0,e.jsx)("button",{onClick:$,className:"flex items-center justify-center px-4 py-4 rounded-2xl bg-white/[0.04] hover:bg-white/[0.08] border border-white/[0.08] text-white/50 hover:text-white transition-all",children:(0,e.jsx)(ce,{className:"w-4 h-4"})})]}),b==="done"&&(0,e.jsx)("p",{className:"text-xs text-white/40 text-center",children:"Card shared!"}),b==="error"&&(0,e.jsx)("p",{className:"text-xs text-red-400 text-center",children:"Could not generate card. Try again."})]})})})}var st={NO_STOP_LOSS:{id:"stop-loss-101",title:"Stop Loss Fundamentals",duration:"5 min",description:"Learn why stop losses are essential for risk management"},OVERTRADING:{id:"overtrading-psych",title:"Why We Overtrade",duration:"7 min",description:"Understanding the psychology behind overtrading"},FOMO_ENTRY:{id:"fomo-control",title:"Controlling FOMO",duration:"6 min",description:"Techniques to avoid fear of missing out trades"},BAD_RR:{id:"risk-reward-basics",title:"Risk/Reward Basics",duration:"8 min",description:"Master the fundamentals of risk to reward ratios"},REVENGE_TRADE:{id:"revenge-trading",title:"Breaking the Revenge Cycle",duration:"10 min",description:"How to stop revenge trading after losses"},PLAN_DEVIATION:{id:"trading-rules",title:"Building Your Trading Rules",duration:"8 min",description:"Creating and following consistent trading rules"}};function xt({isOpen:i,onClose:g,onBeforeSave:$,sessionData:n}){const b=Fe(),{user:h}=Ae(),{trades:j}=Ke(),[p,k]=(0,d.useState)(""),[C,E]=(0,d.useState)(""),[R,y]=(0,d.useState)(""),[v,D]=(0,d.useState)(!1),[T,U]=(0,d.useState)(!1),[rt,J]=(0,d.useState)(!1),[ue,ee]=(0,d.useState)(!1),[A,Y]=(0,d.useState)([]),V=(0,d.useRef)(null);(0,d.useEffect)(()=>
2{if(!i)return;U(!1),J(!1);const t=V.current;if(!t)return;const s=()=>J(t.scrollHeight>t.clientHeight+20),r=new ResizeObserver(s);return r.observe(t),s(),()=>r.disconnect()},[i,n]);const ge=()=>{V.current&&V.current.scrollTop>30&&U(!0)},[P,te]=(0,d.useState)([]),[I,se]=(0,d.useState)([]),[at,it]=(0,d.useState)(!1),G=n?.tradingRules?.customRules||[],K=n?.playbookSetups||[],N=n?.sessionStart,S=n?.stats,Q=n?.durationMinutes,a=(0,d.useMemo)(()=>{if(S&&((S.tradesCount||0)>0||(S.wins||0)>0||(S.losses||0)>0||(S.totalPL||0)!==0))return console.log("[EndOfDaySummary] Using passedStats:",S),S;const t=n?.sessionId;if(!N&&!t)return console.log("[EndOfDaySummary] No sessionStart or sessionId, returning null"),null;const s=N?N instanceof Date?N:new Date(N):null,r=(j||[]).filter(c=>{if(t&&c.sessionId===t)return!0;if(!s)return!1;const L=c.entryTime instanceof Date?c.entryTime:new Date(c.entryTime);return!isNaN(L.getTime())&&L>=s});console.log("[EndOfDaySummary] Fallback recompute: found",r.length,"trades from",(j||[]).length,"total");const l=r.filter(c=>c.status==="closed"||c.exitPrice),o=l.filter(c=>W(c)>0),x=l.filter(c=>W(c)<0),u=l.reduce((c,L)=>c+W(L),0),w=[];r.forEach(c=>{c.stopLoss||w.push("NO_STOP_LOSS"),c.followedRules===!1&&w.push("PLAN_DEVIATION"),c.mainViolationCodes?.length&&w.push(...c.mainViolationCodes)}),r.length>5&&w.push("OVERTRADING");const F=[...new Set(w)];return{tradesCount:r.length,wins:o.length,losses:x.length,totalPL:u,winRate:l.length>0?(o.length/l.length*100).toFixed(1):0,violations:F,avgWin:o.length>0?o.reduce((c,L)=>c+W(L),0)/o.length:0,avgLoss:x.length>0?Math.abs(x.reduce((c,L)=>c+W(L),0))/x.length:0}},[j,N,S,n?.sessionId]),_=a?.violations?.[0]?st[a.violations[0]]:null,f=(0,d.useMemo)(()=>{if(S?.sessionTrades?.length>0)return S.sessionTrades;const t=n?.sessionId,s=N?N instanceof Date?N:new Date(N):null;return(j||[]).filter(r=>{if(t&&r.sessionId===t)return!0;if(!s)return!1;const l=r.entryTime instanceof Date?r.entryTime:new Date(r.entryTime);return!isNaN(l.getTime())&&l>=s})},[S,j,n?.sessionId,N]);(0,d.useEffect)(()=>{const t=h?.uid,s=n?.sessionId;if(!i||!t||!s){Y([]);return}return Te(Me(Ue(Ce,"users",t,"enforcementEvents"),Ie("sessionId","==",s)),r=>{Y(r.docs.map(l=>({id:l.id,...l.data()})))},()=>Y([]))},[i,n?.sessionId,h?.uid]);const O=(0,d.useMemo)(()=>({violations:new Set(A.map(t=>t.violationType)).size,positionsClosed:A.filter(t=>(t.action==="position_closed"||t.action==="account_flattened")&&t.status!=="failed").length,ordersCancelled:A.filter(t=>t.action==="order_cancelled"&&t.status!=="failed").length,restrictions:A.filter(t=>t.action==="cooldown_started"||t.action==="trading_locked").length,failures:A.filter(t=>t.status==="failed").length,remainingOpen:f.filter(t=>t.status==="open"||t.status==null&&t.exitTime==null&&t.exitPrice==null).length}),[A,f]),m=(0,d.useMemo)(()=>{const t=n?.preMarketChecklist;if(!t)return null;const s=t.items||[],r=t.checkedItems||{},l=u=>{if(!u)return!1;if(typeof u.checked=="boolean")return u.checked;const w=u.id!=null?r[u.id]:void 0;if(typeof w=="boolean")return w;const F=u.key!=null?r[u.key]:void 0;return typeof F=="boolean"?F:!1},o=s.length>0?s.length:Object.keys(r).length;if(o===0)return null;const x=s.length>0?s.filter(l).length:Object.values(r).filter(Boolean).length;return{completed:x,total:o,pct:Math.round(x/o*100),items:s.map(u=>({...u,checked:l(u)})),checkedItems:r}},[n?.preMarketChecklist]),M=(0,d.useMemo)(()=>{if(!f||f.length===0)return null;const t=f.filter(x=>x.stopLoss||x.stopLossPrice).length,s=f.filter(x=>x.takeProfit||x.takeProfitPrice||x.target).length,r=f.filter(x=>x.followedRules!==!1&&x.followedPlan!==!1).length,l=f.filter(x=>x.setup||x.strategy).length,o=f.length;return{stopLoss:{count:t,total:o,pct:Math.round(t/o*100)},takeProfit:{count:s,total:o,pct:Math.round(s/o*100)},followedPlan:{count:r,total:o,pct:Math.round(r/o*100)},hadSetup:{count:l,total:o,pct:Math.round(l/o*100)},overallScore:Math.round((t+r+l)/(o*3)*100)}},[f]),[fe,re]=(0,d.useState)(null),[ae,ie]=(0,d.useState)(!1),[be,ye]=(0,d.useState)(!1),[H,we]=(0,d.useState)([]);(0,d.useEffect)(()=>{!i||!h?.uid||qe.getTodayCooldowns(h.uid).then(we).catch(()=>{})},[i,h?.uid]);const je=async()=>
2{if(!(ae||!a||a.tradesCount===0)){ie(!0),ye(!0);try{const t=await Ye(h?.uid),s=await He({stats:a,duration:Q,marketContext:n?.marketContext,checklistCompliance:m?{completed:m.completed,total:m.total,pct:m.pct}:null,tradeRuleCompliance:M||null,rulesFollowed:P,setupsUsed:I,sessionNotes:R||null},t);re(s.feedback),n?.sessionId&&await Ve(h?.uid,n.sessionId,s)}catch(t){console.error("AI feedback generation failed:",t),re("Unable to generate AI feedback. Please try again later.")}finally{ie(!1)}}},X=(0,d.useMemo)(()=>a?a.totalPL>0&&a.violations?.length===0?"great":a.totalPL>0?"good":a.totalPL<0&&a.violations?.length>0?"rough":a.totalPL<0?"loss":"neutral":"neutral",[a]),le={great:{emoji:"ð¥",title:"Excellent Session!",subtitle:"Profitable and disciplined trading"},good:{emoji:"â
",title:"Good Session",subtitle:"Profitable, but some areas to improve"},neutral:{emoji:"ð",title:"Session Complete",subtitle:"Review your trades and plan tomorrow"},loss:{emoji:"ð",title:"Tough Day",subtitle:"Losses happen. Learn and improve."},rough:{emoji:"â ï¸",title:"Review Needed",subtitle:"Some violations to address"}},ve=()=>{_&&(g(),b(`/education?video=${_.id}`))},z=p.trim().length>=20&&C.trim().length>0,Ne=async()=>{if(!(!h||!z)){D(!0);try{if($&&!await $()){D(!1);return}await Qe.saveDailyClosure(h.uid,{sessionId:n?.sessionId,stats:a,violationType:a?.violations?.[0]||null,videoId:_?.id||null,videoTitle:_?.title||null,reflection:p,tomorrowPlan:C,sessionNotes:R,keyLessons:[],endingMood:X,rulesFollowed:P,setupsUsed:I,preMarketChecklist:n?.preMarketChecklist||{},checklistCompliance:m?{completed:m.completed,total:m.total,pct:m.pct}:null,tradeRuleCompliance:M||null}),g(),b("/trade-analytics")}catch(t){console.error("Failed to save reflection:",t)}finally{D(!1)}}},Se=t=>{if(!t)return"N/A";const s=Math.floor(t/60),r=t%60;return s>0?`${s}h ${r}m`:`${r}m`};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(me,{mode:"wait",children:i&&(0,e.jsxs)(Z.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{type:"spring",damping:32,stiffness:280,mass:.85},drag:"y",dragConstraints:{top:0},dragElastic:{top:0,bottom:.25},onDragEnd:(t,{offset:s,velocity:r})=>{(s.y>120||r.y>600)&&g()},className:["fixed bottom-0 inset-x-0 z-[80]","flex flex-col","bg-[#1C1C1E]","rounded-t-[28px]","shadow-[0_-12px_60px_rgba(0,0,0,0.7),0_-2px_8px_rgba(0,0,0,0.45)]","border-t border-white/[0.07]","sm:inset-x-auto sm:left-1/2 sm:-translate-x-1/2","sm:bottom-6 sm:w-[430px]","sm:rounded-[24px] sm:border sm:border-white/[0.1]"].join(" "),style:{maxHeight:"92svh"},children:[(0,e.jsx)("div",{className:"flex justify-center pt-[14px] pb-1 flex-shrink-0",children:(0,e.jsx)("div",{className:"w-9 h-[5px] rounded-full bg-white/[0.22]"})}),(0,e.jsxs)("div",{className:"px-5 pt-2 pb-4 flex-shrink-0 border-b border-white/[0.07]",children:[(0,e.jsxs)("div",{className:"flex items-start justify-between",children:[(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("span",{className:"text-[32px] leading-none",children:le[X].emoji}),(0,e.jsxs)("div",{children:[(0,e.jsx)("h2",{className:"text-[17px] font-semibold text-white leading-snug",children:le[X].title}),(0,e.jsx)("p",{className:"text-[13px] text-gray-400 mt-0.5",children:new Date().toLocaleDateString("en-US",{weekday:"long",month:"short",day:"numeric"})})]})]}),(0,e.jsx)("button",{onClick:g,className:"w-8 h-8 flex items-center justify-center rounded-full bg-white/[0.08] hover:bg-white/[0.14] transition mt-0.5 flex-shrink-0","aria-label":"Close",children:(0,e.jsx)(ce,{className:"w-4 h-4 text-gray-300"})})]}),(0,e.jsx)("div",{className:"mt-3 grid grid-cols-4 gap-2",children:[{value:(a?.totalPL||0)>=0?`+$${Math.abs(a?.totalPL||0).toFixed(0)}`:`-$${Math.abs(a?.totalPL||0).toFixed(0)}`,label:"P&L",color:(a?.totalPL||0)>=0?"text-emerald-400":"text-red-400"},{value:`${a?.winRate||0}%`,label:"Win Rate",color:Number(a?.winRate||0)>=50?"text-emerald-400":"text-amber-400"},{value:a?.tradesCount||0,label:"Trades",color:"text-blue-400"},{value:m?`${m.pct}%`:"â",label:"Checklist",color:m?m.pct===100?"text-emerald-400":m.pct>=50?"text-amber-400":"text-red-400":"text-gray-500"}].map(({value:t,label:s,color:r})=>(0,e.jsxs)("div",{className:"bg-white/[0.06] rounded-2xl px-2 py-2.5 text-center",children:[(0,e.jsx)("div",{className:`text-[16px] font-bold leading-tight ${r}`,children:t}),(0,e.jsx)("div",{className:"text-[10px] text-gray-500 uppercase tracking-wide mt-0.5",children:s})]},s))})]}),(0,e.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto overscroll-contain",ref:V,onScroll:ge,children:[Q&&(0,e.jsx)("div",{className:"flex justify-center pt-4",children:(0,e.jsxs)("div",{className:"flex items-center gap-1.5 px-3 py-1.5 bg-white/[0.05] rounded-full",children:[(0,e.jsx)(ze,{className:"w-3.5 h-3.5 text-gray-500"}),(0,e.jsx)("span",{className:"text-[12px] text-gray-400",children:Se(Q)})]})}),(0,e.jsxs)("div",{className:"px-5 pt-4 pb-5 border-b border-white/[0.06]",children:[(0,e.jsxs)("div",{className:"flex items-center justify-center gap-8",children:[(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("div",{className:"text-[28px] font-bold text-emerald-400 leading-none",children:a?.wins||0}),(0,e.jsx)("div",{className:"text-[11px] text-gray-500 uppercase tracking-wide mt-1",children:"Wins"})]}),(0,e.jsx)("div",{className:"w-px h-10 bg-white/10"}),(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("div",{className:"text-[28px] font-bold text-red-400 leading-none",children:a?.losses||0}),(0,e.jsx)("div",{className:"text-[11px] text-gray-500 uppercase tracking-wide mt-1",children:"Losses"})]}),(a?.avgWin>0||a?.avgLoss>0)&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"w-px h-10 bg-white/10"}),(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("div",{className:"text-[22px] font-bold text-gray-200 leading-none",children:a?.avgLoss>0?(a.avgWin/a.avgLoss).toFixed(2):"â"}),(0,e.jsx)("div",{className:"text-[11px] text-gray-500 uppercase tracking-wide mt-1",children:"RR"})]})]})]}),(a?.avgWin>0||a?.avgLoss>0)&&(0,e.jsxs)("div",{className:"flex justify-center gap-6 mt-3 text-[13px]",children:[(0,e.jsxs)("span",{className:"text-gray-500",children:["Avg Win ",(0,e.jsxs)("span",{className:"text-emerald-400 font-medium",children:["$",a.avgWin?.toFixed(0)||0]})]}),(0,e.jsxs)("span",{className:"text-gray-500",children:["Avg Loss ",(0,e.jsxs)("span",{className:"text-red-400 font-medium",children:["$",a.avgLoss?.toFixed(0)||0]})]})]})]}),M&&(0,e.jsxs)("div",{className:"px-5 pt-5 pb-5 border-b border-white/[0.06]",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-widest mb-3",children:"Discipline"}),(0,e.jsx)("div",{className:"space-y-3",children:[{label:"Stop Loss Set",data:M.stopLoss,icon:"ð¡ï¸"},{label:"Take Profit Set",data:M.takeProfit,icon:"ð¯"},{label:"Followed Plan",data:M.followedPlan,icon:"ð"},{label:"Had Setup",data:M.hadSetup,icon:"ð"}].map(({label:t,data:s,icon:r})=>(0,e.jsxs)("div",{className:"flex items-center gap-3",children:[(0,e.jsx)("span",{className:"text-sm w-5 text-center",children:r}),(0,e.jsxs)("div",{className:"flex-1",children:[(0,e.jsxs)("div",{className:"flex justify-between mb-1",children:[(0,e.jsx)("span",{className:"text-[13px] text-gray-300",children:t}),(0,e.jsxs)("span",{className:`text-[13px] font-medium ${s.pct===100?"text-emerald-400":s.pct>=50?"text-amber-400":"text-red-400"}`,children:[s.count,"/",s.total]})]}),(0,e.jsx)("div",{className:"h-[3px] bg-white/[0.08] rounded-full overflow-hidden",children:(0,e.jsx)("div",{className:`h-full rounded-full transition-all duration-700 ${s.pct===100?"bg-emerald-500":s.pct>=50?"bg-amber-500":"bg-red-500"}`,style:{width:`${s.pct}%`}})})]})]},t))})]}),m&&(0,e.jsxs)("div",{className:"px-5 pt-5 pb-5 border-b border-white/[0.06]",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-widest",children:"Pre-Session Checklist"}),(0,e.jsxs)("span",{className:`text-[12px] font-bold px-2.5 py-0.5 rounded-full ${m.pct===100?"bg-emerald-500/20 text-emerald-400":m.pct>=50?"bg-amber-500/20 text-amber-400":"bg-red-500/20 text-red-400"}`,children:[m.completed,"/",m.total]})]}),(0,e.jsx)("div",{className:"space-y-1.5",children:(m.items.length>0?m.items:Object.entries(m.checkedItems).map(([t,s])=>({id:t,checked:s,text:t.replace(/_/g," ").replace(/\b\w/g,r=>r.toUpperCase())}))).map((t,s)=>(0,e.jsxs)("div",{className:"flex items-center gap-2.5 py-1",children:[t.checked?(0,e.jsx)(B,{className:"w-4 h-4 text-emerald-400 flex-shrink-0"}):(0,e.jsx)(De,{className:"w-4 h-4 text-red-400 flex-shrink-0"}),(0,e.jsx)("span",{className:`text-[13px] ${t.checked?"text-gray-300":"text-gray-500 line-through"}`,children:t.text||t.label||t.id})]},t.id||s))})]}),(0,e.jsxs)("div",{className:"px-5 pt-5 pb-5 border-b border-white/[0.06]",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-widest mb-3",children:"AI Analysis"}),be?ae?(0,e.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-purple-500/10 rounded-2xl",children:[(0,e.jsx)("div",{className:"w-5 h-5 border-2 border-purple-400/30 border-t-purple-400 rounded-full animate-spin flex-shrink-0"}),(0,e.jsx)("span",{className:"text-[14px] text-gray-400",children:"Analyzing your session..."})]}):(0,e.jsx)("div",{className:"p-4 bg-purple-500/10 rounded-2xl border border-purple-500/20",children:(0,e.jsx)("p",{className:"text-[14px] text-gray-200 leading-relaxed whitespace-pre-line",children:fe})}):(0,e.jsxs)("button",{onClick:je,disabled:!a||a.tradesCount===0,className:"w-full flex items-center gap-3 p-4 bg-white/[0.05] rounded-2xl hover:bg-white/[0.09] transition active:scale-[0.98] disabled:opacity-40 disabled:pointer-events-none",children:[(0,e.jsx)("div",{className:"w-10 h-10 flex items-center justify-center bg-purple-500/20 rounded-xl flex-shrink-0",children:(0,e.jsx)(We,{className:"w-5 h-5 text-purple-400"})}),(0,e.jsxs)("div",{className:"text-left",children:[(0,e.jsx)("div",{className:"text-[15px] font-medium text-white",children:"Get AI Coaching"}),(0,e.jsx)("div",{className:"text-[12px] text-gray-500 mt-0.5",children:"Personalized feedback on your session"})]}),(0,e.jsx)(ne,{className:"w-4 h-4 text-gray-600 ml-auto flex-shrink-0"})]})]}),a?.violations?.length>0?(0,e.jsxs)("div",{className:"px-5 pt-5 pb-5 border-b border-white/[0.06]",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-widest mb-3",children:"Areas to Improve"}),(0,e.jsx)("div",{className:"space-y-2",children:a.violations.slice(0,5).map((t,s)=>(0,e.jsxs)("div",{className:"flex items-center gap-3 p-3 bg-amber-500/10 rounded-xl border border-amber-500/20",children:[(0,e.jsx)(_e,{className:"w-4 h-4 text-amber-400 flex-shrink-0"}),(0,e.jsx)("span",{className:"text-[13px] text-amber-200",children:t.replace(/_/g," ")})]},s))}),_&&(0,e.jsxs)("button",{onClick:ve,className:"mt-3 w-full flex items-center gap-3 p-3 bg-white/[0.05] rounded-xl hover:bg-white/[0.09] transition active:scale-[0.98]",children:[(0,e.jsx)(ke,{className:"w-5 h-5 text-blue-400 flex-shrink-0"}),(0,e.jsxs)("div",{className:"text-left flex-1 min-w-0",children:[(0,e.jsx)("div",{className:"text-[14px] text-white font-medium",children:_.title}),(0,e.jsxs)("div",{className:"text-[11px] text-gray-500",children:[_.duration," · Homework video"]})]}),(0,e.jsx)(ne,{className:"w-4 h-4 text-gray-600 flex-shrink-0"})]})]}):a?.tradesCount>0?(0,e.jsx)("div",{className:"px-5 pt-5 pb-5 border-b border-white/[0.06]",children:(0,e.jsxs)("div",{className:"flex items-center gap-3 p-4 bg-emerald-500/10 rounded-2xl border border-emerald-500/20",children:[(0,e.jsx)(B,{className:"w-6 h-6 text-emerald-400 flex-shrink-0"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("div",{className:"text-[15px] font-semibold text-emerald-300",children:"Clean Trading Day"}),(0,e.jsx)("div",{className:"text-[12px] text-gray-500",children:"No major violations detected"})]})]})}):null,(G.length>0||K.length>0)&&(0,e.jsxs)("div",{className:"px-5 pt-5 pb-5 border-b border-white/[0.06]",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-widest mb-3",children:"Rules & Setups Followed"}),(0,e.jsxs)("div",{className:"space-y-3",children:[G.length>0&&(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"text-[12px] text-gray-500 block mb-2",children:"Which rules did you follow?"}),(0,e.jsx)("div",{className:"space-y-1.5 max-h-36 overflow-y-auto",children:G.map((t,s)=>{const r=t.id||t.content,l=P.includes(r);return(0,e.jsxs)("label",{className:`flex items-center gap-2.5 p-3 rounded-xl cursor-pointer transition-all text-[13px] ${l?"bg-emerald-500/15 border border-emerald-500/30 text-emerald-300":"bg-white/[0.04] border border-white/[0.08] text-gray-400"}`,children:[(0,e.jsx)("input",{type:"checkbox",checked:l,onChange:o=>{o.target.checked?te([...P,r]):te(P.filter(x=>x!==r))},className:"w-4 h-4 rounded border-gray-600 bg-gray-700 text-emerald-500 focus:ring-emerald-500/50"}),(0,e.jsx)("span",{className:"line-clamp-1",children:t.content||t.name||t})]},r||s)})})]}),K.length>0&&(0,e.jsxs)("div",{children:[(0,e.jsx)("label",{className:"text-[12px] text-gray-500 block mb-2",children:"Which setups did you use?"}),(0,e.jsx)("div",{className:"flex flex-wrap gap-2",children:K.map((t,s)=>{const r=t.id||t.name,l=I.includes(r);return(0,e.jsx)("button",{onClick:()=>{se(l?I.filter(o=>o!==r):[...I,r])},className:`px-3 py-1.5 rounded-xl text-[12px] font-medium transition-all ${l?"bg-blue-500/20 border border-blue-500/40 text-blue-300":"bg-white/[0.04] border border-white/[0.08] text-gray-400"}`,children:t.name},r||s)})})]}),(P.length>0||I.length>0)&&(0,e.jsxs)("div",{className:"flex gap-4 text-[12px] text-gray-500 pt-1 border-t border-white/[0.06]",children:[P.length>0&&(0,e.jsxs)("span",{className:"flex items-center gap-1",children:[(0,e.jsx)(B,{className:"w-3.5 h-3.5 text-emerald-400"}),P.length," rule",P.length>
21?"s":""]}),I.length>0&&(0,e.jsxs)("span",{className:"flex items-center gap-1",children:[(0,e.jsx)(B,{className:"w-3.5 h-3.5 text-blue-400"}),I.length," setup",I.length>1?"s":""]})]})]})]}),(0,e.jsxs)("div",{className:"border-b border-white/[0.06] px-5 py-5",children:[(0,e.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-widest text-gray-500",children:"Redline Enforcement"}),(0,e.jsx)("span",{className:"rounded-full bg-indigo-500/15 px-2 py-0.5 text-[11px] font-medium text-indigo-300",children:n?.tradingRules?"Rules activated":"No rule snapshot"})]}),(0,e.jsx)("div",{className:"grid grid-cols-3 gap-2",children:[["Violations",O.violations],["Closed",O.positionsClosed],["Orders cancelled",O.ordersCancelled],["Cooldowns / locks",O.restrictions],["Broker failures",O.failures],["Still open",O.remainingOpen]].map(([t,s])=>(0,e.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.035] p-2.5 text-center",children:[(0,e.jsx)("div",{className:`text-lg font-black ${t==="Broker failures"&&s>0?"text-red-400":"text-white"}`,children:s}),(0,e.jsx)("div",{className:"mt-0.5 text-[9px] font-semibold uppercase tracking-wide text-gray-500",children:t})]},t))}),A.length>0&&(0,e.jsx)("div",{className:"mt-3 max-h-48 space-y-2 overflow-y-auto",children:A.map(t=>{const s=f.find(r=>r.id===t.tradeId);return(0,e.jsxs)("button",{type:"button",onClick:()=>b("/trade-logger"),className:"flex min-h-11 w-full items-center justify-between gap-3 rounded-xl border border-white/[0.07] bg-slate-950/50 px-3 py-2 text-left",children:[(0,e.jsxs)("span",{className:"min-w-0",children:[(0,e.jsxs)("span",{className:"block truncate text-[13px] font-bold text-white",children:[s?.ticker||s?.symbol||"Account action",t.action==="position_closed"||t.action==="account_flattened"?" â Closed by Redline":""]}),(0,e.jsxs)("span",{className:"block truncate text-[11px] text-gray-500",children:["Reason: ",String(t.violationType||t.ruleId).replaceAll("_"," ")]})]}),(0,e.jsx)("span",{className:t.status==="failed"?"text-[11px] font-bold text-red-400":"text-[11px] font-bold text-indigo-300",children:t.status==="failed"?"Failed":"View receipt"})]},t.id)})})]}),f.length>0&&(0,e.jsxs)("div",{className:"px-5 pt-5 pb-5 border-b border-white/[0.06]",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-widest",children:"Session Trades"}),(0,e.jsxs)("span",{className:"text-[12px] text-gray-500",children:[f.length," trade",f.length!==1?"s":""]})]}),(0,e.jsx)("div",{className:"space-y-2 max-h-56 overflow-y-auto pr-0.5",children:f.map((t,s)=>{const r=W(t),l=r>0,o=r<0,x=t.ticker||t.symbol||t.asset||"â",u=(t.direction||t.side||"").toUpperCase(),w=t.entryPrice||t.entry||null,F=t.exitPrice||t.exit||null,c=t.setup||t.strategy||null,L=t.status||"open";return(0,e.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-xl border ${l?"bg-emerald-500/[0.07] border-emerald-500/20":o?"bg-red-500/[0.07] border-red-500/20":"bg-white/[0.04] border-white/[0.08]"}`,children:[(0,e.jsx)("div",{className:`p-1.5 rounded-lg flex-shrink-0 ${l?"bg-emerald-500/15":o?"bg-red-500/15":"bg-white/[0.06]"}`,children:l?(0,e.jsx)(Re,{className:"w-4 h-4 text-emerald-400"}):o?(0,e.jsx)(Be,{className:"w-4 h-4 text-red-400"}):(0,e.jsx)(Ge,{className:"w-4 h-4 text-gray-400"})}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("span",{className:"text-[14px] font-semibold text-white",children:x}),u&&(0,e.jsx)("span",{className:`text-[10px] font-bold px-1.5 py-0.5 rounded-md ${u==="LONG"||u==="BUY"?"bg-emerald-500/20 text-emerald-400":"bg-red-500/20 text-red-400"}`,children:u==="BUY"?"L":u==="SELL"?"S":u.charAt(0)}),L!=="closed"&&(0,e.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-md bg-amber-500/20 text-amber-400",children:"OPEN"})]}),(w||F)&&(0,e.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[w&&(0,e.jsxs)("span",{className:"text-[11px] text-gray-500",children:["$",Number(w).toFixed(2)]}),F&&(0,e.jsxs)("span",{className:"text-[11px] text-gray-500",children:["â $",Number(F).toFixed(2)]})]}),c&&(0,e.jsx)("div",{className:"text-[11px] text-gray-500 mt-0.5",children:c})]}),(0,e.jsxs)("div",{className:`text-[15px] font-bold flex-shrink-0 ${l?"text-emerald-400":o?"text-red-400":"text-gray-400"}`,children:[l?"+":"",r!==0?`$${Math.abs(r).toFixed(2)}`:"â"]})]},t.id||s)})})]}),H.length>0&&(0,e.jsxs)("div",{className:"px-5 pt-5 pb-5 border-b border-white/[0.06]",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-widest",children:"Cooldowns Today"}),(0,e.jsx)("span",{className:"px-2 py-0.5 bg-orange-500/20 text-orange-300 text-[11px] font-medium rounded-full",children:H.length})]}),(0,e.jsx)("div",{className:"space-y-2",children:H.map((t,s)=>{const r=t.startedAt?.toDate?t.startedAt.toDate():new Date(t.startedAt),l=t.status==="completed";return(0,e.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-xl border ${l?"bg-emerald-500/5 border-emerald-500/20":"bg-orange-500/5 border-orange-500/20"}`,children:[(0,e.jsx)("div",{className:`w-2 h-2 rounded-full flex-shrink-0 ${l?"bg-emerald-400":"bg-orange-400 animate-pulse"}`}),(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"text-[13px] text-white font-medium truncate",children:t.reason||t.violationType||"Behavioral cooldown"}),(0,e.jsxs)("p",{className:"text-[11px] text-gray-500",children:[r.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})," · ",t.durationMinutes||"?"," min"]})]}),(0,e.jsx)("span",{className:`text-[11px] font-medium px-2 py-0.5 rounded-full flex-shrink-0 ${l?"bg-emerald-500/20 text-emerald-300":"bg-orange-500/20 text-orange-300"}`,children:l?"Done":"Active"})]},t.id||s)})}),(0,e.jsxs)("p",{className:"text-[11px] text-gray-600 mt-2",children:["Total: ",H.reduce((t,s)=>t+(s.durationMinutes||0),0)," min of cooldown"]})]}),(0,e.jsxs)("div",{className:"px-5 pt-5 pb-5 border-b border-white/[0.06]",children:[(0,e.jsx)("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-widest mb-3",children:"Session Notes"}),(0,e.jsx)("textarea",{value:R,onChange:t=>y(t.target.value),placeholder:"Market conditions, emotions, observations...",className:"w-full px-4 py-3 bg-white/[0.05] border border-white/[0.08] rounded-2xl text-[14px] text-white placeholder-gray-600 resize-none focus:outline-none focus:ring-2 focus:ring-blue-500/40 focu
2s:border-blue-500/40 transition",rows:3})]}),(0,e.jsxs)("div",{className:"px-5 pt-5 pb-8",children:[(0,e.jsxs)("p",{className:"text-[11px] font-semibold text-gray-500 uppercase tracking-widest mb-3",children:["Daily Reflection ",(0,e.jsx)("span",{className:"text-red-400/70",children:"*"})]}),(0,e.jsxs)("div",{className:"space-y-3",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("label",{className:"text-[12px] text-gray-500 block mb-1.5",children:["What did you learn today? ",(0,e.jsx)("span",{className:"text-gray-600",children:"(min 20 chars)"})]}),(0,e.jsx)("textarea",{value:p,onChange:t=>k(t.target.value),placeholder:"Key takeaways from today's session...",className:`w-full px-4 py-3 bg-white/[0.05] border rounded-2xl text-[14px] text-white placeholder-gray-600 resize-none focus:outline-none focus:ring-2 transition ${p.trim().length>0&&p.trim().length<20?"border-amber-500/50 focus:ring-amber-500/40":p.trim().length>=20?"border-emerald-500/40 focus:ring-emerald-500/40":"border-white/[0.08] focus:ring-blue-500/40"}`,rows:3}),p.trim().length>0&&p.trim().length<20&&(0,e.jsxs)("p",{className:"text-[11px] text-amber-400 mt-1.5",children:[20-p.trim().length," more characters needed"]}),p.trim().length>=20&&(0,e.jsx)("p",{className:"text-[11px] text-emerald-400 mt-1.5",children:"â Reflection complete"})]}),(0,e.jsxs)("div",{children:[(0,e.jsxs)("label",{className:"text-[12px] text-gray-500 block mb-1.5",children:["Tomorrow's focus ",(0,e.jsx)("span",{className:"text-red-400/70",children:"*"})]}),(0,e.jsx)("input",{type:"text",value:C,onChange:t=>E(t.target.value),placeholder:"What will you focus on tomorrow?",className:`w-full px-4 py-3 bg-white/[0.05] border rounded-2xl text-[14px] text-white placeholder-gray-600 focus:outline-none focus:ring-2 transition ${C.trim().length>0?"border-emerald-500/40 focus:ring-emerald-500/40":"border-white/[0.08] focus:ring-blue-500/40"}`})]})]})]})]}),(0,e.jsxs)("div",{className:"flex-shrink-0 px-5 pt-4 border-t border-white/[0.07] bg-[#1C1C1E] space-y-2.5",style:{paddingBottom:"max(20px, env(safe-area-inset-bottom))"},children:[!z&&(0,e.jsx)("p",{className:"text-[12px] text-gray-500 text-center",children:p.trim()?p.trim().length<20?`${20-p.trim().length} more characters needed in reflection`:C.trim()?"":"Add tomorrow's focus to unlock save":"Write a reflection below to unlock save"}),(0,e.jsxs)("button",{onClick:()=>ee(!0),disabled:!a||a.tradesCount===0,className:"w-full py-3 rounded-2xl text-[14px] font-medium text-purple-300 hover:text-white bg-purple-500/[0.12] hover:bg-purple-500/[0.22] border border-purple-500/20 transition-all active:scale-[0.98] flex items-center justify-center gap-2 disabled:opacity-40 disabled:cursor-not-allowed",children:[(0,e.jsx)(xe,{className:"w-4 h-4"}),"Share Todayâs Score"]}),(0,e.jsx)("button",{onClick:Ne,disabled:v||!z,className:`w-full py-4 rounded-2xl font-semibold text-[16px] flex items-center justify-center gap-2 transition-all active:scale-[0.98] ${z?"bg-blue-500 hover:bg-blue-400 text-white shadow-lg shadow-blue-500/25":"bg-white/[0.07] text-gray-500 cursor-not-allowed"}`,children:v?(0,e.jsx)("div",{className:"w-5 h-5 border-2 border-white/30 border-t-white rounded-full animate-spin"}):z?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(B,{className:"w-5 h-5"}),"Save & View Analytics"]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(Le,{className:"w-5 h-5 opacity-60"}),"Complete Reflection to Save"]})}),(0,e.jsx)("button",{onClick:g,className:"w-full py-3.5 rounded-2xl text-[15px] font-medium text-gray-400 hover:text-white bg-white/[0.05] hover:bg-white/[0.09] transition-all active:scale-[0.98]",children:"Close without saving"})]})]},"eos-sheet")}),ue&&a&&(0,e.jsx)(tt,{session:{date:new Date,pnl:a.totalPL,pnlPct:0,wins:a.wins,losses:a.losses,disciplineScore:Math.max(0,100-(a.violations?.length||0)*10),violations:a.violations||[],accountContext:n?.accountContext||null},username:h?.displayName?`@${h.displayName.replace(/\s+/g,"")}`:void 0,onClose:()=>ee(!1)})]})}export{xt 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.