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]="5d3718fc-4155-4bf9-9646-3eab8fd2d100",e._sentryDebugIdIdentifier="sentry-dbid-5d3718fc-4155-4bf9-9646-3eab8fd2d100")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3746,7581],{21964:(e,t,r)=>{Promise.resolve().then(r.t.bind(r,67873,23)),Promise.resolve().then(r.bind(r,2061)),Promise.resolve().then(r.bind(r,80671)),Promise.resolve().then(r.bind(r,80615)),Promise.resolve().then(r.bind(r,71675)),Promise.resolve().then(r.bind(r,87041)),Promise.resolve().then(r.bind(r,26886)),Promise.resolve().then(r.bind(r,99500)),Promise.resolve().then(r.bind(r,87054)),Promise.resolve().then(r.bind(r,61211)),Promise.resolve().then(r.bind(r,3746)),Promise.resolve().then(r.bind(r,63485))},57613:(e,t,r)=>{"use strict";var s=r(51801);r.o(s,"useParams")&&r.d(t,{useParams:function(){return s.useParams}}),r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},51615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return s.callServer},createServerReference:function(){return l},findSourceMapURL:function(){return a.findSourceMapURL}});let s=r(82516),a=r(36424),l=r(52640).createServerReference},2061:(e,t,r)=>{"use strict";r.d(t,{ErrorBoundary:()=>n});var s=r(52308);let a=(0,s.createContext)(null),l={didCatch:!1,error:null};class n extends s.Component{static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){let{error:e}=this.state;if(null!==e){for(var t,r,s=arguments.length,a=Array(s),n=0;n0&&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,s)){var a,n;null===(a=(n=this.props).onReset)||void 0===a||a.call(n,{next:s,prev:e.resetKeys,reason:"keys"}),this.setState(l)}}render(){let{children:e,fallbackRender:t,FallbackComponent:r,fallback:l}=this.props,{didCatch:n,error:o}=this.state,i=e;if(n){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)i=t(e);else if(r)i=(0,s.createElement)(r,e);else if(void 0!==l)i=l;else throw o}return(0,s.createElement)(a.Provider,{value:{didCatch:n,error:o,resetErrorBoundary:this.resetErrorBoundary}},i)}constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=l}}},12950:(e,t,r)=>{"use strict";r.d(t,{z:()=>c});var s=r(3896),a=r(52863),l=r(62783),n=r(18809),o=r(70744),i=r.n(o);let c=e=>{let{posts:t,style:r="cards",forceSubscribeInvite:o=!1}=e,c=o||t.length<3;return(0,s.jsxs)("div",{className:"flex flex-col gap-4 justify-center",children:[(0,s.jsx)("div",{className:"container mx-4 ".concat("cards"===r?"my-4":"my-0"," mx-auto flex flex-wrap gap-4 justify-center"),children:"cards"===r?t.map((e,t)=>(0,s.jsx)(n.default,{post:e,index:t},e.slug)):(0,s.jsx)("div",{className:"flex flex-col gap-2",children:t.map(e=>(0,s.jsxs)("div",{className:"flex flex-row items-center my-0",children:[e.stars>1&&(0,s.jsx)(a.A,{className:"w-4 h-4 mr-2 text-yellow-500 fill-yellow-500"}),(0,s.jsxs)(i(),{href:"/posts/".concat(e.slug),className:"flex flex-row items-center text-gray-600 hover:scale-100 no-underline",children:[e.title,(0,s.jsx)(l.A,{className:"w-4 h-4 ml-2 text-gray-600"})]})]},e.slug))})}),(0,s.jsxs)("footer",{className:"flex flex-col gap-2",children:[c&&(0,s.jsxs)("p",{className:"text-tiny text-gray-400 text-center text-balance !my-0",children:["I will add more posts soon (subscribe to"," ",(0,s.jsx)(i(),{href:"/newsletter",children:"my newsletter"})," to be notified)."]}),(0,s.jsxs)("p",{className:"text-tiny text-gray-400 text-center text-balance !my-0",children:["Click ",(0,s.jsx)(i(),{href:"/blog",children:"here"})," to view all of my posts."]})]})]})}},18809:(e,t,r)=>{"use strict";r.d(t,{default:()=>f});var s=r(3896),a=r(49948),l=r(27240),n=r(3851),o=r(17429),i=r(77470),c=r(52308);let d="text-tiny text-nowrap rounded-md px-1 py-0.5",m=(e,t)=>e>=2?{text:"Most popular",className:"".concat(d," text-rose-600 border border-rose-600")}:e>=1||0===t&&e>0?{text:"Popular",className:"".concat(d," text-orange-500 border border-orange-500")}:0===e&&0===t?{text:"Most recent",className:"".concat(d," text-orange-500 border border-orange-500")}:null,u=(0,c.memo)(e=>{let{stars:t,index:r}=e,a=m(t,r);return a?(0,s.jsx)("span",{className:a.className,children:a.text}):null});u.displayName="BlogpostCardTitle";let h={container:"mx-auto w-full md:max-w-[48%] 2xl:max-w-[31%]",card:"no-button-style z-0 p-2 w-full min-w-64 cursor-pointer",header:"py-1 md:py-2 lg:py-3",headerContent:"w-full flex justify-between items-start",title:"text-left text-balance font-semibold",chipContainer:"flex justify-end mt-1 ml-2",body:"py-2",description:"text-sm text-gray-500",footer:"flex justify-between items-center py-1 md:py-2 lg:py-3",date:"text-tiny text-gray-400 min-w-20",tagContainer:"flex flex-wrap space-x-1 justify-end",tag:"text-tiny text-gray-400"},x=(0,c.memo)(e=>{let{tags:t}=e;return(0,s.jsx)("div",{className:h.tagContainer,children:t.map(e=>(0,s.jsxs)("span",{className:h.tag,children:["#",e]},e))})});x.displayName="Tags";let p=(0,c.memo)(e=>{let{post:t,index:r}=e,{title:c,slug:d,stars:m,description:p,date:f,tags:g}=t;return(0,s.jsx)("div",{className:h.container,children:(0,s.jsxs)(a.Z,{as:l.h,href:"/posts/".concat(d),classNames:{base:h.card},children:[(0,s.jsx)(n.d,{className:h.header,children:(0,s.jsxs)("div",{className:h.headerContent,children:[(0,s.jsx)("span",{className:h.title,children:c}),(0,s.jsx)("div",{className:h.chipContainer,children:(0,s.jsx)(u,{stars:m,index:r})})]})}),(0,s.jsx)(o.U,{className:h.body,children:(0,s.jsx)("span",{className:h.description,children:p})}),(0,s.jsxs)(i.Z,{className:h.footer,children:[(0,s.jsx)("span",{className:h.date,children:f}),(0,s.jsx)(x,{tags:g})]})]})})});p.displayName="BlogpostCard";let f=p},80671:(e,t,r)=>{"use strict";r.d(t,{AboutTheBook:()=>u});var s=r(3896),a=r(19778),l=r(60157),n=r(86524),o=r(87041),i=r(52308),c=r(70957);let d=(0,i.memo)(function(e){let{onClick:t}=e;return(0,s.jsxs)(l.T,{variant:"light",onPress:t,className:"h-auto !py-0 section-separator mx-auto my-6 p-2 rounded-lg max-w-3xl overflow-hidden !bg-white relative w-full shadow-none","aria-labelledby":"stores-heading",children:[(0,s.jsx)("h2",{id:"stores-heading",className:"text-sm text-center font-semibold mb-4",children:"Available at these stores:"}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(o.LogoReel,{logos:c.K}),(0,s.jsx)(n.A,{width:"w-24"})]})]})});var m=r(16465);let u=(0,i.memo)(function(e){let{book:t,className:r=""}=e,{isOpen:l,onOpen:n,onOpenChange:o}=(0,m.j)();return(0,s.jsxs)("section",{id:"about",className:"section-separator \n flex flex-col gap-6 ".concat(r),"aria-labelledby":"about-heading",children:[(0,s.jsx)("h3",{id:"about-heading",className:"text-2xl font-bold",children:"About the book"}),(0,s.jsx)("div",{className:"prose max-w-none",children:t.aboutText}),(0,s.jsx)(a.B,{book:t,isOpen:l,onOpenChange:o}),(0,s.jsx)(d,{onClick:n})]})})},80615:(e,t,r)=>{"use strict";r.d(t,{default:()=>p});var s=r(3896),a=r(6643),l=r(60157),n=r(52308),o=r(61211),i=r(70744),c=r.n(i),d=r(32944),m=r(70607);let u=e=>{let{src:t,alt:r,className:l="",zIndex:n=1}=e;return(0,s.jsx)(a.W,{as:d.default,src:t,alt:r,width:300,height:450,className:"border border-slate-400 rounded-sm ".concat(l),style:{width:"auto",height:"auto",maxWidth:"300px",zIndex:n}})},h=(0,n.memo)(function(e){let{book:t,isPriority:r}=e;return(0,s.jsx)(c(),{href:"#".concat(t.slug),onClick:e=>{e.preventDefault();try{let e=document.getElementById(t.slug);if(e)e.scrollIntoView({behavior:"smooth"});else{let e=document.getElementById("about");e&&e.scrollIntoView({behavior:"smooth"})}}catch(e){console.warn("Failed to scroll:",e)}},children:(0,s.jsx)(a.W,{src:t.coverSrc,alt:t.title,width:400,height:600,className:"border border-black rounded-sm shadow-md transition-transform hover:scale-105 z-10",loading:r?"eager":"lazy"})})}),x=(0,n.memo)(function(e){let{book:t}=e,[r,a]=(0,n.useState)(!1),i=.75*(0,m.A)({maxWidth:800});(0,n.useEffect)(()=>{a(!0)},[]);let c=t.page1src&&t.page2src;return(0,s.jsxs)("section",{className:"section-separator text-center text-balance mt-2",children:[(0,s.jsxs)("div",{className:"mx-auto px-4 mb-4",children:[(0,s.jsx)("h1",{className:"mt-0 mb-4",children:t.title}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 justify-center items-center",children:[(0,s.jsx)("p",{className:"text-sm",children:t.shortDescription}),t.edition&&(0,s.jsxs)("p",{className:"text-tiny italic",children:["(",t.edition,")"]})]})]}),(0,s.jsx)("div",{className:"w-full overflow-visible",children:(0,s.jsx)("div",{className:"max-w-[".concat(800,"px] mx-auto"),style:{zoom:i,transformOrigin:"top left"},children:(0,s.jsxs)("div",{className:"flex justify-center items-center relative",children:[c&&r&&(0,s.jsx)(u,{src:t.page1src,alt:"".concat(t.title," page 1"),className:"-mr-4",zIndex:1}),(0,s.jsx)(h,{book:t,isPriority:!0}),c&&r&&(0,s.jsx)(u,{src:t.page2src,alt:"".concat(t.title," page 2"),className:"-ml-4",zIndex:2})]})})}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-8 mt-6 px-4",children:[(0,s.jsx)(o.BuyBookButton,{book:t}),(0,s.jsx)("p",{className:"italic mb-0 text-sm",children:"or"}),(0,s.jsx)(l.T,{variant:"light",onPress:()=>{var e;null===(e=document.getElementById("about"))||void 0===e||e.scrollIntoView({behavior:"smooth"})},className:"underline underline-offset-8 shadow-none",children:"Learn more →"})]})]})});x.displayName="BookHero";let p=x},71675:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var s=r(3896),a=r(60157),l=r(70744),n=r.n(l);let o=(0,r(52308).memo)(function(e){let{excerptUrl:t}=e;return t?(0,s.jsxs)("section",{id:"excerpt",className:"section-separator flex flex-col gap-4 p-4 sm:p-6 lg:p-8 border border-black rounded-lg shadow-md",children:[(0,s.jsx)("h3",{className:"m-0",children:"Read an excerpt"}),(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-gray-700",children:"Here is an excerpt from the book. If you like it, you can buy the book from Amazon or my store."}),(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)(n(),{href:t,target:"_blank",rel:"noopener noreferrer",className:"inline-block",children:(0,s.jsx)(a.T,{color:"primary",className:"min-w-[160px]",children:"Read the excerpt"})})})]})]}):null})},86524:(e,t,r)=>{"use strict";r.d(t,{A:()=>n});var s=r(3896),a=r(52308);let l=e=>{let{side:t,className:r,width:a}=e;return(0,s.jsx)("div",{className:"".concat(r," ").concat(a," ").concat(t,"-0 bg-gradient-to-").concat("left"===t?"r":"l"," from-white to-transparent"),"aria-hidden":"true"})},n=(0,a.memo)(function(e){let{width:t}=e,r="absolute top-0 bottom-0 pointer-events-none";return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(l,{side:"left",className:r,width:t}),(0,s.jsx)(l,{side:"right",className:r,width:t})]})})},87041:(e,t,r)=>{"use strict";r.d(t,{LogoReel:()=>d});var s=r(3896),a=r(52308),l=r(86524),n=r(32944),o=r(70607);let i={width:100,height:50},c=(0,a.memo)(function(e){let{logo:t,index:r}=e;return(0,s.jsx)("div",{className:"flex-shrink-0 mx-4",children:(0,s.jsx)(n.default,{src:t.src,alt:t.alt,width:i.width,height:i.height,className:"h-12 w-auto object-contain",onError:e=>{e.target.style.display="none"}})})}),d=(0,a.memo)(function(e){let{logos:t}=e,r=(0,a.useRef)(null);if(!Array.isArray(t)||0===t.length)return null;let n=Array.from({length:4},()=>t).flat(),d=i.width*t.length*4,m=(0,o.A)({maxWidth:d}),u=(0,a.useCallback)(()=>{let e=r.current;if(!e)return;let t=e.scrollWidth;e.style.setProperty("--scroll-width","".concat(t,"px"))},[]);return(0,a.useEffect)(()=>{var e;u();let t=()=>{requestAnimationFrame(u)};window.addEventListener("resize",t);let s=null===(e=r.current)||void 0===e?void 0:e.getElementsByTagName("img");return s&&Promise.all(Array.from(s).map(e=>e.complete||new Promise(t=>{e.onload=t,e.onerror=t}))).then(u),()=>window.removeEventListener("resize",t)},[u]),(0,s.jsxs)("div",{className:"w-[95vw] max-w-full overflow-hidden bg-white mt-4 relative",children:[(0,s.jsx)("div",{className:"flex animate-scroll max-w-full",ref:r,style:{transform:"scale(".concat(m,")"),transformOrigin:"left center"},role:"marquee","aria-label":"Logo reel",children:n.map((e,t)=>(0,s.jsx)(c,{logo:e,index:t},"logo-".concat(e.alt,"-").concat(t)))}),(0,s.jsx)(l.A,{width:"w-24"})]})})},26886:(e,t,r)=>{"use strict";r.d(t,{default:()=>o});var s=r(3896),a=r(52308),l=r(12950),n=r(42097);let o=(0,a.memo)(function(e){let{tag:t}=e,[r,o]=(0,a.useState)([]),[i,c]=(0,a.useState)(!0),[d,m]=(0,a.useState)(null),u=(0,a.useCallback)(async()=>{try{c(!0),m(null);let e=await (0,n.K)([t],4);o(e)}catch(e){console.error("Failed to fetch related posts:",e),m("Failed to load related posts. Please try again later.")}finally{c(!1)}},[t]);return((0,a.useEffect)(()=>{t&&u()},[u,t]),i)?(0,s.jsx)("div",{role:"status",className:"animate-pulse",children:"Loading related posts..."}):d?(0,s.jsx)("div",{className:"text-red-600",children:d}):0===r.length?null:(0,s.jsxs)("section",{className:"section-separator flex flex-col gap-4","aria-labelledby":"related-posts-heading",children:[(0,s.jsx)("h3",{id:"related-posts-heading",children:"Top related posts"}),(0,s.jsx)(l.z,{posts:r})]})})},87054:(e,t,r)=>{"use strict";r.d(t,{ReviewsCarousel:()=>d});var s=r(3896),a=r(52308),l=r(99500);let n=e=>{let[t,r]=(0,a.useState)(!1),s=(0,a.useRef)({x:0,scrollLeft:0}),l=(0,a.useCallback)(t=>{if(!e.current)return;r(!0);let a="touches"in t?t.touches[0].clientX:t.clientX;s.current={x:a,scrollLeft:e.current.scrollLeft}},[e]),n=(0,a.useCallback)(()=>{r(!1)},[]),o=(0,a.useCallback)(r=>{if(!t||!e.current)return;r.preventDefault();let a="touches"in r?r.touches[0].clientX:r.clientX,l=s.current.x-a;e.current.scrollLeft=s.current.scrollLeft+l},[t,e]);return{isDragging:t,handleDragStart:l,handleDragEnd:n,handleDragMove:o}},o={SCROLL_AMOUNT:300},i=(0,a.memo)(function(e){let{review:t,showRating:r,isLast:a}=e;return(0,s.jsx)("div",{className:"w-48 md:w-64 flex-shrink-0 ".concat(a?"":"mr-4 md:mr-8"),children:(0,s.jsx)(l.ReviewCard,{review:t,showRating:r})})}),c=(0,a.memo)(function(e){let{direction:t,show:r,onClick:a}=e;return(0,s.jsx)("button",{onClick:a,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)})}),d=(0,a.memo)(function(e){let{reviews:t,showRatings:r,title:l="Some reviews",width:d,height:m}=e,u=(0,a.useRef)(null),[h,x]=(0,a.useState)(!1),[p,f]=(0,a.useState)(!0),g=(0,a.useCallback)(()=>{let e=u.current;if(!e)return;let{scrollLeft:t,scrollWidth:r,clientWidth:s}=e;x(t>0),f(t{let t=u.current;if(!t)return;let r="left"===e?-o.SCROLL_AMOUNT:o.SCROLL_AMOUNT;t.scrollBy({left:r,behavior:"smooth"})},[]),{isDragging:y,handleDragStart:v,handleDragEnd:j,handleDragMove:w}=n(u),N=(0,a.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),w(e))},[w]),k=(0,a.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),v(e))},[v]),C=(0,a.useCallback)(e=>{(null==e?void 0:e.currentTarget)&&(null==e?void 0:e.target)&&(e.persist(),j())},[j]),B=t.length<2,P=t.length<3&&"lg"===d;return(0,s.jsxs)("section",{className:"".concat("sm"===m?"mt-0 mb-0 p-0":""," section-separator"),children:[(0,s.jsx)("h3",{className:"text-2xl font-bold mb-4",children:l}),(0,s.jsxs)("div",{className:"w-full relative",children:[(0,s.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"===d?"lg:max-w-[600px]":"","\n cursor-grab active:cursor-grabbing ").concat(B?"flex justify-center":""),ref:u,onScroll:g,onMouseDown:k,onMouseUp:C,onMouseLeave:C,onMouseMove:N,onTouchStart:k,onTouchEnd:C,onTouchMove:N,children:(0,s.jsx)("div",{className:"flex ".concat(P?"md:justify-center":""),children:t.map((e,a)=>(0,s.jsx)(i,{review:e,showRating:r,isLast:a===t.length-1},"review-".concat(a)))})}),(0,s.jsx)(c,{direction:"left",show:h,onClick:()=>b("left")}),(0,s.jsx)(c,{direction:"right",show:p,onClick:()=>b("right")})]})]})})},61211:(e,t,r)=>{"use strict";r.d(t,{BuyBookButton:()=>c});var s=r(3896),a=r(42363),l=r(16465),n=r(60157),o=r(52308),i=r(19778);let c=(0,o.memo)(e=>{let{book:t,className:r}=e,{isOpen:o,onOpen:c,onOpenChange:d}=(0,l.j)();return t?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.T,{color:"primary",onPress:()=>{try{null==c||c()}catch(e){console.error("Error opening modal:",e),a.Cp(e)}},"aria-label":"Buy ".concat(t.title),className:r,children:"Buy Now"}),(0,s.jsx)(i.B,{book:t,isOpen:o,onOpenChange:d})]}):(!function(){let e="BuyBookButton: No book provided";console.warn(e),a.wd(e,{level:"warning",extra:{component:"BuyBookButton"}})}(),null)});c.displayName="BuyBookButton"},19778:(e,t,r)=>{"use strict";r.d(t,{B:()=>x});var s=r(3896),a=r(42363),l=r(85617),n=r(53936),o=r(97406),i=r(32471),c=r(60157),d=r(27240),m=r(60470),u=r(52308);let h="/books/preorder",x=u.memo(e=>{let{book:t,isOpen:r,onOpenChange:x}=e;if(!(null==t?void 0:t.title)){let e=Error("BuyBookModal: Book or book title is missing");return console.error(e),a.Cp(e),null}let p=(0,u.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]),f=(0,u.useCallback)(e=>{null==x||x(e)},[x]);if(0===p.length){let e=Error("BuyBookModal: No purchase options available for book: ".concat(t.title));return console.warn(e),a.wd(e.message,{level:"warning"}),null}return(0,s.jsx)(l.Y,{isOpen:r,onOpenChange:f,size:"sm",hideCloseButton:!0,children:(0,s.jsx)(n.g,{className:"pb-0",children:e=>(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.c,{className:"flex flex-col gap-1",children:["Buy ",t.title]}),(0,s.jsx)(i.h,{children:p.map(e=>{let{type:r,href:l}=e;return(0,s.jsx)(c.T,{as:d.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),a.Cp(e)}},children:r},r)})}),(0,s.jsx)(m.q,{children:(0,s.jsx)(c.T,{color:"primary",variant:"light",onPress:()=>{try{null==e||e()}catch(e){console.error("Error closing modal:",e),a.Cp(e)}},className:"shadow-none text-white","aria-label":"Close purchase options modal",children:"Close"})})]})})})});x.displayName="BuyBookModal"},3746:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>y});var s=r(3896),a=r(80890),l=r(60157),n=r(52308),o=r(32944),i=r(87041),c=r(87054),d=r(70957),m=r(58744),u=r(88166),h=r(57613),x=r(75403),p=r(29515);let f=x.z.object({email:x.z.string().email("Please enter a valid email address")}),g=()=>(0,s.jsxs)("div",{className:"mt-8 rounded-lg p-2 small-text",children:[(0,s.jsx)("p",{className:"font-semibold",children:"In the welcome email, you will find:"}),(0,s.jsxs)("ul",{className:"no-disc",children:[(0,s.jsx)("li",{children:"✔ A guide on how to bring clarity to your teams"}),(0,s.jsx)("li",{children:'✔ A 33% discount code for my book "Best Practices For Operational Excellence"'}),(0,s.jsx)("li",{children:"✔ An archive of my top Twitter threads, including the ones market with a ⭐️ that are my favorite"}),(0,s.jsx)("li",{children:'✔ A digital copy of my book "The Employee Engagement Handbook," with plenty of concrete advice to increase talent retention and commitment'})]})]}),b=()=>(0,s.jsxs)("div",{id:"logo-reel",children:[(0,s.jsx)("p",{className:"text-center text-[10px] leading-3 my-4",children:"Part of my portfolio / trusted by leaders at"}),(0,s.jsx)(i.LogoReel,{logos:d.c})]}),y=e=>{var t;let{size:r="lg"}=e,i=(0,h.useRouter)(),{handleSubmit:d,formState:{errors:x,isSubmitting:y},register:v,setError:j}=(0,u.mN)({resolver:(0,p.u)(f),defaultValues:{email:""}}),w=(0,n.useCallback)(async e=>{try{if((await fetch("https://app.convertkit.com/forms/1862996/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email_address:e.email})})).ok)i.push("https://luca-dellanna.com/welcome");else throw Error("Subscription failed")}catch(e){console.error("Error:",e),j("email",{type:"manual",message:e instanceof Error?e.message:"An error occurred. Please try again later."})}},[i,j]),N=m.Y.filter(e=>e.object.includes("Luca"));return(0,s.jsxs)("section",{className:"section-separator max-w-2xl lg:max-w-3xl p-4 md:p-8 my-12 border border-black rounded-lg shadow-lg",children:[(0,s.jsx)("form",{onSubmit:d(w),className:"mx-auto flex mb-8 items-center justify-center",children:(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("div",{id:"headline-and-form",children:["lg"===r?(0,s.jsx)("h2",{className:"mb-2",children:"Luca's newsletter"}):(0,s.jsx)("h3",{className:"mt-0 sm:mt-2 md:mt-4 mb-2",children:"Luca's newsletter"}),(0,s.jsx)("p",{className:"text-tiny text-center italic",children:"You can expect 1-2 emails a month. Unsubscribe at any time."}),(0,s.jsxs)("div",{id:"ck-form",className:"flex flex-col items-center sm:flex-row gap-4 mt-6",children:[(0,s.jsx)("div",{className:"w-full",children:(0,s.jsx)(a.r,{...v("email"),type:"email",placeholder:"Enter your email",isRequired:!0,className:"flex-grow",isDisabled:y,errorMessage:null===(t=x.email)||void 0===t?void 0:t.message,isInvalid:!!x.email,onFocus:e=>e.stopPropagation(),onBlur:e=>e.stopPropagation()})}),(0,s.jsx)(l.T,{type:"submit",className:"primary !px-6 py-2 w-[fit-content]",isLoading:y,isDisabled:y,children:(0,s.jsx)("span",{className:"mx-6 whitespace-nowrap",children:"Join 25,000+ readers"})})]})]}),(0,s.jsx)(o.default,{src:"/luca-portrait.jpg",alt:"Luca Dellanna",height:150,width:100,className:"ml-8 border border-black rounded-lg hidden md:block"})]})}),(0,s.jsx)(c.ReviewsCarousel,{width:"lg",height:"sm",reviews:N,showRatings:!1,title:"They say about Luca"}),"lg"===r&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(g,{}),(0,s.jsx)(b,{})]})]})}},63485:(e,t,r)=>{"use strict";r.d(t,{default:()=>n});var s=r(3896),a=r(52308),l=r(60157);let n=(0,a.memo)(function(e){let{error:t,resetErrorBoundary:r,message:a="We're sorry, a problem occurred. Please try again later."}=e;return(0,s.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,s.jsx)("h2",{className:"text-lg font-semibold text-red-800 mb-2",children:"Oops! Something went wrong"}),(0,s.jsx)("p",{className:"text-red-700 mb-4",children:a}),!1,(0,s.jsx)(l.T,{onPress:r,color:"danger",className:"w-full sm:w-auto",children:"Try again"})]})})},70957:(e,t,r)=>{"use strict";r.d(t,{K:()=>a,c:()=>s});let s=[{src:"/societe-generale.png",alt:"Soci\xe9t\xe9 G\xe9nerale"},{src:"/shopify.png",alt:"Shopify"},{src:"/dupont.png",alt:"DuPont"},{src:"/mckinsey.png",alt:"McKinsey and Company"},{src:"/markel.png",alt:"Markel Group"},{src:"/standard-chartered.png",alt:"Standard Chartered"},{src:"/shopify.png",alt:"Shopify"},{src:"/marriott.png",alt:"Marriott"},{src:"/genova-university.png",alt:"Genova University"},{src:"/mises-institute.png",alt:"Mises Institute"},{src:"/upstart-wealth-management.png",alt:"Upstart Wealth Management"}],a=[{src:"/amazon.png",alt:"Amazon"},{src:"/barnes-noble.png",alt:"Barnes&Noble"},{src:"/apple-books.png",alt:"Apple Books"},{src:"/google-play.png",alt:"Google Play Books"}]},70607:(e,t,r)=>{"use strict";r.d(t,{A:()=>a});var s=r(52308);function a(e){let{maxWidth:t,minScale:r=.1,debounceMs:a=100}=e,[l,n]=(0,s.useState)(1),o=(0,s.useRef)(void 0),i=(0,s.useCallback)(()=>{n(Math.min(.95,Math.max(r,window.innerWidth/t)))},[t,r]);return(0,s.useEffect)(()=>{let e=()=>o.current&&clearTimeout(o.current),t=()=>{e(),o.current=setTimeout(i,a)};return i(),window.addEventListener("resize",t,{passive:!0}),()=>{e(),window.removeEventListener("resize",t)}},[i,a]),l}},42097:(e,t,r)=>{"use strict";r.d(t,{K:()=>a});var s=r(51615);let a=(0,s.createServerReference)("70c1a61dcc797ba64275d3cc5f7c5d2621b10e0b97",s.callServer,void 0,s.findSourceMapURL,"getPosts")},3851:(e,t,r)=>{"use strict";r.d(t,{d:()=>c});var s=r(78468),a=r(28405),l=r(73223),n=r(93288),o=r(3896),i=(0,a.Rf)((e,t)=>{var r;let{as:a,className:i,children:c,...d}=e,m=(0,l.zD)(t),{slots:u,classNames:h}=(0,s.f)(),x=(0,n.$z)(null==h?void 0:h.header,i);return(0,o.jsx)(a||"div",{ref:m,className:null==(r=u.header)?void 0:r.call(u,{class:x}),...d,children:c})});i.displayName="HeroUI.CardHeader";var c=i},77470:(e,t,r)=>{"use strict";r.d(t,{Z:()=>c});var s=r(78468),a=r(28405),l=r(73223),n=r(93288),o=r(3896),i=(0,a.Rf)((e,t)=>{var r;let{as:a,className:i,children:c,...d}=e,m=(0,l.zD)(t),{slots:u,classNames:h}=(0,s.f)(),x=(0,n.$z)(null==h?void 0:h.footer,i);return(0,o.jsx)(a||"div",{ref:m,className:null==(r=u.footer)?void 0:r.call(u,{class:x}),...d,children:c})});i.displayName="HeroUI.CardFooter";var c=i},62783:(e,t,r)=>{"use strict";r.d(t,{A:()=>s});let s=(0,r(37394).A)("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]])}},e=>{var t=t=>e(e.s=t);e.O(0,[1796,4555,7873,157,7931,3957,890,4137,9509,3519,8016,7410,7358],()=>t(21964)),_N_E=e.O()}]);