Loading
function(e,l,s){s.r(l),s.d(l,{default:()=>em});var t=s(477900),n=s(582128),a=s(503698),r=s.n(a),i=s(806163),o=s(132500),c=s(17928),d=s(364522),u=s(944791),h=s(444927),g=s(688810),x=s(354328),I=s(475073),C=s(611924),m=s(744082),p=s(594832),b=s(440938),j=s(590180),A=s(50920),E=s(395856),f=s(790297),L=s(350172),_=s(730202),N=s(295586),v=s(510801),T=s(682301);function O(e){let{enabled:l=!0,includeUnpublished:s=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=l&&null!=e?e:"";n.useEffect(()=>{""!==t&&N.p.requestCollections([t],{includeUnpublished:s})},[t,s]);let{collection:a,fetchState:r}=(0,c.cf)([_.A],()=>({collection:_.A.getCollection(t),fetchState:_.A.getFetchState(t)}),[t]),i=(0,T.Hd)(t,r),o=n.useMemo(()=>null!=a?v.A.fromStorefrontCollectionRecord(a):null,[a]),d=n.useMemo(()=>"error"===r||i?"error":null!=o?"ready":"loading",[r,i,o]);return{category:o,state:d,retry:n.useCallback(()=>{""!==t&&(0,L._v)({collectionIds:[t],includeUnpublishedCollections:s,includeUnpublishedProducts:s,ignoreCache:!0})},[t,s])}}var S=s(841702),k=s(983545),y=s(626148),R=s(235939);s(321073);var B=s(575593),F=s(651162),P=s(40474),G=s(297264),U=s(821609),D=s(449543),M=s(152858),H=s(197935),V=s(287809),w=s(174459),X=s(161918),W=s(993408),$=s(879221),Y=s(511265),z=s(652215),K=s(828515),q=s(258245),J=s(484469),Z=s(196231),Q=s(337183),ee=s(758836),el=s(375708),es=s(146053);function et(e){return e.skuId}function en(e,l){let s=(0,E.$)(l),{category:t}=O(e,{enabled:s,includeUnpublished:(0,x.A)("shop_include_unpublished")}),n=(0,c.bG)([j.A],()=>j.A.getCategory(e));return s?t??void 0:n}let ea={aspectRatio:"1 / 1"},er={[B.R.PROFILE_EFFECT]:{className:es.I5,aspectRatio:"1 / 2"},[B.R.BUNDLE]:{className:es.kP,aspectRatio:"2 / 1"}};function ei(e){let{category:l}=e,s=(0,c.bG)([V.default],()=>V.default.getCurrentUser()),n=(0,Y.p)()(l.products);return null==s||0===n.length?null:(0,t.jsx)("div",{className:es.hd,children:(0,t.jsx)("div",{className:es.fr,children:n.map((e,l)=>{let{className:s,aspectRatio:n}=er[e.type===B.R.VARIANTS_GROUP&&null!=e.variants&&e.variants.length>0&&e.variants.every(e=>e.type===B.R.PROFILE_EFFECT)?B.R.PROFILE_EFFECT:e.type]??ea;return(0,t.jsx)(b.R9,{newValue:{tilePosition:l},children:(0,t.jsx)(q.A,{skuId:e.skuId,cardClassName:s,aspectRatio:n})},e.skuId)})})})}function eo(e){let{currentCategorySkuId:l,handleTransition:s}=e,a=(0,E.$)("collection_index_related_drops"),r=(0,$.O)("related_drops"),{categories:i}=function(e){let{anchorCollectionId:l,limit:s,enabled:t=!0}=e,a=n.useMemo(()=>({applicationId:z.FYj,anchorCollectionId:l??"",limit:s}),[l,s]),r=t&&null!=l&&""!==l,i=(0,L.HX)(a);n.useEffect(()=>{r&&(0,L.Su)(a)},[r,a]);let{collectionIds:o,fetchState:d}=(0,c.cf)([_.A],()=>({collectionIds:_.A.getCollectionsAfterIds(i),fetchState:_.A.getCollectionsAfterFetchState(i)}),[i]),u=n.useMemo(()=>r?o??[]:[],[r,o]),h=u.join(","),g=(0,c.cf)([_.A],()=>{let e={};for(let l of u)e[l]=_.A.getCollectionOrSummary(l);return e},[u]);return{categories:n.useMemo(()=>u.map(e=>g[e]).filter(e=>null!=e).map(e=>v.A.fromStorefrontCollectionRecord(e)),[h,g]),isLoading:r&&null==o&&"error"!==d}}({anchorCollectionId:l,limit:12,enabled:a}),o=(0,c.bG)([j.A],()=>j.A.categories),d=n.useCallback(e=>e.skuId!==l&&null!=e.featuredBlockUrl&&!0!==e.isOrbsExclusive&&(null==e.unpublishedAt||e.unpublishedAt>new Date)&&!ee.MS.some(l=>{let{categorySkuId:s}=l;return s===e.skuId}),[l]),u=n.useMemo(()=>{if(a)return i.filter(d).slice(0,8);let e=[...o.values()],s=e.findIndex(e=>e.skuId===l);if(-1===s)return[];let t=[];for(let l=1;l<=e.length&&t.length<8;l++){let n=e[(s+l)%e.length];d(n)&&n.products.length>0&&t.push(n)}return t},[a,i,o,l,d]);return 0===u.length?null:(0,t.jsxs)("div",{className:es.t3,children:[(0,t.jsx)("div",{className:es.bb,children:(0,t.jsx)(G.D,{variant:"heading-lg/semibold",children:el.intl.string(el.t.EhRZ9o)})}),r?(0,t.jsx)(H.A,{gap:"xl",scrollStep:"item",items:u,getItemKey:et,renderItem:(e,l,n)=>(0,t.jsx)(ec,{category:e,index:n,handleTransition:s,listItemProps:l},e.skuId)},l):(0,t.jsx)(D.A,{gap:"xl",scrollBehavior:M.Uf.ITEM,children:u.map((e,l)=>(0,t.jsx)(ec,{category:e,index:l,handleTransition:s},e.skuId))},l)]})}function ec(e){let{category:l,index:s,handleTransition:n,listItemProps:a}=e;return(0,t.jsx)(b.R9,{newValue:{categoryPosition:s,pageCategory:l.name,pageSection:"related_drops",tilePosition:s},children:(0,t.jsx)("div",{className:es.EU,children:(0,t.jsx)(Z.S,{category:l,badgeText:(0,W.HF)(l.unpublishedAt)?el.intl.string(el.t["h/uBCR"]):void 0,handleTransition:n,pageType:ee.G2.COLLECTION_INDEX,className:es.vK,listItemProps:a})})})}let ed=[{tab:ee.G2.AVATAR_DECORATIONS,label:()=>el.intl.string(el.t.dRZYNE)},{tab:ee.G2.PROFILE_EFFECTS,label:()=>el.intl.string(el.t["1cNjtx"])},{tab:ee.G2.NAMEPLATES,label:()=>el.intl.string(el.t.V68Fqz)},{tab:ee.G2.PROFILE_FRAMES,label:()=>el.intl.string(el.t.ecTJkR)},{tab:ee.G2.BUNDLES,label:()=>el.intl.string(el.t.FYFpps)}];function eu(){let e=(0,i.W6)();return(0,t.jsxs)("div",{className:es.nb,children:[(0,t.jsx)(G.D,{variant:"heading-md/semibold",children:el.intl.string(el.t.Yr70c4)}),(0,t.jsx)("div",{className:es.J2,children:ed.map(l=>{let{tab:s,label:n}=l;return(0,t.jsx)(U.$,{variant:"secondary",text:n(),onClick:()=>e.push(z.BVt.COLLECTIBLES_SHOP_WITH_TAB(s))},s)})})]})}function eh(e){let{collectionId:l}=e,s=(0,i.W6)(),a=(0,b.uM)(),o=en(l,"collection_index_breadcrumb")?.name,c=n.useMemo(()=>[{id:"shop_all",label:el.intl.string(el.t.xFcotU)},{id:"collection",label:o??""}],[o]),d=n.useCallback(e=>{"shop_all"===e.id&&(w.default.track(z.HAw.COLLECTIBLES_SHOP_ELEMENT_CLICKED,{collectibles_shop_session_id:a?.sessionId,sku_id:l,page_type:ee.G2.COLLECTION_INDEX,page_category:o,cta_name:"collection breadcrumb shop all"}),s.push(z.BVt.COLLECTIBLES_SHOP_WITH_TAB(ee.G2.CATALOG)))},[s,a?.sessionId,l,o]),u=n.useCallback((e,l)=>(0,t.jsxs)("span",{className:r()(es.u,{[es.kG]:l}),children:[e.label,!l&&(0,t.jsx)("span",{className:es.Tl,children:"/"})]}),[]);return(0,t.jsx)(P.A,{className:es.C2,separatorClassName:es.Lw,breadcrumbs:c,activeId:"collection",onBreadcrumbClick:d,renderCustomBreadcrumb:u})}function eg(){return(0,t.jsxs)("div",{className:es.kL,children:[(0,t.jsx)(Q.A,{isLoading:!0,hideButton:!0,hideCards:!0,tab:ee.G2.COLLECTION_INDEX}),(0,t.jsx)("div",{className:es.hd,children:(0,t.jsx)("div",{className:es.fr,children:Array.from({length:8},(e,l)=>(0,t.jsx)(J.A,{},l))})}),(0,t.jsxs)("div",{className:es.t3,children:[(0,t.jsx)("div",{className:es.bb,children:(0,t.jsx)("div",{className:es.M$})}),(0,t.jsxs)("div",{className:es.A9,children:[(0,t.jsx)("div",{className:es.nl}),(0,t.jsx)("div",{className:es.nl})]})]})]})}let ex=function(e){let{collectionId:l}=e,s=(0,i.W6)(),a=en(l,"collection_index_page_content"),r=n.useCallback(e=>{let{categorySkuId:l}=e;null!=l&&s.push(z.BVt.COLLECTIBLES_SHOP_COLLECTION_DETAIL(l))},[s]),o=n.useMemo(()=>null==a?null:{rankedSkuIds:a.heroRanking??[],name:a.name,unpublishedAt:a.unpublishedAt,categorySkuId:a.skuId,summary:a.summary,type:F.g.HERO,categoryStoreListingId:a.storeListingId,bannerDisplayConfig:a.heroBannerDisplayConfig,logoDisplayConfig:a.heroLogoDisplayConfig,heroLogoUrl:a.heroLogoUrl,heroBannerUrl:a.heroBannerUrl,heroBannerAnimatedUrl:a.heroBannerAnimatedUrl,heroRiveUrl:a.heroRiveUrl},[a]);if(null==a)return null;let c=null!=a.heroBannerUrl||null!=a.heroRiveUrl;return(0,t.jsx)(X.iM,{tab:ee.G2.COLLECTION_INDEX,children:(0,t.jsxs)("div",{className:es.kL,children:[c&&null!=o?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:es.rz,children:[(0,t.jsx)("div",{className:es.zn,children:(0,t.jsx)(eh,{collectionId:l})}),(0,t.jsx)(Q.A,{heroBlock:o,isLoading:!1,tab:ee.G2.COLLECTION_INDEX,hideButton:!0,hideCards:!0})]}),(0,t.jsx)(ei,{category:a}),(0,t.jsx)(eo,{currentCategorySkuId:a.skuId,handleTransition:r},a.skuId)]}):(0,t.jsxs)("div",{className:es.AW,children:[(0,t.jsx)("div",{className:es.zn,children:(0,t.jsx)(eh,{collectionId:l})}),(0,t.jsx)("div",{className:es.$T,children:(0,t.jsx)(K.A,{category:a})}),(0,t.jsx)(ei,{category:a}),(0,t.jsx)(eo,{currentCategorySkuId:a.skuId,handleTransition:r},a.skuId)]}),(0,t.jsx)(eu,{})]})})};var eI=s(146919),eC=s(170522);let em=function(e){let{collectionId:l}=e,s=n.useRef(null),a=n.useRef(null);(0,C.P)(I.a);let L=(0,eI.yB)("CollectiblesShopIndexPage");(0,eI.gB)();let{selectedTab:_,transitionToTab:N,transitionState:v}=(0,k.o)(ee.G2.COLLECTION_INDEX);(0,p.pE)();let T=(0,E.$)("collection_index_page");(0,S.Ay)({stalePurchasesOK:!0,skipFetch:T}),(0,m.A)(z.FYj);let B=(0,h.A)((0,o.A)()),F=(0,A.a)("CollectiblesShopIndexPage"),{category:P,state:G}=O(l,{enabled:T,includeUnpublished:(0,x.A)("shop_include_unpublished")}),U=(0,c.bG)([j.A],()=>null!=l?j.A.getCategory(l):void 0),D=(0,c.bG)([j.A],()=>j.A.isFetchingCategories),M=(0,c.bG)([j.A],()=>null!=j.A.lastSuccessfulFetch),H=(0,c.bG)([j.A],()=>j.A.error),V=T?P??void 0:U,{analyticsLocations:w}=(0,f.lC)(ee.G2.COLLECTION_INDEX);(0,f.uS)(B,_,V?.name,v),n.useEffect(()=>{a.current?.scrollTo({top:0})},[l]),n.useEffect(()=>{(0,u.I)(z.BVt.COLLECTIBLES_SHOP)},[]);let X=(T?"loading"!==G:!D&&(M||null!=H))&&null==V;return null==l||!F||X?(0,t.jsx)(i.rd,{to:z.BVt.COLLECTIBLES_SHOP}):V?.isOrbsExclusive===!0?(0,t.jsx)(i.rd,{to:z.BVt.COLLECTIBLES_SHOP_WITH_TAB(ee.G2.ORBS)}):null==V?(0,t.jsxs)("div",{className:r()(eC.bx,{[eI.jP]:L}),ref:s,tabIndex:-1,children:[(0,t.jsx)(y.G,{handleTransition:N,selectedTab:_,selectedCollectionId:l}),(0,t.jsx)(d.Ip,{children:(0,t.jsx)(eg,{})})]}):(0,t.jsx)(g.f5,{value:w,children:(0,t.jsx)(b.R9,{newValue:{sessionId:B},children:(0,t.jsxs)("div",{className:r()(eC.bx,{[eI.jP]:L}),ref:s,tabIndex:-1,children:[(0,t.jsx)(y.G,{handleTransition:N,selectedTab:_,selectedCollectionId:l}),(0,t.jsx)(R.A,{tab:_,handleTransition:N}),(0,t.jsx)(d.Ip,{ref:a,children:(0,t.jsx)(ex,{collectionId:l})})]})})})}}