(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9262],{4388:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/newspaper",function(){return a(411)}])},1731:function(e,t,a){"use strict";a.d(t,{Ol:function(){return i},SZ:function(){return d},Zb:function(){return l},aY:function(){return c},eW:function(){return u},ll:function(){return o}});var s=a(5893),r=a(7294),n=a(2917);let l=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,n.cn)("rounded-xl border bg-card text-card-foreground shadow",a),...r})});l.displayName="Card";let i=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,n.cn)("flex flex-col space-y-1.5 p-6",a),...r})});i.displayName="CardHeader";let o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("h3",{ref:t,className:(0,n.cn)("font-semibold leading-none tracking-tight",a),...r})});o.displayName="CardTitle";let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("p",{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",a),...r})});d.displayName="CardDescription";let c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,n.cn)("p-6 pt-0",a),...r})});c.displayName="CardContent";let u=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)("div",{ref:t,className:(0,n.cn)("flex items-center p-6 pt-0",a),...r})});u.displayName="CardFooter"},3617:function(e,t,a){"use strict";a.d(t,{$N:function(){return m},Be:function(){return x},Vq:function(){return o},cZ:function(){return f},fK:function(){return DialogHeader},hg:function(){return d}});var s=a(5893),r=a(7294),n=a(2854),l=a(2469),i=a(2917);let o=n.fC,d=n.xz,c=n.h_;n.x8;let u=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.aV,{ref:t,className:(0,i.cn)("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...r})});u.displayName=n.aV.displayName;let f=r.forwardRef((e,t)=>{let{className:a,children:r,...o}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(u,{}),(0,s.jsxs)(n.VY,{ref:t,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...o,children:[r,(0,s.jsxs)(n.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,s.jsx)(l.Pxu,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]})]})]})});f.displayName=n.VY.displayName;let DialogHeader=e=>{let{className:t,...a}=e;return(0,s.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-1.5 text-center sm:text-left",t),...a})};DialogHeader.displayName="DialogHeader";let m=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.Dx,{ref:t,className:(0,i.cn)("text-lg font-semibold leading-none tracking-tight",a),...r})});m.displayName=n.Dx.displayName;let x=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.dk,{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",a),...r})});x.displayName=n.dk.displayName},293:function(e,t,a){"use strict";a.d(t,{I:function(){return l}});var s=a(5893),r=a(7294),n=a(2917);let l=r.forwardRef((e,t)=>{let{className:a,type:r,...l}=e;return(0,s.jsx)("input",{type:r,className:(0,n.cn)("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...l})});l.displayName="Input"},8953:function(e,t,a){"use strict";a.d(t,{_:function(){return d}});var s=a(5893),r=a(7294),n=a(9102),l=a(5139),i=a(2917);let o=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.f,{ref:t,className:(0,i.cn)(o(),a),...r})});d.displayName=n.f.displayName},4976:function(e,t,a){"use strict";a.d(t,{Z:function(){return i}});var s=a(5893),r=a(7294),n=a(2780),l=a(2917);let i=r.forwardRef((e,t)=>{let{className:a,orientation:r="horizontal",decorative:i=!0,...o}=e;return(0,s.jsx)(n.f,{ref:t,decorative:i,orientation:r,className:(0,l.cn)("shrink-0 bg-border","horizontal"===r?"h-[1px] w-full":"h-full w-[1px]",a),...o})});i.displayName=n.f.displayName},1805:function(e,t,a){"use strict";a.d(t,{SP:function(){return d},dr:function(){return o},mQ:function(){return i},nU:function(){return c}});var s=a(5893),r=a(7294),n=a(434),l=a(2917);let i=n.fC,o=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.aV,{ref:t,className:(0,l.cn)("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",a),...r})});o.displayName=n.aV.displayName;let d=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.xz,{ref:t,className:(0,l.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",a),...r})});d.displayName=n.xz.displayName;let c=r.forwardRef((e,t)=>{let{className:a,...r}=e;return(0,s.jsx)(n.VY,{ref:t,className:(0,l.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...r})});c.displayName=n.VY.displayName},411:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return p},default:function(){return Newspaper}});var s=a(5893),r=a(7294),n=a(1731),l=a(4976),i=a(1805),o=a(9663),d=a(1664),c=a.n(d),u=a(3617),f=a(293),m=a(8953),x=a(7066);let NewsCard=e=>{let{news:t}=e;return(0,s.jsx)(c(),{href:"/newspaper/".concat(t.videoId),passHref:!0,children:(0,s.jsx)(n.Zb,{className:"mb-8 cursor-pointer overflow-hidden transition-shadow hover:shadow-lg",children:(0,s.jsxs)("div",{className:"flex flex-col md:flex-row",children:[(0,s.jsx)("div",{className:"md:w-1/3",children:(0,s.jsx)("img",{src:t.thumbnail.url,alt:t.title,className:"h-full w-full object-cover"})}),(0,s.jsxs)("div",{className:"p-6 md:w-2/3",children:[(0,s.jsx)(n.Ol,{className:"mb-4 p-0",children:(0,s.jsx)(n.ll,{className:"text-3xl font-bold leading-tight",children:t.title})}),(0,s.jsxs)(n.aY,{className:"p-0",children:[(0,s.jsx)("p",{className:"mb-4 text-lg leading-relaxed",children:t.excerpt}),(0,s.jsxs)("p",{className:"text-sm text-gray-600",children:[t.channelTitle," -"," ",new Date(t.timestamp).toLocaleString("en-US",{month:"long",day:"numeric",year:"numeric"})]})]})]})]})})})},SubscriptionModal=()=>{let[e,t]=(0,r.useState)(""),[a,n]=(0,r.useState)(!1),[l,i]=(0,r.useState)(!1),handleSubmit=async a=>{a.preventDefault(),n(!0);try{let a=await x.Z.post("/api/subscribe-newsletter",{email:e}),s=a.data;console.log(s),"PENDING"===s.status?(i(!0),t("")):i(!1)}catch(e){console.error("Subscription error:",e)}finally{n(!1)}};return(0,s.jsxs)(u.Vq,{children:[(0,s.jsx)(u.hg,{asChild:!0,children:(0,s.jsx)("button",{className:"rounded-sm font-medium text-blue-500 hover:underline focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2",children:"Subscribe to our daily newsletter"})}),(0,s.jsxs)(u.cZ,{className:"sm:max-w-[425px]",style:{fontFamily:"sans-serif"},children:[(0,s.jsxs)(u.fK,{children:[(0,s.jsx)(u.$N,{children:"Subscribe to Our Daily Newspaper"}),(0,s.jsx)(u.Be,{children:"Get the latest news delivered to your inbox every day."})]}),l?(0,s.jsx)("div",{className:"py-6 text-center text-green-600",children:"Thank you for subscribing! Please check your email to confirm your subscription. You'll receive our daily updates once confirmed."}):(0,s.jsxs)("form",{onSubmit:handleSubmit,className:"grid gap-4 py-4",children:[(0,s.jsxs)("div",{className:"grid grid-cols-4 items-center gap-4",children:[(0,s.jsx)(m._,{htmlFor:"email",className:"text-right",children:"Email"}),(0,s.jsx)(f.I,{id:"email",type:"email",value:e,onChange:e=>t(e.target.value),className:"col-span-3",required:!0})]}),(0,s.jsx)(o.z,{type:"submit",disabled:a,className:"ml-auto",children:a?"Subscribing...":"Subscribe"})]})]})]})};var p=!0;function Newspaper(e){let{categorizedNews:t}=e;return(0,s.jsx)("div",{className:"min-h-screen bg-gray-50 font-serif text-gray-900",children:(0,s.jsxs)("div",{className:"mx-auto max-w-5xl p-6",children:[(0,s.jsxs)("header",{className:"mb-4 text-center",children:[(0,s.jsx)("h1",{className:"mb-2 text-6xl font-bold tracking-tight text-red-500",children:"The Daily TLDR"}),(0,s.jsx)("p",{className:"text-xl italic text-gray-500",children:new Date().toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})})]}),(0,s.jsxs)("div",{className:"mb-8 text-center font-sans text-sm",children:["Stay informed: ",(0,s.jsx)(SubscriptionModal,{})]}),(0,s.jsx)(l.Z,{className:"my-8"}),(0,s.jsxs)(i.mQ,{defaultValue:"all",className:"mb-8 w-full",children:[(0,s.jsxs)(i.dr,{className:"grid w-full grid-cols-4",children:[(0,s.jsx)(i.SP,{value:"all",children:"All"}),(0,s.jsx)(i.SP,{value:"world",children:"World"}),(0,s.jsx)(i.SP,{value:"business",children:"Business"}),(0,s.jsx)(i.SP,{value:"education",children:"Education"})]}),Object.entries(t).map(e=>{let[t,a]=e;return(0,s.jsx)(i.nU,{value:t,children:a.length>0?a.map(e=>(0,s.jsx)(NewsCard,{news:e},e.videoId)):(0,s.jsxs)(n.Zb,{className:"mb-8",children:[(0,s.jsx)(n.Ol,{children:(0,s.jsx)(n.ll,{className:"text-3xl font-bold",children:"No News Available"})}),(0,s.jsx)(n.aY,{children:(0,s.jsx)("p",{className:"text-lg",children:"Check back later for the latest updates."})})]})},t)})]})]})})}}},function(e){e.O(0,[7066,8379,9774,2888,179],function(){return e(e.s=4388)}),_N_E=e.O()}]);