atagen

malice

public
Star0
Watch0
d8624c214c044f548c0a9b7cbcae6d081c88cca8
2
ssh://brewery@pls.lobotomise.me:33/atagen/malice.git

Blame: web/src/lib/MessageRow.svelte

973f8fbdaf80atagen2026-09-28 09:10 UTC1
<script lang="ts">
973f8fbdaf80atagen2026-09-28 09:10 UTC2
  import MediaAttachmentView from './MediaAttachmentView.svelte';
973f8fbdaf80atagen2026-09-28 09:10 UTC3
  import MxcAvatar from './MxcAvatar.svelte';
544a170ead2catagen2026-10-20 11:47 UTC4
  import Emoji from './Emoji.svelte';
544a170ead2catagen2026-10-20 11:47 UTC5
  import EmojiText from './EmojiText.svelte';
df3c0f2b3da4atagen2026-10-22 13:07 UTC6
  import MessageText from './MessageText.svelte';
544a170ead2catagen2026-10-20 11:47 UTC7
  import ReactionPicker from './ReactionPicker.svelte';
b8ab00377c20atagen2026-10-22 05:13 UTC8
  import LinkCard from './LinkCard.svelte';
ecb8598b38afatagen2026-10-22 09:19 UTC9
  import { mediaUrl, messageMediaUrl } from './api';
df3c0f2b3da4atagen2026-10-22 13:07 UTC10
  import type { ImagePack, LinkPreview, Person, QuickReaction, ReplyReference, SendState, TimelineContent, TimelineEvent } from './types';
973f8fbdaf80atagen2026-09-28 09:10 UTC11
  import { senderLabel } from './types';
973f8fbdaf80atagen2026-09-28 09:10 UTC12
  import { formatClock, formatDay, initialsOf, senderHue } from './format';
973f8fbdaf80atagen2026-09-28 09:10 UTC13
  import { findUrls } from './urls';
787cdbbf0721atagen2026-10-24 06:50 UTC14
  import { mentionsFromHtml, resolveMentions, stripMarkdownPills } from './mentions';
973f8fbdaf80atagen2026-09-28 09:10 UTC15
973f8fbdaf80atagen2026-09-28 09:10 UTC16
  export let itemId: string;
973f8fbdaf80atagen2026-09-28 09:10 UTC17
  export let event: TimelineEvent;
973f8fbdaf80atagen2026-09-28 09:10 UTC18
  export let showSender: boolean;
973f8fbdaf80atagen2026-09-28 09:10 UTC19
  export let reacting: boolean;
ecb8598b38afatagen2026-10-22 09:19 UTC20
  export let onReact: (eventId: string, key: string, shortcode?: string) => void;
973f8fbdaf80atagen2026-09-28 09:10 UTC21
  export let senderAvatar: string | null = null;
544a170ead2catagen2026-10-20 11:47 UTC22
  export let quickReactions: QuickReaction[] = [];
544a170ead2catagen2026-10-20 11:47 UTC23
  export let packs: ImagePack[] = [];
544a170ead2catagen2026-10-20 11:47 UTC24
  export let onQuickChange: (list: QuickReaction[]) => void = () => {};
ecb8598b38afatagen2026-10-22 09:19 UTC25
  export let linkPreviews: Record<string, LinkPreview | null> = {};
ecb8598b38afatagen2026-10-22 09:19 UTC26
  export let loadPreview: ((url: string) => void) | null = null;
df3c0f2b3da4atagen2026-10-22 13:07 UTC27
  export let people: Record<string, Person> = {};
df3c0f2b3da4atagen2026-10-22 13:07 UTC28
  export let onReply: ((target: ReplyReference) => void) | null = null;
df3c0f2b3da4atagen2026-10-22 13:07 UTC29
  export let onJump: ((eventId: string) => void) | null = null;
cf23dbf4e77catagen2026-10-23 06:36 UTC30
  export let onEdit: ((eventId: string, body: string) => void) | null = null;
cf23dbf4e77catagen2026-10-23 06:36 UTC31
  export let editing = false;
df3c0f2b3da4atagen2026-10-22 13:07 UTC32
  export let showSent = true;
705b1e1062c2atagen2026-10-23 09:05 UTC33
  export let self: string | null = null;
d8624c214c04atagen2026-10-24 08:24 UTC34
  export let onUser: ((userId: string, x: number, y: number, menu: boolean) => void) | null = null;
d8624c214c04atagen2026-10-24 08:24 UTC35
d8624c214c04atagen2026-10-24 08:24 UTC36
  function openUser(ev: MouseEvent, menu: boolean): void {
d8624c214c04atagen2026-10-24 08:24 UTC37
    if (!onUser) return;
d8624c214c04atagen2026-10-24 08:24 UTC38
    const rect = (ev.currentTarget as HTMLElement).getBoundingClientRect();
d8624c214c04atagen2026-10-24 08:24 UTC39
    onUser(event.sender.user_id, menu ? ev.clientX : rect.left, menu ? ev.clientY : rect.bottom + 4, menu);
d8624c214c04atagen2026-10-24 08:24 UTC40
  }
973f8fbdaf80atagen2026-09-28 09:10 UTC41
544a170ead2catagen2026-10-20 11:47 UTC42
  const PICKER_WIDTH = 320;
544a170ead2catagen2026-10-20 11:47 UTC43
  const PICKER_HEIGHT = 380;
544a170ead2catagen2026-10-20 11:47 UTC44
  const PICKER_MARGIN = 8;
df3c0f2b3da4atagen2026-10-22 13:07 UTC45
  const MAX_READERS = 3;
544a170ead2catagen2026-10-20 11:47 UTC46
544a170ead2catagen2026-10-20 11:47 UTC47
  let row: HTMLDivElement;
544a170ead2catagen2026-10-20 11:47 UTC48
  let pickerPop: HTMLDivElement | undefined;
544a170ead2catagen2026-10-20 11:47 UTC49
  let selected = false;
544a170ead2catagen2026-10-20 11:47 UTC50
  let pickerOpen = false;
544a170ead2catagen2026-10-20 11:47 UTC51
  let pickerStyle = '';
973f8fbdaf80atagen2026-09-28 09:10 UTC52
973f8fbdaf80atagen2026-09-28 09:10 UTC53
  const MEMBERSHIP_LABELS: Record<string, string> = {
973f8fbdaf80atagen2026-09-28 09:10 UTC54
    Joined: 'joined the room',
973f8fbdaf80atagen2026-09-28 09:10 UTC55
    Left: 'left the room',
973f8fbdaf80atagen2026-09-28 09:10 UTC56
    Banned: 'was banned',
973f8fbdaf80atagen2026-09-28 09:10 UTC57
    Unbanned: 'was unbanned',
973f8fbdaf80atagen2026-09-28 09:10 UTC58
    Kicked: 'was kicked',
973f8fbdaf80atagen2026-09-28 09:10 UTC59
    KickedAndBanned: 'was kicked and banned',
973f8fbdaf80atagen2026-09-28 09:10 UTC60
    Invited: 'was invited',
973f8fbdaf80atagen2026-09-28 09:10 UTC61
    InvitationAccepted: 'accepted the invite',
973f8fbdaf80atagen2026-09-28 09:10 UTC62
    InvitationRejected: 'rejected the invite',
973f8fbdaf80atagen2026-09-28 09:10 UTC63
    InvitationRevoked: 'had the invite revoked',
973f8fbdaf80atagen2026-09-28 09:10 UTC64
    Knocked: 'requested to join',
973f8fbdaf80atagen2026-09-28 09:10 UTC65
    KnockAccepted: 'was let in',
973f8fbdaf80atagen2026-09-28 09:10 UTC66
    KnockRetracted: 'withdrew the request to join',
973f8fbdaf80atagen2026-09-28 09:10 UTC67
    KnockDenied: 'had the request to join denied'
973f8fbdaf80atagen2026-09-28 09:10 UTC68
  };
