{"ast":null,"code":"'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_useId as useId, unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { useButton } from '../useButton';\nimport { useListItem } from '../useList';\nimport { DropdownActionTypes } from '../useDropdown';\nimport { DropdownContext } from '../useDropdown/DropdownContext';\nimport { combineHooksSlotProps } from '../utils/combineHooksSlotProps';\nimport { useCompoundItem } from '../useCompound';\nimport { extractEventHandlers } from '../utils/extractEventHandlers';\nfunction idGenerator(existingKeys) {\n return `menu-item-${existingKeys.size}`;\n}\nconst FALLBACK_MENU_CONTEXT = {\n dispatch: () => {},\n popupId: '',\n registerPopup: () => {},\n registerTrigger: () => {},\n state: {\n open: true,\n changeReason: null\n },\n triggerElement: null\n};\n\n/**\n *\n * Demos:\n *\n * - [Menu](https://mui.com/base-ui/react-menu/#hooks)\n *\n * API:\n *\n * - [useMenuItem API](https://mui.com/base-ui/react-menu/hooks-api/#use-menu-item)\n */\nexport function useMenuItem(params) {\n var _React$useContext;\n const {\n disabled = false,\n id: idParam,\n rootRef: externalRef,\n label,\n disableFocusOnHover = false\n } = params;\n const id = useId(idParam);\n const itemRef = React.useRef(null);\n const itemMetadata = React.useMemo(() => ({\n disabled,\n id: id != null ? id : '',\n label,\n ref: itemRef\n }), [disabled, id, label]);\n const {\n dispatch\n } = (_React$useContext = React.useContext(DropdownContext)) != null ? _React$useContext : FALLBACK_MENU_CONTEXT;\n const {\n getRootProps: getListRootProps,\n highlighted\n } = useListItem({\n item: id,\n handlePointerOverEvents: !disableFocusOnHover\n });\n const {\n index,\n totalItemCount\n } = useCompoundItem(id != null ? id : idGenerator, itemMetadata);\n const {\n getRootProps: getButtonProps,\n focusVisible,\n rootRef: buttonRefHandler\n } = useButton({\n disabled,\n focusableWhenDisabled: true\n });\n const handleRef = useForkRef(buttonRefHandler, externalRef, itemRef);\n React.useDebugValue({\n id,\n highlighted,\n disabled,\n label\n });\n const createHandleClick = otherHandlers => event => {\n var _otherHandlers$onClic;\n (_otherHandlers$onClic = otherHandlers.onClick) == null || _otherHandlers$onClic.call(otherHandlers, event);\n if (event.defaultMuiPrevented) {\n return;\n }\n dispatch({\n type: DropdownActionTypes.close,\n event\n });\n };\n const getOwnHandlers = (otherHandlers = {}) => _extends({}, otherHandlers, {\n onClick: createHandleClick(otherHandlers)\n });\n function getRootProps(externalProps = {}) {\n const externalEventHandlers = extractEventHandlers(externalProps);\n const getCombinedRootProps = combineHooksSlotProps(getOwnHandlers, combineHooksSlotProps(getButtonProps, getListRootProps));\n return _extends({}, externalProps, externalEventHandlers, getCombinedRootProps(externalEventHandlers), {\n id,\n ref: handleRef,\n role: 'menuitem'\n });\n }\n\n // If `id` is undefined (during SSR in React < 18), we fall back to rendering a simplified menu item\n // which does not have access to infortmation about its position or highlighted state.\n if (id === undefined) {\n return {\n getRootProps,\n disabled: false,\n focusVisible,\n highlighted: false,\n index: -1,\n totalItemCount: 0,\n rootRef: handleRef\n };\n }\n return {\n getRootProps,\n disabled,\n focusVisible,\n highlighted,\n index,\n totalItemCount,\n rootRef: handleRef\n };\n}","map":{"version":3,"names":["_extends","React","unstable_useId","useId","unstable_useForkRef","useForkRef","useButton","useListItem","DropdownActionTypes","DropdownContext","combineHooksSlotProps","useCompoundItem","extractEventHandlers","idGenerator","existingKeys","size","FALLBACK_MENU_CONTEXT","dispatch","popupId","registerPopup","registerTrigger","state","open","changeReason","triggerElement","useMenuItem","params","_React$useContext","disabled","id","idParam","rootRef","externalRef","label","disableFocusOnHover","itemRef","useRef","itemMetadata","useMemo","ref","useContext","getRootProps","getListRootProps","highlighted","item","handlePointerOverEvents","index","totalItemCount","getButtonProps","focusVisible","buttonRefHandler","focusableWhenDisabled","handleRef","useDebugValue","createHandleClick","otherHandlers","event","_otherHandlers$onClic","onClick","call","defaultMuiPrevented","type","close","getOwnHandlers","externalProps","externalEventHandlers","getCombinedRootProps","role","undefined"],"sources":["/home/gnx/Desktop/ETB/ETB-FrontEnd/node_modules/@mui/base/useMenuItem/useMenuItem.js"],"sourcesContent":["'use client';\n\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_useId as useId, unstable_useForkRef as useForkRef } from '@mui/utils';\nimport { useButton } from '../useButton';\nimport { useListItem } from '../useList';\nimport { DropdownActionTypes } from '../useDropdown';\nimport { DropdownContext } from '../useDropdown/DropdownContext';\nimport { combineHooksSlotProps } from '../utils/combineHooksSlotProps';\nimport { useCompoundItem } from '../useCompound';\nimport { extractEventHandlers } from '../utils/extractEventHandlers';\nfunction idGenerator(existingKeys) {\n return `menu-item-${existingKeys.size}`;\n}\nconst FALLBACK_MENU_CONTEXT = {\n dispatch: () => {},\n popupId: '',\n registerPopup: () => {},\n registerTrigger: () => {},\n state: {\n open: true,\n changeReason: null\n },\n triggerElement: null\n};\n\n/**\n *\n * Demos:\n *\n * - [Menu](https://mui.com/base-ui/react-menu/#hooks)\n *\n * API:\n *\n * - [useMenuItem API](https://mui.com/base-ui/react-menu/hooks-api/#use-menu-item)\n */\nexport function useMenuItem(params) {\n var _React$useContext;\n const {\n disabled = false,\n id: idParam,\n rootRef: externalRef,\n label,\n disableFocusOnHover = false\n } = params;\n const id = useId(idParam);\n const itemRef = React.useRef(null);\n const itemMetadata = React.useMemo(() => ({\n disabled,\n id: id != null ? id : '',\n label,\n ref: itemRef\n }), [disabled, id, label]);\n const {\n dispatch\n } = (_React$useContext = React.useContext(DropdownContext)) != null ? _React$useContext : FALLBACK_MENU_CONTEXT;\n const {\n getRootProps: getListRootProps,\n highlighted\n } = useListItem({\n item: id,\n handlePointerOverEvents: !disableFocusOnHover\n });\n const {\n index,\n totalItemCount\n } = useCompoundItem(id != null ? id : idGenerator, itemMetadata);\n const {\n getRootProps: getButtonProps,\n focusVisible,\n rootRef: buttonRefHandler\n } = useButton({\n disabled,\n focusableWhenDisabled: true\n });\n const handleRef = useForkRef(buttonRefHandler, externalRef, itemRef);\n React.useDebugValue({\n id,\n highlighted,\n disabled,\n label\n });\n const createHandleClick = otherHandlers => event => {\n var _otherHandlers$onClic;\n (_otherHandlers$onClic = otherHandlers.onClick) == null || _otherHandlers$onClic.call(otherHandlers, event);\n if (event.defaultMuiPrevented) {\n return;\n }\n dispatch({\n type: DropdownActionTypes.close,\n event\n });\n };\n const getOwnHandlers = (otherHandlers = {}) => _extends({}, otherHandlers, {\n onClick: createHandleClick(otherHandlers)\n });\n function getRootProps(externalProps = {}) {\n const externalEventHandlers = extractEventHandlers(externalProps);\n const getCombinedRootProps = combineHooksSlotProps(getOwnHandlers, combineHooksSlotProps(getButtonProps, getListRootProps));\n return _extends({}, externalProps, externalEventHandlers, getCombinedRootProps(externalEventHandlers), {\n id,\n ref: handleRef,\n role: 'menuitem'\n });\n }\n\n // If `id` is undefined (during SSR in React < 18), we fall back to rendering a simplified menu item\n // which does not have access to infortmation about its position or highlighted state.\n if (id === undefined) {\n return {\n getRootProps,\n disabled: false,\n focusVisible,\n highlighted: false,\n index: -1,\n totalItemCount: 0,\n rootRef: handleRef\n };\n }\n return {\n getRootProps,\n disabled,\n focusVisible,\n highlighted,\n index,\n totalItemCount,\n rootRef: handleRef\n };\n}"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,cAAc,IAAIC,KAAK,EAAEC,mBAAmB,IAAIC,UAAU,QAAQ,YAAY;AACvF,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,WAAW,QAAQ,YAAY;AACxC,SAASC,mBAAmB,QAAQ,gBAAgB;AACpD,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,qBAAqB,QAAQ,gCAAgC;AACtE,SAASC,eAAe,QAAQ,gBAAgB;AAChD,SAASC,oBAAoB,QAAQ,+BAA+B;AACpE,SAASC,WAAWA,CAACC,YAAY,EAAE;EACjC,OAAO,aAAaA,YAAY,CAACC,IAAI,EAAE;AACzC;AACA,MAAMC,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