!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]="2c3dbc33-3136-4744-982d-df4e3105d579",e._sentryDebugIdIdentifier="sentry-dbid-2c3dbc33-3136-4744-982d-df4e3105d579")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4398],{47718:function(e,t,r){"use strict";r.r(t),r.d(t,{__N_SSP:function(){return p}});var a=r(64897),s=r(94922),l=r(46420),n=r(2002),i=r(15188),o=r(84553),c=r(36734),u=(r(98670),r(82090)),d=r(52322);var p=!0;t.default=function(e){let{page:t,preview:r,renderFullBleedPageHero:p}=e;const h=(0,a.Z)(),f=t.content.pageHeader.heading,g=t.content?.productsCategoryUid,m=[{href:"/",title:"Home"},{href:"/store",title:"My Nintendo Store"},{href:"/store/hardware",title:"Hardware"},{href:"/store/hardware/[slug]",title:f}],b=s.e.HARDWARE,y=(0,u.XD)({category:b,productsCategoryUid:g,merchandisedGrid:t?.content?.merchandisedGrid,router:h}),v=(0,n.vS)(h.locale)?s.H.filter((e=>"Price"!==e.title)):s.H;return g?(0,d.jsx)(l.X$,{router:h,categoryConfig:y,defaultCategory:b,searchParamWhitelist:c.uy,preserveQueryParamKeys:c.aq,children:(0,d.jsx)(i.Z,{preview:r,breadcrumbLinks:m,page:t.content,pageIcon:"controller",cachePrefix:`${(0,n.GL)(f)}`,filterSections:v,analytics:{eventPrefix:`Hardware:${f}`,pageName:`Hardware PLP - ${f}`},fullBleedHero:p})}):(0,d.jsx)(o.Z,{preview:r,breadcrumbLinks:m,page:t.content,filterSections:v,analytics:{pageName:`Hardware PLP - ${f}`}})}},84553:function(e,t,r){"use strict";var a=r(82269),s=r(95235),l=r(2784),n=r(5632),i=r.n(n),o=r(82091),c=r(97224),u=r(94922),d=r(46420),p=r(51505),h=r(82732),f=r(37364),g=r(98803),m=r(1505),b=r(26856),y=r(88053),v=r(31837),j=r(9873),w=r(90862),x=r(2002),P=r(95395),k=r(83533),S=r(62156),O=r(88627),F=(r(64629),r(36734)),H=r(99140),M=r(23089),C=r(26378),_=r(402),L=r(49481),N=r(73353),D=r(33831),B=r(52322);const E=["title","attribute"];function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function z(e){for(var t=1;t{let{preview:t,breadcrumbLinks:r,filterSections:s,lightScrim:F,page:I,pageIcon:Z,sortByOptions:A,showRating:R,analytics:$,enableStickyCollectionNav:q,fullBleedHero:G,cmsProductPageSize:V,hiddenFilters:U,disableDefaultMarketingPageHeading:X}=e;const{pageHeader:K,ctaCollection:Q,merchandisedGrid:W,legalText:Y,marketingPage:J}=I||{},ee=J?L[J?.templateName??"plmpStandard"]:null,te=X?l.Fragment:f.H.NewLevel,re=(0,P.O_)(),{text:ae}=(0,o.useLocalizer)(),{trackLoadMoreProducts:se}=(0,u.u)(),le=(0,n.useRouter)(),{asPath:ne,pathname:ie,query:oe}=le,ce=(0,P.D9)(oe?.slug),ue=(0,o.useFeature)("wdev-1631-horizontal-tiles"),de=ue?.variant?.payload?.value,pe=(0,k.Z)(k.o.TABLET_SMALL),he="horizontal"===de&&!pe,fe=(0,o.deserializeHash)(ne),ge=(0,l.useRef)(),{0:me,1:be}=(0,l.useState)((()=>A.find((e=>{let{param:t}=e;return t===fe.sort}))?.value||A[0].value)),{0:ye,1:ve}=(0,l.useState)((()=>parseInt(fe.p)||0)),{isFilterModalOpen:je,selectedSortByOption:we,toggleModalFiltersMenu:xe,handleSortByChange:Pe}=(0,d.sI)({sortBy:me,sortByOptions:A,analytics:$,applySortBy:e=>{be((()=>e))}}),ke=(0,l.useMemo)((()=>A.map((e=>{let{value:t,label:r}=e;return{value:t,label:ae(r)}}))),[A,ae]),Se=(0,l.useMemo)((()=>({value:we.value,label:ae(we.label)})),[we,ae]),Oe=(0,l.useMemo)((()=>s.map((e=>{let{attribute:t}=e;return t}))),[s]),Fe=(W||[]).flat(),He=(W||[]).flat().filter((e=>{let{sku:t}=e;return Boolean(t)})),{appliedFilters:Me,appliedFiltersQuery:Ce,filteredProducts:_e,filteredState:Le,refine:Ne,refineByQuery:De,clearFilters:Be}=(0,P.x3)(He,Oe,{operator:P.fP.AND,queryToInitializeFilters:fe,hidden:U}),Ee=0===Me?.length&&we.value===A[0].value,Ie=(0,k.Z)(k.o.DESKTOP),ze=(0,l.useRef)();ze.current=Ie;const Te=Ee?Fe:_e,Ze=(0,l.useMemo)((()=>Te.slice(0,(V||Te.length)*(ye+1))),[ye,Te,V]),Ae=Ze.lengthme?[...Ze].sort(me):Ze),[Ze,me]),$e=(0,l.useCallback)((()=>{const e=(0,o.deserializeHash)(ne),t=A.find((t=>{let{param:r}=t;return r===e.sort}))?.value||A[0].value;De(e),be((()=>t)),ve(parseInt(e.p)||0)}),[A,ne,De]),qe=(0,l.useCallback)((e=>{const t=A.find((e=>{let{value:t}=e;return t===me}))?.param||A[0].value;return`#${new URLSearchParams(z(z({},e),{},{sort:t,p:ye})).toString()}`}),[A,me,ye]),Ge=(0,l.useCallback)((e=>(ve((()=>0)),e)),[]),Ve=(0,l.useCallback)((function(){Ge(Ne)(...arguments)}),[Ne,Ge]),Ue=(0,l.useCallback)((function(){Ge(Be)(...arguments)}),[Be,Ge]),Xe=(0,l.useCallback)((function(){Ge(Pe)(...arguments)}),[Pe,Ge]),Ke=(0,l.useCallback)((()=>{const{pageName:e}=$;se(e);const t=(0,o.deserializeHash)(),r=ye+1;t.p=r,ve((()=>r))}),[ye,$,se]),Qe=(0,l.useMemo)((()=>qe(Ce)),[Ce,qe]),We=(0,l.useMemo)((()=>Me.map((e=>({attribute:e.split(P.HA)[0],label:e.split(P.HA)[1],value:e})))),[Me]),Ye=(0,l.useMemo)((()=>$?.featureFlag?{featureFlag:$.featureFlag}:{featureFlag:ue?.id,featureFlagVariant:de}),[$,ue,de]),Je=(0,l.useMemo)((()=>s.filter((e=>{let{attribute:t}=e;return Le[t]?.items?.length>0})).map(((e,t)=>{let{title:r,attribute:s}=e,l=(0,a.Z)(e,E);return(0,B.jsx)(O.vT,z({attribute:s,title:r&&ae(r),startCollapsed:0!==t,refine:Ve,items:Le[s]?.items||[],showMoreLabel:ae("Show more"),showLessLabel:ae("Show less"),collapsible:!0,limit:5,showMore:!0,analytics:{pageName:$?.pageName}},l),s)}))),[s,Le,Ve,ae,$]),et=(0,l.useMemo)((()=>(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(O.en,{$singleColumnMobile:he,children:Re.map(((e,t)=>e.sku?(0,l.createElement)(w.I8,z(z(z({},Ye),{},{key:e.sku+t},e),{},{constrain:!1,showRating:R||Boolean(le.query[H.Tx.UTM_CODE])||!1,mobileHorizontal:he,analytics:{listDetails:{id:`clp-${(0,x.GL)($.pageName)}`,name:$.pageName}}})):(0,B.jsx)(C.Z,{asset:e.asset.primary.assetPath,cta:e.cta,heading:e.heading},e.heading+t)))}),Ae&&(0,B.jsx)(D.VR,{children:(0,B.jsx)(g.B,{variant:"tertiary",icon:m.Z,onClick:Ke,children:ae("Load more")})})]})),[le.query,$,Ye,R,Ae,Re,he,Ke,ae]);(0,S.Z)({isDesktop:Ie,scrollToRef:ge,scrollToElementID:T,enableStickyCollectionNav:q,pillFarm:Q.list}),(0,l.useEffect)((()=>{i().push({pathname:i().pathname,query:i().query,hash:Qe},null,{shallow:!0}).catch((e=>{if(!e.cancelled)throw e}))}),[Qe]),(0,x.nw)((()=>{$e()})),(0,l.useEffect)((()=>{!0===ze.current&&ge.current&&(0,x.n5)(ge.current,{offsetY:q&&N.d})}),[Me.length,q]),(0,l.useEffect)((()=>{q&&ge.current&&oe?.slug!==ce&&(0,x.n5)(ge.current,{offsetY:N.d,behavior:"smooth",onlyScrollIfAbove:!0})}),[q,oe?.slug,ce]),(0,l.useEffect)((()=>{const e=oe?.slug;Boolean(ce)&&Boolean(e)&&e!==ce&&$e()}),[$e,ce,oe?.slug]);const tt=(0,l.useMemo)((()=>r?(0,B.jsx)(b.B,{currentPage:ie,children:r.map(((e,t)=>(0,B.jsx)(c.Z,{href:e.href,children:(0,B.jsx)("a",{children:ae(e.title)})},e.title+t)))}):null),[r,ae,ie]),rt=(0,l.useMemo)((()=>K?.asset?.primary?.assetPath?G?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(y.F,{heading:K.heading,subtitle:K.description,image:{desktop:{assetPath:K.asset?.primary?.assetPath},mobile:{assetPath:K.asset?.secondary?.assetPath}},pillFarm:Q.list,icon:Z}),(0,B.jsx)(O.Hr,{})]}):(0,B.jsx)(O.tm,{iconName:Z,content:{assetPath:K.asset?.primary?.assetPath,assetPathAlt:K.asset?.alt,background:K.background,cta:K.cta,description:K.description,heading:K.heading,modifiers:K.modifiers},lightScrim:F}):null),[K,G,Z,F,Q]);return(0,B.jsxs)(_.Kq,{preview:t,children:[J&&(0,B.jsx)(te,{children:(0,B.jsx)(ee,{marketingPage:J})}),r&&(0,B.jsx)(O.JL,{children:tt}),rt,(0,B.jsxs)(f.H.NewLevel,{children:[!G&&Q?.list.length>0&&(0,B.jsx)(O.$0,{constrained:!0,small:!0,divider:["bottom"],children:(0,B.jsx)(O.l6,{center:!0,items:Q.list})}),(0,B.jsx)("span",{ref:ge,id:"products","data-drawer-id":T}),(0,B.jsx)(v.S,{size:36,axis:"vertical"}),(0,B.jsxs)(O.He,{children:[(0,B.jsxs)(D.zB,{$breadcrumbs:!!r,children:[(0,B.jsx)(p.D,{children:tt}),(0,B.jsx)(h.S,{label:ae("Sort by"),onSelect:Xe,options:ke,dropdownValue:re?Se:null}),(0,B.jsx)(p.M,{children:(0,B.jsx)(O.Lb,{icon:j.Z,variant:"tertiary",onClick:xe,children:ae("Filter")})})]}),(0,B.jsx)(v.S,{size:32,axis:"vertical"}),(0,B.jsx)(O.dA,{enableStickyFilterPanel:!0,isFilterModalOpen:je,toggleModalFiltersMenu:xe,attributeFilterSets:Je,isDesktop:Ie,stickyOffset:q&&parseInt(M.TH)+16,customizeFilters:{clearFilters:Ue,removeFilter:Ve,activeFilters:We,totalHits:_e.length},children:et}),Y&&(0,B.jsx)(D.VH,{children:(0,B.jsx)(O.Ho,{data:Y,textVariant:"legal"})})]}),(0,B.jsx)(O.y4,{})]})]})};Z.defaultProps={sortByOptions:F.Op},t.Z=Z},99503:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/store/hardware/[slug]",function(){return r(47718)}])}},function(e){e.O(0,[8286,4511,402,5806,5188,9774,2888,179],(function(){return t=99503,e(e.s=t);var t}));var t=e.O();_N_E=t}]); //# sourceMappingURL=[slug]-46c65bc5b6ba9b87.js.map