{"version":3,"file":"Notifications.cjs","names":["_Transition","getDefaultZIndex","notificationsStore","createVarsResolver","rem","factory","useProps","useMantineTheme","useNotifications","useForceUpdate","useReducedMotion","useRef","useState","useCallback","positions","getGroupedNotifications","useStyles","NotificationContainer","hideNotification","getNotificationStateStyles","OptionalPortal","Box","TransitionGroup","RemoveScroll","classes","notifications"],"sources":["../src/Notifications.tsx"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from 'react';\nimport {\n  Transition as _Transition,\n  TransitionGroup,\n  TransitionStatus,\n} from 'react-transition-group';\nimport {\n  BasePortalProps,\n  Box,\n  BoxProps,\n  createVarsResolver,\n  ElementProps,\n  factory,\n  Factory,\n  getDefaultZIndex,\n  OptionalPortal,\n  rem,\n  RemoveScroll,\n  StylesApiProps,\n  useMantineTheme,\n  useProps,\n  useStyles,\n} from '@mantine/core';\nimport { useDidUpdate, useForceUpdate, useReducedMotion } from '@mantine/hooks';\nimport {\n  getGroupedNotifications,\n  positions,\n} from './get-grouped-notifications/get-grouped-notifications';\nimport { getNotificationStateStyles } from './get-notification-state-styles';\nimport { NotificationContainer } from './NotificationContainer';\nimport {\n  hideNotification,\n  NotificationData,\n  NotificationPosition,\n  notifications,\n  NotificationsStore,\n  notificationsStore,\n  SequencedNotificationData,\n  useNotifications,\n} from './notifications.store';\nimport classes from './Notifications.module.css';\n\nconst Transition: any = _Transition;\n\n/** Vertical gap between notifications of an expanded stack, in px */\nconst STACK_EXPANDED_GAP = 16;\n\n/** Offset step used for a notification that has not been measured yet, in px */\nconst FALLBACK_NOTIFICATION_HEIGHT = 80;\n\nexport type NotificationsStylesNames = 'root' | 'notification' | 'progress';\nexport type NotificationsCssVariables = {\n  root: '--notifications-z-index' | '--notifications-container-width';\n};\n\nexport interface NotificationsProps\n  extends BoxProps, StylesApiProps<NotificationsFactory>, ElementProps<'div'> {\n  /** Notifications default position @default 'bottom-right' */\n  position?: NotificationPosition;\n\n  /** Auto close timeout for all notifications in ms, `false` to disable auto close, can be overwritten for individual notifications in `notifications.show` function @default 4000 */\n  autoClose?: number | false;\n\n  /** Notification transition duration in ms @default 250 */\n  transitionDuration?: number;\n\n  /** Determines whether notifications can be dismissed by dragging left or right @default true */\n  allowDragDismiss?: boolean;\n\n  /** Determines whether notifications can be dismissed with horizontal scroll gesture while hovered @default true */\n  allowScrollDismiss?: boolean;\n\n  /** Notification width, cannot exceed 100% @default 440 */\n  containerWidth?: number | string;\n\n  /** Notification `max-height`, used for transitions @default 200 */\n  notificationMaxHeight?: number | string;\n\n  /** Maximum number of notifications displayed at a time, other new notifications will be added to queue @default 5 */\n  limit?: number;\n\n  /** Notifications container z-index @default 400 */\n  zIndex?: string | number;\n\n  /** Props passed down to the `Portal` component */\n  portalProps?: BasePortalProps;\n\n  /** Store for notifications state, can be used to create multiple instances of notifications system in your application */\n  store?: NotificationsStore;\n\n  /** Determines whether notifications container should be rendered inside `Portal` @default true */\n  withinPortal?: boolean;\n\n  /** Determines which notifications should pause auto close on hover, `'all'` – pauses auto close for all notifications when any notification is hovered, `'notification'` – pauses auto close only for the hovered notification @default 'all' */\n  pauseResetOnHover?: 'all' | 'notification';\n\n  /** Custom render function that replaces the default notification, can be overridden per notification */\n  renderNotification?: (notification: NotificationData) => React.ReactNode;\n\n  /** Controls how notifications are positioned in the stack, `'default'` – standard vertical list, `'stacked'` – only first notification is fully visible, rest are stacked behind @default 'default' */\n  layout?: 'default' | 'stacked';\n\n  /** Determines whether a progress line that fills up until the notification auto closes is displayed at the bottom of every notification, can be overwritten for individual notifications in `notifications.show` and `notifications.update` functions @default false */\n  withAutoCloseProgress?: boolean;\n}\n\nexport type NotificationsFactory = Factory<{\n  props: NotificationsProps;\n  ref: HTMLDivElement;\n  stylesNames: NotificationsStylesNames;\n  vars: NotificationsCssVariables;\n  staticComponents: {\n    show: typeof notifications.show;\n    hide: typeof notifications.hide;\n    update: typeof notifications.update;\n    promise: typeof notifications.promise;\n    clean: typeof notifications.clean;\n    cleanQueue: typeof notifications.cleanQueue;\n    updateState: typeof notifications.updateState;\n  };\n}>;\n\nconst defaultProps = {\n  position: 'bottom-right',\n  autoClose: 4000,\n  transitionDuration: 250,\n  allowDragDismiss: true,\n  allowScrollDismiss: true,\n  containerWidth: 440,\n  notificationMaxHeight: 200,\n  limit: 5,\n  zIndex: getDefaultZIndex('overlay'),\n  store: notificationsStore,\n  withinPortal: true,\n  pauseResetOnHover: 'all',\n  layout: 'default',\n  withAutoCloseProgress: false,\n} satisfies Partial<NotificationsProps>;\n\nconst varsResolver = createVarsResolver<NotificationsFactory>((_, { zIndex, containerWidth }) => ({\n  root: {\n    '--notifications-z-index': zIndex?.toString(),\n    '--notifications-container-width': rem(containerWidth),\n  },\n}));\n\nexport const Notifications = factory<NotificationsFactory>((_props) => {\n  const props = useProps('Notifications', defaultProps, _props);\n  const {\n    classNames,\n    className,\n    style,\n    styles,\n    unstyled,\n    vars,\n    attributes,\n    position,\n    autoClose,\n    transitionDuration,\n    allowDragDismiss,\n    allowScrollDismiss,\n    containerWidth,\n    notificationMaxHeight,\n    limit,\n    zIndex,\n    store,\n    portalProps,\n    withinPortal,\n    pauseResetOnHover,\n    renderNotification,\n    layout,\n    withAutoCloseProgress,\n    ...others\n  } = props;\n\n  const theme = useMantineTheme();\n  const data = useNotifications(store);\n  const forceUpdate = useForceUpdate();\n  const shouldReduceMotion = useReducedMotion();\n  const refs = useRef<Record<string, HTMLDivElement>>({});\n  const previousLength = useRef<number>(0);\n  // Every position renders its own stack, so hover, expansion and pinning are tracked per\n  // position – a single shared flag made hovering one corner expand all six of them.\n  const [hoveredCounts, setHoveredCounts] = useState<Partial<Record<NotificationPosition, number>>>(\n    {}\n  );\n  const [expandedPositions, setExpandedPositions] = useState<\n    Partial<Record<NotificationPosition, boolean>>\n  >({});\n  const [hoveredGroups, setHoveredGroups] = useState<\n    Partial<Record<NotificationPosition, boolean>>\n  >({});\n  const [pinnedPosition, setPinnedPosition] = useState<NotificationPosition | null>(null);\n  const collapseTimeouts = useRef<Partial<Record<NotificationPosition, number>>>({});\n\n  // `pauseResetOnHover=\"all\"` is documented as pausing every notification when any one of\n  // them is hovered, so this stays global while the stack state above does not.\n  const hoveredCount =\n    Object.values(hoveredCounts).reduce((acc, count) => acc + (count ?? 0), 0) +\n    Object.values(hoveredGroups).filter(Boolean).length;\n\n  const handleHoverStart = useCallback(\n    (pos: NotificationPosition) =>\n      setHoveredCounts((current) => ({ ...current, [pos]: (current[pos] ?? 0) + 1 })),\n    []\n  );\n\n  const handleHoverEnd = useCallback(\n    (pos: NotificationPosition) =>\n      setHoveredCounts((current) => ({ ...current, [pos]: Math.max(0, (current[pos] ?? 0) - 1) })),\n    []\n  );\n\n  // Stacked hover is also tracked on the group element that wraps a stack, not only on the\n  // individual notifications. When the hovered notification unmounts, React does not deliver\n  // `onMouseEnter` to the one that slides under a stationary pointer: the browser dispatches\n  // only a `mouseover` for the new target (no `mouseout`, the old node is gone), and the\n  // enter/leave plugin drops it because its `relatedTarget` still resolves to a React\n  // instance. The group is hovered throughout, so its state needs no event to stay correct\n  // and the stack stays open until the pointer really leaves.\n  // Kept apart from the notification counter above so that it can be released on its own –\n  // the group has no unmount hook to fall back on the way a notification does.\n  const getGroupHoverProps = useCallback(\n    (pos: NotificationPosition) =>\n      layout === 'stacked'\n        ? {\n            onMouseEnter: () => setHoveredGroups((current) => ({ ...current, [pos]: true })),\n            onMouseLeave: () => setHoveredGroups((current) => ({ ...current, [pos]: false })),\n          }\n        : {},\n    [layout]\n  );\n\n  // Touch devices have no hover, so tapping the stack pins it open until the next tap\n  // outside of it. Without this the notifications behind the first one are unreachable.\n  const handleExpandRequest = useCallback(\n    (pos: NotificationPosition) => setPinnedPosition(pos),\n    []\n  );\n\n  useEffect(() => {\n    if (layout !== 'stacked') {\n      return undefined;\n    }\n\n    const timeouts = collapseTimeouts.current;\n\n    positions.forEach((pos) => {\n      if ((hoveredCounts[pos] ?? 0) > 0 || hoveredGroups[pos] || pinnedPosition === pos) {\n        window.clearTimeout(timeouts[pos]);\n        setExpandedPositions((current) => (current[pos] ? current : { ...current, [pos]: true }));\n      } else {\n        timeouts[pos] = window.setTimeout(() => {\n          setExpandedPositions((current) =>\n            current[pos] ? { ...current, [pos]: false } : current\n          );\n        }, 200);\n      }\n    });\n\n    return () => positions.forEach((pos) => window.clearTimeout(timeouts[pos]));\n  }, [hoveredCounts, hoveredGroups, pinnedPosition, layout]);\n\n  useEffect(() => {\n    if (!pinnedPosition) {\n      return undefined;\n    }\n\n    const handlePointerDown = (event: PointerEvent) => {\n      const target = event.target as Node | null;\n      const insideStack =\n        target !== null && Object.values(refs.current).some((element) => element?.contains(target));\n\n      if (!insideStack) {\n        setPinnedPosition(null);\n      }\n    };\n\n    document.addEventListener('pointerdown', handlePointerDown);\n    return () => document.removeEventListener('pointerdown', handlePointerDown);\n  }, [pinnedPosition]);\n\n  const grouped = getGroupedNotifications(data.notifications, position);\n  const pinnedCount = pinnedPosition ? grouped[pinnedPosition].length : 0;\n\n  useEffect(() => {\n    if (layout !== 'stacked' || (pinnedPosition !== null && pinnedCount === 0)) {\n      setPinnedPosition(null);\n    }\n  }, [pinnedCount, pinnedPosition, layout]);\n\n  // Leaving the stacked layout takes the handlers below out of the tree, so nothing can ever\n  // deliver the `mouseleave` that would release the group and a stale flag would keep auto\n  // close paused forever. Emptying a stack needs no such handling – the browser drops the\n  // hover on its own once the last notification is removed, and releasing it here instead\n  // would fire while the dismissed notification is still exiting under the pointer.\n  useEffect(() => {\n    if (layout !== 'stacked') {\n      setHoveredGroups((current) => (Object.values(current).some(Boolean) ? {} : current));\n    }\n  }, [layout]);\n\n  // Expanded stack offsets need the height of every notification. Measuring during render\n  // would force a layout pass on every hover, focus and store update, so heights are cached\n  // here and refreshed from the ResizeObserver – which also covers a notification that grows\n  // after mount (image loads, async content, viewport reflow) and would otherwise leave the\n  // ones after it overlapping or gapped until something else triggered a render.\n  const resizeObserver = useRef<ResizeObserver | null>(null);\n  const measuredHeights = useRef<Record<string, number>>({});\n  const observedIds = useRef(new WeakMap<Element, string>());\n\n  const measureNotification = useCallback((id: string, element: HTMLElement) => {\n    const height = element.offsetHeight;\n\n    if (measuredHeights.current[id] === height) {\n      return false;\n    }\n\n    measuredHeights.current[id] = height;\n    return true;\n  }, []);\n\n  useEffect(() => {\n    if (layout !== 'stacked' || typeof ResizeObserver === 'undefined') {\n      return undefined;\n    }\n\n    const observer = new ResizeObserver((entries) => {\n      let changed = false;\n\n      entries.forEach((entry) => {\n        const id = observedIds.current.get(entry.target);\n\n        if (id && measureNotification(id, entry.target as HTMLElement)) {\n          changed = true;\n        }\n      });\n\n      if (changed) {\n        forceUpdate();\n      }\n    });\n\n    resizeObserver.current = observer;\n    Object.values(refs.current).forEach((element) => element && observer.observe(element));\n\n    return () => {\n      observer.disconnect();\n      resizeObserver.current = null;\n    };\n  }, [layout, forceUpdate, measureNotification]);\n\n  const refCallbacks = useRef<Record<string, (node: HTMLDivElement | null) => void>>({});\n\n  const getNotificationRef = useCallback(\n    (id: string) => {\n      if (!refCallbacks.current[id]) {\n        refCallbacks.current[id] = (node: HTMLDivElement | null) => {\n          const previous = refs.current[id];\n\n          if (previous && previous !== node) {\n            resizeObserver.current?.unobserve(previous);\n            observedIds.current.delete(previous);\n          }\n\n          if (node) {\n            refs.current[id] = node;\n            observedIds.current.set(node, id);\n            // Measured here rather than during render – the commit phase is where a layout\n            // read is already paid for, and the ResizeObserver keeps the value fresh after.\n            measureNotification(id, node);\n            resizeObserver.current?.observe(node);\n          } else {\n            delete refs.current[id];\n            delete refCallbacks.current[id];\n            delete measuredHeights.current[id];\n          }\n        };\n      }\n\n      return refCallbacks.current[id];\n    },\n    [measureNotification]\n  );\n\n  const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n  const duration = reduceMotion ? 1 : transitionDuration;\n\n  const getStyles = useStyles<NotificationsFactory>({\n    name: 'Notifications',\n    classes,\n    props,\n    className,\n    style,\n    classNames,\n    styles,\n    unstyled,\n    attributes,\n    vars,\n    varsResolver,\n  });\n\n  useEffect(() => {\n    store?.updateState((current) => ({\n      ...current,\n      limit: limit || 5,\n      defaultPosition: position,\n    }));\n  }, [limit, position]);\n\n  useDidUpdate(() => {\n    if (data.notifications.length > previousLength.current) {\n      setTimeout(() => forceUpdate(), 0);\n    }\n    previousLength.current = data.notifications.length;\n  }, [data.notifications]);\n\n  const groupedComponents = positions.reduce(\n    (acc, pos) => {\n      const groupLength = grouped[pos].length;\n      const expandedOffsets: number[] = new Array(groupLength).fill(0);\n      const stackExpanded = layout === 'stacked' && !!expandedPositions[pos];\n\n      // `grouped[pos]` is sorted by priority descending, with equal priorities in insertion\n      // order. A stack is rendered front to back, so `stackOrder[0]` is the notification in\n      // front: the most urgent one, and the newest among equal priorities – only the\n      // tie-break is reversed here. Taking the front from the end of the priority-sorted\n      // array instead would put the *lowest* priority notification in front and leave an\n      // urgent one inert behind it.\n      // Rendering front first also keeps DOM order matching the visual stack – otherwise a\n      // forward Tab from the front notification (the only focusable one while collapsed)\n      // skips past the ones it just un-inerted and leaves the region. Placement is\n      // unaffected: stacked notifications share one grid cell and are positioned by\n      // transform and an explicit z-index.\n      const stackOrder =\n        layout === 'stacked'\n          ? [...(grouped[pos] as SequencedNotificationData[])].sort(\n              (a, b) =>\n                (b.priority ?? 0) - (a.priority ?? 0) || (b.__sequence ?? 0) - (a.__sequence ?? 0)\n            )\n          : grouped[pos];\n\n      if (stackExpanded && groupLength > 0) {\n        const direction = pos.startsWith('top') ? 1 : -1;\n        let cumOffset = 0;\n\n        for (let i = 0; i < groupLength; i += 1) {\n          expandedOffsets[i] = cumOffset * direction;\n          cumOffset +=\n            (measuredHeights.current[stackOrder[i].id!] || FALLBACK_NOTIFICATION_HEIGHT) +\n            STACK_EXPANDED_GAP;\n        }\n      }\n\n      acc[pos] = stackOrder.map((item, stackIndex) => {\n        const { style: notificationStyle, ...notification } = item;\n\n        return (\n          <Transition\n            key={notification.id}\n            timeout={duration}\n            onEnter={() => refs.current[notification.id!].offsetHeight}\n            nodeRef={{ current: refs.current[notification.id!] }}\n          >\n            {(state: TransitionStatus) => (\n              <NotificationContainer\n                ref={getNotificationRef(notification.id!)}\n                data={notification}\n                onHide={(id) => hideNotification(id, store)}\n                autoClose={autoClose}\n                transitionDuration={duration}\n                allowDragDismiss={allowDragDismiss}\n                allowScrollDismiss={allowScrollDismiss}\n                paused={\n                  (pauseResetOnHover === 'all' ? hoveredCount > 0 : false) ||\n                  (layout === 'stacked' && !stackExpanded && stackIndex > 0)\n                }\n                onHoverStart={() => handleHoverStart(pos)}\n                onHoverEnd={() => handleHoverEnd(pos)}\n                onExpandRequest={() => handleExpandRequest(pos)}\n                renderNotification={\n                  'renderNotification' in notification\n                    ? notification.renderNotification\n                    : renderNotification\n                }\n                layout={layout}\n                withAutoCloseProgress={withAutoCloseProgress}\n                progressProps={getStyles('progress')}\n                stackIndex={stackIndex}\n                stackSize={groupLength}\n                stackPosition={pos}\n                stackExpanded={stackExpanded}\n                stackExpandedOffset={expandedOffsets[stackIndex]}\n                transitionState={state}\n                {...getStyles('notification', {\n                  style: {\n                    ...getNotificationStateStyles({\n                      state,\n                      position: pos,\n                      transitionDuration: duration,\n                      maxHeight: notificationMaxHeight,\n                    }),\n                    ...notificationStyle,\n                  },\n                })}\n              />\n            )}\n          </Transition>\n        );\n      });\n\n      return acc;\n    },\n    {} as Record<NotificationPosition, React.ReactNode>\n  );\n\n  return (\n    <OptionalPortal withinPortal={withinPortal} {...portalProps}>\n      <Box {...getStyles('root')} data-position=\"top-center\" data-layout={layout} {...others}>\n        <TransitionGroup {...getGroupHoverProps('top-center')}>\n          {groupedComponents['top-center']}\n        </TransitionGroup>\n      </Box>\n\n      <Box {...getStyles('root')} data-position=\"top-left\" data-layout={layout} {...others}>\n        <TransitionGroup {...getGroupHoverProps('top-left')}>\n          {groupedComponents['top-left']}\n        </TransitionGroup>\n      </Box>\n\n      <Box\n        {...getStyles('root', { className: RemoveScroll.classNames.fullWidth })}\n        data-position=\"top-right\"\n        data-layout={layout}\n        {...others}\n      >\n        <TransitionGroup {...getGroupHoverProps('top-right')}>\n          {groupedComponents['top-right']}\n        </TransitionGroup>\n      </Box>\n\n      <Box\n        {...getStyles('root', { className: RemoveScroll.classNames.fullWidth })}\n        data-position=\"bottom-right\"\n        data-layout={layout}\n        {...others}\n      >\n        <TransitionGroup {...getGroupHoverProps('bottom-right')}>\n          {groupedComponents['bottom-right']}\n        </TransitionGroup>\n      </Box>\n\n      <Box {...getStyles('root')} data-position=\"bottom-left\" data-layout={layout} {...others}>\n        <TransitionGroup {...getGroupHoverProps('bottom-left')}>\n          {groupedComponents['bottom-left']}\n        </TransitionGroup>\n      </Box>\n\n      <Box {...getStyles('root')} data-position=\"bottom-center\" data-layout={layout} {...others}>\n        <TransitionGroup {...getGroupHoverProps('bottom-center')}>\n          {groupedComponents['bottom-center']}\n        </TransitionGroup>\n      </Box>\n    </OptionalPortal>\n  );\n});\n\nNotifications.classes = classes;\nNotifications.varsResolver = varsResolver;\nNotifications.displayName = '@mantine/notifications/Notifications';\nNotifications.show = notifications.show;\nNotifications.hide = notifications.hide;\nNotifications.update = notifications.update;\nNotifications.promise = notifications.promise;\nNotifications.clean = notifications.clean;\nNotifications.cleanQueue = notifications.cleanQueue;\nNotifications.updateState = notifications.updateState;\n"],"mappings":";;;;;;;;;;;;AA0CA,MAAM,aAAkBA,uBAAAA;;AAGxB,MAAM,qBAAqB;;AAG3B,MAAM,+BAA+B;AA0ErC,MAAM,eAAe;CACnB,UAAU;CACV,WAAW;CACX,oBAAoB;CACpB,kBAAkB;CAClB,oBAAoB;CACpB,gBAAgB;CAChB,uBAAuB;CACvB,OAAO;CACP,SAAA,GAAQC,cAAAA,iBAAAA,CAAiB,SAAS;CAClC,OAAOC,4BAAAA;CACP,cAAc;CACd,mBAAmB;CACnB,QAAQ;CACR,uBAAuB;AACzB;AAEA,MAAM,gBAAA,GAAeC,cAAAA,mBAAAA,EAA0C,GAAG,EAAE,QAAQ,sBAAsB,EAChG,MAAM;CACJ,2BAA2B,QAAQ,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