!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]="53a0fd49-45c3-4647-9fbb-721fcdf17abc",e._sentryDebugIdIdentifier="sentry-dbid-53a0fd49-45c3-4647-9fbb-721fcdf17abc")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5484],{90749:function(e,t,i){i.d(t,{Xx:function(){return y},ZA:function(){return C},_S:function(){return v},cw:function(){return d},h3:function(){return b},nc:function(){return f},p6:function(){return w},rU:function(){return m},wt:function(){return p},xv:function(){return h},y:function(){return g},zx:function(){return P}});var n=i(82731),r=i(18459),o=i(9614),a=i(14805),s=i(67196),l=i(88091),u=i(30253),c=i(769);const d=(0,n.default)(o.Q).withConfig({componentId:"sc-10vf2cu-0"})(["height:100%;font-weight:bold;"]),f=n.default.div.withConfig({componentId:"sc-10vf2cu-1"})(["display:flex;flex-direction:row;align-items:center;justify-content:space-between;"]),p=(0,n.default)(a.S).withConfig({componentId:"sc-10vf2cu-2"})(["height:",";& > div{font-size:",";}"],(e=>{let{theme:t}=e;return t.spacing[40]}),(e=>{let{theme:t}=e;return t.font.size.h1LMobile})),m=(n.default.span.withConfig({componentId:"sc-10vf2cu-3"})(["display:",";font-weight:",";color:",";"],(e=>{let{isLoading:t}=e;return t?"none":"block"}),(e=>{let{theme:t}=e;return t.font.weight.bold}),(e=>{let{theme:t}=e;return t.color.primary})),(0,n.default)(s.L).withConfig({componentId:"sc-10vf2cu-4"})(["display:inline !important;span{font-size:",";","{font-size:",";}}"],(e=>{let{theme:t}=e;return t.font.size.legalMobile}),(e=>{let{theme:t}=e;return t.mediaQuery.tabletSmall}),(e=>{let{theme:t}=e;return t.font.size.captionMobile}))),h=(0,n.default)(l.T).withConfig({componentId:"sc-10vf2cu-5"})(["line-height:1.5;"]),g=(0,n.default)(h).withConfig({componentId:"sc-10vf2cu-6"})(["color:",";font-weight:",";"],(e=>{let{theme:t}=e;return t.color.primary}),(e=>{let{theme:t}=e;return t.font.weight.bold})),b=(0,n.default)(u.B).withConfig({componentId:"sc-10vf2cu-7"})(["white-space:pre-wrap;"]),y=(0,n.default)(c.L).withConfig({componentId:"sc-10vf2cu-8"})(["width:max-content;"]),w=n.default.span.withConfig({componentId:"sc-10vf2cu-9"})(["font-weight:",";"],(e=>{let{$boldHelperText:t}=e;return t?700:"initial"})),v=n.default.div.withConfig({componentId:"sc-10vf2cu-10"})(["margin-top:",";margin-bottom:",";","{margin-top:",";}"],(e=>{let{theme:t}=e;return t.spacing[4]}),(e=>{let{theme:t}=e;return t.spacing[8]}),(e=>{let{theme:t}=e;return t.mediaQuery.desktop}),(e=>{let{theme:t}=e;return t.spacing[12]})),C=(0,n.default)(r.Qc).withConfig({componentId:"sc-10vf2cu-11"})(["margin-top:var(--theme-spacing-16);","{margin-top:var(--theme-spacing-24);}"],(e=>{let{theme:t}=e;return t.mediaQuery.desktop})),P=(0,n.default)(u.B).withConfig({componentId:"sc-10vf2cu-12"})(["width:100%;"])},43399:function(e,t,i){i.d(t,{O:function(){return r}});const n="The requested quantity is not available",r={DEFAULT:"Something went wrong. Please try again.",QTY_NOT_AVAILABLE:n,QTY_NOT_AVAILABLE_FR:n,INSUFFICIENT_STOCK:n,QTY_EXCEEDS_MAXIMUM:n,PURCHASE_LIMIT_REACHED:n,PRODUCT_UNAVAILABLE:n}},67831:function(e,t,i){var n=i(95235),r=i(2784),o=i(64897),a=i(56675),s=i(82091),l=i(97852),u=i(90749),c=i(79149),d=i(52322);function f(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function p(e){for(var t=1;t{const{locale:t}=(0,o.Z)(),i=(0,a.x)(),n=(0,s.useMaintenance)(),f=(0,s.useAccounts)(),m=(0,s.useCart)(),{trackAddToCart:h}=(0,s.useAnalytics)(),g=(0,s.useCustomer)(),{text:b,price:y,date:w}=(0,s.useLocalizer)(),{__typename:v,availability:C,bundleItems:P,nsuid:D,requiresSubscription:I,sku:T,requiresCoupon:S,requiresLogin:O,platinumPoints:A,eshopDetails:L,prePurchase:k,prices:E,loadingPricing:_,productType:R,isSalableQty:N,releaseDate:M,releaseDateDisplay:x,soldOutPermanent:j,isPreorderable:q,variations:Q,voucherNsuid:U,startShippingDate:B,shipDateDisplay:z,enableRetailCrawler:G,waitlist:F}=e,H=_||m?.loading||m?.updating||n?.loading,{0:V,1:Y}=(0,r.useState)(!1),{0:Z,1:X}=(0,r.useState)(1),{0:W,1:$}=(0,r.useState)({}),K=(0,l.u)(),J="MOBILE"===D,ee="BUNDLE"===R,te="CONFIGURABLE"===R,ie=(0,c.EE)(e),ne=F?.campaigns,re=F?.invites,oe=re?.length>0?re[0]:null,ae=ne?.filter((e=>!0===e?.allowRequests)).length>0,se=P?.every((e=>{let{required:t,title:i}=e;return t&&!!W[i]}));(0,r.useEffect)((()=>{if(ee){const e=P?.reduce(((e,t)=>{let{options:i,title:n}=t;const r=i.length>1?i?.find((e=>{let{isDefault:t}=e;return t})):i[0];return p(p({},e),{},{[n]:r?.id})}),{});$(e)}}),[ee,P]);const le=(C?.includes(b("Pre-order"))||C?.includes(b("Available now"))||N||k)&&!J,{consentedGroups:ue}=(0,s.useCookies)(),ce=(0,r.useMemo)((()=>{if(!G)return null;const e=ue?.has(s.ConsentGroups.PERFORMANCE);if(!e)return null;if(D&&Q?.length){const e=Q.find((e=>!e.product?.nsuid));if(e)return e.product.sku}return D?null:T}),[ue,D,T,Q,G]),de=g?.data?.membershipStatus.active,fe=m?.addableQty(e),pe=Z>=fe,me=!N&&!J||!!Q?.length&&Q.every((e=>{let{product:t}=e;return!t.isSalableQty})),he=k&&z&&!N,ge=(I||A||O)&&!f.isLoggedIn,be=I&&!de,{buttonDisabled:ye,promptLogin:we,disableQuantity:ve,buttonCopy:Ce,helperText:Pe,boldHelperText:De}=(0,r.useMemo)((()=>{if(J)return{};let e="",i="",r=!1,o=!1,a=ie,s=!1,l=n?.store?.active;const c=(0,d.jsx)(u.rU,{href:"/store/products/nintendo-switch-game-vouchers/",locale:t,children:b("Learn more about vouchers")}),f=(0,d.jsx)(u.rU,{href:"/switch/online/",children:b("Nintendo Switch Online members")});if(I&&(i=b("This item is only for paid {0}.",{args:[f]})),ne?.length>0&&"active"!==oe?.status){if(i="Active invitation required to purchase Nintendo Switch\u2122 2 system and accessories from the My Nintendo Store. Register your interest to be contacted when it's your time to shop: {0}",ge)e="Sign in",o=!0;else if(!1!==ae||oe)if(oe)if(s=!0,"pending"===oe.status)e="Invite requested",i="You're already on the waitlist! We will let you know when you are up! "+i;else if("redeemed"===oe?.status){const t=ne?.find((e=>{let{id:t}=e;return t===oe?.campaignId}))?.meta?.primarySku?.[0];e=t===T?"Success":"Invite required"}else e="Unavailable";else e="Get on Waitlist",i="Get on the waitlist and we will let you know when you are up! "+i;else e="Invite required",i="Attention: Invite required. "+i,s=!0;i=b(i,{args:[(0,d.jsx)(u.rU,{href:"/gaming-systems/switch-2/how-to-buy/",children:b("Registration page")},"registration-page")]})}else if(ie)if(n?.eshop?.active)r=!0,i=b("Direct downloads are not possible during maintenance"),s=!0,e="Direct download";else if("MarketingProduct"===v)s=!0,e=b("Releases {0}",{args:[x||M&&w(M,{format:{day:"numeric",month:"numeric",year:"2-digit"}})]});else if(he)s=!0,a=!0,e=b("Releases {0}",{args:[x]});else if(ge)e="Sign in to download",o=!0;else if(be)s=!0,e="Direct download";else if(L?.isPreordered)s=!0,e="Already pre-ordered";else if(L?.isPurchased)s=!0,e="Already downloaded";else if(L?.isPreorderable)e="Pre-order",i=U?b("Pre-order or redeem a Game Voucher to pre-load this game and start playing as soon as it\u2019s released. {0}",{args:[c]}):b("This lets you pre-load the game, so you'll be able to play as soon as the game is released.");else if(L?.isPurchasable)0==E?.minimum?.finalPrice?e="Free download":U?(e="Direct download",i=b("This item will be sent to your system automatically after purchase or Nintendo Switch Game Voucher redemption. {0}",{args:[c]})):(e="Direct download",i="This item will be sent to your system automatically after purchase.");else{const t=new Date(M);s=!0,x?e=b("Releases {0}",{args:[x]}):Date.now()({regPrice:Boolean(x)&&!k?null:y(E?.minimum?.regularPrice,{formatZero:!0}),salePrice:E?.minimum?.discounted?y(E?.minimum?.finalPrice):""})),[x,k,E,y]),Te=(0,r.useCallback)((()=>{if(we)f.promptLogin();else{i.cache.evict({id:i.cache.identify(e),fieldName:"eshopDetails",args:{personalized:!0},broadcast:!1});const n="string"===typeof Ce?Ce:"CTA";h(e),K.trackEvent({eventName:`PDP: ${n} Clicked`,objectId:T,isConversion:!0},t)}}),[we,Ce,t,T,K,h,f,i.cache,e]),Se=(0,r.useCallback)(((i,n)=>{const{customAnalytics:r}=n||{};if(we)f.promptLogin();else{if(!e.requiresCoupon||i)return h(e,r?.itemListDetails),K.addToCart(T,{eventName:r?.eventName||"PDP: Add to Cart Clicked",locale:t}),m.addProduct(e,{couponCode:i?.trim(),selectedOptions:Object.values(W),quantity:Z});Y(!0)}}),[T,we,K,f,m,e,Z,t,h,W]);return(0,r.useMemo)((()=>({state:{isLoading:H,account:f,quantity:Z,isMobileGame:J,isDigitalProduct:ie,isPurchasable:le,isConfigurableProduct:te,retailerSku:ce,membershipRequired:be,addableQty:fe,itemLimitReached:pe,soldOut:me,loginToPurchase:ge,buttonDisabled:ye,promptLogin:we,disableQuantity:ve,buttonCopy:Ce,helperText:Pe,boldHelperText:De,displayPrice:Ie,showRedemptionCodeModal:V,selectedOptionsByTitle:W},actions:{setQuantity:X,setSelectedOptionsByTitle:$,handleDirectDownloadClick:Te,handleAddToCart:Se,setShowRedemptionCodeModal:Y}})),[H,f,Z,J,ie,le,te,ce,be,fe,pe,me,ge,ye,we,ve,Ce,Pe,De,Ie,X,Te,Se,V,Y,W,$])}}}]); //# sourceMappingURL=5484-8344401bbeef0a99.js.map