// @requirements REQ-PRODUCT-CF-HOST REQ-PRODUCT-MOBILE REQ-PRODUCT-A11Y import {guideSections,siteSections,sectionForGuide,exampleSectionUrl,guideSectionUrl,starterPath} from './navigation.mjs'; const e=value=>String(value).replace(/[&<>"']/gu,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); const links=rows=>``; export function guideLanding(){return `

Documentation

Build one part
at a time

A site inventory, your legal wording and the controls you need. Start with the frontend; add retained records and a backend when you need them.

Your first integration

${starterPath()}

Continue by task

${siteSections.map(section=>`

${e(section.title)}

${e(section.description)}

${section.groups.slice(0,3).map(g=>e(g.title)).join(' · ')}

Explore this area
`).join('')}

Reference and verification

Look up coverage, source requirements and verification results separately from integration instructions.

Browse reference → All guides and reports →
`;} export function guideArea(section,entries){ const reports=entries.filter(entry=>entry.route.startsWith('/guide/verification/')&§ionForGuide(entry.route).id===section.id); const groups=section.groups??[{title:'Project reference',description:section.description,guides:section.guides.filter(g=>g.href!=='/guide/all')}]; const primary=new Set(groups.flatMap(g=>g.guides.map(guide=>guide.href))); const extra=entries.filter(entry=>!entry.route.startsWith('/guide/verification/')&§ionForGuide(entry.route).id===section.id&&!primary.has(entry.route)); return `

Integration area

${e(section.title)}

${e(section.description)}

${siteSections.includes(section)?`Browse working examples ↗`:''}
${groups.map((group,i)=>`
${String(i+1).padStart(2,'0')}

${e(group.title)}

${e(group.description)}

${links(group.guides)}
`).join('')}${extra.length?`

Further reading

${links(extra)}
`:''}${reports.length?`
Verification reports ${reports.length}${links(reports)}
`:''}
← All integration areasComplete index for this area →
`; } export function allGuidePages(entries){ const grouped=section=>entries.filter(entry=>entry.route!=='/guide'&§ionForGuide(entry.route).id===section.id); return `

Complete reference

All guides and reports

The full index follows the same task order as the guide overview. Verification reports are folded beneath their related area.

${guideSections.map(section=>{ const rows=grouped(section),reports=rows.filter(entry=>entry.route.startsWith('/guide/verification/')),remaining=new Map(rows.filter(entry=>!entry.route.startsWith('/guide/verification/')).map(entry=>[entry.route,entry])); const ordered=section.guides.flatMap(g=>{const entry=remaining.get(g.href);remaining.delete(g.href);return entry?[entry]:[]}); ordered.push(...[...remaining.values()].sort((a,b)=>a.title.localeCompare(b.title,'en'))); return `

${e(section.title)}

${links(ordered)}${reports.length?`
Verification reports ${reports.length}${links(reports)}
`:''}
`; }).join('')}`; }