1import{c as b,r as m,j as e,m as h,L as P,u as k}from"./index-pR_eQQT3.js";import{a as E}from"./musicData-CF0Q0jII.js";import{A as L,N as S}from"./NotFound-oLwvvWnZ.js";import{P as j,a as v,V as A}from"./volume-2-DCGFL9QU.js";import"./sparkles-hql_cd-P.js";/** 2 * @license lucide-react v0.344.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const C=b("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/** 7 * @license lucide-react v0.344.0 - ISC 8 * 9 * This source code is licensed under the ISC license. 10 * See the LICENSE file in the root directory of this source tree. 11 */const V=b("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);function I(){const[a,n]=m.useState(null),[l,r]=m.useState(!1),[x,d]=m.useState(0),[i,o]=m.useState(1),[y,c]=m.useState(null),s=m.useRef(null);m.useEffect(()=>(s.current=new Audio,()=>{s.current&&(s.current.pause(),s.current=null)}),[]),m.useEffect(()=>{if(!s.current)return;const t=s.current,u=()=>{t.duration&&d(t.currentTime/t.duration*100)},f=()=>{r(!1),d(0)},p=w=>{console.error("Audio error:",w),c("Unable to play audio. Please ensure the audio file exists."),r(!1)};return t.addEventListener("timeupdate",u),t.addEventListener("ended",f),t.addEventListener("error",p),()=>{t.removeEventListener("timeupdate",u),t.removeEventListener("ended",f),t.removeEventListener("error",p)}},[]);const N=async t=>{if(s.current)try{if(c(null),(a==null?void 0:a.id)===t.id){g();return}l&&s.current.pause(),s.current.src=t.audioUrl,s.current.volume=i;const u=s.current.play();u!==void 0&&u.then(()=>{n(t),r(!0)}).catch(f=>{console.error("Playback failed:",f),c("Unable to play audio. Please ensure the audio file exists."),r(!1)})}catch(u){console.error("Error playing track:",u),c("Unable to play audio. Please ensure the audio file exists."),r(!1)}},g=()=>{if(!(!s.current||!a))try{if(l)s.current.pause(),r(!1);else{const t=s.current.play();t!==void 0&&t.then(()=>r(!0)).catch(u=>{console.error("Playback failed:",u),c("Unable to play audio. Please ensure the audio file exists."),r(!1)})}}catch(t){console.error("Error toggling play:",t),c("Unable to play audio. Please ensure the audio file exists."),r(!1)}};return{currentTrack:a,isPlaying:l,progress:x,volume:i,error:y,playTrack:N,togglePlay:g,seekTo:t=>{if(!s.current)return;const u=t/100*s.current.duration;s.current.currentTime=u,d(t)},adjustVolume:t=>{s.current&&(s.current.volume=t,o(t))}}}function U({album:a}){return e.jsxs("div",{className:"flex flex-col md:flex-row gap-8 mb-12",children:[e.jsx(h.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"w-full md:w-64 flex-shrink-0",children:e.jsx("img",{src:a.coverImage,alt:a.title,className:"w-full aspect-square object-cover rounded-lg shadow-2xl"})}),e.jsx("div",{className:"flex flex-col justify-end",children:e.jsxs(h.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:[e.jsx("h1",{className:"text-4xl font-bold text-white mb-4",children:a.title}),e.jsx("p",{className:"text-xl text-gray-300 mb-6",children:a.description})]})})]})}function $({tracks:a,currentTrack:n,isPlaying:l,onTrackSelect:r,onTogglePlay:x}){const d=i=>{(n==null?void 0:n.id)===i.id?x():r(i)};return e.jsx("div",{className:"space-y-2",children:a.map((i,o)=>{const y=(n==null?void 0:n.id)===i.id,c=i.icon;return e.jsxs(h.button,{onClick:()=>d(i),className:`w-full flex items-center gap-4 p-4 rounded-lg transition-colors ${y?"bg-blue-500/20 border border-blue-500/30":"hover:bg-gray-800"}`,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:o*.1},children:[e.jsx("div",{className:"w-8 flex-shrink-0",children:y?l?e.jsx(j,{className:"w-6 h-6 text-blue-400"}):e.jsx(v,{className:"w-6 h-6 text-blue-400"}):e.jsx("span",{className:"text-gray-400",children:o+1})}),c&&e.jsx(c,{className:"w-5 h-5 text-blue-400"}),e.jsxs("div",{className:"flex-1 text-left",children:[e.jsx("div",{className:`font-medium ${y?"text-blue-400":"text-white"}`,children:i.title}),e.jsx("div",{className:"text-sm text-gray-400",children:i.genre})]}),e.jsx("div",{className:"text-sm text-gray-400",children:i.duration})]},i.id)})})}function B({currentTrack:a,isPlaying:n,progress:l,volume:r,onTogglePlay:x,onSeek:d,onVolumeChange:i}){return a?e.jsx(h.div,{initial:{opacity:0,y:20}
11,animate:{opacity:1,y:0},className:"bg-gray-900/90 backdrop-blur-sm border-t border-gray-800 p-6 rounded-t-xl",children:e.jsxs("div",{className:"flex items-center gap-8",children:[e.jsx("img",{src:a.coverImage,alt:a.title,className:"w-16 h-16 rounded-lg object-cover"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("div",{className:"font-medium text-white mb-1",children:a.title}),e.jsx("div",{className:"text-sm text-gray-400",children:a.artist}),e.jsx("div",{className:"mt-4",children:e.jsx("input",{type:"range",min:"0",max:"100",value:l,onChange:o=>d(Number(o.target.value)),className:"w-full h-1 bg-gray-700 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #3b82f6 ${l}%, #374151 ${l}%)`}})})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{className:"text-gray-400 hover:text-white transition-colors",children:e.jsx(C,{className:"w-6 h-6"})}),e.jsx("button",{onClick:x,className:"p-3 rounded-full bg-blue-500 hover:bg-blue-600 transition-colors",children:n?e.jsx(j,{className:"w-6 h-6 text-white"}):e.jsx(v,{className:"w-6 h-6 text-white"})}),e.jsx("button",{className:"text-gray-400 hover:text-white transition-colors",children:e.jsx(V,{className:"w-6 h-6"})})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(A,{className:"w-5 h-5 text-gray-400"}),e.jsx("input",{type:"range",min:"0",max:"1",step:"0.1",value:r,onChange:o=>i(Number(o.target.value)),className:"w-24 h-1 bg-gray-700 rounded-lg appearance-none cursor-pointer",style:{background:`linear-gradient(to right, #3b82f6 ${r*100}%, #374151 ${r*100}%)`}})]})]})}):null}function F(){return e.jsx(h.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"bg-gray-900/90 backdrop-blur-sm border-t border-gray-800 p-4 flex justify-center",children:e.jsxs(P,{to:"/music",className:"inline-flex items-center gap-2 text-gray-400 hover:text-white transition-colors group",children:[e.jsx(L,{className:"w-5 h-5 group-hover:-translate-x-1 transition-transform"}),e.jsx("span",{children:"Back to Music"})]})})}function G(){const{albumId:a}=k(),n=E.find(s=>s.id===a),{currentTrack:l,isPlaying:r,progress:x,volume:d,playTrack:i,togglePlay:o,seekTo:y,adjustVolume:c}=I();return n?e.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-blue-900 via-gray-900 to-black",children:[e.jsxs("div",{className:"container mx-auto px-4 pt-24 pb-48",children:[e.jsx(U,{album:n}),e.jsx($,{tracks:n.tracks,currentTrack:l,isPlaying:r,onTrackSelect:i,onTogglePlay:o})]}),e.jsxs("div",{className:"fixed bottom-0 left-0 right-0",children:[e.jsx(F,{}),e.jsx(B,{currentTrack:l,isPlaying:r,progress:x,volume:d,onTogglePlay:o,onSeek:y,onVolumeChange:c})]})]}):e.jsx(S,{})}export{G as AlbumPage};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.