!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]="d289d834-4dd8-42b2-b589-985cdf38a1dc",e._sentryDebugIdIdentifier="sentry-dbid-d289d834-4dd8-42b2-b589-985cdf38a1dc")}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 P},_S:function(){return v},cw:function(){return d},h3:function(){return b},nc:function(){return p},p6:function(){return w},rU:function(){return h},wt:function(){return m},xv:function(){return f},y:function(){return g},zx:function(){return C}});var n=i(82731),r=i(18459),o=i(60301),a=i(18632),s=i(25871),l=i(48494),c=i(14766),u=i(95851);const d=(0,n.ZP)(o.Q).withConfig({componentId:"sc-10vf2cu-0"})(["height:100%;font-weight:bold;"]),p=n.ZP.div.withConfig({componentId:"sc-10vf2cu-1"})(["display:flex;flex-direction:row;align-items:center;justify-content:space-between;"]),m=(0,n.ZP)(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})),h=(n.ZP.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.ZP)(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}))),f=(0,n.ZP)(l.T).withConfig({componentId:"sc-10vf2cu-5"})(["line-height:1.5;"]),g=(0,n.ZP)(f).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.ZP)(c.B).withConfig({componentId:"sc-10vf2cu-7"})(["white-space:pre-wrap;"]),y=(0,n.ZP)(u.L).withConfig({componentId:"sc-10vf2cu-8"})(["width:max-content;"]),w=n.ZP.span.withConfig({componentId:"sc-10vf2cu-9"})(["font-weight:",";"],(e=>{let{$boldHelperText:t}=e;return t?700:"initial"})),v=n.ZP.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]})),P=(0,n.ZP)(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})),C=(0,n.ZP)(c.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),c=i(90749),u=i(79149),d=i(52322);function p(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 m(e){for(var t=1;t{const{locale:t}=(0,o.Z)(),i=(0,a.x)(),n=(0,s.useMaintenance)(),p=(0,s.useAccounts)(),h=(0,s.useCart)(),{trackAddToCart:f}=(0,s.useAnalytics)(),g=(0,s.useCustomer)(),{text:b,price:y,date:w}=(0,s.useLocalizer)(),{__typename:v,availability:P,bundleItems:C,nsuid:D,requiresSubscription:I,sku:T,requiresCoupon:O,requiresLogin:S,platinumPoints:A,eshopDetails:L,prePurchase:k,prices:E,loadingPricing:_,productType:R,isSalableQty:N,releaseDate:M,releaseDateDisplay:x,soldOutPermanent:Z,isPreorderable:j,variations:q,voucherNsuid:Q,startShippingDate:U,shipDateDisplay:B,enableRetailCrawler:z,waitlist:G}=e,F=_||h?.loading||h?.updating||n?.loading,{0:H,1:V}=(0,r.useState)(!1),{0:Y,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,u.EE)(e),ne=G?.campaigns,re=G?.invites,oe=re?.length>0?re[0]:null,ae=ne?.filter((e=>!0===e?.allowRequests)).length>0,se=C?.every((e=>{let{required:t,title:i}=e;return t&&!!W[i]}));(0,r.useEffect)((()=>{if(ee){const e=C?.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 m(m({},e),{},{[n]:r?.id})}),{});$(e)}}),[ee,C]);const le=(P?.includes(b("Pre-order"))||P?.includes(b("Available now"))||N||k)&&!J,{consentedGroups:ce}=(0,s.useCookies)(),ue=(0,r.useMemo)((()=>{if(!z)return null;const e=ce?.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}),[ce,D,T,q,z]),de=g?.data?.membershipStatus.active,pe=h?.addableQty(e),me=Y>=pe,he=!N&&!J||!!q?.length&&q.every((e=>{let{product:t}=e;return!t.isSalableQty})),fe=k&&B&&!N,ge=(I||A||S)&&!p.isLoggedIn,be=I&&!de,{buttonDisabled:ye,promptLogin:we,disableQuantity:ve,buttonCopy:Pe,helperText:Ce,boldHelperText:De}=(0,r.useMemo)((()=>{if(J)return{};let e="",i="",r=!1,o=!1,a=ie,s=!1,l=n?.store?.active;const u=(0,d.jsx)(c.rU,{href:"/store/products/nintendo-switch-game-vouchers/",locale:t,children:b("Learn more about vouchers")}),p=(0,d.jsx)(c.rU,{href:"/switch/online/",children:b("Nintendo Switch Online members")});if(I&&(i=b("This item is only for paid {0}.",{args:[p]})),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?"Purchased":"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)(c.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(fe)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=Q?b("Pre-order or redeem a Game Voucher to pre-load this game and start playing as soon as it\u2019s released. {0}",{args:[u]}):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":Q?(e="Direct download",i=b("This item will be sent to your system automatically after purchase or Nintendo Switch Game Voucher redemption. {0}",{args:[u]})):(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)p.promptLogin();else{i.cache.evict({id:i.cache.identify(e),fieldName:"eshopDetails",args:{personalized:!0},broadcast:!1});const n="string"===typeof Pe?Pe:"CTA";f(e),K.trackEvent({eventName:`PDP: ${n} Clicked`,objectId:T,isConversion:!0},t)}}),[we,Pe,t,T,K,f,p,i.cache,e]),Oe=(0,r.useCallback)(((i,n)=>{const{customAnalytics:r}=n||{};if(we)p.promptLogin();else{if(!e.requiresCoupon||i)return f(e,r?.itemListDetails),K.addToCart(T,{eventName:r?.eventName||"PDP: Add to Cart Clicked",locale:t}),h.addProduct(e,{couponCode:i?.trim(),selectedOptions:Object.values(W),quantity:Y});V(!0)}}),[T,we,K,p,h,e,Y,t,f,W]);return(0,r.useMemo)((()=>({state:{isLoading:F,account:p,quantity:Y,isMobileGame:J,isDigitalProduct:ie,isPurchasable:le,isConfigurableProduct:te,retailerSku:ue,membershipRequired:be,addableQty:pe,itemLimitReached:me,soldOut:he,loginToPurchase:ge,buttonDisabled:ye,promptLogin:we,disableQuantity:ve,buttonCopy:Pe,helperText:Ce,boldHelperText:De,displayPrice:Ie,showRedemptionCodeModal:H,selectedOptionsByTitle:W},actions:{setQuantity:X,setSelectedOptionsByTitle:$,handleDirectDownloadClick:Te,handleAddToCart:Oe,setShowRedemptionCodeModal:V}})),[F,p,Y,J,ie,le,te,ue,be,pe,me,he,ge,ye,we,ve,Pe,Ce,De,Ie,X,Te,Oe,H,V,W,$])}}}]); //# sourceMappingURL=5484-b52fe942553fb25b.js.map