PageSourceSearch

https://predx.pro/_next/static/chunks/a53209e84787b396.js

js predx.pro collected 2026-10-02 01:10:01 UTC 32,876 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,736279,e=>{"use strict";var t=e.i(843476),l=e.i(271645);let s=(0,e.i(475254).default)("sliders-horizontal",[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]]);var a=e.i(917479),r=e.i(266027),n=e.i(579844),i=e.i(242883),d=e.i(657688),o=e.i(852008),c=e.i(463059),x=e.i(373375),m=e.i(522016),u=e.i(344873),h=e.i(975157),p=e.i(302747),g=e.i(257202),v=e.i(364052);function f(e){let{heat:s}=e,{t:a}=(0,v.useTranslation)(),r=(null==s?void 0:s.trend)??[],{change:n,isPositive:i}=(0,l.useMemo)(()=>{if(r.length<2)return{change:0,isPositive:!0};let e=r[0].total_interactions,t=r[r.length-1].total_interactions-e;return{change:t,isPositive:t>=0}},[r]);return(0,t.jsx)(t.Fragment,{children:(null==s?void 0:s.total_interactions)?(0,t.jsxs)("div",{className:"max-w-[230px] pr-4 px-1 border-r border-white/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(g.SocialSignalIcon,{className:"text-white"}),(0,t.jsx)("span",{className:"text-white text-[12px] uppercase tracking-wide font-semibold",children:a("Social Engagement")})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,t.jsx)("p",{className:"text-white font-bold text-[24px] leading-tight",children:(0,u.formatLargeNumber)(s.total_interactions,1,"")}),n?(0,t.jsxs)("div",{className:`flex items-center gap-0.5 text-xs font-medium ${i?"text-[#00C805]":"text-[#F73538]"}`,children:[i?"+":"",(0,u.formatLargeNumber)(n,1,""),"(24h)"]}):""]}),(0,t.jsxs)("div",{className:"text-[11px] text-white/50 flex flex-col gap-1",children:[(0,t.jsxs)("p",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"font-medium text-white/80",children:(0,u.formatLargeNumber)(s.sample_tweet_count,1,"")}),(0,t.jsx)("span",{children:a("Posts")})]}),(0,t.jsxs)("p",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"font-medium text-white/80",children:(0,u.formatLargeNumber)(s.total_interactions,1,"")}),(0,t.jsx)("span",{children:a("Interactions")})]}),(0,t.jsxs)("p",{className:"flex items-center gap-1",children:[(0,t.jsx)("span",{className:"font-medium text-white/80",children:(0,u.formatLargeNumber)(s.total_views,1,"")}),(0,t.jsx)("span",{children:a("Views")})]})]})]}):""})}var b=e.i(351644),j=e.i(101944);function N(e){if(!(null==e?void 0:e.news))return{relatedMarkets:[],topMarkets:[],newsCount:0,marketCount:0,totalVolume:0};let t=Array.from(new Map(e.news.flatMap(e=>e.events||[]).map(e=>[e.id,e])).values()),l=t.reduce((e,t)=>e+(t.total_volume||0),0);return{relatedMarkets:t,topMarkets:t.slice(0,2),newsCount:e.news.length,marketCount:t.length,totalVolume:l}}function w(e){var t;if(e)return null==(t=e.news.flatMap(e=>e.events||[])[0])?void 0:t.event_id}function y(e){var s,a,r;let{event:n,heat:i}=e,{t:o,currentLanguage:c}=(0,v.useTranslation)(),x=N(n),h=n.image_url||(null==(s=x.relatedMarkets[0])?void 0:s.image)||"",p=(0,u.formatRelativeTime)(new Date(n.updated_at||n.created_at).getTime(),!1,c),g=`/event/${(null==(a=x.relatedMarkets[0])?void 0:a.slug)||(null==(r=x.relatedMarkets[0])?void 0:r.id)||""}`,f=null==i?void 0:i.trend,{change:b,isPositive:w}=(0,l.useMemo)(()=>{if(!f||f.length<2)return{change:0,isPositive:!0};let e=f[0].total_interactions,t=f[f.length-1].total_interactions-e;return{change:t,isPositive:t>=0}},[f]);return(0,t.jsxs)(m.default,{href:g,className:"relative w-full h-[340px] rounded-[16px] overflow-hidden cursor-pointer select-none block",children:[(0,t.jsxs)("div",{className:"absolute inset-0 bg-gray-900",children:[h&&(0,t.jsx)(d.default,{src:h,alt:"",fill:!0,className:"object-cover",unoptimized:!0}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/10 to-transparent"})]}),(0,t.jsxs)("div",{className:"relative h-full flex flex-col p-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 flex-wrap",children:[(0,t.jsx)("span",{className:"px-2 py-0.5 bg-black/50 backdrop-blur-sm rounded text-white text-[10px] font-bold capitalize tracking-wide",children:o("Event")}),p&&(0,t.jsx)("span",{className:"px-2 py-0.5 bg-black/50 backdrop-blur-sm rounded text-white capitalize text-[10px]",children:p})]}),(0,t.jsxs)("div",{className:"mt-auto",children:[(0,t.jsx)("h3",{className:"text-white font-bold text-sm leading-snug line-clamp-3 mb-3",children:n.title}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(null==i?void 0:i.total_interactions)?(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px]",children:[(0,t.jsx)("span",{className:"text-white/50 uppercase tracking-wide",children:o("Social Engagement")}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-white/80 font-semibold",children:(null==i?void 0:i.total_interactions)?(0,u.formatLargeNumber)(i.total_interactions,1,""):"--"}),b?(0,t.jsxs)("div",{className:`flex items-center gap-0.5 text-xs font-medium ${w?"text-positive":"text-negative"}`,children:[w?"+":"",(0,u.formatLargeNumber)(b,1,""),"(24h)"]}):""]})]}):"",(0,t.jsxs)("div",{className:"flex items-center justify-between text-[10px]",children:[(0,t.jsx)("span",{className:"text-white/50 uppercase tracking-wide",children:o("Related Market")}),(0,t.jsxs)("span",{className:"text-white/80 font-semibold",children:[x.marketCount," ",o((0,j.pluralKey)(x.marketCount,"Market","Markets"))]})]})]})]})]})]})}function k(e){var l,s,a;let{event:r,heat:n,translatedTopMarkets:i}=e,{t:c}=(0,v.useTranslation)(),x=N(r),h=i??x.topMarkets,p=r.image_url||(null==(l=x.relatedMarkets[0])?void 0:l.image)||"",b=`/event/${(null==(s=x.relatedMarkets[0])?void 0:s.slug)||(null==(a=x.relatedMarkets[0])?void 0:a.id)||""}`;return(0,t.jsxs)(m.default,{href:b,className:"relative w-full h-full rounded-[16px] overflow-hidden block",children:[(0,t.jsxs)("div",{className:"absolute inset-0 bg-gray-900",children:[p&&(0,t.jsx)(d.default,{src:p,alt:"",fill:!0,className:"object-cover",unoptimized:!0}),(0,t.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/10 to-transparent"})]}),(0,t.jsxs)("div",{className:"relative h-full flex flex-col px-6 pt-6",children:[(0,t.jsx)("div",{children:(0,t.jsx)("span",{className:"px-3 py-1 bg-primary text-primary-foreground text-xs font-semibold",children:c("Event")})}),(0,t.jsx)("div",{className:"flex-1 flex items-center mt-3",children:(0,t.jsx)("h2",{className:"text-white font-bold text-[30px] leading-tight line-clamp-3 max-w-[80%]",children:r.title})}),(0,t.jsxs)("div",{className:"flex gap-4 mt-3 pb-2",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-[230px] max-w-[300px] pr-4 border-r border-white/10",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,t.jsx)(g.SocialEngagementIcon,{className:"text-white"}),(0,t.jsx)("span",{className:"text-white text-[12px] uppercase tracking-wide font-semibold",children:c("Latest News")})]}),(0,t.jsx)("div",{className:"w-full",children:r.news.slice().sort((e,t)=>
1new Date(t.publish_time).getTime()-new Date(e.publish_time).getTime()).slice(0,2).map((e,l,s)=>(0,t.jsxs)("div",{className:"flex items-start gap-2",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center self-stretch flex-shrink-0",children:[(0,t.jsx)("div",{className:"mt-[5px] w-1.5 h-1.5 rounded-full bg-white/50 flex-shrink-0"}),l<s.length-1&&(0,t.jsx)("div",{className:"flex-1 w-px bg-white/15 mt-1"})]}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 pb-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[e.source_icon_url&&(0,t.jsx)("img",{src:e.source_icon_url,alt:e.source,className:"force-round rounded-full w-3.5 h-3.5 object-cover flex-shrink-0"}),(0,t.jsx)("span",{className:"text-white/70 text-[10px] font-medium truncate max-w-[80px]",children:e.source}),(0,t.jsxs)("span",{className:"text-white/30 text-[10px] flex-shrink-0",children:["· ",(0,u.formatRelativeTime)(new Date(e.publish_time).getTime())]})]}),(0,t.jsx)("p",{className:"text-white/50 text-[10px] line-clamp-2 mt-0.5 predx-serif",children:e.news_title})]})]},l))})]}),(0,t.jsx)(f,{heat:n}),(0,t.jsxs)("div",{className:"max-w-[230px]",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-3",children:[(0,t.jsx)(o.Layers,{className:"w-4 h-4 text-white"}),(0,t.jsx)("span",{className:"text-white text-[12px] uppercase tracking-wide font-semibold",children:c("Related Market")})]}),(0,t.jsxs)("p",{className:"text-white text-xs mb-3 flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"font-bold text-[24px]",children:x.marketCount}),(0,t.jsx)("span",{className:"font-medium text-white/50",children:c("Markets")})]}),h.map((e,l)=>(0,t.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 last:mb-0",children:[e.image&&(0,t.jsx)("img",{src:e.image,alt:"",className:"h-[22px] w-[22px] shrink-0 rounded object-cover"}),(0,t.jsx)("p",{className:"text-white/70 text-[10px] line-clamp-2 flex-1 min-w-0 predx-serif",children:e.title}),(0,t.jsxs)("div",{className:"text-white/50 text-[10px] flex-shrink-0 text-right",children:[(0,t.jsx)("div",{className:"text-white font-bold",children:(0,u.formatLargeNumber)(e.total_volume,1)}),(0,t.jsx)("div",{className:"font-medium",children:c("Vol.")})]})]},l))]})]})]})]})}function _(){var e,s,a,d,o,m,u;let{t:g,currentLanguage:f}=(0,v.useTranslation)(),{data:j,isLoading:N}=(0,r.useQuery)({queryKey:["bannerFeedEvents",18],queryFn:()=>(0,n.getFeedEvents)({limit:3,topic_id:18}),staleTime:3e5}),_=(null==j?void 0:j.feed)??[],[S,T]=(0,l.useState)(0),M=(0,l.useMemo)(()=>_.map(e=>{let t=e.news.slice().sort((e,t)=>new Date(t.publish_time).getTime()-new Date(e.publish_time).getTime()).slice(0,2),l=Array.from(new Map(e.news.flatMap(e=>e.events||[]).map(e=>[e.id,e])).values()).slice(0,2);return{event:e,sortedTop2:t,topMarkets:l}}),[_]),E=(0,l.useMemo)(()=>{let e=[];return M.forEach((t,l)=>{var s,a,r,n,i,d;let{event:o,sortedTop2:c,topMarkets:x}=t;[o.title,null==(s=c[0])?void 0:s.news_title,null==(a=c[0])?void 0:a.source,null==(r=c[1])?void 0:r.news_title,null==(n=c[1])?void 0:n.source,null==(i=x[0])?void 0:i.title,null==(d=x[1])?void 0:d.title].forEach((t,s)=>{t&&e.push({text:t,eventIdx:l,slot:s})})}),e},[M]),{data:C}=(0,r.useQuery)({queryKey:["banner-translate",_.map(e=>e.event_id).join(","),f],queryFn:()=>(0,i.translate)({text:E.map(e=>e.text),target:f}),enabled:"en"!==f&&_.length>0,staleTime:1/0}),q=(0,l.useMemo)(()=>{let e=null==C?void 0:C.translated;return M.map((t,l)=>{var s,a;let{event:r,sortedTop2:n,topMarkets:i}=t;if(!e)return{event:r,translatedTopMarkets:i};let d=new Map;E.forEach((t,s)=>{let{eventIdx:a,slot:r}=t;a===l&&e[s]&&d.set(r,e[s])});let o=null==(s=n[0])?void 0:s.news_id,c=null==(a=n[1])?void 0:a.news_id,x=r.news.map(e=>e.news_id===o?{...e,news_title:d.get(1)||e.news_title,source:d.get(2)||e.source}:e.news_id===c?{...e,news_title:d.get(3)||e.news_title,source:d.get(4)||e.source}:e),m=i.map((e,t)=>({...e,title:d.get(5+t)||e.title}));return{event:{...r,title:d.get(0)||r.title,news:x},translatedTopMarkets:m}})},[M,E,C]),{data:L}=(0,b.useSocialSignal)(w(_[0])),{data:z}=(0,b.useSocialSignal)(w(_[1])),{data:R}=(0,b.useSocialSignal)(w(_[2])),A=[null==L||null==(e=L.data)?void 0:e.heat,null==z||null==(s=z.data)?void 0:s.heat,null==R||null==(a=R.data)?void 0:a.heat];if(N)return(0,t.jsx)("div",{className:"py-4",children:(0,t.jsx)("div",{className:"mx-auto max-w-container px-3 sm:px-6 lg:px-8",children:(0,t.jsxs)("div",{className:"flex gap-3 h-[380px] items-center",children:[(0,t.jsx)("div",{className:"bg-background hidden lg:block w-[270px] flex-shrink-0",children:(0,t.jsx)(p.Skeleton,{className:"w-full h-[340px] rounded-[16px]"})}),(0,t.jsxs)("div",{className:"bg-background flex-1 min-w-0 h-full relative",children:[(0,t.jsx)(p.Skeleton,{className:"absolute inset-0 rounded-[16px]"}),(0,t.jsxs)("div",{className:"relative h-full flex flex-col px-6 pt-6 pb-4",children:[(0,t.jsx)(p.Skeleton,{className:"h-6 w-14 roun
1ded-md opacity-50"}),(0,t.jsx)("div",{className:"flex-1 flex items-center mt-3",children:(0,t.jsxs)("div",{className:"space-y-2.5 w-[60%]",children:[(0,t.jsx)(p.Skeleton,{className:"h-7 w-full rounded opacity-50"}),(0,t.jsx)(p.Skeleton,{className:"h-7 w-5/6 rounded opacity-50"}),(0,t.jsx)(p.Skeleton,{className:"h-7 w-4/6 rounded opacity-50"})]})}),(0,t.jsxs)("div",{className:"flex gap-4",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-[230px] max-w-[300px] space-y-2 pr-4 border-r border-white/10",children:[(0,t.jsx)(p.Skeleton,{className:"h-3.5 w-24 rounded opacity-50"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-full rounded opacity-50"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-4/5 rounded opacity-50"})]}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsx)(p.Skeleton,{className:"h-3.5 w-28 rounded opacity-50"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-full rounded opacity-50"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-3/4 rounded opacity-50"})]}),(0,t.jsxs)("div",{className:"max-w-[230px] space-y-2",children:[(0,t.jsx)(p.Skeleton,{className:"h-3.5 w-28 rounded opacity-50"}),(0,t.jsx)(p.Skeleton,{className:"h-8 w-16 rounded opacity-50"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-full rounded opacity-50"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-4/5 rounded opacity-50"})]})]})]})]}),(0,t.jsx)("div",{className:"bg-background hidden lg:block w-[270px] flex-shrink-0",children:(0,t.jsx)(p.Skeleton,{className:"w-full h-[340px] rounded-[16px]"})})]})})});if(0===_.length)return null;let F=(S-1+_.length)%_.length,K=(S+1)%_.length;return(0,t.jsx)("div",{className:"py-4",children:(0,t.jsxs)("div",{className:"mx-auto max-w-container px-3 sm:px-6 lg:px-8",children:[(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("div",{className:"flex gap-3 h-[380px] items-center",children:[_.length>1&&(0,t.jsx)("div",{className:"hidden lg:block w-[270px] flex-shrink-0 opacity-75 hover:opacity-90 transition-opacity",children:(0,t.jsx)(y,{event:(null==(d=q[F])?void 0:d.event)??_[F],heat:A[F]})}),(0,t.jsx)("div",{className:"flex-1 min-w-0 h-full",children:(0,t.jsx)(k,{event:(null==(o=q[S])?void 0:o.event)??_[S],heat:A[S],translatedTopMarkets:null==(m=q[S])?void 0:m.translatedTopMarkets})}),_.length>1&&(0,t.jsx)("div",{className:"hidden lg:block w-[270px] flex-shrink-0 opacity-75 hover:opacity-90 transition-opacity",children:(0,t.jsx)(y,{event:(null==(u=q[K])?void 0:u.event)??_[K],heat:A[K]})})]}),_.length>1&&(0,t.jsx)("button",{onClick:()=>T(F),className:"absolute left-[-16px] top-1/2 -translate-y-1/2 z-10 force-round rounded-full w-8 h-8 bg-background border border-border flex items-center justify-center hover:opacity-70 transition-colors","aria-label":g("Previous"),children:(0,t.jsx)(x.ChevronLeft,{className:"w-5 h-5 text-foreground hover:text-primary"})}),_.length>1&&(0,t.jsx)("button",{onClick:()=>T(K),className:"absolute right-[-16px] top-1/2 -translate-y-1/2 z-10 force-round rounded-full w-8 h-8 bg-background border border-border flex items-center justify-center hover:opacity-70 transition-colors","aria-label":g("Next"),children:(0,t.jsx)(c.ChevronRight,{className:"w-5 h-5 text-foreground hover:text-primary"})})]}),_.length>1&&(0,t.jsx)("div",{className:"flex items-center justify-center gap-2 mt-3",children:_.map((e,l)=>(0,t.jsx)("button",{onClick:()=>T(l),className:(0,h.cn)("h-1.5 rounded-full transition-all duration-300",l===S?"w-6 bg-primary":"w-4 bg-border"),"aria-label":g("Slide {n}",{n:l+1})},l))})]})})}var S=e.i(876219);
1function T(e){let{count:l=8}=e;return(0,t.jsx)(t.Fragment,{children:Array.from({length:l}).map((e,l)=>(0,t.jsxs)("div",{className:"bg-background rounded-2xl border border-gray-100 dark:border-gray-800 px-4 pt-3.5 pb-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3 mb-3",children:[(0,t.jsx)(p.Skeleton,{className:"w-[50px] h-[50px] rounded-[14px] flex-shrink-0"}),(0,t.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,t.jsx)(p.Skeleton,{className:"h-[18px] w-full"}),(0,t.jsx)(p.Skeleton,{className:"h-[18px] w-2/3"})]})]}),(0,t.jsx)("div",{className:"space-y-2 mb-3",children:[1,2].map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)(p.Skeleton,{className:"h-4 flex-1"}),(0,t.jsx)(p.Skeleton,{className:"flex-shrink-0 w-[100px] h-10 rounded-lg"})]},e))}),(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)(p.Skeleton,{className:"h-3.5 w-16"}),(0,t.jsx)(p.Skeleton,{className:"h-1 w-1 rounded-full"}),(0,t.jsx)(p.Skeleton,{className:"h-3.5 w-12"})]})]},l))})}var M=e.i(856173),E=e.i(283599),C=e.i(612276),q=e.i(618566),L=e.i(694164),z=e.i(836503),R=e.i(639057),A=e.i(168206),F=e.i(952571),K=e.i(129210),P=e.i(466841);function D(){return(0,t.jsxs)("div",{className:"px-4",children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2 pt-3",children:[(0,t.jsx)(p.Skeleton,{className:"h-5 w-28 rounded-full"}),(0,t.jsx)(p.Skeleton,{className:"h-5 w-20 rounded-full"}),(0,t.jsx)(p.Skeleton,{className:"h-5 w-36 rounded-full"}),(0,t.jsx)(p.Skeleton,{className:"h-5 w-24 rounded-full"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-3 py-3",children:[(0,t.jsx)(p.Skeleton,{className:"h-12 w-12 shrink-0 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-1.5",children:[(0,t.jsx)(p.Skeleton,{className:"h-3.5 w-full rounded"}),(0,t.jsx)(p.Skeleton,{className:"h-3.5 w-4/5 rounded"})]}),(0,t.jsxs)("div",{className:"w-[200px] shrink-0 flex flex-col gap-2 pl-3 border-l border-border-light",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p.Skeleton,{className:"h-5 w-32 rounded"}),(0,t.jsx)(p.Skeleton,{className:"h-4 w-8 rounded"})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(p.Skeleton,{className:"h-1.5 flex-1 rounded-full"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-14 rounded"})]})]}),(0,t.jsxs)("div",{className:"shrink-0 pl-3 border-l border-border-light flex flex-col gap-1.5",children:[(0,t.jsx)(p.Skeleton,{className:"h-3 w-14 rounded"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-10 rounded"})]}),(0,t.jsx)(p.Skeleton,{className:"w-[85px] shrink-0 h-10 rounded-lg"})]})]})}function I(){let{t:e}=(0,v.useTranslation)(),[s,a]=(0,l.useState)(!1),n=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!s)return;let e=e=>{n.current&&!n.current.contains(e.target)&&a(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[s]);let{data:i,isLoading:d}=(0,r.useQuery)({queryKey:["liveSignalsMarket"],queryFn:()=>(0,K.getSignalsList)({limit:3,offset:0,signal_type:"cross_validated"}),staleTime:6e4}),o=(null==i?void 0:i.signals)??[];return d||0!==o.length?(0,t.jsxs)("div",{className:"rounded-2xl bg-background overflow-hidden h-full",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between px-4 pt-4 pb-3 border-b border-border-card",children:[(0,t.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-base font-bold text-text-primary",children:e("Live Trading Signals")}),(0,t.jsxs)("div",{ref:n,className:"relative flex items-center",children:[(0,t.jsx)("button",{onClick:()=>a(e=>!e),className:"text-text-tertiary hover:text-text-secondary transition-colors",children:(0,t.jsx)(F.Info,{size:14})}),s&&(0,t.jsxs)("div",{className:"absolute left-1/2 -translate-x-1/2 top-full mt-2 z-50 w-60 bg-background text-text-primary text-xs px-3 py-2 border border-border",children:[e("Multi-factor signals from Smart Money, news, social sentiment."),(0,t.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-background rotate-45 border-l border-t border-border"})]})]})]}),(0,t.jsxs)(m.default,{href:"/signal",className:"flex items-center gap-0.5 text-sm text-text-secondary hover:text-primary transition-colors",children:[e("View All"),
1(0,t.jsx)(c.ChevronRight,{size:16})]})]}),d?(0,t.jsx)("div",{className:"px-4 pt-2.5 pb-3",children:Array.from({length:3}).map((e,l)=>(0,t.jsx)("div",{className:(0,h.cn)("border-border-card",0===l?"":"border-t"),children:(0,t.jsx)(D,{})},l))}):(0,t.jsx)("div",{className:"py-2",children:o.map((e,l)=>(0,t.jsx)(P.SignalCardMarket,{signal:e,isLast:2===l},e.signal_id))})]}):null}var $=e.i(635408),O=e.i(25652),Q=e.i(624040);async function V(e){let t={locale:"en"};return(null==e?void 0:e.category)&&"all"!==e.category&&(t.category=e.category),(await Q.apiClient.get("/api/v1/top-moving-now",{params:t})).data.markets}var H=e.i(912505);function G(){var e;let{t:s,currentLanguage:a}=(0,v.useTranslation)(),{data:n}=(0,E.default)(L.SELECTED_CATEGROTY),[d,o]=(0,l.useState)(!1),c=(0,l.useRef)(null);(0,l.useEffect)(()=>{if(!d)return;let e=e=>{c.current&&!c.current.contains(e.target)&&o(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[d]);let x=null==n?void 0:n.category_slug,{data:u,isLoading:g}=(0,r.useQuery)({queryKey:["top-moving-now",x??null],queryFn:()=>V({category:x??void 0}),enabled:void 0!==n,staleTime:6e5}),f=null==(e=u??[])?void 0:e.slice(0,6),{data:b}=(0,r.useQuery)({queryKey:["top-moving-now-translate",f.map(e=>e.market_id),a],queryFn:()=>(0,i.translate)({text:f.map(e=>(e.question??"").slice(0,5e3)),target:a}),enabled:f.length>0&&"en"!==a,staleTime:1/0,retry:1}),j=null==b?void 0:b.translated;return(0,t.jsxs)("div",{className:"rounded-2xl bg-background shadow-sm overflow-hidden h-full flex flex-col",children:[(0,t.jsxs)("div",{className:"px-4 pt-4 pb-3 border-b border-border-card flex items-center gap-1.5",children:[(0,t.jsx)("span",{className:"text-base font-bold text-text-primary",children:s("Top Moving Now")}),(0,t.jsxs)("div",{ref:c,className:"relative flex items-center",children:[(0,t.jsx)("button",{onClick:()=>o(e=>!e),className:"text-text-tertiary hover:text-text-secondary transition-colors",children:(0,t.jsx)(F.Info,{size:14})}),d&&(0,t.jsxs)("div",{className:"absolute left-1/2 -translate-x-1/2 top-full mt-2 z-50 w-56 rounded-lg bg-white dark:bg-gray-700 text-text-primary dark:text-white text-xs px-3 py-2 shadow-lg border border-border dark:border-transparent",children:[s("See the markets that moved the most in the last 24 hours"),(0,t.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-white dark:bg-gray-700 rotate-45 border-l border-t border-border dark:border-transparent"})]})]})]}),(0,t.jsx)("div",{className:(0,h.cn)("flex flex-col gap-1 pb-1 flex-1",(null==f?void 0:f.length)<=3?"pt-4":"pt-2"),children:g||void 0===n?Array.from({length:6}).map((e,l)=>(0,t.jsxs)("div",{className:(0,h.cn)("flex items-center gap-3 px-4 py-1.5"),children:[(0,t.jsx)(p.Skeleton,{className:"w-4 h-4 shrink-0"}),(0,t.jsx)(p.Skeleton,{className:"h-10 w-10 shrink-0 rounded-lg"}),(0,t.jsxs)("div",{className:"flex-1 min-w-0 space-y-1.5",children:[(0,t.jsx)(p.Skeleton,{className:"h-3 w-full"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-3/4"})]}),(0,t.jsxs)("div",{className:"shrink-0 space-y-1.5",children:[(0,t.jsx)(p.Skeleton,{className:"h-4 w-10 ml-auto"}),(0,t.jsx)(p.Skeleton,{className:"h-3 w-8 ml-auto"})]})]},l)):0===f.length?(0,t.jsx)(H.default,{type:"trade",title:s("No data available"),fill:!0}):(0,t.jsxs)(t.Fragment,{children:[f.map((e,l)=>{let s=`${Math.round(100*e.outcome_yes_price)}%`,a=e.price_change_24h,r=`${Math.abs(Math.round(100*a))}%`,n=a<0,i=(null==j?void 0:j[l])??e.question;return(0,t.jsxs)(m.default,{href:`/event/${e.event_slug??""}?tab=research&marketId=${e.market_id}`,className:"flex items-center py-1.5 gap-3 px-4 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:[(0,t.jsx)("span",{className:"w-3 shrink-0 text-sm font-medium text-text-tertiary text-left",children:l+1}),(0,t.jsx)("img",{src:e.image_url??"",alt:"",className:(0,h.cn)("shrink-0 rounded-lg object-cover bg-gray-100",(null==f?void 0:f.length)<=3?"h-12 w-12":"h-10 w-10"),onError:e=>{e.target.style.display="none"}}),(0,t.jsx)("p",{className:(0,h.cn)("flex-1 min-w-0 text-sm font-semibold text-text-primary leading-snug predx-serif",(null==f?void 0:f.length)>=5&&"line-clamp-2",(null==f?void 0:f.length)===4&&"line-clamp-3"),children:i}),(0,t.jsxs)("div",{className:"shrink-0 text-right",children:[(0,t.jsx)("div",{className:"text-base font-bold text-text-primary",children:s}),(0,t.jsxs)("div",{className:(0,h.cn)("flex items-center justify-end gap-0.5 text-xs font-medium",n?"text-red-500":"text-green-500"),children:[n?(0,t.jsx)($.TrendingDown,{size:11}):(0,t.jsx)(O.TrendingUp,{size:11}),r]})]})]},e.market_id)}),f.length<6&&(0,t.jsx)("div",{className:"flex-1 flex items-end justify-center pb-4",children:(0,t.jsx)("p",{className:"text-xs text-text-tertiary text-center px-4",children:s("Ranked by absolute price change in the last 24 hours")})})]})})]})}var B=e.i(711672);function U(e){let{selectedTag:s,onSelect:a,categoryId:n}=e,{t:i,currentLanguage:d}=(0,v.useTranslation)(),[o,m]=(0,l.useState)(!1),[u,h]=(0,l.useState)(!1),p=(0,l.useRef)(null),{data:g}=(0,r.useQuery)({queryKey:["hotTags",d],queryFn:()=>(0,B.fetchHotTags)(d),staleTime:36e5,enabled:!n}),{data:f}=(0,M.useTagsByCategoryId)(n),b=n?((null==f?void 0:f.tags)??[]).filter(e=>e.slug&&e.label).map(e=>({slug:e.slug,label:e.label})):(g??[]).map(e=>({slug:e.slug,label:e.label})),j=()=>{let e=p.current;if(!e)return;let{scrollLeft:t,scrollWidth:l,clientWidth:s}=e;m(t>0),h(t+s<l-1)};(0,l.useEffect)(()=>
1(j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)),[b]);let N=e=>{let t=p.current;t&&(t.scrollTo({left:t.scrollLeft+("left"===e?-200:200),behavior:"smooth"}),setTimeout(j,100))};return b&&0!==b.length?(0,t.jsxs)("div",{className:"relative mb-4 mt-1",children:[o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute left-0 top-0 bottom-0 w-12 z-10 pointer-events-none bg-gradient-to-r from-background to-transparent"}),(0,t.jsx)("button",{onClick:()=>N("left"),className:"absolute left-0 top-1/2 -translate-y-1/2 z-20 force-round rounded-full p-1 bg-background border border-border hover:bg-muted","aria-label":i("Scroll left"),children:(0,t.jsx)(x.ChevronLeft,{size:16,className:"text-gray-600 dark:text-gray-400"})})]}),(0,t.jsxs)("div",{ref:p,onScroll:j,className:"flex items-center gap-2 overflow-x-auto scrollbar-hide py-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:[(0,t.jsx)("button",{onClick:()=>a("all"),className:`flex-shrink-0 px-3 py-1.5 text-sm rounded-lg whitespace-nowrap transition-colors ${"all"===s?"bg-primary text-primary-foreground":"bg-background text-text-secondary hover:bg-muted"}`,children:i("All")}),b.map(e=>(0,t.jsx)("button",{onClick:()=>a(e.slug),className:`flex-shrink-0 px-3 py-1.5 text-sm rounded-lg whitespace-nowrap transition-colors ${s===e.slug?"bg-primary text-primary-foreground":"bg-background text-text-secondary hover:bg-muted"}`,children:e.label},e.slug))]}),u&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"absolute right-0 top-0 bottom-0 w-12 z-10 pointer-events-none bg-gradient-to-l from-background to-transparent"}),(0,t.jsx)("button",{onClick:()=>N("right"),className:"absolute right-0 top-1/2 -translate-y-1/2 z-20 force-round rounded-full p-1 bg-background border border-border hover:bg-muted","aria-label":i("Scroll right"),children:(0,t.jsx)(c.ChevronRight,{size:16,className:"text-gray-600 dark:text-gray-400"})})]})]}):null}var Y=e.i(44604);let W={category_id:-1,category_name:"All",category_slug:"all",created_at:null};function J(){let[e,r]=(0,l.useState)(!1),[n,i]=(0,l.useState)("all"),[d,o]=(0,l.useState)("all"),{data:c}=(0,E.default)(L.SELECTED_CATEGROTY),{trigger:x}=(0,C.default)(L.SELECTED_CATEGROTY),{data:m}=(0,E.default)(L.SELECTED_MARKETS_FILTERS),{t:u}=(0,v.useTranslation)(),{track:h}=(0,R.useTracking)(),p=(0,l.useRef)(!0),g=(0,q.useSearchParams)().get("category"),{data:f}=(0,M.useCategories)();(0,l.useEffect)(()=>{var e;if(!g)return;let t=null==f||null==(e=f.categories)?void 0:e.find(e=>e.category_slug===g);t&&t.category_slug!==(null==c?void 0:c.category_slug)&&x(t)},[g,f]),(0,l.useEffect)(()=>{g||x(W)},[g]),(0,l.useEffect)(()=>{i("all"),o("all")},[null==c?void 0:c.category_slug]),(0,l.useEffect)(()=>{h(A.TrackEvent.MARKET_VIEW,{})},[]),(0,l.useEffect)(()=>{if(void 0!==c||void 0!==m){if(p.current){p.current=!1;return}h(A.TrackEvent.MARKET_FILTER_CHANGE,{category:null==c?void 0:c.category_slug,status:null==m?void 0:m.status,topic:"all"!==d?d:void 0})}},[null==c?void 0:c.category_slug,d,null==m?void 0:m.status,null==m?void 0:m.end_date_start,null==m?void 0:m.end_date_end,null==m?void 0:m.liquidity_min,null==m?void 0:m.liquidity_max,null==m?void 0:m.volume_24hr_min,null==m?void 0:m.volume_24hr_max]);let b=(0,l.useMemo)(()=>{let e=null==c?void 0:c.category_slug;if(!e)return;let t={};return"all"!==e?(t.category=e,"all"!==d&&(t.tag_slug=d)):"all"!==n&&(t.tag_slug=n),t.event_status=({Active:"active",Resolved:"resolved",All:"all"})[(null==m?void 0:m.status)??"Active"]??"active",(null==m?void 0:m.end_date_start)&&(null==m?void 0:m.end_date_end)&&(t.end_date_start=m.end_date_start,t.end_date_end=m.end_date_end),(null==m?void 0:m.creation_date_start)&&(null==m?void 0:m.creation_date_end)&&(t.creation_date_start=m.creation_date_start,t.creation_date_end=m.creation_date_end),(null==m?void 0:m.liquidity_min)!==null&&(null==m?void 0:m.liquidity_min)!==void 0&&(t.liquidity_min=m.liquidity_min),(null==m?void 0:m.liquidity_max)!==null&&(null==m?void 0:m.liquidity_max)!==void 0&&(t.liquidity_max=m.liquidity_max),(null==m?void 0:m.volume_24hr_min)!==null&&(null==m?void 0:m.volume_24hr_min)!==void 0&&(t.volume_24hr_min=m.volume_24hr_min),(null==m?void 0:m.volume_24hr_max)!==null&&(null==m?void 0:m.volume_24hr_max)!==void 0&&(t.volume_24hr_max=m.volume_24hr_max),t},[null==c?void 0:c.category_slug,n,d,null==m?void 0:m.status,null==m?void 0:m.end_date_start,null==m?void 0:m.end_date_end,null==m?void 0:m.creation_date_start,null==m?void 0:m.creation_date_end,null==m?void 0:m.liquidity_min,null==m?void 0:m.liquidity_max,null==m?void 0:m.volume_24hr_min,null==m?void 0:m.volume_24hr_max]),{data:j,fetchNextPage:N,hasNextPage:w,isFetchingNextPage:y,isLoading:k,isError:F,reload:K}=(0,M.usePaginatedSearchPolymarket)(b,20);return(0,t.jsxs)("div",{className:"min-h-screen bg-muted",children:[(0,t.jsx)(_,{}),(0,t.jsx)("div",{className:"pb-4",children:(0,t.jsxs)("div",{className:"mx-auto max-w-container px-3 sm:px-6 lg:px-8 flex flex-col lg:flex-row items-stretch gap-4",children:[(0,t.jsx)("div",{className:"flex-[2] min-w-0 
1w-full",children:(0,t.jsx)(I,{})}),(0,t.jsx)("div",{className:"flex-[1] min-w-0 w-full",children:(0,t.jsx)(G,{})})]})}),(0,t.jsxs)("div",{className:"mx-auto max-w-container px-3 sm:px-6 lg:px-8",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between py-2",children:[(0,t.jsx)("div",{className:"text-[18px] font-bold text-text-primary",children:u("All markets")}),(0,t.jsx)("button",{onClick:()=>r(e=>!e),className:`flex items-center gap-1.5 h-8 px-2 bg-background text-sm border border-border transition-colors ${e?"text-primary bg-primary/5":"text-text-secondary hover:text-primary"}`,children:(0,t.jsx)(s,{size:14})})]}),e&&(0,t.jsx)("div",{className:"pt-1 pb-3",children:(0,t.jsx)(a.default,{})}),(null==c?void 0:c.category_slug)==="all"&&(0,t.jsx)(U,{selectedTag:n,onSelect:i}),(null==c?void 0:c.category_slug)&&"all"!==c.category_slug&&(0,t.jsx)(U,{categoryId:c.category_id,selectedTag:d,onSelect:o}),k&&(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 pb-8",children:(0,t.jsx)(T,{count:12})}),!k&&j.length>0&&(0,t.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 sm:gap-4 pb-8",children:j.map((e,l)=>(0,t.jsx)(S.MarketCardV2,{data:e},e.event.id+"_"+l))}),w&&!F&&(0,t.jsx)("div",{className:"flex justify-center items-center py-8",children:(0,t.jsxs)("button",{onClick:N,disabled:y,className:"px-4 py-2 bg-background border border-border text-sm text-text-secondary hover:text-primary hover:border-primary transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[y&&(0,t.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-primary"}),u("Show more markets")]})}),!k&&0===j.length&&!F&&(0,t.jsx)("div",{className:"text-center py-20 text-text-secondary",children:u("No markets found")}),!w&&j.length>0&&(0,t.jsx)("div",{className:"text-center py-8 text-text-secondary",children:u("No more markets to load")}),0===j.length&&F&&(0,t.jsx)(z.default,{desc:u("Failed to load markets. Please try again later."),onRetry:K}),(0,t.jsx)(Y.default,{})]})]})}function X(){return(0,t.jsx)(l.Suspense,{fallback:null,children:(0,t.jsx)(J,{})})}e.s(["default",()=>X],736279)}]);

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.