function escapeHtml(t){const o=document.createElement("div");return o.textContent=t,o.innerHTML}function formatDuration(t){return t?`${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")}`:"--:--"}function formatTime(t){return!t||isNaN(t)?"0:00":`${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")}`}function formatDate(t){if(!t||isNaN(t))return"";const o=new Date-t,a=Math.floor(o/864e5);return 0===a?"Today":1===a?"Yesterday":a<7?`${a} days ago`:a<30?`${Math.floor(a/7)} weeks ago`:a<365?`${Math.floor(a/30)} months ago`:t.toLocaleDateString()}