{#if lang === 'mermaid'} {#if mermaidHtml}
{:else}
{code}
{/if} {:else}
{lang}
{collapsed ? $i18n.t('Expand') : $i18n.t('Collapse')}
{#if ($config?.features?.enable_code_execution ?? true) && (lang.toLowerCase() === 'python' || lang.toLowerCase() === 'py' || (lang === '' && checkPythonCode(code)))} {#if executing}
Running
{:else if run}
{ code = _code; await tick(); executePython(code); }} >
{$i18n.t('Run')}
{/if} {/if} {#if save}
{saved ? $i18n.t('Saved') : $i18n.t('Save')}
{/if}
{copied ? $i18n.t('Copied') : $i18n.t('Copy')}
{#if !collapsed}
{ saveCode(); }} onChange={(value) => { _code = value; }} /> {:else}
{$i18n.t('{{COUNT}} hidden lines', { COUNT: code.split('\n').length })}
{/if}
{#if !collapsed}
{#if executing || stdout || stderr || result || files}
{#if executing}
STDOUT/STDERR
Running...
{:else} {#if stdout || stderr}
STDOUT/STDERR
{stdout || stderr}
{/if} {#if result || files}
RESULT
{#if result}
{`${JSON.stringify(result)}`}
{/if} {#if files}
{#each files as file} {#if file.type.startsWith('image')}
{/if} {/each}
{/if}
{/if} {/if}
{/if} {/if} {/if}