// @ts-nocheck

function getCdn($url) {
    if (!$url) return $url;
    if (typeof $url !== 'string') return $url;
    if ($url.startsWith('blob')) return $url;
    if ($url.startsWith('http')) return $url;

    let cleaned = $url.replace(/\/+/g, '/');
    cleaned = cleaned.replace(/^\/+/, '');

    return 'https://cdn.teeinblue.com/' + cleaned;
}

function isHttpUrl(url) {
    const regex = /^https?:\/\/[^\s/$.?#].[^\s]*$/i;
    return regex.test(url);
}

export {
    getCdn,
    isHttpUrl,
};
