{#snippet heroActions()}
{#if zoomActive} {/if}
{#each rangePresets as preset (preset.label)} {/each}
{/snippet} {#if loadError}
Failed to load weather data: {loadError}
{/if}
{#if fetchedData}
{#each chartDefs as def, i (i)}

{def.title}

{#if def.subtitle}

{def.subtitle}

{/if}
{/each}
{:else}
v !== 'weather_code').length || 1} chartHeight={340} bleed={false} />
{/if}
{#if fetchedData && !loading} } models={params.models || []} sunrise={fetchedData.sunrise} sunset={fetchedData.sunset} timezone={fetchedData.timezone} /> {/if}
{#snippet controls()}
{/snippet}

{m.compare_models_heading()}

{#if params.models && params.models.length > 0}
{params.models?.length || 0} / {models.flat().length}
{/if}
{#each models as group, i (i)}
{#each group as item (item.value)} {@const { value, label } = item as { value: string; label: string }}
{ if (params.models?.includes(value)) { params.models = params.models.filter((item) => { return item !== value; }); } else if (params.models) { params.models = [...params.models, value]; } }} />
{/each}
{/each}

{m.compare_variables_heading()}

{#if params.hourly && params.hourly.length > 0}
{params.hourly?.length || 0} / {hourly.flat().length}
{/if}
{#each hourly as group, i (i)}
{#each group as { value, label } (value)}
{ if (params.hourly?.includes(value)) { params.hourly = params.hourly.filter((item) => { return item !== value; }); } else if (params.hourly) { params.hourly = [...params.hourly, value]; } }} />
{/each}
{/each}