973f8fbdaf80atagen2026-09-28 09:10 UTC69
973f8fbdaf80atagen2026-09-28 09:10 UTC70
  $: name = senderLabel(event.sender);
973f8fbdaf80atagen2026-09-28 09:10 UTC71
  $: displayName = event.sender.name_ambiguous ? `${name} (${event.sender.user_id})` : name;
df3c0f2b3da4atagen2026-10-22 13:07 UTC72
  $: readers = event.read_by.map((id) => people[id] ?? { user_id: id, name: id, avatar: null });
973f8fbdaf80atagen2026-09-28 09:10 UTC73
  $: interactive = event.content.kind === 'Message' || event.content.kind === 'Sticker' || event.content.kind === 'Poll';
705b1e1062c2atagen2026-10-23 09:05 UTC74
  $: message = event.content.kind === 'Message' ? event.content.message : null;
705b1e1062c2atagen2026-10-23 09:05 UTC75
  $: stripped = stripMarkdownPills(message ? (message.media ? message.media.caption : message.body) ?? '' : '');
787cdbbf0721atagen2026-10-24 06:50 UTC76
  $: linked = message ? [...mentionsFromHtml(message.formatted_body), ...stripped.mentions] : [];
787cdbbf0721atagen2026-10-24 06:50 UTC77
  $: mentions = resolveMentions(stripped.text, linked);
787cdbbf0721atagen2026-10-24 06:50 UTC78
  $: mentionsMe = self !== null && [...linked, ...mentions].some((m) => m.user_id === self);
705b1e1062c2atagen2026-10-23 09:05 UTC79
  $: previews = findUrls(stripped.text);
705b1e1062c2atagen2026-10-23 09:05 UTC80
  $: bundled = message ? message.link_previews : [];
705b1e1062c2atagen2026-10-23 09:05 UTC81
  $: cards = previews
705b1e1062c2atagen2026-10-23 09:05 UTC82
    .map((link) => ({ link, preview: bundled.find((b) => b.url === link.href) ?? linkPreviews[link.href] ?? null }))
705b1e1062c2atagen2026-10-23 09:05 UTC83
    .filter((c) => c.preview && (c.preview.title || c.preview.description || c.preview.image));
ecb8598b38afatagen2026-10-22 09:19 UTC84
  $: if (loadPreview) {
ecb8598b38afatagen2026-10-22 09:19 UTC85
    for (const link of previews) {
ecb8598b38afatagen2026-10-22 09:19 UTC86
      if (!bundled.some((b) => b.url === link.href) && !(link.href in linkPreviews)) loadPreview(link.href);
ecb8598b38afatagen2026-10-22 09:19 UTC87
    }
ecb8598b38afatagen2026-10-22 09:19 UTC88
  }
973f8fbdaf80atagen2026-09-28 09:10 UTC89
973f8fbdaf80atagen2026-09-28 09:10 UTC90
  function sendLabel(state: SendState): string {
973f8fbdaf80atagen2026-09-28 09:10 UTC91
    if (state.kind === 'Failed') return state.will_retry ? 'failed — will retry' : 'failed — not delivered';
973f8fbdaf80atagen2026-09-28 09:10 UTC92
    if (state.kind === 'Sending') return 'sending…';
df3c0f2b3da4atagen2026-10-22 13:07 UTC93
    if (showSent && event.own && state.kind === 'Sent' && event.event_id) return '✓ sent';
973f8fbdaf80atagen2026-09-28 09:10 UTC94
    return '';
973f8fbdaf80atagen2026-09-28 09:10 UTC95
  }
973f8fbdaf80atagen2026-09-28 09:10 UTC96
544a170ead2catagen2026-10-20 11:47 UTC97
  function toggleSelected(e: MouseEvent) {
544a170ead2catagen2026-10-20 11:47 UTC98
    if (!interactive || (e.target as Element).closest('a, button, input, video, audio, .picker-pop')) return;
544a170ead2catagen2026-10-20 11:47 UTC99
    selected = !selected;
544a170ead2catagen2026-10-20 11:47 UTC100
  }
544a170ead2catagen2026-10-20 11:47 UTC101
544a170ead2catagen2026-10-20 11:47 UTC102
  function deselectOutside(e: PointerEvent) {
544a170ead2catagen2026-10-20 11:47 UTC103
    if (selected && !pickerOpen && !row.contains(e.target as Node)) selected = false;
544a170ead2catagen2026-10-20 11:47 UTC104
  }
544a170ead2catagen2026-10-20 11:47 UTC105
544a170ead2catagen2026-10-20 11:47 UTC106
  function openPicker(e: MouseEvent) {
544a170ead2catagen2026-10-20 11:47 UTC107
    if (pickerOpen) {
544a170ead2catagen2026-10-20 11:47 UTC108
      pickerOpen = false;
544a170ead2catagen2026-10-20 11:47 UTC109
      return;
544a170ead2catagen2026-10-20 11:47 UTC110
    }
544a170ead2catagen2026-10-20 11:47 UTC111
    const rect = (e.currentTarget as HTMLElement).getBoundingClientRect();
544a170ead2catagen2026-10-20 11:47 UTC112
    const height = Math.min(PICKER_HEIGHT, window.innerHeight - 2 * PICKER_MARGIN);
544a170ead2catagen2026-10-20 11:47 UTC113
    const below = window.innerHeight - rect.bottom - PICKER_MARGIN >= height;
544a170ead2catagen2026-10-20 11:47 UTC114
    const top = below ? rect.bottom + 4 : Math.max(PICKER_MARGIN, rect.top - height - 4);
544a170ead2catagen2026-10-20 11:47 UTC115
    const maxLeft = window.innerWidth - PICKER_WIDTH - PICKER_MARGIN;
544a170ead2catagen2026-10-20 11:47 UTC116
    const left = Math.max(PICKER_MARGIN, Math.min(rect.right - PICKER_WIDTH, maxLeft));
544a170ead2catagen2026-10-20 11:47 UTC117
    pickerStyle = `top:${top}px;left:${left}px;height:${height}px`;
544a170ead2catagen2026-10-20 11:47 UTC118
    selected = true;
544a170ead2catagen2026-10-20 11:47 UTC119
    pickerOpen = true;
544a170ead2catagen2026-10-20 11:47 UTC120
  }
544a170ead2catagen2026-10-20 11:47 UTC121
544a170ead2catagen2026-10-20 11:47 UTC122
  function closePicker() {
544a170ead2catagen2026-10-20 11:47 UTC123
    pickerOpen = false;
544a170ead2catagen2026-10-20 11:47 UTC124
  }
544a170ead2catagen2026-10-20 11:47 UTC125
ecb8598b38afatagen2026-10-22 09:19 UTC126
  function isImageKey(key: string): boolean {
ecb8598b38afatagen2026-10-22 09:19 UTC127
    return key.startsWith('mxc://') || packs.some((p) => p.images.some((i) => i.reaction_key === key));
ecb8598b38afatagen2026-10-22 09:19 UTC128
  }
