import{n as e}from"./rolldown-runtime-CMxvf4Kt.js";import{Bn as t,Cn as n,Xn as r,_n as i,hn as a,hr as o,mn as s,pn as c,qt as l,rr as u,xn as d}from"./vendor-C4JLrdLj.js";import{Jr as f,K as p,Tt as m,qr as h,vt as g,wt as _,yt as v,z as y}from"./ws-JRT2XE7Y.js";import{_ as b,v as x}from"./AMPlaybackActions-CHMHzCPG.js";import{n as S,t as C}from"./LiveBadge-j2EiICCn.js";var w,T,E,D,O,k=e((()=>{l(),_(),g(),p(),x(),S(),w={key:0,class:`am-progress-widget`},T={class:`am-currenttime`},E={class:`am-progress`},D=[`title`],O=n({__name:`AMProgressWidget`,setup(e){let n=c(()=>!!(l.player.nowPlayingItem?.type===`radioStation`||l.isLiveRadio)),l=v(),f=m(),p=o(!0),h=o(`0:00`),g=o(`0:00`),_=-1;r(()=>f.currentTime,e=>{let t=Math.floor(e??0);if(t===_)return;_=t;let n=y(e??0);n!==h.value&&(h.value=e<=0?`0:00`:n)});let x=-1;r(()=>[f.currentTime,f.duration,p.value],([e,t,n])=>{let r=Math.floor(e??0);if(r===x)return;x=r;let i=t??0;if(i<=0){g.value!==`0:00`&&(g.value=`0:00`);return}let a=n?`-`+y(Math.max(0,i-(e??0))):y(i);a!==g.value&&(g.value=a)},{immediate:!0});let S=o(void 0),O=-1;r(()=>f.currentTime,()=>{let e=Math.max(0,(f.duration??0)-(f.currentTime??0));if(!Number.isFinite(e)||e<=0){S.value!==void 0&&(S.value=void 0),O=-1;return}let t=new Date(Date.now()+e*1e3),n=t.getHours()*60+t.getMinutes();n!==O&&(O=n,S.value=`Ends at ${t.toLocaleTimeString([],{hour:`numeric`,minute:`2-digit`})}`)});function k(){p.value=!p.value}return(e,r)=>n.value?(t(),a(C,{key:1})):(t(),i(`div`,w,[s(`div`,T,u(h.value),1),s(`div`,E,[d(b)]),s(`div`,{class:`am-duration clickable`,title:S.value,onClick:k},u(g.value),9,D)]))}})})),A=e((()=>{})),j,M=e((()=>{k(),k(),A(),f(),j=h(O,[[`__scopeId`,`data-v-83f47210`]])}));export{M as n,j as t};