1import{j as e}from"./react-vendor-DgF5BvPh.js";import{u,aW as g,Z as p,p as j,A as l,$ as f,n as o,aX as N,v}from"./index-DQrNnQ_p.js";import{S as i}from"./skeleton-BoDMVMzp.js";import{S as n}from"./sparkles-WEEv1Nnr.js";import{L as d}from"./router-CYXz2GUs.js";import"./ui-vendor-DLQD4Y5c.js";const c=r=>{const a=r.match(/Issue\s*(\d+)/i);return a?parseInt(a[1],10):0},A=()=>{const{data:r,isLoading:a,error:m}=u({queryKey:["scan1-magazines"],queryFn:async()=>{const{data:s,error:t}=await v.from("scan1_magazines").select("*");if(t)throw t;return s.sort((x,h)=>c(x.title)-c(h.title))}});return e.jsxs("div",{className:"min-h-screen flex flex-col",children:[e.jsx(g,{}),e.jsxs("main",{className:"flex-grow",children:[e.jsx("section",{className:"bg-primary text-primary-foreground py-16 md:py-24",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"max-w-3xl",children:[e.jsxs(p,{variant:"secondary",className:"mb-4",children:[e.jsx(j,{className:"h-3 w-3 mr-1"}),"Publications"]}),e.jsx("h1",{className:"text-4xl md:text-5xl font-heading font-bold mb-4",children:"SCAN magazine archive"}),e.jsx("p",{className:"text-lg md:text-xl text-primary-foreground/80 mb-6",children:"Explore 20 years of our original print magazine (2001â2021), featuring news, insights, and stories from GS1 New Zealand and the wider supply chain community."}),e.jsxs(d,{to:"/scan2.0",className:"inline-flex items-center gap-2 text-sm text-primary-foreground/70 hover:text-primary-foreground transition-colors",children:[e.jsx(n,{className:"h-4 w-4"}),e.jsx("span",{children:"Looking for the latest? View SCAN 2.0, our current digital edition"}),e.jsx(l,{className:"h-3 w-3"})]})]})})}),e.jsx("section",{className:"py-12",children:e.jsx("div",{className:"container mx-auto px-4",children:a?e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4",children:[...Array(12)].map((s,t)=>e.jsxs("div",{className:"bg-card rounded-lg overflow-hidden shadow-sm",children:[e.jsx(i,{className:"aspect-[3/4] w-full"}),e.jsxs("div",{className:"p-2 space-y-1",children:[e.jsx(i,{className:"h-4 w-3/4"}),e.jsx(i,{className:"h-3 w-1/2"})]})]},t))}):m?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-destructive",children:"Error loading magazines. Please try again later."})}):r&&r.length>0?e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6 gap-4",children:r.map(s=>e.jsxs("a",{href:s.pdf_url||void 0,target:"_blank",rel:"noopener noreferrer",className:`block bg-card rounded-lg overflow-hidden shadow-sm hover:shadow-lg transition-all group ${s.pdf_url?"cursor-pointer":"cursor-default opacity-60"}`,children:[e.jsx("div",{className:"aspect-[3/4] relative overflow-hidden bg-muted",children:s.hero_image?e.jsx(f,{src:s.hero_image,alt:`${s.title} magazine cover - GS1 New Zealand industry publication`,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",children:e.jsx(o,{className:"w-10 h-10 text-muted-foreground"})})}),e.jsxs("div",{className:"p-3 text-center",children:[e.jsx("h2",{className:"font-medium text-sm text-foreground mb-1",children:s.title.replace("SCAN - ","")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.issue_date})]})]},s.id))}):e.jsxs("div",{className:"text-center py-12",children:[e.jsx(o,{className:"w-16 h-16 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground text-lg",children:"No magazines available yet."})]})})}),e.jsx("section",{className:"py-12 bg-muted/30 border-t",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs(d,{to:"/scan2.0",className:"group flex items-center justify-between p-6 bg-card rounded-xl border border-border hover:border-primary/30 hover:shadow-md transition-all",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"p-3 bg-primary/10 rounded-lg",children:e.jsx(n,{className:"h-6 w-6 text-primary"})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-heading font-semibold text-lg mb-1",children:"SCAN 2.0 â Our Digital Edition"}),e.jsx("p",{className:"text-muted-foreground text-sm",children:"Discover our current digital magazine with the latest member stories and industry insights"})]})]}),e.jsx(l,{className:"h-5 w-5 text-muted-foreground group-hover:text-primary group-hover:translate-x-1 transition-all"})]})})})]}),e.jsx(N,{})]})};export{A 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.