1import{n as M}from"./home-feed.VfUojGtq.js";import{n as E}from"./news-summary.LiqrDFUF.js";import{s as j,n as q}from"./news-source-name.CeRCmk6O.js";(()=>{const f=document.querySelector('main[aria-label="The network feed"]'),m=f?.getAttribute("data-signup-base")||"",u=f?.querySelector("[data-feedlist]");if(!m||!u)return;const S=e=>{const r=Math.max(0,Math.floor(Date.now()/1e3-e));if(r<60)return"just now";const t=Math.floor(r/60);if(t<60)return t+"m ago";const n=Math.floor(t/60);if(n<24)return n+"h ago";const o=Math.floor(n/24);return o<30?o+"d ago":o<365?Math.max(1,Math.round(o/30))+"mo ago":Math.max(1,Math.round(o/365))+"y ago"},a=(e,r,t)=>{const n=document.createElement(e);return r&&(n.className=r),t!==void 0&&(n.textContent=t),n};let l=new Map;const p=e=>{const r=a("article","feed-item news-row"+(e.image?"":" nocover"));r.setAttribute("data-fi",""),r.setAttribute("data-kind","news");const t=a("div","feed-main"),n=a("div","feed-meta"),o=q(e.source,l);n.append(a("span","kind-tag kt-news","news"+(o?" · "+o:"")));const s=typeof e.category=="string"?e.category.trim():"";s&&n.append(a("span","kind-tag kt-cat",s)),n.append(a("span","tmeta",typeof e.publishedAt=="number"?S(e.publishedAt):""));const d="/news/item/?g="+encodeURIComponent(String(e.guid||""))+(e.source?"&s="+encodeURIComponent(String(e.source)):""),b=a("h2","feed-title"),y=a("a",void 0,String(e.title||"Untitled"));y.setAttribute("href",d),b.append(y),t.append(n,b);const v=E(e);v&&t.append(a("p","feed-ex",v));const A=a("div","feed-foot");A.append(a("span","fsp")),t.append(A),r.append(t);const i=a("a","feed-cover"+(e.image?"":" feed-cover-fb"));i.setAttribute("href",d),i.setAttribute("aria-hidden","true"),i.setAttribute("tabindex","-1");const c=document.createElement("img"),k=e.image?String(e.image).replace(/�*38;/g,"&").replace(/&/g,"&"):"";return c.src=k||"/brand/feature/feature-category.png",c.alt="",c.loading="lazy",c.decoding="async",c.addEventListener("error",()=>{c.src="/brand/feature/feature-category.png",i.classList.add("feed-cover-fb")},{once:!0}),i.append(c),r.append(i),r},g=document.querySelector("[data-latest-news]"),h=document.querySelector("[data-latest-news-list]"),w=()=>{g&&g.remove()};Promise.all([fetch(m+"/news/feed?limit=60").then(e=>e.ok?e.json():Promise.reject(new Error("bad status"))),fetch("/news-sources.json").then(e=>e.ok?e.json():null).catch(()=>null)]).then(([e,r])=>{const t=Array.isArray(e?.items)?e.items:[];if(!t.length){w();return}if(l=j(r),h){const s=a("div","feed-chunk");t.slice(0,6).forEach(d=>s.append(p(d))),h.replaceChildren(s)}const n=Array.from(u.querySelectorAll(".feed-chunk [data-fi]"));M(n.length,t.length).forEach((s,d)=>n[s]?.after(p(t[d]))),document.dispatchEvent(new Event("gbti:feed-updated"))}).catch(()=>{w()})})();
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.