1import{r as l,j as e,a1 as v,z as S,s as E,N as h,o,d as c,m as R,B as y,O as C,Q as M}from"./index-KSWbwNeY.js";import{C as P}from"./card-CwL_ed79.js";import{S as O,a as B}from"./sidebar-card-28KQOkcJ.js";import{i as z}from"./isThisMonth-DQ0kQjMz.js";import{B as g}from"./book-open-DS7Nmuzn.js";import{L as I}from"./lock-DNHSxtLD.js";import{p as N}from"./parseISO-BHcD4hpi.js";import{f as L}from"./format-hhvI2L0z.js";const j=l.forwardRef(({children:s,shimmerColor:r,className:t,...a},i)=>e.jsxs("button",{ref:i,className:v("shimmer-button group relative inline-flex items-center justify-center gap-2","px-6 py-3 rounded-full font-medium text-sm","bg-foreground text-background","transition-all duration-300 ease-out","hover:scale-[1.02] active:scale-[0.98]","disabled:pointer-events-none disabled:opacity-50",t),...a,children:[e.jsx("span",{className:"absolute inset-0 rounded-full overflow-hidden",style:{padding:"1px"},children:e.jsx("span",{className:"absolute inset-[-100%] animate-[border-shimmer_8s_linear_infinite] opacity-30 group-hover:opacity-60 transition-opacity duration-500",style:{background:r||`conic-gradient( 2 from 0deg, 3 transparent 0deg, 4 transparent 60deg, 5 hsl(var(--primary-foreground) / 0.8) 90deg, 6 hsl(var(--primary-foreground) / 1) 120deg, 7 hsl(var(--primary-foreground) / 0.8) 150deg, 8 transparent 180deg, 9 transparent 360deg 10 )`}})}),e.jsx("span",{className:"absolute inset-[1px] rounded-full bg-foreground transition-colors text-primary-foreground"}),e.jsx("span",{className:"relative z-10 flex items-center gap-2",children:s})]}));j.displayName="ShimmerButton";const A=l.forwardRef(({children:s,shimmerColor:r,className:t,...a},i)=>e.jsxs("a",{ref:i,className:v("shimmer-button group relative inline-flex items-center justify-center gap-2","px-6 py-3 rounded-full font-medium text-sm","bg-foreground text-background","transition-all duration-300 ease-out","hover:scale-[1.02] active:scale-[0.98]",t),...a,children:[e.jsx("span",{className:"absolute inset-0 rounded-full overflow-hidden",style:{padding:"1px"},children:e.jsx("span",{className:"absolute inset-[-100%] animate-[border-shimmer_8s_linear_infinite] opacity-30 group-hover:opacity-60 transition-opacity duration-500",style:{background:r||`conic-gradient( 11 from 0deg, 12 transparent 0deg, 13 transparent 60deg, 14 hsl(var(--primary-foreground) / 0.8) 90deg, 15 hsl(var(--primary-foreground) / 1) 120deg, 16 hsl(var(--primary-foreground) / 0.8) 150deg, 17 transparent 180deg, 18 transparent 360deg 19 )`}})}),e.jsx("span",{className:"absolute inset-[1px] rounded-full bg-foreground transition-colors"}),e.jsx("span",{className:"relative z-10 flex items-center gap-2",children:s})]}));A.displayName="ShimmerLink";const D=l.forwardRef(({children:s,shimmerColor:r,className:t,...a},i)=>e.jsxs("button",{ref:i,className:v("shimmer-button group relative inline-flex items-center justify-center gap-2","px-6 py-3 rounded-full font-medium text-sm","text-foreground","transition-all duration-300 ease-out","hover:scale-[1.02] active:scale-[0.98]","disabled:pointer-events-none disabled:opacity-50",t),...a,children:[e.jsx("span",{className:"absolute inset-0 rounded-full overflow-hidden",style:{padding:"1px"},children:e.jsx("span",{className:"absolute inset-[-100%] animate-[border-shimmer_8s_linear_infinite] opacity-40 group-hover:opacity-70 transition-opacity duration-500",style:{background:r||`conic-gradient( 20 from 0deg, 21 transparent 0deg, 22 transparent 60deg, 23 hsl(var(--foreground) / 0.6) 90deg, 24 hsl(var(--foreground) / 0.8) 120deg, 25 hsl(var(--foreground) / 0.6) 150deg, 26 transparent 180deg, 27 transparent 360deg 28 )`}})}),e.jsx("span",{className:"absolute inset-[1px] rounded-full bg-background/50 backdrop-blur-sm transition-colors group-hover:bg-background/80"}),e.jsx("span",{className:"relative z-10 flex items-center gap-2",children:s})]}));D.displayName="ShimmerOutlineButton";const b=(s,r=320)=>s?C(s)?M(s,{width:r,quality:60}):s:"",w=s=>new DOMParser().parseFromString(s,"text/html").body.textContent||"",F=({variant:s="hero",className:r=""})=>{const[t,a]=l.useState(null),[i,k]=l.useState(!0),{status:m}=S(),d=m==null?void 0:m.hasSubscription,u=t?z(N(t.issue_month)):!1;l.useEffect(()=>{_()},[]);const _=async()=>{try{const{data:n,error:f}=await E.from("print_editions").select("id, title, description, cover_image_url, pdf_url, issue_month").eq("is_published",!0).order("issue_month",{ascending:!1}).limit(1).single();if(f&&f.code!=="PGRST116")throw f;a(n)}catch(n){console.error("Error fetching print edition:",n)}finally{k(!1)}},p=()=>{t&&d&&(window.location.href=`/print-editions/${t.id}`)};if(i||!t)return null;const x=n=>{try{return L(N(n),"MMMM yyyy")}catch{return n}};return s==="hero"?e.jsx("section",{className:`relative overflow-hidden bg-gradient-to-br from-primary/5 via-background to-accent/5 ${r}`,children:e.jsxs("div",{className:"container mx-auto px-4 py-12 md:py-16",children:[e.jsxs("div",{className:"grid md:grid-cols-2 gap-8 md:gap-12 items-center",children:[e.jsx("div",{className:"relative group flex justify-center md:justify-end order-1 md:order-2",children:e.jsxs("div",{className:"relative transform transition-all duration-500 group-hover:scale-[1.02] group-hover:-translate-y-2 group-hover:-rotate-1",children:[e.jsx("div",{className:"absolute inset-0 bg-primary/20 blur-2xl transform translate-x-4 translate-y-4 opacity-40 transition-all duration-500 group-hover:opacity-60 group-hover:translate-y-6 group-hover:blur-3xl"}),e.jsxs("div",{className:"relative w-64 md:w-80 aspect-[3/4] overflow-hidden shadow-2xl border border-border/50",children:[e.jsx("img",{src:b(t.cover_image_url,640),alt:t.title,className:"w-full h-full object-cover"}
28),u&&e.jsx(h,{className:"absolute top-3 left-3 bg-accent text-accent-foreground animate-pulse",children:"NEW"})]})]})}),e.jsxs("div",{className:"space-y-6 order-2 md:order-1 text-center md:text-left opacity-0 animate-fade-in",style:{animationDelay:"200ms",animationFillMode:"forwards"},children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{to:"/print-editions",className:"text-sm font-medium text-primary uppercase tracking-wider hover:underline",children:"Print Edition"}),e.jsx("h2",{className:"text-3xl md:text-4xl font-sans font-medium lg:text-2xl",children:x(t.issue_month)}),t.description&&e.jsx("p",{className:"text-muted-foreground max-w-md mx-auto md:mx-0 line-clamp-2 opacity-0 animate-fade-in text-base",style:{animationDelay:"400ms",animationFillMode:"forwards"},children:w(t.description)})]}),e.jsx("div",{className:"flex flex-col sm:flex-row gap-4 justify-center md:justify-start",children:d?e.jsxs(j,{onClick:p,className:"py-3.5 px-8",children:[e.jsx(g,{className:"h-5 w-5"}),"Read Now",e.jsx(c,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]}):e.jsxs(j,{onClick:()=>window.location.href="/subscribe",className:"py-3.5 px-8",children:[e.jsx(g,{className:"h-5 w-5"}),"Subscribe to Read",e.jsx(c,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})}),!d&&e.jsxs("p",{className:"text-sm text-muted-foreground flex items-center justify-center md:justify-start gap-1",children:[e.jsx(I,{className:"h-3 w-3"}),"Available exclusively for print subscribers"]}
28)]})]}),e.jsx("div",{className:"mt-8 text-center opacity-0 animate-fade-in",style:{animationDelay:"600ms",animationFillMode:"forwards"},children:e.jsxs(o,{to:"/print-editions",className:"inline-flex items-center gap-2 text-sm font-medium text-muted-foreground hover:text-primary transition-colors group",children:["View All Issues",e.jsx(c,{className:"h-4 w-4 transition-transform group-hover:translate-x-1"})]})})]})}):s==="sidebar"?e.jsx(O,{className:r,header:e.jsx(B,{title:"Print Edition",badge:u?e.jsx(h,{className:"bg-amber-500/10 text-amber-600 border-amber-500/20 text-[9px] px-1.5 py-0",children:"NEW"}):void 0}),children:e.jsxs("div",{className:"flex gap-4 p-4",children:[e.jsx(o,{to:"/print-editions",className:"block flex-shrink-0",children:e.jsx("img",{src:b(t.cover_image_url,280),alt:t.title,className:"w-32 h-44 object-cover shadow-md border border-slate-200 dark:border-slate-700 rounded transition-transform duration-300 hover:scale-[1.03]"})}),e.jsxs("div",{className:"space-y-2 pt-0.5",children:[e.jsx("p",{className:"text-[13px] font-medium text-slate-800 dark:text-slate-100",children:x(t.issue_month)}),e.jsxs("div",{className:"space-y-1.5",children:[d?e.jsxs("button",{onClick:p,className:"block text-[12px] text-slate-500 hover:text-amber-600 dark:hover:text-amber-400 transition-colors flex items-center gap-1",children:["Read Now",e.jsx(R.span,{animate:{x:[0,2,0]},transition:{duration:1.2,repeat:1/0,ease:"easeInOut"},children:"â"})]}):e.jsx(o,{to:"/subscribe",className:"block text-[12px] text-slate-500 hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:"Subscribe"}),e.jsx(o,{to:"/print-editions",className:"block text-[12px] text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 transition-colors",children:"All Issues"})]})]})]})}):e.jsx(P,{className:`overflow-hidden ${r}`,children:e.jsxs("div",{className:"flex flex-col sm:flex-row",children:[e.jsx("div",{className:"sm:w-32 md:w-40 shrink-0",children:e.jsxs("div",{className:"relative aspect-[3/4] sm:h-full",children:[e.jsx("img",{src:b(t.cover_image_url,320),alt:t.title,className:"w-full h-full object-cover"}),u&&e.jsx(h,{className:"absolute top-2 left-2 bg-accent text-accent-foreground text-xs",children:"NEW"})]})}),e.jsxs("div",{className:"flex-1 p-4 flex flex-col justify-center",children:[e.jsx("p",{className:"text-xs font-medium text-primary uppercase tracking-wider mb-1",children:"Print Edition"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:x(t.issue_month)}),t.description&&e.jsx("p",{className:"text-sm text-muted-foreground mb-4 line-clamp-2",children:w(t.description)}),d?e.jsxs(y,{size:"sm",onClick:p,className:"w-fit",children:[e.jsx(g,{className:"mr-2 h-4 w-4"}),"Read Now"]}):e.jsx(y,{size:"sm",className:"w-fit",asChild:!0,children:e.jsxs(o,{to:"/subscribe",children:["Subscribe to Read",e.jsx(c,{className:"ml-2 h-4 w-4"})]})})]})]})})},V=Object.freeze(Object.defineProperty({__proto__:null,default:F},Symbol.toStringTag,{value:"Module"}));export{F as P,j as S,V as a};
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.