import{n as e}from"./rolldown-runtime-DAXXjFlN.js";import{An as t,Ar as n,Fn as r,Ln as i,On as a,Pn as o,er as s,jn as c,mr as l,pr as u,sn as d,vr as f,zr as p}from"./vendor-Dcerr41Y.js";import{Ft as m,Gt as h,It as g,Kt as _,Lt as v,Mt as y,Nt as b,Pt as x,Rt as S,S as C,b as w,it as T,jt as E,rt as D,x as O,y as k}from"./vendor-quasar-CU_esu6y.js";import{Dr as A,Er as j,br as M,di as N,gr as P,mr as F,ui as I,xr as L}from"./ws-DjAvcWfg.js";import{c as R,s as z}from"./index-IojTodLd.js";import{n as B,t as V}from"./CTooltip-VbAiroE6.js";var H,U=e((()=>{B(),C(),S(),x(),w(),y(),g(),_(),T(),d(),M(),z(),A(),H=i({__name:`SleepTimerBadge`,setup(e){let i=R(),d=n(!1),g=n(``);function _(){let e=new Date,t=e.getHours().toString().padStart(2,`0`),n=e.getMinutes().toString().padStart(2,`0`);g.value=`${t}:${n}`,d.value=!0}function y(){if(!g.value)return;let e=new Date,[t,n]=g.value.split(`:`).map(Number);if(t===void 0||n===void 0)return;let r=new Date(e);r.setHours(t,n,0,0),r<=e&&r.setDate(r.getDate()+1);let a=r.getTime()-e.getTime(),o=Math.floor(a/6e4);o>0&&i.startTimer(o),d.value=!1}function x(e){let t=new F;t.setItems([P(`15 Minutes`,()=>i.startTimer(15)),P(`30 Minutes`,()=>i.startTimer(30)),P(`45 Minutes`,()=>i.startTimer(45)),P(`1 Hour`,()=>i.startTimer(60)),P(`Custom...`,async()=>{_()}),L(),P(`Clear Timer`,()=>i.clearTimer())]),t.show(e)}return(e,n)=>{let _=V;return p(i).isActive?(s(),c(`div`,{key:0,class:`sleep-timer-badge`,onClick:x},[r(j,{name:`sleepTimer`,size:`18px`}),r(_,null,{default:u(()=>[o(f(p(i).formattedRemainingTime)+` remaining (Ends at `+f(p(i).endTimeFormatted)+`)`,1)]),_:1}),r(h,{modelValue:d.value,"onUpdate:modelValue":n[1]||=e=>d.value=e,class:`z-top`},{default:u(()=>[r(m,{style:{"min-width":`300px`}},{default:u(()=>[r(b,{class:`row items-center`},{default:u(()=>[n[2]||=a(`div`,{class:`text-h6`},`Set Sleep Timer`,-1),r(O),l(r(v,{icon:`close`,flat:``,round:``,dense:``},null,512),[[D]])]),_:1}),r(b,{class:`flex flex-center`},{default:u(()=>[r(k,{modelValue:g.value,"onUpdate:modelValue":n[0]||=e=>g.value=e,format24h:``},null,8,[`modelValue`])]),_:1}),r(E,{align:`right`},{default:u(()=>[l(r(v,{flat:``,label:`Cancel`,color:`primary`},null,512),[[D]]),r(v,{flat:``,label:`Start`,color:`primary`,onClick:y})]),_:1})]),_:1})]),_:1},8,[`modelValue`])])):t(``,!0)}}})})),W=e((()=>{})),G,K=e((()=>{U(),U(),W(),N(),G=I(H,[[`__scopeId`,`data-v-8f279f62`]])}));export{K as n,G as t};