{#each fields as field (field.key)}
{#if field.type === SettingsFieldType.INPUT} {@const currentValue = String(localConfig[field.key] ?? '')} {@const serverDefault = currentModelParams[field.key]} {@const isCustomRealTime = (() => { if (serverDefault == null) return false; if (currentValue === '') return false; const numericInput = parseFloat(currentValue); const normalizedInput = !isNaN(numericInput) ? Math.round(numericInput * 1000000) / 1000000 : currentValue; const normalizedDefault = typeof serverDefault === 'number' ? Math.round(serverDefault * 1000000) / 1000000 : serverDefault; return normalizedInput !== normalizedDefault; })()}
{#if isCustomRealTime} {/if}
{ // Update local config immediately for real-time badge feedback onConfigChange(field.key, e.currentTarget.value); }} placeholder={currentModelParams[field.key] != null ? `Default: ${normalizeFloatingPoint(currentModelParams[field.key])}` : ''} class="w-full {isCustomRealTime ? 'pr-8' : ''}" /> {#if isCustomRealTime} {/if}
{#if field.help || SETTING_CONFIG_INFO[field.key]}

{@html field.help || SETTING_CONFIG_INFO[field.key]}

{/if} {:else if field.type === SettingsFieldType.TEXTAREA} {#if field.label} {/if}