${unit.subject}
${unit.title.replace(/^Grade 3\s*/, '')}
${guides.length ? `${guides.length} teacher plan${guides.length === 1 ? '' : 's'}` : 'Teacher plan not identified'} · ${student.length} student resource${student.length === 1 ? '' : 's'}
${resources ? `${resources}
` : 'Open the original archive source for supporting materials.
'}Core Knowledge source ↗`;
}).join('');
}
async function loadLibrary() {
try {
const response = await fetch('/api/catalog', { cache: 'no-store' });
if (!response.ok) throw new Error('catalog unavailable');
const catalog = await response.json();
units = catalog.units;
document.querySelector('#unit-count').textContent = catalog.unit_count;
document.querySelector('#guide-count').textContent = catalog.teacher_guide_count;
document.querySelector('#student-count').textContent = catalog.student_material_count;
renderFilters();
renderUnits();
} catch {
status.textContent = 'The local catalog could not load. Start the private Grade 3 demo server.';
}
}
loadLibrary();