vendor: 13,489 bytes, lines 1-11
1import{c as _,bi as b,bj as T,bk as k,bl as E,bm as A,bn as I,bo as X,u as P,j as s,A as $,d as U,aZ as S,ap as K,R as V,a as v,C as J,h as C,E as Z,r as z,o as ee,a4 as te,n as re,i as ne,s as W}from"./index-Bd0Su9Yd.js";import{P as ae}from"./PageContextBanner-B_MLJ1h6.js";import{A as se}from"./arrow-up-right-DM8uQCpc.js";import{A as ie}from"./arrow-down-right-CxlppB3B.js";import{M as oe}from"./minus-BcOKa_g1.js";import"./info-DeYX3SEk.js";/** 2 * @license lucide-react v0.462.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const ce=_("Bitcoin",[["path",{d:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",key:"yr8idg"}]]);/** 7 * @license lucide-react v0.462.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const de=_("Earth",[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);function j(t,e){var f,u,g,l;const r=T(),n=(e==null?void 0:e.weekStartsOn)??((u=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:u.weekStartsOn)??r.weekStartsOn??((l=(g=r.locale)==null?void 0:g.options)==null?void 0:l.weekStartsOn)??0,a=b(t),i=a.getDay(),d=(i<n?7:0)+i-n;return a.setDate(a.getDate()-d),a.setHours(0,0,0,0),a}function M(t){return j(t,{weekStartsOn:1})}function R(t){const e=b(t),r=e.getFullYear(),n=k(t,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const a=M(n),i=k(t,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const d=M(i);return e.getTime()>=a.getTime()?r+1:e.getTime()>=d.getTime()?r:r-1}function F(t){const e=b(t);return e.setHours(0,0,0,0),e}function ue(t,e){const r=F(t),n=F(e),a=+r-E(r),i=+n-E(n);return Math.round((a-i)/A)}function le(t){const e=R(t),r=k(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),M(r)}function me(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function fe(t){if(!me(t)&&typeof t!="number")return!1;const e=b(t);return!isNaN(Number(e))}function he(t){const e=b(t),r=k(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}function ge(t){const e=b(t);return ue(e,he(e))+1}function xe(t){const e=b(t),r=+M(e)-+le(e);return Math.round(r/I)+1}function G(t,e){var l,o,x,w;const r=b(t),n=r.getFullYear(),a=T(),i=(e==null?void 0:e.firstWeekContainsDate)??((o=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:o.firstWeekContainsDate)??a.firstWeekContainsDate??((w=(x=a.locale)==null?void 0:x.options)==null?void 0:w.firstWeekContainsDate)??1,d=k(t,0);d.setFullYear(n+1,0,i),d.setHours(0,0,0,0);const f=j(d,e),u=k(t,0);u.setFullYear(n,0,i),u.setHours(0,0,0,0);const g=j(u,e);return r.getTime()>=f.getTime()?n+1:r.getTime()>=g.getTime()?n:n-1}function be(t,e){var f,u,g,l;const r=T(),n=(e==null?void 0:e.firstWeekContainsDate)??((u=(f=e==null?void 0:e.locale)==null?void 0:f.options)==null?void 0:u.firstWeekContainsDate)??r.firstWeekContainsDate??((l=(g=r.locale)==null?void 0:g.options)==null?void 0:l.firstWeekContainsDate)??1,a=G(t,e),i=k(t,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),j(i,e)}function we(t,e){const r=b(t),n=+j(r,e)-+be(r,e);return Math.round(n/I)+1}function c(t,e){const r=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return r+n}const p={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return c(e==="yy"?n%100:n,e.length)},M(t,e){const r=t.getMonth();return e==="M"?String(r+1):c(r+1,2)},d(t,e){return c(t.getDate(),e.length)},a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return c(t.getHours()%12||12,e.length)},H(t,e){return c(t.getHours(),e.length)},m(t,e){return c(t.getMinutes(),e.length)},s(t,e){return c(t.getSeconds(),e.length)},S(t,e){const r=e.length,n=t.getMilliseconds(),a=Math.trunc(n*Math.pow(10,r-3));return c(a,e.length)}},O={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},q={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){const n=t.getFullYear(),a=n>0?n:1-n;return r.ordinalNumber(a,{unit:"year"})}return p.y(t,e)},Y:function(t,e,r,n){const a=G(t,n),i=a>0?a:1-a;if(e==="YY"){const d=i%100;return c(d,2)}return e==="Yo"?r.ordinalNumber(i,{unit:"year"}):c(i,e.length)},R:function(t,e){const r=R(t);return c(r,e.length)},u:function(t,e){const r=t.getFullYear();return c(r,e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return c(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return c(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return p.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return c(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const a=we(t,n);return e==="wo"?r.ordinalNumber(a,{unit:"week"}):c(a,e.length)},I:function(t,e,r){const n=xe(t);return e==="Io"?r.ordinalNumber(n,{unit:"week"}):c(n,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getDate(),{unit:"date"}):p.d(t,e)},D:function(t,e,r){const n=ge(t);return e==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):c(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return c(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});case"eeee":default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return c(i,e.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});case"cccc":default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return c(a,e.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let a;switch(n===12?a=O.noon:n===0?a=O.midnight:a=n/12>=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let a;switch(n>=17?a=O.evening:n>=12?a=O.afternoon:n>=4?a=O.morning:a=O.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return p.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getHours(),{unit:"hour"}):p.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return e==="Ko"?r.ordinalNumber(n,{unit:"hour"}):c(n,e.length)},k:function(t,e,r){let n=t.getHours();return n===0&&(n=24),e==="ko"?r.ordinalNumber(n,{unit:"hour"}):c(n,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):p.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getSeconds(),{unit:"second"}):p.s(t,e)},S:function(t,e){return p.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return L(n);case"XXXX":case"XX":return y(n);case"XXXXX":case"XXX":default:return y(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return L(n);case"xxxx":case"xx":return y(n);case"xxxxx":case"xxx":default:return y(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+B(n,":");case"OOOO":default:return"GMT"+y(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+B(n,":");case"zzzz":default:return"GMT"+y(n,":")}},t:function(t,e,r){const n=Math.trunc(t.getTime()/1e3);return c(n,e.length)},T:function(t,e,r){const n=t.getTime();return c(n,e.length)}};function B(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=Math.trunc(n/60),i=n%60;return i===0?r+String(a):r+String(a)+e+c(i,2)}function L(t,e){return t%60===0?(t>0?"-":"+")+c(Math.abs(t)/60,2):y(t,e)}function y(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),a=c(Math.trunc(n/60),2),i=c(n%60,2);return r+a+e+i}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},Q=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},pe=(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],a=r[2];if(!a)return H(t,e);let i;switch(n){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",H(n,e)).replace("{{time}}",Q(a,e))},ye={p:Q,P:pe},ke=/^D+$/,Ne=/^Y+$/,Oe=["D","DD","YY","YYYY"];function ve(t){return ke.test(t)}function je(t){return Ne.test(t)}function Me(t,e,r){const n=Te(t,e,r);if(console.warn(n),Oe.includes(t))throw new RangeError(n)}function Te(t,e,r){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const De=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ye=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Ee=/^'([^]*?)'?$/,Pe=/''/g,Se=/[a-zA-Z]/;function Ce(t,e,r){var l,o,x,w;const n=T(),a=n.locale??X,i=n.firstWeekContainsDate??((o=(l=n.locale)==null?void 0:l.options)==null?void 0:o.firstWeekContainsDate)??1,d=n.weekStartsOn??((w=(x=n.locale)==null?void 0:x.options)==null?void 0:w.weekStartsOn)??0,f=b(t);if(!fe(f))throw new RangeError("Invalid time value");let u=e.match(Ye).map(h=>{const m=h[0];if(m==="p"||m==="P"){const N=ye[m];return N(h,a.formatLong)}return h}).join("").match(De).map(h=>{if(h==="''")return{isToken:!1,value:"'"};const m=h[0];if(m==="'")return{isToken:!1,value:We(h)};if(q[m])return{isToken:!0,value:h};
11if(m.match(Se))throw new RangeError("Format string contains an unescaped latin alphabet character `"+m+"`");return{isToken:!1,value:h}});a.localize.preprocessor&&(u=a.localize.preprocessor(f,u));const g={firstWeekContainsDate:i,weekStartsOn:d,locale:a};return u.map(h=>{if(!h.isToken)return h.value;const m=h.value;(je(m)||ve(m))&&Me(m,e,String(t));const N=q[m[0]];return N(f,m,a.localize,g)}).join("")}function We(t){const e=t.match(Ee);return e?e[1].replace(Pe,"'"):t}const Fe={indices:{label:"Major Indices",icon:ee,color:"text-primary"},movers:{label:"Top Movers",icon:te,color:"text-orange-400"},macro:{label:"Economy & Fed",icon:re,color:"text-blue-400"},geopolitics:{label:"Geopolitics",icon:de,color:"text-amber-400"},crypto:{label:"Crypto",icon:ce,color:"text-purple-400"},commodities:{label:"Commodities",icon:ne,color:"text-emerald-400"}};function qe(t){const e=/(?:\*\*|##\s*)([A-Z]+):?\s*\**/g,r=[];let n;for(;(n=e.exec(t))!==null;)r.push({key:n[1].toLowerCase(),start:n.index});if(r.length===0)return[];const a=[];for(let i=0;i<r.length;i++){const d=r[i].key,f=Fe[d];if(!f)continue;const u=i<r.length-1?r[i+1].start:t.length,g=t.indexOf("**",r[i].start+2),l=g!==-1?t.indexOf("**",g+2):r[i].start;let o=t.slice(l!==-1?l+2:r[i].start,u).trim();o=o.replace(/^\s*[-:]\s*/,"").replace(/\*\*/g,"").replace(/^#+\s*/gm,"").trim(),o&&a.push({key:d,...f,content:o})}return a}function Be(t){return t.split(/(\+?\-?\d+[,.]?\d*%|\$[\d,.]+[BMKT]?)/g).map((e,r)=>{if(/^[+-]?\d/.test(e)&&e.includes("%")){const n=e.startsWith("-");return s.jsx("span",{className:v("font-mono font-semibold",n?"text-loss":"text-gain"),children:e},r)}return/^\$/.test(e)?s.jsx("span",{className:"font-mono font-semibold text-primary",children:e},r):e})}function Xe(){const{data:t,isLoading:e,error:r,refetch:n,isFetching:a}=P({queryKey:["daily-brief-page"],queryFn:async()=>{const{data:o,error:x}=await W.from("market_briefing_cache").select("briefing, fetched_at").eq("id","latest").single();if(x)throw x;return o},staleTime:3e5,refetchInterval:6e5}),i=t!=null&&t.briefing?qe(t.briefing):[],d=t!=null&&t.fetched_at?new Date(t.fetched_at):null,f=d?Date.now()-d.getTime()>12*60*60*1e3:!1,{data:u,isFetching:g}=P({queryKey:["daily-brief-headlines"],queryFn:async()=>{const{data:o,error:x}=await W.functions.invoke("news-feed");if(x)throw x;return o},staleTime:2*60*1e3,refetchInterval:5*60*1e3}),l=((u==null?void 0:u.articles)||[]).slice(0,12);return s.jsxs($,{children:[s.jsx(U,{title:"Daily Market Brief | Lemon Juice Labs",description:"AI-curated daily market briefing with real-time index data, top movers, macro insights, and geopolitics. Updated every few hours."}),s.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-6 space-y-5",children:[s.jsx(ae,{pageKey:"dashboard"}),s.jsxs("div",{className:"flex items-start justify-between",children:[s.jsxs("div",{children:[s.jsxs("h1",{className:"text-xl md:text-2xl font-bold text-foreground flex items-center gap-2",children:[s.jsx(S,{className:"h-5 w-5 text-primary"}),"Daily Market Brief"]}),s.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"AI-curated from live market data. No opinions, just numbers."})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(K,{title:"Daily Market Brief",context:"Your morning market brief â before the bell"}),s.jsxs("button",{onClick:()=>n(),disabled:a,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors rounded-lg border border-border px-3 py-1.5",children:[s.jsx(V,{className:v("h-3.5 w-3.5",a&&"animate-spin")}),"Refresh"]})]})]}),d&&s.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground",children:[s.jsx(J,{className:"h-3 w-3"}),s.jsxs("span",{children:["Updated ",C(d,{addSuffix:!0})," · ",Ce(d,"MMM d, h:mm a")]}),f&&s.jsx("span",{className:"ml-2 rounded bg-amber-500/15 text-amber-500 px-1.5 py-0.5 text-[10px] font-medium",children:"STALE"})]}),e&&s.jsx("div",{className:"space-y-4",children:[1,2,3].map(o=>s.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 animate-pulse",children:[s.jsx("div",{className:"h-4 w-24 bg-muted rounded mb-3"}),s.jsx("div",{className:"h-3 w-full bg-muted rounded mb-2"}),s.jsx("div",{className:"h-3 w-3/4 bg-muted rounded"})]},o))}),r&&!t&&s.jsx("div",{className:"rounded-xl border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive",children:"Failed to load briefing. Try refreshing."}),!e&&!r&&i.length===0&&s.jsx("div",{className:"rounded-xl border border-border bg-card p-6 text-center text-sm text-muted-foreground",children:"No briefing available yet. The AI generates a new brief every few hours during market days."}),i.length>0&&s.jsx("div",{className:"space-y-3",children:i.map(o=>{const x=o.icon;return s.jsxs("div",{className:"rounded-xl border border-border bg-card p-4 transition-colors hover:border-primary/20",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx("div",{className:v("flex h-7 w-7 items-center justify-center rounded-lg bg-card border border-border"),children:s.jsx(x,{className:v("h-3.5 w-3.5",o.color)})}),s.jsx("h2",{className:v("text-sm font-bold uppercase tracking-wide",o.color),children:o.label})]}
11),s.jsx("p",{className:"text-[13px] md:text-sm text-foreground/85 leading-relaxed",children:Be(o.content)})]},o.key)})}),s.jsxs("div",{className:"space-y-3 pt-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("h2",{className:"text-sm font-bold uppercase tracking-wide text-foreground flex items-center gap-2",children:[s.jsx(S,{className:"h-4 w-4 text-primary"}),"Live Headlines"]}),s.jsx("span",{className:"text-[11px] text-muted-foreground",children:g?"Updatingâ¦":`${l.length} from trusted sources`})]}),l.length===0&&!g&&s.jsx("div",{className:"rounded-xl border border-border bg-card p-4 text-sm text-muted-foreground",children:"No fresh headlines available right now."}),s.jsx("div",{className:"grid gap-2",children:l.map((o,x)=>{var m,N,D,Y;const w=((m=o.sentiment)==null?void 0:m.label)==="bullish"?se:((N=o.sentiment)==null?void 0:N.label)==="bearish"?ie:oe,h=((D=o.sentiment)==null?void 0:D.label)==="bullish"?"text-gain":((Y=o.sentiment)==null?void 0:Y.label)==="bearish"?"text-loss":"text-muted-foreground";return s.jsx(He,{article:o,SentIcon:w,sentColor:h,children:s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(w,{className:v("h-3.5 w-3.5 mt-0.5 shrink-0",h)}),s.jsx("p",{className:"text-sm font-semibold text-foreground leading-snug group-hover:text-primary line-clamp-2",children:o.title})]}),o.description&&s.jsx("p",{className:"text-[12px] text-muted-foreground mt-1 line-clamp-2 pl-5",children:o.description}),s.jsxs("div",{className:"flex items-center gap-2 mt-1.5 pl-5 text-[11px] text-muted-foreground",children:[s.jsx("span",{className:"font-medium text-foreground/70",children:o.source}),s.jsx("span",{children:"·"}),s.jsx("span",{children:C(new Date(o.publishedAt),{addSuffix:!0})}),o.ticker&&s.jsxs(s.Fragment,{children:[s.jsx("span",{children:"·"}),s.jsxs("span",{className:"font-mono text-primary",children:["$",o.ticker]})]}),s.jsx(Z,{className:"h-3 w-3 ml-auto opacity-0 group-hover:opacity-100 transition-opacity"})]})]})},`${o.url}-${x}`)})})]}),s.jsxs("div",{className:"rounded-lg border border-border bg-muted/30 px-4 py-3 text-[11px] text-muted-foreground space-y-1",children:[s.jsx("p",{className:"font-medium text-foreground/70",children:"Data sources"}),s.jsx("p",{children:"Index and equity data via Polygon.io and Twelve Data. Macroeconomic indicators from FRED (Federal Reserve Economic Data). Crypto prices via CoinGecko. Commodities data via Yahoo Finance. Live headlines from Finnhub (Reuters, Bloomberg, CNBC, WSJ, MarketWatch, FT, Benzinga, AP). Briefing synthesized by AI from verified financial news."}),s.jsx("p",{className:"italic",children:"This briefing is AI-generated from real market data and does not constitute financial advice. Numbers reflect conditions at the time of generation and may have changed."})]})]})]})}function Le(t){if(!t)return!0;const e=t.toLowerCase();return e.includes("s.yimg.com/cv/apiv2/default")||e.includes("yahoo_finance")||e.includes("/default-")||e.endsWith(".svg")===!1&&e.includes("logo")&&e.includes("yahoo")}function He({article:t,children:e}){const[r,n]=z.useState(!1),a=!!t.thumbnail&&!r&&!Le(t.thumbnail);return s.jsxs("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",className:"group rounded-xl border border-border bg-card p-3 hover:border-primary/30 transition-colors flex gap-3",children:[a&&s.jsx("img",{src:t.thumbnail,alt:"",loading:"lazy",referrerPolicy:"no-referrer",className:"h-16 w-16 rounded-md object-cover shrink-0 hidden sm:block bg-muted",onError:()=>n(!0)}),e]})}export{Xe 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.