import{Xn as e,jn as t,qt as n}from"./vendor-C4JLrdLj.js";import{Bn as r,Hn as i,h as a,m as o}from"./ws-JRT2XE7Y.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 e=>{o||(o=!0,await t(),await d(),n.bootRevealed=!0,u(l),e===`cap`&&console.warn(`[BootReveal] catalog-ready fired on max-hold cap`))};if(r.musicKitReady){f(`ready`);return}let p=setTimeout(()=>f(`cap`),s),m=e(()=>r.musicKitReady,e=>{e&&(m(),clearTimeout(p),f(`ready`))})}export{f as startBootReveal};