import{Tr as e,_r as t,dn as n}from"./vendor-6bGPahzI.js";import{et as r}from"./vendor-quasar-Bl8FKFQs.js";import{Ji as i,On as a,Pt as o,Yi as s,jt as c,lr as l,ur as u,wn as d}from"./ws-BfVPV0ME.js";import{n as f,t as p}from"./useUISound-CZTRA0mz.js";import{n as m,t as h}from"./vLyricProgress-CszW8Tta.js";i(),o(),n();var g=null;function _(){g?.stop(),g=e(!0);let n=document.documentElement;g.run(()=>{t(()=>{let e=c().accessibility;if(!e)return;n.classList.toggle(`a11y-bold`,!!e.boldText),n.classList.toggle(`a11y-high-contrast`,!!e.highContrast),n.classList.toggle(`a11y-focus-visible`,!!e.forceFocusVisible);let t=e.motionIntensity||`normal`,r=[`none`,`reduced`,`normal`,`playful`].includes(t)?t:`normal`;n.classList.remove(`motion-none`,`motion-reduced`,`motion-normal`,`motion-playful`),n.classList.add(`motion-${r}`);let i=r===`none`||r===`reduced`;e.reducedMotion!==i&&(e.reducedMotion=i),n.classList.toggle(`cards-in-motion`,!!e.cardMotion);let a=Math.min(1.5,Math.max(.75,Number(e.uiScale)||1));n.style.setProperty(`--a11y-ui-scale`,String(a))})})}u(),d(),p(),h();var v=new WeakMap,y=`c-tooltip-directive-style`;function b(e){if(e.getElementById(y))return;let t=e.createElement(`style`);t.id=y,t.textContent=`
    .c-tooltip.c-tooltip--directive {
      --tooltip-bg: color-mix(in srgb, var(--systemPrimary) 10%, rgb(18 18 20));
      --tooltip-border: color-mix(in srgb, var(--systemPrimary) 35%, rgb(255 255 255 / 16%));
      pointer-events: none;
      position: fixed;
      z-index: 99999;
      border-radius: 10px;
      border: 1px solid var(--tooltip-border);
      background: linear-gradient(180deg, rgb(255 255 255 / 9%), rgb(255 255 255 / 1%)), var(--tooltip-bg);
      backdrop-filter: blur(18px) saturate(130%);
      box-shadow:
        0 12px 24px rgb(0 0 0 / 32%),
        inset 0 1px 0 rgb(255 255 255 / 14%);
      color: var(--textDefault);
      max-width: min(320px, calc(100vw - 12px));
      opacity: 1;
      transition: opacity 0.12s ease;
    }

    .c-tooltip.c-tooltip--directive .c-tooltip__content {
      display: block;
      padding: 8px 10px;
      font-size: 12px;
      line-height: 1.25;
      font-weight: 500;
      text-align: center;
      overflow-wrap: anywhere;
    }
  `,e.head.appendChild(t)}function x(e){return typeof e==`string`?{text:e,anchor:`bottom middle`,self:`top middle`,offset:[0,8],delay:0}:{text:e?.text??``,anchor:e?.anchor??`bottom middle`,self:e?.self??`top middle`,offset:e?.offset??[0,8],delay:e?.delay??0,className:e?.class,style:e?.style}}function S(e,t){let n=e.toLowerCase().split(/\s+/).filter(Boolean),r=null,i=null;for(let e of n)(e===`left`||e===`start`)&&(r=`left`),(e===`right`||e===`end`)&&(r=`right`),(e===`middle`||e===`center`)&&(i?r=`middle`:i=`center`),e===`top`&&(i=`top`),e===`bottom`&&(i=`bottom`);return{horizontal:r??t.horizontal,vertical:i??t.vertical}}function C(e,t){return t===`left`?e.left:t===`right`?e.right:e.left+e.width/2}function w(e,t){return t===`top`?e.top:t===`bottom`?e.bottom:e.top+e.height/2}function T(e){e.showTimer&&=(clearTimeout(e.showTimer),null)}function E(e,t){if(t){if(typeof t==`string`){e.style.cssText+=`;${t}`;return}for(let[n,r]of Object.entries(t))e.style.setProperty(n,String(r))}}function D(e,t){let n=t.tooltipEl;if(!n)return!1;let r=e.ownerDocument.defaultView??window,i=e.getBoundingClientRect(),a=n.getBoundingClientRect(),o=S(t.binding.anchor,{horizontal:`middle`,vertical:`bottom`}),s=S(t.binding.self,{horizontal:`middle`,vertical:`top`}),c=C(i,o.horizontal),l=w(i,o.vertical);s.horizontal===`middle`&&(c-=a.width/2),s.horizontal===`right`&&(c-=a.width),s.vertical===`center`&&(l-=a.height/2),s.vertical===`bottom`&&(l-=a.height),c+=t.binding.offset[0],l+=t.binding.offset[1];let u=r.innerWidth-a.width-6,d=r.innerHeight-a.height-6;return n.style.left=`${Math.max(6,Math.min(u,c))}px`,n.style.top=`${Math.max(6,Math.min(d,l))}px`,!0}function O(e,t){queueMicrotask(()=>{if(!D(e,t))return;let n=e.ownerDocument.defaultView??window;n.requestAnimationFrame(()=>{D(e,t),n.requestAnimationFrame(()=>{D(e,t)})})})}function k(e){T(e),e.tooltipEl&&=(e.tooltipEl.remove(),null)}function A(e,t){let n=e.ownerDocument;b(n);let r=n.createElement(`div`);r.className=`c-tooltip c-tooltip--directive${t.binding.className?` ${t.binding.className}`:``}`,r.style.visibility=`hidden`;let i=n.createElement(`div`);return i.className=`c-tooltip__content`,i.textContent=t.binding.text,r.appendChild(i),E(r,t.binding.style),n.body.appendChild(r),t.tooltipEl=r,r}function j(e,t){T(t),t.binding.text.trim()&&(t.showTimer=setTimeout(()=>{if(t.tooltipEl)return;let n=A(e,t);O(e,t),n.style.visibility=`visible`},t.binding.delay))}function M(e,t){let n={binding:x(t),tooltipEl:null,showTimer:null,onMouseEnter:()=>j(e,n),onMouseLeave:()=>k(n),onFocusIn:()=>j(e,n),onFocusOut:()=>k(n),onDismiss:()=>k(n)};e.addEventListener(`mouseenter`,n.onMouseEnter),e.addEventListener(`mouseleave`,n.onMouseLeave),e.addEventListener(`focusin`,n.onFocusIn),e.addEventListener(`focusout`,n.onFocusOut),e.addEventListener(`pointerdown`,n.onDismiss),e.addEventListener(`contextmenu`,n.onDismiss),v.set(e,n)}function N(e){let t=v.get(e);t&&(e.removeEventListener(`mouseenter`,t.onMouseEnter),e.removeEventListener(`mouseleave`,t.onMouseLeave),e.removeEventListener(`focusin`,t.onFocusIn),e.removeEventListener(`focusout`,t.onFocusOut),e.removeEventListener(`pointerdown`,t.onDismiss),e.removeEventListener(`contextmenu`,t.onDismiss),k(t),v.delete(e))}var P={mounted(e,t){M(e,t.value)},updated(e,t){let n=v.get(e);if(!n){M(e,t.value);return}t.value!==t.oldValue&&(n.binding=x(t.value),n.tooltipEl&&(k(n),j(e,n)))},unmounted(e){N(e)}},F=new WeakMap;function I(e){return e??`click`}function L(e,t){let n=I(t),r=()=>f(n),i=()=>f(`hover`);e.addEventListener(`click`,r),e.addEventListener(`pointerenter`,i),F.set(e,{click:r,pointerenter:i})}function R(e){let t=F.get(e);t&&(e.removeEventListener(`click`,t.click),e.removeEventListener(`pointerenter`,t.pointerenter),F.delete(e))}var z={mounted(e,t){L(e,t.value)},updated(e,t){t.value!==t.oldValue&&(R(e),L(e,t.value))},unmounted(e){R(e)}};p();var B=[`button`,`[role="button"]`,`[role="tab"]`,`[role="menuitem"]`,`[role="option"]`,`.q-btn`,`.q-tab`,`.q-item.q-item--clickable`,`.q-item[clickable]`,`.q-select`,`.q-expansion-item__toggle-icon`,`.chrome-button`,`.settings-sidebar-item`,`.sidebar_nav-btn`,`.pod-tab`,`.mediaitem-card`,`[data-sidebar-navigation-button]`].join(`,`),V=[`button`,`[role="button"]`,`[role="tab"]`,`.q-btn`,`.q-tab`,`.chrome-button`,`.settings-sidebar-item`,`.sidebar_nav-btn`,`.pod-tab`,`[data-sidebar-navigation-button]`].join(`,`);function H(e){return!!e.closest(`.q-toggle, .q-slider, input[type="checkbox"], input[type="range"]`)}function U(e){if(!(e instanceof HTMLElement))return null;let t=e.closest(B);return!t||H(t)?null:t}function W(e){return e instanceof HTMLElement?!!(e instanceof HTMLInputElement&&e.type===`checkbox`||e.getAttribute(`role`)===`switch`||e.closest(`.q-toggle`)):!1}function G(e){return e instanceof HTMLElement?!!(e instanceof HTMLInputElement&&e.type===`range`||e.closest(`.q-slider`)):!1}function K(){document.addEventListener(`click`,e=>{let t=U(e.target);if(t){if(t.matches(`.q-tab, [role="tab"], .pod-tab, .settings-sidebar-item, .sidebar_nav-btn, [data-sidebar-navigation-button]`)){f(`tab-switch`);return}f(`click`)}},{capture:!0,passive:!0});let e=null,t=null,n=!1;function r(){n=!1;let r=t;if(t=null,!(r instanceof HTMLElement)){e=null;return}let i=r.closest(V);if(!i){e=null;return}i!==e&&(H(i)||(e=i,f(`hover`)))}document.addEventListener(`pointerover`,e=>{document.body.classList.contains(`scrolling`)||e.target!==t&&(t=e.target,!n&&(n=!0,requestAnimationFrame(r)))},{passive:!0}),document.addEventListener(`change`,e=>{let t=e.target;if(W(t)){f((t instanceof HTMLInputElement?t.checked:t.getAttribute(`aria-checked`)===`true`)?`switch-on`:`switch-off`);return}if(G(t)){f(`slide-tick`);return}(t instanceof HTMLSelectElement||t instanceof HTMLElement&&t.closest(`.q-select`))&&f(`click`)},{passive:!0}),document.addEventListener(`input`,e=>{let t=e.target;G(t)&&f(`slide-tick`)},{passive:!0}),document.addEventListener(`click`,e=>{if(!(e.target instanceof HTMLElement))return;let t=e.target.closest(`.q-expansion-item`);t&&queueMicrotask(()=>{f(t.querySelector(`.q-expansion-item--expanded`)?`expand`:`collapse`)})},{capture:!0,passive:!0})}var q=r(({app:e})=>{if(!a()){e.directive(`ui-sound`,z),e.directive(`tooltip`,P),e.directive(`lyric-line-progress`,m),K();try{s()}catch{}try{l()}catch{}queueMicrotask(()=>{try{_()}catch{requestAnimationFrame(()=>{try{_()}catch{}})}})}});export{q as default};