ecb8598b38afatagen2026-10-22 09:19 UTC129
ecb8598b38afatagen2026-10-22 09:19 UTC130
  function react(key: string, shortcode: string | null) {
ecb8598b38afatagen2026-10-22 09:19 UTC131
    if (shortcode && isImageKey(key)) onReact(event.event_id ?? '', key, shortcode);
ecb8598b38afatagen2026-10-22 09:19 UTC132
    else onReact(event.event_id ?? '', key);
ecb8598b38afatagen2026-10-22 09:19 UTC133
  }
ecb8598b38afatagen2026-10-22 09:19 UTC134
df3c0f2b3da4atagen2026-10-22 13:07 UTC135
  function reply() {
df3c0f2b3da4atagen2026-10-22 13:07 UTC136
    if (!event.event_id || !onReply) return;
df3c0f2b3da4atagen2026-10-22 13:07 UTC137
    onReply({
df3c0f2b3da4atagen2026-10-22 13:07 UTC138
      event_id: event.event_id,
df3c0f2b3da4atagen2026-10-22 13:07 UTC139
      details: { kind: 'Ready', sender: event.sender, content: event.content, timestamp_ms: event.timestamp_ms }
df3c0f2b3da4atagen2026-10-22 13:07 UTC140
    });
df3c0f2b3da4atagen2026-10-22 13:07 UTC141
  }
df3c0f2b3da4atagen2026-10-22 13:07 UTC142
cf23dbf4e77catagen2026-10-23 06:36 UTC143
  $: editableBody =
cf23dbf4e77catagen2026-10-23 06:36 UTC144
    event.own && event.editable && event.event_id && event.content.kind === 'Message' && event.content.message.kind === 'Text'
cf23dbf4e77catagen2026-10-23 06:36 UTC145
      ? event.content.message.body
cf23dbf4e77catagen2026-10-23 06:36 UTC146
      : null;
cf23dbf4e77catagen2026-10-23 06:36 UTC147
cf23dbf4e77catagen2026-10-23 06:36 UTC148
  function edit() {
cf23dbf4e77catagen2026-10-23 06:36 UTC149
    if (!event.event_id || editableBody === null || !onEdit) return;
cf23dbf4e77catagen2026-10-23 06:36 UTC150
    onEdit(event.event_id, editableBody);
cf23dbf4e77catagen2026-10-23 06:36 UTC151
  }
cf23dbf4e77catagen2026-10-23 06:36 UTC152
cf23dbf4e77catagen2026-10-23 06:36 UTC153
  function reactorNames(senders: string[]): string {
cf23dbf4e77catagen2026-10-23 06:36 UTC154
    const names = senders.map((id) => people[id]?.name ?? id);
cf23dbf4e77catagen2026-10-23 06:36 UTC155
    if (names.length <= 12) return names.join(', ');
cf23dbf4e77catagen2026-10-23 06:36 UTC156
    return `${names.slice(0, 12).join(', ')} and ${names.length - 12} more`;
cf23dbf4e77catagen2026-10-23 06:36 UTC157
  }
cf23dbf4e77catagen2026-10-23 06:36 UTC158
ecb8598b38afatagen2026-10-22 09:19 UTC159
  function pick(key: string, shortcode: string | null) {
544a170ead2catagen2026-10-20 11:47 UTC160
    pickerOpen = false;
ecb8598b38afatagen2026-10-22 09:19 UTC161
    react(key, shortcode);
544a170ead2catagen2026-10-20 11:47 UTC162
  }
544a170ead2catagen2026-10-20 11:47 UTC163
544a170ead2catagen2026-10-20 11:47 UTC164
  function closeOnScroll(e: Event) {
544a170ead2catagen2026-10-20 11:47 UTC165
    if (pickerOpen && !pickerPop?.contains(e.target as Node)) pickerOpen = false;
544a170ead2catagen2026-10-20 11:47 UTC166
  }
544a170ead2catagen2026-10-20 11:47 UTC167
973f8fbdaf80atagen2026-09-28 09:10 UTC168
  function actorLabel(userId: string, name: string | null): string {
973f8fbdaf80atagen2026-09-28 09:10 UTC169
    return name ?? userId;
973f8fbdaf80atagen2026-09-28 09:10 UTC170
  }
973f8fbdaf80atagen2026-09-28 09:10 UTC171
973f8fbdaf80atagen2026-09-28 09:10 UTC172
  function replyPreview(content: TimelineContent): string {
705b1e1062c2atagen2026-10-23 09:05 UTC173
    if (content.kind === 'Message') return stripMarkdownPills(content.message.body).text;
973f8fbdaf80atagen2026-09-28 09:10 UTC174
    if (content.kind === 'Sticker') return content.body || 'Sticker';
973f8fbdaf80atagen2026-09-28 09:10 UTC175
    if (content.kind === 'Poll') return `Poll: ${content.question}`;
973f8fbdaf80atagen2026-09-28 09:10 UTC176
    if (content.kind === 'Redacted') return 'Message deleted';
973f8fbdaf80atagen2026-09-28 09:10 UTC177
    if (content.kind === 'UnableToDecrypt') return 'Unable to decrypt';
973f8fbdaf80atagen2026-09-28 09:10 UTC178
    return systemLine(content);
973f8fbdaf80atagen2026-09-28 09:10 UTC179
  }
