PageSourceSearch

https://digg.com/_next/static/chunks/384ib2j9o6n7h.js?dpl=dpl_7KizRMkS8hiaeq9KCJTqcosxwVbT

js digg.com collected 2026-09-24 07:01:39 UTC 36,197 bytes, 6 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0d0df-a5ad-70b1-b9b3-2638483f429d")}catch(e){}}();;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="81417a34-06fe-f882-e98b-539c2a00e0c8")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,512390,729027,e=>{"use strict";var t=e.i(567590),r=e.i(237355),n=e.i(177917);let a=(0,n.createServerReference)("4080ce8e46cf2bbe2ac8ce20ef71a74f4e8fcaf8d3",n.callServer,void 0,n.findSourceMapURL,"subscribeToNewsletter");var i=e.i(668390),s=e.i(407953),l=e.i(479069);async function o(){try{var e;let t=await fetch("/api/newsletter/subscription-status",{cache:"no-store"}),r=await t.json();if(!(t.ok&&(e=r.state,"signed_out"===e||"subscribed"===e||"not_subscribed"===e||"unavailable"===e)))return"unavailable";return"signed_out"===r.state?"not_subscribed":r.state}catch{return"unavailable"}}i.default.env.VITEST;let u=function(){let{isLoaded:e,userId:t}=(0,s.useAuth)(),r=(0,l.useQuery)({queryFn:o,queryKey:["newsletter-subscription",e?t??"signed-out":"request-auth"],retry:!1});return r.isPending?"loading":r.data??"unavailable"};var d=e.i(467343),c=e.i(787360),m=e.i(517550);async function p(e){e.setStatus({kind:"pending"});let r=null;try{r=t.default.get_distinct_id?.()??null}catch{}let n=await a({email:e.email,marketingEmailFrequency:e.edition,source:e.source,posthogDistinctId:r});if(!n.ok){(0,m.recordProductEvent)("newsletter_subscribe_failed",{prompt:e.prompt,reason:n.reason,edition:e.edition,...e.surface&&{surface:e.surface}}),e.setStatus({kind:"error",message:n.error});return}if((0,m.recordProductEvent)("newsletter_prompt_submitted",{prompt:e.prompt,edition:e.edition,...e.surface&&{surface:e.surface},...void 0!==e.rung&&{rung:e.rung},...n.alreadySubscribed&&{already_subscribed:!0}}),n.alreadySubscribed){e.onSubscribed(),e.setStatus({kind:"already_subscribed",email:n.email});return}e.setStatus({kind:"sent",email:n.email})}e.s(["useNewsletterLadderSnapshot",0,function(){let[e,t]=(0,r.useState)(null),n=u();return((0,r.useEffect)(()=>{t((0,c.loadPromptState)())},[]),(0,r.useEffect)(()=>(0,c.onPromptStateChange)(()=>{t((0,c.loadPromptState)())}),[]),"loading"===n||"unavailable"===n)?null:e&&"subscribed"===n&&!e.subscribed?(0,d.registerSubscribed)(e):e},"useNewsletterPrompt",0,function({topic:e}){let[t,n]=(0,r.useState)(null),a=(0,r.useRef)(null),[i,s]=(0,r.useState)({open:!1,rung:1,variant:"first_ask"}),l=(0,r.useRef)(!1),o=(0,r.useRef)(!1),[u,h]=(0,r.useState)({kind:"idle"}),[f,g]=(0,r.useState)({kind:"idle"}),[b,w]=(0,r.useState)(!1),[v,x]=(0,r.useState)(null),[y,S]=(0,r.useState)(!1),j=(0,r.useCallback)(e=>{let t=e(a.current??(0,c.loadPromptState)());a.current=t,(0,c.savePromptState)(t),n(t)},[]);(0,r.useEffect)(()=>{let t=(0,d.registerActivity)((0,c.loadPromptState)(),Date.now());!("u"<typeof document)&&document.cookie.split("; ").some(e=>e.startsWith("digg_newsletter_subscribed="))&&(t=(0,d.registerSubscribed)(t));let r=new URL(window.location.href),i=!1;"1"===r.searchParams.get("newsletter_confirmed")&&(t=(0,d.registerSubscribed)(t),function(e){if("1"!==e.searchParams.get("newsletter_confirmed"))return!1;let t=`digg.newsletter.confirmed-banner-consumed.v1:${e.pathname}`;try{if("1"===window.sessionStorage.getItem(t))return!1;window.sessionStorage.setItem(t,"1")}catch{}return!0}(r)&&(w(!0),(0,m.recordProductEvent)("newsletter_subscribe_confirmed",{surface:"verify_redirect",topic:e})),r.searchParams.delete("newsletter_confirmed"),i=!0);let s=r.searchParams.get("newsletter_verify");("expired"===s||"invalid"===s||"retry"===s)&&(x(s),r.searchParams.delete("newsletter_verify"),i=!0),i&&window.history.replaceState(window.history.state,"",`${r.pathname}${r.search}${r.hash}`),a.current=t,(0,c.savePromptState)(t),n(t),S(!0)},[e]),(0,r.useEffect)(()=>
2{if(!b)return;let e=window.setTimeout(()=>{w(!1)},6e3);return()=>{window.clearTimeout(e)}},[b]),(0,r.useEffect)(()=>(0,c.onPromptStateChange)(()=>{let e=(0,c.loadPromptState)();a.current=e,n(e)}),[]),(0,r.useEffect)(()=>{if(y)return window.addEventListener("scroll",t),()=>{window.removeEventListener("scroll",t)};function t(){let r;if(l.current)return;let{current:n}=a;if(!n||!(r=document.querySelector('[data-newsletter-modal-trigger="true"]'))||!(r.getBoundingClientRect().top<=0))return;let i=(0,d.shouldShowCaptureModal)(n,Date.now(),!0,d.DEFAULT_LADDER_CONFIG);i.show&&(l.current=!0,s({open:!0,rung:i.rung,variant:i.variant}),(0,m.recordProductEvent)("newsletter_prompt_shown",{prompt:"capture_modal",rung:i.rung,variant:i.variant,topic:e}),window.removeEventListener("scroll",t))}},[y,e]);let k=(0,r.useCallback)(()=>{o.current||(o.current=!0,(0,m.recordProductEvent)("newsletter_prompt_shown",{prompt:"inline_card",surface:"end_of_feed",topic:e}))},[e]),C=(0,r.useCallback)(async(e,t,r)=>{await p({prompt:e,source:e,email:t,edition:r,..."capture_modal"===e&&{rung:i.rung},setStatus:"inline_card"===e?h:g,onSubscribed:()=>{j(d.registerSubscribed)}})},[j,i.rung]),_=(0,r.useCallback)(()=>{s(e=>({...e,open:!1})),"sent"!==f.kind&&"already_subscribed"!==f.kind&&((0,m.recordProductEvent)("newsletter_prompt_dismissed",{prompt:"capture_modal",rung:i.rung,variant:i.variant}),j(e=>(0,d.registerModalDismissal)(e,Date.now())))},[j,i.rung,i.variant,f.kind]),N=(0,r.useCallback)(()=>{s(e=>({...e,open:!1})),(0,m.recordProductEvent)("newsletter_prompt_dismissed",{prompt:"capture_modal",rung:i.rung,never_ask_again:!0}),j(d.registerNeverAskAgain)},[j,i.rung]);return{ready:null!==t,subscribed:t?.subscribed??!1,inlineCardVisible:!!t&&(0,d.shouldShowInlineCard)(t,Date.now()),confirmedBanner:b,verifyError:v,inlineStatus:u,modalStatus:f,modal:i,recordInlineShown:k,submitInline:(e,t)=>void C("inline_card",e,t),submitModal:(e,t)=>void C("capture_modal",e,t),dismissModal:_,neverAskAgain:N}},"useNewsletterSignup",0,function(e){let[t,n]=(0,r.useState)({kind:"idle"});return{status:t,submit:(0,r.useCallback)(async(t,r)=>{await p({prompt:"inline_card",source:"sidebar"===e?"sidebar_card":"inl
2ine_card",surface:e,email:t,edition:r,setStatus:n,onSubscribed:()=>{(0,c.savePromptState)((0,d.registerSubscribed)((0,c.loadPromptState)()))}})},[e])}}],512390);var h=e.i(947500),f=e.i(981614),g=e.i(678090);let b=(0,e.i(540796).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var w=e.i(466691),v=e.i(924911),x=e.i(380662),y=e.i(925466),S=e.i(767841),j=e.i(807103),k=e.i(559137),C=e.i(78829);e.s(["NewsletterSignupForm",0,({status:e,onSubmit:t,defaultEdition:n=k.DEFAULT_MARKETING_EMAIL_FREQUENCY,compact:a=!1,stacked:i=!1,variant:s="default",hideEditionPicker:l=!1,hideError:o=!1,submitLabel:u="Subscribe",idPrefix:d})=>{let[c,m]=(0,r.useState)(""),[p,_]=(0,r.useState)(n),N="blueCard"===s;if("sent"===e.kind)return(0,h.jsxs)("p",{className:(0,C.cn)("font-mono text-sm text-muted-foreground",N&&"text-white/80 dark:text-white/80"),"aria-live":"polite",children:["Check your inbox — we sent a confirmation link to"," ",(0,h.jsx)("span",{className:(0,C.cn)("text-foreground",N&&"text-white dark:text-white"),children:e.email}),"."]});if("already_subscribed"===e.kind)return(0,h.jsxs)("p",{className:(0,C.cn)("font-mono text-sm text-muted-foreground",N&&"text-white/80 dark:text-white/80"),"aria-live":"polite",children:[(0,h.jsx)("span",{className:(0,C.cn)("text-foreground",N&&"text-white dark:text-white"),children:e.email})," ","is already subscribed. Manage preferences from any newsletter email."]});let E="pending"===e.kind,P="figmaCard"===s,I=N||P&&(c.trim().length>0||E);return(0,h.jsxs)("form",{className:(0,C.cn)("flex flex-col",N?"gap-3":P?"gap-6":a?"gap-2.5":"gap-3"),onSubmit:e=>{e.preventDefault(),E||t(c,p)},children:[l?null:N?(0,h.jsx)(j.ToggleGroup,{type:"single",value:p,onValueChange:e=>{let t=(0,k.normalizeMarketingEmailFrequency)(e);t&&_(t)},className:"grid w-full grid-cols-2 gap-1 rounded-full border border-white/20 bg-white/10 p-1","aria-label":"Email edition",children:k.MARKETING_EMAIL_FREQUENCY_OPTIONS.map(e=>(0,h.jsx)(j.ToggleGroupItem,{value:e.value,disabled:E,className:"h-8 w-full min-w-0 rounded-full px-2 text-xs font-semibold text-white hover:bg-white/10 hover:text-white focus-visible:border-white/60 focus-visible:ring-white/40 data-[state=on]:bg-white data-[state=on]:text-blue-800 dark:text-white dark:data-[state=on]:text-blue-800",children:"daily"===e.value?"Daily Rundown":"Saturday Edition"},e.value))}):(0,h.jsx)(S.RadioGroup,{value:p,onValueChange:e=>{let t=(0,k.normalizeMarketingEmailFrequency)(e);t&&_(t)},className:(0,C.cn)(P?"flex flex-col gap-3":"gap-x-5 gap-y-2",!P&&(i?"flex flex-col":"flex flex-wrap items-center")),"aria-label":"Email edition",children:k.MARKETING_EMAIL_FREQUENCY_OPTIONS.map(e=>{let t=P&&"daily"===e.value?"Daily Rundown":P?"Saturday Edition":e.shortLabel,r=P&&"daily"===e.value?null:P&&"saturday_morning"===e.value?"(delivers Saturday)":e.shortDescription;return(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(S.RadioGroupItem,{id:`${d}-${e.value}`,value:e.value,disabled:E,className:(0,C.cn)(P&&"border-border bg-background data-checked:border-primary data-checked:bg-primary")}),(0,h.jsxs)(y.Label,{htmlFor:`${d}-${e.value}`,className:(0,C.cn)("gap-1.5 font-normal",P&&"items-baseline font-sans"),title:e.description,children:[(0,h.jsx)("span",{className:(0,C.cn)("text-sm font-medium text-foreground",P&&"text-sm font-medium"),children:t}),r?(0,h.jsx)("span",{className:(0,C.cn)("font-mono text-xs text-muted-foreground",P&&"font-sans text-xs text-muted-foreground",!P&&(i?"inline":"hidden sm:inline")),children:r}):null]})]},e.value)})}),P||N?(0,h.jsxs)(x.InputGroup,{className:(0,C.cn)(N&&"h-11 rounded-full border-white bg-white shadow-none has-[[data-slot=input-group-control]:focus-visible]:border-white has-[[data-slot=input-group-control]:focus-visible]:ring-white/40 dark:bg-white"),children:[(0,h.jsx)(x.InputGroupInput,{type:"email",required:!0,autoComplete:"email",placeholder:"[email protected]",value:c,onChange:e=>m(e.target.value),disabled:E,"aria-label":"Email address",className:(0,C.cn)(N&&"px-4 text-blue-950 placeholder:text-blue-900/50 dark:text-blue-950 dar
2k:placeholder:text-blue-900/50")}),I?(0,h.jsx)(x.InputGroupAddon,{align:"inline-end",children:(0,h.jsx)(x.InputGroupButton,{type:"submit",variant:"default",size:N?"sm":"icon-sm",disabled:E,"aria-label":E?"Sending newsletter confirmation":"Submit newsletter signup",className:(0,C.cn)(N&&"h-9 justify-center gap-0 overflow-hidden rounded-full",N&&(E?"w-9 px-0":"w-24 px-3")),children:N?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(f.LoaderCircle,{"aria-hidden":!0,className:(0,C.cn)("shrink-0 transition-opacity duration-150 ease-out motion-reduce:transition-none",E?"size-4 animate-spin opacity-100":"size-0 opacity-0")}),(0,h.jsx)("span",{className:(0,C.cn)("transition-opacity duration-150 ease-out motion-reduce:transition-none",E?"w-0 opacity-0":"opacity-100"),children:u})]}):(0,h.jsx)(h.Fragment,{children:E?(0,h.jsx)(f.LoaderCircle,{"aria-hidden":!0,className:"animate-spin"}):(0,h.jsx)(b,{"aria-hidden":!0})})})}):null]}):(0,h.jsxs)("div",{className:(0,C.cn)("flex flex-col gap-2",!i&&"sm:flex-row"),children:[(0,h.jsx)(v.Input,{type:"email",required:!0,autoComplete:"email",placeholder:"[email protected]",value:c,onChange:e=>m(e.target.value),disabled:E,"aria-label":"Email address",className:(0,C.cn)("h-9",!i&&"sm:max-w-64")}),(0,h.jsxs)(w.Button,{type:"submit",size:"sm",disabled:E,className:"h-9 shrink-0",children:[(0,h.jsx)(g.Mail,{"aria-hidden":!0,className:"size-4"}),E?"Sending…":u]})]}),"error"!==e.kind||o?null:(0,h.jsx)("p",{className:(0,C.cn)("font-mono text-xs text-destructive",N&&"text-red-100 dark:text-red-100"),role:"alert",children:e.message})]})}],729027)},317896,626448,57676,51123,490471,373364,e=>{"use strict";var t=e.i(947500);let r="America/Los_Angeles",n=[{label:"Best",value:"best"},{label:"Hot",value:"hot"},{label:"Newest",value:"newest"},{label:"Top",value:"top"}],a=[{label:"Today",value:"today"},{label:"Past 24 hours",value:"24h"},{label:"Past 7 days",value:"7d"},{label:"Past 30 days",value:"30d"},{label:"Past year",value:"1y"},{label:"All time",value:"all"}],i="today";function s(e,t,r,n="top"){let a=new URL(e,"https://digg.local");return(a.search="",t===n&&("top"!==t||r===i))?a.pathname:(a.searchParams.set("view",t),"top"===t&&r&&a.searchParams.set("range",r),`${a.pathname}${a.search}`)}function l(e,t="top"){return n.some(t=>t.value===e)?e:t}function o(e){return a.some(t=>t.value===e)?e:i}function u(e){if(!e||!/^\d{4}-\d{2}-\d{2}$/u.test(e))return null;let[t,r,n]=e.split("-").map(Number);return new Date(Date.UTC(t,r-1,n)).toISOString().slice(0,10)===e?e:null}function d(e){if(!Number.isFinite(e.getTime()))throw TypeError("[feed] invalid instant");return new Intl.DateTimeFormat("en-CA",{day:"2-digit",month:"2-digit",timeZone:r,year:"numeric"}).format(e)}function c(e,t){let r=u(e);if(!r||!Number.isInteger(t))throw Error(`[feed] invalid Pacific calendar operation: ${e}, ${t}`);let[n,a,i]=r.split("-").map(Number);return new Date(Date.UTC(n,a-1,i+t)).toISOString().slice(0,10)}function m(e,t){let r,n,a=(r=new Intl.DateTimeFormat("en-US",{day:"2-digit",hour:"2-digit",hourCycle:"h23",minute:"2-digit",month:"2-digit",second:"2-digit",timeZone:t,year:"numeric"}).formatToParts(e),{day:(n=e=>Number(r.find(t=>t.type===e)?.value??0))("day"),hour:n("hour"),minute:n("minute"),month:n("month"),second:n("second"),year:n("year")});return Date.UTC(a.year,a.month-1,a.day,a.hour,a.minute,a.second)-e.getTime()}function p(e,t,n){let a,i;return i=new Date((a=new Date(Date.UTC(e,t-1,n,0))).getTime()-m(a,r)),new Date(a.getTime()-m(i,r))}var h=e.i(653955);e.i(784995);var f=e.i(439414),g=e.i(466691),b=e.i(84818),w=e.i(300033),v=e.i(237355);let x=[0,2,3,5,10];e.s(["FEED_SOURCE_FILTER_OPTIONS",0,x,"useFeedSourceFilter",0,function({isAdmin:e,posts:t,sections:r}){let[n,a]=(0,v.useState)(0),i=e?n:0,s=e=>Math.max(e.postCount,e.sourcePostCount??0)>=i;return{minimumSources:i,onMinimumSourcesChange:t=>{let r=x.find(e=>String(e)===t);e&&void 0!==r&&a(r)},posts:i?t.filter(s):t,sections:i?r.map(e=>({...e,posts:e.posts.filter(s)})).filter(e=>e.posts.length>0):r}}],626448);let y=({actions:e,filters:r})=>(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3 sm:gap-4","data-slot":"topic-feed-toolbar",children:[(0,t.jsx)("div",{className:"min-w-0",children:r}),e?(0,t.jsx)("div",{className:"ml-auto flex shrink-0 items-center gap-2",children:e}):null]}),S=({minimumSources:e=0,onMinimumSourcesChange:r,onRangeChange:i,onViewChange:s,range:l,view:o})=>(0,t.jsxs)("div",{"aria-label":"Feed filters",className:"flex flex-row flex-wrap items-center gap-2","data-testid":"feed-view-controls",role:"group",children:[(0,t.jsxs)(b.Select,{value:o,onValueChange:s,children:[(0,t.jsx)(b.SelectTrigger,{"aria-label":"Feed View",children:(0,t.jsx)(w.SelectValue,{children:n.find(e=>e.value===o)?.label})}),(0,t.jsx)(b.SelectContent,{align:"start",side:"bottom",children:(0,t.jsx)(w.SelectGroup,{children:n.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.label},e.value))})})]}),"top"===o&&l?(0,t.jsxs)(b.Select,{value:l,onValueChange:i,children:[(0,t.jsx)(b.SelectTrigger,{"aria-label":"Top time range",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(b.SelectContent,{align:"start",side:"bottom",children:(0,t.jsx)(w.SelectGroup,{children:a.map(e=>(0,t.jsx)(w.SelectItem,{value:e.value,children:e.label},e.value))})})]}):null,r?(0,t.jsxs)(b.Select,{value:String(e),onValueChange:r,children:[(0,t.jsx)(b.SelectTrigger,{"aria-label":"Minimum sources",children:(0,t.jsx)(w.SelectValue,{})}),(0,t.jsx)(b.SelectContent,{align:"start",side:"bottom",children:(0,t.jsx)(w.SelectGroup,{children:x.map(e=>(0,t.jsx)(w.SelectItem,{value:String(e),children:0===e?"All sources":`${e}+ sources`},e))})})]}):null]}),j=({errorMessage:e,onRetry:r,status:n})=>"initial-loading"===n||"loading-more"===n?(0,t.jsx)("div",{"aria-label":"Loading more Posts",className:"border-t border-border pt-7",children:(0,t.jsx)(f.PostSkeleton,{})}):"error"===n?(0,t.jsxs)("div",{"aria-live":"polite",className:"flex items-center justify-between gap-4 border-t border-border py-4",children:[(0,t.jsx)("p",{className:"font-mono text-xs text-muted-foreground",children:e??"Feed is temporarily unavailable."}),(0,t.jsx)(g.Button,{onClick:r,size:"sm",variant:"outline",children:"Retry"})]}):null;e.s(["ContinuousFeed",0,({minimumSources:e=0,onMinimumSourcesChange:r,canMarkBreakingForPost:a,expandableClusterPosts:i=!1,leadingAccessoryForPost:s,metaAccessoryForPost:l,errorMessage:o,headerAccessory:u,headingId:d,insertions:c,nowMs:m,onPromoteToTop:p,onRemoveFromTopic:f,onRangeChange:g,onRetry:b,onViewChange:w,posts:v,promotionAvailableForPost:x,promotionDisabledForPost:k,promotionPendingForPost:C,range:_,renderVersion:N,sentinelRef:E,status:P,storyBasePath:I,topic:T,topicDisplayName:R,view:F})=>{let D=n.find(e=>e.value===F)?.label??"Top",M="initial-loading"===P||"loading-more"===P;return(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,t.jsx)(y,{actions:u,filters:(0,t.jsx)(S,{minimumSources:e,onMinimumSourcesChange:r,onRangeChange:g,onViewChange:w,range:_,view:F})}),(0,t.jsx)(h.Feed,{bodyState:0===v.length?M||"error"===P?(0,t.jsx)(j,{errorMessage:o,onRetry:b,status:P}):(0,t.jsx)("p",{className:"py-8 font-mono text-sm text-muted-foreground",children:e>0?`No ${R} Posts with ${e}+ sources in this view.`:`No ${R} Posts match this view yet.`}):void 0,className:"flex flex-col",expandableClusterPosts:i,canMarkBreakingForPost:a,header:(0,t.jsxs)("h2",{id:d,className:"sr-only",children:[D," ",R," Stories"]}),headingId:d,insertions:c,leadingAccessoryForPost:s,metaAccessoryForPost:l,nowMs:m,onPromoteToTop:p,onRemoveFromTopic:f,posts:v,promotionAvailableForPost:x,promotionDisabledForPost:k,promotionPendingForPost:C,renderVersion:N,showSeparators:!0,storyBasePath:I,surface:"continuous_feed",topic:T}),v.length>0?(0,t.jsx)(j,{errorMessage:o,onRetry:b,status:P}
2):null,(0,t.jsx)("div",{ref:E,"aria-hidden":!0,className:"h-px","data-feed-continuation-sentinel":!0})]})}],317896);var k=e.i(603190);let C=()=>(0,t.jsx)("div",{className:"py-10","data-feed-day-separator":!0,children:(0,t.jsx)(k.Separator,{})});var _=e.i(655271);let N=({onLoadMore:e,onRetry:r,retryPacificDay:n,sentinelRef:a,status:i,loadMoreLabel:s="Load older stories"})=>(0,t.jsxs)("div",{"data-feed-history-footer":!0,"aria-live":"polite",className:"mt-6 flex min-h-14 flex-col items-center justify-center gap-2 py-4",children:["idle"===i?(0,t.jsx)("button",{ref:a,type:"button",onClick:e,className:"font-mono text-xs tracking-wider text-muted-foreground uppercase hover:text-foreground",children:s}):null,"loading"===i?(0,t.jsx)("div",{"aria-label":"Loading older stories",className:"h-14 w-full animate-pulse border-b border-foreground/10 bg-foreground/[0.025]"}):null,"terminus"===i?(0,t.jsx)("p",{children:(0,t.jsx)(_.EyebrowLabel,{className:"text-xs tracking-wider",children:"You're all caught up."})}):null,"error"===i?(0,t.jsx)("button",{type:"button",onClick:r,"aria-label":n?`Retry ${n}`:"Retry older stories",className:"font-mono text-xs tracking-wider text-muted-foreground uppercase underline underline-offset-2 hover:text-foreground",children:"Couldn't load older stories — tap to retry"}):null]});var E=e.i(824959),P=e.i(512390),I=e.i(467343),T=e.i(517550),R=e.i(267011),F=e.i(839717),D=e.i(729027);let M=({status:e,onSubmit:r})=>{let n="sent"===e.kind||"already_subscribed"===e.kind,a="sent"===e.kind?"Check your inbox.":"already_subscribed"===e.kind?"You're already subscribed.":"Today's top tech stories. In your inbox.";return(0,t.jsxs)("aside",{"aria-label":"Newsletter signup","data-testid":"newsletter-feed-banner",className:"flex w-full min-w-0 flex-col gap-4 roun
2ded-xl border border-blue-600 bg-blue-500 px-5 py-5 shadow-xs sm:min-h-24 sm:flex-row sm:items-center sm:gap-4 sm:py-0",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-3",children:[(0,t.jsx)(R.default,{"aria-hidden":"true",alt:"",src:"/newsletter/icon-newsletter-blue.png",width:80,height:80,sizes:"64px",className:"size-16 shrink-0 object-contain opacity-80"}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0",children:[n?null:(0,t.jsx)(_.EyebrowLabel,{className:"text-2xs font-medium tracking-[0.22em] text-white/80 dark:text-white/80",children:"The Digg Newsletter"}),(0,t.jsx)("h2",{className:"animate-in font-sans text-lg font-bold tracking-[-0.02em] text-white duration-200 ease-out fade-in-0 motion-reduce:animate-none dark:text-white",children:a},a),n?(0,t.jsx)("p",{className:"animate-in truncate font-sans text-sm text-white/85 duration-200 ease-out fade-in-0 motion-reduce:animate-none dark:text-white/85",title:e.email,children:"sent"===e.kind?`We sent a confirmation link to ${e.email}`:`${e.email} is already subscribed`}):null]})]}),n?null:(0,t.jsx)(F.TooltipProvider,{children:(0,t.jsxs)(F.Tooltip,{open:"error"===e.kind,children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("div",{className:"w-full min-w-0 sm:w-56 sm:shrink-0",children:(0,t.jsx)(D.NewsletterSignupForm,{status:e,onSubmit:r,variant:"blueCard",hideEditionPicker:!0,hideError:!0,submitLabel:"Subscribe",idPrefix:"newsletter-feed-banner"})})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",align:"center",sideOffset:8,className:"bg-destructive text-destructive-foreground dark:bg-popover [&_svg]:bg-destructive [&_svg]:fill-destructive dark:[&_svg]:bg-popover dark:[&_svg]:fill-popover",children:(0,t.jsx)("span",{role:"alert",children:"error"===e.kind?e.message:null})})]})})]})},L=({topic:e})=>{let r,n=(0,P.useNewsletterLadderSnapshot)(),{status:a,submit:i}=(0,P.useNewsletterSignup)("feed"),s=(0,v.useRef)(null),l=null!==n&&(0,I.shouldShowFeedHouseFill)(n),o=(0,v.useCallback)(()=>{(0,T.recordProductEvent)("newsletter_prompt_shown",{prompt:"inline_card",surface:"feed",topic:e})},[e]);return(r=(0,v.useRef)(!1),(0,v.useEffect)(()=>{if(!l||r.current)return;let e=s.current;if(!e||"u"<typeof IntersectionObserver)return;let t=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&(r.current||(r.current=!0,o()),t.disconnect())},{threshold:.5});return t.observe(e),()=>t.disconnect()},[l,o,s]),l)?(0,t.jsx)("div",{ref:s,className:"min-w-0 animate-in duration-200 ease-out fade-in-0 motion-reduce:animate-none",children:(0,t.jsx)(M,{status:a,onSubmit:(e,t)=>void i(e,t)})}):null},O=[{afterRank:3,houseFill:!0,id:"feed-promo-slot-1",slot:"feedPrimary"},{afterRank:12,houseFill:!1,id:"feed-promo-slot-2",slot:"feedSecondary"}],A=({houseFill:e,slot:r,topic:n})=>(0,t.jsx)(E.AdButlerNativeSponsorSlot,{slot:r,variant:"feed",className:"min-w-0",fallback:e?(0,t.jsx)(L,{topic:n}):void 0});function $(e,r){return O.flatMap(({afterRank:n,houseFill:a,id:i,slot:s})=>e.length>n?[{afterRank:e[n-1].rank,id:i,node:(0,t.jsx)(A,{houseFill:a,slot:s,topic:r})}]:[])}e.s(["buildFeedPromoInsertions",0,$],57676),e.s(["FeedHistorySections",0,({sections:e,status:r,onLoadMore:n,onRetry:a,sentinelRef:i,renderVersion:s,storyBasePath:l,topic:o,metaAccessoryForPost:u,promoSlotsEnabled:d=!1})=>{let c=d?e.findIndex(e=>$(e.posts,o).length>0):-1;return(0,t.jsxs)(t.Fragment,{children:[e.map((e,r)=>{let n=`feed-${e.pacificDay}-heading`;return(0,t.jsxs)(v.Fragment,{children:[(0,t.jsx)(C,{}),(0,t.jsx)(h.Feed,{date:e.pacificDay,headingId:n,header:(0,t.jsxs)("h2",{id:n,className:"font-sans text-lg font-bold text-foreground",children:["Top Stories ",(0,t.jsxs)("span",{className:"font-normal",children:["· ",e.dayLabel]})]}),headerClassName:"mb-3",insertions:r===c?$(e.posts,o):void 0,metaAccessoryForPost:u,nowMs:e.n
2owMs,posts:e.posts,renderVersion:s,showSeparators:!0,storyBasePath:l,surface:"feed-history",topic:o})]},e.pacificDay)}),(0,t.jsx)(N,{onLoadMore:n,onRetry:a,sentinelRef:i,status:r})]})}],51123);var U=e.i(545694),B=e.i(27338),V=e.i(78829);e.s(["TopicContentLayout",0,({after:e=null,afterMain:r=null,afterMainClassName:n,children:a,className:i,main:s,mainClassName:l,sidebar:o=null,sidebarSponsor:u=!0,sidebarBottomOffset:d,sidebarClassName:c,sidebarMobilePlacement:m="hidden"})=>(0,t.jsx)(U.AdButlerPageBoundary,{children:(0,t.jsxs)("div",{className:(0,V.cn)("flex min-w-0 flex-col gap-8",i),children:[a,(0,t.jsxs)("div",{className:"grid min-w-0 gap-8 lg:grid-cols-[minmax(0,1fr)_376px] lg:items-start lg:gap-x-[var(--topic-column-gap,80px)]",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-8 lg:gap-16",children:[(0,t.jsx)("div",{"data-testid":"topic-main-panel",className:(0,V.cn)("min-w-0 flex-1",l),children:s}),r?(0,t.jsx)("div",{"data-testid":"topic-after-main-panel",className:(0,V.cn)("min-w-0",n),children:r}):null]}),o?(0,t.jsxs)(B.TopicStickySidebar,{bottomOffset:d,className:(0,V.cn)("min-w-0 flex-col gap-3 lg:w-[376px] lg:shrink-0","after-main"===m?"flex":"hidden lg:flex",c),children:[u?(0,t.jsx)(E.HomepageSidebarAdButlerSponsorSlot,{}):null,o]}):null]}),e]})}),"topicFeedLayoutClassName",0,"mx-auto w-full max-w-[798px] lg:max-w-[calc(798px+376px+var(--topic-column-gap,80px))]"],490471);var G=e.i(377627);let z={kind:"idle"},q="Feed is temporarily unavailable";class K extends Error{capturedByServer;constructor(e,t){super(e),this.name="ContinuousFeedPageError",this.capturedByServer=t}}async function H({cursor:e,range:t,publishedOnly:r,signal:n,topic:a,view:i}){let s=new URLSearchParams({topic:a,view:i});"top"===i&&t&&s.set("range",t),e&&s.set("cursor",e),s.set("published",r?"1":"0");let l=await fetch(`/api/feed/continuous?${s.toString()}`,{cache:"no-store",signal:n}),o=await l.json().catch(()=>null);if(!l.ok)throw new K(o&&"error"in o&&"string"==typeof o.error?o.error:q,!!(o&&"captured"in o&&!0===o.captured));return o}function Y(e){let t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;e.current?.scrollIntoView({behavior:t?"auto":"smooth",block:"start"})}function Q(e){return e instanceof Error?e.message:q}function Z(e,t){let r="top"===e.view;return{activity:z,dateCursor:t&&r&&"today"===e.range?function(e){if(!Number.isInteger(1))throw Error("[feed] invalid day offset: 1");return c(d(e),-1)}(new Date(e.nowMs)):null,nextCursor:r?null:e.nextCursor,nowMs:e.nowMs,posts:r?e.posts.slice(0,20):e.posts,publishedClusterIds:e.publishedClusterIds,publishedOnly:e.publishedOnly,range:e.range,sections:[],view:e.view}}function W(e,t,r){if("u"<typeof IntersectionObserver)return;let n=new IntersectionObserver(e=>{e.some(e=>e.isIntersecting)&&r()},{rootMargin:t});return n.observe(e),()=>{n.disconnect()}}e.s(["useContinuousFeed",0,function({basePath:e,completedDates:t=!1,defaultView:r="top",feedStartRef:n,initialPage:a,topic:m}){let[h,f]=(0,v.useState)(()=>Z(a,t)),g=(0,v.useRef)({view:a.view,range:a.range,publishedOnly:a.publishedOnly}),b=(0,v.useRef)(a.range??i),w=(0,v.useRef)(null),x=(0,v.useRef)(0),y=(0,v.useRef)(null),S=(0,v.useRef)(0),j=(0,v.useRef)(null),k=(0,v.useRef)(null),C=(0,v.useCallback)(()=>{w.current?.abort();let e=new AbortController;w.current=e;let t=x.current+1;return x.current=t,{controller:e,generation:t}},[]),_=(0,v.useCallback)(async(e,r,n)=>{g.current={view:e,range:r,publishedOnly:n};let{controller:a,generation:i}=C();f(t=>({...t,activity:{action:"initial",kind:"loading"},dateCursor:null,nextCursor:null,posts:[],publishedClusterIds:[],publishedOnly:n,range:r,sections:[],view:e}));try{let s=await H({publishedOnly:n,range:r,signal:a.signal,topic:m,view:e});if(x.current!==i)return;S.current=0,f(Z(s,t))}catch(e){if(a.signal.aborted||x.current!==i)return;f(t=>({...t,activity:{action:"initial",kind:"error",message:Q(e)}}))}},[C,t,m]),N=(0,v.useCallback)(t=>{let a=l(t,r);if(a===h.view)return;let i="top"===a?b.current:null;(0,T.recordProductEvent)("feed_view_changed",{control:"view",previous_range:h.range,previous_view:h.view,range:i,surface:"continuous_feed",topic:m,view:a}),window.history.pushState(null,"",s(e,a,i,null)),Y(n),_(a,i,h.publishedOnly)},[e,r,n,_,h.publishedOnly,h.range,h.view,m]),E=(0,v.useCallback)(t=>{let r=o(t);"top"===h.view&&r!==h.range&&(b.current=r,(0,T.recordProductEvent)("feed_view_changed",{control:"range",previous_range:h.range,previous_view:h.view,range:r,surface:"continuous_feed",topic:m,view:"top"}),window.history.pushState(null,"",s(e,"top",r,null)),Y(n),_("top",r,h.publishedOnly))},[e,n,_,h.publishedOnly,h.range,h.view,m]),P=(0,v.useCallback)(e=>{Y(n),_(h.view,h.range,e)},[n,_,h.range,h.view]),I=(0,v.useCallback)(async e=>
2{if(!h.nextCursor||"idle"!==h.activity.kind&&!e)return;let t=performance.now(),{controller:r,generation:n}=C();f(e=>({...e,activity:{action:"continuation",kind:"loading"}}));try{let e=await H({cursor:h.nextCursor,publishedOnly:h.publishedOnly,range:h.range,signal:r.signal,topic:m,view:h.view});if(x.current!==n)return;(0,T.recordProductEvent)("feed_continuation_load_finished",{duration_ms:Math.max(0,Math.round(performance.now()-t)),outcome:"success",range:h.range,result_count:e.posts.length,retry_count:S.current,surface:"continuous_feed",topic:m,view:h.view}),S.current=0,f(t=>{var r,n;let a;return{...t,activity:z,nextCursor:e.nextCursor,nowMs:e.nowMs,posts:(r=t.posts,n=e.posts,a=new Set(r.map(e=>e.clusterId)),[...r,...n.filter(e=>!a.has(e.clusterId))]),publishedClusterIds:[...new Set([...t.publishedClusterIds,...e.publishedClusterIds])]}})}catch(e){if(r.signal.aborted||x.current!==n)return void(0,T.recordProductEvent)("feed_continuation_load_finished",{duration_ms:Math.max(0,Math.round(performance.now()-t)),outcome:"cancelled",range:h.range,result_count:0,retry_count:S.current,surface:"continuous_feed",topic:m,view:h.view});(0,T.recordProductEvent)("feed_continuation_load_finished",{duration_ms:Math.max(0,Math.round(performance.now()-t)),outcome:"failure",range:h.range,result_count:0,retry_count:S.current,surface:"continuous_feed",topic:m,view:h.view}),e instanceof K&&e.capturedByServer||G.captureException(e,{fingerprint:["continuous-feed-continuation-load"],tags:{route:"feed_continuous",surface:"continuous_feed",topic:m,view:h.view}}),f(t=>({...t,activity:{action:"continuation",kind:"error",message:Q(e)}}))}},[C,h.activity.kind,h.nextCursor,h.publishedOnly,h.range,h.view,m]),R=(0,v.useCallback)(async e=>{let t=h.dateCursor;if(!t||"idle"!==h.activity.kind&&!e||y.current?.cursor===t)return;let{controller:r,generation:n}=C();y.current={controller:r,cursor:t},f(e=>({...e,activity:{action:"date",kind:"loading"}}));let a=!1;try{let e=new URLSearchParams({topic:m,cursor:t,version:"published-v1",view:"top"}),i=await fetch(`/api/feed/day?${e}`,{signal:r.signal});if(!i.ok)throw a=!0,Error(`HTTP ${i.status} from published Feed history`);let s=await i.json();if(r.signal.aborted||x.current!==n)return;if(!(s&&"object"==typeof s&&("ready"===s.state||"terminus"===s.state)&&("terminus"===s.state||"string"==typeof s.pacificDay&&"string"==typeof s.dayLabel)&&Array.isArray(s.posts)&&Array.isArray(s.unavailablePosts)&&Array.isArray(s.publishedClusterIds)&&(null===s.nextCursor||"string"==typeof s.nextCursor)&&"boolean"==typeof s.hasMoreInDay&&"boolean"==typeof s.updatesAvailable))throw TypeError("Invalid published Feed history response");let l=function(e,t){if("terminus"===t.state)return{nextCursor:null,sections:[...e]};if(!t.pacificDay||!t.dayLabel)throw TypeError("Published history response has no date");if(t.hasMoreInDay)throw TypeError("Published history continuation stayed inside a date");let r=e.at(-1);if(r&&r.pacificDay<=t.pacificDay)throw TypeError("Published history continuation changed date order");let n=new Set(e.flatMap(e=>e.publishedClusterIds)),a={...t,dayLabel:t.dayLabel,pacificDay:t.pacificDay,posts:t.posts.filter(e=>!n.has(e.clusterId)),state:"ready"};return{nextCursor:t.nextCursor,sections:[...e,a]}}(h.sections,{...s,posts:s.posts.slice(0,20)});f(e=>({...e,activity:z,dateCursor:l.nextCursor,sections:l.sections}))}catch(e){if(r.signal.aborted||x.current!==n)return;a||G.captureException(e,{fingerprint:["published-feed-history-client"],tags:{topic:m,route:"feed_history"}}),f(t=>({...t,activity:{action:"date",kind:"error",message:Q(e)}}))}finally{y.current?.controller===r&&(y.current=null)}},[C,h.activity.kind,h.dateCursor,h.sections,m]),F=(0,v.useCallback)(async()=>{h.nextCursor?await I(!1):await R(!1)},[R,I,h.nextCursor]),D=(0,v.useCallback)(()=>{let e=g.current;e&&e.view===h.view&&e.range===h.range&&e.publishedOnly===h.publishedOnly&&_(h.view,h.range,h.publishedOnly)},[_,h.publishedOnly,h.range,h.view]),M=(0,v.useCallback)(()=>{let e="error"===h.activity.kind?h.activity.action:null;"date"===e?R(!0):(S.current+=1,"continuation"===e)?I(!0):_(h.view,h.range,h.publishedOnly)},[_,R,I,h.activity,h.publishedOnly,h.range,h.view]),{activity:L}=h,O="loading"===L.kind?"initial"===L.action?"initial-loading":"continuation"===L.action?"loading-more":"ready":"error"===L.kind&&"date"!==L.action?"error":"ready",A="error"===L.kind&&"date"!==L.action?L.message:null,$=t&&"top"===h.view&&"today"===h.range&&("idle"===L.kind||"date"===L.action),U="idle"!==L.kind&&"date"===L.action?"loading"===L.kind?"loading":"error":h.dateCursor?"idle":"terminus";return(0,v.useEffect)(()=>{let t=new URLSearchParams(window.location.search);if(!(t.has("view")||t.has("range"))&&"ready"===O){if("hot"===h.view){"hot"!==r&&window.history.replaceState(null,"",s(e,"hot",null,null));return}new Set(h.posts.map(e=>e.clusterId)).size>=8||(window.history.replaceState(null,"",s(e,"hot",null,null)),_("hot",null,h.publishedOnly))}},[e,r,_,h.posts,h.publishedOnly,h.view,O]),(0,v.useEffect)(()=>
2{if("top"!==h.view||"today"!==h.range)return;let e=(function(e){let t=u(e);if(!t)throw Error(`[feed] invalid Pacific day: ${e}`);let r=c(t,1),[n,a,i]=t.split("-").map(Number),[s,l,o]=r.split("-").map(Number);return{dateLabel:function(e){let t=u(e);if(!t)throw Error(`[feed] invalid Pacific day: ${e}`);let[r,n,a]=t.split("-").map(Number);return new Intl.DateTimeFormat("en-US",{day:"numeric",month:"short",timeZone:"UTC",year:"numeric"}).format(new Date(Date.UTC(r,n-1,a)))}(t),endUtc:p(s,l,o),pacificDay:t,startUtc:p(n,a,i)}})(d(new Date(h.nowMs))).endUtc.getTime(),t=!1,r=()=>{t||Date.now()<e||(t=!0,_("top","today",h.publishedOnly))},n=window.setTimeout(r,Math.max(0,e-Date.now()));return window.addEventListener("focus",r),document.addEventListener("visibilitychange",r),()=>{window.clearTimeout(n),window.removeEventListener("focus",r),document.removeEventListener("visibilitychange",r)}},[_,h.nowMs,h.publishedOnly,h.range,h.view]),(0,v.useEffect)(()=>{let t=()=>{let t,a,i,u,d,c,m=(a=(t=new URLSearchParams(window.location.search)).getAll("view"),i=t.getAll("range"),c=s(e,(d={range:"top"===(u=l(1===a.length?a[0]:null,r))?o(1===i.length?i[0]:null):null,view:u}).view,d.range,t.has("view")||t.has("range")?null:r),`${window.location.pathname}${window.location.search}`!==c&&window.history.replaceState(null,"",c),d);m.range&&(b.current=m.range),Y(n),_(m.view,m.range,h.publishedOnly)};return window.addEventListener("popstate",t),()=>{window.removeEventListener("popstate",t)}},[e,r,n,_,h.publishedOnly]),(0,v.useEffect)(()=>{let e=j.current;if(e&&h.nextCursor&&"ready"===O)return W(e,"600px 0px",()=>void F())},[F,h.nextCursor,O]),(0,v.useEffect)(()=>{let e=k.current;if(e&&$&&"idle"===U)return W(e,"300px",()=>void F())},[$,U,F]),(0,v.useEffect)(()=>()=>{w.current?.abort(),x.current+=1},[]),{completedDates:{enabled:$,sections:h.sections,sentinelRef:k,status:U},errorMessage:A,nextCursor:h.nextCursor,nowMs:h.nowMs,onLoadMore:()=>void F(),onPublishedOnlyChange:P,onRangeChange:E,onRefresh:D,onRetry:M,onViewChange:N,posts:h.posts,publishedClusterIds:h.publishedClusterIds,publishedOnly:h.publishedOnly,range:h.range,sentinelRef:j,status:O,view:h.view}}],373364)}]);
3
4//# debugId=81417a34-06fe-f882-e98b-539c2a00e0c8
5//# sourceMappingURL=30pvzh9iih9e6.js.map
6//# chunkId=01a0d0df-a5ad-70b1-b9b3-2638483f429d

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.