{ const target = event.target; if (target instanceof Node && !root?.contains(target) && !popover?.contains(target)) { keepOpen(); pinned = false; hoveredId = null; } }} on:keydown={(event) => { if (event.key === 'Escape') { pinned = false; hoveredId = null; } }} />
{ touchInteraction = e.pointerType === 'touch'; if (!(e.target as HTMLElement).closest('[data-file-comment-id],[data-cell]')) { keepOpen(); pinned = false; hoveredId = null; } }} on:click={(e) => reveal(e, touchInteraction || e.detail === 0)} > {#if loading}
{:else if pdf} (commentState = 'error')} /> {:else if ext === 'docx' && original} {:else if ext === 'pptx' && slides.length} {:else if workbook} {#if editingError}

{editingError}

{/if} (dirty = value)} onSave={save} /> {:else if previewError}

{$i18n.t('Preview failed')}

{/if} {#if unplaced.length || commentState === 'error' || commentState === 'partial'} {/if}
{#if hoveredId} {/if}