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