export function timePassed({current:e,duration:i,showAfter:t=null}){if(0===t)return!0;if(null===t||!i)return!1;if(e===t)return!0;let n=e/i*100;return 99.9<n&&(n=100),n>=t}export function lightOrDark(e){if(!e)return;let i,t,n,o;if(e.match(/^rgb/)){const o=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);i=o[1],t=o[2],n=o[3]}else{const o=+("0x"+e.slice(1).replace(e.length<5&&/./g,"$&$&"));i=o>>16,t=o>>8&255,n=255&o}return o=Math.sqrt(i*i*.299+t*t*.587+n*n*.114),o>127.5?"light":"dark"}export function timeToSeconds(e){let i,t=e.split(":");return t.length>1&&(i=60*parseInt(t[0])),parseInt(t[1])+parseInt(i)}export function getMobileOperatingSystem(){var e=navigator.userAgent||navigator.vendor;return/windows phone/i.test(e)?"Windows Phone":/android/i.test(e)?"Android":"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1||/(iPad|iPhone|iPod)/gi.test(navigator.platform)?"iOS":"unknown"}export function isIOS(){return"iOS"===getMobileOperatingSystem()}export function isMobile(){return"unknown"!==getMobileOperatingSystem()}export function isiOSYoutubeFullscreen(e){var i,t;return isIOS()&&"youtube"===e.provider&&!(null===(t=null===(i=null==e?void 0:e.config)||void 0===i?void 0:i.blockAttributes)||void 0===t?void 0:t.playsinline)}export function isWebView(){var e=window.navigator.standalone,i=window.navigator.userAgent.toLowerCase(),t=/safari/.test(i);return/iphone|ipod|ipad/.test(i)?!(!e&&t)&&(!e&&!t||void 0):!!i.includes("wv")}export function isAndroidWebView(){return!("Android"!==getMobileOperatingSystem()||!isWebView())}export function parseColor(e){var i=e.match(/^rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)$/i);return i?[i[1],i[2],i[3],"1"]:(i=e.match(/^rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*((0.)?\d+)\s*\)$/i))?[i[1],i[2],i[3],i[4]]:void 0}export function exitFullScreen(e){var i,t,n,o,r;if(isMobile()&&!(null===(t=null===(i=null==e?void 0:e.config)||void 0===i?void 0:i.blockAttributes)||void 0===t?void 0:t.playsInline)&&("function"==typeof(null===(n=null==e?void 0:e.media)||void 0===n?void 0:n.webkitExitFullScreen)&&(null==e||e.media.webkitExitFullScreen()),"function"==typeof(null===(o=null==e?void 0:e.embed)||void 0===o?void 0:o.exitFullscreen)&&(null===(r=null==e?void 0:e.embed)||void 0===r||r.exitFullscreen()),"youtube"===e.provider)){const i=e.currentTime;e.currentTime=e.duration,e.once("playing",()=>{e.currentTime=i})}}