{"ast":null,"code":"import $epM9y$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport { useState as $epM9y$useState, useRef as $epM9y$useRef, useEffect as $epM9y$useEffect, createElement as $epM9y$createElement, useCallback as $epM9y$useCallback, forwardRef as $epM9y$forwardRef, Fragment as $epM9y$Fragment } from \"react\";\nimport { composeEventHandlers as $epM9y$composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection as $epM9y$createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs as $epM9y$useComposedRefs, composeRefs as $epM9y$composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope as $epM9y$createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection as $epM9y$useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer as $epM9y$DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards as $epM9y$useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope as $epM9y$FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId as $epM9y$useId } from \"@radix-ui/react-id\";\nimport { createPopperScope as $epM9y$createPopperScope, Root as $epM9y$Root, Anchor as $epM9y$Anchor, Content as $epM9y$Content, Arrow as $epM9y$Arrow } from \"@radix-ui/react-popper\";\nimport { Portal as $epM9y$Portal } from \"@radix-ui/react-portal\";\nimport { Presence as $epM9y$Presence } from \"@radix-ui/react-presence\";\nimport { Primitive as $epM9y$Primitive, dispatchDiscreteCustomEvent as $epM9y$dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport { createRovingFocusGroupScope as $epM9y$createRovingFocusGroupScope, Root as $epM9y$Root1, Item as $epM9y$Item } from \"@radix-ui/react-roving-focus\";\nimport { Slot as $epM9y$Slot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef as $epM9y$useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { hideOthers as $epM9y$hideOthers } from \"aria-hidden\";\nimport { RemoveScroll as $epM9y$RemoveScroll } from \"react-remove-scroll\";\nconst $6cc32821e9371a1c$var$SELECTION_KEYS = ['Enter', ' '];\nconst $6cc32821e9371a1c$var$FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home'];\nconst $6cc32821e9371a1c$var$LAST_KEYS = ['ArrowUp', 'PageDown', 'End'];\nconst $6cc32821e9371a1c$var$FIRST_LAST_KEYS = [...$6cc32821e9371a1c$var$FIRST_KEYS, ...$6cc32821e9371a1c$var$LAST_KEYS];\nconst $6cc32821e9371a1c$var$SUB_OPEN_KEYS = {\n  ltr: [...$6cc32821e9371a1c$var$SELECTION_KEYS, 'ArrowRight'],\n  rtl: [...$6cc32821e9371a1c$var$SELECTION_KEYS, 'ArrowLeft']\n};\nconst $6cc32821e9371a1c$var$SUB_CLOSE_KEYS = {\n  ltr: ['ArrowLeft'],\n  rtl: ['ArrowRight']\n};\n/* -------------------------------------------------------------------------------------------------\n * Menu\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$MENU_NAME = 'Menu';\nconst [$6cc32821e9371a1c$var$Collection, $6cc32821e9371a1c$var$useCollection, $6cc32821e9371a1c$var$createCollectionScope] = $epM9y$createCollection($6cc32821e9371a1c$var$MENU_NAME);\nconst [$6cc32821e9371a1c$var$createMenuContext, $6cc32821e9371a1c$export$4027731b685e72eb] = $epM9y$createContextScope($6cc32821e9371a1c$var$MENU_NAME, [$6cc32821e9371a1c$var$createCollectionScope, $epM9y$createPopperScope, $epM9y$createRovingFocusGroupScope]);\nconst $6cc32821e9371a1c$var$usePopperScope = $epM9y$createPopperScope();\nconst $6cc32821e9371a1c$var$useRovingFocusGroupScope = $epM9y$createRovingFocusGroupScope();\nconst [$6cc32821e9371a1c$var$MenuProvider, $6cc32821e9371a1c$var$useMenuContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME);\nconst [$6cc32821e9371a1c$var$MenuRootProvider, $6cc32821e9371a1c$var$useMenuRootContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$MENU_NAME);\nconst $6cc32821e9371a1c$export$d9b273488cd8ce6f = props => {\n  const {\n    __scopeMenu: __scopeMenu,\n    open = false,\n    children: children,\n    dir: dir,\n    onOpenChange: onOpenChange,\n    modal = true\n  } = props;\n  const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  const [content, setContent] = $epM9y$useState(null);\n  const isUsingKeyboardRef = $epM9y$useRef(false);\n  const handleOpenChange = $epM9y$useCallbackRef(onOpenChange);\n  const direction = $epM9y$useDirection(dir);\n  $epM9y$useEffect(() => {\n    // Capture phase ensures we set the boolean before any side effects execute\n    // in response to the key or pointer event as they might depend on this value.\n    const handleKeyDown = () => {\n      isUsingKeyboardRef.current = true;\n      document.addEventListener('pointerdown', handlePointer, {\n        capture: true,\n        once: true\n      });\n      document.addEventListener('pointermove', handlePointer, {\n        capture: true,\n        once: true\n      });\n    };\n    const handlePointer = () => isUsingKeyboardRef.current = false;\n    document.addEventListener('keydown', handleKeyDown, {\n      capture: true\n    });\n    return () => {\n      document.removeEventListener('keydown', handleKeyDown, {\n        capture: true\n      });\n      document.removeEventListener('pointerdown', handlePointer, {\n        capture: true\n      });\n      document.removeEventListener('pointermove', handlePointer, {\n        capture: true\n      });\n    };\n  }, []);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Root, popperScope, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuProvider, {\n    scope: __scopeMenu,\n    open: open,\n    onOpenChange: handleOpenChange,\n    content: content,\n    onContentChange: setContent\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuRootProvider, {\n    scope: __scopeMenu,\n    onClose: $epM9y$useCallback(() => handleOpenChange(false), [handleOpenChange]),\n    isUsingKeyboardRef: isUsingKeyboardRef,\n    dir: direction,\n    modal: modal\n  }, children)));\n};\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$d9b273488cd8ce6f, {\n  displayName: $6cc32821e9371a1c$var$MENU_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuAnchor\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$ANCHOR_NAME = 'MenuAnchor';\nconst $6cc32821e9371a1c$export$9fa5ebd18bee4d43 = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    __scopeMenu: __scopeMenu,\n    ...anchorProps\n  } = props;\n  const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Anchor, $epM9y$babelruntimehelpersesmextends({}, popperScope, anchorProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$9fa5ebd18bee4d43, {\n  displayName: $6cc32821e9371a1c$var$ANCHOR_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuPortal\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$PORTAL_NAME = 'MenuPortal';\nconst [$6cc32821e9371a1c$var$PortalProvider, $6cc32821e9371a1c$var$usePortalContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$PORTAL_NAME, {\n  forceMount: undefined\n});\nconst $6cc32821e9371a1c$export$793392f970497feb = props => {\n  const {\n    __scopeMenu: __scopeMenu,\n    forceMount: forceMount,\n    children: children,\n    container: container\n  } = props;\n  const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$PORTAL_NAME, __scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$PortalProvider, {\n    scope: __scopeMenu,\n    forceMount: forceMount\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Presence, {\n    present: forceMount || context.open\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Portal, {\n    asChild: true,\n    container: container\n  }, children)));\n};\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$793392f970497feb, {\n  displayName: $6cc32821e9371a1c$var$PORTAL_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuContent\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$CONTENT_NAME = 'MenuContent';\nconst [$6cc32821e9371a1c$var$MenuContentProvider, $6cc32821e9371a1c$var$useMenuContentContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$CONTENT_NAME);\nconst $6cc32821e9371a1c$export$479f0f2f71193efe = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const portalContext = $6cc32821e9371a1c$var$usePortalContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  const {\n    forceMount = portalContext.forceMount,\n    ...contentProps\n  } = props;\n  const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.Provider, {\n    scope: props.__scopeMenu\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Presence, {\n    present: forceMount || context.open\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.Slot, {\n    scope: props.__scopeMenu\n  }, rootContext.modal ? /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuRootContentModal, $epM9y$babelruntimehelpersesmextends({}, contentProps, {\n    ref: forwardedRef\n  })) : /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuRootContentNonModal, $epM9y$babelruntimehelpersesmextends({}, contentProps, {\n    ref: forwardedRef\n  })))));\n});\n/* ---------------------------------------------------------------------------------------------- */\nconst $6cc32821e9371a1c$var$MenuRootContentModal = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  const ref = $epM9y$useRef(null);\n  const composedRefs = $epM9y$useComposedRefs(forwardedRef, ref); // Hide everything from ARIA except the `MenuContent`\n  $epM9y$useEffect(() => {\n    const content = ref.current;\n    if (content) return $epM9y$hideOthers(content);\n  }, []);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuContentImpl, $epM9y$babelruntimehelpersesmextends({}, props, {\n    ref: composedRefs // we make sure we're not trapping once it's been closed\n    ,\n\n    trapFocus: context.open // make sure to only disable pointer events when open\n    ,\n\n    disableOutsidePointerEvents: context.open,\n    disableOutsideScroll: true // When focus is trapped, a `focusout` event may still happen.\n    ,\n\n    onFocusOutside: $epM9y$composeEventHandlers(props.onFocusOutside, event => event.preventDefault(), {\n      checkForDefaultPrevented: false\n    }),\n    onDismiss: () => context.onOpenChange(false)\n  }));\n});\nconst $6cc32821e9371a1c$var$MenuRootContentNonModal = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuContentImpl, $epM9y$babelruntimehelpersesmextends({}, props, {\n    ref: forwardedRef,\n    trapFocus: false,\n    disableOutsidePointerEvents: false,\n    disableOutsideScroll: false,\n    onDismiss: () => context.onOpenChange(false)\n  }));\n});\n/* ---------------------------------------------------------------------------------------------- */\nconst $6cc32821e9371a1c$var$MenuContentImpl = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    __scopeMenu: __scopeMenu,\n    loop = false,\n    trapFocus: trapFocus,\n    onOpenAutoFocus: onOpenAutoFocus,\n    onCloseAutoFocus: onCloseAutoFocus,\n    disableOutsidePointerEvents: disableOutsidePointerEvents,\n    onEntryFocus: onEntryFocus,\n    onEscapeKeyDown: onEscapeKeyDown,\n    onPointerDownOutside: onPointerDownOutside,\n    onFocusOutside: onFocusOutside,\n    onInteractOutside: onInteractOutside,\n    onDismiss: onDismiss,\n    disableOutsideScroll: disableOutsideScroll,\n    ...contentProps\n  } = props;\n  const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, __scopeMenu);\n  const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, __scopeMenu);\n  const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  const rovingFocusGroupScope = $6cc32821e9371a1c$var$useRovingFocusGroupScope(__scopeMenu);\n  const getItems = $6cc32821e9371a1c$var$useCollection(__scopeMenu);\n  const [currentItemId, setCurrentItemId] = $epM9y$useState(null);\n  const contentRef = $epM9y$useRef(null);\n  const composedRefs = $epM9y$useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n  const timerRef = $epM9y$useRef(0);\n  const searchRef = $epM9y$useRef('');\n  const pointerGraceTimerRef = $epM9y$useRef(0);\n  const pointerGraceIntentRef = $epM9y$useRef(null);\n  const pointerDirRef = $epM9y$useRef('right');\n  const lastPointerXRef = $epM9y$useRef(0);\n  const ScrollLockWrapper = disableOutsideScroll ? $epM9y$RemoveScroll : $epM9y$Fragment;\n  const scrollLockWrapperProps = disableOutsideScroll ? {\n    as: $epM9y$Slot,\n    allowPinchZoom: true\n  } : undefined;\n  const handleTypeaheadSearch = key => {\n    var _items$find, _items$find2;\n    const search = searchRef.current + key;\n    const items = getItems().filter(item => !item.disabled);\n    const currentItem = document.activeElement;\n    const currentMatch = (_items$find = items.find(item => item.ref.current === currentItem)) === null || _items$find === void 0 ? void 0 : _items$find.textValue;\n    const values = items.map(item => item.textValue);\n    const nextMatch = $6cc32821e9371a1c$var$getNextMatch(values, search, currentMatch);\n    const newItem = (_items$find2 = items.find(item => item.textValue === nextMatch)) === null || _items$find2 === void 0 ? void 0 : _items$find2.ref.current; // Reset `searchRef` 1 second after it was last updated\n    (function updateSearch(value) {\n      searchRef.current = value;\n      window.clearTimeout(timerRef.current);\n      if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000);\n    })(search);\n    if (newItem)\n      /**\n      * Imperative focus during keydown is risky so we prevent React's batching updates\n      * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n      */\n      setTimeout(() => newItem.focus());\n  };\n  $epM9y$useEffect(() => {\n    return () => window.clearTimeout(timerRef.current);\n  }, []); // Make sure the whole tree has focus guards as our `MenuContent` may be\n  // the last element in the DOM (beacuse of the `Portal`)\n  $epM9y$useFocusGuards();\n  const isPointerMovingToSubmenu = $epM9y$useCallback(event => {\n    var _pointerGraceIntentRe, _pointerGraceIntentRe2;\n    const isMovingTowards = pointerDirRef.current === ((_pointerGraceIntentRe = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe === void 0 ? void 0 : _pointerGraceIntentRe.side);\n    return isMovingTowards && $6cc32821e9371a1c$var$isPointerInGraceArea(event, (_pointerGraceIntentRe2 = pointerGraceIntentRef.current) === null || _pointerGraceIntentRe2 === void 0 ? void 0 : _pointerGraceIntentRe2.area);\n  }, []);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuContentProvider, {\n    scope: __scopeMenu,\n    searchRef: searchRef,\n    onItemEnter: $epM9y$useCallback(event => {\n      if (isPointerMovingToSubmenu(event)) event.preventDefault();\n    }, [isPointerMovingToSubmenu]),\n    onItemLeave: $epM9y$useCallback(event => {\n      var _contentRef$current;\n      if (isPointerMovingToSubmenu(event)) return;\n      (_contentRef$current = contentRef.current) === null || _contentRef$current === void 0 || _contentRef$current.focus();\n      setCurrentItemId(null);\n    }, [isPointerMovingToSubmenu]),\n    onTriggerLeave: $epM9y$useCallback(event => {\n      if (isPointerMovingToSubmenu(event)) event.preventDefault();\n    }, [isPointerMovingToSubmenu]),\n    pointerGraceTimerRef: pointerGraceTimerRef,\n    onPointerGraceIntentChange: $epM9y$useCallback(intent => {\n      pointerGraceIntentRef.current = intent;\n    }, [])\n  }, /*#__PURE__*/$epM9y$createElement(ScrollLockWrapper, scrollLockWrapperProps, /*#__PURE__*/$epM9y$createElement($epM9y$FocusScope, {\n    asChild: true,\n    trapped: trapFocus,\n    onMountAutoFocus: $epM9y$composeEventHandlers(onOpenAutoFocus, event => {\n      var _contentRef$current2;\n      // when opening, explicitly focus the content area only and leave\n      // `onEntryFocus` in  control of focusing first item\n      event.preventDefault();\n      (_contentRef$current2 = contentRef.current) === null || _contentRef$current2 === void 0 || _contentRef$current2.focus();\n    }),\n    onUnmountAutoFocus: onCloseAutoFocus\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$DismissableLayer, {\n    asChild: true,\n    disableOutsidePointerEvents: disableOutsidePointerEvents,\n    onEscapeKeyDown: onEscapeKeyDown,\n    onPointerDownOutside: onPointerDownOutside,\n    onFocusOutside: onFocusOutside,\n    onInteractOutside: onInteractOutside,\n    onDismiss: onDismiss\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Root1, $epM9y$babelruntimehelpersesmextends({\n    asChild: true\n  }, rovingFocusGroupScope, {\n    dir: rootContext.dir,\n    orientation: \"vertical\",\n    loop: loop,\n    currentTabStopId: currentItemId,\n    onCurrentTabStopIdChange: setCurrentItemId,\n    onEntryFocus: $epM9y$composeEventHandlers(onEntryFocus, event => {\n      // only focus first item when using keyboard\n      if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n    })\n  }), /*#__PURE__*/$epM9y$createElement($epM9y$Content, $epM9y$babelruntimehelpersesmextends({\n    role: \"menu\",\n    \"aria-orientation\": \"vertical\",\n    \"data-state\": $6cc32821e9371a1c$var$getOpenState(context.open),\n    \"data-radix-menu-content\": \"\",\n    dir: rootContext.dir\n  }, popperScope, contentProps, {\n    ref: composedRefs,\n    style: {\n      outline: 'none',\n      ...contentProps.style\n    },\n    onKeyDown: $epM9y$composeEventHandlers(contentProps.onKeyDown, event => {\n      // submenu key events bubble through portals. We only care about keys in this menu.\n      const target = event.target;\n      const isKeyDownInside = target.closest('[data-radix-menu-content]') === event.currentTarget;\n      const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n      const isCharacterKey = event.key.length === 1;\n      if (isKeyDownInside) {\n        // menus should not be navigated using tab key so we prevent it\n        if (event.key === 'Tab') event.preventDefault();\n        if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n      } // focus first/last item based on key pressed\n      const content = contentRef.current;\n      if (event.target !== content) return;\n      if (!$6cc32821e9371a1c$var$FIRST_LAST_KEYS.includes(event.key)) return;\n      event.preventDefault();\n      const items = getItems().filter(item => !item.disabled);\n      const candidateNodes = items.map(item => item.ref.current);\n      if ($6cc32821e9371a1c$var$LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n      $6cc32821e9371a1c$var$focusFirst(candidateNodes);\n    }),\n    onBlur: $epM9y$composeEventHandlers(props.onBlur, event => {\n      // clear search buffer when leaving the menu\n      if (!event.currentTarget.contains(event.target)) {\n        window.clearTimeout(timerRef.current);\n        searchRef.current = '';\n      }\n    }),\n    onPointerMove: $epM9y$composeEventHandlers(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse(event => {\n      const target = event.target;\n      const pointerXHasChanged = lastPointerXRef.current !== event.clientX; // We don't use `event.movementX` for this check because Safari will\n      // always return `0` on a pointer event.\n      if (event.currentTarget.contains(target) && pointerXHasChanged) {\n        const newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left';\n        pointerDirRef.current = newDir;\n        lastPointerXRef.current = event.clientX;\n      }\n    }))\n  })))))));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$479f0f2f71193efe, {\n  displayName: $6cc32821e9371a1c$var$CONTENT_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuGroup\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$GROUP_NAME = 'MenuGroup';\nconst $6cc32821e9371a1c$export$22a631d1f72787bb = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    __scopeMenu: __scopeMenu,\n    ...groupProps\n  } = props;\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.div, $epM9y$babelruntimehelpersesmextends({\n    role: \"group\"\n  }, groupProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$22a631d1f72787bb, {\n  displayName: $6cc32821e9371a1c$var$GROUP_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuLabel\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$LABEL_NAME = 'MenuLabel';\nconst $6cc32821e9371a1c$export$dd37bec0e8a99143 = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    __scopeMenu: __scopeMenu,\n    ...labelProps\n  } = props;\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.div, $epM9y$babelruntimehelpersesmextends({}, labelProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$dd37bec0e8a99143, {\n  displayName: $6cc32821e9371a1c$var$LABEL_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuItem\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$ITEM_NAME = 'MenuItem';\nconst $6cc32821e9371a1c$var$ITEM_SELECT = 'menu.itemSelect';\nconst $6cc32821e9371a1c$export$2ce376c2cc3355c8 = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    disabled = false,\n    onSelect: onSelect,\n    ...itemProps\n  } = props;\n  const ref = $epM9y$useRef(null);\n  const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);\n  const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, props.__scopeMenu);\n  const composedRefs = $epM9y$useComposedRefs(forwardedRef, ref);\n  const isPointerDownRef = $epM9y$useRef(false);\n  const handleSelect = () => {\n    const menuItem = ref.current;\n    if (!disabled && menuItem) {\n      const itemSelectEvent = new CustomEvent($6cc32821e9371a1c$var$ITEM_SELECT, {\n        bubbles: true,\n        cancelable: true\n      });\n      menuItem.addEventListener($6cc32821e9371a1c$var$ITEM_SELECT, event => onSelect === null || onSelect === void 0 ? void 0 : onSelect(event), {\n        once: true\n      });\n      $epM9y$dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n      if (itemSelectEvent.defaultPrevented) isPointerDownRef.current = false;else rootContext.onClose();\n    }\n  };\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuItemImpl, $epM9y$babelruntimehelpersesmextends({}, itemProps, {\n    ref: composedRefs,\n    disabled: disabled,\n    onClick: $epM9y$composeEventHandlers(props.onClick, handleSelect),\n    onPointerDown: event => {\n      var _props$onPointerDown;\n      (_props$onPointerDown = props.onPointerDown) === null || _props$onPointerDown === void 0 || _props$onPointerDown.call(props, event);\n      isPointerDownRef.current = true;\n    },\n    onPointerUp: $epM9y$composeEventHandlers(props.onPointerUp, event => {\n      var _event$currentTarget;\n      // Pointer down can move to a different menu item which should activate it on pointer up.\n      // We dispatch a click for selection to allow composition with click based triggers and to\n      // prevent Firefox from getting stuck in text selection mode when the menu closes.\n      if (!isPointerDownRef.current) (_event$currentTarget = event.currentTarget) === null || _event$currentTarget === void 0 || _event$currentTarget.click();\n    }),\n    onKeyDown: $epM9y$composeEventHandlers(props.onKeyDown, event => {\n      const isTypingAhead = contentContext.searchRef.current !== '';\n      if (disabled || isTypingAhead && event.key === ' ') return;\n      if ($6cc32821e9371a1c$var$SELECTION_KEYS.includes(event.key)) {\n        event.currentTarget.click();\n        /**\n        * We prevent default browser behaviour for selection keys as they should trigger\n        * a selection only:\n        * - prevents space from scrolling the page.\n        * - if keydown causes focus to move, prevents keydown from firing on the new target.\n        */\n        event.preventDefault();\n      }\n    })\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$2ce376c2cc3355c8, {\n  displayName: $6cc32821e9371a1c$var$ITEM_NAME\n});\n/* ---------------------------------------------------------------------------------------------- */\nconst $6cc32821e9371a1c$var$MenuItemImpl = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    __scopeMenu: __scopeMenu,\n    disabled = false,\n    textValue: textValue,\n    ...itemProps\n  } = props;\n  const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$ITEM_NAME, __scopeMenu);\n  const rovingFocusGroupScope = $6cc32821e9371a1c$var$useRovingFocusGroupScope(__scopeMenu);\n  const ref = $epM9y$useRef(null);\n  const composedRefs = $epM9y$useComposedRefs(forwardedRef, ref);\n  const [isFocused, setIsFocused] = $epM9y$useState(false); // get the item's `.textContent` as default strategy for typeahead `textValue`\n  const [textContent, setTextContent] = $epM9y$useState('');\n  $epM9y$useEffect(() => {\n    const menuItem = ref.current;\n    if (menuItem) {\n      var _menuItem$textContent;\n      setTextContent(((_menuItem$textContent = menuItem.textContent) !== null && _menuItem$textContent !== void 0 ? _menuItem$textContent : '').trim());\n    }\n  }, [itemProps.children]);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.ItemSlot, {\n    scope: __scopeMenu,\n    disabled: disabled,\n    textValue: textValue !== null && textValue !== void 0 ? textValue : textContent\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Item, $epM9y$babelruntimehelpersesmextends({\n    asChild: true\n  }, rovingFocusGroupScope, {\n    focusable: !disabled\n  }), /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.div, $epM9y$babelruntimehelpersesmextends({\n    role: \"menuitem\",\n    \"data-highlighted\": isFocused ? '' : undefined,\n    \"aria-disabled\": disabled || undefined,\n    \"data-disabled\": disabled ? '' : undefined\n  }, itemProps, {\n    ref: composedRefs,\n    onPointerMove: $epM9y$composeEventHandlers(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse(event => {\n      if (disabled) contentContext.onItemLeave(event);else {\n        contentContext.onItemEnter(event);\n        if (!event.defaultPrevented) {\n          const item = event.currentTarget;\n          item.focus();\n        }\n      }\n    })),\n    onPointerLeave: $epM9y$composeEventHandlers(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse(event => contentContext.onItemLeave(event))),\n    onFocus: $epM9y$composeEventHandlers(props.onFocus, () => setIsFocused(true)),\n    onBlur: $epM9y$composeEventHandlers(props.onBlur, () => setIsFocused(false))\n  }))));\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$CHECKBOX_ITEM_NAME = 'MenuCheckboxItem';\nconst $6cc32821e9371a1c$export$f6f243521332502d = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    checked = false,\n    onCheckedChange: onCheckedChange,\n    ...checkboxItemProps\n  } = props;\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$ItemIndicatorProvider, {\n    scope: props.__scopeMenu,\n    checked: checked\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$export$2ce376c2cc3355c8, $epM9y$babelruntimehelpersesmextends({\n    role: \"menuitemcheckbox\",\n    \"aria-checked\": $6cc32821e9371a1c$var$isIndeterminate(checked) ? 'mixed' : checked\n  }, checkboxItemProps, {\n    ref: forwardedRef,\n    \"data-state\": $6cc32821e9371a1c$var$getCheckedState(checked),\n    onSelect: $epM9y$composeEventHandlers(checkboxItemProps.onSelect, () => onCheckedChange === null || onCheckedChange === void 0 ? void 0 : onCheckedChange($6cc32821e9371a1c$var$isIndeterminate(checked) ? true : !checked), {\n      checkForDefaultPrevented: false\n    })\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$f6f243521332502d, {\n  displayName: $6cc32821e9371a1c$var$CHECKBOX_ITEM_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$RADIO_GROUP_NAME = 'MenuRadioGroup';\nconst [$6cc32821e9371a1c$var$RadioGroupProvider, $6cc32821e9371a1c$var$useRadioGroupContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$RADIO_GROUP_NAME, {\n  value: undefined,\n  onValueChange: () => {}\n});\nconst $6cc32821e9371a1c$export$ea2200c9eee416b3 = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    value: value,\n    onValueChange: onValueChange,\n    ...groupProps\n  } = props;\n  const handleValueChange = $epM9y$useCallbackRef(onValueChange);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$RadioGroupProvider, {\n    scope: props.__scopeMenu,\n    value: value,\n    onValueChange: handleValueChange\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$export$22a631d1f72787bb, $epM9y$babelruntimehelpersesmextends({}, groupProps, {\n    ref: forwardedRef\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$ea2200c9eee416b3, {\n  displayName: $6cc32821e9371a1c$var$RADIO_GROUP_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$RADIO_ITEM_NAME = 'MenuRadioItem';\nconst $6cc32821e9371a1c$export$69bd225e9817f6d0 = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    value: value,\n    ...radioItemProps\n  } = props;\n  const context = $6cc32821e9371a1c$var$useRadioGroupContext($6cc32821e9371a1c$var$RADIO_ITEM_NAME, props.__scopeMenu);\n  const checked = value === context.value;\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$ItemIndicatorProvider, {\n    scope: props.__scopeMenu,\n    checked: checked\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$export$2ce376c2cc3355c8, $epM9y$babelruntimehelpersesmextends({\n    role: \"menuitemradio\",\n    \"aria-checked\": checked\n  }, radioItemProps, {\n    ref: forwardedRef,\n    \"data-state\": $6cc32821e9371a1c$var$getCheckedState(checked),\n    onSelect: $epM9y$composeEventHandlers(radioItemProps.onSelect, () => {\n      var _context$onValueChang;\n      return (_context$onValueChang = context.onValueChange) === null || _context$onValueChang === void 0 ? void 0 : _context$onValueChang.call(context, value);\n    }, {\n      checkForDefaultPrevented: false\n    })\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$69bd225e9817f6d0, {\n  displayName: $6cc32821e9371a1c$var$RADIO_ITEM_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$ITEM_INDICATOR_NAME = 'MenuItemIndicator';\nconst [$6cc32821e9371a1c$var$ItemIndicatorProvider, $6cc32821e9371a1c$var$useItemIndicatorContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$ITEM_INDICATOR_NAME, {\n  checked: false\n});\nconst $6cc32821e9371a1c$export$a2593e23056970a3 = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    __scopeMenu: __scopeMenu,\n    forceMount: forceMount,\n    ...itemIndicatorProps\n  } = props;\n  const indicatorContext = $6cc32821e9371a1c$var$useItemIndicatorContext($6cc32821e9371a1c$var$ITEM_INDICATOR_NAME, __scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Presence, {\n    present: forceMount || $6cc32821e9371a1c$var$isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.span, $epM9y$babelruntimehelpersesmextends({}, itemIndicatorProps, {\n    ref: forwardedRef,\n    \"data-state\": $6cc32821e9371a1c$var$getCheckedState(indicatorContext.checked)\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$a2593e23056970a3, {\n  displayName: $6cc32821e9371a1c$var$ITEM_INDICATOR_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuSeparator\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$SEPARATOR_NAME = 'MenuSeparator';\nconst $6cc32821e9371a1c$export$1cec7dcdd713e220 = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    __scopeMenu: __scopeMenu,\n    ...separatorProps\n  } = props;\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Primitive.div, $epM9y$babelruntimehelpersesmextends({\n    role: \"separator\",\n    \"aria-orientation\": \"horizontal\"\n  }, separatorProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$1cec7dcdd713e220, {\n  displayName: $6cc32821e9371a1c$var$SEPARATOR_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuArrow\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$ARROW_NAME = 'MenuArrow';\nconst $6cc32821e9371a1c$export$bcdda4773debf5fa = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const {\n    __scopeMenu: __scopeMenu,\n    ...arrowProps\n  } = props;\n  const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Arrow, $epM9y$babelruntimehelpersesmextends({}, popperScope, arrowProps, {\n    ref: forwardedRef\n  }));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$bcdda4773debf5fa, {\n  displayName: $6cc32821e9371a1c$var$ARROW_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuSub\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$SUB_NAME = 'MenuSub';\nconst [$6cc32821e9371a1c$var$MenuSubProvider, $6cc32821e9371a1c$var$useMenuSubContext] = $6cc32821e9371a1c$var$createMenuContext($6cc32821e9371a1c$var$SUB_NAME);\nconst $6cc32821e9371a1c$export$71bdb9d1e2909932 = props => {\n  const {\n    __scopeMenu: __scopeMenu,\n    children: children,\n    open = false,\n    onOpenChange: onOpenChange\n  } = props;\n  const parentMenuContext = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_NAME, __scopeMenu);\n  const popperScope = $6cc32821e9371a1c$var$usePopperScope(__scopeMenu);\n  const [trigger, setTrigger] = $epM9y$useState(null);\n  const [content, setContent] = $epM9y$useState(null);\n  const handleOpenChange = $epM9y$useCallbackRef(onOpenChange); // Prevent the parent menu from reopening with open submenus.\n  $epM9y$useEffect(() => {\n    if (parentMenuContext.open === false) handleOpenChange(false);\n    return () => handleOpenChange(false);\n  }, [parentMenuContext.open, handleOpenChange]);\n  return /*#__PURE__*/$epM9y$createElement($epM9y$Root, popperScope, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuProvider, {\n    scope: __scopeMenu,\n    open: open,\n    onOpenChange: handleOpenChange,\n    content: content,\n    onContentChange: setContent\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuSubProvider, {\n    scope: __scopeMenu,\n    contentId: $epM9y$useId(),\n    triggerId: $epM9y$useId(),\n    trigger: trigger,\n    onTriggerChange: setTrigger\n  }, children)));\n};\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$71bdb9d1e2909932, {\n  displayName: $6cc32821e9371a1c$var$SUB_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$SUB_TRIGGER_NAME = 'MenuSubTrigger';\nconst $6cc32821e9371a1c$export$5fbbb3ba7297405f = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);\n  const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);\n  const subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);\n  const contentContext = $6cc32821e9371a1c$var$useMenuContentContext($6cc32821e9371a1c$var$SUB_TRIGGER_NAME, props.__scopeMenu);\n  const openTimerRef = $epM9y$useRef(null);\n  const {\n    pointerGraceTimerRef: pointerGraceTimerRef,\n    onPointerGraceIntentChange: onPointerGraceIntentChange\n  } = contentContext;\n  const scope = {\n    __scopeMenu: props.__scopeMenu\n  };\n  const clearOpenTimer = $epM9y$useCallback(() => {\n    if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n    openTimerRef.current = null;\n  }, []);\n  $epM9y$useEffect(() => clearOpenTimer, [clearOpenTimer]);\n  $epM9y$useEffect(() => {\n    const pointerGraceTimer = pointerGraceTimerRef.current;\n    return () => {\n      window.clearTimeout(pointerGraceTimer);\n      onPointerGraceIntentChange(null);\n    };\n  }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$export$9fa5ebd18bee4d43, $epM9y$babelruntimehelpersesmextends({\n    asChild: true\n  }, scope), /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuItemImpl, $epM9y$babelruntimehelpersesmextends({\n    id: subContext.triggerId,\n    \"aria-haspopup\": \"menu\",\n    \"aria-expanded\": context.open,\n    \"aria-controls\": subContext.contentId,\n    \"data-state\": $6cc32821e9371a1c$var$getOpenState(context.open)\n  }, props, {\n    ref: $epM9y$composeRefs(forwardedRef, subContext.onTriggerChange) // This is redundant for mouse users but we cannot determine pointer type from\n    ,\n\n    onClick: event => {\n      var _props$onClick;\n      (_props$onClick = props.onClick) === null || _props$onClick === void 0 || _props$onClick.call(props, event);\n      if (props.disabled || event.defaultPrevented) return;\n      /**\n      * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)\n      * and we rely heavily on `onFocusOutside` for submenus to close when switching\n      * between separate submenus.\n      */\n      event.currentTarget.focus();\n      if (!context.open) context.onOpenChange(true);\n    },\n    onPointerMove: $epM9y$composeEventHandlers(props.onPointerMove, $6cc32821e9371a1c$var$whenMouse(event => {\n      contentContext.onItemEnter(event);\n      if (event.defaultPrevented) return;\n      if (!props.disabled && !context.open && !openTimerRef.current) {\n        contentContext.onPointerGraceIntentChange(null);\n        openTimerRef.current = window.setTimeout(() => {\n          context.onOpenChange(true);\n          clearOpenTimer();\n        }, 100);\n      }\n    })),\n    onPointerLeave: $epM9y$composeEventHandlers(props.onPointerLeave, $6cc32821e9371a1c$var$whenMouse(event => {\n      var _context$content;\n      clearOpenTimer();\n      const contentRect = (_context$content = context.content) === null || _context$content === void 0 ? void 0 : _context$content.getBoundingClientRect();\n      if (contentRect) {\n        var _context$content2;\n        // TODO: make sure to update this when we change positioning logic\n        const side = (_context$content2 = context.content) === null || _context$content2 === void 0 ? void 0 : _context$content2.dataset.side;\n        const rightSide = side === 'right';\n        const bleed = rightSide ? -5 : 5;\n        const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];\n        const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];\n        contentContext.onPointerGraceIntentChange({\n          area: [\n          // consistently within polygon bounds\n          {\n            x: event.clientX + bleed,\n            y: event.clientY\n          }, {\n            x: contentNearEdge,\n            y: contentRect.top\n          }, {\n            x: contentFarEdge,\n            y: contentRect.top\n          }, {\n            x: contentFarEdge,\n            y: contentRect.bottom\n          }, {\n            x: contentNearEdge,\n            y: contentRect.bottom\n          }],\n          side: side\n        });\n        window.clearTimeout(pointerGraceTimerRef.current);\n        pointerGraceTimerRef.current = window.setTimeout(() => contentContext.onPointerGraceIntentChange(null), 300);\n      } else {\n        contentContext.onTriggerLeave(event);\n        if (event.defaultPrevented) return; // There's 100ms where the user may leave an item before the submenu was opened.\n        contentContext.onPointerGraceIntentChange(null);\n      }\n    })),\n    onKeyDown: $epM9y$composeEventHandlers(props.onKeyDown, event => {\n      const isTypingAhead = contentContext.searchRef.current !== '';\n      if (props.disabled || isTypingAhead && event.key === ' ') return;\n      if ($6cc32821e9371a1c$var$SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n        var _context$content3;\n        context.onOpenChange(true); // The trigger may hold focus if opened via pointer interaction\n        // so we ensure content is given focus again when switching to keyboard.\n        (_context$content3 = context.content) === null || _context$content3 === void 0 || _context$content3.focus(); // prevent window from scrolling\n        event.preventDefault();\n      }\n    })\n  })));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$5fbbb3ba7297405f, {\n  displayName: $6cc32821e9371a1c$var$SUB_TRIGGER_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * MenuSubContent\n * -----------------------------------------------------------------------------------------------*/\nconst $6cc32821e9371a1c$var$SUB_CONTENT_NAME = 'MenuSubContent';\nconst $6cc32821e9371a1c$export$e7142ab31822bde6 = /*#__PURE__*/$epM9y$forwardRef((props, forwardedRef) => {\n  const portalContext = $6cc32821e9371a1c$var$usePortalContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  const {\n    forceMount = portalContext.forceMount,\n    ...subContentProps\n  } = props;\n  const context = $6cc32821e9371a1c$var$useMenuContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  const rootContext = $6cc32821e9371a1c$var$useMenuRootContext($6cc32821e9371a1c$var$CONTENT_NAME, props.__scopeMenu);\n  const subContext = $6cc32821e9371a1c$var$useMenuSubContext($6cc32821e9371a1c$var$SUB_CONTENT_NAME, props.__scopeMenu);\n  const ref = $epM9y$useRef(null);\n  const composedRefs = $epM9y$useComposedRefs(forwardedRef, ref);\n  return /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.Provider, {\n    scope: props.__scopeMenu\n  }, /*#__PURE__*/$epM9y$createElement($epM9y$Presence, {\n    present: forceMount || context.open\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$Collection.Slot, {\n    scope: props.__scopeMenu\n  }, /*#__PURE__*/$epM9y$createElement($6cc32821e9371a1c$var$MenuContentImpl, $epM9y$babelruntimehelpersesmextends({\n    id: subContext.contentId,\n    \"aria-labelledby\": subContext.triggerId\n  }, subContentProps, {\n    ref: composedRefs,\n    align: \"start\",\n    side: rootContext.dir === 'rtl' ? 'left' : 'right',\n    disableOutsidePointerEvents: false,\n    disableOutsideScroll: false,\n    trapFocus: false,\n    onOpenAutoFocus: event => {\n      var _ref$current;\n      // when opening a submenu, focus content for keyboard users only\n      if (rootContext.isUsingKeyboardRef.current) (_ref$current = ref.current) === null || _ref$current === void 0 || _ref$current.focus();\n      event.preventDefault();\n    } // The menu might close because of focusing another menu item in the parent menu. We\n    ,\n\n    onCloseAutoFocus: event => event.preventDefault(),\n    onFocusOutside: $epM9y$composeEventHandlers(props.onFocusOutside, event => {\n      // We prevent closing when the trigger is focused to avoid triggering a re-open animation\n      // on pointer interaction.\n      if (event.target !== subContext.trigger) context.onOpenChange(false);\n    }),\n    onEscapeKeyDown: $epM9y$composeEventHandlers(props.onEscapeKeyDown, event => {\n      rootContext.onClose(); // ensure pressing escape in submenu doesn't escape full screen mode\n      event.preventDefault();\n    }),\n    onKeyDown: $epM9y$composeEventHandlers(props.onKeyDown, event => {\n      // Submenu key events bubble through portals. We only care about keys in this menu.\n      const isKeyDownInside = event.currentTarget.contains(event.target);\n      const isCloseKey = $6cc32821e9371a1c$var$SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n      if (isKeyDownInside && isCloseKey) {\n        var _subContext$trigger;\n        context.onOpenChange(false); // We focus manually because we prevented it in `onCloseAutoFocus`\n        (_subContext$trigger = subContext.trigger) === null || _subContext$trigger === void 0 || _subContext$trigger.focus(); // prevent window from scrolling\n        event.preventDefault();\n      }\n    })\n  })))));\n});\n/*#__PURE__*/\nObject.assign($6cc32821e9371a1c$export$e7142ab31822bde6, {\n  displayName: $6cc32821e9371a1c$var$SUB_CONTENT_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/\nfunction $6cc32821e9371a1c$var$getOpenState(open) {\n  return open ? 'open' : 'closed';\n}\nfunction $6cc32821e9371a1c$var$isIndeterminate(checked) {\n  return checked === 'indeterminate';\n}\nfunction $6cc32821e9371a1c$var$getCheckedState(checked) {\n  return $6cc32821e9371a1c$var$isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\nfunction $6cc32821e9371a1c$var$focusFirst(candidates) {\n  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n  for (const candidate of candidates) {\n    // if focus is already where we want to go, we don't want to keep going through the candidates\n    if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n    candidate.focus();\n    if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n  }\n}\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction $6cc32821e9371a1c$var$wrapArray(array, startIndex) {\n  return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in all the values,\n * the search and the current match, and returns the next match (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through options starting with that character)\n *\n * We also reorder the values by wrapping the array around the current match.\n * This is so we always look forward from the current match, and picking the first\n * match will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current match from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current match still matches.\n */\nfunction $6cc32821e9371a1c$var$getNextMatch(values, search, currentMatch) {\n  const isRepeated = search.length > 1 && Array.from(search).every(char => char === search[0]);\n  const normalizedSearch = isRepeated ? search[0] : search;\n  const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n  let wrappedValues = $6cc32821e9371a1c$var$wrapArray(values, Math.max(currentMatchIndex, 0));\n  const excludeCurrentMatch = normalizedSearch.length === 1;\n  if (excludeCurrentMatch) wrappedValues = wrappedValues.filter(v => v !== currentMatch);\n  const nextMatch = wrappedValues.find(value => value.toLowerCase().startsWith(normalizedSearch.toLowerCase()));\n  return nextMatch !== currentMatch ? nextMatch : undefined;\n}\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nfunction $6cc32821e9371a1c$var$isPointInPolygon(point, polygon) {\n  const {\n    x: x,\n    y: y\n  } = point;\n  let inside = false;\n  for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n    const xi = polygon[i].x;\n    const yi = polygon[i].y;\n    const xj = polygon[j].x;\n    const yj = polygon[j].y; // prettier-ignore\n    const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n    if (intersect) inside = !inside;\n  }\n  return inside;\n}\nfunction $6cc32821e9371a1c$var$isPointerInGraceArea(event, area) {\n  if (!area) return false;\n  const cursorPos = {\n    x: event.clientX,\n    y: event.clientY\n  };\n  return $6cc32821e9371a1c$var$isPointInPolygon(cursorPos, area);\n}\nfunction $6cc32821e9371a1c$var$whenMouse(handler) {\n  return event => event.pointerType === 'mouse' ? handler(event) : undefined;\n}\nconst $6cc32821e9371a1c$export$be92b6f5f03c0fe9 = $6cc32821e9371a1c$export$d9b273488cd8ce6f;\nconst $6cc32821e9371a1c$export$b688253958b8dfe7 = $6cc32821e9371a1c$export$9fa5ebd18bee4d43;\nconst $6cc32821e9371a1c$export$602eac185826482c = $6cc32821e9371a1c$export$793392f970497feb;\nconst $6cc32821e9371a1c$export$7c6e2c02157bb7d2 = $6cc32821e9371a1c$export$479f0f2f71193efe;\nconst $6cc32821e9371a1c$export$eb2fcfdbd7ba97d4 = $6cc32821e9371a1c$export$22a631d1f72787bb;\nconst $6cc32821e9371a1c$export$b04be29aa201d4f5 = $6cc32821e9371a1c$export$dd37bec0e8a99143;\nconst $6cc32821e9371a1c$export$6d08773d2e66f8f2 = $6cc32821e9371a1c$export$2ce376c2cc3355c8;\nconst $6cc32821e9371a1c$export$16ce288f89fa631c = $6cc32821e9371a1c$export$f6f243521332502d;\nconst $6cc32821e9371a1c$export$a98f0dcb43a68a25 = $6cc32821e9371a1c$export$ea2200c9eee416b3;\nconst $6cc32821e9371a1c$export$371ab307eab489c0 = $6cc32821e9371a1c$export$69bd225e9817f6d0;\nconst $6cc32821e9371a1c$export$c3468e2714d175fa = $6cc32821e9371a1c$export$a2593e23056970a3;\nconst $6cc32821e9371a1c$export$1ff3c3f08ae963c0 = $6cc32821e9371a1c$export$1cec7dcdd713e220;\nconst $6cc32821e9371a1c$export$21b07c8f274aebd5 = $6cc32821e9371a1c$export$bcdda4773debf5fa;\nconst $6cc32821e9371a1c$export$d7a01e11500dfb6f = $6cc32821e9371a1c$export$71bdb9d1e2909932;\nconst $6cc32821e9371a1c$export$2ea8a7a591ac5eac = $6cc32821e9371a1c$export$5fbbb3ba7297405f;\nconst $6cc32821e9371a1c$export$6d4de93b380beddf = $6cc32821e9371a1c$export$e7142ab31822bde6;\nexport { $6cc32821e9371a1c$export$4027731b685e72eb as createMenuScope, $6cc32821e9371a1c$export$d9b273488cd8ce6f as Menu, $6cc32821e9371a1c$export$9fa5ebd18bee4d43 as MenuAnchor, $6cc32821e9371a1c$export$793392f970497feb as MenuPortal, $6cc32821e9371a1c$export$479f0f2f71193efe as MenuContent, $6cc32821e9371a1c$export$22a631d1f72787bb as MenuGroup, $6cc32821e9371a1c$export$dd37bec0e8a99143 as MenuLabel, $6cc32821e9371a1c$export$2ce376c2cc3355c8 as MenuItem, $6cc32821e9371a1c$export$f6f243521332502d as MenuCheckboxItem, $6cc32821e9371a1c$export$ea2200c9eee416b3 as MenuRadioGroup, $6cc32821e9371a1c$export$69bd225e9817f6d0 as MenuRadioItem, $6cc32821e9371a1c$export$a2593e23056970a3 as MenuItemIndicator, $6cc32821e9371a1c$export$1cec7dcdd713e220 as MenuSeparator, $6cc32821e9371a1c$export$bcdda4773debf5fa as MenuArrow, $6cc32821e9371a1c$export$71bdb9d1e2909932 as MenuSub, $6cc32821e9371a1c$export$5fbbb3ba7297405f as MenuSubTrigger, $6cc32821e9371a1c$export$e7142ab31822bde6 as MenuSubContent, $6cc32821e9371a1c$export$be92b6f5f03c0fe9 as Root, $6cc32821e9371a1c$export$b688253958b8dfe7 as Anchor, $6cc32821e9371a1c$export$602eac185826482c as Portal, $6cc32821e9371a1c$export$7c6e2c02157bb7d2 as Content, $6cc32821e9371a1c$export$eb2fcfdbd7ba97d4 as Group, $6cc32821e9371a1c$export$b04be29aa201d4f5 as Label, $6cc32821e9371a1c$export$6d08773d2e66f8f2 as Item, $6cc32821e9371a1c$export$16ce288f89fa631c as CheckboxItem, $6cc32821e9371a1c$export$a98f0dcb43a68a25 as RadioGroup, $6cc32821e9371a1c$export$371ab307eab489c0 as RadioItem, $6cc32821e9371a1c$export$c3468e2714d175fa as ItemIndicator, $6cc32821e9371a1c$export$1ff3c3f08ae963c0 as Separator, $6cc32821e9371a1c$export$21b07c8f274aebd5 as Arrow, $6cc32821e9371a1c$export$d7a01e11500dfb6f as Sub, $6cc32821e9371a1c$export$2ea8a7a591ac5eac as SubTrigger, $6cc32821e9371a1c$export$6d4de93b380beddf as SubContent };","map":{"version":3,"names":["$6cc32821e9371a1c$var$SELECTION_KEYS","$6cc32821e9371a1c$var$FIRST_KEYS","$6cc32821e9371a1c$var$LAST_KEYS","$6cc32821e9371a1c$var$FIRST_LAST_KEYS","$6cc32821e9371a1c$var$SUB_OPEN_KEYS","ltr","rtl","$6cc32821e9371a1c$var$SUB_CLOSE_KEYS","$6cc32821e9371a1c$var$MENU_NAME","$6cc32821e9371a1c$var$Collection","$6cc32821e9371a1c$var$useCollection","$6cc32821e9371a1c$var$createCollectionScope","$epM9y$createCollection","$6cc32821e9371a1c$var$createMenuContext","$6cc32821e9371a1c$export$4027731b685e72eb","$epM9y$createContextScope","$epM9y$createPopperScope","$epM9y$createRovingFocusGroupScope","$6cc32821e9371a1c$var$usePopperScope","$6cc32821e9371a1c$var$useRovingFocusGroupScope","$6cc32821e9371a1c$var$MenuProvider","$6cc32821e9371a1c$var$useMenuContext","$6cc32821e9371a1c$var$MenuRootProvider","$6cc32821e9371a1c$var$useMenuRootContext","$6cc32821e9371a1c$export$d9b273488cd8ce6f","props","__scopeMenu","open","children","dir","onOpenChange","modal","popperScope","content","setContent","$epM9y$useState","isUsingKeyboardRef","$epM9y$useRef","handleOpenChange","$epM9y$useCallbackRef","direction","$epM9y$useDirection","$epM9y$useEffect","handleKeyDown","current","document","addEventListener","handlePointer","capture","once","removeEventListener","$epM9y$createElement","$epM9y$Root","scope","onContentChange","onClose","$epM9y$useCallback","Object","assign","displayName","$6cc32821e9371a1c$var$ANCHOR_NAME","$6cc32821e9371a1c$export$9fa5ebd18bee4d43","$epM9y$forwardRef","forwardedRef","anchorProps","$epM9y$Anchor","$epM9y$babelruntimehelpersesmextends","ref","$6cc32821e9371a1c$var$PORTAL_NAME","$6cc32821e9371a1c$var$PortalProvider","$6cc32821e9371a1c$var$usePortalContext","forceMount","undefined","$6cc32821e9371a1c$export$793392f970497feb","container","context","$epM9y$Presence","present","$epM9y$Portal","asChild","$6cc32821e9371a1c$var$CONTENT_NAME","$6cc32821e9371a1c$var$MenuContentProvider","$6cc32821e9371a1c$var$useMenuContentContext","$6cc32821e9371a1c$export$479f0f2f71193efe","portalContext","contentProps","rootContext","Provider","Slot","$6cc32821e9371a1c$var$MenuRootContentModal","$6cc32821e9371a1c$var$MenuRootContentNonModal","composedRefs","$epM9y$useComposedRefs","$epM9y$hideOthers","$6cc32821e9371a1c$var$MenuContentImpl","trapFocus","disableOutsidePointerEvents","disableOutsideScroll","onFocusOutside","$epM9y$composeEventHandlers","event","preventDefault","checkForDefaultPrevented","onDismiss","loop","onOpenAutoFocus","onCloseAutoFocus","onEntryFocus","onEscapeKeyDown","onPointerDownOutside","onInteractOutside","rovingFocusGroupScope","getItems","currentItemId","setCurrentItemId","contentRef","timerRef","searchRef","pointerGraceTimerRef","pointerGraceIntentRef","pointerDirRef","lastPointerXRef","ScrollLockWrapper","$epM9y$RemoveScroll","$epM9y$Fragment","scrollLockWrapperProps","as","$epM9y$Slot","allowPinchZoom","handleTypeaheadSearch","key","_items$find","_items$find2","search","items","filter","item","disabled","currentItem","activeElement","currentMatch","find","textValue","values","map","nextMatch","$6cc32821e9371a1c$var$getNextMatch","newItem","updateSearch","value","window","clearTimeout","setTimeout","focus","$epM9y$useFocusGuards","isPointerMovingToSubmenu","_pointerGraceIntentRe","_pointerGraceIntentRe2","isMovingTowards","side","$6cc32821e9371a1c$var$isPointerInGraceArea","area","onItemEnter","onItemLeave","_contentRef$current","onTriggerLeave","onPointerGraceIntentChange","intent","$epM9y$FocusScope","trapped","onMountAutoFocus","_contentRef$current2","onUnmountAutoFocus","$epM9y$DismissableLayer","$epM9y$Root1","orientation","currentTabStopId","onCurrentTabStopIdChange","$epM9y$Content","role","$6cc32821e9371a1c$var$getOpenState","style","outline","onKeyDown","target","isKeyDownInside","closest","currentTarget","isModifierKey","ctrlKey","altKey","metaKey","isCharacterKey","length","includes","candidateNodes","reverse","$6cc32821e9371a1c$var$focusFirst","onBlur","contains","onPointerMove","$6cc32821e9371a1c$var$whenMouse","pointerXHasChanged","clientX","newDir","$6cc32821e9371a1c$var$GROUP_NAME","$6cc32821e9371a1c$export$22a631d1f72787bb","groupProps","$epM9y$Primitive","div","$6cc32821e9371a1c$var$LABEL_NAME","$6cc32821e9371a1c$export$dd37bec0e8a99143","labelProps","$6cc32821e9371a1c$var$ITEM_NAME","$6cc32821e9371a1c$var$ITEM_SELECT","$6cc32821e9371a1c$export$2ce376c2cc3355c8","onSelect","itemProps","contentContext","isPointerDownRef","handleSelect","menuItem","itemSelectEvent","CustomEvent","bubbles","cancelable","$epM9y$dispatchDiscreteCustomEvent","defaultPrevented","$6cc32821e9371a1c$var$MenuItemImpl","onClick","onPointerDown","_props$onPointerDown","call","onPointerUp","_event$currentTarget","click","isTypingAhead","isFocused","setIsFocused","textContent","setTextContent","_menuItem$textContent","trim","ItemSlot","$epM9y$Item","focusable","onPointerLeave","onFocus","$6cc32821e9371a1c$var$CHECKBOX_ITEM_NAME","$6cc32821e9371a1c$export$f6f243521332502d","checked","onCheckedChange","checkboxItemProps","$6cc32821e9371a1c$var$ItemIndicatorProvider","$6cc32821e9371a1c$var$isIndeterminate","$6cc32821e9371a1c$var$getCheckedState","$6cc32821e9371a1c$var$RADIO_GROUP_NAME","$6cc32821e9371a1c$var$RadioGroupProvider","$6cc32821e9371a1c$var$useRadioGroupContext","onValueChange","$6cc32821e9371a1c$export$ea2200c9eee416b3","handleValueChange","$6cc32821e9371a1c$var$RADIO_ITEM_NAME","$6cc32821e9371a1c$export$69bd225e9817f6d0","radioItemProps","_context$onValueChang","$6cc32821e9371a1c$var$ITEM_INDICATOR_NAME","$6cc32821e9371a1c$var$useItemIndicatorContext","$6cc32821e9371a1c$export$a2593e23056970a3","itemIndicatorProps","indicatorContext","span","$6cc32821e9371a1c$var$SEPARATOR_NAME","$6cc32821e9371a1c$export$1cec7dcdd713e220","separatorProps","$6cc32821e9371a1c$var$ARROW_NAME","$6cc32821e9371a1c$export$bcdda4773debf5fa","arrowProps","$epM9y$Arrow","$6cc32821e9371a1c$var$SUB_NAME","$6cc32821e9371a1c$var$MenuSubProvider","$6cc32821e9371a1c$var$useMenuSubContext","$6cc32821e9371a1c$export$71bdb9d1e2909932","parentMenuContext","trigger","setTrigger","contentId","$epM9y$useId","triggerId","onTriggerChange","$6cc32821e9371a1c$var$SUB_TRIGGER_NAME","$6cc32821e9371a1c$export$5fbbb3ba7297405f","subContext","openTimerRef","clearOpenTimer","pointerGraceTimer","id","$epM9y$composeRefs","_props$onClick","_context$content","contentRect","getBoundingClientRect","_context$content2","dataset","rightSide","bleed","contentNearEdge","contentFarEdge","x","y","clientY","top","bottom","_context$content3","$6cc32821e9371a1c$var$SUB_CONTENT_NAME","$6cc32821e9371a1c$export$e7142ab31822bde6","subContentProps","align","_ref$current","isCloseKey","_subContext$trigger","getOpenState","isIndeterminate","getCheckedState","focusFirst","candidates","PREVIOUSLY_FOCUSED_ELEMENT","candidate","$6cc32821e9371a1c$var$wrapArray","wrapArray","array","startIndex","_","index","getNextMatch","isRepeated","Array","from","every","char","normalizedSearch","currentMatchIndex","indexOf","wrappedValues","Math","max","excludeCurrentMatch","v","toLowerCase","startsWith","$6cc32821e9371a1c$var$isPointInPolygon","isPointInPolygon","point","polygon","inside","i","j","xi","yi","xj","yj","intersect","isPointerInGraceArea","cursorPos","whenMouse","handler","pointerType","$6cc32821e9371a1c$export$be92b6f5f03c0fe9","$6cc32821e9371a1c$export$b688253958b8dfe7","$6cc32821e9371a1c$export$602eac185826482c","$6cc32821e9371a1c$export$7c6e2c02157bb7d2","$6cc32821e9371a1c$export$eb2fcfdbd7ba97d4","$6cc32821e9371a1c$export$b04be29aa201d4f5","$6cc32821e9371a1c$export$6d08773d2e66f8f2","$6cc32821e9371a1c$export$16ce288f89fa631c","$6cc32821e9371a1c$export$a98f0dcb43a68a25","$6cc32821e9371a1c$export$371ab307eab489c0","$6cc32821e9371a1c$export$c3468e2714d175fa","$6cc32821e9371a1c$export$1ff3c3f08ae963c0","$6cc32821e9371a1c$export$21b07c8f274aebd5","$6cc32821e9371a1c$export$d7a01e11500dfb6f","$6cc32821e9371a1c$export$2ea8a7a591ac5eac","$6cc32821e9371a1c$export$6d4de93b380beddf"],"sources":["C:\\Users\\user\\Desktop\\05portreact\\node_modules\\@radix-ui\\react-menu\\dist\\packages\\react\\menu\\src\\index.ts","C:\\Users\\user\\Desktop\\05portreact\\node_modules\\@radix-ui\\react-menu\\dist\\packages\\react\\menu\\src\\Menu.tsx"],"sourcesContent":["export {\n  createMenuScope,\n  //\n  Menu,\n  MenuAnchor,\n  MenuPortal,\n  MenuContent,\n  MenuGroup,\n  MenuLabel,\n  MenuItem,\n  MenuCheckboxItem,\n  MenuRadioGroup,\n  MenuRadioItem,\n  MenuItemIndicator,\n  MenuSeparator,\n  MenuArrow,\n  MenuSub,\n  MenuSubTrigger,\n  MenuSubContent,\n  //\n  Root,\n  Anchor,\n  Portal,\n  Content,\n  Group,\n  Label,\n  Item,\n  CheckboxItem,\n  RadioGroup,\n  RadioItem,\n  ItemIndicator,\n  Separator,\n  Arrow,\n  Sub,\n  SubTrigger,\n  SubContent,\n} from './Menu';\nexport type {\n  MenuProps,\n  MenuAnchorProps,\n  MenuPortalProps,\n  MenuContentProps,\n  MenuGroupProps,\n  MenuLabelProps,\n  MenuItemProps,\n  MenuCheckboxItemProps,\n  MenuRadioGroupProps,\n  MenuRadioItemProps,\n  MenuItemIndicatorProps,\n  MenuSeparatorProps,\n  MenuArrowProps,\n  MenuSubProps,\n  MenuSubTriggerProps,\n  MenuSubContentProps,\n} from './Menu';\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs, composeRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useDirection } from '@radix-ui/react-direction';\nimport { DismissableLayer } from '@radix-ui/react-dismissable-layer';\nimport { useFocusGuards } from '@radix-ui/react-focus-guards';\nimport { FocusScope } from '@radix-ui/react-focus-scope';\nimport { useId } from '@radix-ui/react-id';\nimport * as PopperPrimitive from '@radix-ui/react-popper';\nimport { createPopperScope } from '@radix-ui/react-popper';\nimport { Portal as PortalPrimitive } from '@radix-ui/react-portal';\nimport { Presence } from '@radix-ui/react-presence';\nimport { Primitive, dispatchDiscreteCustomEvent } from '@radix-ui/react-primitive';\nimport * as RovingFocusGroup from '@radix-ui/react-roving-focus';\nimport { createRovingFocusGroupScope } from '@radix-ui/react-roving-focus';\nimport { Slot } from '@radix-ui/react-slot';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { hideOthers } from 'aria-hidden';\nimport { RemoveScroll } from 'react-remove-scroll';\n\nimport type * as Radix from '@radix-ui/react-primitive';\nimport type { Scope } from '@radix-ui/react-context';\n\ntype Direction = 'ltr' | 'rtl';\n\nconst SELECTION_KEYS = ['Enter', ' '];\nconst FIRST_KEYS = ['ArrowDown', 'PageUp', 'Home'];\nconst LAST_KEYS = ['ArrowUp', 'PageDown', 'End'];\nconst FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nconst SUB_OPEN_KEYS: Record<Direction, string[]> = {\n  ltr: [...SELECTION_KEYS, 'ArrowRight'],\n  rtl: [...SELECTION_KEYS, 'ArrowLeft'],\n};\nconst SUB_CLOSE_KEYS: Record<Direction, string[]> = {\n  ltr: ['ArrowLeft'],\n  rtl: ['ArrowRight'],\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Menu\n * -----------------------------------------------------------------------------------------------*/\n\nconst MENU_NAME = 'Menu';\n\ntype ItemData = { disabled: boolean; textValue: string };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n  MenuItemElement,\n  ItemData\n>(MENU_NAME);\n\ntype ScopedProps<P> = P & { __scopeMenu?: Scope };\nconst [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n  createCollectionScope,\n  createPopperScope,\n  createRovingFocusGroupScope,\n]);\nconst usePopperScope = createPopperScope();\nconst useRovingFocusGroupScope = createRovingFocusGroupScope();\n\ntype MenuContextValue = {\n  open: boolean;\n  onOpenChange(open: boolean): void;\n  content: MenuContentElement | null;\n  onContentChange(content: MenuContentElement | null): void;\n};\n\nconst [MenuProvider, useMenuContext] = createMenuContext<MenuContextValue>(MENU_NAME);\n\ntype MenuRootContextValue = {\n  onClose(): void;\n  isUsingKeyboardRef: React.RefObject<boolean>;\n  dir: Direction;\n  modal: boolean;\n};\n\nconst [MenuRootProvider, useMenuRootContext] = createMenuContext<MenuRootContextValue>(MENU_NAME);\n\ninterface MenuProps {\n  children?: React.ReactNode;\n  open?: boolean;\n  onOpenChange?(open: boolean): void;\n  dir?: Direction;\n  modal?: boolean;\n}\n\nconst Menu: React.FC<MenuProps> = (props: ScopedProps<MenuProps>) => {\n  const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n  const popperScope = usePopperScope(__scopeMenu);\n  const [content, setContent] = React.useState<MenuContentElement | null>(null);\n  const isUsingKeyboardRef = React.useRef(false);\n  const handleOpenChange = useCallbackRef(onOpenChange);\n  const direction = useDirection(dir);\n\n  React.useEffect(() => {\n    // Capture phase ensures we set the boolean before any side effects execute\n    // in response to the key or pointer event as they might depend on this value.\n    const handleKeyDown = () => {\n      isUsingKeyboardRef.current = true;\n      document.addEventListener('pointerdown', handlePointer, { capture: true, once: true });\n      document.addEventListener('pointermove', handlePointer, { capture: true, once: true });\n    };\n    const handlePointer = () => (isUsingKeyboardRef.current = false);\n    document.addEventListener('keydown', handleKeyDown, { capture: true });\n    return () => {\n      document.removeEventListener('keydown', handleKeyDown, { capture: true });\n      document.removeEventListener('pointerdown', handlePointer, { capture: true });\n      document.removeEventListener('pointermove', handlePointer, { capture: true });\n    };\n  }, []);\n\n  return (\n    <PopperPrimitive.Root {...popperScope}>\n      <MenuProvider\n        scope={__scopeMenu}\n        open={open}\n        onOpenChange={handleOpenChange}\n        content={content}\n        onContentChange={setContent}\n      >\n        <MenuRootProvider\n          scope={__scopeMenu}\n          onClose={React.useCallback(() => handleOpenChange(false), [handleOpenChange])}\n          isUsingKeyboardRef={isUsingKeyboardRef}\n          dir={direction}\n          modal={modal}\n        >\n          {children}\n        </MenuRootProvider>\n      </MenuProvider>\n    </PopperPrimitive.Root>\n  );\n};\n\nMenu.displayName = MENU_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuAnchor\n * -----------------------------------------------------------------------------------------------*/\n\nconst ANCHOR_NAME = 'MenuAnchor';\n\ntype MenuAnchorElement = React.ElementRef<typeof PopperPrimitive.Anchor>;\ntype PopperAnchorProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Anchor>;\ninterface MenuAnchorProps extends PopperAnchorProps {}\n\nconst MenuAnchor = React.forwardRef<MenuAnchorElement, MenuAnchorProps>(\n  (props: ScopedProps<MenuAnchorProps>, forwardedRef) => {\n    const { __scopeMenu, ...anchorProps } = props;\n    const popperScope = usePopperScope(__scopeMenu);\n    return <PopperPrimitive.Anchor {...popperScope} {...anchorProps} ref={forwardedRef} />;\n  }\n);\n\nMenuAnchor.displayName = ANCHOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuPortal\n * -----------------------------------------------------------------------------------------------*/\n\nconst PORTAL_NAME = 'MenuPortal';\n\ntype PortalContextValue = { forceMount?: true };\nconst [PortalProvider, usePortalContext] = createMenuContext<PortalContextValue>(PORTAL_NAME, {\n  forceMount: undefined,\n});\n\ntype PortalProps = React.ComponentPropsWithoutRef<typeof PortalPrimitive>;\ninterface MenuPortalProps extends Omit<PortalProps, 'asChild'> {\n  children?: React.ReactNode;\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling animation with React animation libraries.\n   */\n  forceMount?: true;\n}\n\nconst MenuPortal: React.FC<MenuPortalProps> = (props: ScopedProps<MenuPortalProps>) => {\n  const { __scopeMenu, forceMount, children, container } = props;\n  const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n  return (\n    <PortalProvider scope={__scopeMenu} forceMount={forceMount}>\n      <Presence present={forceMount || context.open}>\n        <PortalPrimitive asChild container={container}>\n          {children}\n        </PortalPrimitive>\n      </Presence>\n    </PortalProvider>\n  );\n};\n\nMenuPortal.displayName = PORTAL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst CONTENT_NAME = 'MenuContent';\n\ntype MenuContentContextValue = {\n  onItemEnter(event: React.PointerEvent): void;\n  onItemLeave(event: React.PointerEvent): void;\n  onTriggerLeave(event: React.PointerEvent): void;\n  searchRef: React.RefObject<string>;\n  pointerGraceTimerRef: React.MutableRefObject<number>;\n  onPointerGraceIntentChange(intent: GraceIntent | null): void;\n};\nconst [MenuContentProvider, useMenuContentContext] =\n  createMenuContext<MenuContentContextValue>(CONTENT_NAME);\n\ntype MenuContentElement = MenuRootContentTypeElement;\n/**\n * We purposefully don't union MenuRootContent and MenuSubContent props here because\n * they have conflicting prop types. We agreed that we would allow MenuSubContent to\n * accept props that it would just ignore.\n */\ninterface MenuContentProps extends MenuRootContentTypeProps {\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling animation with React animation libraries.\n   */\n  forceMount?: true;\n}\n\nconst MenuContent = React.forwardRef<MenuContentElement, MenuContentProps>(\n  (props: ScopedProps<MenuContentProps>, forwardedRef) => {\n    const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n    const { forceMount = portalContext.forceMount, ...contentProps } = props;\n    const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n    const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n\n    return (\n      <Collection.Provider scope={props.__scopeMenu}>\n        <Presence present={forceMount || context.open}>\n          <Collection.Slot scope={props.__scopeMenu}>\n            {rootContext.modal ? (\n              <MenuRootContentModal {...contentProps} ref={forwardedRef} />\n            ) : (\n              <MenuRootContentNonModal {...contentProps} ref={forwardedRef} />\n            )}\n          </Collection.Slot>\n        </Presence>\n      </Collection.Provider>\n    );\n  }\n);\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuRootContentTypeElement = MenuContentImplElement;\ninterface MenuRootContentTypeProps\n  extends Omit<MenuContentImplProps, keyof MenuContentImplPrivateProps> {}\n\nconst MenuRootContentModal = React.forwardRef<MenuRootContentTypeElement, MenuRootContentTypeProps>(\n  (props: ScopedProps<MenuRootContentTypeProps>, forwardedRef) => {\n    const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n    const ref = React.useRef<MenuRootContentTypeElement>(null);\n    const composedRefs = useComposedRefs(forwardedRef, ref);\n\n    // Hide everything from ARIA except the `MenuContent`\n    React.useEffect(() => {\n      const content = ref.current;\n      if (content) return hideOthers(content);\n    }, []);\n\n    return (\n      <MenuContentImpl\n        {...props}\n        ref={composedRefs}\n        // we make sure we're not trapping once it's been closed\n        // (closed !== unmounted when animating out)\n        trapFocus={context.open}\n        // make sure to only disable pointer events when open\n        // this avoids blocking interactions while animating out\n        disableOutsidePointerEvents={context.open}\n        disableOutsideScroll\n        // When focus is trapped, a `focusout` event may still happen.\n        // We make sure we don't trigger our `onDismiss` in such case.\n        onFocusOutside={composeEventHandlers(\n          props.onFocusOutside,\n          (event) => event.preventDefault(),\n          { checkForDefaultPrevented: false }\n        )}\n        onDismiss={() => context.onOpenChange(false)}\n      />\n    );\n  }\n);\n\nconst MenuRootContentNonModal = React.forwardRef<\n  MenuRootContentTypeElement,\n  MenuRootContentTypeProps\n>((props: ScopedProps<MenuRootContentTypeProps>, forwardedRef) => {\n  const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n  return (\n    <MenuContentImpl\n      {...props}\n      ref={forwardedRef}\n      trapFocus={false}\n      disableOutsidePointerEvents={false}\n      disableOutsideScroll={false}\n      onDismiss={() => context.onOpenChange(false)}\n    />\n  );\n});\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuContentImplElement = React.ElementRef<typeof PopperPrimitive.Content>;\ntype FocusScopeProps = Radix.ComponentPropsWithoutRef<typeof FocusScope>;\ntype DismissableLayerProps = Radix.ComponentPropsWithoutRef<typeof DismissableLayer>;\ntype RovingFocusGroupProps = Radix.ComponentPropsWithoutRef<typeof RovingFocusGroup.Root>;\ntype PopperContentProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Content>;\ntype MenuContentImplPrivateProps = {\n  onOpenAutoFocus?: FocusScopeProps['onMountAutoFocus'];\n  onDismiss?: DismissableLayerProps['onDismiss'];\n  disableOutsidePointerEvents?: DismissableLayerProps['disableOutsidePointerEvents'];\n\n  /**\n   * Whether scrolling outside the `MenuContent` should be prevented\n   * (default: `false`)\n   */\n  disableOutsideScroll?: boolean;\n\n  /**\n   * Whether focus should be trapped within the `MenuContent`\n   * (default: false)\n   */\n  trapFocus?: FocusScopeProps['trapped'];\n};\ninterface MenuContentImplProps\n  extends MenuContentImplPrivateProps,\n    Omit<PopperContentProps, 'dir' | 'onPlaced'> {\n  /**\n   * Event handler called when auto-focusing on close.\n   * Can be prevented.\n   */\n  onCloseAutoFocus?: FocusScopeProps['onUnmountAutoFocus'];\n\n  /**\n   * Whether keyboard navigation should loop around\n   * @defaultValue false\n   */\n  loop?: RovingFocusGroupProps['loop'];\n\n  onEntryFocus?: RovingFocusGroupProps['onEntryFocus'];\n  onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown'];\n  onPointerDownOutside?: DismissableLayerProps['onPointerDownOutside'];\n  onFocusOutside?: DismissableLayerProps['onFocusOutside'];\n  onInteractOutside?: DismissableLayerProps['onInteractOutside'];\n}\n\nconst MenuContentImpl = React.forwardRef<MenuContentImplElement, MenuContentImplProps>(\n  (props: ScopedProps<MenuContentImplProps>, forwardedRef) => {\n    const {\n      __scopeMenu,\n      loop = false,\n      trapFocus,\n      onOpenAutoFocus,\n      onCloseAutoFocus,\n      disableOutsidePointerEvents,\n      onEntryFocus,\n      onEscapeKeyDown,\n      onPointerDownOutside,\n      onFocusOutside,\n      onInteractOutside,\n      onDismiss,\n      disableOutsideScroll,\n      ...contentProps\n    } = props;\n    const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n    const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n    const popperScope = usePopperScope(__scopeMenu);\n    const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n    const getItems = useCollection(__scopeMenu);\n    const [currentItemId, setCurrentItemId] = React.useState<string | null>(null);\n    const contentRef = React.useRef<HTMLDivElement>(null);\n    const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n    const timerRef = React.useRef(0);\n    const searchRef = React.useRef('');\n    const pointerGraceTimerRef = React.useRef(0);\n    const pointerGraceIntentRef = React.useRef<GraceIntent | null>(null);\n    const pointerDirRef = React.useRef<Side>('right');\n    const lastPointerXRef = React.useRef(0);\n\n    const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n    const scrollLockWrapperProps = disableOutsideScroll\n      ? { as: Slot, allowPinchZoom: true }\n      : undefined;\n\n    const handleTypeaheadSearch = (key: string) => {\n      const search = searchRef.current + key;\n      const items = getItems().filter((item) => !item.disabled);\n      const currentItem = document.activeElement;\n      const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n      const values = items.map((item) => item.textValue);\n      const nextMatch = getNextMatch(values, search, currentMatch);\n      const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n\n      // Reset `searchRef` 1 second after it was last updated\n      (function updateSearch(value: string) {\n        searchRef.current = value;\n        window.clearTimeout(timerRef.current);\n        if (value !== '') timerRef.current = window.setTimeout(() => updateSearch(''), 1000);\n      })(search);\n\n      if (newItem) {\n        /**\n         * Imperative focus during keydown is risky so we prevent React's batching updates\n         * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n         */\n        setTimeout(() => (newItem as HTMLElement).focus());\n      }\n    };\n\n    React.useEffect(() => {\n      return () => window.clearTimeout(timerRef.current);\n    }, []);\n\n    // Make sure the whole tree has focus guards as our `MenuContent` may be\n    // the last element in the DOM (beacuse of the `Portal`)\n    useFocusGuards();\n\n    const isPointerMovingToSubmenu = React.useCallback((event: React.PointerEvent) => {\n      const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n      return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n    }, []);\n\n    return (\n      <MenuContentProvider\n        scope={__scopeMenu}\n        searchRef={searchRef}\n        onItemEnter={React.useCallback(\n          (event) => {\n            if (isPointerMovingToSubmenu(event)) event.preventDefault();\n          },\n          [isPointerMovingToSubmenu]\n        )}\n        onItemLeave={React.useCallback(\n          (event) => {\n            if (isPointerMovingToSubmenu(event)) return;\n            contentRef.current?.focus();\n            setCurrentItemId(null);\n          },\n          [isPointerMovingToSubmenu]\n        )}\n        onTriggerLeave={React.useCallback(\n          (event) => {\n            if (isPointerMovingToSubmenu(event)) event.preventDefault();\n          },\n          [isPointerMovingToSubmenu]\n        )}\n        pointerGraceTimerRef={pointerGraceTimerRef}\n        onPointerGraceIntentChange={React.useCallback((intent) => {\n          pointerGraceIntentRef.current = intent;\n        }, [])}\n      >\n        <ScrollLockWrapper {...scrollLockWrapperProps}>\n          <FocusScope\n            asChild\n            trapped={trapFocus}\n            onMountAutoFocus={composeEventHandlers(onOpenAutoFocus, (event) => {\n              // when opening, explicitly focus the content area only and leave\n              // `onEntryFocus` in  control of focusing first item\n              event.preventDefault();\n              contentRef.current?.focus();\n            })}\n            onUnmountAutoFocus={onCloseAutoFocus}\n          >\n            <DismissableLayer\n              asChild\n              disableOutsidePointerEvents={disableOutsidePointerEvents}\n              onEscapeKeyDown={onEscapeKeyDown}\n              onPointerDownOutside={onPointerDownOutside}\n              onFocusOutside={onFocusOutside}\n              onInteractOutside={onInteractOutside}\n              onDismiss={onDismiss}\n            >\n              <RovingFocusGroup.Root\n                asChild\n                {...rovingFocusGroupScope}\n                dir={rootContext.dir}\n                orientation=\"vertical\"\n                loop={loop}\n                currentTabStopId={currentItemId}\n                onCurrentTabStopIdChange={setCurrentItemId}\n                onEntryFocus={composeEventHandlers(onEntryFocus, (event) => {\n                  // only focus first item when using keyboard\n                  if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n                })}\n              >\n                <PopperPrimitive.Content\n                  role=\"menu\"\n                  aria-orientation=\"vertical\"\n                  data-state={getOpenState(context.open)}\n                  data-radix-menu-content=\"\"\n                  dir={rootContext.dir}\n                  {...popperScope}\n                  {...contentProps}\n                  ref={composedRefs}\n                  style={{ outline: 'none', ...contentProps.style }}\n                  onKeyDown={composeEventHandlers(contentProps.onKeyDown, (event) => {\n                    // submenu key events bubble through portals. We only care about keys in this menu.\n                    const target = event.target as HTMLElement;\n                    const isKeyDownInside =\n                      target.closest('[data-radix-menu-content]') === event.currentTarget;\n                    const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n                    const isCharacterKey = event.key.length === 1;\n                    if (isKeyDownInside) {\n                      // menus should not be navigated using tab key so we prevent it\n                      if (event.key === 'Tab') event.preventDefault();\n                      if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n                    }\n                    // focus first/last item based on key pressed\n                    const content = contentRef.current;\n                    if (event.target !== content) return;\n                    if (!FIRST_LAST_KEYS.includes(event.key)) return;\n                    event.preventDefault();\n                    const items = getItems().filter((item) => !item.disabled);\n                    const candidateNodes = items.map((item) => item.ref.current!);\n                    if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n                    focusFirst(candidateNodes);\n                  })}\n                  onBlur={composeEventHandlers(props.onBlur, (event) => {\n                    // clear search buffer when leaving the menu\n                    if (!event.currentTarget.contains(event.target)) {\n                      window.clearTimeout(timerRef.current);\n                      searchRef.current = '';\n                    }\n                  })}\n                  onPointerMove={composeEventHandlers(\n                    props.onPointerMove,\n                    whenMouse((event) => {\n                      const target = event.target as HTMLElement;\n                      const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n\n                      // We don't use `event.movementX` for this check because Safari will\n                      // always return `0` on a pointer event.\n                      if (event.currentTarget.contains(target) && pointerXHasChanged) {\n                        const newDir = event.clientX > lastPointerXRef.current ? 'right' : 'left';\n                        pointerDirRef.current = newDir;\n                        lastPointerXRef.current = event.clientX;\n                      }\n                    })\n                  )}\n                />\n              </RovingFocusGroup.Root>\n            </DismissableLayer>\n          </FocusScope>\n        </ScrollLockWrapper>\n      </MenuContentProvider>\n    );\n  }\n);\n\nMenuContent.displayName = CONTENT_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'MenuGroup';\n\ntype MenuGroupElement = React.ElementRef<typeof Primitive.div>;\ntype PrimitiveDivProps = Radix.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface MenuGroupProps extends PrimitiveDivProps {}\n\nconst MenuGroup = React.forwardRef<MenuGroupElement, MenuGroupProps>(\n  (props: ScopedProps<MenuGroupProps>, forwardedRef) => {\n    const { __scopeMenu, ...groupProps } = props;\n    return <Primitive.div role=\"group\" {...groupProps} ref={forwardedRef} />;\n  }\n);\n\nMenuGroup.displayName = GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuLabel\n * -----------------------------------------------------------------------------------------------*/\n\nconst LABEL_NAME = 'MenuLabel';\n\ntype MenuLabelElement = React.ElementRef<typeof Primitive.div>;\ninterface MenuLabelProps extends PrimitiveDivProps {}\n\nconst MenuLabel = React.forwardRef<MenuLabelElement, MenuLabelProps>(\n  (props: ScopedProps<MenuLabelProps>, forwardedRef) => {\n    const { __scopeMenu, ...labelProps } = props;\n    return <Primitive.div {...labelProps} ref={forwardedRef} />;\n  }\n);\n\nMenuLabel.displayName = LABEL_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'MenuItem';\nconst ITEM_SELECT = 'menu.itemSelect';\n\ntype MenuItemElement = MenuItemImplElement;\ninterface MenuItemProps extends Omit<MenuItemImplProps, 'onSelect'> {\n  onSelect?: (event: Event) => void;\n}\n\nconst MenuItem = React.forwardRef<MenuItemElement, MenuItemProps>(\n  (props: ScopedProps<MenuItemProps>, forwardedRef) => {\n    const { disabled = false, onSelect, ...itemProps } = props;\n    const ref = React.useRef<HTMLDivElement>(null);\n    const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n    const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n    const composedRefs = useComposedRefs(forwardedRef, ref);\n    const isPointerDownRef = React.useRef(false);\n\n    const handleSelect = () => {\n      const menuItem = ref.current;\n      if (!disabled && menuItem) {\n        const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n        menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n        dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n        if (itemSelectEvent.defaultPrevented) {\n          isPointerDownRef.current = false;\n        } else {\n          rootContext.onClose();\n        }\n      }\n    };\n\n    return (\n      <MenuItemImpl\n        {...itemProps}\n        ref={composedRefs}\n        disabled={disabled}\n        onClick={composeEventHandlers(props.onClick, handleSelect)}\n        onPointerDown={(event) => {\n          props.onPointerDown?.(event);\n          isPointerDownRef.current = true;\n        }}\n        onPointerUp={composeEventHandlers(props.onPointerUp, (event) => {\n          // Pointer down can move to a different menu item which should activate it on pointer up.\n          // We dispatch a click for selection to allow composition with click based triggers and to\n          // prevent Firefox from getting stuck in text selection mode when the menu closes.\n          if (!isPointerDownRef.current) event.currentTarget?.click();\n        })}\n        onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n          const isTypingAhead = contentContext.searchRef.current !== '';\n          if (disabled || (isTypingAhead && event.key === ' ')) return;\n          if (SELECTION_KEYS.includes(event.key)) {\n            event.currentTarget.click();\n            /**\n             * We prevent default browser behaviour for selection keys as they should trigger\n             * a selection only:\n             * - prevents space from scrolling the page.\n             * - if keydown causes focus to move, prevents keydown from firing on the new target.\n             */\n            event.preventDefault();\n          }\n        })}\n      />\n    );\n  }\n);\n\nMenuItem.displayName = ITEM_NAME;\n\n/* ---------------------------------------------------------------------------------------------- */\n\ntype MenuItemImplElement = React.ElementRef<typeof Primitive.div>;\ninterface MenuItemImplProps extends PrimitiveDivProps {\n  disabled?: boolean;\n  textValue?: string;\n}\n\nconst MenuItemImpl = React.forwardRef<MenuItemImplElement, MenuItemImplProps>(\n  (props: ScopedProps<MenuItemImplProps>, forwardedRef) => {\n    const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n    const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n    const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n    const ref = React.useRef<HTMLDivElement>(null);\n    const composedRefs = useComposedRefs(forwardedRef, ref);\n    const [isFocused, setIsFocused] = React.useState(false);\n\n    // get the item's `.textContent` as default strategy for typeahead `textValue`\n    const [textContent, setTextContent] = React.useState('');\n    React.useEffect(() => {\n      const menuItem = ref.current;\n      if (menuItem) {\n        setTextContent((menuItem.textContent ?? '').trim());\n      }\n    }, [itemProps.children]);\n\n    return (\n      <Collection.ItemSlot\n        scope={__scopeMenu}\n        disabled={disabled}\n        textValue={textValue ?? textContent}\n      >\n        <RovingFocusGroup.Item asChild {...rovingFocusGroupScope} focusable={!disabled}>\n          <Primitive.div\n            role=\"menuitem\"\n            data-highlighted={isFocused ? '' : undefined}\n            aria-disabled={disabled || undefined}\n            data-disabled={disabled ? '' : undefined}\n            {...itemProps}\n            ref={composedRefs}\n            /**\n             * We focus items on `pointerMove` to achieve the following:\n             *\n             * - Mouse over an item (it focuses)\n             * - Leave mouse where it is and use keyboard to focus a different item\n             * - Wiggle mouse without it leaving previously focused item\n             * - Previously focused item should re-focus\n             *\n             * If we used `mouseOver`/`mouseEnter` it would not re-focus when the mouse\n             * wiggles. This is to match native menu implementation.\n             */\n            onPointerMove={composeEventHandlers(\n              props.onPointerMove,\n              whenMouse((event) => {\n                if (disabled) {\n                  contentContext.onItemLeave(event);\n                } else {\n                  contentContext.onItemEnter(event);\n                  if (!event.defaultPrevented) {\n                    const item = event.currentTarget;\n                    item.focus();\n                  }\n                }\n              })\n            )}\n            onPointerLeave={composeEventHandlers(\n              props.onPointerLeave,\n              whenMouse((event) => contentContext.onItemLeave(event))\n            )}\n            onFocus={composeEventHandlers(props.onFocus, () => setIsFocused(true))}\n            onBlur={composeEventHandlers(props.onBlur, () => setIsFocused(false))}\n          />\n        </RovingFocusGroup.Item>\n      </Collection.ItemSlot>\n    );\n  }\n);\n\n/* -------------------------------------------------------------------------------------------------\n * MenuCheckboxItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst CHECKBOX_ITEM_NAME = 'MenuCheckboxItem';\n\ntype MenuCheckboxItemElement = MenuItemElement;\n\ntype CheckedState = boolean | 'indeterminate';\n\ninterface MenuCheckboxItemProps extends MenuItemProps {\n  checked?: CheckedState;\n  // `onCheckedChange` can never be called with `\"indeterminate\"` from the inside\n  onCheckedChange?: (checked: boolean) => void;\n}\n\nconst MenuCheckboxItem = React.forwardRef<MenuCheckboxItemElement, MenuCheckboxItemProps>(\n  (props: ScopedProps<MenuCheckboxItemProps>, forwardedRef) => {\n    const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n    return (\n      <ItemIndicatorProvider scope={props.__scopeMenu} checked={checked}>\n        <MenuItem\n          role=\"menuitemcheckbox\"\n          aria-checked={isIndeterminate(checked) ? 'mixed' : checked}\n          {...checkboxItemProps}\n          ref={forwardedRef}\n          data-state={getCheckedState(checked)}\n          onSelect={composeEventHandlers(\n            checkboxItemProps.onSelect,\n            () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n            { checkForDefaultPrevented: false }\n          )}\n        />\n      </ItemIndicatorProvider>\n    );\n  }\n);\n\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_GROUP_NAME = 'MenuRadioGroup';\n\nconst [RadioGroupProvider, useRadioGroupContext] = createMenuContext<MenuRadioGroupProps>(\n  RADIO_GROUP_NAME,\n  { value: undefined, onValueChange: () => {} }\n);\n\ntype MenuRadioGroupElement = React.ElementRef<typeof MenuGroup>;\ninterface MenuRadioGroupProps extends MenuGroupProps {\n  value?: string;\n  onValueChange?: (value: string) => void;\n}\n\nconst MenuRadioGroup = React.forwardRef<MenuRadioGroupElement, MenuRadioGroupProps>(\n  (props: ScopedProps<MenuRadioGroupProps>, forwardedRef) => {\n    const { value, onValueChange, ...groupProps } = props;\n    const handleValueChange = useCallbackRef(onValueChange);\n    return (\n      <RadioGroupProvider scope={props.__scopeMenu} value={value} onValueChange={handleValueChange}>\n        <MenuGroup {...groupProps} ref={forwardedRef} />\n      </RadioGroupProvider>\n    );\n  }\n);\n\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuRadioItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst RADIO_ITEM_NAME = 'MenuRadioItem';\n\ntype MenuRadioItemElement = React.ElementRef<typeof MenuItem>;\ninterface MenuRadioItemProps extends MenuItemProps {\n  value: string;\n}\n\nconst MenuRadioItem = React.forwardRef<MenuRadioItemElement, MenuRadioItemProps>(\n  (props: ScopedProps<MenuRadioItemProps>, forwardedRef) => {\n    const { value, ...radioItemProps } = props;\n    const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n    const checked = value === context.value;\n    return (\n      <ItemIndicatorProvider scope={props.__scopeMenu} checked={checked}>\n        <MenuItem\n          role=\"menuitemradio\"\n          aria-checked={checked}\n          {...radioItemProps}\n          ref={forwardedRef}\n          data-state={getCheckedState(checked)}\n          onSelect={composeEventHandlers(\n            radioItemProps.onSelect,\n            () => context.onValueChange?.(value),\n            { checkForDefaultPrevented: false }\n          )}\n        />\n      </ItemIndicatorProvider>\n    );\n  }\n);\n\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuItemIndicator\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_INDICATOR_NAME = 'MenuItemIndicator';\n\ntype CheckboxContextValue = { checked: CheckedState };\n\nconst [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext<CheckboxContextValue>(\n  ITEM_INDICATOR_NAME,\n  { checked: false }\n);\n\ntype MenuItemIndicatorElement = React.ElementRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = Radix.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface MenuItemIndicatorProps extends PrimitiveSpanProps {\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling animation with React animation libraries.\n   */\n  forceMount?: true;\n}\n\nconst MenuItemIndicator = React.forwardRef<MenuItemIndicatorElement, MenuItemIndicatorProps>(\n  (props: ScopedProps<MenuItemIndicatorProps>, forwardedRef) => {\n    const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n    const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n    return (\n      <Presence\n        present={\n          forceMount ||\n          isIndeterminate(indicatorContext.checked) ||\n          indicatorContext.checked === true\n        }\n      >\n        <Primitive.span\n          {...itemIndicatorProps}\n          ref={forwardedRef}\n          data-state={getCheckedState(indicatorContext.checked)}\n        />\n      </Presence>\n    );\n  }\n);\n\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSeparator\n * -----------------------------------------------------------------------------------------------*/\n\nconst SEPARATOR_NAME = 'MenuSeparator';\n\ntype MenuSeparatorElement = React.ElementRef<typeof Primitive.div>;\ninterface MenuSeparatorProps extends PrimitiveDivProps {}\n\nconst MenuSeparator = React.forwardRef<MenuSeparatorElement, MenuSeparatorProps>(\n  (props: ScopedProps<MenuSeparatorProps>, forwardedRef) => {\n    const { __scopeMenu, ...separatorProps } = props;\n    return (\n      <Primitive.div\n        role=\"separator\"\n        aria-orientation=\"horizontal\"\n        {...separatorProps}\n        ref={forwardedRef}\n      />\n    );\n  }\n);\n\nMenuSeparator.displayName = SEPARATOR_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuArrow\n * -----------------------------------------------------------------------------------------------*/\n\nconst ARROW_NAME = 'MenuArrow';\n\ntype MenuArrowElement = React.ElementRef<typeof PopperPrimitive.Arrow>;\ntype PopperArrowProps = Radix.ComponentPropsWithoutRef<typeof PopperPrimitive.Arrow>;\ninterface MenuArrowProps extends PopperArrowProps {}\n\nconst MenuArrow = React.forwardRef<MenuArrowElement, MenuArrowProps>(\n  (props: ScopedProps<MenuArrowProps>, forwardedRef) => {\n    const { __scopeMenu, ...arrowProps } = props;\n    const popperScope = usePopperScope(__scopeMenu);\n    return <PopperPrimitive.Arrow {...popperScope} {...arrowProps} ref={forwardedRef} />;\n  }\n);\n\nMenuArrow.displayName = ARROW_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSub\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_NAME = 'MenuSub';\n\ntype MenuSubContextValue = {\n  contentId: string;\n  triggerId: string;\n  trigger: MenuSubTriggerElement | null;\n  onTriggerChange(trigger: MenuSubTriggerElement | null): void;\n};\n\nconst [MenuSubProvider, useMenuSubContext] = createMenuContext<MenuSubContextValue>(SUB_NAME);\n\ninterface MenuSubProps {\n  children?: React.ReactNode;\n  open?: boolean;\n  onOpenChange?(open: boolean): void;\n}\n\nconst MenuSub: React.FC<MenuSubProps> = (props: ScopedProps<MenuSubProps>) => {\n  const { __scopeMenu, children, open = false, onOpenChange } = props;\n  const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n  const popperScope = usePopperScope(__scopeMenu);\n  const [trigger, setTrigger] = React.useState<MenuSubTriggerElement | null>(null);\n  const [content, setContent] = React.useState<MenuContentElement | null>(null);\n  const handleOpenChange = useCallbackRef(onOpenChange);\n\n  // Prevent the parent menu from reopening with open submenus.\n  React.useEffect(() => {\n    if (parentMenuContext.open === false) handleOpenChange(false);\n    return () => handleOpenChange(false);\n  }, [parentMenuContext.open, handleOpenChange]);\n\n  return (\n    <PopperPrimitive.Root {...popperScope}>\n      <MenuProvider\n        scope={__scopeMenu}\n        open={open}\n        onOpenChange={handleOpenChange}\n        content={content}\n        onContentChange={setContent}\n      >\n        <MenuSubProvider\n          scope={__scopeMenu}\n          contentId={useId()}\n          triggerId={useId()}\n          trigger={trigger}\n          onTriggerChange={setTrigger}\n        >\n          {children}\n        </MenuSubProvider>\n      </MenuProvider>\n    </PopperPrimitive.Root>\n  );\n};\n\nMenuSub.displayName = SUB_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubTrigger\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_TRIGGER_NAME = 'MenuSubTrigger';\n\ntype MenuSubTriggerElement = MenuItemImplElement;\ninterface MenuSubTriggerProps extends MenuItemImplProps {}\n\nconst MenuSubTrigger = React.forwardRef<MenuSubTriggerElement, MenuSubTriggerProps>(\n  (props: ScopedProps<MenuSubTriggerProps>, forwardedRef) => {\n    const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n    const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n    const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n    const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n    const openTimerRef = React.useRef<number | null>(null);\n    const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n    const scope = { __scopeMenu: props.__scopeMenu };\n\n    const clearOpenTimer = React.useCallback(() => {\n      if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n      openTimerRef.current = null;\n    }, []);\n\n    React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n\n    React.useEffect(() => {\n      const pointerGraceTimer = pointerGraceTimerRef.current;\n      return () => {\n        window.clearTimeout(pointerGraceTimer);\n        onPointerGraceIntentChange(null);\n      };\n    }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n\n    return (\n      <MenuAnchor asChild {...scope}>\n        <MenuItemImpl\n          id={subContext.triggerId}\n          aria-haspopup=\"menu\"\n          aria-expanded={context.open}\n          aria-controls={subContext.contentId}\n          data-state={getOpenState(context.open)}\n          {...props}\n          ref={composeRefs(forwardedRef, subContext.onTriggerChange)}\n          // This is redundant for mouse users but we cannot determine pointer type from\n          // click event and we cannot use pointerup event (see git history for reasons why)\n          onClick={(event) => {\n            props.onClick?.(event);\n            if (props.disabled || event.defaultPrevented) return;\n            /**\n             * We manually focus because iOS Safari doesn't always focus on click (e.g. buttons)\n             * and we rely heavily on `onFocusOutside` for submenus to close when switching\n             * between separate submenus.\n             */\n            event.currentTarget.focus();\n            if (!context.open) context.onOpenChange(true);\n          }}\n          onPointerMove={composeEventHandlers(\n            props.onPointerMove,\n            whenMouse((event) => {\n              contentContext.onItemEnter(event);\n              if (event.defaultPrevented) return;\n              if (!props.disabled && !context.open && !openTimerRef.current) {\n                contentContext.onPointerGraceIntentChange(null);\n                openTimerRef.current = window.setTimeout(() => {\n                  context.onOpenChange(true);\n                  clearOpenTimer();\n                }, 100);\n              }\n            })\n          )}\n          onPointerLeave={composeEventHandlers(\n            props.onPointerLeave,\n            whenMouse((event) => {\n              clearOpenTimer();\n\n              const contentRect = context.content?.getBoundingClientRect();\n              if (contentRect) {\n                // TODO: make sure to update this when we change positioning logic\n                const side = context.content?.dataset.side as Side;\n                const rightSide = side === 'right';\n                const bleed = rightSide ? -5 : +5;\n                const contentNearEdge = contentRect[rightSide ? 'left' : 'right'];\n                const contentFarEdge = contentRect[rightSide ? 'right' : 'left'];\n\n                contentContext.onPointerGraceIntentChange({\n                  area: [\n                    // Apply a bleed on clientX to ensure that our exit point is\n                    // consistently within polygon bounds\n                    { x: event.clientX + bleed, y: event.clientY },\n                    { x: contentNearEdge, y: contentRect.top },\n                    { x: contentFarEdge, y: contentRect.top },\n                    { x: contentFarEdge, y: contentRect.bottom },\n                    { x: contentNearEdge, y: contentRect.bottom },\n                  ],\n                  side,\n                });\n\n                window.clearTimeout(pointerGraceTimerRef.current);\n                pointerGraceTimerRef.current = window.setTimeout(\n                  () => contentContext.onPointerGraceIntentChange(null),\n                  300\n                );\n              } else {\n                contentContext.onTriggerLeave(event);\n                if (event.defaultPrevented) return;\n\n                // There's 100ms where the user may leave an item before the submenu was opened.\n                contentContext.onPointerGraceIntentChange(null);\n              }\n            })\n          )}\n          onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n            const isTypingAhead = contentContext.searchRef.current !== '';\n            if (props.disabled || (isTypingAhead && event.key === ' ')) return;\n            if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n              context.onOpenChange(true);\n              // The trigger may hold focus if opened via pointer interaction\n              // so we ensure content is given focus again when switching to keyboard.\n              context.content?.focus();\n              // prevent window from scrolling\n              event.preventDefault();\n            }\n          })}\n        />\n      </MenuAnchor>\n    );\n  }\n);\n\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\n\n/* -------------------------------------------------------------------------------------------------\n * MenuSubContent\n * -----------------------------------------------------------------------------------------------*/\n\nconst SUB_CONTENT_NAME = 'MenuSubContent';\n\ntype MenuSubContentElement = MenuContentImplElement;\ninterface MenuSubContentProps\n  extends Omit<\n    MenuContentImplProps,\n    keyof MenuContentImplPrivateProps | 'onCloseAutoFocus' | 'onEntryFocus' | 'side' | 'align'\n  > {\n  /**\n   * Used to force mounting when more control is needed. Useful when\n   * controlling animation with React animation libraries.\n   */\n  forceMount?: true;\n}\n\nconst MenuSubContent = React.forwardRef<MenuSubContentElement, MenuSubContentProps>(\n  (props: ScopedProps<MenuSubContentProps>, forwardedRef) => {\n    const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n    const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n    const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n    const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n    const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n    const ref = React.useRef<MenuSubContentElement>(null);\n    const composedRefs = useComposedRefs(forwardedRef, ref);\n    return (\n      <Collection.Provider scope={props.__scopeMenu}>\n        <Presence present={forceMount || context.open}>\n          <Collection.Slot scope={props.__scopeMenu}>\n            <MenuContentImpl\n              id={subContext.contentId}\n              aria-labelledby={subContext.triggerId}\n              {...subContentProps}\n              ref={composedRefs}\n              align=\"start\"\n              side={rootContext.dir === 'rtl' ? 'left' : 'right'}\n              disableOutsidePointerEvents={false}\n              disableOutsideScroll={false}\n              trapFocus={false}\n              onOpenAutoFocus={(event) => {\n                // when opening a submenu, focus content for keyboard users only\n                if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n                event.preventDefault();\n              }}\n              // The menu might close because of focusing another menu item in the parent menu. We\n              // don't want it to refocus the trigger in that case so we handle trigger focus ourselves.\n              onCloseAutoFocus={(event) => event.preventDefault()}\n              onFocusOutside={composeEventHandlers(props.onFocusOutside, (event) => {\n                // We prevent closing when the trigger is focused to avoid triggering a re-open animation\n                // on pointer interaction.\n                if (event.target !== subContext.trigger) context.onOpenChange(false);\n              })}\n              onEscapeKeyDown={composeEventHandlers(props.onEscapeKeyDown, (event) => {\n                rootContext.onClose();\n                // ensure pressing escape in submenu doesn't escape full screen mode\n                event.preventDefault();\n              })}\n              onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n                // Submenu key events bubble through portals. We only care about keys in this menu.\n                const isKeyDownInside = event.currentTarget.contains(event.target as HTMLElement);\n                const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n                if (isKeyDownInside && isCloseKey) {\n                  context.onOpenChange(false);\n                  // We focus manually because we prevented it in `onCloseAutoFocus`\n                  subContext.trigger?.focus();\n                  // prevent window from scrolling\n                  event.preventDefault();\n                }\n              })}\n            />\n          </Collection.Slot>\n        </Presence>\n      </Collection.Provider>\n    );\n  }\n);\n\nMenuSubContent.displayName = SUB_CONTENT_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction getOpenState(open: boolean) {\n  return open ? 'open' : 'closed';\n}\n\nfunction isIndeterminate(checked?: CheckedState): checked is 'indeterminate' {\n  return checked === 'indeterminate';\n}\n\nfunction getCheckedState(checked: CheckedState) {\n  return isIndeterminate(checked) ? 'indeterminate' : checked ? 'checked' : 'unchecked';\n}\n\nfunction focusFirst(candidates: HTMLElement[]) {\n  const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n  for (const candidate of candidates) {\n    // if focus is already where we want to go, we don't want to keep going through the candidates\n    if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n    candidate.focus();\n    if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n  }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray<T>(array: T[], startIndex: number) {\n  return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\n\n/**\n * This is the \"meat\" of the typeahead matching logic. It takes in all the values,\n * the search and the current match, and returns the next match (or `undefined`).\n *\n * We normalize the search because if a user has repeatedly pressed a character,\n * we want the exact same behavior as if we only had that one character\n * (ie. cycle through options starting with that character)\n *\n * We also reorder the values by wrapping the array around the current match.\n * This is so we always look forward from the current match, and picking the first\n * match will always be the correct one.\n *\n * Finally, if the normalized search is exactly one character, we exclude the\n * current match from the values because otherwise it would be the first to match always\n * and focus would never move. This is as opposed to the regular case, where we\n * don't want focus to move if the current match still matches.\n */\nfunction getNextMatch(values: string[], search: string, currentMatch?: string) {\n  const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n  const normalizedSearch = isRepeated ? search[0] : search;\n  const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n  let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n  const excludeCurrentMatch = normalizedSearch.length === 1;\n  if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n  const nextMatch = wrappedValues.find((value) =>\n    value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n  );\n  return nextMatch !== currentMatch ? nextMatch : undefined;\n}\n\ntype Point = { x: number; y: number };\ntype Polygon = Point[];\ntype Side = 'left' | 'right';\ntype GraceIntent = { area: Polygon; side: Side };\n\n// Determine if a point is inside of a polygon.\n// Based on https://github.com/substack/point-in-polygon\nfunction isPointInPolygon(point: Point, polygon: Polygon) {\n  const { x, y } = point;\n  let inside = false;\n  for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n    const xi = polygon[i].x;\n    const yi = polygon[i].y;\n    const xj = polygon[j].x;\n    const yj = polygon[j].y;\n\n    // prettier-ignore\n    const intersect = ((yi > y) !== (yj > y)) && (x < (xj - xi) * (y - yi) / (yj - yi) + xi);\n    if (intersect) inside = !inside;\n  }\n\n  return inside;\n}\n\nfunction isPointerInGraceArea(event: React.PointerEvent, area?: Polygon) {\n  if (!area) return false;\n  const cursorPos = { x: event.clientX, y: event.clientY };\n  return isPointInPolygon(cursorPos, area);\n}\n\nfunction whenMouse<E>(handler: React.PointerEventHandler<E>): React.PointerEventHandler<E> {\n  return (event) => (event.pointerType === 'mouse' ? handler(event) : undefined);\n}\n\nconst Root = Menu;\nconst Anchor = MenuAnchor;\nconst Portal = MenuPortal;\nconst Content = MenuContent;\nconst Group = MenuGroup;\nconst Label = MenuLabel;\nconst Item = MenuItem;\nconst CheckboxItem = MenuCheckboxItem;\nconst RadioGroup = MenuRadioGroup;\nconst RadioItem = MenuRadioItem;\nconst ItemIndicator = MenuItemIndicator;\nconst Separator = MenuSeparator;\nconst Arrow = MenuArrow;\nconst Sub = MenuSub;\nconst SubTrigger = MenuSubTrigger;\nconst SubContent = MenuSubContent;\n\nexport {\n  createMenuScope,\n  //\n  Menu,\n  MenuAnchor,\n  MenuPortal,\n  MenuContent,\n  MenuGroup,\n  MenuLabel,\n  MenuItem,\n  MenuCheckboxItem,\n  MenuRadioGroup,\n  MenuRadioItem,\n  MenuItemIndicator,\n  MenuSeparator,\n  MenuArrow,\n  MenuSub,\n  MenuSubTrigger,\n  MenuSubContent,\n  //\n  Root,\n  Anchor,\n  Portal,\n  Content,\n  Group,\n  Label,\n  Item,\n  CheckboxItem,\n  RadioGroup,\n  RadioItem,\n  ItemIndicator,\n  Separator,\n  Arrow,\n  Sub,\n  SubTrigger,\n  SubContent,\n};\nexport type {\n  MenuProps,\n  MenuAnchorProps,\n  MenuPortalProps,\n  MenuContentProps,\n  MenuGroupProps,\n  MenuLabelProps,\n  MenuItemProps,\n  MenuCheckboxItemProps,\n  MenuRadioGroupProps,\n  MenuRadioItemProps,\n  MenuItemIndicatorProps,\n  MenuSeparatorProps,\n  MenuArrowProps,\n  MenuSubProps,\n  MenuSubTriggerProps,\n  MenuSubContentProps,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AC2BA,MAAMA,oCAAc,GAAG,CAAC,OAAD,EAAU,GAAV,CAAvB;AACA,MAAMC,gCAAU,GAAG,CAAC,WAAD,EAAc,QAAd,EAAwB,MAAxB,CAAnB;AACA,MAAMC,+BAAS,GAAG,CAAC,SAAD,EAAY,UAAZ,EAAwB,KAAxB,CAAlB;AACA,MAAMC,qCAAe,GAAG,C,GAAIF,gCAAJ,E,GAAmBC,+BAAnB,CAAxB;AACA,MAAME,mCAA0C,GAAG;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