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