{#each Object.entries(tabLabels) as [tab, label]}
{@const enabled =
tab === 'elevation' ? hasElevation :
tab === 'slope' ? hasSlope :
tab === 'speed' ? hasSpeed :
tab === 'hr' ? hasHR :
tab === 'cadence' ? hasCadence :
hasPower}
{#if hasDistance && chartType === 'line' && activeTab !== 'slope'}
X:
{#each (['time', 'distance'] as XMode[]) as mode}
{/each}
{/if}
{#if chartType === 'line' && activeTab !== 'slope'}
{#each (['raw', '10s', '20s'] as SmoothMode[]) as sm}
{/each}
{/if}
{#if activeTab !== 'slope'}
{#each (['line', 'histogram'] as ChartType[]) as type}
{/each}
{/if}