'use client'
/**
 * Validates that an externally-sourced image URL is safe to render as an
 * `<img src>`. Token icon URLs come from the MoonPay currencies API response,
 * so they are treated as untrusted input: only absolute HTTPS URLs are allowed,
 * which rules out `javascript:`, `data:`, and other non-network schemes.
 */
const isTrustedImageUrl = (url) => {
    if (!url) {
        return false;
    }
    try {
        return new URL(url).protocol === 'https:';
    }
    catch (_a) {
        return false;
    }
};

export { isTrustedImageUrl };
