{t('stats_title', lang)} - Bocken

{t('stats_title', lang)}

{stats.totalWorkouts ?? 0}
{(stats.totalWorkouts ?? 0) === 1 ? t('workout_singular', lang) : t('workouts_plural', lang)}
{stats.totalTonnage ?? 0}t
{t('lifted', lang)}
{#if stats.kcalEstimate}
~{stats.kcalEstimate.kcal.toLocaleString()}kcal
{t('burned', lang)}
{#if !hasDemographics}
{t('kcal_set_profile', lang)} {t('measure_title', lang)}
{/if}
{/if}
{stats.totalCardioKm ?? 0}km
{t('covered', lang)}
{#if goalEditing}
{ if (e.key === 'Escape') goalEditing = false; }} role="dialog" tabindex="-1">
goalEditing = false} onkeydown={(e) => { if (e.key === 'Escape') goalEditing = false; }} role="presentation">

{t('weekly_goal', lang)}

{goalInput}
{t('workouts_per_week_goal', lang)}
{/if}
{#if (stats.workoutsChart?.data?.length ?? 0) > 0} {:else}

{t('no_workout_data', lang)}

{/if}
{#if (stats.weightChart?.data?.length ?? 0) > 1} {/if}
{#if ns}
{#if ns.avgProteinPerKg != null}
{ns.avgProteinPerKg.toFixed(1)}{t('protein_per_kg_unit', lang)}
{:else}
{/if}
{t('protein_per_kg', lang)}
{#if ns.avgProteinPerKg != null} {t('seven_day_avg', lang)} {:else if !ns.trendWeight} {t('no_weight_data', lang)} {:else} {t('no_nutrition_data', lang)} {/if}
0} class:deficit={ns.avgCalorieBalance < 0}>
{#if ns.avgCalorieBalance != null}
0} class:negative={ns.avgCalorieBalance < 0}> {ns.avgCalorieBalance > 0 ? '+' : ''}{ns.avgCalorieBalance}{t('calorie_balance_unit', lang)}
{:else}
{/if}
{t('calorie_balance', lang)} {#if showBalanceInfo}
{lang === 'en' ? 'Average daily calories eaten minus your calorie goal over the last 7 days. Negative = deficit, positive = surplus.' : 'Durchschnittlich gegessene Kalorien minus dein Kalorienziel der letzten 7 Tage. Negativ = Defizit, positiv = Überschuss.'}
{/if}
{#if ns.avgCalorieBalance != null} {t('seven_day_avg', lang)} {:else} {t('no_calorie_goal', lang)} {/if}
{#if ns.adherencePercent != null}
{ns.adherencePercent}%
{:else}
{/if}
{t('diet_adherence', lang)} {#if showAdherenceInfo}
{lang === 'en' ? 'Percentage of days where calories eaten were within ±10% of your goal. Days without tracking count as misses.' : 'Prozent der Tage, an denen die gegessenen Kalorien innerhalb von ±10 % deines Ziels lagen. Nicht erfasste Tage zählen als verfehlt.'}
{/if}
{#if ns.adherencePercent != null} {t('since_start', lang)} ({ns.adherenceDays} {t('days', lang)}) {:else} {t('no_calorie_goal', lang)} {/if}
{#if ns.macroSplit}
{t('macro_split', lang)} ({t('seven_day_avg', lang)})
{#each [ { pct: ns.macroSplit.protein, target: ns.macroTargets?.protein, label: t('protein', lang), cls: 'ring-protein', fill: '#a3be8c' }, { pct: ns.macroSplit.fat, target: ns.macroTargets?.fat, label: t('fat', lang), cls: 'ring-fat', fill: '#d08770' }, { pct: ns.macroSplit.carbs, target: ns.macroTargets?.carbs, label: t('carbs', lang), cls: 'ring-carbs', fill: '#81a1c1' }, ] as macro (macro.cls)}
{#if macro.target != null} {@const pos = targetMarkerPos(macro.target)} {macro.target}% {/if} {macro.pct}% {macro.label}
{/each}
{lang === 'en' ? 'Actual' : 'Ist'} {lang === 'en' ? 'Target' : 'Ziel'}
{/if} {/if}

{t('muscle_balance', lang)}