{"version":3,"file":"NotificationList.mjs","names":[],"sources":["../../../../src/components/Notifications/NotificationList.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport clsx from 'clsx';\nimport type { Notification } from 'stream-chat';\n\nimport { hasSystemNotificationTag, useNotificationApi } from './hooks/useNotificationApi';\nimport { useNotifications } from './hooks/useNotifications';\nimport { Notification as DefaultNotification } from './Notification';\nimport { useComponentContext, useTranslationContext } from '../../context';\n\nimport type { NotificationTargetPanel } from './notificationTarget';\n\nexport type NotificationListFilter = (notification: Notification) => boolean;\nexport type NotificationListEnterFrom = 'bottom' | 'left' | 'right' | 'top';\nexport type NotificationListVerticalAlignment = 'bottom' | 'top';\n/**\n * Selects the notification to display, given the store contents and the displayed notification\n * (`null` when nothing is mounted). Returning `displayed` or a notification with the same ID keeps\n * the current one, a different notification triggers a swap (immediate or after `minDisplayMs`),\n * and `null` triggers the empty-slot exit.\n */\nexport type PickNextNotification = (\n  notifications: Notification[],\n  displayed: Notification | null,\n) => Notification | null;\n\n/** Queue fallback of `createDefaultPickNext`, used when none of its other rules applies. */\nexport type PickFromQueue = (\n  notifications: Notification[],\n  displayed: Notification | null,\n) => Notification | null;\n\nexport type NotificationListProps = {\n  /** Class applied to the list container. */\n  className?: string;\n  /**\n   * Direction from which a replacement enters the visible slot. Defaults to `bottom`. An\n   * `entryDirection` in the notification's `metadata` or `origin.context` takes precedence.\n   */\n  enterFrom?: NotificationListEnterFrom;\n  /**\n   * Limits the list to notifications that pass the filter, e.g. by `origin.emitter`,\n   * `origin.context` or `metadata`. System banners are always excluded.\n   */\n  filter?: NotificationListFilter;\n  /**\n   * Minimum time (ms) the active notification stays visible before a queued one replaces it.\n   * Same-type repeats and external dismissals bypass it. Defaults to 1000.\n   */\n  minDisplayMs?: number;\n  /**\n   * Overrides which notification is displayed, given the store and the displayed one. Defaults to\n   * `createDefaultPickNext(pickOldest)`; pass `createDefaultPickNext(pickNewest)` for LIFO.\n   */\n  pickNext?: PickNextNotification;\n  /** Panel target consumed by this list. */\n  panel?: NotificationTargetPanel;\n  /** Panel assumed for notifications that name none. Defaults to `channel`. */\n  fallbackPanel?: NotificationTargetPanel;\n  /** Vertical alignment of the single notification slot within its parent. Defaults to `bottom`. */\n  verticalAlignment?: NotificationListVerticalAlignment;\n};\n\n// Entry motion goes through CSS variables so one keyframe is shared in SCSS. Full-size percentages\n// on the active axis slide a replacement in from outside its slot.\nconst ENTER_TRANSLATION: Record<NotificationListEnterFrom, { x: string; y: string }> = {\n  bottom: { x: '0%', y: '100%' },\n  left: { x: '-100%', y: '0%' },\n  right: { x: '100%', y: '0%' },\n  top: { x: '0%', y: '-100%' },\n};\n\nconst EXIT_ANIMATION_MS = 340;\nconst DEFAULT_MIN_DISPLAY_MS = 1000;\n\nconst isEnterFrom = (value: unknown): value is NotificationListEnterFrom =>\n  value === 'bottom' || value === 'left' || value === 'right' || value === 'top';\n\nconst getNotificationEnterFrom = (\n  notification: Notification | null,\n  fallbackEnterFrom: NotificationListEnterFrom,\n) => {\n  if (!notification) return fallbackEnterFrom;\n\n  const metadataEnterFrom = notification.metadata?.entryDirection;\n  if (isEnterFrom(metadataEnterFrom)) return metadataEnterFrom;\n\n  const originEnterFrom = notification.origin.context?.entryDirection;\n  if (isEnterFrom(originEnterFrom)) return originEnterFrom;\n\n  return fallbackEnterFrom;\n};\n\nconst isPersistent = (notification: Notification) => !notification.duration;\n\nconst haveSameType = (a: Notification | null, b: Notification | null) =>\n  !!a?.type && !!b?.type && a.type === b.type;\n\n/** FIFO queue selector: the oldest notification (by `createdAt`) other than `displayed`. */\nexport const pickOldest: PickFromQueue = (notifications, displayed) => {\n  const excludeId = displayed?.id ?? null;\n  let oldest: Notification | null = null;\n  for (const notification of notifications) {\n    if (notification.id === excludeId) continue;\n    if (!oldest || notification.createdAt < oldest.createdAt) {\n      oldest = notification;\n    }\n  }\n  return oldest;\n};\n\n/** LIFO queue selector: the newest notification (by `createdAt`) other than `displayed`. */\nexport const pickNewest: PickFromQueue = (notifications, displayed) => {\n  const excludeId = displayed?.id ?? null;\n  let newest: Notification | null = null;\n  for (const notification of notifications) {\n    if (notification.id === excludeId) continue;\n    if (!newest || notification.createdAt > newest.createdAt) {\n      newest = notification;\n    }\n  }\n  return newest;\n};\n\nconst pickNewestPersistent = (\n  notifications: Notification[],\n  excludeId: string | null,\n): Notification | null => {\n  let newest: Notification | null = null;\n  for (const notification of notifications) {\n    if (notification.id === excludeId) continue;\n    if (!isPersistent(notification)) continue;\n    if (!newest || notification.createdAt > newest.createdAt) {\n      newest = notification;\n    }\n  }\n  return newest;\n};\n\nconst isNewerOfSameType = (candidate: Notification, displayed: Notification) =>\n  haveSameType(candidate, displayed) && candidate.createdAt > displayed.createdAt;\n\n/** The newest notification of the displayed one's `type` that arrived after it. */\nconst pickNewerOfType = (\n  notifications: Notification[],\n  displayed: Notification,\n): Notification | null => {\n  let newest: Notification | null = null;\n  for (const notification of notifications) {\n    if (!isNewerOfSameType(notification, displayed)) continue;\n    if (!newest || notification.createdAt > newest.createdAt) {\n      newest = notification;\n    }\n  }\n  return newest;\n};\n\n/**\n * Builds the default `PickNextNotification` selector with a configurable queue fallback. The\n * scheduling effect in `NotificationList` decides when to swap, the selector what to swap to. It\n * returns `null` for an empty store, otherwise:\n *\n * - Nothing displayed, or the displayed one left the store: the newest persistent notification (no\n *   `duration`), else `pickFromQueue`.\n * - A persistent is displayed: it stays until a newer persistent arrives or it is dismissed.\n * - A transient is displayed: the newest notification of the same `type` that arrived after it,\n *   else the newest persistent, else `pickFromQueue`, else the displayed one.\n *\n * @param pickFromQueue - Queue fallback. Defaults to `pickOldest`.\n * @returns The selector.\n */\nexport const createDefaultPickNext =\n  (pickFromQueue: PickFromQueue = pickOldest): PickNextNotification =>\n  (notifications, displayed) => {\n    if (notifications.length === 0) return null;\n\n    const newestPersistent = pickNewestPersistent(notifications, null);\n\n    if (!displayed) {\n      return newestPersistent ?? pickFromQueue(notifications, null);\n    }\n\n    const displayedInStore = notifications.some(({ id }) => id === displayed.id);\n    if (!displayedInStore) {\n      return newestPersistent ?? pickFromQueue(notifications, null);\n    }\n\n    if (isPersistent(displayed)) {\n      // Only a newer persistent can replace it. Reuse the earlier lookup when it already points at\n      // a different persistent.\n      const newerPersistent =\n        newestPersistent && newestPersistent.id !== displayed.id\n          ? newestPersistent\n          : pickNewestPersistent(notifications, displayed.id);\n      if (newerPersistent && newerPersistent.createdAt > displayed.createdAt) {\n        return newerPersistent;\n      }\n      return displayed;\n    }\n\n    // A transient is displayed. A later repeat of its type collapses to the latest occurrence.\n    const newerOfType = pickNewerOfType(notifications, displayed);\n    if (newerOfType) return newerOfType;\n\n    // A queued persistent jumps ahead of the queue.\n    if (newestPersistent) return newestPersistent;\n\n    return pickFromQueue(notifications, displayed) ?? displayed;\n  };\n\n/** Default selector: the rules of `createDefaultPickNext` with a FIFO queue fallback. */\nconst defaultPickNext = createDefaultPickNext(pickOldest);\n\nexport const NotificationList = ({\n  className,\n  enterFrom = 'bottom',\n  fallbackPanel,\n  filter,\n  minDisplayMs = DEFAULT_MIN_DISPLAY_MS,\n  panel,\n  pickNext = defaultPickNext,\n  verticalAlignment = 'bottom',\n}: NotificationListProps) => {\n  const { Notification: NotificationComponent = DefaultNotification } =\n    useComponentContext();\n  const { t } = useTranslationContext();\n  const { ensureNotificationTimeout, removeNotification } = useNotificationApi();\n  // Timer of the exit animation, set when `transitionState` flips to `'exit'`. When it fires, the\n  // next candidate mounts or the slot empties. At most one exit animation is in flight.\n  const exitTimeoutRef = useRef<number | null>(null);\n  // Dwell timer that defers a swap until `minDisplayMs` has passed since the active notification\n  // became visible. It exists only while waiting; same-type repeats, external dismissals and\n  // arrivals after the dwell window start the exit directly.\n  const replacementTimeoutRef = useRef<number | null>(null);\n  const candidateRef = useRef<Notification | null>(null);\n  const displayedAtRef = useRef<number | null>(null);\n  const listRef = useRef<HTMLDivElement | null>(null);\n  const observedElementRef = useRef<HTMLDivElement | null>(null);\n\n  const [displayedNotification, setDisplayedNotification] = useState<Notification | null>(\n    null,\n  );\n  const [transitionState, setTransitionState] = useState<'enter' | 'exit'>('enter');\n  const combinedFilter = useCallback(\n    (notification: Notification) => {\n      if (hasSystemNotificationTag(notification)) return false;\n      return filter ? filter(notification) : true;\n    },\n    [filter],\n  );\n  const notifications = useNotifications({\n    applyDisplayFilter: true,\n    fallbackPanel,\n    filter: combinedFilter,\n    panel,\n  });\n\n  const dismiss = useCallback(\n    (id: string) => {\n      removeNotification(id);\n    },\n    [removeNotification],\n  );\n\n  const clearReplacementTimeout = useCallback(() => {\n    if (replacementTimeoutRef.current !== null) {\n      window.clearTimeout(replacementTimeoutRef.current);\n      replacementTimeoutRef.current = null;\n    }\n  }, []);\n\n  useEffect(\n    () => () => {\n      clearReplacementTimeout();\n      if (exitTimeoutRef.current !== null) {\n        window.clearTimeout(exitTimeoutRef.current);\n        exitTimeoutRef.current = null;\n      }\n    },\n    [clearReplacementTimeout],\n  );\n\n  // Tracks the freshest candidate so swap completion reads the latest one, even when a\n  // notification arrives mid-exit.\n  useEffect(() => {\n    candidateRef.current = pickNext(notifications, displayedNotification);\n  }, [displayedNotification, notifications, pickNext]);\n\n  // Scheduling effect: decides when to swap, while `pickNext` decides what to swap to. A swap waits\n  // until the active notification has been visible for `minDisplayMs`, except for a same-type\n  // repeat and for a displayed notification that already left the store.\n  useEffect(() => {\n    // An exit is in flight; its timer sets new state, which re-runs this effect.\n    if (transitionState === 'exit') return;\n\n    // Nothing is mounted yet: mount the candidate directly.\n    if (!displayedNotification) {\n      const candidate = pickNext(notifications, null);\n      if (candidate) {\n        displayedAtRef.current = Date.now();\n        setDisplayedNotification(candidate);\n        setTransitionState('enter');\n      }\n      return;\n    }\n\n    const candidate = pickNext(notifications, displayedNotification);\n\n    // No candidate (e.g. the store was drained): play the exit animation, then unmount.\n    if (!candidate) {\n      clearReplacementTimeout();\n      setTransitionState('exit');\n      exitTimeoutRef.current = window.setTimeout(() => {\n        exitTimeoutRef.current = null;\n        displayedAtRef.current = null;\n        setDisplayedNotification(null);\n        setTransitionState('enter');\n      }, EXIT_ANIMATION_MS);\n      return;\n    }\n\n    // The candidate is already displayed. Cancel a dwell timer queued by an earlier run that became\n    // moot (e.g. the incoming notification was removed before its dwell expired).\n    if (candidate.id === displayedNotification.id) {\n      clearReplacementTimeout();\n      return;\n    }\n\n    const displayedInStore = notifications.some(\n      ({ id }) => id === displayedNotification.id,\n    );\n\n    // Shared by the immediate and dwell-deferred branches below. `previousId` and `wasInStore` are\n    // captured so the exit timer cleans up correctly even if state has moved on by then.\n    const startSwap = () => {\n      replacementTimeoutRef.current = null;\n      setTransitionState('exit');\n      const previousId = displayedNotification.id;\n      const wasInStore = displayedInStore;\n      exitTimeoutRef.current = window.setTimeout(() => {\n        exitTimeoutRef.current = null;\n        if (wasInStore) {\n          // Removing it keeps it from re-appearing and clears its auto-dismiss timer.\n          removeNotification(previousId);\n        }\n        // Reads the latest candidate when the exit completes; it may differ from the one chosen\n        // when the swap was queued, as notifications can arrive during the exit window.\n        const next = candidateRef.current;\n        if (next && next.id !== previousId) {\n          displayedAtRef.current = Date.now();\n          setDisplayedNotification(next);\n          setTransitionState('enter');\n        } else {\n          displayedAtRef.current = null;\n          setDisplayedNotification(null);\n          setTransitionState('enter');\n        }\n      }, EXIT_ANIMATION_MS);\n    };\n\n    // The displayed notification was dismissed or auto-dismissed: swap right away rather than\n    // stall the empty slot for `minDisplayMs`.\n    if (!displayedInStore) {\n      clearReplacementTimeout();\n      startSwap();\n      return;\n    }\n\n    // A later repeat of the same type replaces the active notification immediately, and the new\n    // one starts its own auto-dismiss countdown. An older one of the same type waits its turn.\n    if (isNewerOfSameType(candidate, displayedNotification)) {\n      clearReplacementTimeout();\n      startSwap();\n      return;\n    }\n\n    // Default branch: enforce the dwell window. `displayedAtRef` is stamped whenever\n    // `displayedNotification` is set, so it matches what is on screen.\n    const elapsed = displayedAtRef.current ? Date.now() - displayedAtRef.current : 0;\n    const remaining = Math.max(0, minDisplayMs - elapsed);\n\n    if (remaining === 0) {\n      clearReplacementTimeout();\n      startSwap();\n    } else if (replacementTimeoutRef.current === null) {\n      // Scheduled once: re-runs (e.g. even newer arrivals) do not reschedule, since `candidateRef`\n      // keeps tracking the freshest candidate for when the exit completes.\n      replacementTimeoutRef.current = window.setTimeout(startSwap, remaining);\n    }\n  }, [\n    clearReplacementTimeout,\n    displayedNotification,\n    minDisplayMs,\n    notifications,\n    pickNext,\n    removeNotification,\n    transitionState,\n  ]);\n\n  const notification = displayedNotification;\n  const notificationEnterFrom = getNotificationEnterFrom(notification, enterFrom);\n\n  useEffect(() => {\n    const element = observedElementRef.current;\n    if (!element || !notification || transitionState === 'exit') return;\n\n    // `ensureTimeout` leaves a running countdown alone, so this can run whenever the notification\n    // becomes visible without tracking which ones were started.\n    const startTimeout = () => {\n      ensureNotificationTimeout(notification.id);\n    };\n\n    if (typeof IntersectionObserver === 'undefined') {\n      startTimeout();\n      return;\n    }\n\n    const observer = new IntersectionObserver(\n      (entries) => {\n        const [entry] = entries;\n        if (!entry?.isIntersecting) return;\n\n        startTimeout();\n        observer.disconnect();\n      },\n      {\n        root: listRef.current,\n        threshold: 0.5,\n      },\n    );\n\n    observer.observe(element);\n\n    return () => {\n      observer.disconnect();\n    };\n  }, [ensureNotificationTimeout, notification, transitionState]);\n\n  if (!notification) return null;\n\n  return (\n    <div\n      aria-label={t('notification.list.notifications.ariaLabel', 'Notifications')}\n      className={clsx(\n        'str-chat__notification-list',\n        `str-chat__notification-list--enter-from-${notificationEnterFrom}`,\n        `str-chat__notification-list--position-${verticalAlignment}`,\n        panel && `str-chat__notification-list--${panel}`,\n        className,\n      )}\n      data-testid='notification-list'\n      ref={listRef}\n      role='region'\n      style={\n        {\n          '--str-chat__notification-list-enter-x':\n            ENTER_TRANSLATION[notificationEnterFrom].x,\n          '--str-chat__notification-list-enter-y':\n            ENTER_TRANSLATION[notificationEnterFrom].y,\n        } as React.CSSProperties\n      }\n    >\n      <div\n        aria-hidden\n        className='str-chat__notification-list__edge str-chat__notification-list__edge--top'\n      />\n      <NotificationComponent\n        entryDirection={notificationEnterFrom}\n        key={notification.id}\n        notification={notification}\n        onDismiss={() => dismiss(notification.id)}\n        ref={(element) => {\n          observedElementRef.current = element;\n        }}\n        showClose={!notification.duration}\n        transitionState={transitionState}\n      />\n      <div\n        aria-hidden\n        className='str-chat__notification-list__edge str-chat__notification-list__edge--bottom'\n      />\n    </div>\n  );\n};\n"],"mappings":";;;;;;;;;AAgEA,IAAM,oBAAiF;CACrF,QAAQ;EAAE,GAAG;EAAM,GAAG;CAAO;CAC7B,MAAM;EAAE,GAAG;EAAS,GAAG;CAAK;CAC5B,OAAO;EAAE,GAAG;EAAQ,GAAG;CAAK;CAC5B,KAAK;EAAE,GAAG;EAAM,GAAG;CAAQ;AAC7B;AAEA,IAAM,oBAAoB;AAC1B,IAAM,yBAAyB;AAE/B,IAAM,eAAe,UACnB,UAAU,YAAY,UAAU,UAAU,UAAU,WAAW,UAAU;AAE3E,IAAM,4BACJ,cACA,sBACG;CACH,IAAI,CAAC,cAAc,OAAO;CAE1B,MAAM,oBAAoB,aAAa,UAAU;CACjD,IAAI,YAAY,iBAAiB,GAAG,OAAO;CAE3C,MAAM,kBAAkB,aAAa,OAAO,SAAS;CACrD,IAAI,YAAY,eAAe,GAAG,OAAO;CAEzC,OAAO;AACT;AAEA,IAAM,gBAAgB,iBAA+B,CAAC,aAAa;AAEnE,IAAM,gBAAgB,GAAwB,MAC5C,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,GAAG,QAAQ,EAAE,SAAS,EAAE;;AAGzC,IAAa,cAA6B,eAAe,cAAc;CACrE,MAAM,YAAY,WAAW,MAAM;CACnC,IAAI,SAA8B;CAClC,KAAK,MAAM,gBAAgB,eAAe;EACxC,IAAI,aAAa,OAAO,WAAW;EACnC,IAAI,CAAC,UAAU,aAAa,YAAY,OAAO,WAC7C,SAAS;CAEb;CACA,OAAO;AACT;;AAGA,IAAa,cAA6B,eAAe,cAAc;CACrE,MAAM,Y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