{#each entries as entry, index} {@const address = entry.address} {@const expanded = toc.expandedMap.get(address) ?? false} {@const isLeaf = toc.leaves.has(address)} {@const isVisible = isEntryVisible(address)} {#if isLeaf} handleSectionClick(address)} > {:else} {@const childDepth = depth + 1} expanded, (open) => setEntryExpanded(address, open)} > {/if} {/each}