PageSourceSearch

https://vault22.com/_next/static/chunks/pages/app/financial-news-d57c0b884c1b7550.js

js vault22.com collected 2026-10-02 00:11:41 UTC 35,202 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46119],{26363:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>v});var i=n(37876),r=n(14232),l=n(89099),s=n(77328),a=n.n(s),o=n(14741),d=n(87979),c=n(92400),x=n(46929);let p=[{symbol:"^GSPC",name:"S&P 500",type:"index"},{symbol:"^DJI",name:"Dow Jones",type:"index"},{symbol:"^IXIC",name:"NASDAQ",type:"index"},{symbol:"^RUT",name:"Russell 2000",type:"index"},{symbol:"SPY",name:"SPDR S&P 500 ETF",type:"etf"},{symbol:"QQQ",name:"Invesco QQQ Trust",type:"etf"},{symbol:"VTI",name:"Vanguard Total Stock",type:"etf"},{symbol:"IWM",name:"iShares Russell 2000",type:"etf"},{symbol:"VOO",name:"Vanguard S&P 500",type:"etf"},{symbol:"VEA",name:"Vanguard FTSE Developed",type:"etf"}];function h(){let[e,t]=(0,r.useState)([]),[n,l]=(0,r.useState)(!0),[s,a]=(0,r.useState)(null),[o,d]=(0,r.useState)(new Date);if((0,r.useEffect)(()=>{let e=async()=>{try{l(!0),await new Promise(e=>setTimeout(e,500));let e=function(){let e={"^GSPC":5998.74,"^DJI":44722.06,"^IXIC":19060.48,"^RUT":2434.73,SPY:598.26,QQQ:523.89,VTI:299.56,IWM:242.18,VOO:550.12,VEA:52.34};return p.map(t=>{let n=e[t.symbol]||100,i=(Math.random()-.5)*5,r=i/100*n;return{symbol:t.symbol,name:t.name,price:n+r,change:r,changePercent:i,type:t.type}})}();t(e),d(new Date),a(null)}catch(e){console.error("Error fetching market data:",e),a("Failed to load market data")}finally{l(!1)}};e();let n=setInterval(e,6e4);return()=>clearInterval(n)},[]),n&&0===e.length)return(0,i.jsxs)("div",{className:"text-center py-8",children:[(0,i.jsx)("div",{className:"inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-teal-500 mb-3"}),(0,i.jsx)("p",{className:"text-sm text-gray-600",children:"Loading market data..."})]});if(s&&0===e.length)return(0,i.jsx)("div",{className:"text-center py-8 text-red-600",children:(0,i.jsx)("p",{children:s})});let c=e.filter(e=>"index"===e.type),x=e.filter(e=>"etf"===e.type);return(0,i.jsxs)("div",{className:"w-full space-y-6",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{style:{fontFamily:"Inter",fontWeight:600,fontSize:"16px",lineHeight:"20px",color:"#4A5565",marginBottom:"12px"},children:"Major Indices"}),(0,i.jsx)("div",{className:"bg-white overflow-hidden",style:{border:"0.555556px solid #E5E7EB",borderRadius:"14px"},children:(0,i.jsx)("div",{className:"overflow-x-auto",children:(0,i.jsxs)("table",{className:"w-full",children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{style:{height:"44.27px",background:"#F9FAFB",borderBottom:"0.555556px solid #E5E7EB"},children:[(0,i.jsx)("th",{className:"text-left",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#4A5565"},children:"Index"}),(0,i.jsx)("th",{className:"text-left",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#4A5565"},children:"Symbol"}),(0,i.jsx)("th",{className:"text-right",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#4A5565"},children:"Price"}),(0,i.jsx)("th",{className:"text-right",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#4A5565"},children:"Change"})]})}),(0,i.jsx)("tbody",{children:c.map(e=>{let t=e.changePercent>=0;return(0,i.jsxs)("tr",{style:{height:"60.54px",borderBottom:"0.555556px solid #F3F4F6"},children:[(0,i.jsx)("td",{style:{padding:"12px 16px"},children:(0,i.jsx)("span",{style:{fontFamily:"Inter",fontWeight:500,fontSize:"16px",lineHeight:"20px",color:"#22252B"},children:e.name})}),(0,i.jsx)("td",{style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"20px",color:"#4E5159"},children:e.symbol.replace("^","")}),(0,i.jsx)("td",{className:"text-right",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"20px",color:"#22252B"},children:e.price.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}),(0,i.jsx)("td",{className:"text-right",style:{padding:"12px 16px"},children:(0,i.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[t?(0,i.jsx)("svg",{width:"11",height:"6",viewBox:"0 0 11 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0},children:(0,i.jsx)("path",{d:"M10.497 0.5L6.24821 4.74877L3.74894 2.24949L0.499878 5.49855",stroke:"#00A63E",strokeWidth:"0.999711",
1strokeLinecap:"round",strokeLinejoin:"round"})}):(0,i.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0},children:[(0,i.jsxs)("g",{clipPath:"url(#clip0_markets)",children:[(0,i.jsx)("path",{d:"M7.99768 8.49718H10.9968V5.49805",stroke:"#E7000B",strokeWidth:"0.999711",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M10.9968 8.49758L6.74803 4.24881L4.24875 6.74808L0.999695 3.49902",stroke:"#E7000B",strokeWidth:"0.999711",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip0_markets",children:(0,i.jsx)("rect",{width:"11.9965",height:"11.9965",fill:"white"})})})]}),(0,i.jsxs)("span",{style:{fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"20px",color:t?"#00A63E":"#E7000B"},children:[t?"+":"",e.changePercent.toFixed(2),"%"]})]})})]},e.symbol)})})]})})})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("h3",{style:{fontFamily:"Inter",fontWeight:600,fontSize:"16px",lineHeight:"20px",color:"#4A5565",marginBottom:"12px"},children:"Top ETFs"}),(0,i.jsx)("div",{className:"bg-white overflow-hidden",style:{border:"0.555556px solid #E5E7EB",borderRadius:"14px"},children:(0,i.jsx)("div",{className:"overflow-x-auto",children:(0,i.jsxs)("table",{className:"w-full",children:[(0,i.jsx)("thead",{children:(0,i.jsxs)("tr",{style:{height:"44.27px",background:"#F9FAFB",borderBottom:"0.555556px solid #E5E7EB"},children:[(0,i.jsx)("th",{className:"text-left",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#4A5565"},children:"ETF"}),(0,i.jsx)("th",{className:"text-left",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#4A5565"},children:"Symbol"}),(0,i.jsx)("th",{className:"text-right",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#4A5565"},children:"Price"}),(0,i.jsx)("th",{className:"text-right",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#4A5565"},children:"Change"})]})}),(0,i.jsx)("tbody",{children:x.map(e=>{let t=e.changePercent>=0;return(0,i.jsxs)("tr",{style:{height:"60.54px",borderBottom:"0.555556px solid #F3F4F6"},children:[(0,i.jsx)("td",{style:{padding:"12px 16px"},children:(0,i.jsx)("span",{style:{fontFamily:"Inter",fontWeight:500,fontSize:"16px",lineHeight:"20px",color:"#22252B"},children:e.name})}),(0,i.jsx)("td",{style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"20px",color:"#4E5159"},children:e.symbol}),(0,i.jsxs)("td",{className:"text-right",style:{padding:"12px 16px",fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"20px",color:"#22252B"},children:["$",e.price.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})]}),(0,i.jsx)("td",{className:"text-right",style:{padding:"12px 16px"},children:(0,i.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[t?(0,i.jsx)("svg",{width:"11",height:"6",viewBox:"0 0 11 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0},children:(0,i.jsx)("path",{d:"M10.497 0.5L6.24821 4.74877L3.74894 2.24949L0.499878 5.49855",stroke:"#00A63E",strokeWidth:"0.999711",strokeLinecap:"round",strokeLinejoin:"round"})}):(0,i.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{flexShrink:0},children:[(0,i.jsxs)("g",{clipPath:"url(#clip1_markets)",children:[(0,i.jsx)("path",{d:"M7.99768 8.49718H10.9968V5.49805",stroke:"#E7000B",strokeWidth:"0.999711",strokeLinecap:"round",strokeLinejoin:"round"}),(0,i.jsx)("path",{d:"M10.9968 8.49758L6.74803 4.24881L4.24875 6.74808L0.999695 3.49902",stroke:"#E7000B",strokeWidth:"0.999711",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,i.jsx)("defs",{children:(0,i.jsx)("clipPath",{id:"clip1_markets",children:(0,i.jsx)("rect",{width:"11.9965",height:"11.9965",fill:"white"})})})]}),(0,i.jsxs)("span",{style:{fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"20px",color:t?"#00A63E":"#E7000B"},children:[t?"+":"",e.changePercent.toFixed(2),"%"]})]})})]},e.symbol)})})]})})})]}),(0,i.jsxs)("p",{className:"text-center",style:{fontFamily:"Inter",fontSize:"12px",color:"#9
1CA3AF"},children:["Data updates every 60 seconds • Last updated: ",o.toLocaleTimeString()]})]})}var g=n(98477),m=n(5068),f=n(67688);let u={bullish:{bg:"#DCFCE7",text:"#166534"},bearish:{bg:"#FEE2E2",text:"#991B1B"},neutral:{bg:"#F3F4F6",text:"#4B5563"},mixed:{bg:"#FEF3C7",text:"#92400E"}};function y(){var e,t;let{initialArticleId:n,onArticleSelect:l}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},[s,a]=(0,r.useState)([]),[d,c]=(0,r.useState)(!0),[x,p]=(0,r.useState)("All"),[h,y]=(0,r.useState)(["All"]),[b,j]=(0,r.useState)(null);(0,r.useEffect)(()=>{(async()=>{try{c(!0);let e="https://strapi.vault22.com";if(!e)throw Error("NEXT_PUBLIC_STRAPI_URL is not configured");let t=await m.A.get("".concat(e,"/api/financial-newses"),{params:{populate:"*",sort:"publishedAt:desc","pagination[limit]":20}});if(t.data&&t.data.data){a(t.data.data);let e=new Set;t.data.data.forEach(t=>{t.attributes.category&&e.add(t.attributes.category)}),y(["All",...Array.from(e).sort()])}}catch(e){console.error("Failed to fetch financial news:",e)}finally{c(!1)}})()},[]),(0,r.useEffect)(()=>{if(n&&s.length>0){let e=s.find(e=>e.id===n);e&&j(e)}},[n,s]);let w=e=>{j(e),null==l||l((null==e?void 0:e.id)||null)},F=e=>{let t=new Date,n=new Date(e),i=Math.floor((t.getTime()-n.getTime())/36e5);if(i<1){let e=Math.floor((t.getTime()-n.getTime())/6e4);return"".concat(e," minutes ago")}{if(i<24)return"".concat(i," hours ago");let e=Math.floor(i/24);return"".concat(e," day").concat(e>1?"s":""," ago")}},v="All"===x?s:s.filter(e=>e.attributes.category===x);return d?(0,i.jsxs)("div",{className:"flex flex-col gap-4 w-full",children:[(0,i.jsx)("div",{className:"flex items-center justify-between",style:{height:"44px"},children:(0,i.jsx)("h2",{style:{fontFamily:"Inter",fontWeight:500,fontSize:"16px",lineHeight:"20px",color:"#22252B"},children:"Latest Financial News"})}),(0,i.jsxs)("div",{className:"text-center py-8",children:[(0,i.jsx)("div",{className:"inline-block animate-spin rounded-full h-12 w-12 border-b-2 border-teal-500 mb-3"}),(0,i.jsx)("p",{className:"text-sm text-gray-600",children:"Loading news..."})]})]}):(0,i.jsxs)("div",{className:"flex flex-col w-full",style:{gap:"16px"},children:[(0,i.jsxs)("div",{className:"flex items-center justify-between w-full",style:{height:"44px",padding:"0px"},children:[(0,i.jsx)("h2",{style:{height:"20px",fontFamily:"Inter",fontWeight:500,fontSize:"16px",lineHeight:"20px",color:"#22252B",flexShrink:0,whiteSpace:"nowrap"},children:"Latest Financial News"}),(0,i.jsxs)("div",{className:"relative flex items-center cursor-pointer",style:{boxSizing:"border-box",padding:"12px 8px 12px 12px",gap:"34px",minWidth:"107.33px",height:"44px",border:"1px solid #E4E5E8",borderRadius:"8px",flexShrink:0},children:[(0,i.jsx)("select",{value:x,onChange:e=>p(e.target.value),className:"cursor-pointer focus:outline-none appearance-none absolute inset-0",style:{fontFamily:"Inter",fontWeight:500,fontSize:"16px",lineHeight:"20px",color:"transparent",backgroundColor:"transparent",border:"none",padding:"12px 8px 12px 12px",width:"100%",height:"100%"},children:h.map(e=>(0,i.jsx)("option",{value:e,style:{color:"#000000",backgroundColor:"#FFFFFF",padding:"8px"},children:e},e))}),(0,i.jsx)("span",{style:{fontFamily:"Inter",fontWeight:500,fontSize:"16px",lineHeight:"20px",color:"#000000",pointerEvents:"none",position:"relative",zIndex:1},children:x}),(0,i.jsx)("div",{style:{width:"16px",height:"16px",display:"flex",alignItems:"center",justifyContent:"center",flexShrink:0,pointerEvents:"none",position:"relative",zIndex:1},children:(0,i.jsx)("svg",{width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",children:(0,i.jsx)("path",{d:"M0.5 0.5L4 3.5L7.5 0.5",stroke:"#6A7282",strokeWidth:"1.33319",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),(0,i.jsx)("div",{className:"flex flex-col w-full",style:{gap:"12px",maxHeight:"calc(100vh - 200px)",overflowY:"auto",paddingRight:"4px"},children:v.length>0?v.map(e=>{var t,n;return(0,i.jsxs)("div",{onClick:()=>w(e),className:"w-full",style:{boxSizing:"border-box",display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"0px",minHeight:"348px",background:"#FFFFFF",border:"0.555556px solid #E5E7EB",borderRadius:"14px",overflow:"hidden",cursor:"pointer",transition:"transform 0.2s, box-shadow 0.2s"},onMouseEnter:e=>{e.currentTarget.style.transform="translateY(-2px)",e.currentTarget.style.boxShadow="0 4px 12px rgba(0,0,0,0.1)"},onMouseLeave:e=>{e.currentTarget.style.transform="translateY(0)",e.currentTarget.style.boxShadow="none"},children:[(0,i.jsxs)("div",{className:"w-full",style:{display:"flex",flexDirection:"row",alignItems:"flex-start",justifyContent:"space-between",padding:"8px",gap:"10px",height:"160px",backgroundImage:e.attributes.thumbnailUrl?"url(".concat(e.attributes.thumbnailUrl,")"):"linear-gradient(135deg, #1E3A5F 0%, #2E5A8F 100%)",backgroundSize:"cover",backgroundPosition:"center",borderRadius:"0px"},children:[(0,i.jsx)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",padding:"8px",gap:"10px",background:"#1E3A5F",borderRadius:"1.86414e+07px",flex:"none",order:0,flexGrow:0},children:(0,i.jsx)("span",{style:{fontFamily:"Inter",fontStyle:"normal",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#FFFFFF",flex:"none",order:0,flexGrow:0},children:e.attributes.category})}),e.attributes.sentiment&&(0,i.jsx)("div",{style:{display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",padding:"6px 10px",gap:"4px",background:(null==(t=u[e.attributes.sentiment])?void 0:t.bg)||"#F3F4F6",borderRadius:"1.86414e+07px",flex:"none",order:1,flexGrow:0},children:(0,i.jsx)("span",{style:{fontFamily:"Inter",fontStyle:"normal",fontWeight:600,fontSize:"12px",lineHeight:"16px",color:(null==(n=u[e.attributes.sentiment])?void 0:n.text)||"#4B5563",flex:"none",order:0,flexGrow:0,textTransform:"capitalize"},children:e.attributes.sentiment})})]}),(0,i.jsxs)("div",{className:"w-full",style:{display:"flex",flexDirection:"column",alignItems:"flex-start",padding:"16px",gap:"12px",minHeight:"188px",borderRadius:"0px",flex:1},children:[(0,i.jsx)("div",{style:{height:"20px",fontFamily:"Inter",fontStyle:"normal",fontWeight:400,fontSize:"14px",lineHeight:"20px",color:"#6A7282",flex:"none",order:0,flexGrow:0},children:F(e.attributes.publishedAt)}),(0,i.jsx)("div",{style:{height:"40px",fontFamily:"Inter",fontStyle:"normal",fontWeight:500,fontSize:"16px",lineHeight:"20px",color:"#101828",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:2,WebkitBoxOrient:"vertical",flex:"none",order:1,alignSelf:"stretch",flexGrow:0},children:e.attributes.title}),(0,i.jsx)("div",{style:{height:"72px",fontFamily:"Inter",fontStyle:"normal",fontWeight:400,fontSize:"16px",lineHeight:"24px",color:"#4A5565",overflow:"hidden",textOverflow:"ellipsis",display:"-webkit-box",WebkitLineClamp:3,WebkitBoxOrient:"vertical",flex:"none",order:2,flexGrow:0},children:e.attributes.excerpt})]})]},e.id)}):(0,i.jsxs)("div",{className:"text-center py-8",style:{color:"#6A7282"},children:[(0,i.jsx)("p",{className:"text-3xl mb-2",children:"\uD83D\uDCC8"}),(0,i.jsx)("p",{className:"text-sm",children:"No financial news articles found"})]})}),b&&(0,g.createPortal)((0,i.jsx)("div",{onClick:()=>w(null),style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"rgba(0, 0, 0, 0.75)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:999999,padding:"20px",overflowY:"auto"},children:(0,i.jsxs)("div",{onClick:e=>e.stopPropagation(),style:{background:"#FFFFFF",borderRadius:"16px",maxWidth:"800px",width:"100%",maxHeight:"90vh",overflowY:"auto",position:"relative"},children:[b.attributes.thumbnailUrl&&(0,i.jsx)("div",{style:{width:"100%",height:"400px",backgroundImage:"url(".concat(b.attributes.thumbnailUrl,")"),backgroundSize:"cover",backgroundPosition:"center",borderRadius:"16px 16px 0 0"}}),(0,i.jsx)("button",{onClick:()=>w(null),style:{position:"absolute",top:"20px",right:"20px",width:"40px",height:"40px",borderRadius:"50%",background:"rgba(0, 0, 0, 0.6)",backdropFilter:"blur(4px)",WebkitBackdropFilter:"blur(4px)",border:"none",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"24px",fontWeight:300,color:"#FFFFFF",zIndex:1e3,transition:"all 0.2s",boxShadow:"0 2px 8px rgba(0, 0, 0, 0.3)"},onMouseEnter:e=>{e.currentTarget.style.background="rgba(0, 0, 0, 0.8)",e.currentTarget.style.transform="scale(1.1)"},onMouseLeave:e=>{e.currentTarget.style.background="rgba(0, 0, 0, 0.6)",e.currentTarget.style.transform="scale(1)"},children:"\xd7"}),(0,i.jsxs)("div",{style:{padding:"32px"},children:[(0,i.jsxs)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap",marginBottom:"16
1px"},children:[(0,i.jsx)("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"8px 16px",background:"#1E3A5F",borderRadius:"9999px"},children:(0,i.jsx)("span",{style:{fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:"#FFFFFF"},children:b.attributes.category})}),b.attributes.sentiment&&(0,i.jsx)("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",padding:"8px 16px",background:(null==(e=u[b.attributes.sentiment])?void 0:e.bg)||"#F3F4F6",borderRadius:"9999px"},children:(0,i.jsx)("span",{style:{fontFamily:"Inter",fontWeight:600,fontSize:"14px",lineHeight:"18px",color:(null==(t=u[b.attributes.sentiment])?void 0:t.text)||"#4B5563",textTransform:"capitalize"},children:b.attributes.sentiment})})]}),(0,i.jsx)("div",{style:{fontFamily:"Inter",fontWeight:400,fontSize:"14px",lineHeight:"20px",color:"#6A7282",marginBottom:"16px"},children:F(b.attributes.publishedAt)}),(0,i.jsx)("h1",{style:{fontFamily:"Inter",fontWeight:600,fontSize:"32px",lineHeight:"40px",color:"#101828",marginBottom:"16px"},children:b.attributes.title}),b.attributes.securities&&b.attributes.securities.length>0&&(0,i.jsxs)("div",{style:{marginBottom:"16px"},children:[(0,i.jsx)("div",{style:{fontFamily:"Inter",fontWeight:500,fontSize:"12px",color:"#6A7282",marginBottom:"8px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Securities Mentioned"}),(0,i.jsx)("div",{style:{display:"flex",gap:"8px",flexWrap:"wrap"},children:b.attributes.securities.map((e,t)=>(0,i.jsx)("span",{style:{fontFamily:"Inter",fontWeight:500,fontSize:"13px",padding:"4px 10px",background:"#EEF2FF",color:"#4338CA",borderRadius:"6px"},children:e.symbol},t))})]}),(0,i.jsx)("p",{style:{fontFamily:"Inter",fontWeight:500,fontSize:"18px",lineHeight:"28px",color:"#4A5565",marginBottom:"24px"},children:b.attributes.excerpt}),(0,i.jsx)("div",{style:{fontFamily:"Inter",fontWeight:400,fontSize:"16px",lineHeight:"28px",color:"#22252B"},children:(0,i.jsx)(o.oz,{rehypePlugins:[f.A],components:{h1:e=>{let{node:t,...n}=e;return(0,i.jsx)("h1",{style:{fontFamily:"Inter",fontSize:"28px",fontWeight:700,color:"#101828",marginTop:"24px",marginBottom:"16px",lineHeight:"36px"},...n})},h2:e=>{let{node:t,...n}=e;return(0,i.jsx)("h2",{style:{fontFamily:"Inter",fontSize:"24px",fontWeight:600,color:"#101828",marginTop:"20px",marginBottom:"12px",lineHeight:"32px"},...n})},h3:e=>{let{node:t,...n}=e;return(0,i.jsx)("h3",{style:{fontFamily:"Inter",fontSize:"20px",fontWeight:600,color:"#101828",marginTop:"18px",marginBottom:"10px",lineHeight:"28px"},...n})},p:e=>{let{node:t,...n}=e;return(0,i.jsx)("p",{style:{fontFamily:"Inter",fontSize:"16px",lineHeight:"28px",color:"#22252B",marginBottom:"16px"},...n})},ul:e=>{let{node:t,...n}=e;return(0,i.jsx)("ul",{style:{fontFamily:"Inter",fontSize:"16px",lineHeight:"28px",color:"#22252B",marginBottom:"16px",paddingLeft:"24px",listStyleType:"disc"},...n})},ol:e=>{let{node:t,...n}=e;return(0,i.jsx)("ol",{style:{fontFamily:"Inter",fontSize:"16px",lineHeight:"28px",color:"#22252B",marginBottom:"16px",paddingLeft:"24px",listStyleType:"decimal"},...n})},li:e=>{let{node:t,...n}=e;return(0,i.jsx)("li",{style:{fontFamily:"Inter",fontSize:"16px",lineHeight:"28px",color:"#22252B",marginBottom:"8px"},...n})},strong:e=>{let{node:t,...n}=e;return(0,i.jsx)("strong",{style:{fontWeight:600,color:"#101828"},...n})},em:e=>{let{node:t,...n}=e;return(0,i.jsx)("em",{style:{fontStyle:"italic",color:"#4A5565"},...n})},blockquote:e=>{let{node:t,...n}=e;return(0,i.jsx)("blockquote",{style:{borderLeft:"4px solid #1E3A5F",paddingLeft:"16px",marginLeft:"0",marginBottom:"16px",color:"#4A5565",fontStyle:"italic",background:"rgba(30, 58, 95, 0.03)",paddingTop:"12px",paddingBottom:"12px",borderRadius:"0 4px 4px 0"},...n})},code:e=>{let{node:t,...n}=e;return n.inline?(0,i.jsx)("code",{style:{fontFamily:"Monaco, monospace",fontSize:"14px",background:"rgba(101, 108, 133, 0.1)",padding:"2px 8px",borderRadius:"4px",color:"#1E3A5F",fontWeight:500},...n}):(0,i.jsx)("code",{style:{fontFamily:"Monaco, monospace",fontSize:"14px",background:"#F9FAFB",padding:"12px 16px",borderRadius:"8px",display:"block",marginBottom:"16
1px",color:"#22252B",border:"1px solid #E5E7EB",overflowX:"auto"},...n})}},children:b.attributes.content})}),b.attributes.sourceUrl&&(0,i.jsx)("div",{style:{marginTop:"32px",paddingTop:"24px",borderTop:"1px solid #E5E7EB"},children:(0,i.jsxs)("a",{href:b.attributes.sourceUrl,target:"_blank",rel:"noopener noreferrer",style:{fontFamily:"Inter",fontWeight:500,fontSize:"16px",lineHeight:"20px",color:"#1E3A5F",textDecoration:"none",display:"inline-flex",alignItems:"center",gap:"8px"},children:["Read original article",(0,i.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:(0,i.jsx)("path",{d:"M6 3H3v10h10v-3M9 3h4v4M13 3L6 10",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})})]})]})}),document.body)]})}var b=n(29528),j=n(91452),w=n(14312),F=n(75938);function v(){(0,l.useRouter)();let{isAuthenticated:e}=(0,j.n)(),[t,n]=(0,r.useState)(null),[s,p]=(0,r.useState)(""),g=(0,r.useRef)(null),[m,f]=(0,r.useState)(!1),[u,v]=(0,r.useState)(!1),[k,S]=(0,r.useState)(!1),[N,E]=(0,r.useState)(""),[I,A]=(0,r.useState)([]),[z,B]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e=()=>{let e=window.location.hash.slice(1);if(e){let t=parseInt(e,10);isNaN(t)||n(t)}else n(null)},t=setTimeout(()=>{e()},100);return e(),window.addEventListener("hashchange",e),()=>{clearTimeout(t),window.removeEventListener("hashchange",e)}},[]);let W=async()=>{if(!u){v(!0),S(!1),p(""),E("Research started..."),A([]),B(!1);try{var e,t;let n=localStorage.getItem("customerId"),i="https://chatbot.vault22.com/maya-stream";if(!i)throw Error("NEXT_PUBLIC_CRYPTO_NEWS_API_URL is not configured");let r=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({question:"Analyze the current financial markets and provide insights on major indices (S&P 500, NASDAQ, Dow Jones), top ETFs, and market trends. Cover:\n\n1. Overall market sentiment and direction\n2. Key market movers and sector performance\n3. Recent economic indicators and their impact\n4. Notable corporate news affecting markets\n5. Potential risks and opportunities for investors\n\nProvide a comprehensive analysis with actionable insights.",customerId:n})});if(!r.ok)throw Error("HTTP error! status: ".concat(r.status));let l=null==(e=r.body)?void 0:e.getReader(),s=new TextDecoder;if(!l)throw Error("No response body");let a="",o="";v(!1),S(!0);let d=Date.now();for(;;){let{done:e,value:n}=await l.read();if(e)break;let i=(o+=s.decode(n,{stream:!0})).split("\n");for(let e of(o=i.pop()||"",i))if(e.startsWith("data: "))try{let n=JSON.parse(e.slice(6));if("text_delta"===n.type&&n.text){a+=n.text;let e=Date.now();e-d>=100&&(d=e,p(a),await new Promise(e=>setTimeout(e,0)))}else if("heartbeat"===n.type)N&&"Research started..."!==N||E("Research started...");else if("tool_start"===n.type){let e=n.tool||"unknown",i=(null==(t=n.input)?void 0:t.query)||"";"searchCachedNews"===e?E("Searching cache..."):"searchLiveNews"===e&&E(i?"Searching internet for: ".concat(i):"Searching internet..."),A(t=>[...t,{tool:e,query:i,timestamp:Date.now()}])}else"text_end"===n.type&&E("Research finished")}catch(t){console.error("Error parsing SSE line:",e,t)}}v(!1),S(!1),a?p(a):p("I'm sorry, I couldn't generate an analysis right now. Please try again later.")}catch(e){console.error("Error getting market analysis:",e),p("I'm sorry, I'm having trouble connecting right now. Please try again later."),v(!1),S(!1)}}},T=async()=>{if(s){f(!0);try{let e=new w.default({orientation:"portrait",unit:"mm",format:"a4"}),t=e.internal.pageSize.getWidth(),n=e.internal.pageSize.getHeight(),i=t-40,r=20;e.setFontSize(18),e.setTextColor(30,58,95),e.text("Market Analysis Report",t/2,r,{align:"center"}),r+=8,e.setFontSize(9),e.setTextColor(107,114,128),e.text("Generated on ".concat(new Date().toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),t/2,r,{align:"center"}),r+=12,e.setDrawColor(200,200,200),e.line(20,r,t-20,r),r+=8;let l=e=>e.replace(/[\uD83C-\uDBFF\uDC00-\uDFFF]+/g,"").replace(/[\u2600-\u27BF]/g,"").replace(/[\uFE00-\uFE0F]/g,"").replace(/[\u2300-\u23FF]/g,"").replace(/[\u2B50]/g,"").replace(/[\u203C\u2049]/g,"").replace(/[\u25AA-\u25FE]/g,"").trim(),a=e=>{let t="";for(let n of e)"text"===n.type?t+=n.text:"strong"===n.type||"em"===n.type||"link"===n.type?t+=a(n.tokens||[]):"codespan"===n.type?t+=n.text:n.raw&&(t+=n.raw);return l(t)},o=()=>{r>n-20&&(e.addPage(),r=20)};for(let n of F.xI.lexer(s))switch(o(),n.type){case"heading":{let t=n.depth,l=a(n.tokens||[]);1===t?(e.setFontSize(14),r+=4):2===t?(e.setFontSize(12),r+=3):(3===t?e.setFontSize(11):e.setFontSize(10),r+=2),e.setFont("helvetica","bold"),e.setTextColor(30,58,95);let s=e.splitTextToSize(l,i);e.text(s,20,r),r+=s.length*(t<=2?5.5:4.5)+4;break}case"paragraph":{e.setFontSize(10),e.setFont("helvetica","normal"),e.setTextColor(0,0,0);let t=a(n.tokens||[]),l=e.splitTextToSize(t,i);e.text(l,20,r),r+=4.5*l.length+3;break}case"list":{let t=n.items||[];for(let s=0;s<t.length;s++){o();let d=t[s];e.setFontSize(10),e.setFont("helvetica","normal"),e.setTextColor(0,0,0);let c="";if(d.tokens)for(let e of d.tokens)"text"===e.type?c+=l(e.text):"paragraph"===e.type&&(c+=a(e.tokens||[]));let x=n.ordered?"".concat(s+1,"."):"-",p=n.ordered?8:5,h=e.splitTextToSize(c,i-p);e.text(x,20,r),e.text(h,20+p,r),r+=4.5*h.length+2}r+=2;break}case"hr":r+=2,e.setDrawColor(200,200,200),e.line(20,r,t-20,r),r+=6;break;case"space":r+=2}let d="market-analysis-".concat(new Date().toISOString().split("T")[0],".pdf");e.save(d)}catch(e){console.error("Error exporting to PDF:",e),alert("Failed to export PDF. Please try again.")}finally{f(!1)}}};return(0,i.jsxs)(x.A,{children:[(0,i.jsxs)(a(),{children:[(0,i.jsx)("title",{children:"Financial News | Vault22"}),(0,i.jsx)("meta",{name:"description",content:"Stay updated with the latest financial news and market insights"})]}),(0,i.jsx)(c.A,{children:(0,i.jsxs)("div",{className:"space-y-6",children:[(0,i.jsx)("div",{className:"flex items-center justify-between",children:(0,i.jsx)("h1",{"data-testid":"financial-news-heading",className:"text-2xl font-bold text-gray-900 dark:text-white",children:"Financial News"})}),(0,i.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[(0,i.jsxs)("div",{className:"lg:col-span-2 space-y-6",children:[s||k||u?(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm overflow-hidden border border-gray-200",children:[(0,i.jsxs)("div",{className:"h-[60px] flex items-center justify-between px-6",style:{background:"linear-gradient(89.93deg, #1E3A5F 28.1%, #2E5A8F 99.94%)"},children:[(0,i.jsxs)("h2",{"data-testid":"financial-news-market-analysis-heading",className:"text-xl font-semibold text-white flex items-center gap-2",children:[(0,i.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",children:(0,i.jsx)("path",{d:"M3 17V11M10 17V7M17 17V3",stroke:"white",strokeWidth:"2.5",strokeLinecap:"round"})}),"AI Market Analysis"]}),(0,i.jsx)("div",{className:"flex items-center gap-3",children:s&&!k&&!u&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("button",{onClick:W,className:"flex items-center gap-2 bg-white/20 px-3 py-1.5 rounded-lg text-sm font-medium text-white hover:bg-white/30 transition-colors",children:[(0,i.jsx)("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",children:(0,i.jsx)("path",{d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),"Refresh"]}),(0,i.jsx)("button",{onClick:T,disabled:m,className:"flex items-center gap-2 bg-white px-4 py-2 rounded-lg text-sm font-medium text-[#1E3A5F] hover:bg-gray-50 transition-colors",children:m?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("div",{className:"w-4 h-4 border-2 border-[#1E3A5F] border-t-transparent roun
1ded-full animate-spin"}),"Exporting..."]}):(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,i.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 10v6m0 0l-3-3m3 3l3-3m2 8H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})}),"Export PDF"]})})]})})]}),(0,i.jsx)("div",{className:"p-6",children:u?(0,i.jsxs)("div",{className:"text-center py-12",children:[(0,i.jsx)(b.A,{size:80}),(0,i.jsx)("p",{className:"text-sm text-gray-500 mt-3",children:"Analyzing markets..."})]}):(0,i.jsxs)("div",{children:[N&&k&&(0,i.jsxs)("div",{onClick:()=>B(!0),className:"mb-5 flex items-center cursor-pointer hover:bg-gray-100 transition-all px-4 py-3 bg-gray-50 border border-gray-200 rounded-xl text-sm text-gray-600",children:[(0,i.jsx)("span",{className:"w-2.5 h-2.5 rounded-full mr-3 ".concat("Research finished"===N?"bg-green-500":"bg-[#1E3A5F] animate-pulse")}),(0,i.jsx)("span",{children:N})]}),z&&(0,i.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",onClick:()=>B(!1),children:(0,i.jsxs)("div",{className:"bg-white rounded-lg p-6 max-w-2xl w-full mx-4 max-h-96 overflow-y-auto",onClick:e=>e.stopPropagation(),children:[(0,i.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,i.jsx)("h3",{className:"text-lg font-bold text-gray-900",children:"Research History"}),(0,i.jsx)("button",{onClick:()=>B(!1),className:"text-gray-400 hover:text-gray-600",children:"X"})]}),(0,i.jsxs)("div",{className:"space-y-2",children:[I.map((e,t)=>(0,i.jsxs)("div",{className:"text-sm px-3 py-2 bg-gray-50 rounded flex items-start",children:[(0,i.jsxs)("span",{className:"text-gray-400 mr-2",children:[t+1,"."]}),(0,i.jsxs)("div",{className:"flex-1",children:[(0,i.jsxs)("span",{className:"font-mono text-gray-700",children:["searchCachedNews"===e.tool&&"Cached News Search","searchLiveNews"===e.tool&&"Live Web Search"]}),e.query&&(0,i.jsxs)("div",{className:"text-gray-500 mt-1",children:["Query: ",e.query]})]})]},t)),0===I.length&&(0,i.jsx)("div",{className:"text-center text-gray-400 py-8",children:"No research actions yet"})]})]})}),(0,i.jsx)("div",{className:"overflow-y-auto max-h-[380px] pr-1",children:(0,i.jsx)("div",{ref:g,className:"prose prose-sm max-w-none",children:(0,i.jsx)(o.oz,{remarkPlugins:[d.A],components:{h1:e=>{let{node:t,...n}=e;return(0,i.jsx)("h1",{className:"text-xl font-bold text-gray-900 mt-5 mb-3",...n})},h2:e=>{let{node:t,...n}=e;return(0,i.jsx)("h2",{className:"text-lg font-semibold text-gray-900 mt-4 mb-2",...n})},h3:e=>{let{node:t,...n}=e;return(0,i.jsx)("h3",{className:"text-base font-semibold text-gray-800 mt-4 mb-2",...n})},p:e=>{let{node:t,...n}=e;return(0,i.jsx)("p",{className:"text-sm text-gray-600 mb-3 leading-relaxed",...n})},ul:e=>{let{node:t,...n}=e;return(0,i.jsx)("ul",{className:"text-sm text-gray-600 mb-3 pl-5 list-disc",...n})},ol:e=>{let{node:t,...n}=e;return(0,i.jsx)("ol",{className:"text-sm text-gray-600 mb-3 pl-5 list-decimal",...n})},li:e=>{let{node:t,...n}=e;return(0,i.jsx)("li",{className:"text-sm text-gray-600 mb-1",...n})},strong:e=>{let{node:t,...n}=e;return(0,i.jsx)("strong",{className:"font-semibold text-gray-900",...n})},blockquote:e=>{let{node:t,...n}=e;return(0,i.jsx)("blockquote",{className:"border-l-3 border-[#1E3A5F] pl-4 my-3 text-gray-500 italic",...n})},hr:e=>{let{node:t,...n}=e;return(0,i.jsx)("hr",{className:"border-t border-gray-200 my-5",...n})}},children:s?s.replace(/[\uD83C-\uDBFF\uDC00-\uDFFF]+/g,"").replace(/[\u2600-\u27BF]/g,"").replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/([^\n])(#{1,6}\s)/g,"$1\n$2").replace(/([^\n])(\n[-*+]\s)/g,"$1\n$2").replace(/([^\n])(\n\d+\.\s)/g,"$1\n$2").replace(/[ \t]+$/gm,"").replace(/\n{3,}/g,"\n\n").trim():s})})})]})})]}):(0,i.jsx)("div",{className:"rounded-2xl shadow-sm p-8",style:{background:"linear-gradient(89.93deg, #1E3A5F 28.1%, #2E5A8F 99.94%)"},children:(0,i.jsxs)("div",{className:"flex flex-col md:flex-row items-start gap-8",children:[(0,i.jsxs)("div",{className:"flex flex-col gap-4 flex-1",children:[(0,i.jsx)("h2",{"data-testid":"financial-news-welcome-heading",className:"text-3xl font-medium text-[#4ADE80]",children:"Welcome to Financial News Hub"}),(0,i.jsx)("p",{className:"text-base text-white/80",children:"Stay updated with the latest financial news and market insights. Get AI-powered analysis of indices, ETFs, and market trends."})]}),(0,i.jsxs)("button",{onClick:W,className:"flex items-center justify-center gap-2 bg-white hover:bg-gray-50 transition-all rounded-xl px-6 py-4 text-[#1E3A5F] text-lg font-medium whitespace-nowrap",children:[(0,i.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 24 24",fill:"none",children:(0,i.jsx)("path",{d:"M4 20V12M12 20V4M20 20V14",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round"})}),"Start AI Analysis"]})]})}),(0,i.jsxs)("div",{className:"bg-white rounded-2xl shadow-sm border border-gray-200 p-6",children:[(0,i.jsx)("h2",{"data-testid":"financial-news-market-overview-heading",className:"text-xl font-semibold text-gray-900 mb-4",children:"Market Overview"}),(0,i.jsx)(h,{})]})]}),(0,i.jsx)("div",{className:"lg:col-span-1",children:(0,i.jsx)("div",{className:"sticky top-24",children:(0,i.jsx)(y,{initialArt
1icleId:t,onArticleSelect:e=>{e?window.location.hash="#".concat(e):window.history.replaceState(null,"",window.location.pathname+window.location.search),n(e)}})})})]})]})})]})}},34198:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/financial-news",function(){return n(26363)}])}},e=>{e.O(0,[80347,54155,70140,75938,90636,46593,38792],()=>e(e.s=34198)),_N_E=e.O()}]);

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.