{#if rest.href !== undefined} {@render children?.()} {:else} {@const attrs = rest as HTMLButtonAttributes} (loading ? e.preventDefault() : attrs.onclick?.(e))} onkeydown={(e) => { // Holding Enter repeats clicks natively: one press, one action (no double submit). if (e.key === 'Enter' && e.repeat) e.preventDefault(); attrs.onkeydown?.(e); }} > {@render children?.()} {#if loading}{/if} {/if}