import { siteConfig } from './site.config.js'; function httpsUrl(value, fallback) { try { const url = new URL(value); return url.protocol === 'https:' ? url.href : fallback; } catch { return fallback; } } export function configurePublicLinks() { const sourceUrl = httpsUrl(siteConfig.sourceUrl, 'https://branchwell.ai/pulsecanvas/app'); const newsletterUrl = httpsUrl(siteConfig.newsletterUrl, '/download/'); document.querySelectorAll('[data-source]').forEach(link => { link.href = sourceUrl; }); document.querySelectorAll('[data-newsletter]').forEach(link => { link.href = newsletterUrl; }); }