PageSourceSearch

https://stonksup.io/assets/InsiderFlowPopup-leobW9bd.js

js stonksup.io collected 2026-09-24 15:04:00 UTC 24,412 bytes, 1 lines download raw bytes

1import{z as I,aJ as le,r as $,j as n,C as ae,E as P,aF as ce,F as g,R as N,Q as de,Z as ue}from"./index-Tvz-Tq9B.js";import{U as pe}from"./UpgradeUnlockOverlay-CACDrrLp.js";function j(e){return String(e??"").trim()}function F(e){if(typeof e=="number"&&Number.isFinite(e))return e;const t=parseFloat(String(e??"").replace(/,/g,""));return Number.isFinite(t)?t:null}function he(e){const t=j(e==null?void 0:e.transactionType),r=j(e==null?void 0:e.transactionType_cn),s=j(e==null?void 0:e.shares_string),a=j(e==null?void 0:e.reportingName),i=j(e==null?void 0:e.value_string);return!t&&!r&&!s&&!a&&!i?null:{transactionType:t||null,transactionTypeCn:r||null,sharesString:s||null,reportingName:a||null,valueString:i||null,value:F(e==null?void 0:e.value)}}function U(e){var s,a;const t=(s=e.transactionType)==null?void 0:s.trim().toLowerCase(),r=(a=e.transactionTypeCn)==null?void 0:a.trim();return t==="net"||r==="净额"}function fe(e){var u,f;if(!e||typeof e!="object")return null;const t=e.recent_label;let r=null;if(t&&typeof t=="object"){const c=F(t.recent_insider_number),x=t.recent_insider_title,p=Array.isArray(x)?x.map(h=>j(h)).filter(Boolean):[];r={recentInsiderNumber:c==null?null:Math.trunc(c),recentInsiderTitle:p}}const s=Array.isArray(e.recent_stats)?e.recent_stats.map(he).filter(c=>c!=null):[],a=s.find(U),i=a?{valueString:a.valueString,value:a.value}:{valueString:j((u=e==null?void 0:e.net_stat)==null?void 0:u.value_string)||null,value:F(((f=e==null?void 0:e.net_stat)==null?void 0:f.value)??(e==null?void 0:e.net_stat))},o=Array.isArray(e.recent_key_insiders_en)?e.recent_key_insiders_en.map(c=>j(c)).filter(Boolean):[],d=Array.isArray(e.recent_key_insiders_cn)?e.recent_key_insiders_cn.map(c=>j(c)).filter(Boolean):[],l=[];if(Array.isArray(e.history_stats))for(const c of e.history_stats){const x=j(c==null?void 0:c.Month);if(!x)continue;const p={};for(const[h,y]of Object.entries(c))h==="Month"||h==="月份"||y==null||(p[h]=y);l.push({monthKey:x,monthLabelCn:j(c==null?void 0:c.月份)||null,values:p})}return{recentLabel:r,netStat:i.value==null&&!i.valueString?null:i,recentStats:s,recentKeyInsidersEn:o,recentKeyInsidersCn:d,historyRows:l}}async function ge(){const t=(await ce.get("/stable-insider-whale")).data,r=Array.isArray(t)?t:(t==null?void 0:t.items)??[];if(!r.length)return{timestamp:null,entries:[]};const s=r[0],i=(Array.isArray(s==null?void 0:s.attributes)?s.attributes:[]).map(o=>{const d=j(o==null?void 0:o.symbol).toUpperCase();if(!d)return null;const l=Array.isArray(o==null?void 0:o.insider_analysis)?o.insider_analysis[0]:o==null?void 0:o.insider_analysis;return{symbol:d,analysis:fe(l)}}).filter(o=>o!=null);return{timestamp:(s==null?void 0:s.timestamp)??null,entries:i}}function xe(e,t=!1){if(!e)return"";try{const r=e.endsWith("Z")?e:`${e}Z`;return new Date(r).toLocaleString("en-US",{month:"short",day:"numeric",...t?{hour:"2-digit",minute:"2-digit",hour12:!1}:{}})}catch{return""}}const me=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function V(e,t=!1){const r=e.split("-"),s=parseInt(r[1]??"0",10);return s<1||s>12?e:t?`${s}月`:me[s-1]}function _(e){var t,r;return((r=(t=e.analysis)==null?void 0:t.netStat)==null?void 0:r.value)??null}function ye(e){var t;return((t=e.analysis)==null?void 0:t.recentStats.find(U))??null}function H(e){var t,r,s;return((s=(r=(t=e.analysis)==null?void 0:t.netStat)==null?void 0:r.valueString)==null?void 0:s.trim())||"--"}function te(e){return H(e).replace(/\$\s+([+-])/,"$$$1")}function be(e){return te(e).replace(/^\$\s*-/,"$").replace(/^-\$/,"$").replace(/^-/,"")}function X(e){var t,r;return((r=(t=ye(e))==null?void 0:t.sharesString)==null?void 0:r.trim())||"--"}function ve(e){var r,s;const t=((s=(r=e.analysis)==null?void 0:r.recentLabel)==null?void 0:s.recentInsiderTitle)??[];return t.length?t.join(", "):"--"}function we(e,t){var s,a;const r=((a=(s=e.analysis)==null?void 0:s.recentLabel)==null?void 0:a.recentInsiderTitle)??[];return r.length?r.join(", "):t?"未披露":"Not disclosed"}function je(e,t){if(!e||!t)return e;let r=e;return r=r.replace(/^Sold\s+(.+?)\s+shares/i,"卖出 $1 股"),r=r.replace(/^Purchased\s+(.+?)\s+shares/i,"买入 $1 股"),r=r.replace(/^Bought\s+(.+?)\s+shares/i,"买入 $1 股"),r=r.replace(/^Received in-kind transfer of\
1s+(.+?)\s+shares/i,"收到实物转让 $1 股"),r=r.replace(/;\s*other disposition of\s+(.+?)\s+shares/i,";其他处置 $1 股"),r=r.replace(/\s+shares\b/gi," 股"),r=r.replace(/\.\s*$/,"。"),r}function ne(e,t){const r=_(t);return r==null?e.fg5:r<0?e.loss:e.gain}function D(e,t){const r=t.trim();return r.startsWith("-")||r.includes("$ -")?e.loss:r.startsWith("+")||r.includes("$ +")?e.gain:e.fg2}function Se(e,t){return e===1?t.medalGold:e===2?t.medalSilver:e===3?t.medalBronze:t.fg4}function T(e){const t=(e.transactionType??"").toLowerCase().trim();return t==="net"?0:t==="purchase"||t==="buy"?1:t==="sale"||t==="sell"?2:3}function $e(e,t){return e.filter(r=>{const s=_(r);return t==="net_outflow"?s!=null&&s<0:s!=null&&s>0}).sort((r,s)=>Math.abs(_(s)??0)-Math.abs(_(r)??0))}function ke({symbol:e,size:t,T:r}){const[s,a]=$.useState(!1),i={width:t,height:t,borderRadius:"50%",objectFit:"cover",flexShrink:0};return s?n.jsx("span",{style:{...i,background:r.bgInput,color:r.fg3,display:"inline-flex",alignItems:"center",justifyContent:"center",fontSize:g.xs,fontWeight:g.w400},children:e.slice(0,3)}):n.jsx("img",{src:`https://images.financialmodelingprep.com/symbol/${e}.png`,width:t,height:t,alt:e,onError:()=>a(!0),style:i})}function Ie({T:e,value:t,onChange:r}){const{t:s}=I(),a=[{value:"net_outflow",label:s("popup.insider.netOutflow","Net Outflow")},{value:"net_inflow",label:s("popup.insider.netInflow","Net Inflow")}];return n.jsx("div",{style:{margin:"4px 0 12px"},children:n.jsx(de,{T:e,options:a,selected:t,onSelect:r,compact:!0,ariaLabel:"Insider flow filter"})})}const ee="48px minmax(160px, 1fr) 110px 130px 14px",We=1;function Ae({T:e,rows:t,onSelect:r,isPaid:s,onOpenUpgrade:a}){const{t:i}=I(),[o,d]=$.useState(null);if(!t.length)return n.jsx(P,{T:e,msg:i("dashboard.empty.noFilterMatch","No entries match the selected filter")});const l={fontSize:13,fontWeight:g.w400,color:e.fg2},u=a??(()=>{}),f=s?t.length:We,c=(h,y,b)=>{const v=h.symbol.toUpperCase(),A=o===v,R=ne(e,h);return n.jsxs("button",{type:"button",onClick:()=>b?u():r(h),onMouseEnter:()=>d(v),onMouseLeave:()=>d(L=>L===v?null:L),style:{display:"grid",gridTemplateColumns:ee,gap:8,alignItems:"center",width:"100%",padding:"10px 14px",border:"none",borderBottom:`1px solid ${e.hairline}`,background:A&&!b?e.bgControl:"transparent",color:"inherit",cursor:"pointer",fontFamily:"inherit",textAlign:"left",transition:"background 0.12s"},children:[n.jsx("span",{style:{fontSize:13,fontWeight:g.w400,color:Se(y+1,e),fontVariantNumeric:"tabular-nums"},children:y+1}),n.jsxs("span",{style:{display:"flex",alignItems:"center",gap:10,minWidth:0},children:[n.jsx(ue,{T:e,symbol:v,size:24}),n.jsxs("span",{style:{minWidth:0},children:[n.jsx("span",{style:{display:"block",fontSize:13.5,fontWeight:g.w400,color:A?e.fg1:e.fg2,lineHeight:1.2},children:v}),n.jsx("span",{style:{display:"block",fontSize:11,color:e.fg4,lineHeight:1.2,marginTop:2,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:ve(h)})]})]}),n.jsx("span",{style:{fontSize:13,color:e.fg2,textAlign:"right",fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap"},children:X(h)}),n.jsx("span",{style:{fontSize:13,fontWeight:g.w400,color:R,fontVariantNumeric:"tabular-nums",whiteSpace:"nowrap",textAlign:"right"},children:H(h)}),n.jsx("span",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:n.jsx("svg",{width:12,height:12,viewBox:"0 0 16 16",fill:"none",style:{color:e.fg5,flexShrink:0},children:n.jsx("path",{d:"M6 4l4 4-4 4",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})})})]},v)},x=t.slice(0,f),p=t.slice(f);return n.jsxs("div",{style:{borderRadius:N.md,border:`1px solid ${e.hairline}`,background:e.bgCardAlt,overflow:"hidden"},children:[n.jsxs("div",{style:{display:"grid",gridTemplateColumns:ee,gap:8,alignItems:"center",padding:"8px 14px",borderBottom:`1px solid ${e.hairline}`},children:[n.jsx("span",{style:l,children:i("dashboard.fin.rank","Rank")}),n.jsx("span",{style:l,children:i("dashboard.fin.symbol","Symbol")}),n.jsx("span",{style:{...l,textAlign:"right"},children:i("dashboard.fin.shares","Shares")}
1),n.jsx("span",{style:{...l,textAlign:"right"},children:i("dashboard.fin.netAmount","Net Amount")}),n.jsx("span",{"aria-hidden":"true"})]}),x.map((h,y)=>c(h,y,!1)),p.length>0&&n.jsx(pe,{T:e,locked:!0,onUpgrade:u,mode:"fullRow",borderRadius:0,children:p.map((h,y)=>c(h,f+y,!0))})]})}function J({T:e,title:t}){return n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[n.jsx("span",{style:{width:3,height:15,borderRadius:2,background:e.blue,flexShrink:0}}),n.jsx("span",{style:{fontSize:13.5,fontWeight:g.w700,color:e.fg1},children:t})]})}function Le(e){var s,a,i;const t=e.trim(),r=/^\s*([^|]+)\|\s*([^:]+):\s*(.+)$/.exec(t);return r?{raw:t,date:((s=r[1])==null?void 0:s.trim())||null,actor:((a=r[2])==null?void 0:a.trim())||null,detail:((i=r[3])==null?void 0:i.trim())||null}:{raw:t,date:null,actor:null,detail:null}}function Ne(e,t){var l,u,f,c;const r=_(e)??0,s=(u=(l=e.analysis)==null?void 0:l.recentLabel)==null?void 0:u.recentInsiderNumber;if(t){const x=r<0?"净卖出":"净买入",p=be(e),h=X(e),y=s==null?"内部人员数量未知":`涉及 ${s} 位内部人员`;return`近期内部人员${x}约 ${p},对应 ${h} 股,${y}。`}const a=r<0?"sold":"bought",i=s==null?"Insiders":`${s} insider${s===1?"":"s"}`,o=((f=e.analysis)==null?void 0:f.recentKeyInsidersEn.length)||((c=e.analysis)==null?void 0:c.recentStats.length)||null,d=o?` across ${o} reported move${o===1?"":"s"}`:"";return`${i} ${a} a net ${te(e)} worth of shares${d}.`}function Re(e,t){var o,d;const r=_(e)??0,s=(d=(o=e.analysis)==null?void 0:o.recentLabel)==null?void 0:d.recentInsiderNumber;if(t){const l=r<0?"净卖出":"净买入",u=s==null?"内部人员":`${s} 位内部人员`;return`内部人员大额${l},涉及 ${u}`}const a=r<0?"net selling":"net buying",i=s==null?"insiders":`${s} insider${s===1?"":"s"}`;return`Large insider ${a} led by ${i}`}function _e({T:e,entry:t}){var x;const{t:r,i18n:s}=I(),a=(x=s.language)==null?void 0:x.toLowerCase().startsWith("zh"),i=t.analysis,o=a?(i==null?void 0:i.recentKeyInsidersCn)??[]:(i==null?void 0:i.recentKeyInsidersEn)??[],d=a?(i==null?void 0:i.recentKeyInsidersEn)??[]:(i==null?void 0:i.recentKeyInsidersCn)??[],u=(o.length?o:d).map(Le).slice(0,5),f=[r("popup.insider.date","Date"),r("popup.insider.insider","Insider"),r("popup.insider.move","Move")],c={padding:"7px 10px",fontSize:12.5,lineHeight:1.35,borderBottom:`1px solid ${e.hairline}`,verticalAlign:"top"};return n.jsxs("div",{style:{marginBottom:18},children:[n.jsx(J,{T:e,title:r("dashboard.popups.keyInsiderMoves","Key Insider Moves")}),n.jsx("div",{style:{borderRadius:N.sm,background:e.bgCardAlt,border:`1px solid ${e.hairline}`,overflow:"hidden"},children:u.length?n.jsx("div",{style:{overflowX:"auto"},children:n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",tableLayout:"auto"},children:[n.jsx("thead",{children:n.jsx("tr",{style:{background:e.bgControl},children:f.map(p=>n.jsx("th",{style:{...c,color:e.fg2,fontWeight:g.w500,textAlign:"left",whiteSpace:"nowrap"},children:p},p))})}),n.jsx("tbody",{children:u.map((p,h)=>n.jsxs("tr",{children:[n.jsx("td",{style:{...c,color:e.fg4,fontWeight:g.w400,whiteSpace:"nowrap",width:118},children:p.date??"--"}),n.jsx("td",{style:{...c,color:e.fg1,fontWeight:g.w500,minWidth:180},children:p.actor??"--"}),n.jsx("td",{style:{...c,color:e.fg2,fontWeight:g.w500,minWidth:280},children:je(p.detail??p.raw,a)})]},`${p.raw}-${h}`))})]})}):n.jsx("div",{style:{fontSize:13,color:e.fg5,padding:"12px 14px"},children:r("dashboard.empty.noKeyInsiderMoves","No key insider moves available.")})})]})}function Me({T:e,stats:t}){var d;const{t:r,i18n:s}=I(),a=(d=s.language)==null?void 0:d.toLowerCase().startsWith("zh"),i=[...t].sort((l,u)=>T(l)-T(u));if(!i.length)return n.jsx("div",{style:{fontSize:13,color:e.fg5},children:r("dashboard.empty.noTransactions","No transactions available.")});const o={padding:"7px 8px",fontSize:13,lineHeight:1.35,whiteSpace:"nowrap",borderBottom:`1px solid ${e.hairline}`};return n.jsx("div",{style:{overflowX:"auto"},children:n.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",tableLayout:"auto"},children:[n.jsx("thead",{children:n.jsx("tr",{style:{background:e.bgControl},children:[r("popup.insider.type","Type"),r("popup.insider.insider","Insider"),r("popup.insider.value","Value"),r("popup.insider.shares","Shares")].map((l,u)=>n.jsx("th",{style:{...o,color:e.fg2,fontWeight:g.w500,textAlign:u>1?"right":"left"},children:l},l))})}),n.jsx("tbody",{children:i.map((l,u)=>{const f=U(l),c=f?(l.value??0)<0?e.loss:e.gain:e.fg2,x=a?l.transactionTypeCn??l.transactionType:l.transactionType??l.transactionTypeCn;return n.jsxs("tr",{children:[n.jsx("td",{style:{...o,color:c,fontWeight:f?g.w600:g.w400},children:x?r(`popup.insider.txnType.${x}`,x):"--"}),n.jsx("td",{style:{...o,color:e.fg2},children:l.reportingName??"--"}),n.jsx("td",{style:{...o,color:c,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:l.valueString??"--"}),n.jsx("td",{style:{...o,color:e.fg2,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:l.sharesString??"--"})]},`${l.transactionType}-${l.reportingName}-${u}`)})})]})})}function Ce(e){const t=new Set;return e.forEach(r=>
1Object.keys(r.values).forEach(s=>t.add(s))),Array.from(t).sort()}function se(e,t){return e.find(r=>r.monthKey===t)??null}function O(e,t){return e?j(e.values[t]):""}function ze(e){const t=e.trim();return!t||t==="-"||t==="--"}function Be(e,t,r){return e.filter(s=>s.monthKey!=="Price"&&s.monthKey!=="Price%").map(s=>({label:r?s.monthLabelCn??s.monthKey:s.monthKey,value:O(s,t)})).filter(s=>!ze(s.value))}function Fe({T:e,month:t,price:r,pricePct:s,activities:a,left:i}){var u;const{t:o,i18n:d}=I(),l=(u=d.language)==null?void 0:u.toLowerCase().startsWith("zh");return n.jsxs("div",{style:{position:"absolute",top:12,left:i,minWidth:188,maxWidth:260,padding:"9px 10px",borderRadius:N.sm,border:`1px solid ${e.hairline}`,background:e.bgCard,boxShadow:"0 12px 30px rgba(0,0,0,0.18)",color:e.fg2,fontSize:11.5,lineHeight:1.45,pointerEvents:"none",zIndex:2},children:[n.jsx("div",{style:{color:e.fg1,fontWeight:g.w600,marginBottom:5},children:V(t,l)}),n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[n.jsx("span",{children:o("popup.insider.price","Price")}),n.jsx("span",{style:{color:e.fg1,fontVariantNumeric:"tabular-nums"},children:r||"--"})]}),s&&n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[n.jsx("span",{children:o("popup.insider.priceChange","Price %")}),n.jsx("span",{style:{color:D(e,s),fontVariantNumeric:"tabular-nums"},children:s})]}),a.length>0&&n.jsx("div",{style:{marginTop:6,paddingTop:6,borderTop:`1px solid ${e.hairline}`},children:a.map(f=>n.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:16},children:[n.jsx("span",{style:{color:e.fg4},children:f.label}),n.jsx("span",{style:{color:D(e,f.value),fontVariantNumeric:"tabular-nums",textAlign:"right"},children:f.value})]},f.label))})]})}function He({T:e,rows:t,priceRow:r,months:s,isZh:a}){const[i,o]=$.useState(null),d=560,l=210,u=48,f=20,c=12,x=34,p=d-u-f,h=l-c-x,y=s.map(m=>F(r.values[m])),b=y.filter(m=>m!=null);if(!b.length)return null;let v=Math.min(...b),A=Math.max(...b);v===A&&(v-=1,A+=1);const R=A-v,L=m=>u+(s.length>1?m/(s.length-1)*p:p/2),w=m=>c+h-(m-v)/R*h,S=s.length>1?p/(s.length-1):p,z=Math.max(16,S/2),Y=y.find(m=>m!=null),G=[...y].reverse().find(m=>m!=null),B=Y!=null&&G!=null&&G>Y?e.gain:e.loss,Q=y.map((m,k)=>m==null?null:`${k===0?"M":"L"}${L(k).toFixed(1)},${w(m).toFixed(1)}`).filter(Boolean).join(" "),re=se(t,"Price%"),Z=i==null?null:y[i],M=i==null?null:s[i],W=i==null?null:L(i),K=Z==null?null:w(Z),q=188,ie=W==null?0:W<d/2?Math.min(d-q-8,W+14):Math.max(8,W-q-14),C=M==null?null:{month:M,price:O(r,M),pricePct:O(re,M),activities:Be(t,M,a)};return n.jsxs("div",{style:{position:"relative",width:d,maxWidth:"100%",margin:"0 auto"},children:[C&&n.jsx(Fe,{T:e,month:C.month,price:C.price,pricePct:C.pricePct,activities:C.activities,left:ie}),n.jsxs("svg",{viewBox:`0 0 ${d} ${l}`,style:{width:"100%",height:l,display:"block",overflow:"visible"},onMouseLeave:()=>o(null),onMouseMove:m=>{if(s.length<2)return;const k=m.currentTarget.getBoundingClientRect(),E=(m.clientX-k.left)/k.width*d;if(E<u-z||E>u+p+z){o(null);return}const oe=(Math.max(u,Math.min(u+p,E))-u)/p;o(Math.max(0,Math.min(s.length-1,Math.round(oe*(s.length-1)))))},children:[n.jsx("line",{x1:u,y1:c+h,x2:u+p,y2:c+h,stroke:e.hairline}),n.jsx("line",{x1:u,y1:c,x2:u,y2:c+h,stroke:e.hairline}),s.map((m,k)=>n.jsx("text",{x:L(k),y:l-8,fontSize:g.xs,fill:e.fg4,textAnchor:"middle",children:V(m,a)},m)),Q&&n.jsx("path",{d:Q,fill:"none",stroke:B,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}),y.map((m,k)=>m==null?null:n.jsx("circle",{cx:L(k),cy:w(m),r:4,fill:B,opacity:i===k?1:.78},`${k}-${m}`)),i!=null&&W!=null&&n.jsx("line",{x1:W,x2:W,y1:c,y2:c+h,stroke:e.fg5,strokeWidth:1,strokeDasharray:"4,4",opacity:.7}),W!=null&&K!=null&&n.jsxs(n.Fragment,{children:[n.jsx("circle",{cx:W,cy:K,r:6,fill:B,opacity:.16}),n.jsx("circle",{cx:W,cy:K,r:4.5,fill:B,stroke:e.bgCardAlt,strokeWidth:1.5})]})]})]})}function Ke({T:e,rows:t,isZh:r}){const{t:s}=I(),a=Ce(t);if(!t.length||!a.length)return n.jsx("div",{style:{fontSize:13,color:e.fg5},children:s("dashboard.empty.noHistory","No history available.")});const i={padding:"7px 9px",fontSize:12.5,lineHeight:1.35,whiteSpace:"nowrap",borderBottom:`1px solid ${e.hairline}`};return n.jsx("div",{style:{overflowX:"auto"},children:n.jsxs("table",{style:{borderCollapse:"collapse",minWidth:"100%"},children:[n.jsx("thead",{children:n.jsxs("tr",{style:{background:e.bgControl},children:[n.jsx("th",{style:{...i,color:e.fg1,fontWeight:g.w700,textAlign:"left"},children:r?"月份":"Month"}),t.map((o,d)=>n.jsx("th",{style:{...i,color:e.fg1,fontWeight:g.w700,textAlign:"right"},children:r?o.monthLabelCn??o.monthKey:o.monthKey},`${o.monthKey}-${d}`))]})}),n.jsx("tbody",{children:a.map(o=>n.jsxs("tr",{children:[n.jsx("td",{style:{...i,color:e.fg1,fontWeight:g.w700},children:V(o,r)}),t.map((d,l)=>n.jsx("td",{style:{...i,color:e.fg2,textAlign:"right",fontVariantNumeric:"tabular-nums"},children:j(d.values[o])||"--"},`${d.monthKey}-${l}-${o}`))]},o))})]})})}function Ee({T:e,entry:t}){var s;const{t:r}=I();return n.jsxs("div",{style:{marginBottom:18},children:[n.jsx(J,{T:e,title:r("dashboard.popups.recentTransactions","Recent Transactions")}),n.jsx("div",{style:{borderRadius:N.sm,background:e.bgCardAlt,border:`1px solid ${e.hairline}`,overflow:"hidden"},children:n.jsx(Me,{T:e,stats:((s=t.analysis)==null?void 0:s.recentStats)??[]})})]})}function Pe({T:e,entry:t,isZh:r}){var d;const{t:s}=I(),a=((d=t.analysis)==null?void 0:d.historyRows)??[],i=se(a,"Price"),o=i?Object.keys(i.values).sort():[];return n.jsxs("div",{style:{marginBottom:18},children:[n.jsx(J,{T:e,title:s("dashboard.popups.history","History")}),i&&o.length>0&&n.jsxs("div",{style:{padding:"12px 14px",borderRadius:N.sm,background:e.bgCardAlt,border:`1px solid ${e.hairline}`,marginBottom:12,overflow:"visible"},children:[n.jsx("div",{style:{fontSize:12.5,color:e.fg4,lineHeight:1.45,marginBottom:10},children:s("popup.insider.historyChartDesc","Price history with monthly insider activity.")}),n.jsx(He,{T:e,rows:a,priceRow:i,months:o,isZh:r})]}),n.jsxs("div",{style:{borderRadius:N.sm,background:e.bgCardAlt,border:`1px solid ${e.hairline}`,overflow:"hidden"},children:[n.jsx("div",{style:{padding:"9px 12px",borderBottom:`1px solid ${e.hairline}
1`,fontSize:12.5,fontWeight:g.w500,color:e.fg2},children:s("popup.insider.monthlyBreakdown","Monthly Breakdown")}),n.jsx(Ke,{T:e,rows:a,isZh:r})]})]})}function Oe({T:e,entry:t,isZh:r}){var u,f,c,x;const{t:s}=I(),a=ne(e,t),i=(_(t)??0)<0,o=(f=(u=t.analysis)==null?void 0:u.recentLabel)==null?void 0:f.recentInsiderNumber,d=((x=(c=t.analysis)==null?void 0:c.recentLabel)==null?void 0:x.recentInsiderTitle)??[],l=[{label:s("popup.insider.netAmount","Net Amount"),value:H(t),tone:"flow"},{label:s("popup.insider.shares","Shares"),value:X(t)},{label:s("popup.insider.insider","Insiders"),value:o==null?"--":String(o)},{label:s("popup.insider.keyRoles","Key roles"),value:we(t,r),muted:d.length===0}];return n.jsxs("div",{style:{padding:"16px 18px",borderRadius:N.md,background:e.bgCardAlt,border:`1px solid ${e.hairline}`,marginBottom:12},children:[n.jsxs("div",{style:{minWidth:0,marginBottom:14},children:[n.jsx("div",{style:{fontSize:12.5,fontWeight:g.w600,color:e.fg4,marginBottom:8},children:i?s("popup.insider.netOutflow","Net Outflow"):s("popup.insider.netInflow","Net Inflow")}),n.jsx("div",{style:{fontSize:30,fontWeight:g.w700,color:a,lineHeight:1},children:H(t)}),n.jsx("div",{style:{fontSize:13,color:e.fg2,lineHeight:1.45,marginTop:10},children:Re(t,r)}),n.jsx("div",{style:{fontSize:12.5,color:e.fg4,lineHeight:1.45,marginTop:4},children:Ne(t,r)})]}),n.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, minmax(0, 1fr))",gap:0,minWidth:0,borderTop:`1px solid ${e.hairline}`,paddingTop:12},children:l.map((p,h)=>n.jsxs("div",{style:{minWidth:0,paddingLeft:h===0?0:14,paddingRight:h===l.length-1?0:14,borderRight:h===l.length-1?"none":`1px solid ${e.hairline}`},children:[n.jsx("div",{style:{fontSize:12,fontWeight:g.w500,color:e.fg4,marginBottom:5},children:p.label}),n.jsx("div",{style:{fontSize:14,fontWeight:g.w600,color:p.tone==="flow"?a:p.muted?e.fg5:e.fg1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:p.value})]},p.label))})]})}function Ue({T:e,entry:t,timestamp:r,onSelectSymbol:s}){var u,f;const{t:a,i18n:i}=I(),o=(u=i.language)==null?void 0:u.toLowerCase().startsWith("zh"),d=t.symbol.toUpperCase(),l=(((f=t.analysis)==null?void 0:f.historyRows)??[]).length>0;return n.jsxs("div",{children:[n.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginBottom:14},children:[n.jsx(ke,{T:e,symbol:d,size:32}),n.jsxs("div",{style:{minWidth:0,flex:1,display:"flex",alignItems:"center",gap:10,flexWrap:"wrap"},children:[n.jsx("span",{style:{fontSize:22,fontWeight:g.w700,color:e.fg1},children:d}),s&&n.jsx("button",{type:"button",onClick:()=>s(d),style:{height:24,padding:"0 9px",borderRadius:N.pill,border:`1px solid ${e.borderWeak}`,background:e.bgControl,color:e.fg2,fontSize:11.5,fontWeight:g.w500,fontFamily:"inherit",cursor:"pointer",whiteSpace:"nowrap"},children:a("dashboard.actions.openChart","Open chart")})]})]}),n.jsxs("div",{style:{fontSize:13,color:e.fg4,marginBottom:16},children:[a("dashboard.popups.updated","Updated")," ",xe(r,!0)||"--"]}),n.jsx(Oe,{T:e,entry:t,isZh:o}),n.jsx(_e,{T:e,entry:t}),n.jsx(Ee,{T:e,entry:t}),l&&n.jsx(Pe,{T:e,entry:t,isZh:o})]})}function Ye({T:e,onSelectSymbol:t,onOpenUpgrade:r,onDetailChange:s,initialDetailSymbol
1:a,onDetailSymbolChange:i}){const{t:o}=I(),d=le(),[l,u]=$.useState(null),[f,c]=$.useState(!0),[x,p]=$.useState(null),[h,y]=$.useState("net_outflow"),[b,v]=$.useState(null),A=$.useCallback(()=>{v(null),i==null||i(null),s==null||s(null,null)},[s,i]),R=$.useCallback(w=>{const S=w.symbol.toUpperCase();v(w),i==null||i(S),s==null||s(S,A)},[A,s,i]);if($.useEffect(()=>{let w=!1;return c(!0),p(null),ge().then(S=>{w||(u(S),c(!1))}).catch(S=>{w||(p((S==null?void 0:S.message)??"Network error"),c(!1))}),()=>{w=!0}},[]),$.useEffect(()=>{const w=a==null?void 0:a.trim().toUpperCase();if(!w||!(l!=null&&l.entries.length)||(b==null?void 0:b.symbol.toUpperCase())===w)return;const S=l.entries.find(z=>z.symbol.toUpperCase()===w);if(S){R(S);return}i==null||i(null),s==null||s(null,null)},[b==null?void 0:b.symbol,R,a,s,i,l==null?void 0:l.entries]),f)return n.jsx(ae,{T:e,rows:5});if(x)return n.jsx(P,{T:e,msg:`${o("dashboard.empty.failedToLoad","Failed to load")} - ${x}`});if(!(l!=null&&l.entries.length))return n.jsx(P,{T:e,msg:o("dashboard.empty.noData","No data available")});if(b)return n.jsx(Ue,{T:e,entry:b,timestamp:l.timestamp,onSelectSymbol:t});const L=$e(l.entries,h);return n.jsxs("div",{children:[n.jsx(Ie,{T:e,value:h,onChange:y}),n.jsx(Ae,{T:e,rows:L,onSelect:R,isPaid:d,onOpenUpgrade:r})]})}export{Ye 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.