{#if $selectedTask}
{:else} {#if loading}

{$t.migration?.loading_envs }

{:else if error}
{error}
{/if}

{$t.migration?.select_dashboards_title }

{#if sourceEnvId} {:else}

{$t.dashboard?.select_source || "Select a source environment to view dashboards."}

{/if}
{ console.info("[MigrationOptionsSection][REASON] Database replacement toggled", { replaceDb }); if (replaceDb && sourceDatabases.length === 0) fetchDatabases(); }} class="h-4 w-4 text-indigo-600 focus:ring-indigo-500 border-gray-300 rounded" />
{#if replaceDb}

{$t.migration?.database_mappings }

{#if fetchingDbs}

{$t.migration?.loading_dbs || "Loading databases and suggestions..."}

{:else if sourceDatabases.length > 0} {:else if sourceEnvId && targetEnvId} {/if}
{/if}
{#if dryRunResult}

Pre-flight Diff

Dashboards
create: {dryRunResult.summary.dashboards.create}
update: {dryRunResult.summary.dashboards.update}
delete: {dryRunResult.summary.dashboards.delete}
Charts
create: {dryRunResult.summary.charts.create}
update: {dryRunResult.summary.charts.update}
delete: {dryRunResult.summary.charts.delete}
Datasets
create: {dryRunResult.summary.datasets.create}
update: {dryRunResult.summary.datasets.update}
delete: {dryRunResult.summary.datasets.delete}
Risk
score: {dryRunResult.risk.score}, level: {dryRunResult.risk.level}
issues: {dryRunResult.risk.items.length}
Diff JSON
{JSON.stringify(dryRunResult, null, 2)}
{/if} {/if}
{ console.info("[MigrationModals][REASON] Closing log viewer"); showLogViewer = false; }} /> { console.info("[MigrationModals][REASON] User cancelled password prompt"); showPasswordPrompt = false; }} />