973f8fbdaf80atagen2026-09-28 09:10 UTC180
973f8fbdaf80atagen2026-09-28 09:10 UTC181
  function systemLine(content: TimelineContent): string {
973f8fbdaf80atagen2026-09-28 09:10 UTC182
    switch (content.kind) {
973f8fbdaf80atagen2026-09-28 09:10 UTC183
      case 'Redacted':
973f8fbdaf80atagen2026-09-28 09:10 UTC184
        return 'Message deleted';
973f8fbdaf80atagen2026-09-28 09:10 UTC185
      case 'UnableToDecrypt':
973f8fbdaf80atagen2026-09-28 09:10 UTC186
        return `Message from ${displayName} could not be decrypted`;
973f8fbdaf80atagen2026-09-28 09:10 UTC187
      case 'Membership': {
973f8fbdaf80atagen2026-09-28 09:10 UTC188
        const who = actorLabel(content.user_id, content.display_name);
973f8fbdaf80atagen2026-09-28 09:10 UTC189
        return `${who} ${MEMBERSHIP_LABELS[content.change] ?? 'updated their membership'}`;
973f8fbdaf80atagen2026-09-28 09:10 UTC190
      }
973f8fbdaf80atagen2026-09-28 09:10 UTC191
      case 'Profile': {
973f8fbdaf80atagen2026-09-28 09:10 UTC192
        const who = actorLabel(content.user_id, null);
973f8fbdaf80atagen2026-09-28 09:10 UTC193
        const parts: string[] = [];
973f8fbdaf80atagen2026-09-28 09:10 UTC194
        if (content.display_name) {
973f8fbdaf80atagen2026-09-28 09:10 UTC195
          parts.push(
973f8fbdaf80atagen2026-09-28 09:10 UTC196
            content.display_name.new
973f8fbdaf80atagen2026-09-28 09:10 UTC197
              ? `changed their display name to "${content.display_name.new}"`
973f8fbdaf80atagen2026-09-28 09:10 UTC198
              : 'removed their display name'
973f8fbdaf80atagen2026-09-28 09:10 UTC199
          );
973f8fbdaf80atagen2026-09-28 09:10 UTC200
        }
973f8fbdaf80atagen2026-09-28 09:10 UTC201
        if (content.avatar) parts.push('changed their avatar');
973f8fbdaf80atagen2026-09-28 09:10 UTC202
        return `${who} ${parts.length > 0 ? parts.join(' and ') : 'updated their profile'}`;
973f8fbdaf80atagen2026-09-28 09:10 UTC203
      }
973f8fbdaf80atagen2026-09-28 09:10 UTC204
      case 'RoomName':
973f8fbdaf80atagen2026-09-28 09:10 UTC205
        return content.name
973f8fbdaf80atagen2026-09-28 09:10 UTC206
          ? `${displayName} changed the room name to "${content.name}"`
973f8fbdaf80atagen2026-09-28 09:10 UTC207
          : `${displayName} removed the room name`;
973f8fbdaf80atagen2026-09-28 09:10 UTC208
      case 'RoomTopic':
973f8fbdaf80atagen2026-09-28 09:10 UTC209
        return content.topic
973f8fbdaf80atagen2026-09-28 09:10 UTC210
          ? `${displayName} changed the topic to "${content.topic}"`
973f8fbdaf80atagen2026-09-28 09:10 UTC211
          : `${displayName} removed the topic`;
973f8fbdaf80atagen2026-09-28 09:10 UTC212
      case 'RoomAvatar':
973f8fbdaf80atagen2026-09-28 09:10 UTC213
        return content.avatar ? `${displayName} changed the room avatar` : `${displayName} removed the room avatar`;
973f8fbdaf80atagen2026-09-28 09:10 UTC214
      case 'EncryptionEnabled':
973f8fbdaf80atagen2026-09-28 09:10 UTC215
        return `${displayName} enabled encryption in this room`;
973f8fbdaf80atagen2026-09-28 09:10 UTC216
      case 'RoomCreated':
973f8fbdaf80atagen2026-09-28 09:10 UTC217
        return `${displayName} created the room`;
973f8fbdaf80atagen2026-09-28 09:10 UTC218
      case 'RoomUpgraded':
973f8fbdaf80atagen2026-09-28 09:10 UTC219
        return `${displayName} upgraded the room to a new version`;
973f8fbdaf80atagen2026-09-28 09:10 UTC220
      case 'OtherState':
973f8fbdaf80atagen2026-09-28 09:10 UTC221
        return `${displayName} sent a state event (${content.event_type})`;
973f8fbdaf80atagen2026-09-28 09:10 UTC222
      case 'Other':
973f8fbdaf80atagen2026-09-28 09:10 UTC223
        return `${displayName} sent an event (${content.event_type})`;
973f8fbdaf80atagen2026-09-28 09:10 UTC224
      default:
973f8fbdaf80atagen2026-09-28 09:10 UTC225
        return displayName;
973f8fbdaf80atagen2026-09-28 09:10 UTC226
    }
973f8fbdaf80atagen2026-09-28 09:10 UTC227
  }
973f8fbdaf80atagen2026-09-28 09:10 UTC228
</script>
973f8fbdaf80atagen2026-09-28 09:10 UTC229
544a170ead2catagen2026-10-20 11:47 UTC230
<svelte:window
544a170ead2catagen2026-10-20 11:47 UTC231
  on:pointerdown={deselectOutside}
544a170ead2catagen2026-10-20 11:47 UTC232
  on:keydown={(e) => e.key === 'Escape' && (selected = false)}
544a170ead2catagen2026-10-20 11:47 UTC233
  on:scroll|capture={closeOnScroll}
544a170ead2catagen2026-10-20 11:47 UTC234
  on:resize={closePicker}
544a170ead2catagen2026-10-20 11:47 UTC235
/>
544a170ead2catagen2026-10-20 11:47 UTC236
544a170ead2catagen2026-10-20 11:47 UTC237
<!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->
544a170ead2catagen2026-10-20 11:47 UTC238
<div
544a170ead2catagen2026-10-20 11:47 UTC239
  class="msg"
544a170ead2catagen2026-10-20 11:47 UTC240
  class:own={event.own}
cf23dbf4e77catagen2026-10-23 06:36 UTC241
  class:editing
705b1e1062c2atagen2026-10-23 09:05 UTC242
  class:mentioned={mentionsMe}
544a170ead2catagen2026-10-20 11:47 UTC243
  class:system={!interactive}
df3c0f2b3da4atagen2026-10-22 13:07 UTC244
  class:has-readers={interactive && readers.length > 0}
544a170ead2catagen2026-10-20 11:47 UTC245
  class:selected
544a170ead2catagen2026-10-20 11:47 UTC246
  data-item={itemId}
df3c0f2b3da4atagen2026-10-22 13:07 UTC247
  data-event={event.event_id}
544a170ead2catagen2026-10-20 11:47 UTC248
  bind:this={row}
544a170ead2catagen2026-10-20 11:47 UTC249
  on:click={toggleSelected}
