"use strict";(this.__LOADABLE_LOADED_CHUNKS__=this.__LOADABLE_LOADED_CHUNKS__||[]).push([[9824],{35889:(t,e,l)=>{l.r(e),l.d(e,{default:()=>E});var i=l(18443),n=l(19981),s=l(9969),r=l(43422),a=l(59294),o=l(36012),d=l.n(o),u=l(46423),c=l(74763),Z=l(87805),h=l(9821),y=l(24179),p=l(78743),m=l(87779),T=l(78257),I=l(15061),_=l(97216),A=l(61729),R=l(33998),S=l(25025),b=l(72798),g=l(61993),w=l(90758),B=l(83738),M=l(96832),O=l(76570),f=l(66833),v=l(44812),C=l(23653),D=l(54067),L=l(32173),$=l(34853);const k=(0,m.Z)(h.Z),E=({artistReceived:t,profileId:e,sessionId:l})=>{const[o,h]=(0,M.useState)([]),[m,E]=(0,M.useState)(!1),[H,N]=(0,M.useState)(void 0),V=(0,w.Z)(),X=!m||m&&!!H,Y=(0,M.useCallback)((async()=>{if(!X)return;let n=[];try{var s,r,a;const d=await(0,b.Z)((0,O.v7)({key:H,limit:30,profileId:e,sessionId:l}));n=null!=(s=null==d||null==(r=d.data)?void 0:r.data)?s:[],t(n);const u=[...o,...n],c=(0,i.Z)(u,"id");h(c),E(!0),N(null==d||null==(a=d.data)||null==(a=a.links)?void 0:a.nextPageKey)}catch(t){const e=t instanceof Error?t:new Error(t);u.ZP.error(u.Ke.YOUR_LIBRARY,e.message,{},e)}}),[t,o,X,H,e,l]);(0,g.Z)((()=>{Y()}));let F=[...(0,r.Z)({allRoundTiles:!0})];return m&&(F=o.map((({count:t,id:e,name:l,playedFrom:i})=>{const n=`/your-library/artists/${(0,v.lV)(l)}-${e}/`,r=V("{count} song{plural}",{count:`${t||0} `,plural:1===t?"":"s"}),a=(0,$.tZ)(y.Z,{children:(0,$.tZ)(k,{additionalOpts:{myMusicType:C.bV.ARTIST},className:"play",myMusicType:C.bV.ARTIST,playedFrom:i||p.Z.PROF_MY_ARTISTS_ARTISTS,seedId:e,stationId:e,stationType:C.bV.MY_MUSIC})}),o=(0,$.tZ)(S.Z,{children:(0,$.tZ)(s.Z,{alt:l,aspectRatio:1,background:!0,height:D.ul,id:e,type:C.bV.ARTIST,width:D.ul})});return(0,$.BX)(M.Fragment,{children:[(0,$.tZ)(T.Z,{imageComponent:o,isRoundImage:!0,playButtonComponent:a,subtitleComponent:r,title:l,url:n}),(0,$.BX)(A.Z,{isRoundImage:!0,noTileOnMobile:!0,subTitle:r,tileDelay:0,tilesInRow:L.n,title:l,url:n,children:[a,o]},`${e}-${l}-tile`)]},`${e}-${l}-fragment`)}))),(0,$.BX)($.HY,{children:[(0,$.tZ)(f.H4,{"data-test":"your-library-artists-title",hideHeader:0===F.length,children:(0,$.BX)(I.Z,{children:[V("Artists")," (A-Z)"]})}),(0,$.BX)(_.Z,{shouldShow:F.length>0||!m,children:[(0,$.tZ)(n.Z,{}),(0,$.tZ)(f.Nx,{children:(0,$.tZ)(d(),{hasMore:X,loadMore:Y,pageStart:0,children:(0,$.tZ)(R.Z,{noTileOnMobile:!0,tilesInRow:L.n,children:F})})})]}),(0,$.tZ)(_.Z,{shouldShow:0===F.length,children:(0,$.tZ)(a.Z,{buttons:[(0,$.tZ)(c.Z,{dataTest:"artists-empty-link",to:"/artist/",children:(0,$.tZ)(Z.Z,{children:V("Browse Artists")})},"artists-empty-link")],icon:B.c9,subtitle:V("Need to find an artist you love?"),title:V("Any artists you follow will show up here")})})]})}}}]); //# sourceMappingURL=Artists.www.js.map