{#if baseUrl && apiKey && filePath}
{#if kernelError}
{kernelError}
{/if}
{/if}
{#each cells as cell, i}
{#if cell.cell_type === 'markdown'}
{#if editingCell[i]}
{:else}
startEditing(i)}
>
{@html renderMarkdown(toStr(cell.source))}
{/if}
{:else if cell.cell_type === 'code'}
{#if runningCell === i}
{:else if baseUrl && apiKey && filePath}
{/if}
{#if cell.execution_count !== undefined && cell.execution_count !== null}
[{cell.execution_count}]
{:else}
[ ]
{/if}
{#if editingCell[i]}
{
editedSources[i] = e.detail;
}}
on:run={() => runCell(i)}
on:cancel={() => cancelEditing(i)}
/>
{:else}
startEditing(i)}
>
{#if highlightedCells[i]}
{@html highlightedCells[i]}
{:else}
{toStr(cell.source)}
{/if}
{/if}
{#if cell.outputs && cell.outputs.length > 0}
{#each cell.outputs as output}
{#if output.output_type === 'error'}
{stripAnsi(
(output.traceback ?? []).join('\n') || `${output.ename}: ${output.evalue}`
)}
{:else}
{@const html = getOutputHtml(output)}
{@const images = getOutputImages(output)}
{@const text = getOutputText(output)}
{#if html}
{@html html}
{/if}
{#each images as src}
![Output]()
{/each}
{#if text}
{text}
{/if}
{/if}
{/each}
{/if}
{:else if cell.cell_type === 'raw'}
{toStr(cell.source)}
{/if}
{/each}