{"version":3,"sources":["../../../src/components/OutletScope.tsx"],"sourcesContent":["import { type PropsWithChildren, useMemo } from 'react';\nimport { OutletScopeProvider } from '../context/NovuUIContext';\nimport { OutletStore } from '../context/OutletStore';\nimport { OutletHost } from './OutletHost';\n\ntype OutletScopeProps = PropsWithChildren<{\n  /** A store the parent already holds, because it built renderers on it during its own render; otherwise one is created. */\n  store?: OutletStore;\n}>;\n\n/**\n * Hosts the outlets of the component that renders it, at that component's place in the React tree.\n *\n * React events from portal content bubble through the React tree, not the DOM. A custom bell rendered inside a\n * host's popover trigger only reaches the trigger's `onClick` when its portal sits beneath the trigger, so the\n * components a host can wrap in children mode (`Bell`, `Notifications`, `InboxContent`) carry their own scope\n * instead of leaving their outlets to the outermost scope in `NovuUI`.\n */\nexport const OutletScope = ({ store, children }: OutletScopeProps) => {\n  const outlets = useMemo(() => store ?? new OutletStore(), [store]);\n\n  return (\n    <OutletScopeProvider value={outlets}>\n      {children}\n      {/* after the children on purpose: their render props update refs during render, the outlets read them */}\n      <OutletHost store={outlets} />\n    </OutletScopeProvider>\n  );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAgD;AAChD,2BAAoC;AACpC,yBAA4B;AAC5B,wBAA2B;AAmBvB;AAJG,IAAM,cAAc,CAAC,EAAE,OAAO,SAAS,MAAwB;AACpE,QAAM,cAAU,sBAAQ,MAAM,SAAS,IAAI,+BAAY,GAAG,CAAC,KAAK,CAAC;AAEjE,SACE,6CAAC,4CAAoB,OAAO,SACzB;AAAA;AAAA,IAED,4CAAC,gCAAW,OAAO,SAAS;AAAA,KAC9B;AAEJ;","names":[]}