tfy-web-components 0.0.43 → 0.0.45

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/dist/{Button-CPJYHldw.js → Button-HHEfL8b9.js} +5 -4
  2. package/dist/{Button-CPJYHldw.js.map → Button-HHEfL8b9.js.map} +1 -1
  3. package/dist/CSPContext-Cldo9QDp.js +13 -0
  4. package/dist/CSPContext-Cldo9QDp.js.map +1 -0
  5. package/dist/{CompositeItem-DJWNsIwE.js → CompositeItem-GNejxLcK.js} +3 -3
  6. package/dist/{CompositeItem-DJWNsIwE.js.map → CompositeItem-GNejxLcK.js.map} +1 -1
  7. package/dist/{CompositeRoot-BlljDWkR.js → CompositeRoot-7_u1HqDT.js} +9 -47
  8. package/dist/CompositeRoot-7_u1HqDT.js.map +1 -0
  9. package/dist/DropdownMenu-Crlf-J4E.js +3304 -0
  10. package/dist/DropdownMenu-Crlf-J4E.js.map +1 -0
  11. package/dist/{Input-Dcxu6SVO.js → Input-BS9fWUAf.js} +3 -3
  12. package/dist/{Input-Dcxu6SVO.js.map → Input-BS9fWUAf.js.map} +1 -1
  13. package/dist/{Modal-BUWlwJcN.js → Modal-DaHG8mjy.js} +10 -10
  14. package/dist/{Modal-BUWlwJcN.js.map → Modal-DaHG8mjy.js.map} +1 -1
  15. package/dist/Popover-A8IyEt2w.js +400 -0
  16. package/dist/Popover-A8IyEt2w.js.map +1 -0
  17. package/dist/{Popover-BqqXJnK1.js → PopoverPopup-teGm7D5T.js} +25 -498
  18. package/dist/PopoverPopup-teGm7D5T.js.map +1 -0
  19. package/dist/PrehydrationScript-B3u_PP2W.js +49 -0
  20. package/dist/PrehydrationScript-B3u_PP2W.js.map +1 -0
  21. package/dist/Select-BtX40h2K.js +2187 -0
  22. package/dist/Select-BtX40h2K.js.map +1 -0
  23. package/dist/{useValueAsRef-BfFRcMg6.js → addEventListener-D-i9O6BG.js} +8 -8
  24. package/dist/addEventListener-D-i9O6BG.js.map +1 -0
  25. package/dist/clamp-D7_nsB8C.js +30 -0
  26. package/dist/clamp-D7_nsB8C.js.map +1 -0
  27. package/dist/components/atoms/Accordion.es.js +9 -9
  28. package/dist/components/atoms/Avatar.es.js +9 -9
  29. package/dist/components/atoms/Avatar.es.js.map +1 -1
  30. package/dist/components/atoms/Badge.d.ts +5 -6
  31. package/dist/components/atoms/Badge.es.js +80 -43
  32. package/dist/components/atoms/Badge.es.js.map +1 -1
  33. package/dist/components/atoms/Button.d.ts +1 -1
  34. package/dist/components/atoms/Button.es.js +2 -2
  35. package/dist/components/atoms/ButtonGroup.es.js +1 -1
  36. package/dist/components/atoms/Combobox.d.ts +34 -0
  37. package/dist/components/atoms/Combobox.es.js +3252 -0
  38. package/dist/components/atoms/Combobox.es.js.map +1 -0
  39. package/dist/components/atoms/ContextMenu.d.ts +12 -0
  40. package/dist/components/atoms/ContextMenu.es.js +259 -0
  41. package/dist/components/atoms/ContextMenu.es.js.map +1 -0
  42. package/dist/components/atoms/DropdownMenu.d.ts +51 -0
  43. package/dist/components/atoms/DropdownMenu.es.js +31 -0
  44. package/dist/components/atoms/DropdownMenu.es.js.map +1 -0
  45. package/dist/components/atoms/IconButton.d.ts +1 -1
  46. package/dist/components/atoms/IconButton.es.js +3 -3
  47. package/dist/components/atoms/IconButton.es.js.map +1 -1
  48. package/dist/components/atoms/IconProvider.es.js +4 -1
  49. package/dist/components/atoms/IconProvider.es.js.map +1 -1
  50. package/dist/components/atoms/Modal.es.js +1 -1
  51. package/dist/components/atoms/OverflowButton.es.js +2 -2
  52. package/dist/components/atoms/PaginationDot.d.ts +14 -0
  53. package/dist/components/atoms/PaginationDot.es.js +58 -0
  54. package/dist/components/atoms/PaginationDot.es.js.map +1 -0
  55. package/dist/components/atoms/PaginationItem.d.ts +15 -0
  56. package/dist/components/atoms/PaginationItem.es.js +87 -0
  57. package/dist/components/atoms/PaginationItem.es.js.map +1 -0
  58. package/dist/components/atoms/Popover.d.ts +10 -0
  59. package/dist/components/atoms/Popover.es.js +50 -0
  60. package/dist/components/atoms/Popover.es.js.map +1 -0
  61. package/dist/components/atoms/Select.d.ts +63 -0
  62. package/dist/components/atoms/Select.es.js +23 -0
  63. package/dist/components/atoms/Select.es.js.map +1 -0
  64. package/dist/components/atoms/Switch.es.js +7 -6
  65. package/dist/components/atoms/Switch.es.js.map +1 -1
  66. package/dist/components/atoms/TabButton.d.ts +31 -6
  67. package/dist/components/atoms/TabButton.es.js +425 -55
  68. package/dist/components/atoms/TabButton.es.js.map +1 -1
  69. package/dist/components/atoms/Tag.d.ts +2 -2
  70. package/dist/components/atoms/Tag.es.js +66 -33
  71. package/dist/components/atoms/Tag.es.js.map +1 -1
  72. package/dist/components/atoms/Tooltip.es.js +1153 -19
  73. package/dist/components/atoms/Tooltip.es.js.map +1 -1
  74. package/dist/components/atoms/stories/OverlayThemePanels.d.ts +8 -0
  75. package/dist/components/molecules/Alert.es.js +3 -3
  76. package/dist/components/molecules/CopyField.es.js +2 -2
  77. package/dist/components/molecules/CustomDrawer.es.js +1 -1
  78. package/dist/components/molecules/Dialog.es.js +1 -1
  79. package/dist/components/molecules/ImagesPreview.es.js +2 -2
  80. package/dist/components/molecules/Input.es.js +2 -2
  81. package/dist/components/molecules/Markdown.es.js +1 -1
  82. package/dist/components/molecules/Pagination.d.ts +58 -0
  83. package/dist/components/molecules/Pagination.es.js +272 -0
  84. package/dist/components/molecules/Pagination.es.js.map +1 -0
  85. package/dist/components/molecules/SimpleCodeEditor.es.js +3 -3
  86. package/dist/components/molecules/SimpleCodeEditor.es.js.map +1 -1
  87. package/dist/components/molecules/TagGroup.d.ts +11 -0
  88. package/dist/components/molecules/TagGroup.es.js +59 -0
  89. package/dist/components/molecules/TagGroup.es.js.map +1 -0
  90. package/dist/components/molecules/ToggleButton.es.js +2 -2
  91. package/dist/components/molecules/TopBar.d.ts +47 -0
  92. package/dist/components/molecules/TopBar.es.js +164 -0
  93. package/dist/components/molecules/TopBar.es.js.map +1 -0
  94. package/dist/components/molecules/agent-chat/AssistantMessage.d.ts +3 -1
  95. package/dist/components/molecules/agent-chat.es.js +4 -3
  96. package/dist/components/molecules/agent-chat.es.js.map +1 -1
  97. package/dist/components/theme/colors.es.js +1 -0
  98. package/dist/components/theme/colors.es.js.map +1 -1
  99. package/dist/composite-DnShFmi7.js +551 -0
  100. package/dist/composite-DnShFmi7.js.map +1 -0
  101. package/dist/{composite-C22yiNy1.js → composite-IA--dSel.js} +2 -2
  102. package/dist/{composite-C22yiNy1.js.map → composite-IA--dSel.js.map} +1 -1
  103. package/dist/constants-BaUKmVF_.js +103 -0
  104. package/dist/constants-BaUKmVF_.js.map +1 -0
  105. package/dist/{index-C-2yrwZl.js → element-B1vbc-LG.js} +69 -111
  106. package/dist/element-B1vbc-LG.js.map +1 -0
  107. package/dist/error-nCTLdGUr.js +6 -0
  108. package/dist/{error-FX4R42W-.js.map → error-nCTLdGUr.js.map} +1 -1
  109. package/dist/index.d.ts +12 -2
  110. package/dist/index.es.js +65 -12
  111. package/dist/index.es.js.map +1 -1
  112. package/dist/{inertValue-IJM5NA30.js → inertValue-C1Ml1s55.js} +2 -2
  113. package/dist/{inertValue-IJM5NA30.js.map → inertValue-C1Ml1s55.js.map} +1 -1
  114. package/dist/isElementDisabled-lq1fKien.js +47 -0
  115. package/dist/isElementDisabled-lq1fKien.js.map +1 -0
  116. package/dist/new-components/atoms/Alert.d.ts +9 -1
  117. package/dist/new-components/atoms/Alert.es.js +38 -13
  118. package/dist/new-components/atoms/Alert.es.js.map +1 -1
  119. package/dist/new-components/atoms/Checkbox.es.js +8 -7
  120. package/dist/new-components/atoms/Checkbox.es.js.map +1 -1
  121. package/dist/new-components/atoms/EmptyState.d.ts +3 -0
  122. package/dist/new-components/atoms/EmptyState.es.js +9 -4
  123. package/dist/new-components/atoms/EmptyState.es.js.map +1 -1
  124. package/dist/new-components/atoms/Popover.es.js +3 -2
  125. package/dist/new-components/atoms/Popover.es.js.map +1 -1
  126. package/dist/new-components/atoms/Radio.es.js +13 -24
  127. package/dist/new-components/atoms/Radio.es.js.map +1 -1
  128. package/dist/new-components/atoms/SegmentedControl.es.js +7 -7
  129. package/dist/new-components/atoms/Slider.es.js +14 -88
  130. package/dist/new-components/atoms/Slider.es.js.map +1 -1
  131. package/dist/new-components/atoms/Toast.d.ts +8 -12
  132. package/dist/new-components/atoms/Toast.es.js +202 -145
  133. package/dist/new-components/atoms/Toast.es.js.map +1 -1
  134. package/dist/new-components/atoms/Toggletip.d.ts +1 -1
  135. package/dist/new-components/atoms/Toggletip.es.js +3 -2
  136. package/dist/new-components/atoms/Toggletip.es.js.map +1 -1
  137. package/dist/new-components/atoms/stories/ThemeComparison.d.ts +2 -1
  138. package/dist/serializeValue-BLvnTy3o.js +17 -0
  139. package/dist/serializeValue-BLvnTy3o.js.map +1 -0
  140. package/dist/stringifyLocale-DOx30wH1.js +13 -0
  141. package/dist/stringifyLocale-DOx30wH1.js.map +1 -0
  142. package/dist/style.css +1 -1
  143. package/dist/tokens.css +24 -6
  144. package/dist/{useAnimationFrame-DwhymJoW.js → useAnimationFrame-DqvuRtgK.js} +2 -2
  145. package/dist/{useAnimationFrame-DwhymJoW.js.map → useAnimationFrame-DqvuRtgK.js.map} +1 -1
  146. package/dist/{useAriaLabelledBy-Lyj6n_TU.js → useAriaLabelledBy-CP4wKTYs.js} +3 -3
  147. package/dist/{useAriaLabelledBy-Lyj6n_TU.js.map → useAriaLabelledBy-CP4wKTYs.js.map} +1 -1
  148. package/dist/{useBaseUiId-CmLtG9DS.js → useBaseUiId-CYT1vFMG.js} +64 -44
  149. package/dist/{useBaseUiId-CmLtG9DS.js.map → useBaseUiId-CYT1vFMG.js.map} +1 -1
  150. package/dist/{useButton-D2BMuSfC.js → useButton-BlHadUfM.js} +4 -4
  151. package/dist/{useButton-D2BMuSfC.js.map → useButton-BlHadUfM.js.map} +1 -1
  152. package/dist/{CompositeList-D4xmSZ5V.js → useCompositeListItem-DlAKWsHE.js} +59 -59
  153. package/dist/useCompositeListItem-DlAKWsHE.js.map +1 -0
  154. package/dist/{useControlled-BSyYkg5C.js → useControlled-DMDWXIzj.js} +2 -2
  155. package/dist/{useControlled-BSyYkg5C.js.map → useControlled-DMDWXIzj.js.map} +1 -1
  156. package/dist/useFocus-C__7iwl1.js +137 -0
  157. package/dist/useFocus-C__7iwl1.js.map +1 -0
  158. package/dist/{useIsoLayoutEffect-e9VA-ICd.js → useIsoLayoutEffect-D2lpsB9D.js} +8 -4
  159. package/dist/{useIsoLayoutEffect-e9VA-ICd.js.map → useIsoLayoutEffect-D2lpsB9D.js.map} +1 -1
  160. package/dist/{usePopupHandleStore-CkW2IoED.js → usePopupHandleStore-C_Vw7xcw.js} +1966 -2002
  161. package/dist/usePopupHandleStore-C_Vw7xcw.js.map +1 -0
  162. package/dist/{Tooltip-uQIVdskf.js → usePositioner-BmYVsMO_.js} +17 -1402
  163. package/dist/usePositioner-BmYVsMO_.js.map +1 -0
  164. package/dist/{useOpenInteractionType-CDFYOw2d.js → useScrollLock-By-42HSc.js} +74 -58
  165. package/dist/useScrollLock-By-42HSc.js.map +1 -0
  166. package/dist/{useLabelableId-CcIE3RU0.js → useSetFieldFocused-CcdG6FNp.js} +27 -35
  167. package/dist/useSetFieldFocused-CcdG6FNp.js.map +1 -0
  168. package/dist/{useTimeout-BXf1hDIL.js → useTimeout-D1vYJgq4.js} +3 -3
  169. package/dist/{useTimeout-BXf1hDIL.js.map → useTimeout-D1vYJgq4.js.map} +1 -1
  170. package/dist/{useTransitionStatus-C9gg_XJ-.js → useTransitionStatus-CHrs3i5F.js} +3 -3
  171. package/dist/{useTransitionStatus-C9gg_XJ-.js.map → useTransitionStatus-CHrs3i5F.js.map} +1 -1
  172. package/dist/useTriggerFocusGuards-CXAhW8P6.js +100 -0
  173. package/dist/useTriggerFocusGuards-CXAhW8P6.js.map +1 -0
  174. package/dist/useValueChanged-BnlOop8k.js +16 -0
  175. package/dist/useValueChanged-BnlOop8k.js.map +1 -0
  176. package/package.json +1 -1
  177. package/dist/CompositeList-D4xmSZ5V.js.map +0 -1
  178. package/dist/CompositeRoot-BlljDWkR.js.map +0 -1
  179. package/dist/Popover-BqqXJnK1.js.map +0 -1
  180. package/dist/Tooltip-uQIVdskf.js.map +0 -1
  181. package/dist/composite-BL4bbAWg.js +0 -66
  182. package/dist/composite-BL4bbAWg.js.map +0 -1
  183. package/dist/error-FX4R42W-.js +0 -6
  184. package/dist/index-C-2yrwZl.js.map +0 -1
  185. package/dist/shadowDom-BfewIqRj.js +0 -52
  186. package/dist/shadowDom-BfewIqRj.js.map +0 -1
  187. package/dist/useLabelableId-CcIE3RU0.js.map +0 -1
  188. package/dist/useOpenInteractionType-CDFYOw2d.js.map +0 -1
  189. package/dist/usePopupHandleStore-CkW2IoED.js.map +0 -1
  190. package/dist/useValueAsRef-BfFRcMg6.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"usePopupHandleStore-CkW2IoED.js","sources":["../node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs","../node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs","../node_modules/@base-ui/react/utils/popupStateMapping.mjs","../node_modules/@base-ui/utils/platform/os.mjs","../node_modules/@base-ui/utils/platform/engine.mjs","../node_modules/@base-ui/utils/platform/screen-reader.mjs","../node_modules/@base-ui/react/floating-ui-react/utils/event.mjs","../node_modules/@base-ui/utils/mergeCleanups.mjs","../node_modules/@base-ui/react/utils/FocusGuard.mjs","../node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs","../node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs","../node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs","../node_modules/@base-ui/react/internals/constants.mjs","../node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs","../node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs","../node_modules/@base-ui/react/floating-ui-react/components/FloatingTreeStore.mjs","../node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs","../node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs","../node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs","../node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs","../node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs","../node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js","../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../node_modules/use-sync-external-store/shim/with-selector.js","../node_modules/@base-ui/utils/fastHooks.mjs","../node_modules/@base-ui/utils/store/useStore.mjs","../node_modules/@base-ui/utils/store/Store.mjs","../node_modules/@base-ui/utils/store/ReactStore.mjs","../node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs","../node_modules/@base-ui/react/utils/popups/store.mjs","../node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs"],"sourcesContent":["import * as TransitionStatusDataAttributes from \"../internals/TransitionStatusDataAttributes.mjs\";\n\n/**\n * Present when the popup is open.\n */\nexport const open = 'data-open';\n\n/**\n * Present when the popup is closed.\n */\nexport const closed = 'data-closed';\n\n/**\n * Present when the popup begins animating in.\n */\nexport const startingStyle = TransitionStatusDataAttributes.startingStyle;\n\n/**\n * Present when the popup is animating out.\n */\nexport const endingStyle = TransitionStatusDataAttributes.endingStyle;\n\n/**\n * Present when the anchor is hidden.\n */\nexport const anchorHidden = 'data-anchor-hidden';\n\n/**\n * Indicates which side the popup is positioned relative to the trigger.\n * @type { 'top' | 'bottom' | 'left' | 'right' | 'inline-end' | 'inline-start'}\n */\nexport const side = 'data-side';\n\n/**\n * Indicates how the popup is aligned relative to specified side.\n * @type {'start' | 'center' | 'end'}\n */\nexport const align = 'data-align';","/**\n * Present when the popup is open.\n */\nexport const popupOpen = 'data-popup-open';\n\n/**\n * Present when a pressable trigger is pressed.\n */\nexport const pressed = 'data-pressed';","import { transitionStatusMapping } from \"../internals/stateAttributesMapping.mjs\";\nimport * as CommonPopupDataAttributes from \"./CommonPopupDataAttributes.mjs\";\nimport * as CommonTriggerDataAttributes from \"./CommonTriggerDataAttributes.mjs\";\nexport { CommonPopupDataAttributes, CommonTriggerDataAttributes };\nconst TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: ''\n};\nconst PRESSABLE_TRIGGER_HOOK = {\n [CommonTriggerDataAttributes.popupOpen]: '',\n [CommonTriggerDataAttributes.pressed]: ''\n};\nconst POPUP_OPEN_HOOK = {\n [CommonPopupDataAttributes.open]: ''\n};\nconst POPUP_CLOSED_HOOK = {\n [CommonPopupDataAttributes.closed]: ''\n};\nconst ANCHOR_HIDDEN_HOOK = {\n [CommonPopupDataAttributes.anchorHidden]: ''\n};\nexport const triggerOpenStateMapping = {\n open(value) {\n if (value) {\n return TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const pressableTriggerOpenStateMapping = {\n open(value) {\n if (value) {\n return PRESSABLE_TRIGGER_HOOK;\n }\n return null;\n }\n};\nexport const popupStateMapping = {\n open(value) {\n if (value) {\n return POPUP_OPEN_HOOK;\n }\n return POPUP_CLOSED_HOOK;\n },\n anchorHidden(value) {\n if (value) {\n return ANCHOR_HIDDEN_HOOK;\n }\n return null;\n }\n};\nexport const popupTransitionStateMapping = {\n ...popupStateMapping,\n ...transitionStatusMapping\n};","import { lowerUserAgent, lowerPlatform, maxTouchPoints } from \"./shared.mjs\";\n\n// iPadOS 13+ reports `MacIntel` for `navigator.platform`; disambiguated via\n// `maxTouchPoints` so iPad is classified as iOS, not macOS.\n// https://github.com/mui/base-ui/issues/1309\n/** iPhone, iPad (including iPadOS 13+ reporting as macOS), iPod. */\nexport const ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === 'macintel' && maxTouchPoints > 1;\n\n/** Android phones, tablets, and embedded Android browsers. */\nconst ANDROID_STRING = 'android';\nexport const android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING);\n\n/** macOS desktop. Excludes iPadOS, which reports as `MacIntel`. */\nexport const mac = !ios && lowerPlatform.startsWith('mac');\n\n/** Windows desktop. */\nexport const windows = lowerPlatform.startsWith('win');\n\n/** Linux desktop (including Chrome OS). */\nexport const linux = !android && /^(linux|chrome os)/.test(lowerPlatform);\n\n/** Any Apple OS (`mac || ios`). */\nexport const apple = mac || ios;","import { lowerUserAgent } from \"./shared.mjs\";\n\n// WebKit (Safari, all iOS browsers, GNOME Web). Distinguished from Blink by\n// the legacy `-webkit-backdrop-filter` name — Blink forked from WebKit in 2013\n// and only ships the unprefixed `backdrop-filter`.\n/** WebKit: Safari, all iOS browsers, GNOME Web. Excludes Blink. */\nexport const webkit = typeof CSS !== 'undefined' && !!CSS.supports?.('-webkit-backdrop-filter:none');\n\n// Anchored to `!webkit` so engines are mutually exclusive by construction.\n// Firefox-on-iOS uses WebKit (its UA marker is `FxiOS/`, not `Firefox/`); the\n// `!webkit` prefix also defends against future iOS-browser UA changes that\n// might inject `Firefox` into a WebKit-based UA.\n/** Gecko: Firefox. */\nexport const gecko = !webkit && lowerUserAgent.includes('firefox');\n\n// All Chromium-based browsers ship `Chrome/` or `Chromium/` in their UA — both\n// share the `chrom` prefix, so a single substring check covers Chrome, Edge,\n// Opera, Brave, etc. Chrome-on-iOS uses `CriOS/` and stays WebKit. The positive\n// UA check also makes this SSR-safe — an empty UA matches nothing.\n/** Blink: Chrome, Edge, Opera, Brave, and other Chromium-based browsers. */\nexport const blink = !webkit && lowerUserAgent.includes('chrom');","import { apple } from \"./os.mjs\";\n\n// Whether a screen reader is *actually* running cannot be detected. These flags\n// identify platforms where a specific screen reader could be active. VoiceOver\n// is the system screen reader on Apple platforms and works with every browser\n// there, so the flag is purely an OS check; engine-specific quirks (e.g. the\n// NSAccessibility virtual-cursor focus path) should be gated at the call site.\n/**\n * The user *may* be using VoiceOver — actual activation is not detectable.\n * True on any Apple platform (macOS, iOS, iPadOS).\n */\nexport const voiceOver = apple;","import { platform } from '@base-ui/utils/platform';\nexport function stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\nexport function isReactEvent(event) {\n return 'nativeEvent' in event;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/main/packages/@react-aria/utils/src/isVirtualEvent.ts\nexport function isVirtualClick(event) {\n if (event.pointerType === '' && event.isTrusted) {\n return true;\n }\n if (platform.os.android && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nexport function isVirtualPointerEvent(event) {\n if (platform.env.jsdom) {\n return false;\n }\n return !platform.os.android && event.width === 0 && event.height === 0 ||\n // Chrome synthesizes a screen reader press (TalkBack, VoiceOver, NVDA) as a 1x1 mouse\n // `pointerdown` with no pressure. TalkBack can report a pressed button, while desktop\n // mouse presses can report no pressure, so only require no pressed button off Android.\n event.type === 'pointerdown' && event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'mouse' && (platform.os.android || event.buttons === 0) ||\n // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0 && event.pointerType === 'touch';\n}\nexport function isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\nexport function isClickLikeEvent(event) {\n const type = event.type;\n return type === 'click' || type === 'mousedown' || type === 'keydown' || type === 'keyup';\n}","/**\n * Combines multiple cleanup functions into a single cleanup function.\n */\nexport function mergeCleanups(...cleanups) {\n return () => {\n for (let i = 0; i < cleanups.length; i += 1) {\n const cleanup = cleanups[i];\n if (cleanup) {\n cleanup();\n }\n }\n };\n}","'use client';\n\nimport * as React from 'react';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { platform } from '@base-ui/utils/platform';\nimport { visuallyHidden } from '@base-ui/utils/visuallyHidden';\n\n/**\n * @internal\n */\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const [role, setRole] = React.useState();\n useIsoLayoutEffect(() => {\n // Unlike NVDA and JAWS, VoiceOver's virtual cursor triggers `onFocus` as\n // it moves — but only on focusable/role-button elements through WebKit's\n // NSAccessibility path. Setting `role=\"button\"` lets the focus trap catch\n // the cursor.\n if (platform.screenReader.voiceOver && platform.engine.webkit) {\n setRole('button');\n }\n }, []);\n const restProps = {\n tabIndex: 0,\n // Role is only for VoiceOver\n role\n };\n return /*#__PURE__*/_jsx(\"span\", {\n ...props,\n ref: ref,\n style: visuallyHidden,\n \"aria-hidden\": role ? undefined : true,\n ...restProps,\n \"data-base-ui-focus-guard\": \"\"\n });\n});\nif (process.env.NODE_ENV !== \"production\") FocusGuard.displayName = \"FocusGuard\";","import { getComputedStyle, getNodeName, isHTMLElement, isShadowRoot } from '@floating-ui/utils/dom';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { activeElement, contains } from \"./element.mjs\";\nimport { isElementVisible } from \"./composite.mjs\";\nconst CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable=\"false\"]),audio[controls],video[controls]';\nfunction getParentElement(element) {\n const assignedSlot = element.assignedSlot;\n if (assignedSlot) {\n return assignedSlot;\n }\n if (element.parentElement) {\n return element.parentElement;\n }\n const rootNode = element.getRootNode();\n return isShadowRoot(rootNode) ? rootNode.host : null;\n}\nfunction getDetailsSummary(details) {\n for (const child of Array.from(details.children)) {\n if (getNodeName(child) === 'summary') {\n return child;\n }\n }\n return null;\n}\nfunction isWithinOpenDetailsSummary(element, details) {\n const summary = getDetailsSummary(details);\n return !!summary && (element === summary || contains(summary, element));\n}\nfunction isFocusableCandidate(element) {\n const nodeName = element ? getNodeName(element) : '';\n return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== 'summary' || element.parentElement != null && getNodeName(element.parentElement) === 'details' && getDetailsSummary(element.parentElement) === element) && (nodeName !== 'details' || getDetailsSummary(element) == null) && (nodeName !== 'input' || element.type !== 'hidden');\n}\nfunction isFocusableElement(element) {\n if (!isFocusableCandidate(element) || !element.isConnected || element.matches(':disabled')) {\n return false;\n }\n for (let current = element; current; current = getParentElement(current)) {\n const isAncestor = current !== element;\n const isSlot = getNodeName(current) === 'slot';\n if (current.hasAttribute('inert')) {\n return false;\n }\n if (isAncestor && getNodeName(current) === 'details' && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute('hidden') || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) {\n return false;\n }\n }\n return true;\n}\nfunction isVisibleInTabbableTree(element, isAncestor) {\n const styles = getComputedStyle(element);\n if (!isAncestor) {\n return isElementVisible(element, styles);\n }\n return styles.display !== 'none';\n}\nfunction getTabIndex(element) {\n const tabIndex = element.tabIndex;\n if (tabIndex < 0) {\n const nodeName = getNodeName(element);\n if (nodeName === 'details' || nodeName === 'audio' || nodeName === 'video' || isHTMLElement(element) && element.isContentEditable) {\n return 0;\n }\n }\n return tabIndex;\n}\nfunction getNamedRadioInput(element) {\n if (getNodeName(element) !== 'input') {\n return null;\n }\n const input = element;\n return input.type === 'radio' && input.name !== '' ? input : null;\n}\nfunction isTabbableRadio(element, candidates) {\n const input = getNamedRadioInput(element);\n if (!input) {\n return true;\n }\n const checkedRadio = candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form && radio.checked;\n });\n if (checkedRadio) {\n return checkedRadio === input;\n }\n return candidates.find(candidate => {\n const radio = getNamedRadioInput(candidate);\n return radio?.name === input.name && radio.form === input.form;\n }) === input;\n}\nfunction getComposedChildren(container) {\n if (isHTMLElement(container) && getNodeName(container) === 'slot') {\n const assignedElements = container.assignedElements({\n flatten: true\n });\n if (assignedElements.length > 0) {\n return assignedElements;\n }\n }\n if (isHTMLElement(container) && container.shadowRoot) {\n return Array.from(container.shadowRoot.children);\n }\n return Array.from(container.children);\n}\nfunction appendCandidates(container, list) {\n getComposedChildren(container).forEach(child => {\n if (isFocusableCandidate(child)) {\n list.push(child);\n }\n appendCandidates(child, list);\n });\n}\nfunction appendMatchingElements(container, selector, list) {\n getComposedChildren(container).forEach(child => {\n if (isHTMLElement(child) && child.matches(selector)) {\n list.push(child);\n }\n appendMatchingElements(child, selector, list);\n });\n}\nexport function isTabbable(element) {\n return isFocusableElement(element) && getTabIndex(element) >= 0;\n}\nexport function focusable(container) {\n const candidates = [];\n appendCandidates(container, candidates);\n return candidates.filter(isFocusableElement);\n}\nexport function tabbable(container) {\n const candidates = focusable(container);\n return candidates.filter(element => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates));\n}\nfunction getTabbableIn(container, dir) {\n const list = tabbable(container);\n const len = list.length;\n if (len === 0) {\n return undefined;\n }\n const active = activeElement(ownerDocument(container));\n const index = list.indexOf(active);\n // eslint-disable-next-line no-nested-ternary\n const nextIndex = index === -1 ? dir === 1 ? 0 : len - 1 : index + dir;\n return list[nextIndex];\n}\nexport function getNextTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement;\n}\nexport function getPreviousTabbable(referenceElement) {\n return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;\n}\nexport function getTabbableNearElement(referenceElement, direction, exclude) {\n if (!referenceElement) {\n return null;\n }\n\n // Keep the anchor's composed-tree position separate from the focusable radio candidates.\n const list = [];\n appendCandidates(ownerDocument(referenceElement).body, list);\n const index = list.indexOf(referenceElement);\n if (index === -1) {\n return null;\n }\n const candidates = list.filter(isFocusableElement);\n for (let offset = 1; offset < list.length; offset += 1) {\n const element = list[(index + direction * offset + list.length) % list.length];\n if (!contains(exclude, element) && isTabbable(element) && isTabbableRadio(element, candidates)) {\n return element;\n }\n }\n return list[index];\n}\nexport function isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nexport function disableFocusInside(container) {\n const tabbableElements = tabbable(container);\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nexport function enableFocusInside(container) {\n const elements = [];\n appendMatchingElements(container, '[data-tabindex]', elements);\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}","/* eslint-disable @typescript-eslint/no-loop-func */\n\nexport function getNodeChildren(nodes, id, onlyOpenChildren = true) {\n const directChildren = nodes.filter(node => node.parentId === id);\n return directChildren.flatMap(child => [...(!onlyOpenChildren || child.context?.open ? [child] : []), ...getNodeChildren(nodes, child.id, onlyOpenChildren)]);\n}\nexport function getNodeAncestors(nodes, id) {\n let allAncestors = [];\n let currentParentId = nodes.find(node => node.id === id)?.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode?.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}","export function createAttribute(name) {\n return `data-base-ui-${name}`;\n}","export const TYPEAHEAD_RESET_MS = 500;\nexport const PATIENT_CLICK_THRESHOLD = 500;\nexport const DISABLED_TRANSITIONS_STYLE = {\n style: {\n transition: 'none'\n }\n};\nexport const CLICK_TRIGGER_IDENTIFIER = 'data-base-ui-click-trigger';\nexport const BASE_UI_SWIPE_IGNORE_ATTRIBUTE = 'data-base-ui-swipe-ignore';\nexport const LEGACY_SWIPE_IGNORE_ATTRIBUTE = 'data-swipe-ignore';\nexport const BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;\nexport const LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;\n\n/**\n * Used for dropdowns that usually strictly prefer top/bottom placements and\n * use `var(--available-height)` to limit their height.\n */\nexport const DROPDOWN_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'none'\n};\n\n/**\n * Used by regular popups that usually aren't scrollable and are allowed to\n * freely flip to any axis of placement.\n */\nexport const POPUP_COLLISION_AVOIDANCE = {\n fallbackAxisSide: 'end'\n};\n\n/**\n * Special visually hidden styles for the aria-owns owner element to ensure owned element\n * accessibility in iOS/Safari/VoiceControl.\n * The owner element is an empty span, so most of the common visually hidden styles are not needed.\n * @see https://github.com/floating-ui/floating-ui/issues/3403\n */\nexport const ownerVisuallyHidden = {\n clipPath: 'inset(50%)',\n position: 'fixed',\n top: 0,\n left: 0\n};","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { isNode } from '@floating-ui/utils/dom';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FocusGuard } from \"../../utils/FocusGuard.mjs\";\nimport { enableFocusInside, disableFocusInside, getPreviousTabbable, getNextTabbable, isOutsideEvent } from \"../utils/tabbable.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { useRenderElement } from \"../../internals/useRenderElement.mjs\";\nimport { ownerVisuallyHidden } from \"../../internals/constants.mjs\";\nimport { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") PortalContext.displayName = \"PortalContext\";\nexport const usePortalContext = () => React.useContext(PortalContext);\nconst attr = createAttribute('portal');\nexport function useFloatingPortalNode(props = {}) {\n const {\n ref,\n container: containerProp,\n componentProps = EMPTY_OBJECT,\n elementProps\n } = props;\n const uniqueId = useId();\n const portalContext = usePortalContext();\n const parentPortalNode = portalContext?.portalNode;\n const [containerElement, setContainerElement] = React.useState(null);\n const [portalNode, setPortalNode] = React.useState(null);\n const setPortalNodeRef = useStableCallback(node => {\n if (node !== null) {\n // the useIsoLayoutEffect below watching containerProp / parentPortalNode\n // sets setPortalNode(null) when the container becomes null or changes.\n // So even though the ref callback now ignores null, the portal node still gets cleared.\n setPortalNode(node);\n }\n });\n const containerRef = React.useRef(null);\n useIsoLayoutEffect(() => {\n // Wait for the container to be resolved if explicitly `null`.\n if (containerProp === null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body;\n if (resolvedContainer == null) {\n if (containerRef.current) {\n containerRef.current = null;\n setPortalNode(null);\n setContainerElement(null);\n }\n return;\n }\n if (containerRef.current !== resolvedContainer) {\n containerRef.current = resolvedContainer;\n setPortalNode(null);\n setContainerElement(resolvedContainer);\n }\n }, [containerProp, parentPortalNode]);\n const portalElement = useRenderElement('div', componentProps, {\n ref: [ref, setPortalNodeRef],\n props: [{\n id: uniqueId,\n [attr]: ''\n }, elementProps]\n });\n\n // This `createPortal` call injects `portalElement` into the `container`.\n // Another call inside `FloatingPortal`/`FloatingPortalLite` then injects the children into `portalElement`.\n const portalSubtree = containerElement && portalElement ? /*#__PURE__*/ReactDOM.createPortal(portalElement, containerElement) : null;\n return {\n node: portalNode,\n // `id` and `render` props can override or remove the generated ID. Use the exact\n // rendered value so `aria-owns` never points at an ID absent from the DOM.\n nodeId: /*#__PURE__*/React.isValidElement(portalElement) ? portalElement.props.id : undefined,\n subtree: portalSubtree\n };\n}\n\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * This is necessary to ensure the floating element can appear outside any\n * potential parent containers that cause clipping (such as `overflow: hidden`),\n * while retaining its location in the React tree.\n * @see https://floating-ui.com/docs/FloatingPortal\n * @internal\n */\nexport const FloatingPortal = /*#__PURE__*/React.forwardRef(function FloatingPortal(componentProps, forwardedRef) {\n const {\n render,\n className,\n style,\n children,\n container,\n portalOwnerRole,\n ...elementProps\n } = componentProps;\n const {\n node: portalNode,\n nodeId: portalNodeId,\n subtree: portalSubtree\n } = useFloatingPortalNode({\n container,\n ref: forwardedRef,\n componentProps,\n elementProps\n });\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const focusInsideDisabledRef = React.useRef(false);\n const modal = focusManagerState?.modal;\n const open = focusManagerState?.open;\n const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode;\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || modal) {\n return undefined;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && event.relatedTarget && isOutsideEvent(event)) {\n if (event.type === 'focusin') {\n if (focusInsideDisabledRef.current) {\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }\n } else {\n disableFocusInside(portalNode);\n focusInsideDisabledRef.current = true;\n }\n }\n }\n\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n return mergeCleanups(addEventListener(portalNode, 'focusin', onFocus, true), addEventListener(portalNode, 'focusout', onFocus, true));\n }, [portalNode, modal]);\n useIsoLayoutEffect(() => {\n if (!portalNode || open !== true || !focusInsideDisabledRef.current) {\n return;\n }\n\n // Restore tabbability before the focus manager's queued focus-on-open step runs.\n enableFocusInside(portalNode);\n focusInsideDisabledRef.current = false;\n }, [open, portalNode]);\n const portalContextValue = React.useMemo(() => ({\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [portalNode]);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [portalSubtree, /*#__PURE__*/_jsxs(PortalContext.Provider, {\n value: portalContextValue,\n children: [shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n beforeInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const prevTabbable = getPreviousTabbable(domReference);\n prevTabbable?.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(\"span\", {\n role: portalOwnerRole,\n \"aria-owns\": portalNodeId,\n style: ownerVisuallyHidden\n }), portalNode && /*#__PURE__*/ReactDOM.createPortal(children, portalNode), shouldRenderGuards && portalNode && /*#__PURE__*/_jsx(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n afterInsideRef.current?.focus();\n } else {\n const domReference = focusManagerState ? focusManagerState.domReference : null;\n const nextTabbable = getNextTabbable(domReference);\n nextTabbable?.focus();\n if (focusManagerState?.closeOnFocusOut) {\n focusManagerState?.onOpenChange(false, createChangeEventDetails(REASONS.focusOut, event.nativeEvent));\n }\n }\n }\n })]\n })]\n });\n});\nif (process.env.NODE_ENV !== \"production\") FloatingPortal.displayName = \"FloatingPortal\";","export function createEventEmitter() {\n const map = new Map();\n return {\n emit(event, data) {\n map.get(event)?.forEach(listener => listener(data));\n },\n on(event, listener) {\n if (!map.has(event)) {\n map.set(event, new Set());\n }\n map.get(event).add(listener);\n },\n off(event, listener) {\n map.get(event)?.delete(listener);\n }\n };\n}","import { createEventEmitter } from \"../utils/createEventEmitter.mjs\";\n\n/**\n * Stores and manages floating elements in a tree structure.\n * This is a backing store for the `FloatingTree` component.\n */\nexport class FloatingTreeStore {\n nodesRef = {\n current: []\n };\n events = createEventEmitter();\n addNode(node) {\n this.nodesRef.current.push(node);\n }\n removeNode(node) {\n const index = this.nodesRef.current.findIndex(n => n === node);\n if (index !== -1) {\n this.nodesRef.current.splice(index, 1);\n }\n }\n}","'use client';\n\nimport * as React from 'react';\nimport { useId } from '@base-ui/utils/useId';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FloatingTreeStore } from \"./FloatingTreeStore.mjs\";\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nif (process.env.NODE_ENV !== \"production\") FloatingNodeContext.displayName = \"FloatingNodeContext\";\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\n\n/**\n * Returns the parent node id for nested floating elements, if available.\n * Returns `null` for top-level floating elements.\n */\nif (process.env.NODE_ENV !== \"production\") FloatingTreeContext.displayName = \"FloatingTreeContext\";\nexport const useFloatingParentNodeId = () => React.useContext(FloatingNodeContext)?.id || null;\n\n/**\n * Returns the nearest floating tree context, if available.\n */\nexport const useFloatingTree = externalTree => {\n const contextTree = React.useContext(FloatingTreeContext);\n return externalTree ?? contextTree;\n};\n\n/**\n * Registers a node into the `FloatingTree`, returning its id.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nexport function useFloatingNodeId(externalTree) {\n const id = useId();\n const tree = useFloatingTree(externalTree);\n const parentId = useFloatingParentNodeId();\n useIsoLayoutEffect(() => {\n if (!id) {\n return undefined;\n }\n const node = {\n id,\n parentId\n };\n tree?.addNode(node);\n return () => {\n tree?.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n}\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingNode(props) {\n const {\n children,\n id\n } = props;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/_jsx(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId]),\n children: children\n });\n}\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM.\n * This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:\n * - The `bubbles` option in the `useDismiss()` Hook\n * - Nested virtual list navigation\n * - Nested floating elements that each open on hover\n * - Custom communication between parent and child floating elements\n * @see https://floating-ui.com/docs/FloatingTree\n * @internal\n */\nexport function FloatingTree(props) {\n const {\n children,\n externalTree\n } = props;\n const tree = useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;\n return /*#__PURE__*/_jsx(FloatingTreeContext.Provider, {\n value: tree,\n children: children\n });\n}","'use client';\n\n/* eslint-disable no-underscore-dangle */\nimport * as React from 'react';\nimport { addEventListener } from '@base-ui/utils/addEventListener';\nimport { mergeCleanups } from '@base-ui/utils/mergeCleanups';\nimport { ownerDocument } from '@base-ui/utils/owner';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { Timeout, useTimeout } from '@base-ui/utils/useTimeout';\nimport { getComputedStyle, getParentNode, isElement, isHTMLElement, isLastTraversableNode, isShadowRoot } from '@floating-ui/utils/dom';\nimport { platform } from '@base-ui/utils/platform';\nimport { useFloatingTree } from \"../components/FloatingTree.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nimport { createAttribute } from \"../utils/createAttribute.mjs\";\nimport { contains, getTarget, isEventTargetWithin, isRootElement } from \"../utils/element.mjs\";\nimport { isReactEvent, isVirtualClick } from \"../utils/event.mjs\";\nimport { getNodeChildren } from \"../utils/nodes.mjs\";\nfunction alwaysFalse() {\n return false;\n}\nexport function normalizeProp(normalizable) {\n return {\n escapeKey: typeof normalizable === 'boolean' ? normalizable : normalizable?.escapeKey ?? false,\n outsidePress: typeof normalizable === 'boolean' ? normalizable : normalizable?.outsidePress ?? true\n };\n}\n/**\n * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nexport function useDismiss(store, props = {}) {\n const {\n enabled = true,\n escapeKey = true,\n outsidePress: outsidePressProp = true,\n outsidePressEvent = 'sloppy',\n referencePress = alwaysFalse,\n bubbles,\n externalTree\n } = props;\n const open = store.useState('open');\n const floatingElement = store.useState('floatingElement');\n const {\n dataRef,\n events\n } = store.context;\n const tree = useFloatingTree(externalTree);\n const outsidePressFn = useStableCallback(typeof outsidePressProp === 'function' ? outsidePressProp : () => false);\n const outsidePress = typeof outsidePressProp === 'function' ? outsidePressFn : outsidePressProp;\n const outsidePressEnabled = outsidePress !== false;\n const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent);\n const {\n escapeKey: escapeKeyBubbles,\n outsidePress: outsidePressBubbles\n } = normalizeProp(bubbles);\n const pressStartedInsideRef = React.useRef(false);\n const pressStartPreventedRef = React.useRef(false);\n // Ignore only the very next outside click after dragging from inside to outside.\n const suppressNextOutsideClickRef = React.useRef(false);\n // A click whose press began before the floating element opened is the tail of that\n // gesture (e.g. the drag-release that opened it), not a new outside press.\n const sawPressWhileOpenRef = React.useRef(false);\n const isComposingRef = React.useRef(false);\n const currentPointerTypeRef = React.useRef('');\n const touchStateRef = React.useRef(null);\n const cancelDismissOnEndTimeout = useTimeout();\n const clearInsideReactTreeTimeout = useTimeout();\n // Outlives effect re-runs so a pending reset can't leave `isComposingRef` stuck.\n const compositionTimeout = useTimeout();\n const clearInsideReactTree = useStableCallback(() => {\n clearInsideReactTreeTimeout.clear();\n dataRef.current.insideReactTree = false;\n });\n const hasBlockingChild = useStableCallback(bubbleKey => {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : [];\n return children.some(child => child.context?.open && !child.context.dataRef.current[bubbleKey]);\n });\n const isEventWithinOwnElements = useStableCallback(event => {\n return isEventTargetWithin(event, store.select('floatingElement')) || isEventTargetWithin(event, store.select('domReferenceElement'));\n });\n const closeOnReferencePress = useStableCallback(event => {\n if (!referencePress()) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.triggerPress, event.nativeEvent));\n });\n const closeOnEscapeKeyDown = useStableCallback(event => {\n if (!open || !enabled || !escapeKey || event.key !== 'Escape') {\n return;\n }\n const native = isReactEvent(event) ? event.nativeEvent : event;\n\n // Wait until IME is settled. Pressing `Escape` while composing should\n // close the compose menu, but not the floating element. The ref covers Safari, which fires\n // `compositionend` before `keydown`; `isComposing` covers compositions that began while closed.\n if (isComposingRef.current || native.isComposing) {\n return;\n }\n if (!escapeKeyBubbles && hasBlockingChild('__escapeKeyBubbles')) {\n return;\n }\n const eventDetails = createChangeEventDetails(REASONS.escapeKey, native);\n store.setOpen(false, eventDetails);\n if (!eventDetails.isCanceled) {\n event.preventDefault();\n }\n if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) {\n event.stopPropagation();\n }\n });\n const markInsideReactTree = useStableCallback(() => {\n dataRef.current.insideReactTree = true;\n clearInsideReactTreeTimeout.start(0, clearInsideReactTree);\n });\n const markPressStartedInsideReactTree = useStableCallback(event => {\n if (!open || !enabled || event.button !== 0) {\n return;\n }\n const target = getTarget(event.nativeEvent);\n\n // Only treat presses that start within the floating DOM subtree as inside.\n // This avoids suppressing parent dismissal when interacting with nested portals.\n if (!contains(store.select('floatingElement'), target)) {\n return;\n }\n if (!pressStartedInsideRef.current) {\n pressStartedInsideRef.current = true;\n pressStartPreventedRef.current = false;\n }\n });\n const markInsidePressStartPrevented = useStableCallback(event => {\n if (!open || !enabled) {\n return;\n }\n if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) {\n return;\n }\n if (pressStartedInsideRef.current) {\n pressStartPreventedRef.current = true;\n }\n });\n\n // A same-batch close+reopen never renders `open === false`, so only `openchange` can\n // observe that session boundary. The effect below covers controlled flips.\n React.useEffect(() => {\n function handleOpenChange(details) {\n // Only the closing half ends the session: `setOpen(true)` on an already-open\n // element (hovering an inactive trigger) must not drop a press mid-gesture.\n if (!details.open) {\n sawPressWhileOpenRef.current = false;\n }\n }\n events.on('openchange', handleOpenChange);\n return () => {\n events.off('openchange', handleOpenChange);\n };\n }, [events]);\n\n // Not cleared in the listener effect's cleanup, which can run mid-press when a dependency\n // changes. In a closed shadow root, the marker is the only inside-press signal.\n React.useEffect(() => clearInsideReactTree, [clearInsideReactTree]);\n React.useEffect(() => {\n if (!open || !enabled) {\n // Reset in the effect body, not the cleanup, which also runs when a dependency\n // changes mid-gesture.\n if (!open) {\n sawPressWhileOpenRef.current = false;\n isComposingRef.current = false;\n currentPointerTypeRef.current = '';\n touchStateRef.current = null;\n }\n return clearInsideReactTree;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n const preventedPressSuppressionTimeout = new Timeout();\n const doc = ownerDocument(floatingElement);\n function handleCompositionStart() {\n compositionTimeout.clear();\n isComposingRef.current = true;\n }\n function handleCompositionEnd() {\n // Safari fires `compositionend` before `keydown`, so we need to wait\n // until the next tick to set `isComposing` to `false`. Set it here too, since closing\n // resets it while a composition can continue into the next open session.\n // https://bugs.webkit.org/show_bug.cgi?id=165004\n isComposingRef.current = true;\n compositionTimeout.start(\n // 0ms or 1ms don't work in Safari. 5ms appears to consistently work.\n // Only apply to WebKit for the test to remain 0ms.\n platform.engine.webkit ? 5 : 0, () => {\n isComposingRef.current = false;\n });\n }\n function suppressImmediateOutsideClickAfterPreventedStart() {\n suppressNextOutsideClickRef.current = true;\n // Firefox can emit the synthetic outside click in a later task after\n // pointer lock exit, so microtask clearing is too early here.\n preventedPressSuppressionTimeout.start(0, () => {\n suppressNextOutsideClickRef.current = false;\n });\n }\n function resetPressStartState() {\n pressStartedInsideRef.current = false;\n pressStartPreventedRef.current = false;\n }\n function getOutsidePressEvent() {\n const type = currentPointerTypeRef.current;\n const computedType = type === 'pen' || !type ? 'mouse' : type;\n const outsidePressEventValue = getOutsidePressEventProp();\n const resolved = typeof outsidePressEventValue === 'function' ? outsidePressEventValue() : outsidePressEventValue;\n if (typeof resolved === 'string') {\n return resolved;\n }\n return resolved[computedType];\n }\n function shouldIgnoreEvent(event) {\n const computedOutsidePressEvent = getOutsidePressEvent();\n return computedOutsidePressEvent === 'intentional' && event.type !== 'click' || computedOutsidePressEvent === 'sloppy' && event.type === 'click';\n }\n function isEventWithinFloatingTree(event) {\n const nodeId = dataRef.current.floatingContext?.nodeId;\n const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some(node => isEventTargetWithin(event, node.context?.elements.floating));\n return isEventWithinOwnElements(event) || targetIsInsideChildren;\n }\n function closeOnPressOutside(event) {\n if (shouldIgnoreEvent(event)) {\n // A new press began outside the floating element and its trigger. Clear any\n // leftover drag-out suppression so this press's eventual click can dismiss.\n if (event.type !== 'click' && !isEventWithinOwnElements(event)) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n }\n clearInsideReactTree();\n return;\n }\n if (dataRef.current.insideReactTree) {\n clearInsideReactTree();\n return;\n }\n const target = getTarget(event);\n const inertSelector = `[${createAttribute('inert')}]`;\n const targetRoot = isElement(target) ? target.getRootNode() : null;\n const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select('floatingElement'))).querySelectorAll(inertSelector));\n const triggers = store.context.triggerElements;\n\n // If another trigger is clicked, don't close the floating element.\n if (target && (triggers.hasElement(target) || triggers.hasMatchingElement(trigger => contains(trigger, target)))) {\n return;\n }\n let targetRootAncestor = isElement(target) ? target : null;\n while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) {\n const nextParent = getParentNode(targetRootAncestor);\n if (isLastTraversableNode(nextParent) || !isElement(nextParent)) {\n break;\n }\n targetRootAncestor = nextParent;\n }\n\n // Check if the click occurred on a third-party element injected after the\n // floating element rendered.\n if (markers.length && isElement(target) && !isRootElement(target) &&\n // Clicked on a direct ancestor (e.g. FloatingOverlay).\n !contains(target, store.select('floatingElement')) &&\n // If the target root element contains none of the markers, then the\n // element was injected after the floating element rendered.\n markers.every(marker => !contains(targetRootAncestor, marker))) {\n return;\n }\n\n // Check if the click occurred on the scrollbar\n // Skip for touch events: scrollbars don't receive touch events on most platforms\n if (isHTMLElement(target) && !('touches' in event)) {\n const lastTraversableNode = isLastTraversableNode(target);\n const style = getComputedStyle(target);\n const scrollRe = /auto|scroll/;\n const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX);\n const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY);\n const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth;\n const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight;\n const isRTL = style.direction === 'rtl';\n\n // Check click position relative to scrollbar.\n // In some browsers it is possible to change the <body> (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n const pressedVerticalScrollbar = canScrollY && (isRTL ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth);\n const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight;\n if (pressedVerticalScrollbar || pressedHorizontalScrollbar) {\n return;\n }\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // Only `click` events reach this point in intentional mode.\n if (getOutsidePressEvent() === 'intentional') {\n // Press-less clicks (keyboard, assistive technology, `element.click()`) report no\n // click count; `isVirtualClick` also catches the ones that do.\n if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) {\n return;\n }\n\n // A press that starts inside and ends outside gets one suppressed\n // outside click. Run this after inside-target checks so inside clicks\n // don't consume the one-shot suppression.\n if (suppressNextOutsideClickRef.current) {\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = false;\n return;\n }\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n if (hasBlockingChild('__outsidePressBubbles')) {\n return;\n }\n store.setOpen(false, createChangeEventDetails(REASONS.outsidePress, event));\n clearInsideReactTree();\n }\n function handlePointerDown(event) {\n if (getOutsidePressEvent() !== 'sloppy' || event.pointerType === 'touch' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n closeOnPressOutside(event);\n }\n function handleTouchStart(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !store.select('open') || !enabled || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (touch) {\n touchStateRef.current = {\n startTime: Date.now(),\n startX: touch.clientX,\n startY: touch.clientY,\n dismissOnTouchEnd: false,\n dismissOnMouseDown: true\n };\n cancelDismissOnEndTimeout.start(1000, () => {\n if (touchStateRef.current) {\n touchStateRef.current.dismissOnTouchEnd = false;\n touchStateRef.current.dismissOnMouseDown = false;\n }\n });\n }\n }\n function addTargetEventListenerOnce(event, listener) {\n const target = getTarget(event);\n if (!target) {\n return;\n }\n const unsubscribe = addEventListener(target, event.type, () => {\n listener(event);\n unsubscribe();\n });\n }\n function handleTouchStartCapture(event) {\n currentPointerTypeRef.current = 'touch';\n addTargetEventListenerOnce(event, handleTouchStart);\n }\n function closeOnPressOutsideCapture(event) {\n cancelDismissOnEndTimeout.clear();\n\n // Only `pointerdown` marks a press; `mousedown` is its compatibility event, and\n // counting it would misattribute a gesture that started before open.\n if (event.type === 'pointerdown') {\n // Only a primary press can produce a `click`.\n if (event.button === 0) {\n sawPressWhileOpenRef.current = true;\n }\n currentPointerTypeRef.current = event.pointerType;\n }\n if (event.type === 'mousedown' && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) {\n return;\n }\n addTargetEventListenerOnce(event, targetEvent => {\n if (targetEvent.type === 'pointerdown') {\n handlePointerDown(targetEvent);\n } else {\n closeOnPressOutside(targetEvent);\n }\n });\n }\n function handlePressEndCapture(event) {\n // A cancelled gesture produces no click. Not cleared on `pointerup`: the click\n // fires after it and must still find the press.\n if (event.type === 'pointercancel') {\n sawPressWhileOpenRef.current = false;\n }\n if (!pressStartedInsideRef.current) {\n return;\n }\n const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current;\n resetPressStartState();\n if (getOutsidePressEvent() !== 'intentional') {\n return;\n }\n if (event.type === 'pointercancel') {\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n }\n return;\n }\n if (isEventWithinFloatingTree(event)) {\n return;\n }\n\n // If pointerdown was prevented, no click may be generated for that\n // interaction. However, Firefox may still emit an immediate click after\n // pointerup (e.g. NumberField scrub with pointer lock), so suppress for\n // one tick to absorb that synthetic click only.\n if (pressStartedInsideDefaultPrevented) {\n suppressImmediateOutsideClickAfterPreventedStart();\n return;\n }\n\n // Avoid suppressing when outsidePress explicitly ignores this target.\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n preventedPressSuppressionTimeout.clear();\n suppressNextOutsideClickRef.current = true;\n clearInsideReactTree();\n }\n function handleTouchMove(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX);\n const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY);\n const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY);\n if (distance > 5) {\n touchStateRef.current.dismissOnTouchEnd = true;\n }\n if (distance > 10) {\n closeOnPressOutside(event);\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n }\n function handleTouchMoveCapture(event) {\n addTargetEventListenerOnce(event, handleTouchMove);\n }\n function handleTouchEnd(event) {\n if (getOutsidePressEvent() !== 'sloppy' || !touchStateRef.current || isEventWithinOwnElements(event)) {\n return;\n }\n if (touchStateRef.current.dismissOnTouchEnd) {\n closeOnPressOutside(event);\n }\n cancelDismissOnEndTimeout.clear();\n touchStateRef.current = null;\n }\n function handleTouchEndCapture(event) {\n addTargetEventListenerOnce(event, handleTouchEnd);\n }\n const unsubscribe = mergeCleanups(escapeKey && mergeCleanups(addEventListener(doc, 'keydown', closeOnEscapeKeyDown), addEventListener(doc, 'compositionstart', handleCompositionStart), addEventListener(doc, 'compositionend', handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, 'click', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerdown', closeOnPressOutsideCapture, true), addEventListener(doc, 'pointerup', handlePressEndCapture, true), addEventListener(doc, 'pointercancel', handlePressEndCapture, true), addEventListener(doc, 'mousedown', closeOnPressOutsideCapture, true), addEventListener(doc, 'mouseup', handlePressEndCapture, true), addEventListener(doc, 'touchstart', handleTouchStartCapture, {\n capture: true,\n passive: true\n }), addEventListener(doc, 'touchmove', handleTouchMoveCapture, {\n capture: true,\n passive: true\n }), addEventListener(doc, 'touchend', handleTouchEndCapture, {\n capture: true,\n passive: true\n })));\n return () => {\n unsubscribe();\n preventedPressSuppressionTimeout.clear();\n resetPressStartState();\n suppressNextOutsideClickRef.current = false;\n };\n }, [dataRef, floatingElement, escapeKey, outsidePressEnabled, outsidePress, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout, compositionTimeout]);\n const reference = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n onPointerDown: closeOnReferencePress,\n onClick: closeOnReferencePress\n }), [closeOnEscapeKeyDown, closeOnReferencePress]);\n const floating = React.useMemo(() => ({\n onKeyDown: closeOnEscapeKeyDown,\n // `onMouseDown` may be blocked if `event.preventDefault()` is called in\n // `onPointerDown`, such as with <NumberField.ScrubArea>.\n // See https://github.com/mui/base-ui/pull/3379\n onPointerDown: markInsidePressStartPrevented,\n onMouseDown: markInsidePressStartPrevented,\n onClickCapture: markInsideReactTree,\n onMouseDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onPointerDownCapture(event) {\n markInsideReactTree();\n markPressStartedInsideReactTree(event);\n },\n onMouseUpCapture: markInsideReactTree,\n onTouchEndCapture: markInsideReactTree,\n onTouchMoveCapture: markInsideReactTree\n }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]);\n return React.useMemo(() => enabled ? {\n reference,\n floating,\n trigger: reference\n } : {}, [enabled, reference, floating]);\n}","'use client';\n\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { isElement } from '@floating-ui/utils/dom';\n\n/**\n * Narrowed to the store members this hook uses so consumers do not need to provide\n * unrelated store capabilities.\n */\n\n/**\n * Keeps the provided FloatingRootStore in sync with the provided PopupStore.\n */\nexport function useSyncedFloatingRootContext(options) {\n const {\n popupStore,\n treatPopupAsFloatingElement = false,\n floatingRootContext: store,\n floatingId,\n nested,\n onOpenChange\n } = options;\n const open = popupStore.useState('open');\n const referenceElement = popupStore.useState('activeTriggerElement');\n const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? 'popupElement' : 'positionerElement');\n const handleOpenChange = onOpenChange;\n popupStore.useSyncedValue('floatingId', floatingId);\n useIsoLayoutEffect(() => {\n const valuesToSync = {\n open,\n floatingId,\n referenceElement,\n floatingElement\n };\n if (isElement(referenceElement)) {\n valuesToSync.domReferenceElement = referenceElement;\n }\n if (store.state.positionReference === store.state.referenceElement) {\n valuesToSync.positionReference = referenceElement;\n }\n store.update(valuesToSync);\n }, [open, floatingId, referenceElement, floatingElement, store]);\n\n // Keep non-reactive context values fresh for interactions that call `store.setOpen`.\n store.context.onOpenChange = handleOpenChange;\n store.context.nested = nested;\n return store;\n}","'use client';\n\nimport * as React from 'react';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useForcedRerendering } from '@base-ui/utils/useForcedRerendering';\nimport { useTransitionStatus } from \"./useTransitionStatus.mjs\";\nimport { useOpenChangeComplete } from \"./useOpenChangeComplete.mjs\";\n/**\n * Keeps a popup mounted through its closing animation and unmounts it once the animation\n * finishes, unless the close cycle opted out through `preventUnmountOnClose`.\n * Store-agnostic: hosts sync `mounted` and `transitionStatus` wherever they need them.\n *\n * @returns `forceUnmount` unmounts the popup immediately. It is a no-op once the popup is already\n * unmounted, so calling it after the automatic unmount doesn't repeat the completion callback,\n * and a call while the popup is open only takes effect if a close commits in the same batch.\n */\nexport function useUnmountAfterClose(parameters) {\n const {\n open,\n ref,\n preventUnmountOnClose,\n setPreventUnmountOnClose: setPreventUnmountOnCloseParam,\n onUnmount,\n animateInitialOpen\n } = parameters;\n const setPreventUnmountOnClose = useStableCallback(setPreventUnmountOnCloseParam);\n const {\n mounted,\n setMounted,\n transitionStatus\n } = useTransitionStatus(open, false, false, animateInitialOpen);\n\n // Opening starts a new close cycle. Derive during render so the close-completion hook below\n // reads the value on the same pass, and clear the stored value so it doesn't leak into the next\n // close. The effect only runs when `open` changes, so an opt-out recorded while a controlled\n // close is still pending (for example in a transition) is not cleared by the render that still\n // sees `open`.\n const preventUnmountingOnClose = open ? false : preventUnmountOnClose;\n useIsoLayoutEffect(() => {\n if (open) {\n setPreventUnmountOnClose(false);\n }\n }, [open, setPreventUnmountOnClose]);\n\n // Mirrors `mounted` synchronously so repeated `forceUnmount()` calls in one batch complete\n // closing once. Resynced on every commit: `setMounted(false)` while open re-mounts on the next\n // render without changing the committed `mounted`, so a `[mounted]` dependency would leave the\n // mirror stale and block every later unmount.\n const mountedRef = React.useRef(mounted);\n const pendingUnmountRef = React.useRef(false);\n const rerender = useForcedRerendering();\n const unmount = () => {\n mountedRef.current = false;\n setMounted(false);\n onUnmount();\n };\n useIsoLayoutEffect(() => {\n mountedRef.current = mounted;\n if (pendingUnmountRef.current) {\n pendingUnmountRef.current = false;\n if (!open && mounted) {\n unmount();\n }\n }\n });\n const forceUnmount = useStableCallback(() => {\n if (!mountedRef.current) {\n return;\n }\n if (open) {\n // The rendered `open` can't tell a stale exit-animation callback after a quick reopen from a\n // close batched with this call (`close(); unmount()`). Decide once the batch commits: unmount\n // if the popup closed, otherwise drop the call rather than run the host's unmount cleanup and\n // the close completion against a live popup.\n pendingUnmountRef.current = true;\n rerender();\n return;\n }\n unmount();\n });\n useOpenChangeComplete({\n enabled: mounted && !open && !preventUnmountingOnClose,\n open,\n ref,\n onComplete() {\n if (!open) {\n forceUnmount();\n }\n }\n });\n return {\n mounted,\n transitionStatus,\n preventUnmountingOnClose,\n forceUnmount\n };\n}","'use client';\n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { useId } from '@base-ui/utils/useId';\nimport { useStableCallback } from '@base-ui/utils/useStableCallback';\nimport { useIsoLayoutEffect } from '@base-ui/utils/useIsoLayoutEffect';\nimport { useRefWithInit } from '@base-ui/utils/useRefWithInit';\nimport { FOCUSABLE_ATTRIBUTE } from \"../../floating-ui-react/utils/constants.mjs\";\nimport { useFloatingParentNodeId } from \"../../floating-ui-react/components/FloatingTree.mjs\";\nimport { useSyncedFloatingRootContext } from \"../../floating-ui-react/hooks/useSyncedFloatingRootContext.mjs\";\nimport { useUnmountAfterClose } from \"../../internals/useUnmountAfterClose.mjs\";\nimport { createChangeEventDetails } from \"../../internals/createBaseUIEventDetails.mjs\";\nimport { REASONS } from \"../../internals/reasons.mjs\";\nexport const FOCUSABLE_POPUP_PROPS = {\n tabIndex: -1,\n [FOCUSABLE_ATTRIBUTE]: ''\n};\n\n/**\n * Returns the default `initialFocus` resolver for a popup. When opened by touch it focuses the\n * popup element itself to prevent the virtual keyboard from opening (required for Android\n * specifically; iOS handles this automatically). Otherwise it falls back to the default behavior.\n */\nexport function createDefaultInitialFocus(popupRef) {\n return interactionType => interactionType === 'touch' ? popupRef.current : true;\n}\n\n/**\n * The subset of a popup handle that a Root needs to bind its store to. Both the real handle classes\n * and any test double satisfy it.\n */\n\n/**\n * Creates and owns a popup store on behalf of a Root part. The store is created exactly once, with\n * controlled props and root state synced separately after creation. Sets up the synced floating\n * root context and returns the store.\n *\n * @param createStore Factory that builds the store. Called exactly once, receiving the floating id\n * and whether the popup is nested inside another floating element, both resolved on the first render.\n * @param treatPopupAsFloatingElement Whether the popup element is passed to Floating UI as the\n * floating element instead of the default positioner.\n */\nexport function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) {\n const floatingId = useId();\n const nested = useFloatingParentNodeId() != null;\n const store = useRefWithInit(() => createStore(floatingId, nested)).current;\n useSyncedFloatingRootContext({\n popupStore: store,\n treatPopupAsFloatingElement,\n floatingRootContext: store.state.floatingRootContext,\n floatingId,\n nested,\n onOpenChange: store.setOpen\n });\n return store;\n}\n\n/**\n * Attaches a Root's store to a handle for this component's committed lifetime. Popup Roots render\n * it before their interactions and user children so its layout effect runs before descendant layout\n * effects. This lets descendants call the handle during the Root's initial commit without attaching\n * during render, which would leak suspended or abandoned stores. Store subscribers are notified by\n * `attachStore` in this ordinary layout phase, where React permits synchronous updates.\n *\n * Popup Roots must render this component only when a handle is present so handle-less Roots avoid\n * mounting an extra fiber and layout effect.\n */\nexport function PopupHandleAttachment({\n handle,\n store\n}) {\n useIsoLayoutEffect(() => {\n return handle.attachStore(store);\n }, [handle, store]);\n return null;\n}\nfunction syncTriggerCount(store) {\n const triggerCount = store.context.triggerElements.size;\n if (store.select('open') && store.state.triggerCount !== triggerCount) {\n store.set('triggerCount', triggerCount);\n }\n}\n\n/**\n * Returns a stable callback ref that registers/unregisters the trigger element in the store.\n *\n * Stable so a downstream ref merger that retains the callback it was first given still reaches the\n * trigger's current store. The registration is tracked as a `(store, id, element)` triple, so\n * unregistering targets the store the element was actually registered in.\n *\n * Since the callback never changes, the caller must re-run it from a layout effect keyed on\n * `[store, id]` to migrate an already-registered element. That effect is also what registers the\n * element in the first place when `id` only resolves after the first commit (React 17's `useId`\n * fallback), because the register call made while the id is still `undefined` does nothing.\n *\n * @param id Id of the trigger.\n * @param store The Store instance where the trigger should be registered.\n */\nexport function useTriggerRegistration(id, store) {\n const registrationRef = React.useRef(null);\n return useStableCallback(element => {\n const registration = registrationRef.current;\n if (registration !== null) {\n if (registration.element === element && registration.store === store && registration.id === id) {\n // Already registered where it belongs, so the caller's migration effect is free on mount.\n return;\n }\n registrationRef.current = null;\n const registeredStore = registration.store;\n if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) {\n registeredStore.context.triggerElements.delete(registration.id);\n syncTriggerCount(registeredStore);\n }\n }\n if (element !== null && id !== undefined) {\n registrationRef.current = {\n store,\n id,\n element\n };\n store.context.triggerElements.add(id, element);\n syncTriggerCount(store);\n }\n });\n}\nexport function createPopupOpenState(state, open, trigger, preventUnmountOnClose = false) {\n let preventUnmountingOnClose = state.preventUnmountingOnClose;\n if (open) {\n // Opening starts a new close cycle, so clear any previous request to keep the popup mounted.\n preventUnmountingOnClose = false;\n } else if (preventUnmountOnClose) {\n preventUnmountingOnClose = true;\n }\n const triggerId = trigger?.id ?? null;\n let activeTriggerId = state.activeTriggerId;\n let activeTriggerElement = state.activeTriggerElement;\n\n // If a popup is closing, the `trigger` may be undefined.\n // We want to keep the previous value so that exit animations are played and focus is returned correctly.\n if (triggerId || open) {\n activeTriggerId = triggerId;\n activeTriggerElement = trigger ?? null;\n }\n return {\n open,\n preventUnmountingOnClose,\n activeTriggerId,\n activeTriggerElement,\n // An open request without a trigger (a handle's `open(null)` or `openWithPayload()`) must not\n // be reassociated with a lone registered trigger later on. Controlled and default opens never\n // pass through here, so they keep claiming a lone trigger. A close request keeps the flag: a\n // controlled root may decline it and stay open, so the Root clears the flag only once the\n // popup is effectively closed.\n openedWithoutTrigger: open ? trigger == null : state.openedWithoutTrigger\n };\n}\nexport function attachPreventUnmountOnClose(eventDetails) {\n let preventUnmountOnClose = false;\n eventDetails.preventUnmountOnClose = () => {\n preventUnmountOnClose = true;\n };\n return () => preventUnmountOnClose;\n}\n\n/**\n * Runs the shared open-change sequence for a popup store: notifies `onOpenChange`,\n * honors cancellation, dispatches the floating root change, maps the reason to an\n * `instantType`, and commits the state update (synchronously for hover so\n * `getAnimations()` observes it). Stores supply their own differences via\n * `extraState` (e.g. the last change reason) and `onBeforeDispatch` (e.g. updating\n * inline-rect coordinates).\n */\nexport function applyPopupOpenChange(store, nextOpen, eventDetails, options = {}) {\n const reason = eventDetails.reason;\n const isHover = reason === REASONS.triggerHover;\n const isFocusOpen = nextOpen && reason === REASONS.triggerFocus;\n const isDismissClose = !nextOpen && (reason === REASONS.triggerPress || reason === REASONS.escapeKey);\n const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);\n store.context.onOpenChange?.(nextOpen, eventDetails);\n if (eventDetails.isCanceled) {\n return;\n }\n options.onBeforeDispatch?.();\n store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);\n const changeState = () => {\n const popupOpenState = createPopupOpenState(store.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());\n const updatedState = {\n ...options.extraState,\n ...popupOpenState\n };\n if (isFocusOpen) {\n updatedState.instantType = 'focus';\n } else if (isDismissClose) {\n updatedState.instantType = 'dismiss';\n } else if (isHover) {\n updatedState.instantType = undefined;\n }\n store.update(updatedState);\n };\n if (isHover) {\n // Flush synchronously for hover so `node.getAnimations()` sees the new state.\n ReactDOM.flushSync(changeState);\n } else {\n changeState();\n }\n}\n\n/**\n * Sets up trigger data forwarding to the store.\n *\n * @param triggerId Id of the trigger.\n * @param triggerElementRef Ref for the trigger DOM element.\n * @param store The Store instance managing the popup state.\n * @param stateUpdates An object with state updates to apply when the trigger is active.\n */\nexport function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) {\n const isMountedByThisTrigger = store.useState('isMountedByTrigger', triggerId);\n const baseRegisterTrigger = useTriggerRegistration(triggerId, store);\n\n // Applies trigger-owned state (active-trigger ownership and payload) when the trigger registers.\n // Stable so payload/`stateUpdates` changes do not change the ref identity (which would needlessly\n // churn registration); it reads the latest closure values when invoked.\n const applyTriggerData = useStableCallback(element => {\n const open = store.select('open');\n const activeTriggerId = store.select('activeTriggerId');\n if (activeTriggerId === triggerId) {\n const changes = {\n activeTriggerElement: element,\n ...(open ? stateUpdates : null)\n };\n store.update(changes);\n return;\n }\n if (activeTriggerId == null && open && !store.state.openedWithoutTrigger) {\n // If a popup is already open, a detached trigger can mount before any active trigger\n // has been established. Claim the first registered trigger so trigger-owned focus\n // management and ARIA relationships work. A popup opened deliberately without a trigger\n // stays unassociated so the trigger's `payload` does not replace the programmatic one.\n const changes = {\n activeTriggerId: triggerId ?? null,\n activeTriggerElement: element,\n ...stateUpdates\n };\n store.update(changes);\n }\n });\n\n // Stable, so the merged ref on the rendered element keeps its identity for the trigger's whole\n // lifetime.\n const registerTrigger = useStableCallback(element => {\n baseRegisterTrigger(element);\n if (element) {\n applyTriggerData(element);\n }\n });\n\n // A stable ref does not re-fire on a store or id change, so migrate here instead: unregister from\n // the previous store, then register the element the trigger still renders into the current one.\n useIsoLayoutEffect(() => {\n registerTrigger(triggerElementRef.current);\n return () => registerTrigger(null);\n }, [registerTrigger, triggerElementRef, store, triggerId]);\n useIsoLayoutEffect(() => {\n if (isMountedByThisTrigger) {\n const changes = {\n activeTriggerElement: triggerElementRef.current,\n ...stateUpdates\n };\n store.update(changes);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]);\n return {\n registerTrigger,\n isMountedByThisTrigger\n };\n}\n/**\n * Keeps trigger registration state synchronized while the popup is open.\n *\n * When a popup opens without an explicit trigger id and exactly one trigger is registered, that\n * trigger is claimed as the active trigger, unless the open request deliberately carried no trigger\n * (`openedWithoutTrigger`). When the active trigger id is still registered but its\n * element changed, the active element is refreshed. When the active trigger id is missing from the\n * registry but the same element is still registered under a different id (e.g. the rendered trigger\n * carries its own DOM `id` that differs from Base UI's internal trigger id), the active id is\n * reassociated to the registered id instead of being treated as lost. When the active trigger\n * unregisters, the default path preserves existing ownership so non-closing popup families do not\n * silently claim a different trigger while staying open.\n *\n * If `closeOnActiveTriggerUnmount` is enabled, unregistering a previously resolved active trigger\n * requests a close after a microtask so a same-tick replacement trigger with the same id can\n * register first. An active trigger id that has not matched a registered trigger yet is treated as\n * pending and does not request a close.\n *\n * This should be called on the Root part.\n *\n * @param store The Store instance managing the popup state.\n * @param options Options for active trigger unmount behavior.\n */\nexport function useImplicitActiveTrigger(store, options = {}) {\n const {\n closeOnActiveTriggerUnmount = false\n } = options;\n // Distinguishes a trigger that unmounted from a new active trigger that has not hydrated yet.\n const resolvedActiveTriggerIdRef = React.useRef(null);\n const open = store.useState('open');\n const reactiveTriggerCount = store.useState('triggerCount');\n // Subscribe to the active trigger id so the reconciliation below reruns when ownership moves to\n // another trigger while the popup stays open (e.g. a focus/hover handoff between triggers).\n const activeTriggerId = store.useState('activeTriggerId');\n // Subscribe to the active trigger element so the reconciliation reruns when a pending active\n // trigger registers in a commit where the trigger count nets out unchanged (registration\n // forwards the element to the store when the registering trigger matches the active id).\n // Without this, the id would never be marked resolved and a later genuine unmount would be\n // misclassified as pending, disabling `closeOnActiveTriggerUnmount`.\n const reactiveActiveTriggerElement = store.useState('activeTriggerElement');\n useIsoLayoutEffect(() => {\n if (!open) {\n resolvedActiveTriggerIdRef.current = null;\n if (store.state.triggerCount !== 0) {\n store.set('triggerCount', 0);\n }\n // The flag is cleared only here, once the popup is effectively closed: a controlled root may\n // decline a close request and stay open, and a controlled close never reaches\n // `createPopupOpenState` at all.\n if (store.state.openedWithoutTrigger) {\n store.set('openedWithoutTrigger', false);\n }\n return;\n }\n const triggerCount = store.context.triggerElements.size;\n const stateUpdates = {};\n if (store.state.triggerCount !== triggerCount) {\n stateUpdates.triggerCount = triggerCount;\n }\n const currentActiveTriggerId = store.select('activeTriggerId');\n let lostActiveTriggerId = null;\n if (currentActiveTriggerId) {\n const activeTriggerElement = store.context.triggerElements.getById(currentActiveTriggerId);\n if (!activeTriggerElement) {\n for (const [triggerId, triggerElement] of store.context.triggerElements.entries()) {\n if (triggerElement === store.state.activeTriggerElement) {\n stateUpdates.activeTriggerId = triggerId;\n stateUpdates.activeTriggerElement = triggerElement;\n resolvedActiveTriggerIdRef.current = triggerId;\n break;\n }\n }\n if (stateUpdates.activeTriggerId === undefined) {\n if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) {\n lostActiveTriggerId = currentActiveTriggerId;\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = currentActiveTriggerId;\n if (activeTriggerElement !== store.state.activeTriggerElement) {\n stateUpdates.activeTriggerElement = activeTriggerElement;\n }\n }\n } else {\n resolvedActiveTriggerIdRef.current = null;\n }\n if (!lostActiveTriggerId && !currentActiveTriggerId && !store.state.openedWithoutTrigger && triggerCount === 1) {\n const iteratorResult = store.context.triggerElements.entries().next();\n if (!iteratorResult.done) {\n const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value;\n stateUpdates.activeTriggerId = implicitTriggerId;\n stateUpdates.activeTriggerElement = implicitTriggerElement;\n resolvedActiveTriggerIdRef.current = implicitTriggerId;\n }\n }\n if (stateUpdates.triggerCount !== undefined || stateUpdates.activeTriggerId !== undefined || stateUpdates.activeTriggerElement !== undefined) {\n store.update(stateUpdates);\n }\n if (lostActiveTriggerId) {\n if (closeOnActiveTriggerUnmount) {\n // Defer so a same-tick replacement trigger with the same id can register first.\n queueMicrotask(() => {\n if (store.select('open') && store.select('activeTriggerId') === lostActiveTriggerId && !store.context.triggerElements.getById(lostActiveTriggerId)) {\n const eventDetails = createChangeEventDetails(REASONS.none);\n store.setOpen(false, eventDetails);\n // If closing is canceled, keep the previous active trigger ownership for the\n // still-open popup instead of claiming another trigger implicitly.\n if (!eventDetails.isCanceled) {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null\n });\n }\n }\n });\n }\n }\n }, [open, store, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]);\n}\n\n/**\n * Manages the mounted state of the popup.\n * Sets up the transition status listeners and handles unmounting when needed.\n * Updates the `mounted`, `transitionStatus`, and `preventUnmountingOnClose` states in the store.\n *\n * @param open Whether the popup is open.\n * @param store The Store instance managing the popup state.\n * @param onUnmount Optional callback to be called when the popup is unmounted.\n * @param animateInitialOpen Whether a popup that mounts already open should still play its enter\n * transition. Defaults to `false`, so content that was open on the first render (a `defaultOpen`\n * popup on page load, SSR'd markup) appears without animating. Opt in for popups whose subtree\n * only mounts in response to something the user did, such as a submenu inside a menu popup.\n *\n * @returns A function to forcibly unmount the popup. It is a no-op once the popup is already\n * unmounted, so calling it after the automatic unmount doesn't repeat the completion callback.\n */\nexport function useOpenStateTransitions(open, store, onUnmount, animateInitialOpen) {\n const {\n mounted,\n transitionStatus,\n forceUnmount\n } = useUnmountAfterClose({\n open,\n ref: store.context.popupRef,\n preventUnmountOnClose: store.useState('preventUnmountingOnClose'),\n setPreventUnmountOnClose: preventUnmountOnClose => store.set('preventUnmountingOnClose', preventUnmountOnClose),\n animateInitialOpen,\n onUnmount() {\n store.update({\n activeTriggerId: null,\n activeTriggerElement: null,\n mounted: false,\n preventUnmountingOnClose: false\n });\n onUnmount?.();\n store.context.onOpenChangeComplete?.(false);\n }\n });\n\n // Seed the Root-owned store before parts subscribe, matching the hook's initial mounted state.\n // Otherwise, an initially open Root looks like a reopen until the layout effect syncs the store.\n useRefWithInit(() => {\n store.set('mounted', mounted);\n return null;\n });\n store.useSyncedValues({\n mounted,\n transitionStatus\n });\n return {\n forceUnmount,\n transitionStatus\n };\n}\nexport function usePopupInteractionProps(store, statePart) {\n store.useSyncedValues(statePart);\n useIsoLayoutEffect(() => () => {\n store.update({\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n });\n }, [store]);\n}\nexport function usePopupRootSync(store, open) {\n useIsoLayoutEffect(() => {\n if (!open && store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [open, store]);\n useIsoLayoutEffect(() => () => {\n if (store.state.openMethod !== null) {\n store.set('openMethod', null);\n }\n }, [store]);\n}","/**\n * Development-only reverse index of element to registered id, keyed by the owning map.\n *\n * Registration would otherwise have to scan every entry to detect an element claimed by two ids,\n * making the mount of many triggers sharing one handle quadratic. Kept module-scoped, lazily\n * initialized, and read only from `process.env.NODE_ENV` guards so production builds drop it along\n * with the checks.\n */\nlet devElementIdsByMap;\nfunction getDevElementIds(map) {\n devElementIdsByMap ??= new WeakMap();\n let elementIds = devElementIdsByMap.get(map);\n if (!elementIds) {\n elementIds = new WeakMap();\n devElementIdsByMap.set(map, elementIds);\n }\n return elementIds;\n}\n\n/**\n * Data structure to keep track of popup trigger elements by their IDs.\n *\n * Element lookups iterate the id map rather than maintaining a parallel Set. Registration is O(1),\n * while `hasElement` and `hasMatchingElement` are linear in the number of triggers.\n */\nexport class PopupTriggerMap {\n idMap = new Map();\n\n /**\n * Adds a trigger element with the given ID.\n *\n * Note: The provided element is assumed to not be registered under multiple IDs.\n */\n add(id, element) {\n if (process.env.NODE_ENV !== 'production') {\n const elementIds = getDevElementIds(this);\n const existingId = elementIds.get(element);\n if (existingId !== undefined && existingId !== id) {\n // TODO: fix mui/no-guarded-throw\n // eslint-disable-next-line mui/no-guarded-throw\n throw new Error('Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap.');\n }\n\n // Reusing an id for a different element evicts the previous one, so it must lose its claim\n // on the id or a later registration under a different id would be reported as a duplicate.\n const previousElement = this.idMap.get(id);\n if (previousElement !== undefined && previousElement !== element) {\n elementIds.delete(previousElement);\n }\n elementIds.set(element, id);\n }\n this.idMap.set(id, element);\n }\n\n /**\n * Removes the trigger element with the given ID.\n */\n delete(id) {\n if (process.env.NODE_ENV !== 'production') {\n const element = this.idMap.get(id);\n if (element !== undefined) {\n devElementIdsByMap?.get(this)?.delete(element);\n }\n }\n this.idMap.delete(id);\n }\n\n /**\n * Whether the given element is registered as a trigger.\n */\n hasElement(element) {\n for (const registered of this.idMap.values()) {\n if (registered === element) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Whether there is a registered trigger element matching the given predicate.\n */\n hasMatchingElement(predicate) {\n for (const element of this.idMap.values()) {\n if (predicate(element)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Returns the trigger element associated with the given ID, or undefined if no such element exists.\n */\n getById(id) {\n return this.idMap.get(id);\n }\n\n /**\n * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element].\n */\n entries() {\n return this.idMap.entries();\n }\n\n /**\n * Returns an iterable of all registered trigger elements.\n */\n elements() {\n return this.idMap.values();\n }\n\n /**\n * Returns the number of registered trigger elements.\n */\n get size() {\n return this.idMap.size;\n }\n}","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\n\"production\" !== process.env.NODE_ENV &&\n (function () {\n function is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n shim = require(\"use-sync-external-store/shim\"),\n objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = shim.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\n exports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n ) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot))\n return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n };\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","import * as React from 'react';\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\nconst hooks = [];\nlet currentInstance = undefined;\nexport function getInstance() {\n return currentInstance;\n}\nexport function setInstance(instance) {\n currentInstance = instance;\n}\nexport function register(hook) {\n hooks.push(hook);\n}\n\n/**\n * Wraps a component function to enable performance optimizations for internal hooks.\n *\n * **Performance Optimization:**\n * Components wrapped with `fastComponent` have access to a shared \"instance\" context that enables\n * specialized hook implementations to batch operations and reduce overhead. The wrapper creates a\n * stable instance object that persists across renders, sets it as the current context, calls\n * registered hooks before and after rendering, then clears the context. The primary benefit is\n * with `useStore`, where multiple store subscriptions within the same component are collapsed into\n * a single `useSyncExternalStore` subscription per store, significantly reducing re-render overhead.\n * This optimization is only active on React 19+; on earlier versions `useStore` falls back to a\n * separate subscription per call.\n *\n * **Requirements:**\n * - The component function should follow standard React component patterns\n * - `useStore` calls must keep a stable order and count across renders, as batched hooks are\n * matched by call index\n * - Do not rely on the instance context outside of specialized hooks\n *\n * @param fn - The component function to wrap\n * @returns A wrapped component with the same signature as the input function\n *\n * @example\n * ```tsx\n * // Wrapping a component to enable optimized useStore batching\n * export const TooltipRoot = fastComponent(function TooltipRoot(props) {\n * // These useStore calls share a single subscription\n * const open = useStore(store, (state) => state.open);\n * const disabled = useStore(store, (state) => state.disabled);\n * const value = useStore(store, (state) => state.value);\n * // ...\n * });\n * ```\n */\nexport function fastComponent(fn) {\n const FastComponent = (props, forwardedRef) => {\n const instance = useRefWithInit(createInstance).current;\n let result;\n try {\n currentInstance = instance;\n for (const hook of hooks) {\n hook.before(instance);\n }\n result = fn(props, forwardedRef);\n for (const hook of hooks) {\n hook.after(instance);\n }\n instance.didInitialize = true;\n } finally {\n currentInstance = undefined;\n }\n return result;\n };\n FastComponent.displayName = fn.displayName || fn.name;\n return FastComponent;\n}\n\n/**\n * Wraps a component function with ref forwarding to enable performance optimizations for internal hooks.\n *\n * This is a convenience wrapper that combines `fastComponent` with `React.forwardRef`, enabling\n * both performance optimizations and proper ref forwarding. See `fastComponent` for details on\n * the performance benefits.\n *\n * @param fn - The component function that accepts props and a forwarded ref\n * @returns A wrapped component with ref forwarding enabled\n *\n * @example\n * ```tsx\n * // Wrapping a component with ref forwarding and optimized hooks\n * export const TooltipTrigger = fastComponentRef(function TooltipTrigger(\n * props,\n * forwardedRef\n * ) {\n * const store = useContext(TooltipContext);\n * const open = useStore(store, (state) => state.open);\n * // ... component logic with ref\n * return <button ref={forwardedRef} {...props} />;\n * });\n * ```\n */\nexport function fastComponentRef(fn) {\n return /*#__PURE__*/React.forwardRef(fastComponent(fn));\n}\nfunction createInstance() {\n return {\n didInitialize: false\n };\n}","import * as React from 'react';\n/* We need to import the shim because React 17 does not support the `useSyncExternalStore` API.\n * More info: https://github.com/mui/mui-x/issues/18303#issuecomment-2958392341 */\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isReactVersionAtLeast } from \"../reactVersion.mjs\";\nimport { register, getInstance } from \"../fastHooks.mjs\";\n/* Some tests fail in R18 with the raw useSyncExternalStore. It may be possible to make it work\n * but for now we only enable it for R19+. */\nconst canUseRawUseSyncExternalStore = isReactVersionAtLeast(19);\nconst useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy;\nexport function useStore(store, selector, a1, a2, a3) {\n return useStoreImplementation(store, selector, a1, a2, a3);\n}\nfunction useStoreR19(store, selector, a1, a2, a3) {\n const getSelection = React.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]);\n return useSyncExternalStore(store.subscribe, getSelection, getSelection);\n}\nregister({\n before(instance) {\n instance.syncIndex = 0;\n if (!instance.didInitialize) {\n instance.syncTick = 1;\n instance.syncHooks = [];\n instance.didChangeStore = true;\n instance.getSnapshot = () => {\n let didChange = false;\n for (let i = 0; i < instance.syncHooks.length; i += 1) {\n const hook = instance.syncHooks[i];\n const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3);\n if (!Object.is(hook.value, value)) {\n didChange = true;\n hook.value = value;\n }\n }\n if (didChange) {\n instance.syncTick += 1;\n }\n return instance.syncTick;\n };\n }\n },\n after(instance) {\n if (instance.syncHooks.length > 0) {\n if (instance.didChangeStore) {\n instance.didChangeStore = false;\n instance.subscribe = onStoreChange => {\n const stores = new Set();\n for (const hook of instance.syncHooks) {\n stores.add(hook.store);\n }\n const unsubscribes = [];\n for (const store of stores) {\n unsubscribes.push(store.subscribe(onStoreChange));\n }\n return () => {\n for (const unsubscribe of unsubscribes) {\n unsubscribe();\n }\n };\n };\n }\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useSyncExternalStore(instance.subscribe, instance.getSnapshot, instance.getSnapshot);\n }\n }\n});\nfunction useStoreFast(store, selector, a1, a2, a3) {\n const instance = getInstance();\n if (!instance) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStoreR19(store, selector, a1, a2, a3);\n }\n const index = instance.syncIndex;\n instance.syncIndex += 1;\n let hook;\n if (!instance.didInitialize) {\n hook = {\n store,\n selector,\n a1,\n a2,\n a3,\n value: selector(store.getSnapshot(), a1, a2, a3)\n };\n instance.syncHooks.push(hook);\n } else {\n hook = instance.syncHooks[index];\n if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) {\n if (hook.store !== store) {\n instance.didChangeStore = true;\n }\n hook.store = store;\n hook.selector = selector;\n hook.a1 = a1;\n hook.a2 = a2;\n hook.a3 = a3;\n hook.value = selector(store.getSnapshot(), a1, a2, a3);\n }\n }\n return hook.value;\n}\nfunction useStoreLegacy(store, selector, a1, a2, a3) {\n return useSyncExternalStoreWithSelector(store.subscribe, store.getSnapshot, store.getSnapshot, state => selector(state, a1, a2, a3));\n}","import { useStore } from \"./useStore.mjs\";\n/**\n * A data store implementation that allows subscribing to state changes and updating the state.\n * It uses an observer pattern to notify subscribers when the state changes.\n */\nexport class Store {\n /**\n * Creates a store with the given initial state, constructing the class it is called on.\n * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that\n * class but degrades the inferred instance type to `Store`; use `new` there instead.\n */\n static create(state) {\n return new this(state);\n }\n\n /**\n * The current state of the store.\n * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}.\n * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState).\n * The values can be used directly (to avoid subscribing to the store) in effects or event handlers.\n *\n * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification.\n */\n\n // Internal state to handle recursive `setState()` calls\n\n constructor(state) {\n this.state = state;\n this.listeners = new Set();\n this.updateTick = 0;\n }\n\n /**\n * Registers a listener that will be called whenever the store's state changes.\n *\n * @param fn The listener function to be called on state changes.\n * @returns A function to unsubscribe the listener.\n */\n subscribe = fn => {\n this.listeners.add(fn);\n return () => {\n this.listeners.delete(fn);\n };\n };\n\n /**\n * Returns the current state of the store.\n */\n getSnapshot = () => {\n return this.state;\n };\n\n /**\n * Updates the entire store's state and notifies all registered listeners.\n *\n * @param newState The new state to set for the store.\n */\n setState(newState) {\n if (this.state === newState) {\n return;\n }\n this.state = newState;\n this.updateTick += 1;\n const currentTick = this.updateTick;\n for (const listener of this.listeners) {\n if (currentTick !== this.updateTick) {\n // If the tick has changed, a recursive `setState` call has been made,\n // and it has already notified all listeners.\n return;\n }\n listener(newState);\n }\n }\n\n /**\n * Merges the provided changes into the current state and notifies listeners if there are changes.\n * Each value must match its state key. Pass an exact known subset rather than a broad\n * `Partial<State>`, which may contain `undefined` for required state fields.\n *\n * @param changes An object containing the changes to apply to the current state.\n */\n update(changes) {\n for (const key in changes) {\n if (!Object.is(this.state[key], changes[key])) {\n this.setState({\n ...this.state,\n ...changes\n });\n return;\n }\n }\n }\n\n /**\n * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed.\n *\n * @param key The key in the store's state to update.\n * @param value The new value to set for the specified key.\n */\n set(key, value) {\n if (!Object.is(this.state[key], value)) {\n this.setState({\n ...this.state,\n [key]: value\n });\n }\n }\n\n /**\n * Gives the state a new reference and updates all registered listeners.\n */\n notifyAll() {\n const newState = {\n ...this.state\n };\n this.setState(newState);\n }\n use(selector, a1, a2, a3) {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n return useStore(this, selector, a1, a2, a3);\n }\n}","/* False positives - ESLint thinks we're calling a hook from a class component. */\n/* eslint-disable react-hooks/rules-of-hooks */\n'use client';\n\nimport * as React from 'react';\nimport { Store } from \"./Store.mjs\";\nimport { useStore } from \"./useStore.mjs\";\nimport { useStableCallback } from \"../useStableCallback.mjs\";\nimport { useIsoLayoutEffect } from \"../useIsoLayoutEffect.mjs\";\nimport { NOOP } from \"../empty.mjs\";\n\n/**\n * A Store that supports controlled state keys, non-reactive values and provides utility methods for React.\n */\nexport class ReactStore extends Store {\n /**\n * Creates a new ReactStore instance.\n *\n * @param state Initial state of the store.\n * @param context Non-reactive context values.\n * @param selectors Optional selectors for use with `useState`.\n */\n constructor(state, context = {}, selectors) {\n super(state);\n this.context = context;\n this.selectors = selectors;\n }\n\n /**\n * Non-reactive values such as refs, callbacks, etc.\n */\n\n /**\n * Synchronizes a single external value into the store.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValue(key, value) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes a single external value into the store and\n * cleans it up (sets to `undefined`) on unmount.\n *\n * Note that the while the value in `state` is updated immediately, the value returned\n * by `useState` is updated before the next render (similarly to React's `useState`).\n */\n useSyncedValueWithCleanup(key, value) {\n // eslint-disable-next-line consistent-this\n const store = this;\n useIsoLayoutEffect(() => {\n if (store.state[key] !== value) {\n store.set(key, value);\n }\n return () => {\n store.set(key, undefined);\n };\n }, [store, key, value]);\n }\n\n /**\n * Synchronizes multiple external values into the store.\n * Each value must match its state key. Pass an exact known subset rather than a broad\n * `Partial<State>`, which may contain `undefined` for required state fields.\n *\n * Note that the while the values in `state` are updated immediately, the values returned\n * by `useState` are updated before the next render (similarly to React's `useState`).\n *\n * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted.\n */\n useSyncedValues(statePart) {\n // eslint-disable-next-line consistent-this\n const store = this;\n if (process.env.NODE_ENV !== 'production') {\n // Check that an object with the same shape is passed on every render\n React.useDebugValue(statePart, p => Object.keys(p));\n const keys = React.useRef(Object.keys(statePart)).current;\n const nextKeys = Object.keys(statePart);\n if (keys.length !== nextKeys.length || keys.some((key, index) => key !== nextKeys[index])) {\n console.error('ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable.');\n }\n }\n const dependencies = Object.values(statePart);\n useIsoLayoutEffect(() => {\n store.update(statePart);\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [store, ...dependencies]);\n }\n\n /**\n * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled`\n * is non-undefined, the store's state at `key` is updated to match `controlled`.\n */\n useControlledProp(key, controlled) {\n React.useDebugValue(key);\n // eslint-disable-next-line consistent-this\n const store = this;\n const isControlled = controlled !== undefined;\n useIsoLayoutEffect(() => {\n if (isControlled && !Object.is(store.state[key], controlled)) {\n // Set the internal state to match the controlled value.\n store.setState({\n ...store.state,\n [key]: controlled\n });\n }\n }, [store, key, controlled, isControlled]);\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n const cache = this.controlledValues ??= new Map();\n if (!cache.has(key)) {\n cache.set(key, isControlled);\n }\n const previouslyControlled = cache.get(key);\n if (previouslyControlled !== undefined && previouslyControlled !== isControlled) {\n console.error(`A component is changing the ${previouslyControlled ? '' : 'un'}controlled state of ${key.toString()} to be ${previouslyControlled ? 'un' : ''}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`);\n }\n }\n }\n\n /** Gets the current value from the store using a selector with the provided key.\n *\n * @param key Key of the selector to use.\n */\n\n select(key, a1, a2, a3) {\n const selector = this.selectors[key];\n return selector(this.state, a1, a2, a3);\n }\n\n /**\n * Returns a value from the store's state using a selector function.\n * Used to subscribe to specific parts of the state.\n * This methods causes a rerender whenever the selected state changes.\n *\n * @param key Key of the selector to use.\n */\n\n useState(key, a1, a2, a3) {\n React.useDebugValue(key);\n return useStore(this, this.selectors[key], a1, a2, a3);\n }\n\n /**\n * Wraps a function with `useStableCallback` to ensure it has a stable reference\n * and assigns it to the context.\n *\n * @param key Key of the event callback. Must be a function in the context.\n * @param fn Function to assign.\n */\n useContextCallback(key, fn) {\n React.useDebugValue(key);\n const stableFunction = useStableCallback(fn ?? NOOP);\n this.context[key] = stableFunction;\n }\n\n /**\n * Returns a stable setter function for a specific key in the store's state.\n * It's commonly used to pass as a ref callback to React elements.\n *\n * @param key Key of the state to set.\n */\n useStateSetter(key) {\n const ref = React.useRef(undefined);\n if (ref.current === undefined) {\n ref.current = value => {\n this.set(key, value);\n };\n }\n return ref.current;\n }\n\n /**\n * Observes changes derived from the store's selectors and calls the listener when the selected value changes.\n *\n * @param key Key of the selector to observe.\n * @param listener Listener function called when the selector result changes.\n */\n\n observe(selector, listener) {\n let selectFn;\n if (typeof selector === 'function') {\n selectFn = selector;\n } else {\n selectFn = this.selectors[selector];\n }\n let prevValue = selectFn(this.state);\n listener(prevValue, prevValue, this);\n return this.subscribe(nextState => {\n const nextValue = selectFn(nextState);\n if (!Object.is(prevValue, nextValue)) {\n const oldValue = prevValue;\n prevValue = nextValue;\n listener(nextValue, oldValue, this);\n }\n });\n }\n}","import { ReactStore } from '@base-ui/utils/store';\nimport { createEventEmitter } from \"../utils/createEventEmitter.mjs\";\nimport { isClickLikeEvent } from \"../utils.mjs\";\nconst selectors = {\n open: state => state.open,\n transitionStatus: state => state.transitionStatus,\n domReferenceElement: state => state.domReferenceElement,\n referenceElement: state => state.positionReference ?? state.referenceElement,\n floatingElement: state => state.floatingElement,\n floatingId: state => state.floatingId\n};\nexport class FloatingRootStore extends ReactStore {\n constructor(options) {\n const {\n syncOnly,\n nested,\n onOpenChange,\n triggerElements,\n ...initialState\n } = options;\n super({\n ...initialState,\n positionReference: initialState.referenceElement,\n domReferenceElement: initialState.referenceElement\n }, {\n onOpenChange,\n dataRef: {\n current: {}\n },\n events: createEventEmitter(),\n nested,\n triggerElements\n }, selectors);\n this.syncOnly = syncOnly;\n }\n\n /**\n * Syncs the event used by hover logic to distinguish hover-open from click-like interaction.\n */\n syncOpenEvent = (newOpen, event) => {\n if (!newOpen || !this.state.open ||\n // Prevent a pending hover-open from overwriting a click-open event, while allowing\n // click events to upgrade a hover-open.\n event != null && isClickLikeEvent(event)) {\n this.context.dataRef.current.openEvent = newOpen ? event : undefined;\n }\n };\n\n /**\n * Runs the root-owned side effects for an open state change.\n */\n dispatchOpenChange = (newOpen, eventDetails) => {\n this.syncOpenEvent(newOpen, eventDetails.event);\n const details = {\n open: newOpen,\n reason: eventDetails.reason,\n nativeEvent: eventDetails.event,\n nested: this.context.nested,\n triggerElement: eventDetails.trigger\n };\n this.context.events.emit('openchange', details);\n };\n\n /**\n * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments.\n *\n * @param newOpen The new open state.\n * @param eventDetails Details about the event that triggered the open state change.\n */\n setOpen = (newOpen, eventDetails) => {\n if (this.syncOnly) {\n this.context.onOpenChange?.(newOpen, eventDetails);\n return;\n }\n this.dispatchOpenChange(newOpen, eventDetails);\n this.context.onOpenChange?.(newOpen, eventDetails);\n };\n}","import { EMPTY_OBJECT } from '@base-ui/utils/empty';\nimport { FloatingRootStore } from \"../../floating-ui-react/components/FloatingRootStore.mjs\";\n\n/**\n * State common to all popup stores.\n */\n\nexport function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {\n return {\n open: false,\n openProp: undefined,\n mounted: false,\n transitionStatus: undefined,\n floatingRootContext: new FloatingRootStore({\n open: false,\n transitionStatus: undefined,\n floatingElement: null,\n referenceElement: null,\n triggerElements,\n floatingId,\n syncOnly: true,\n nested,\n onOpenChange: undefined\n }),\n floatingId,\n triggerCount: 0,\n preventUnmountingOnClose: false,\n payload: undefined,\n activeTriggerId: null,\n activeTriggerElement: null,\n openedWithoutTrigger: false,\n triggerIdProp: undefined,\n popupElement: null,\n positionerElement: null,\n activeTriggerProps: EMPTY_OBJECT,\n inactiveTriggerProps: EMPTY_OBJECT,\n popupProps: EMPTY_OBJECT\n };\n}\nconst activeTriggerIdSelector = state => state.triggerIdProp ?? state.activeTriggerId;\nconst openSelector = state => state.openProp ?? state.open;\nconst popupIdSelector = state => {\n const popupId = state.popupElement?.id ?? state.floatingId;\n return popupId || undefined;\n};\nfunction triggerOwnsOpenPopup(state, triggerId) {\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) === triggerId;\n}\nfunction triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {\n if (triggerOwnsOpenPopup(state, triggerId)) {\n return true;\n }\n return triggerId !== undefined && openSelector(state) && activeTriggerIdSelector(state) == null && !state.openedWithoutTrigger && state.triggerCount === 1;\n}\nexport const popupStoreSelectors = {\n open: openSelector,\n mounted: state => state.mounted,\n // `open` is written synchronously on an open change; `mounted`/`transitionStatus` sync in a\n // layout effect. Match useTransitionStatus so a retained popup does not miss its starting phase.\n transitionStatus: state => openSelector(state) && !state.mounted ? 'starting' : state.transitionStatus,\n floatingRootContext: state => state.floatingRootContext,\n triggerCount: state => state.triggerCount,\n preventUnmountingOnClose: state => state.preventUnmountingOnClose,\n payload: state => state.payload,\n activeTriggerId: activeTriggerIdSelector,\n activeTriggerElement: state => state.mounted ? state.activeTriggerElement : null,\n popupId: popupIdSelector,\n /**\n * Whether the trigger with the given ID was used to open the popup.\n */\n isTriggerActive: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId,\n /**\n * Whether the popup is open and was activated by a trigger with the given ID.\n */\n isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),\n /**\n * Whether the popup is mounted and was activated by a trigger with the given ID.\n */\n isMountedByTrigger: (state, triggerId) => triggerId !== undefined && activeTriggerIdSelector(state) === triggerId && state.mounted,\n triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,\n /**\n * Popup id for the trigger that currently owns the open popup.\n */\n triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : undefined,\n popupProps: state => state.popupProps,\n popupElement: state => state.popupElement,\n positionerElement: state => state.positionerElement\n};\n\n/**\n * Store members a detached handle-backed trigger reads or invokes for trigger registration and data\n * forwarding. `set`/`update` are included only for trigger-count and trigger-data bookkeeping; on a\n * detached (inert) store they are intentionally no-ops, so a write through them is not guaranteed to\n * be durable. Component handle-store views Pick these from their concrete store (preserving its\n * context and selectors) and add any component-specific trigger-invoked members such as `setOpen`.\n */\n\n/**\n * The subset of a popup store that trigger registration and data forwarding rely on. Narrow enough\n * that an inert store can be passed while detached.\n */","'use client';\n\nimport * as React from 'react';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nimport { NOOP } from '@base-ui/utils/empty';\n/**\n * Reads the store currently exposed by a popup handle and subscribes to store-pointer changes.\n * Detached triggers use this to follow a handle as a root attaches or detaches: while no root is\n * attached, the handle exposes its fallback store; once a root attaches, subscribers re-render and\n * read from the live root store.\n *\n * Returns `undefined` when no handle is provided so callers can fall back to their root context.\n *\n * @param handle The popup handle to read from, or `undefined` when the trigger is not handle-bound.\n */\nexport function usePopupHandleStore(handle) {\n const subscribe = React.useCallback(listener => {\n if (handle === undefined) {\n return NOOP;\n }\n return handle.subscribeStore(listener);\n }, [handle]);\n const getSnapshot = React.useCallback(() => {\n return handle === undefined ? undefined : handle.store;\n }, [handle]);\n return useSyncExternalStore(subscribe, getSnapshot, () => handle?.serverStore);\n}"],"names":["CommonTriggerDataAttributes.popupOpen","CommonTriggerDataAttributes.pressed","CommonPopupDataAttributes.open","CommonPopupDataAttributes.closed","CommonPopupDataAttributes.anchorHidden","platform.os.android","platform.env.jsdom","FocusGuard","platform.screenReader.voiceOver","platform.engine.webkit","_jsx","_a","FloatingPortal","open","_jsxs","REASONS.focusOut","escapeKey","outsidePress","REASONS.triggerPress","REASONS.escapeKey","REASONS.outsidePress","unsubscribe","REASONS.triggerHover","REASONS.triggerFocus","REASONS.none","React","require$$0","require$$1","withSelectorModule","useSyncExternalStore","useSyncExternalStoreWithSelector","selectors"],"mappings":";;;;;;;;;;;;;;;;;AAKO,MAAM,OAAO;AAKb,MAAM,SAAS;AAef,MAAM,eAAe;ACtBrB,MAAM,YAAY;AAKlB,MAAM,UAAU;ACJvB,MAAM,eAAe;AAAA,EACnB,CAACA,SAAqC,GAAG;AAC3C;AACA,MAAM,yBAAyB;AAAA,EAC7B,CAACA,SAAqC,GAAG;AAAA,EACzC,CAACC,OAAmC,GAAG;AACzC;AACA,MAAM,kBAAkB;AAAA,EACtB,CAACC,IAA8B,GAAG;AACpC;AACA,MAAM,oBAAoB;AAAA,EACxB,CAACC,MAAgC,GAAG;AACtC;AACA,MAAM,qBAAqB;AAAA,EACzB,CAACC,YAAsC,GAAG;AAC5C;AACY,MAAC,0BAA0B;AAAA,EACrC,KAAK,OAAO;AACV,QAAI,OAAO;AACT,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AACF;AACY,MAAC,mCAAmC;AAAA,EAC9C,KAAK,OAAO;AACV,QAAI,OAAO;AACT,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AACF;AACY,MAAC,oBAAoB;AAAA,EAC/B,KAAK,OAAO;AACV,QAAI,OAAO;AACT,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AAAA,EACA,aAAa,OAAO;AAClB,QAAI,OAAO;AACT,aAAO;AAAA,IACT;AACA,WAAO;AAAA,EACT;AACF;AACY,MAAC,8BAA8B;AAAA,EACzC,GAAG;AAAA,EACH,GAAG;AACL;AC/CY,MAAC,MAAM,YAAY,KAAK,aAAa,KAAK,kBAAkB,cAAc,iBAAiB;AAGvG,MAAM,iBAAiB;A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ources":["../node_modules/@base-ui/utils/addEventListener.mjs","../node_modules/@base-ui/utils/useValueAsRef.mjs"],"sourcesContent":["/**\n * Adds an event listener and returns a cleanup function to remove it.\n */\n\nexport function addEventListener(target, type, listener, options) {\n target.addEventListener(type, listener, options);\n return () => {\n target.removeEventListener(type, listener, options);\n };\n}","'use client';\n\nimport { useIsoLayoutEffect } from \"./useIsoLayoutEffect.mjs\";\nimport { useRefWithInit } from \"./useRefWithInit.mjs\";\n\n/**\n * Untracks the provided value by turning it into a ref to remove its reactivity.\n *\n * Used to access the passed value inside `React.useEffect` without causing the effect to re-run when the value changes.\n */\nexport function useValueAsRef(value) {\n const latest = useRefWithInit(createLatestRef, value).current;\n latest.next = value;\n\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useIsoLayoutEffect(latest.effect);\n return latest;\n}\nfunction createLatestRef(value) {\n const latest = {\n current: value,\n next: value,\n effect: () => {\n latest.current = latest.next;\n }\n };\n return latest;\n}"],"names":[],"mappings":";AAIO,SAAS,iBAAiB,QAAQ,MAAM,UAAU,SAAS;AAChE,SAAO,iBAAiB,MAAM,UAAU,OAAO;AAC/C,SAAO,MAAM;AACX,WAAO,oBAAoB,MAAM,UAAU,OAAO;AAAA,EACpD;AACF;ACCO,SAAS,cAAc,OAAO;AACnC,QAAM,SAAS,eAAe,iBAAiB,KAAK,EAAE;AACtD,SAAO,OAAO;AAGd,qBAAmB,OAAO,MAAM;AAChC,SAAO;AACT;AACA,SAAS,gBAAgB,OAAO;AAC9B,QAAM,SAAS;AAAA,IACb,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ,MAAM;AACZ,aAAO,UAAU,OAAO;AAAA,IAC1B;AAAA,EACJ;AACE,SAAO;AACT;","x_google_ignoreList":[0,1]}