import{N as e,i as t,k as n,t as r}from"./jsx-runtime-ktpX_HJe.js";import{n as i,t as a}from"./LastPlayed-CtFlEIGx.js";import{g as o}from"./Image-iLcFsxYI.js";import{n as s,t as c}from"./InterestGraph-BxNPbDMf.js";import{t as l}from"./TopTracks-Cm34vZys.js";import"./MediaItemNote-B5eSTeH7.js";var u=r();async function d({params:e}){let t=await fetch(`/apis/web/v1/album/${e.id}`);if(!t.ok)throw new Response(`Failed to load album`,{status:500});return await t.json()}var f=e(function(){let e=n();return console.log(e),(0,u.jsx)(s,{type:`Album`,title:e.title,img:e.image,id:e.id,rank:e.all_time_rank,musicbrainzId:e.musicbrainz_id,timeListened:e.time_listened,listenCount:e.listen_count,firstListen:e.first_listen,imgItemId:e.id,mergeFunc:o,mergeCleanerFunc:(e,t)=>{e.artists=[],e.tracks=[];for(let n=0;n<e.albums.length;n++)e.albums[n].id===t&&e.albums.splice(n,1);return e},subContent:(0,u.jsxs)(u.Fragment,{children:[e.artists.length>0&&!e.is_various_artists&&(0,u.jsxs)(`p`,{children:[`By`,` `,(0,u.jsx)(`span`,{children:(0,u.jsx)(t,{className:`hover:underline`,to:`/artist/${e.artists[0].id}`,children:e.artists[0].name})},e.artists[0].id)]}),e.is_various_artists&&(0,u.jsx)(`p`,{children:`By Various Artists`})]}),children:(0,u.jsxs)(`div`,{className:`flex flex-col gap-10 md:gap-12 mt-8 max-w-[1400px]`,children:[(0,u.jsxs)(`div`,{className:`flex gap-10 md:gap-20 flex-wrap xl:flex-nowrap items-start`,children:[(0,u.jsx)(l,{limit:8,period:`all_time`,albumId:e.id,showSeeMore:!0,className:`max-w-[750px] lg:max-w-[450px]`}),(0,u.jsx)(`div`,{className:`min-w-[350px] flex-1`,children:(0,u.jsx)(a,{limit:11,albumId:e.id,showNowPlaying:!0,showSeeMore:!0})})]}),(0,u.jsxs)(`div`,{className:`flex flex-wrap gap-10`,children:[(0,u.jsx)(c,{type:`album`,id:e.id}),(0,u.jsx)(i,{configurable:!0,albumId:e.id})]})]})})});export{d as clientLoader,f as default};