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]="202bf186-ed7a-4fc6-b2d5-4977f4cd6520",e._sentryDebugIdIdentifier="sentry-dbid-202bf186-ed7a-4fc6-b2d5-4977f4cd6520")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4899],{9271:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var o=r(71844),n=r(49660),l=r(79706);let s=(0,r(76648).memo)(function(e){let{children:t}=e;return(0,o.jsx)(n.ErrorBoundary,{FallbackComponent:l.default,children:t})})},21065:(e,t,r)=>{"use strict";r.d(t,{B:()=>f});var o=r(71844),n=r(20656),l=r(30160),s=r(14250),a=r(82235),i=r(49510),c=r(32366),u=r(50149),d=r(78247),m=r(76648);let h="/books/preorder",f=m.memo(e=>{let{book:t,isOpen:r,onOpenChange:f}=e,b=!!(null==t?void 0:t.title),p=(0,m.useMemo)(()=>{if(!b)return[];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}),t.hasAudible&&t.amazonLink&&e.push({type:"Audible",href:t.amazonLink}),e},[t,b]),x=(0,m.useCallback)(e=>{null==f||f(e)},[f]);if(!b){let e=Error("BuyBookModal: Book or book title is missing");return console.error(e),n.Cp(e),null}if(0===p.length){let e=Error("BuyBookModal: No purchase options available for book: ".concat(t.title));return console.warn(e),n.wd(e.message,{level:"warning"}),null}return(0,o.jsx)(l.Y,{isOpen:r,onOpenChange:x,size:"sm",hideCloseButton:!0,children:(0,o.jsx)(s.g,{className:"pb-0",children:e=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsxs)(a.c,{className:"flex flex-col gap-1",children:["Buy ",t.title]}),(0,o.jsx)(i.h,{children:p.map(e=>{let{type:r,href:l}=e;return(0,o.jsxs)(c.T,{as:u.h,href:l,color:"primary",className:"w-full mb-2",isExternal:l.startsWith("http"),"aria-label":"Buy ".concat(r," version of ").concat(t.title),onPress:()=>{try{if(!l)return;l.startsWith("http")&&window.open(l,"_blank","noopener,noreferrer")}catch(e){console.error("Error handling button press:",e),n.Cp(e)}},children:[r,"Audible"===r&&(0,o.jsx)("span",{className:"text-xs",children:"(only on Amazon.com \uD83C\uDDFA\uD83C\uDDF8)"})]},r)})}),(0,o.jsx)(d.q,{children:(0,o.jsx)(c.T,{color:"primary",variant:"light",onPress:()=>{try{null==e||e()}catch(e){console.error("Error closing modal:",e),n.Cp(e)}},className:"shadow-none text-white","aria-label":"Close purchase options modal",children:"Close"})})]})})})});f.displayName="BuyBookModal"},38493:(e,t,r)=>{"use strict";r.d(t,{BooksGrid:()=>u});var o=r(71844),n=r(76648),l=r(58425),s=r(62953),a=r.n(s),i=r(68543);let c=(0,n.memo)(function(e){let{book:t,isPriority:r}=e,s=(0,n.useCallback)(e=>{e.preventDefault();let r=document.getElementById(t.slug);r&&r.scrollIntoView({behavior:"smooth"})},[t.slug]);return(0,o.jsx)(a(),{href:"#".concat(t.slug),onClick:s,className:"inline-block","aria-label":"View ".concat(t.title),children:(0,o.jsx)(l.default,{src:t.coverSrc,alt:t.title,width:100,height:150,className:"border border-black rounded-sm shadow-md transition-transform hover:scale-105",priority:r,loading:r?"eager":"lazy"})})}),u=(0,n.memo)(function(){let e=i.b.slice(0,10);return(0,o.jsx)("div",{className:"mx-auto max-w-2xl flex flex-wrap gap-4 md:gap-8 justify-center",children:e.map((e,t)=>(0,o.jsx)(c,{book:e,isPriority:t<3},e.slug))})})},49660:(e,t,r)=>{"use strict";r.d(t,{ErrorBoundary:()=>s});var o=r(76648);let n=(0,o.createContext)(null),l={didCatch:!1,error:null};class s extends o.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,o=arguments.length,n=Array(o),s=0;s0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,o)){var n,s;null===(n=(s=this.props).onReset)||void 0===n||n.call(s,{next:o,prev:e.resetKeys,reason:"keys"}),this.setState(l)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:l}=this.props,{didCatch:s,error:a}=this.state,i=e;if(s){let e={error:a,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)i=t(e);else if(r)i=(0,o.createElement)(r,e);else if(void 0!==l)i=l;else throw a}return(0,o.createElement)(n.Provider,{value:{didCatch:s,error:a,resetErrorBoundary:this.resetErrorBoundary}},i)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=l}}},56090:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,62953,23)),Promise.resolve().then(r.t.bind(r,16022,23)),Promise.resolve().then(r.bind(r,38493)),Promise.resolve().then(r.bind(r,68366)),Promise.resolve().then(r.bind(r,94684)),Promise.resolve().then(r.bind(r,80230)),Promise.resolve().then(r.bind(r,9271))},68366:(e,t,r)=>{"use strict";r.d(t,{ReviewsCarousel:()=>u});var o=r(71844),n=r(76648),l=r(74933);let s=e=>{let[t,r]=(0,n.useState)(!1),o=(0,n.useRef)({x:0,scrollLeft:0}),l=(0,n.useCallback)(t=>{e.current&&(r(!0),o.current={x:"touches"in t?t.touches[0].clientX:t.clientX,scrollLeft:e.current.scrollLeft})},[e]),s=(0,n.useCallback)(()=>{r(!1)},[]),a=(0,n.useCallback)(r=>{if(!t||!e.current)return;r.preventDefault();let n="touches"in r?r.touches[0].clientX:r.clientX,l=o.current.x-n;e.current.scrollLeft=o.current.scrollLeft+l},[t,e]);return{isDragging:t,handleDragStart:l,handleDragEnd:s,handleDragMove:a}},a={SCROLL_AMOUNT:300},i=(0,n.memo)(function(e){let{review:t,showRating:r,isLast:n}=e;return(0,o.jsx)("div",{className:"w-48 md:w-64 flex-shrink-0 ".concat(n?"":"mr-4 md:mr-8"),children:(0,o.jsx)(l.ReviewCard,{review:t,showRating:r})})}),c=(0,n.memo)(function(e){let{direction:t,show:r,onClick:n}=e;return(0,o.jsx)("button",{onClick:n,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(r?"bg-gradient-".concat("left"===t?"to-r":"to-l"," from-white to-transparent"):"pointer-events-none"),"aria-label":"Scroll ".concat(t)})}),u=(0,n.memo)(function(e){let{reviews:t,showRatings:r,title:l="Some reviews",width:u,height:d}=e,m=(0,n.useRef)(null),[h,f]=(0,n.useState)(!1),[b,p]=(0,n.useState)(!0),x=(0,n.useCallback)(()=>{let e=m.current;if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:o}=e;f(t>0),p(t{let t=m.current;if(!t)return;let r="left"===e?-a.SCROLL_AMOUNT:a.SCROLL_AMOUNT;t.scrollBy({left:r,behavior:"smooth"})},[]),{isDragging:g,handleDragStart:y,handleDragEnd:w,handleDragMove:k}=s(m),j=(0,n.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),k(e))},[k]),N=(0,n.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),y(e))},[y]),B=(0,n.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),w())},[w]),C=t.length<2,E=t.length<3&&"lg"===u;return(0,o.jsxs)("section",{className:"".concat("sm"===d?"mt-0 mb-0 p-0":""," section-separator"),children:[(0,o.jsx)("h3",{className:"text-2xl font-bold mb-4",children:l}),(0,o.jsxs)("div",{className:"w-full relative",children:[(0,o.jsx)("div",{className:"mx-auto mb-4 relative overflow-x-auto scrollbar-hide select-none\n max-w-[280px] 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:x,onMouseDown:N,onMouseUp:B,onMouseLeave:B,onMouseMove:j,onTouchStart:N,onTouchEnd:B,onTouchMove:j,children:(0,o.jsx)("div",{className:"flex ".concat(E?"md:justify-center":""),children:t.map((e,n)=>(0,o.jsx)(i,{review:e,showRating:r,isLast:n===t.length-1},"review-".concat(n)))})}),(0,o.jsx)(c,{direction:"left",show:h,onClick:()=>v("left")}),(0,o.jsx)(c,{direction:"right",show:b,onClick:()=>v("right")})]})]})})},74933:(e,t,r)=>{"use strict";r.d(t,{ReviewCard:()=>f});var o=r(71844),n=r(38977),l=r(22412),s=r(10021),a=r(76648);let i=(0,a.memo)(function(e){var t;let{author:r}=e;if(!r)return null;let n=(null===(t=r.image)||void 0===t?void 0:t.startsWith("/"))?r.image:"/".concat(r.image);return(0,o.jsxs)("div",{className:"flex mx-auto items-center",children:[r.image&&(0,o.jsx)(s.Q,{size:"sm",src:n,alt:"Avatar of ".concat(r.name),className:"border border-slate-400"}),(0,o.jsxs)("div",{className:"".concat(r.image?"ml-2":""),children:[(0,o.jsx)("p",{className:"my-0 text-tiny",children:r.name}),r.description&&(0,o.jsx)("p",{className:"my-0 text-[10px] leading-3 text-slate-400",children:r.description})]})]})});var c=r(18336);let u={active:"text-yellow-400 fill-yellow-400",inactive:"text-gray-300",base:"w-5 h-5"},d=(0,a.memo)(function(e){let{rating:t,maxStars:r=5}=e;return(0,o.jsx)("div",{className:"flex mx-auto mb-2",role:"img","aria-label":"".concat(t," out of ").concat(r," stars"),children:Array.from({length:r},(e,r)=>(0,o.jsx)(c.A,{className:"".concat(u.base," ").concat(r{"use strict";r.d(t,{default:()=>s});var o=r(71844),n=r(76648),l=r(32366);let s=(0,n.memo)(function(e){let{error:t,resetErrorBoundary:r,message:n="We're sorry, a problem occurred. Please try again later."}=e;return(0,o.jsxs)("div",{role:"alert",className:"p-4 border border-red-500 rounded-lg bg-red-50 max-w-xl mx-auto my-8",children:[(0,o.jsx)("h2",{className:"text-lg font-semibold text-red-800 mb-2",children:"Oops! Something went wrong"}),(0,o.jsx)("p",{className:"text-red-700 mb-4",children:n}),!1,(0,o.jsx)(l.T,{onPress:r,color:"danger",className:"w-full sm:w-auto",children:"Try again"})]})})},80230:(e,t,r)=>{"use strict";r.d(t,{BuyBookButton:()=>c});var o=r(71844),n=r(20656),l=r(77360),s=r(32366),a=r(76648),i=r(21065);let c=(0,a.memo)(e=>{let{book:t,className:r}=e,{isOpen:a,onOpen:c,onOpenChange:u}=(0,l.j)();return t?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s.T,{color:"primary",onPress:()=>{try{null==c||c()}catch(e){console.error("Error opening modal:",e),n.Cp(e)}},"aria-label":"Buy ".concat(t.title),className:r,children:"Buy Now"}),(0,o.jsx)(i.B,{book:t,isOpen:a,onOpenChange:u})]}):(!function(){let e="BuyBookButton: No book provided";console.warn(e),n.wd(e,{level:"warning",extra:{component:"BuyBookButton"}})}(),null)});c.displayName="BuyBookButton"},94684:(e,t,r)=>{"use strict";r.d(t,{BookImage:()=>s});var o=r(76648),n=r(38771),l=r(58425);let s=(0,o.memo)(e=>{let{maxRetries:t=3,retryDelay:r=1e3,priority:s=!1,...a}=e,[i,c]=(0,o.useState)(0),u=i{if(!u||0===i)return;let e=setTimeout(()=>c(0),r);return()=>clearTimeout(e)},[i,r,u]);let d=(0,o.useCallback)(()=>{u&&c(e=>e+1)},[u]);return(0,o.createElement)(n.W,{...a,key:i,onError:d,as:l.default,priority:s,alt:a.alt||"Book cover image"})});s.displayName="BookImage"}},e=>{var t=t=>e(e.s=t);e.O(0,[3085,8124,6022,2366,8648,9024,1301,6668,8543,9954,4789,7358],()=>t(56090)),_N_E=e.O()}]);