import{c as M,r as p,j as e,w as N,u as w,d as L,s as P,v as R,x as E,O as D,i as v,C as F}from"./index-DUbLbkT8.js";import{g as _,b as q,c as H,C as O}from"./blogArticles-bYQrBMqY.js";import{g as V}from"./blogAuthors-B_BhA8O5.js";import W from"./NotFoundPage-BtrRf1ex.js";import{U as T}from"./user-CSX0hPGa.js";/**
 * @license lucide-react v0.383.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const G=M("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);function K({content:c}){const[t,n]=p.useState([]),[s,l]=p.useState("");return p.useEffect(()=>{const a=document.createElement("div");a.innerHTML=c;const r=Array.from(a.querySelectorAll("h2, h3")).map(i=>({id:i.id,text:i.textContent,level:i.tagName.toLowerCase()}));n(r)},[c]),p.useEffect(()=>{if(t.length===0)return;const a=new IntersectionObserver(r=>{for(const i of r)if(i.isIntersecting){l(i.target.id);break}},{rootMargin:"-80px 0px -60% 0px"});for(const r of t){const i=document.getElementById(r.id);i&&a.observe(i)}return()=>a.disconnect()},[t]),t.length<2?null:e.jsxs("nav",{className:"za-card rounded-xl p-5 mb-8 sticky top-24","aria-label":"Table of Contents",children:[e.jsx("h4",{className:"text-xs uppercase tracking-widest za-gold mb-3 za-display",children:"On This Page"}),e.jsx("ul",{className:"space-y-1.5",children:t.map((a,r)=>e.jsx("li",{children:e.jsx("a",{href:`#${a.id}`,onClick:i=>{i.preventDefault();const m=document.getElementById(a.id);m&&m.scrollIntoView({behavior:"smooth",block:"start"})},className:`block text-sm py-1 transition-colors ${a.level==="h3"?"pl-4":""} ${s===a.id?"za-gold":"za-ink-dim hover:text-current"}`,children:a.text})},`${a.id}-${r}`))})]})}function B({title:c,url:t,description:n}){const s={url:encodeURIComponent(`${N}${t}`),title:encodeURIComponent(c),desc:encodeURIComponent(n||"")},l=[{name:"Twitter",href:`https://twitter.com/intent/tweet?text=${s.title}&url=${s.url}`},{name:"Facebook",href:`https://www.facebook.com/sharer/sharer.php?u=${s.url}`},{name:"Pinterest",href:`https://pinterest.com/pin/create/button/?url=${s.url}&description=${s.desc}`},{name:"Copy Link",href:"#",copy:!0}],a=r=>{var i;r.preventDefault(),(i=navigator.clipboard)==null||i.writeText(`${N}${t}`)};return e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{className:"text-xs za-ink-dim uppercase tracking-wider",children:"Share"}),l.map(r=>e.jsx("a",{href:r.copy?"#":r.href,target:r.copy?void 0:"_blank",rel:r.copy?void 0:"noopener noreferrer",onClick:r.copy?a:void 0,className:"za-focus za-surface2 hover:za-bg-gold hover:text-white rounded-full px-3 py-1.5 text-xs transition-colors",children:r.name},r.name))]})}function J({articles:c,onNav:t}){return c.length===0?null:e.jsxs("div",{className:"mb-10",children:[e.jsx("h3",{className:"za-display text-xl mb-4",children:"Related Articles"}),e.jsx("div",{className:"grid sm:grid-cols-3 gap-4",children:c.map(n=>e.jsxs("button",{onClick:()=>t("blog-article",{slug:n.slug}),className:"za-focus za-card za-card-hover rounded-xl p-4 text-left",children:[e.jsx("p",{className:"text-xs za-ink-dim uppercase tracking-wider mb-1",children:n.category.replace(/-/g," ")}),e.jsx("p",{className:"za-display text-sm leading-snug",children:n.title}),e.jsx("p",{className:"text-xs za-ink-dim mt-2 line-clamp-2",children:n.excerpt})]},n.id))})]})}function Q({slugs:c,onNav:t}){const{products:n}=w(),s=c.map(l=>n.find(a=>a.slug===l&&a.enabled)).filter(Boolean);return s.length===0?null:e.jsxs("div",{className:"mb-12",children:[e.jsx("h3",{className:"za-display text-2xl mb-6 flex items-center gap-2",children:e.jsx("span",{className:"za-gold",children:"Related Collections"})}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4",children:s.map(l=>{var a,r,i,m,o,h;return e.jsxs("button",{onClick:()=>t("detail",{slug:l.slug}),className:"za-focus za-card za-card-hover rounded-2xl p-4 text-left group",children:[e.jsx("div",{className:"w-full aspect-[3/4] rounded-xl border border-[rgba(255,255,255,0.06)] mb-3 overflow-hidden",style:{backgroundColor:((a=l.palette)==null?void 0:a[0])||"#1e1b2e"},children:l.coverUrl?e.jsx("img",{src:l.coverUrl,alt:l.displayTitle,className:"w-full h-full object-cover",loading:"lazy"}):e.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center p-3",style:{background:`linear-gradient(135deg, ${((r=l.palette)==null?void 0:r[0])||"#1e1b2e"}88, ${((i=l.palette)==null?void 0:i[1])||"#8b5cf6"}44)`},children:[e.jsx("span",{className:"za-display text-lg text-center leading-tight group-hover:za-gold transition-colors",style:{color:((m=l.palette)==null?void 0:m[1])||"#c6a15b"},children:l.displayTitle}),((o=l.genres)==null?void 0:o[0])&&e.jsx("span",{className:"text-[10px] opacity-60 mt-2 uppercase tracking-wider",children:l.genres[0]})]})}),e.jsxs("p",{className:"text-xs za-ink-dim",children:[l.years," · ",l.episodes||l.seasons," ",l.episodes?"episodes":"seasons"]}),e.jsxs("p",{className:"za-display text-sm za-gold mt-1.5",children:["From $",Math.min(l.formats.digital.price,((h=l.formats.usb)==null?void 0:h.price)||1/0).toFixed(2)]})]},l.id)})})]})}function X({onNav:c,genre:t,excludeSlug:n}){const{products:s}=w(),l=s.filter(a=>{var r;return a.enabled&&((r=a.genres)==null?void 0:r.some(i=>i.toLowerCase()===(t==null?void 0:t.toLowerCase())))&&a.slug!==n}).slice(0,4);return l.length<2?null:e.jsxs("div",{className:"my-10 za-card rounded-2xl p-6 sm:p-8 border-l-4 border-l-purple-500",children:[e.jsxs("h3",{className:"za-display text-xl mb-1",children:["Explore the ",t," Collection"]}),e.jsx("p",{className:"za-ink-dim text-sm mb-5",children:"Browse complete series collections in this genre — available as digital download or USB."}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:l.map(a=>{var o;const[r,i]=a.palette||[],m=a.coverUrl?{backgroundImage:`url(${a.coverUrl})`,backgroundSize:"cover",backgroundPosition:"center"}:{background:`linear-gradient(155deg, ${r||"#1e1b2e"}, ${i||"#8b5cf6"}22 70%, ${r||"#1e1b2e"})`};return e.jsxs("button",{onClick:()=>c("detail",{slug:a.slug}),className:"za-focus za-surface2 rounded-xl overflow-hidden text-left hover:za-bg-gold hover:text-white transition-all group",children:[e.jsx("div",{className:"w-full aspect-[3/4] bg-cover bg-center",style:m}),e.jsxs("div",{className:"p-2",children:[e.jsx("p",{className:"za-display text-xs leading-snug truncate",children:a.displayTitle}),e.jsx("p",{className:"text-[10px] za-ink-dim mt-0.5 group-hover:text-white/70",children:a.years}),e.jsxs("p",{className:"za-display text-[11px] mt-1 za-gold",children:["From $",Math.min(a.formats.digital.price,((o=a.formats.usb)==null?void 0:o.price)||1/0).toFixed(2)]})]})]},a.id)})})]})}function Y({slugs:c,onNav:t}){const{products:n}=w(),s=c.map(l=>n.find(a=>a.slug===l&&a.enabled)).filter(Boolean);return s.length===0?null:e.jsx("div",{className:"mb-10 za-card rounded-2xl overflow-hidden border border-[rgba(255,255,255,0.06)]",children:e.jsxs("div",{className:"p-5 sm:p-6",children:[e.jsxs("h3",{className:"za-display text-lg mb-4 flex items-center gap-2",children:[e.jsx(L,{size:16,className:"za-gold"}),e.jsx("span",{children:"Shop This Collection"})]}),e.jsx("div",{className:"flex flex-col gap-3",children:s.map(l=>{var a,r,i,m,o;return e.jsxs("button",{onClick:()=>t("detail",{slug:l.slug}),className:"za-focus flex items-center gap-4 za-surface2 rounded-xl p-3 sm:p-4 text-left hover:za-bg-gold hover:text-white transition-all group",children:[e.jsx("div",{className:"w-16 h-20 sm:w-20 sm:h-24 rounded-lg shrink-0 overflow-hidden border border-[rgba(255,255,255,0.06)]",style:{backgroundColor:((a=l.palette)==null?void 0:a[0])||"#1e1b2e"},children:l.coverUrl?e.jsx("img",{src:l.coverUrl,alt:l.displayTitle,className:"w-full h-full object-cover"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center p-1",style:{background:`linear-gradient(135deg, ${((r=l.palette)==null?void 0:r[0])||"#1e1b2e"}88, ${((i=l.palette)==null?void 0:i[1])||"#8b5cf6"}44)`},children:e.jsx("span",{className:"text-[9px] font-bold text-center leading-tight",style:{color:((m=l.palette)==null?void 0:m[1])||"#c6a15b"},children:l.displayTitle})})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"za-display text-sm sm:text-base leading-snug truncate group-hover:text-white",children:l.displayTitle}),e.jsxs("p",{className:"text-xs opacity-60 mt-0.5",children:[l.years," · ",l.episodes||l.seasons," ",l.episodes?"episodes":"seasons"]}),e.jsxs("p",{className:"za-display text-xs sm:text-sm za-gold mt-1 group-hover:text-white",children:["From $",Math.min(l.formats.digital.price,((o=l.formats.usb)==null?void 0:o.price)||1/0).toFixed(2)]})]}),e.jsx("span",{className:"za-display text-xs za-bg-gold text-white rounded-full px-3 py-1.5 shrink-0 opacity-0 group-hover:opacity-100 transition-opacity",children:"View"})]},l.id)})})]})})}function Z({slug:c,products:t,onNav:n}){var a,r,i,m,o;const s=p.useMemo(()=>t.find(h=>h.slug===c&&h.enabled),[c,t]);if(!s)return null;const l=s.title.split(/\s+/).slice(0,2).map(h=>h[0]).join("").toUpperCase();return e.jsxs("button",{onClick:()=>n("detail",{slug:s.slug}),className:"za-focus za-card za-card-hover rounded-2xl overflow-hidden text-left group",children:[e.jsx("div",{className:"w-full aspect-[3/4] overflow-hidden",style:{backgroundColor:((a=s.palette)==null?void 0:a[0])||"#1e1b2e"},children:s.coverUrl?e.jsx("img",{src:s.coverUrl,alt:s.displayTitle,className:"w-full h-full object-cover transition-transform duration-300 group-hover:scale-105",loading:"lazy"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center",style:{background:`linear-gradient(135deg, ${((r=s.palette)==null?void 0:r[0])||"#1e1b2e"}88, ${((i=s.palette)==null?void 0:i[1])||"#8b5cf6"}44)`},children:e.jsx("span",{className:"za-display text-2xl",style:{color:((m=s.palette)==null?void 0:m[1])||"#c6a15b"},children:l})})}),e.jsxs("div",{className:"p-3 sm:p-4",children:[e.jsx("p",{className:"za-display text-sm leading-snug line-clamp-2 mb-1",children:s.displayTitle}),e.jsxs("p",{className:"text-xs za-ink-dim",children:[s.years," · ",(o=s.genres)==null?void 0:o[0]]}),e.jsx("span",{className:"inline-block mt-2 za-display text-xs za-bg-gold text-white rounded-full px-3 py-1 opacity-0 group-hover:opacity-100 transition-opacity",children:"View Series"})]})]})}function ee({prev:c,next:t,onNav:n}){return!c&&!t?null:e.jsxs("div",{className:"flex justify-between gap-4 mt-10 pt-8 border-t za-border",children:[e.jsx("div",{className:"flex-1",children:c?e.jsxs("button",{onClick:()=>n("blog-article",{slug:c.slug}),className:"za-focus za-card za-card-hover rounded-xl p-4 text-left w-full",children:[e.jsx("p",{className:"text-xs za-ink-dim uppercase tracking-wider mb-1",children:"Previous"}),e.jsx("p",{className:"za-display text-sm leading-snug",children:c.title})]}):e.jsx("div",{})}),e.jsx("div",{className:"flex-1",children:t?e.jsxs("button",{onClick:()=>n("blog-article",{slug:t.slug}),className:"za-focus za-card za-card-hover rounded-xl p-4 text-right w-full",children:[e.jsx("p",{className:"text-xs za-ink-dim uppercase tracking-wider mb-1",children:"Next"}),e.jsx("p",{className:"za-display text-sm leading-snug",children:t.title})]}):e.jsx("div",{})})]})}function ie({slug:c,onNav:t}){var k,C,$;const{products:n}=w(),s=_(c),l=p.useMemo(()=>s?q(s):[],[s]),a=p.useMemo(()=>H((s==null?void 0:s.category)||"").sort((j,g)=>new Date(g.publishedDate)-new Date(j.publishedDate)),[s]),r=p.useMemo(()=>a.findIndex(x=>x.slug===c),[a,c]),i=r>0?a[r-1]:null,m=r>=0&&r<a.length-1?a[r+1]:null,o=p.useMemo(()=>{var g;if(!s||!n.length)return null;const x=s.relatedProductSlugs||[],j=new Set(["Drama","Comedy","Action","Adventure","Kids","Family"]);for(const u of x){const y=n.find(d=>d.slug===u&&d.enabled);if(y&&((g=y.genres)!=null&&g.length)){const d=y.genres.find(z=>!j.has(z));return d||y.genres[0]}}return null},[s,n]),h=p.useCallback(x=>{const j=x.target.closest("a");if(!j)return;const g=j.getAttribute("href");if(!g||g.startsWith("http")||g.startsWith("mailto")||g.startsWith("#"))return;x.preventDefault();const[u,y]=g.split("?"),d=new URLSearchParams(y||""),z=u.match(/^\/show\/([^/]+)$/);if(z)return t("detail",{slug:decodeURIComponent(z[1])});const S=u.match(/^\/blog\/([^/]+)$/);if(S)return t("blog-article",{slug:decodeURIComponent(S[1])});const I=u.match(/^\/blog\/category\/([^/]+)$/);if(I)return t("blog-category",{slug:decodeURIComponent(I[1])});const U=u.match(/^\/blog\/tag\/([^/]+)$/);if(U)return t("blog-tag",{slug:decodeURIComponent(U[1])});if(u==="/blog")return t("blog");if(u==="/collections"){const f={};return d.get("genre")&&(f.genre=d.get("genre")),d.get("decade")&&(f.decade=d.get("decade")),d.get("format")&&(f.format=d.get("format")),d.get("sort")&&(f.sort=d.get("sort")),d.get("q")&&(f.query=d.get("q")),d.get("wishlist")&&(f.wishlistOnly=!0),t("listing",f)}const A=u.match(/^\/pages\/([^/]+)$/);if(A)return t("trust",{page:A[1]});if(u==="/"||u==="")return t("home");if(u==="/checkout")return t("checkout");if(u==="/my-orders")return t("myorders");t("listing",{query:g.replace(/^\//,"")})},[t]);if(!s)return e.jsx(W,{onNav:t});P({title:s.title,description:s.excerpt,path:`/blog/${c}`,image:s.featuredImage?s.featuredImage.startsWith("http")?s.featuredImage:`${N}${s.featuredImage}`:D,keywords:s.tags.join(", "),jsonLd:E(s),jsonLdExtra:[R([{name:"Home",url:"/"},{name:"Blog",url:"/blog"},{name:s.category.replace(/-/g," "),url:`/blog/category/${s.category}`},{name:s.title}])]});const b=V(s.author);return e.jsx("div",{className:"za-fade-view",children:e.jsxs("div",{className:"max-w-[1400px] mx-auto px-5 sm:px-8 lg:px-12 py-10 sm:py-14",children:[e.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-xs za-ink-dim mb-8 flex-wrap",children:[e.jsx("button",{onClick:()=>t("home"),className:"za-focus hover:text-current",children:"Home"}),e.jsx(v,{size:12}),e.jsx("button",{onClick:()=>t("blog"),className:"za-focus hover:text-current",children:"Blog"}),e.jsx(v,{size:12}),e.jsx("button",{onClick:()=>t("blog-category",{slug:s.category}),className:"za-focus hover:text-current",children:s.category.replace(/-/g," ")}),e.jsx(v,{size:12}),e.jsx("span",{"aria-current":"page",className:"truncate max-w-[200px] sm:max-w-[400px]",children:s.title})]}),e.jsxs("div",{className:"flex flex-col lg:flex-row gap-10",children:[e.jsxs("article",{className:"flex-1 min-w-0 max-w-[860px]",children:[e.jsxs("button",{onClick:()=>t("blog"),className:"za-focus flex items-center gap-1.5 text-xs za-ink-dim hover:text-current mb-6",children:[e.jsx(G,{size:13})," Back to Blog"]}),s.featuredImage&&e.jsx("img",{src:s.featuredImage,alt:s.featuredImageAlt||s.title,className:"w-full rounded-2xl mb-8 object-cover aspect-[16/9] shadow-lg",loading:"eager"}),e.jsx("h1",{className:"za-display text-3xl sm:text-4xl lg:text-5xl leading-[1.05] mb-6",children:s.title}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 text-sm za-ink-dim mb-8",children:[e.jsxs("button",{onClick:()=>t("blog-author",{slug:b.slug}),className:"za-focus flex items-center gap-1.5 hover:text-current",children:[e.jsx(T,{size:14})," ",s.author]}),e.jsx("span",{children:"·"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(O,{size:13})," ",new Date(s.publishedDate).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"})]}),e.jsx("span",{children:"·"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(F,{size:13})," ",s.readingTime," min read"]}),e.jsx("span",{children:"·"}),e.jsx("button",{onClick:()=>t("blog-category",{slug:s.category}),className:"za-focus za-gold uppercase tracking-wider text-xs",children:s.category.replace(/-/g," ")})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-10",children:s.tags.map(x=>e.jsx("button",{onClick:()=>t("blog-tag",{slug:x.toLowerCase().replace(/\s+/g,"-")}),className:"za-focus za-surface2 rounded-full px-3 py-1 text-xs za-ink-dim hover:za-bg-gold hover:text-white transition-colors",children:x},x))}),o&&e.jsxs("div",{className:"mb-10 za-card rounded-2xl p-5 sm:p-6 flex items-center justify-between flex-wrap gap-4",children:[e.jsxs("div",{children:[e.jsxs("p",{className:"za-display text-lg",children:["Browse ",o," Collections"]}),e.jsxs("p",{className:"za-ink-dim text-xs mt-1",children:["View our full ",o," series catalog available now."]})]}),e.jsxs("button",{onClick:()=>t("listing",{genre:o}),className:"za-focus za-bg-gold text-white rounded-full px-5 py-2.5 text-sm za-display shrink-0 shadow-[0_10px_30px_rgba(109,74,255,0.30)]",children:["Explore ",o," Series"]})]}),e.jsx("div",{className:"mb-8",children:e.jsx(B,{title:s.title,url:`/blog/${s.slug}`,description:s.excerpt})}),e.jsx("div",{className:"blog-content",onClick:h,children:e.jsx("div",{dangerouslySetInnerHTML:{__html:s.content}})}),e.jsx("div",{className:"mt-10 mb-10",children:e.jsx(B,{title:s.title,url:`/blog/${s.slug}`,description:s.excerpt})}),((k=s.relatedProductSlugs)==null?void 0:k.length)>0&&e.jsx(Y,{slugs:s.relatedProductSlugs,onNav:t}),((C=s.relatedProductSlugs)==null?void 0:C.length)>0&&e.jsxs("div",{className:"mb-12",children:[e.jsx("h3",{className:"za-display text-xl mb-5 flex items-center gap-2",children:e.jsx("span",{className:"za-gold",children:"Featured Series"})}),e.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-4 gap-4",children:s.relatedProductSlugs.map(x=>e.jsx(Z,{slug:x,products:n,onNav:t},x))})]}),e.jsx(ee,{prev:i,next:m,onNav:t})]}),e.jsx("aside",{className:"w-full lg:w-80 shrink-0 order-first lg:order-last",children:e.jsx(K,{content:s.content})})]}),e.jsxs("div",{className:"mt-16 max-w-[860px]",children:[o&&e.jsx(X,{onNav:t,genre:o,excludeSlug:($=s.relatedProductSlugs)==null?void 0:$[0]}),e.jsx(Q,{slugs:s.relatedProductSlugs,onNav:t}),e.jsx(J,{articles:l,onNav:t})]}),e.jsxs("div",{className:"max-w-[860px] mt-12 za-card rounded-2xl p-6 sm:p-8 flex items-center gap-5 flex-wrap",children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"flex items-center gap-1.5 text-sm za-ink-dim mb-2",children:[e.jsx(T,{size:14})," Written by"]}),e.jsx("p",{className:"za-display text-xl",children:b.name}),b.bio&&e.jsx("p",{className:"text-sm za-ink-dim mt-2 leading-relaxed",children:b.bio})]}),e.jsxs("button",{onClick:()=>t("blog-author",{slug:b.slug}),className:"za-focus za-surface2 rounded-full px-5 py-2.5 text-sm shrink-0 hover:za-bg-gold hover:text-white",children:["View all articles by ",b.name.split(" ")[0]]})]})]})})}export{ie as default};