1import{u as j,r as o,j as e,L as m,f as g}from"./index-DTRo8ve5.js";import{H as l}from"./Header-Bx1Cky1S.js";import{S as a,F as i}from"./SEO-DjncT1pd.js";import{A as f}from"./arrow-left-znKUE2me.js";import{C as b}from"./calendar-BpPD07Af.js";import{k as N}from"./proxy-BcCKx_yV.js";const w=({children:t,delay:s=0})=>e.jsx(N.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.8,delay:s,ease:"easeOut"},children:t}),P=()=>{const{slug:t}=j(),[s,p]=o.useState(null),[u,h]=o.useState(!0),[n,d]=o.useState(null);return o.useEffect(()=>{(async()=>{try{const c=await g();console.log("Searching for episode with slug/id:",t);const r=c.items.find(x=>x.slug===t||x.id===t);r?(console.log("Found episode:",r.title),p(r)):(console.warn("Episode not found for slug/id:",t),d("Episode not found."))}catch{d("Failed to load episode details.")}finally{h(!1)}})()},[t]),u?e.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[e.jsx(a,{title:"Loading Episode..."}),e.jsx(l,{}),e.jsx("main",{className:"flex-grow flex items-center justify-center",children:e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-brand-orange"})}),e.jsx(i,{})]}):n||!s?e.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[e.jsx(a,{title:"Episode Not Found"}),e.jsx(l,{}),e.jsxs("main",{className:"flex-grow flex flex-col items-center justify-center px-4",children:[e.jsx("h1",{className:"text-3xl font-bold text-brand-purple mb-4",children:n||"Episode not found"}),e.jsxs(m,{to:"/podcast",className:"text-brand-orange font-bold flex items-center",children:[e.jsx(f,{size:18,className:"mr-2"})," Back to Podcast"]})]}),e.jsx(i,{})]}):e.jsxs("div",{className:"min-h-screen flex flex-col bg-white",children:[e.jsx(a,{title:s.title,description:s.contentSnippet||"Listen to this episode of The Number Podcast with Wendy Brookhouse.",ogType:"article"}),e.jsx(l,{}),e.jsx("main",{className:"flex-grow pt-32 pb-24",children:e.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-8",children:e.jsxs(w,{children:[e.jsxs(m,{to:"/podcast",className:"inline-flex items-center text-brand-orange font-bold mb-12 group",children:[e.jsx(f,{size:18,className:"mr-2 group-hover:-translate-x-2 transition-transform"})," Back to all episodes"]}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-12 items-start mb-16",children:[e.jsx("div",{className:"w-full md:w-64 aspect-square rounded-3xl overflow-hidden shadow-xl flex-shrink-0",children:e.jsx("img",{src:s.itunes.image,alt:s.title,className:"w-full h-full object-cover",referrerPolicy:"no-referrer"})}),e.jsxs("div",{className:"flex-grow",children:[e.jsx("h1",{className:"text-4xl md:text-5xl text-brand-purple font-bold mb-4 leading-tight",children:s.title}),e.jsx("div",{className:"flex items-center space-x-4 text-sm text-gray-500 mb-8",children:e.jsxs("span",{className:"flex items-center",children:[e.jsx(b,{size:14,className:"mr-2"})," ",new Date(s.pubDate).toLocaleDateString()]})}),e.jsx("div",{className:"bg-brand-light/50 p-6 rounded-2xl border border-gray-100 mb-8",children:e.jsx("audio",{controls:!0,className:"w-full",src:s.enclosure.url,children:"Your browser does not support the audio element."})})]})]}),e.jsxs("div",{className:"prose prose-lg max-w-none",children:[e.jsx("h2",{className:"text-2xl font-bold text-brand-purple mb-6",children:"Show Notes"}),e.jsx("div",{className:"text-gray-700 leading-relaxed space-y-6 podcast-content",dangerouslySetInnerHTML:{__html:s.content}})]})]})})}),e.jsx(i,{})]})};export{P as EpisodeDetail};
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.