{#if !loaded} {:else} {#if loadError}
{loadError}
{/if} {#if showForm}
{t('providers.type')}
{#if !editing} {:else}

{form.type}

{/if}
form.icon = v} /> nameManuallyEdited = true} required class="flex-1 px-3 py-2 border border-[var(--color-border)] rounded-md text-sm bg-[var(--color-background)]" />
{#if descriptor?.hasUrl}
{/if} {#each descriptor?.configFields ?? [] as field (field.key)}
{#if field.type === 'grid-select' && field.gridItems} {:else if field.type === 'number'} {:else if field.type === 'toggle'} {:else} {/if} {#if field.hint}

{t(field.hint)}

{/if}
{/each} {#if descriptor?.webhookUrlPattern && editing} {@const editingWebhookUrl = buildWebhookUrl(descriptor.webhookUrlPattern, providers.find(p => p.id === editing)?.webhook_token ?? '')}
{t('providers.webhookUrl')}

{t('providers.webhookUrlHint')}

{/if}
{/if} {#if !showForm && allProviders.length > 0}
{/if} {#if allProviders.length === 0 && !showForm} {:else if providers.length === 0 && !showForm} {:else}
{#each providers as provider} {@const provDesc = getDescriptor(provider.type)}

{provider.name}

{provider.type}
{#if provider.config?.url} {provider.config.url} {:else if provider.config?.host}

{provider.config.host}:{provider.config.port || 3493}

{/if} {#if provDesc?.webhookUrlPattern} {@const webhookUrl = buildWebhookUrl(provDesc.webhookUrlPattern, provider.webhook_token)}

{t('providers.webhookUrl')}:

{/if}
edit(provider)} /> startDelete(provider)} variant="danger" />
{#if provDesc?.payloadHistory && !showForm} {/if}
{/each}
{/if} {/if} confirmDelete = null} /> blockedBy = null} />