import{Gn as e,dr as t,sn as n}from"./vendor-Dcerr41Y.js";import{Yn as r,Zn as i,h as a,m as o}from"./ws-DjAvcWfg.js";r(),o(),n();var s=800,c=`cider:spa-ready`,l=`cider:catalog-ready`;function u(e){try{window.chrome?.webview?.postMessage?.(e)}catch{}}function d(){return typeof requestAnimationFrame>`u`?Promise.resolve():new Promise(e=>requestAnimationFrame(()=>e()))}function f(){u(c);let n=i(),r=a();if(n.bootRevealed){u(l);return}let o=!1,f=async t=>{o||(o=!0,await e(),await d(),n.bootRevealed=!0,u(l),t===`cap`&&console.warn(`[BootReveal] catalog-ready fired on max-hold cap`))};if(r.musicKitReady){f(`ready`);return}let p=setTimeout(()=>f(`cap`),s),m=t(()=>r.musicKitReady,e=>{e&&(m(),clearTimeout(p),f(`ready`))})}export{f as startBootReveal};