544a170ead2catagen2026-10-20 11:47 UTC250
>
544a170ead2catagen2026-10-20 11:47 UTC251
  {#if interactive && event.event_id}
544a170ead2catagen2026-10-20 11:47 UTC252
    <div class="actions" role="toolbar" aria-label={`Actions for message from ${displayName}`}>
544a170ead2catagen2026-10-20 11:47 UTC253
      {#each quickReactions as r (r.key)}
544a170ead2catagen2026-10-20 11:47 UTC254
        {@const label = r.shortcode ? `:${r.shortcode}:` : r.key}
544a170ead2catagen2026-10-20 11:47 UTC255
        <button
544a170ead2catagen2026-10-20 11:47 UTC256
          type="button"
544a170ead2catagen2026-10-20 11:47 UTC257
          title={`React ${label}`}
544a170ead2catagen2026-10-20 11:47 UTC258
          aria-label={`React ${label} to message from ${displayName}`}
544a170ead2catagen2026-10-20 11:47 UTC259
          disabled={reacting}
ecb8598b38afatagen2026-10-22 09:19 UTC260
          on:click={() => react(r.key, r.shortcode)}
544a170ead2catagen2026-10-20 11:47 UTC261
        >
544a170ead2catagen2026-10-20 11:47 UTC262
          {#if r.key.startsWith('mxc://')}
544a170ead2catagen2026-10-20 11:47 UTC263
            <img class="emote" src={mediaUrl(r.key) ?? ''} alt="" />
544a170ead2catagen2026-10-20 11:47 UTC264
          {:else}
544a170ead2catagen2026-10-20 11:47 UTC265
            <Emoji emoji={r.key} size={18} />
544a170ead2catagen2026-10-20 11:47 UTC266
          {/if}
544a170ead2catagen2026-10-20 11:47 UTC267
        </button>
544a170ead2catagen2026-10-20 11:47 UTC268
      {/each}
544a170ead2catagen2026-10-20 11:47 UTC269
      <button
544a170ead2catagen2026-10-20 11:47 UTC270
        type="button"
544a170ead2catagen2026-10-20 11:47 UTC271
        title="Add reaction"
544a170ead2catagen2026-10-20 11:47 UTC272
        aria-label={`Add reaction to message from ${displayName}`}
544a170ead2catagen2026-10-20 11:47 UTC273
        aria-haspopup="dialog"
544a170ead2catagen2026-10-20 11:47 UTC274
        aria-expanded={pickerOpen}
544a170ead2catagen2026-10-20 11:47 UTC275
        on:pointerdown|stopPropagation
544a170ead2catagen2026-10-20 11:47 UTC276
        on:click={openPicker}
544a170ead2catagen2026-10-20 11:47 UTC277
      >
544a170ead2catagen2026-10-20 11:47 UTC278
        ☺+
544a170ead2catagen2026-10-20 11:47 UTC279
      </button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC280
      {#if onReply}
df3c0f2b3da4atagen2026-10-22 13:07 UTC281
        <button
df3c0f2b3da4atagen2026-10-22 13:07 UTC282
          type="button"
df3c0f2b3da4atagen2026-10-22 13:07 UTC283
          title="Reply"
df3c0f2b3da4atagen2026-10-22 13:07 UTC284
          aria-label={`Reply to message from ${displayName}`}
df3c0f2b3da4atagen2026-10-22 13:07 UTC285
          on:click|stopPropagation={reply}
df3c0f2b3da4atagen2026-10-22 13:07 UTC286
        >
df3c0f2b3da4atagen2026-10-22 13:07 UTC287
          ↩
df3c0f2b3da4atagen2026-10-22 13:07 UTC288
        </button>
df3c0f2b3da4atagen2026-10-22 13:07 UTC289
      {/if}
cf23dbf4e77catagen2026-10-23 06:36 UTC290
      {#if onEdit && editableBody !== null}
cf23dbf4e77catagen2026-10-23 06:36 UTC291
        <button type="button" title="Edit" aria-label="Edit your message" on:click|stopPropagation={edit}>
cf23dbf4e77catagen2026-10-23 06:36 UTC292
          ✎
cf23dbf4e77catagen2026-10-23 06:36 UTC293
        </button>
cf23dbf4e77catagen2026-10-23 06:36 UTC294
      {/if}
544a170ead2catagen2026-10-20 11:47 UTC295
    </div>
544a170ead2catagen2026-10-20 11:47 UTC296
    {#if pickerOpen}
544a170ead2catagen2026-10-20 11:47 UTC297
      <div class="picker-pop" style={pickerStyle} bind:this={pickerPop}>
ecb8598b38afatagen2026-10-22 09:19 UTC298
        <ReactionPicker {packs} quick={quickReactions} onPick={pick} {onQuickChange} onClose={closePicker} />
544a170ead2catagen2026-10-20 11:47 UTC299
      </div>
544a170ead2catagen2026-10-20 11:47 UTC300
    {/if}
544a170ead2catagen2026-10-20 11:47 UTC301
  {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC302
  {#if showSender}
d8624c214c04atagen2026-10-24 08:24 UTC303
    <button
d8624c214c04atagen2026-10-24 08:24 UTC304
      type="button"
d8624c214c04atagen2026-10-24 08:24 UTC305
      class="user-hit"
d8624c214c04atagen2026-10-24 08:24 UTC306
      tabindex="-1"
d8624c214c04atagen2026-10-24 08:24 UTC307
      aria-hidden="true"
d8624c214c04atagen2026-10-24 08:24 UTC308
      on:click|stopPropagation={(ev) => openUser(ev, false)}
d8624c214c04atagen2026-10-24 08:24 UTC309
      on:contextmenu|preventDefault|stopPropagation={(ev) => openUser(ev, true)}
d8624c214c04atagen2026-10-24 08:24 UTC310
    >
d8624c214c04atagen2026-10-24 08:24 UTC311
      {#if senderAvatar}
d8624c214c04atagen2026-10-24 08:24 UTC312
        <MxcAvatar mxc={senderAvatar} label={name} size={34} />
d8624c214c04atagen2026-10-24 08:24 UTC313
      {:else}
d8624c214c04atagen2026-10-24 08:24 UTC314
        <span class="avatar" style={`background:hsl(${senderHue(event.sender.user_id)} 35% 32%)`}>
d8624c214c04atagen2026-10-24 08:24 UTC315
          {initialsOf(name)}
d8624c214c04atagen2026-10-24 08:24 UTC316
        </span>
d8624c214c04atagen2026-10-24 08:24 UTC317
      {/if}
d8624c214c04atagen2026-10-24 08:24 UTC318
    </button>
973f8fbdaf80atagen2026-09-28 09:10 UTC319
  {:else}
973f8fbdaf80atagen2026-09-28 09:10 UTC320
    <div class="avatar-spacer" aria-hidden="true">
973f8fbdaf80atagen2026-09-28 09:10 UTC321
      <span class="hover-time">{formatClock(event.timestamp_ms)}</span>
973f8fbdaf80atagen2026-09-28 09:10 UTC322
    </div>
973f8fbdaf80atagen2026-09-28 09:10 UTC323
  {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC324
  <div class="msg-body">
973f8fbdaf80atagen2026-09-28 09:10 UTC325
    {#if showSender}
973f8fbdaf80atagen2026-09-28 09:10 UTC326
      <div class="msg-head">
d8624c214c04atagen2026-10-24 08:24 UTC327
        <button
d8624c214c04atagen2026-10-24 08:24 UTC328
          type="button"
d8624c214c04atagen2026-10-24 08:24 UTC329
          class="sender"
d8624c214c04atagen2026-10-24 08:24 UTC330
          style={`color:hsl(${senderHue(event.sender.user_id)} 70% var(--name-lightness))`}
d8624c214c04atagen2026-10-24 08:24 UTC331
          on:click|stopPropagation={(ev) => openUser(ev, false)}
d8624c214c04atagen2026-10-24 08:24 UTC332
          on:contextmenu|preventDefault|stopPropagation={(ev) => openUser(ev, true)}
d8624c214c04atagen2026-10-24 08:24 UTC333
        >
973f8fbdaf80atagen2026-09-28 09:10 UTC334
          {displayName}
d8624c214c04atagen2026-10-24 08:24 UTC335
        </button>
973f8fbdaf80atagen2026-09-28 09:10 UTC336
        <time class="time" datetime={new Date(event.timestamp_ms).toISOString()}>
973f8fbdaf80atagen2026-09-28 09:10 UTC337
          {formatDay(event.timestamp_ms)} {formatClock(event.timestamp_ms)}
973f8fbdaf80atagen2026-09-28 09:10 UTC338
        </time>
973f8fbdaf80atagen2026-09-28 09:10 UTC339
        {#if event.content.kind === 'Message' && event.content.message.edited}
973f8fbdaf80atagen2026-09-28 09:10 UTC340
          <span class="edited" title="Edited">(edited)</span>
973f8fbdaf80atagen2026-09-28 09:10 UTC341
        {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC342
      </div>
973f8fbdaf80atagen2026-09-28 09:10 UTC343
    {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC344
    {#if event.reply_to}
df3c0f2b3da4atagen2026-10-22 13:07 UTC345
      {@const target = event.reply_to.event_id}
df3c0f2b3da4atagen2026-10-22 13:07 UTC346
      <button
df3c0f2b3da4atagen2026-10-22 13:07 UTC347
        type="button"
df3c0f2b3da4atagen2026-10-22 13:07 UTC348
        class="reply-quote"
df3c0f2b3da4atagen2026-10-22 13:07 UTC349
        disabled={!onJump}
df3c0f2b3da4atagen2026-10-22 13:07 UTC350
        title="Jump to the original message"
df3c0f2b3da4atagen2026-10-22 13:07 UTC351
        on:click|stopPropagation={() => onJump?.(target)}
df3c0f2b3da4atagen2026-10-22 13:07 UTC352
      >
973f8fbdaf80atagen2026-09-28 09:10 UTC353
        {#if event.reply_to.details.kind === 'Ready'}
df3c0f2b3da4atagen2026-10-22 13:07 UTC354
          <span class="reply-sender">{senderLabel(event.reply_to.details.sender)}</span>
df3c0f2b3da4atagen2026-10-22 13:07 UTC355
          <span class="reply-text"><EmojiText text={replyPreview(event.reply_to.details.content)} /></span>
973f8fbdaf80atagen2026-09-28 09:10 UTC356
        {:else if event.reply_to.details.kind === 'Pending'}
973f8fbdaf80atagen2026-09-28 09:10 UTC357
          Loading reply…
973f8fbdaf80atagen2026-09-28 09:10 UTC358
        {:else}
973f8fbdaf80atagen2026-09-28 09:10 UTC359
          Reply unavailable
973f8fbdaf80atagen2026-09-28 09:10 UTC360
        {/if}
df3c0f2b3da4atagen2026-10-22 13:07 UTC361
      </button>
973f8fbdaf80atagen2026-09-28 09:10 UTC362
    {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC363
973f8fbdaf80atagen2026-09-28 09:10 UTC364
    {#if event.content.kind === 'Message'}
973f8fbdaf80atagen2026-09-28 09:10 UTC365
      {@const m = event.content.message}
705b1e1062c2atagen2026-10-23 09:05 UTC366
      {#if stripped.text}
df3c0f2b3da4atagen2026-10-22 13:07 UTC367
        <div class="text" class:emote={m.kind === 'Emote'} class:notice={m.kind === 'Notice' || m.kind === 'ServerNotice'}>
6d6a4c34bdc1atagen2026-10-24 06:51 UTC368
          {#if m.kind === 'Emote'}* {displayName} {/if}<MessageText text={stripped.text} html={m.formatted_body} jumbo={m.kind === 'Text'} {mentions} {self} nameOf={(id) => people[id]?.name ?? null} />
cf23dbf4e77catagen2026-10-23 06:36 UTC369
          {#if m.edited && !showSender}<span class="edited" title="Edited">(edited)</span>{/if}
df3c0f2b3da4atagen2026-10-22 13:07 UTC370
        </div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC371
      {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC372
      {#if m.media}
973f8fbdaf80atagen2026-09-28 09:10 UTC373
        <MediaAttachmentView attachment={m.media} />
973f8fbdaf80atagen2026-09-28 09:10 UTC374
      {/if}
705b1e1062c2atagen2026-10-23 09:05 UTC375
      {#if cards.length > 0}
973f8fbdaf80atagen2026-09-28 09:10 UTC376
        <div class="link-previews">
705b1e1062c2atagen2026-10-23 09:05 UTC377
          {#each cards as card (card.link.href)}
705b1e1062c2atagen2026-10-23 09:05 UTC378
            <LinkCard link={card.link} preview={card.preview} />
973f8fbdaf80atagen2026-09-28 09:10 UTC379
          {/each}
973f8fbdaf80atagen2026-09-28 09:10 UTC380
        </div>
973f8fbdaf80atagen2026-09-28 09:10 UTC381
      {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC382
    {:else if event.content.kind === 'Sticker'}
544a170ead2catagen2026-10-20 11:47 UTC383
      {#if event.content.body}<p class="text"><EmojiText text={event.content.body} /></p>{/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC384
      {#if event.content.media}
973f8fbdaf80atagen2026-09-28 09:10 UTC385
        <MediaAttachmentView attachment={event.content.media} />
973f8fbdaf80atagen2026-09-28 09:10 UTC386
      {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC387
    {:else if event.content.kind === 'Poll'}
973f8fbdaf80atagen2026-09-28 09:10 UTC388
      <p class="text">📊 {event.content.question}</p>
973f8fbdaf80atagen2026-09-28 09:10 UTC389
    {:else}
973f8fbdaf80atagen2026-09-28 09:10 UTC390
      <p class="system-line">{systemLine(event.content)}</p>
973f8fbdaf80atagen2026-09-28 09:10 UTC391
    {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC392
973f8fbdaf80atagen2026-09-28 09:10 UTC393
    {#if interactive && event.reactions.length > 0}
973f8fbdaf80atagen2026-09-28 09:10 UTC394
      <div class="reactions" aria-label="Reactions">
973f8fbdaf80atagen2026-09-28 09:10 UTC395
        {#each event.reactions as r (r.key)}
973f8fbdaf80atagen2026-09-28 09:10 UTC396
          <button
973f8fbdaf80atagen2026-09-28 09:10 UTC397
            type="button"
973f8fbdaf80atagen2026-09-28 09:10 UTC398
            class="reaction"
973f8fbdaf80atagen2026-09-28 09:10 UTC399
            class:mine={r.own}
cf23dbf4e77catagen2026-10-23 06:36 UTC400
            aria-describedby={`${itemId}-reactors-${r.key}`}
973f8fbdaf80atagen2026-09-28 09:10 UTC401
            disabled={!event.event_id || reacting}
973f8fbdaf80atagen2026-09-28 09:10 UTC402
            on:click={() => event.event_id && onReact(event.event_id, r.key)}
973f8fbdaf80atagen2026-09-28 09:10 UTC403
          >
ecb8598b38afatagen2026-10-22 09:19 UTC404
            {#if r.image}
ecb8598b38afatagen2026-10-22 09:19 UTC405
              <img class="emote" src={messageMediaUrl(r.image, 'Thumbnail')} alt={r.shortcode ?? ''} title={r.shortcode ?? ''} />
ecb8598b38afatagen2026-10-22 09:19 UTC406
            {:else if r.key.startsWith('mxc://')}
544a170ead2catagen2026-10-20 11:47 UTC407
              <img class="emote" src={mediaUrl(r.key) ?? ''} alt="" />
544a170ead2catagen2026-10-20 11:47 UTC408
            {:else}
544a170ead2catagen2026-10-20 11:47 UTC409
              <Emoji emoji={r.key} size={16} />
544a170ead2catagen2026-10-20 11:47 UTC410
            {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC411
            <span class="count">{r.count}</span>
cf23dbf4e77catagen2026-10-23 06:36 UTC412
            <span class="reactors" role="tooltip" id={`${itemId}-reactors-${r.key}`}>
cf23dbf4e77catagen2026-10-23 06:36 UTC413
              <span class="reactors-key">{r.shortcode ? `:${r.shortcode}:` : r.key.startsWith('mxc://') ? 'custom emote' : r.key}</span>
cf23dbf4e77catagen2026-10-23 06:36 UTC414
              {reactorNames(r.senders)}
cf23dbf4e77catagen2026-10-23 06:36 UTC415
            </span>
973f8fbdaf80atagen2026-09-28 09:10 UTC416
          </button>
973f8fbdaf80atagen2026-09-28 09:10 UTC417
        {/each}
973f8fbdaf80atagen2026-09-28 09:10 UTC418
      </div>
973f8fbdaf80atagen2026-09-28 09:10 UTC419
    {/if}
df3c0f2b3da4atagen2026-10-22 13:07 UTC420
    {#if interactive && sendLabel(event.send_state)}
973f8fbdaf80atagen2026-09-28 09:10 UTC421
      <div class="msg-foot">
df3c0f2b3da4atagen2026-10-22 13:07 UTC422
        <span class="sendstate" class:failed={event.send_state.kind === 'Failed'}>{sendLabel(event.send_state)}</span>
df3c0f2b3da4atagen2026-10-22 13:07 UTC423
      </div>
df3c0f2b3da4atagen2026-10-22 13:07 UTC424
    {/if}
df3c0f2b3da4atagen2026-10-22 13:07 UTC425
    {#if interactive && readers.length > 0}
df3c0f2b3da4atagen2026-10-22 13:07 UTC426
      {@const seenBy = `Seen by ${readers.map((r) => r.name).join(', ')}`}
df3c0f2b3da4atagen2026-10-22 13:07 UTC427
      <div class="readby" title={seenBy} aria-label={seenBy} role="img">
df3c0f2b3da4atagen2026-10-22 13:07 UTC428
        {#each readers.slice(0, MAX_READERS) as r (r.user_id)}
df3c0f2b3da4atagen2026-10-22 13:07 UTC429
          <MxcAvatar mxc={r.avatar} label={r.name} size={16} />
df3c0f2b3da4atagen2026-10-22 13:07 UTC430
        {/each}
df3c0f2b3da4atagen2026-10-22 13:07 UTC431
        {#if readers.length > MAX_READERS}<span class="more">+{readers.length - MAX_READERS}</span>{/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC432
      </div>
973f8fbdaf80atagen2026-09-28 09:10 UTC433
    {/if}
973f8fbdaf80atagen2026-09-28 09:10 UTC434
  </div>
973f8fbdaf80atagen2026-09-28 09:10 UTC435
</div>
973f8fbdaf80atagen2026-09-28 09:10 UTC436
973f8fbdaf80atagen2026-09-28 09:10 UTC437
<style>
df3c0f2b3da4atagen2026-10-22 13:07 UTC438
  .msg { position: relative; display: flex; gap: 10px; padding: var(--msg-gap, 3px) 0; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC439
  .msg:hover, .msg.selected { background: var(--hover-faint); }
544a170ead2catagen2026-10-20 11:47 UTC440
  .msg:hover .hover-time, .msg.selected .hover-time { opacity: 1; }
544a170ead2catagen2026-10-20 11:47 UTC441
  .msg-foot { display: flex; align-items: center; gap: 8px; }
973f8fbdaf80atagen2026-09-28 09:10 UTC442
  .sendstate { font-size: 11px; color: var(--muted); }
973f8fbdaf80atagen2026-09-28 09:10 UTC443
  .sendstate.failed { color: var(--danger); }
973f8fbdaf80atagen2026-09-28 09:10 UTC444
  .link-previews { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; max-width: 420px; }
973f8fbdaf80atagen2026-09-28 09:10 UTC445
  .avatar {
973f8fbdaf80atagen2026-09-28 09:10 UTC446
    flex: none;
973f8fbdaf80atagen2026-09-28 09:10 UTC447
    width: 34px; height: 34px;
973f8fbdaf80atagen2026-09-28 09:10 UTC448
    border-radius: 50%;
973f8fbdaf80atagen2026-09-28 09:10 UTC449
    display: grid; place-items: center;
973f8fbdaf80atagen2026-09-28 09:10 UTC450
    font-size: 12px; font-weight: 700; color: #fff;
973f8fbdaf80atagen2026-09-28 09:10 UTC451
  }
973f8fbdaf80atagen2026-09-28 09:10 UTC452
  .avatar-spacer { flex: none; width: 34px; padding-top: 2px; text-align: center; }
973f8fbdaf80atagen2026-09-28 09:10 UTC453
  .hover-time { opacity: 0; font-size: 10.5px; color: var(--muted); }
973f8fbdaf80atagen2026-09-28 09:10 UTC454
  .msg-body { min-width: 0; flex: 1; }
973f8fbdaf80atagen2026-09-28 09:10 UTC455
  .msg-head { display: flex; align-items: baseline; gap: 8px; }
d8624c214c04atagen2026-10-24 08:24 UTC456
  .sender { font-weight: 650; font-size: 13.5px; padding: 0; border: none; background: none; font-family: inherit; cursor: pointer; }
d8624c214c04atagen2026-10-24 08:24 UTC457
  .sender:hover { text-decoration: underline; }
d8624c214c04atagen2026-10-24 08:24 UTC458
  .user-hit { flex: none; align-self: flex-start; padding: 0; border: none; background: none; border-radius: 50%; cursor: pointer; }
973f8fbdaf80atagen2026-09-28 09:10 UTC459
  .time, .edited { color: var(--muted); font-size: 11.5px; }
cf23dbf4e77catagen2026-10-23 06:36 UTC460
  .text .edited { margin-left: 6px; }
cf23dbf4e77catagen2026-10-23 06:36 UTC461
  .msg.editing { background: color-mix(in srgb, var(--accent) 10%, transparent); }
705b1e1062c2atagen2026-10-23 09:05 UTC462
  .msg.mentioned { background: color-mix(in srgb, var(--warn) 8%, transparent); box-shadow: inset 2px 0 0 var(--warn); }
973f8fbdaf80atagen2026-09-28 09:10 UTC463
  .reply-quote {
df3c0f2b3da4atagen2026-10-22 13:07 UTC464
    display: flex; gap: 6px; align-items: baseline;
df3c0f2b3da4atagen2026-10-22 13:07 UTC465
    max-width: min(100%, 520px);
df3c0f2b3da4atagen2026-10-22 13:07 UTC466
    border: none;
973f8fbdaf80atagen2026-09-28 09:10 UTC467
    border-left: 2px solid var(--accent);
973f8fbdaf80atagen2026-09-28 09:10 UTC468
    padding: 2px 8px;
973f8fbdaf80atagen2026-09-28 09:10 UTC469
    margin: 2px 0 4px;
973f8fbdaf80atagen2026-09-28 09:10 UTC470
    color: var(--muted);
973f8fbdaf80atagen2026-09-28 09:10 UTC471
    font-size: 12.5px;
df3c0f2b3da4atagen2026-10-22 13:07 UTC472
    text-align: left;
973f8fbdaf80atagen2026-09-28 09:10 UTC473
    background: var(--bg-soft);
973f8fbdaf80atagen2026-09-28 09:10 UTC474
    border-radius: 0 6px 6px 0;
df3c0f2b3da4atagen2026-10-22 13:07 UTC475
    cursor: pointer;
973f8fbdaf80atagen2026-09-28 09:10 UTC476
  }
df3c0f2b3da4atagen2026-10-22 13:07 UTC477
  .reply-quote:disabled { cursor: default; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC478
  .reply-quote:hover:not(:disabled) { color: var(--text); }
df3c0f2b3da4atagen2026-10-22 13:07 UTC479
  .reply-sender { flex: none; font-weight: 650; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC480
  .reply-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC481
  :global(.msg.flash) { animation: reply-flash 1.2s ease-out; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC482
  @keyframes -global-reply-flash { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } }
973f8fbdaf80atagen2026-09-28 09:10 UTC483
  .text {
973f8fbdaf80atagen2026-09-28 09:10 UTC484
    margin: 1px 0 2px;
973f8fbdaf80atagen2026-09-28 09:10 UTC485
    font-size: 14px;
df3c0f2b3da4atagen2026-10-22 13:07 UTC486
    line-height: var(--msg-line-height, 1.5);
973f8fbdaf80atagen2026-09-28 09:10 UTC487
    white-space: pre-wrap;
973f8fbdaf80atagen2026-09-28 09:10 UTC488
    overflow-wrap: anywhere;
973f8fbdaf80atagen2026-09-28 09:10 UTC489
  }
973f8fbdaf80atagen2026-09-28 09:10 UTC490
  .text.emote { font-style: italic; color: var(--muted); }
973f8fbdaf80atagen2026-09-28 09:10 UTC491
  .text.notice { color: var(--muted); }
973f8fbdaf80atagen2026-09-28 09:10 UTC492
  .system-line { color: var(--muted); font-size: 12.5px; font-style: italic; margin: 1px 0; }
973f8fbdaf80atagen2026-09-28 09:10 UTC493
  .msg.system { opacity: 0.85; }
973f8fbdaf80atagen2026-09-28 09:10 UTC494
  .reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
973f8fbdaf80atagen2026-09-28 09:10 UTC495
  .reaction {
973f8fbdaf80atagen2026-09-28 09:10 UTC496
    display: inline-flex; align-items: center; gap: 4px;
973f8fbdaf80atagen2026-09-28 09:10 UTC497
    background: var(--bg-soft);
973f8fbdaf80atagen2026-09-28 09:10 UTC498
    border: 1px solid var(--border);
973f8fbdaf80atagen2026-09-28 09:10 UTC499
    border-radius: 999px;
973f8fbdaf80atagen2026-09-28 09:10 UTC500
    padding: 1px 8px;
973f8fbdaf80atagen2026-09-28 09:10 UTC501
    font-size: 13px;
973f8fbdaf80atagen2026-09-28 09:10 UTC502
    color: var(--text);
973f8fbdaf80atagen2026-09-28 09:10 UTC503
    cursor: pointer;
973f8fbdaf80atagen2026-09-28 09:10 UTC504
  }
cf23dbf4e77catagen2026-10-23 06:36 UTC505
  .reaction { position: relative; }
cf23dbf4e77catagen2026-10-23 06:36 UTC506
  .reactors {
cf23dbf4e77catagen2026-10-23 06:36 UTC507
    position: absolute;
cf23dbf4e77catagen2026-10-23 06:36 UTC508
    left: 0;
cf23dbf4e77catagen2026-10-23 06:36 UTC509
    bottom: calc(100% + 6px);
cf23dbf4e77catagen2026-10-23 06:36 UTC510
    z-index: 15;
cf23dbf4e77catagen2026-10-23 06:36 UTC511
    display: none;
cf23dbf4e77catagen2026-10-23 06:36 UTC512
    width: max-content;
cf23dbf4e77catagen2026-10-23 06:36 UTC513
    max-width: 260px;
cf23dbf4e77catagen2026-10-23 06:36 UTC514
    padding: 6px 9px;
cf23dbf4e77catagen2026-10-23 06:36 UTC515
    border: 1px solid var(--border);
cf23dbf4e77catagen2026-10-23 06:36 UTC516
    border-radius: 8px;
cf23dbf4e77catagen2026-10-23 06:36 UTC517
    background: var(--panel-2);
cf23dbf4e77catagen2026-10-23 06:36 UTC518
    box-shadow: 0 6px 18px rgb(0 0 0 / 0.3);
cf23dbf4e77catagen2026-10-23 06:36 UTC519
    color: var(--text);
cf23dbf4e77catagen2026-10-23 06:36 UTC520
    font-size: 12px;
cf23dbf4e77catagen2026-10-23 06:36 UTC521
    line-height: 1.35;
cf23dbf4e77catagen2026-10-23 06:36 UTC522
    text-align: left;
cf23dbf4e77catagen2026-10-23 06:36 UTC523
    white-space: normal;
cf23dbf4e77catagen2026-10-23 06:36 UTC524
    pointer-events: none;
cf23dbf4e77catagen2026-10-23 06:36 UTC525
  }
cf23dbf4e77catagen2026-10-23 06:36 UTC526
  .reactors-key { display: block; color: var(--muted); font-size: 11px; }
cf23dbf4e77catagen2026-10-23 06:36 UTC527
  .reaction:hover .reactors, .reaction:focus-visible .reactors { display: block; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC528
  .reaction.mine { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
973f8fbdaf80atagen2026-09-28 09:10 UTC529
  .reaction:disabled { cursor: default; opacity: 0.85; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC530
  .msg.has-readers .msg-body { padding-right: 72px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC531
  .readby { position: absolute; right: 12px; bottom: 4px; display: flex; align-items: center; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC532
  .readby > :global(* + *) { margin-left: -4px; }
df3c0f2b3da4atagen2026-10-22 13:07 UTC533
  .readby :global(.mxc-avatar), .readby :global(.mxc-fallback) { box-shadow: 0 0 0 1.5px var(--bg); }
df3c0f2b3da4atagen2026-10-22 13:07 UTC534
  .readby .more { margin-left: 3px; font-size: 10.5px; color: var(--muted); }
544a170ead2catagen2026-10-20 11:47 UTC535
  .actions {
544a170ead2catagen2026-10-20 11:47 UTC536
    position: absolute; top: -14px; right: 12px; z-index: 2;
544a170ead2catagen2026-10-20 11:47 UTC537
    display: flex; gap: 2px;
544a170ead2catagen2026-10-20 11:47 UTC538
    padding: 2px;
544a170ead2catagen2026-10-20 11:47 UTC539
    background: var(--bg-soft);
544a170ead2catagen2026-10-20 11:47 UTC540
    border: 1px solid var(--border);
544a170ead2catagen2026-10-20 11:47 UTC541
    border-radius: 8px;
544a170ead2catagen2026-10-20 11:47 UTC542
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
544a170ead2catagen2026-10-20 11:47 UTC543
    opacity: 0;
544a170ead2catagen2026-10-20 11:47 UTC544
    pointer-events: none;
544a170ead2catagen2026-10-20 11:47 UTC545
  }
544a170ead2catagen2026-10-20 11:47 UTC546
  .msg:hover .actions, .msg:focus-within .actions, .msg.selected .actions { opacity: 1; pointer-events: auto; }
544a170ead2catagen2026-10-20 11:47 UTC547
  .actions button {
973f8fbdaf80atagen2026-09-28 09:10 UTC548
    background: transparent;
973f8fbdaf80atagen2026-09-28 09:10 UTC549
    border: 1px solid transparent;
973f8fbdaf80atagen2026-09-28 09:10 UTC550
    border-radius: 6px;
973f8fbdaf80atagen2026-09-28 09:10 UTC551
    cursor: pointer;
544a170ead2catagen2026-10-20 11:47 UTC552
    font-size: 14px;
544a170ead2catagen2026-10-20 11:47 UTC553
    padding: 1px 5px;
973f8fbdaf80atagen2026-09-28 09:10 UTC554
  }
df3c0f2b3da4atagen2026-10-22 13:07 UTC555
  .actions button:hover:not(:disabled) { border-color: var(--border); background: var(--hover); }
544a170ead2catagen2026-10-20 11:47 UTC556
  .actions button:disabled { opacity: 0.4; cursor: default; }
544a170ead2catagen2026-10-20 11:47 UTC557
  .emote { width: 1.3em; height: 1.3em; object-fit: contain; vertical-align: middle; }
544a170ead2catagen2026-10-20 11:47 UTC558
  .picker-pop { position: fixed; z-index: 60; width: 320px; max-width: calc(100vw - 16px); }
973f8fbdaf80atagen2026-09-28 09:10 UTC559
</style>