{"version":3,"file":"AriaLiveOutletContext.mjs","names":[],"sources":["../../../../src/components/Accessibility/AriaLiveOutletContext.ts"],"sourcesContent":["import { createContext, useContext } from 'react';\n\nimport type { AriaLivePriority } from './useAriaLiveAnnouncer';\n\nexport type LiveAnnouncement = {\n  id: number;\n  message: string;\n};\n\nexport type AnnouncementsByPriority = {\n  [key in AriaLivePriority]: LiveAnnouncement[];\n};\n\n/**\n * Coordination between {@link AriaLiveAnnouncerProvider}, which owns the announcements and the\n * outlet stack, and the {@link AriaLiveOutlet}s that render them. Internal: consumers announce\n * through `useAriaLiveAnnouncer`.\n */\nexport type AriaLiveOutletContextValue = {\n  /** ID of the outlet that currently renders the live regions. */\n  activeOutletId: symbol | null;\n  /** Current announcements by aria-live priority. */\n  announcementsByPriority: AnnouncementsByPriority;\n  /** Registers an outlet. The higher `layer` wins; ties go to the most recently registered. */\n  registerOutlet: (id: symbol, layer: number) => void;\n  unregisterOutlet: (id: symbol) => void;\n};\n\nexport const AriaLiveOutletContext = createContext<\n  AriaLiveOutletContextValue | undefined\n>(undefined);\n\nexport const useAriaLiveOutletContext = () => useContext(AriaLiveOutletContext);\n"],"mappings":";;AA4BA,IAAa,wBAAwB,cAEnC,KAAA,CAAS;AAEX,IAAa,iCAAiC,WAAW,qBAAqB"}