{#if codes.length === 0}
A あ Я
{t('locales.empty')}
{:else}
{#each codes as code, i (code)} {@const m = meta(code)} {@const isPrimary = i === 0} {@const isShipped = SHIPPED.has(code)}
onDragStart(e, code)} ondragover={(e) => onDragOver(e, code)} ondrop={(e) => onDrop(e, code)} ondragend={onDragEnd} >
{m.native}
{m.name}
·
{code}
{#if isPrimary}
{t('locales.primary')}
{/if} {#if isShipped}
{t('locales.shipped')}
{/if}
{#if !isPrimary}
makePrimary(code)} aria-label={t('locales.makePrimary')} title={t('locales.makePrimary')} >
{/if}
moveUp(code)} disabled={i === 0} aria-label={t('locales.moveUp')} title={t('locales.moveUp')} >
moveDown(code)} disabled={i === codes.length - 1} aria-label={t('locales.moveDown')} title={t('locales.moveDown')} >
remove(code)} disabled={codes.length <= 1} aria-label={t('locales.remove')} title={codes.length <= 1 ? t('locales.removeLast') : t('locales.remove')} >
{/each}
{/if}
{#if !addOpen}
{t('locales.add')}
{:else}
setTimeout(() => { if (addOpen && !addQuery) closeAdd(); }, 150)} placeholder={t('locales.searchPlaceholder')} class="ls-add-input" autocomplete="off" spellcheck="false" type="text" />
{#each suggestions as s, i (s.code)}
highlightIdx = i} onmousedown={(e) => { e.preventDefault(); addCode(s.code); }} >
{s.native}
{s.name}
{s.code}
{#if SHIPPED.has(s.code)}
{/if}
{/each} {#if canAddCustom}
highlightIdx = suggestions.length} onmousedown={(e) => { e.preventDefault(); addCode(addQuery); }} >
{t('locales.addCustom')}
{addQuery.trim().toLowerCase()}
{/if} {#if suggestions.length === 0 && !canAddCustom}
{t('locales.noSuggestions')}
{/if}
{/if}
{t('locales.orderHint')}