{#if show_share_button && value !== null && value.length > 0}
{/if}
{#if value !== null && value.length > 0} {@const groupedMessages = groupMessages(value)} {#each groupedMessages as messages, i} {#if messages.length} {@const role = messages[0].role === "user" ? 'user' : 'bot'} {@const avatar_img = avatar_images[role === "user" ? 0 : 1]}
{#if avatar_img}
{/if}
handle_select(i, messages[0])} on:keydown={(e) => { if (e.key === "Enter") { handle_select(i, messages[0]); } }} dir={rtl ? "rtl" : "ltr"} > {#each messages as message, thought_index} {#if !isFileMessage(message)}
0}> {#if message.thought_metadata.tool_name}
{:else if message.thought_metadata.error}
{:else}
{/if}
{:else} {#if message.file.mime_type?.includes("audio")}
{:else if message !== null && message.file?.mime_type?.includes("video")}
{:else if message !== null && message.file?.mime_type?.includes("image")}
{:else if message !== null && message.file?.url !== null}
{message.file?.orig_name || message.file?.path}
{/if} {/if} {/each}
{/if} {/each} {#if pending_message}
{/if} {:else if placeholder !== null}
{/if}