!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e43366c7-2173-475a-8b3d-a2554a70d9db",e._sentryDebugIdIdentifier="sentry-dbid-e43366c7-2173-475a-8b3d-a2554a70d9db")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4899],{32791:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,66267,23)),Promise.resolve().then(r.t.bind(r,29340,23)),Promise.resolve().then(r.bind(r,65322)),Promise.resolve().then(r.bind(r,69592)),Promise.resolve().then(r.bind(r,22079)),Promise.resolve().then(r.bind(r,84071)),Promise.resolve().then(r.bind(r,55446))},65:(e,t,r)=>{"use strict";r.d(t,{ErrorBoundary:()=>s});var o=r(78293);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}}},65322:(e,t,r)=>{"use strict";r.d(t,{BooksGrid:()=>u});var o=r(55057),n=r(78293),l=r(91351),s=r(66267),a=r.n(s),i=r(9938);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))})})},74117:(e,t,r)=>{"use strict";r.d(t,{ReviewCard:()=>f});var o=r(55057),n=r(4645),l=r(14719),s=r(67413),a=r(78293);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(67073);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,{ReviewsCarousel:()=>u});var o=r(55057),n=r(78293),l=r(74117);let s=e=>{let[t,r]=(0,n.useState)(!1),o=(0,n.useRef)({x:0,scrollLeft:0}),l=(0,n.useCallback)(t=>{if(!e.current)return;r(!0);let n="touches"in t?t.touches[0].clientX:t.clientX;o.current={x:n,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-[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: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")})]})]})})},22079:(e,t,r)=>{"use strict";r.d(t,{BookImage:()=>s});var o=r(78293),n=r(60413),l=r(91351);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})});s.displayName="BookImage"},84071:(e,t,r)=>{"use strict";r.d(t,{BuyBookButton:()=>c});var o=r(55057),n=r(86222),l=r(95186),s=r(84621),a=r(78293),i=r(4974);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:c,"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"},4974:(e,t,r)=>{"use strict";r.d(t,{B:()=>f});var o=r(55057),n=r(86222),l=r(20968),s=r(16482),a=r(75635),i=r(51806),c=r(84621),u=r(14909),d=r(78991),m=r(78293);let h="/books/preorder",f=m.memo(e=>{let{book:t,isOpen:r,onOpenChange:f}=e;if(!(null==t?void 0:t.title)){let e=Error("BuyBookModal: Book or book title is missing");return console.error(e),n.Cp(e),null}let b=(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=>{"function"==typeof f&&f(e)},[f]);if(0===b.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:p,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:b.map(e=>{let{type:r,href:n}=e;return(0,o.jsx)(c.T,{as:u.h,href:n,color:"primary",className:"w-full mb-2",isExternal:n.startsWith("http"),"aria-label":"Buy ".concat(r," version of ").concat(t.title),onPress:()=>{n&&n.startsWith("http")&&window.open(n,"_blank","noopener,noreferrer")},children:r},r)})}),(0,o.jsx)(d.q,{children:(0,o.jsx)(c.T,{color:"primary",variant:"light",onPress:e,className:"shadow-none text-white","aria-label":"Close purchase options modal",children:"Close"})})]})})})});f.displayName="BuyBookModal"},55446:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var o=r(55057),n=r(65),l=r(81609);let s=(0,r(78293).memo)(function(e){let{children:t}=e;return(0,o.jsx)(n.ErrorBoundary,{FallbackComponent:l.default,children:t})})},81609:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var o=r(55057),n=r(78293),l=r(84621);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"})]})})}},e=>{var t=t=>e(e.s=t);e.O(0,[1410,9340,2783,4621,6029,3253,9938,4106,6467,7358],()=>t(32791)),_N_E=e.O()}]);