/gi, '') .replace(//gi, '') .replace(/sonw+s*=s*["'][^"']*["']/gi, '') .replace(/javascript:/gi, '') return '
'+safe+'
' } // Plain text — escape and preserve line breaks return '
'+this.esc(content)+'
' }, ago(dateStr) { if(!dateStr) return '' const diff=Date.now()-new Date(dateStr).getTime(); const m=Math.floor(diff/60000) if(m<1) return 'just now'; if(m<60) return m+'m ago'; const h=Math.floor(m/60); if(h<24) return h+'h ago'; return Math.floor(h/24)+'d ago' }, } function canCreate(role) { return ['platform_owner','admin','creator'].includes(role) } App.init()