try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="5a95ce10-35d3-474c-9fb4-d179a0582b1d",e._sentryDebugIdIdentifier="sentry-dbid-5a95ce10-35d3-474c-9fb4-d179a0582b1d")}catch(e){}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2883],{87054:(e,t,o)=>{o.d(t,{ReviewsCarousel:()=>u});var r=o(3896),l=o(52308),s=o(99500);let n=e=>{let[t,o]=(0,l.useState)(!1),r=(0,l.useRef)({x:0,scrollLeft:0}),s=(0,l.useCallback)(t=>{if(!e.current)return;o(!0);let l="touches"in t?t.touches[0].clientX:t.clientX;r.current={x:l,scrollLeft:e.current.scrollLeft}},[e]),n=(0,l.useCallback)(()=>{o(!1)},[]),a=(0,l.useCallback)(o=>{if(!t||!e.current)return;o.preventDefault();let l="touches"in o?o.touches[0].clientX:o.clientX,s=r.current.x-l;e.current.scrollLeft=r.current.scrollLeft+s},[t,e]);return{isDragging:t,handleDragStart:s,handleDragEnd:n,handleDragMove:a}},a={SCROLL_AMOUNT:300},i=(0,l.memo)(function(e){let{review:t,showRating:o,isLast:l}=e;return(0,r.jsx)("div",{className:"w-48 md:w-64 flex-shrink-0 ".concat(l?"":"mr-4 md:mr-8"),children:(0,r.jsx)(s.ReviewCard,{review:t,showRating:o})})}),c=(0,l.memo)(function(e){let{direction:t,show:o,onClick:l}=e;return(0,r.jsx)("button",{onClick:l,className:"absolute ".concat(t,"-0 top-0 bottom-0 w-16 bg-transparent\n no-button-style shadow-none focus:ring-0 focus:outline-none active:bg-transparent \n border-none focus:border-none outline-none\n ").concat(o?"bg-gradient-".concat("left"===t?"to-r":"to-l"," from-white to-transparent"):"pointer-events-none"),"aria-label":"Scroll ".concat(t)})}),u=(0,l.memo)(function(e){let{reviews:t,showRatings:o,title:s="Some reviews",width:u,height:d}=e,m=(0,l.useRef)(null),[h,x]=(0,l.useState)(!1),[f,p]=(0,l.useState)(!0),b=(0,l.useCallback)(()=>{let e=m.current;if(!e)return;let{scrollLeft:t,scrollWidth:o,clientWidth:r}=e;x(t>0),p(t{let t=m.current;if(!t)return;let o="left"===e?-a.SCROLL_AMOUNT:a.SCROLL_AMOUNT;t.scrollBy({left:o,behavior:"smooth"})},[]),{isDragging:g,handleDragStart:k,handleDragEnd:w,handleDragMove:y}=n(m),j=(0,l.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),y(e))},[y]),N=(0,l.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),k(e))},[k]),B=(0,l.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),w())},[w]),C=t.length<2,L=t.length<3&&"lg"===u;return(0,r.jsxs)("section",{className:"".concat("sm"===d?"mt-0 mb-0 p-0":""," section-separator"),children:[(0,r.jsx)("h3",{className:"text-2xl font-bold mb-4",children:s}),(0,r.jsxs)("div",{className:"w-full relative",children:[(0,r.jsx)("div",{className:"mx-auto mb-4 relative overflow-x-auto scrollbar-hide select-none\n max-w-[300px] sm:max-w-[380px] md:max-w-[420px] ".concat("lg"===u?"lg:max-w-[600px]":"","\n cursor-grab active:cursor-grabbing ").concat(C?"flex justify-center":""),ref:m,onScroll:b,onMouseDown:N,onMouseUp:B,onMouseLeave:B,onMouseMove:j,onTouchStart:N,onTouchEnd:B,onTouchMove:j,children:(0,r.jsx)("div",{className:"flex ".concat(L?"md:justify-center":""),children:t.map((e,l)=>(0,r.jsx)(i,{review:e,showRating:o,isLast:l===t.length-1},"review-".concat(l)))})}),(0,r.jsx)(c,{direction:"left",show:h,onClick:()=>v("left")}),(0,r.jsx)(c,{direction:"right",show:f,onClick:()=>v("right")})]})]})})},56787:(e,t,o)=>{o.d(t,{BookImage:()=>n});var r=o(52308),l=o(6643),s=o(32944);let n=(0,r.memo)(e=>{let{maxRetries:t=3,retryDelay:o=1e3,priority:n=!1,...a}=e,[i,c]=(0,r.useState)(0),u=i{if(!u||0===i)return;let e=setTimeout(()=>c(0),o);return()=>clearTimeout(e)},[i,o,u]);let d=(0,r.useCallback)(()=>{u&&c(e=>e+1)},[u]);return(0,r.createElement)(l.W,{...a,key:i,onError:d,as:s.default,priority:n})});n.displayName="BookImage"},2883:(e,t,o)=>{o.d(t,{j:()=>b});var r=o(3896),l=o(52308),s=o(56787),n=o(50066),a=o(61211),i=o(32944);let c=(0,l.memo)(function(e){let{title:t}=e,o={width:200,height:40,alt:"Decorative laurel image",className:"mx-auto"};return(0,r.jsxs)("div",{className:"max-w-[200px] mx-2",children:[(0,r.jsx)(i.default,{src:"/top-laurel.png",...o}),(0,r.jsx)("p",{className:"text-center text-balance text-tiny mb-0",children:t}),(0,r.jsx)(i.default,{src:"/bottom-laurel.png",...o})]})});var u=o(70744),d=o.n(u),m=o(87054),h=o(58744);let x=(0,l.memo)(e=>{let{book:t,priority:o}=e;return(0,r.jsx)("div",{className:"flex h-auto shrink-0 justify-center","aria-label":"Book cover",children:(0,r.jsx)(d(),{href:"/books/".concat(t.slug),children:(0,r.jsx)(s.BookImage,{src:t.coverSrc,alt:"Cover of ".concat(t.title),width:200,height:300,className:"cursor-pointer border border-black rounded-md mx-auto mb-6 hover:shadow-lg transition-shadow",priority:o})})})}),f=(0,l.memo)(e=>{let{book:t}=e;return(0,r.jsxs)("div",{className:"mx-auto flex items-center justify-center gap-4 md:gap-8 mt-6 px-4",role:"group","aria-label":"Book actions",children:[(0,r.jsx)(a.BuyBookButton,{book:t}),(0,r.jsx)("span",{className:"italic mb-0 text-sm","aria-hidden":"true",children:"or"}),(0,r.jsx)(d(),{href:"/books/".concat(t.slug),className:"text-sm underline underline-offset-8 hover:text-gray-600 transition-colors",children:"Learn more →"})]})}),p=(0,l.memo)(function(e){var t;let{book:o,hasReviews:l,hasLaurels:s,bookReviews:n}=e;return(0,r.jsxs)("div",{className:"m-auto overflow-hidden",children:[l&&(0,r.jsx)(m.ReviewsCarousel,{reviews:n,showRatings:!0,width:"sm",height:"sm"}),!l&&s&&(0,r.jsx)("div",{className:"flex items-center justify-center",role:"list","aria-label":"Book laurels",children:null===(t=o.laurels)||void 0===t?void 0:t.map((e,t)=>(0,r.jsx)(c,{title:e},"".concat(o.slug,"-laurel-").concat(t)))}),(0,r.jsx)(f,{book:o})]})}),b=(0,l.memo)(e=>{let{book:t,priority:o=!1,borderStyle:s="strong"}=e,{bookReviews:a,hasReviews:i,hasLaurels:c}=(0,l.useMemo)(()=>{var e;let o=h.Y.filter(e=>{var o;return null===(o=e.object)||void 0===o?void 0:o.some(e=>null==e?void 0:e.toLowerCase().includes(t.title.toLowerCase()))});return{bookReviews:o,hasReviews:o.length>0,hasLaurels:!!(null===(e=t.laurels)||void 0===e?void 0:e.length)}},[t.title,t.laurels]);return(0,r.jsxs)(n.a,{orientation:"vertical",id:t.slug,className:"w-full flex space-y-3 px-0 sm:px-4 md:px-8 py-6 md:py-8 overflow-hidden",style:s,children:[(0,r.jsx)("h3",{className:"text-center",children:t.title}),(0,r.jsx)("p",{className:"text-sm text-center text-balance text-gray-700",children:t.shortDescription}),(0,r.jsxs)("div",{className:"w-full block md:flex flex-row justify-between space-x-0 md:space-x-20 items-center",children:[(0,r.jsx)(x,{book:t,priority:o}),(0,r.jsx)(p,{book:t,hasReviews:i,hasLaurels:c,bookReviews:a})]})]})});x.displayName="BookCover",f.displayName="BookActions",p.displayName="BookContent",b.displayName="BookShowcase"},50066:(e,t,o)=>{o.d(t,{a:()=>i});var r=o(3896),l=o(52308),s=o(71796);let n={normal:"border-slate-400 shadow-md",strong:"border-black shadow-lg"},a={horizontal:"flex-row",vertical:"flex-col"},i=(0,l.memo)(e=>{let{orientation:t,children:o,className:l,id:i,style:c="normal"}=e;return(0,r.jsx)("div",{id:i,className:(0,s.QP)("max-w-3xl flex-1 mx-auto flex gap-4 items-center justify-center p-4 border rounded-lg",n[c],a[t],l),children:o})});i.displayName="Box"},61211:(e,t,o)=>{o.d(t,{BuyBookButton:()=>c});var r=o(3896),l=o(42363),s=o(16465),n=o(60157),a=o(52308),i=o(19778);let c=(0,a.memo)(e=>{let{book:t,className:o}=e,{isOpen:a,onOpen:c,onOpenChange:u}=(0,s.j)();return t?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.T,{color:"primary",onPress:()=>{try{null==c||c()}catch(e){console.error("Error opening modal:",e),l.Cp(e)}},"aria-label":"Buy ".concat(t.title),className:o,children:"Buy Now"}),(0,r.jsx)(i.B,{book:t,isOpen:a,onOpenChange:u})]}):(!function(){let e="BuyBookButton: No book provided";console.warn(e),l.wd(e,{level:"warning",extra:{component:"BuyBookButton"}})}(),null)});c.displayName="BuyBookButton"},19778:(e,t,o)=>{o.d(t,{B:()=>x});var r=o(3896),l=o(42363),s=o(85617),n=o(53936),a=o(97406),i=o(32471),c=o(60157),u=o(27240),d=o(60470),m=o(52308);let h="/books/preorder",x=m.memo(e=>{let{book:t,isOpen:o,onOpenChange:x}=e;if(!(null==t?void 0:t.title)){let e=Error("BuyBookModal: Book or book title is missing");return console.error(e),l.Cp(e),null}let f=(0,m.useMemo)(()=>{let e=[];return(t.amazonLink||h)&&e.push({type:"Paperback",href:t.amazonLink||h}),(t.myStoreLink||h)&&e.push({type:"eBook",href:t.myStoreLink||h}),t.hasAudiobook&&t.myStoreLink&&e.push({type:"Audiobook",href:t.myStoreLink}),e},[t.amazonLink,t.myStoreLink,t.hasAudiobook]),p=(0,m.useCallback)(e=>{null==x||x(e)},[x]);if(0===f.length){let e=Error("BuyBookModal: No purchase options available for book: ".concat(t.title));return console.warn(e),l.wd(e.message,{level:"warning"}),null}return(0,r.jsx)(s.Y,{isOpen:o,onOpenChange:p,size:"sm",hideCloseButton:!0,children:(0,r.jsx)(n.g,{className:"pb-0",children:e=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(a.c,{className:"flex flex-col gap-1",children:["Buy ",t.title]}),(0,r.jsx)(i.h,{children:f.map(e=>{let{type:o,href:s}=e;return(0,r.jsx)(c.T,{as:u.h,href:s,color:"primary",className:"w-full mb-2",isExternal:s.startsWith("http"),"aria-label":"Buy ".concat(o," version of ").concat(t.title),onPress:()=>{try{if(!s)return;s.startsWith("http")&&window.open(s,"_blank","noopener,noreferrer")}catch(e){console.error("Error handling button press:",e),l.Cp(e)}},children:o},o)})}),(0,r.jsx)(d.q,{children:(0,r.jsx)(c.T,{color:"primary",variant:"light",onPress:()=>{try{null==e||e()}catch(e){console.error("Error closing modal:",e),l.Cp(e)}},className:"shadow-none text-white","aria-label":"Close purchase options modal",children:"Close"})})]})})})});x.displayName="BuyBookModal"}}]);