`, so it can be styled via any CSS solution you prefer.\n * @see https://floating-ui.com/docs/FloatingOverlay\n */\nconst FloatingOverlay = /*#__PURE__*/React.forwardRef(function FloatingOverlay(_ref, ref) {\n let {\n lockScroll = false,\n ...rest\n } = _ref;\n index(() => {\n var _window$visualViewpor, _window$visualViewpor2;\n if (!lockScroll) {\n return;\n }\n const alreadyLocked = document.body.hasAttribute(identifier);\n if (alreadyLocked) {\n return;\n }\n document.body.setAttribute(identifier, '');\n\n // RTL scrollbar\n const scrollbarX = Math.round(document.documentElement.getBoundingClientRect().left) + document.documentElement.scrollLeft;\n const paddingProp = scrollbarX ? 'paddingLeft' : 'paddingRight';\n const scrollbarWidth = window.innerWidth - document.documentElement.clientWidth;\n\n // Only iOS doesn't respect `overflow: hidden` on document.body, and this\n // technique has fewer side effects.\n if (!/iP(hone|ad|od)|iOS/.test(getPlatform())) {\n Object.assign(document.body.style, {\n overflow: 'hidden',\n [paddingProp]: scrollbarWidth + \"px\"\n });\n return () => {\n document.body.removeAttribute(identifier);\n Object.assign(document.body.style, {\n overflow: '',\n [paddingProp]: ''\n });\n };\n }\n\n // iOS 12 does not support `visualViewport`.\n const offsetLeft = ((_window$visualViewpor = window.visualViewport) == null ? void 0 : _window$visualViewpor.offsetLeft) || 0;\n const offsetTop = ((_window$visualViewpor2 = window.visualViewport) == null ? void 0 : _window$visualViewpor2.offsetTop) || 0;\n const scrollX = window.pageXOffset;\n const scrollY = window.pageYOffset;\n Object.assign(document.body.style, {\n position: 'fixed',\n overflow: 'hidden',\n top: -(scrollY - Math.floor(offsetTop)) + \"px\",\n left: -(scrollX - Math.floor(offsetLeft)) + \"px\",\n right: '0',\n [paddingProp]: scrollbarWidth + \"px\"\n });\n return () => {\n Object.assign(document.body.style, {\n position: '',\n overflow: '',\n top: '',\n left: '',\n right: '',\n [paddingProp]: ''\n });\n document.body.removeAttribute(identifier);\n window.scrollTo(scrollX, scrollY);\n };\n }, [lockScroll]);\n return /*#__PURE__*/React.createElement(\"div\", _extends({\n ref: ref\n }, rest, {\n style: {\n position: 'fixed',\n overflow: 'auto',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...rest.style\n }\n }));\n});\n\nfunction isButtonTarget(event) {\n return isHTMLElement(event.target) && event.target.tagName === 'BUTTON';\n}\nfunction isSpaceIgnored(element) {\n return isTypeableElement(element);\n}\n/**\n * Adds click event listeners that change the open state.\n * @see https://floating-ui.com/docs/useClick\n */\nconst useClick = function (_ref, _temp) {\n let {\n open,\n onOpenChange,\n dataRef,\n elements: {\n domReference\n }\n } = _ref;\n let {\n enabled = true,\n event: eventOption = 'click',\n toggle = true,\n ignoreMouse = false,\n keyboardHandlers = true\n } = _temp === void 0 ? {} : _temp;\n const pointerTypeRef = React.useRef();\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n return {\n reference: {\n onPointerDown(event) {\n pointerTypeRef.current = event.pointerType;\n },\n onMouseDown(event) {\n // Ignore all buttons except for the \"main\" button.\n // https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\n if (event.button !== 0) {\n return;\n }\n if (isMouseLikePointerType(pointerTypeRef.current, true) && ignoreMouse) {\n return;\n }\n if (eventOption === 'click') {\n return;\n }\n if (open) {\n if (toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'mousedown' : true)) {\n onOpenChange(false);\n }\n } else {\n // Prevent stealing focus from the floating element\n event.preventDefault();\n onOpenChange(true);\n }\n dataRef.current.openEvent = event.nativeEvent;\n },\n onClick(event) {\n if (dataRef.current.__syncReturnFocus) {\n return;\n }\n if (eventOption === 'mousedown' && pointerTypeRef.current) {\n pointerTypeRef.current = undefined;\n return;\n }\n if (isMouseLikePointerType(pointerTypeRef.current, true) && ignoreMouse) {\n return;\n }\n if (open) {\n if (toggle && (dataRef.current.openEvent ? dataRef.current.openEvent.type === 'click' : true)) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n dataRef.current.openEvent = event.nativeEvent;\n },\n onKeyDown(event) {\n pointerTypeRef.current = undefined;\n if (!keyboardHandlers) {\n return;\n }\n if (isButtonTarget(event)) {\n return;\n }\n if (event.key === ' ' && !isSpaceIgnored(domReference)) {\n // Prevent scrolling\n event.preventDefault();\n }\n if (event.key === 'Enter') {\n if (open) {\n if (toggle) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n }\n },\n onKeyUp(event) {\n if (!keyboardHandlers) {\n return;\n }\n if (isButtonTarget(event) || isSpaceIgnored(domReference)) {\n return;\n }\n if (event.key === ' ') {\n if (open) {\n if (toggle) {\n onOpenChange(false);\n }\n } else {\n onOpenChange(true);\n }\n }\n }\n }\n };\n }, [enabled, dataRef, eventOption, ignoreMouse, keyboardHandlers, domReference, toggle, open, onOpenChange]);\n};\n\n/**\n * Check whether the event.target is within the provided node. Uses event.composedPath if available for custom element support.\n *\n * @param event The event whose target/composedPath to check\n * @param node The node to check against\n * @returns Whether the event.target/composedPath is within the node.\n */\nfunction isEventTargetWithin(event, node) {\n if (node == null) {\n return false;\n }\n if ('composedPath' in event) {\n return event.composedPath().includes(node);\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support composedPath, but browsers without shadow dom don't\n const e = event;\n return e.target != null && node.contains(e.target);\n}\n\nconst bubbleHandlerKeys = {\n pointerdown: 'onPointerDown',\n mousedown: 'onMouseDown',\n click: 'onClick'\n};\nconst captureHandlerKeys = {\n pointerdown: 'onPointerDownCapture',\n mousedown: 'onMouseDownCapture',\n click: 'onClickCapture'\n};\nconst normalizeBubblesProp = function (bubbles) {\n var _bubbles$escapeKey, _bubbles$outsidePress;\n if (bubbles === void 0) {\n bubbles = true;\n }\n return {\n escapeKeyBubbles: typeof bubbles === 'boolean' ? bubbles : (_bubbles$escapeKey = bubbles.escapeKey) != null ? _bubbles$escapeKey : true,\n outsidePressBubbles: typeof bubbles === 'boolean' ? bubbles : (_bubbles$outsidePress = bubbles.outsidePress) != null ? _bubbles$outsidePress : true\n };\n};\n/**\n * Adds listeners that dismiss (close) the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\nconst useDismiss = function (_ref, _temp) {\n let {\n open,\n onOpenChange,\n events,\n nodeId,\n elements: {\n reference,\n domReference,\n floating\n },\n dataRef\n } = _ref;\n let {\n enabled = true,\n escapeKey = true,\n outsidePress: unstable_outsidePress = true,\n outsidePressEvent = 'pointerdown',\n referencePress = false,\n referencePressEvent = 'pointerdown',\n ancestorScroll = false,\n bubbles = true\n } = _temp === void 0 ? {} : _temp;\n const tree = useFloatingTree();\n const nested = useFloatingParentNodeId() != null;\n const outsidePressFn = useEvent(typeof unstable_outsidePress === 'function' ? unstable_outsidePress : () => false);\n const outsidePress = typeof unstable_outsidePress === 'function' ? outsidePressFn : unstable_outsidePress;\n const insideReactTreeRef = React.useRef(false);\n const {\n escapeKeyBubbles,\n outsidePressBubbles\n } = normalizeBubblesProp(bubbles);\n React.useEffect(() => {\n if (!open || !enabled) {\n return;\n }\n dataRef.current.__escapeKeyBubbles = escapeKeyBubbles;\n dataRef.current.__outsidePressBubbles = outsidePressBubbles;\n function onKeyDown(event) {\n if (event.key === 'Escape') {\n const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context;\n if ((_child$context = child.context) != null && _child$context.open && !child.context.dataRef.current.__escapeKeyBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n events.emit('dismiss', {\n type: 'escapeKey',\n data: {\n returnFocus: {\n preventScroll: false\n }\n }\n });\n onOpenChange(false);\n }\n }\n function onOutsidePress(event) {\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = insideReactTreeRef.current;\n insideReactTreeRef.current = false;\n if (insideReactTree) {\n return;\n }\n if (typeof outsidePress === 'function' && !outsidePress(event)) {\n return;\n }\n const target = getTarget(event);\n\n // Check if the click occurred on the scrollbar\n if (isHTMLElement(target) && floating) {\n const win = floating.ownerDocument.defaultView || window;\n const canScrollX = target.scrollWidth > target.clientWidth;\n const canScrollY = target.scrollHeight > target.clientHeight;\n let xCond = canScrollY && event.offsetX > target.clientWidth;\n\n // In some browsers it is possible to change the (or window)\n // scrollbar to the left side, but is very rare and is difficult to\n // check for. Plus, for modal dialogs with backdrops, it is more\n // important that the backdrop is checked but not so much the window.\n if (canScrollY) {\n const isRTL = win.getComputedStyle(target).direction === 'rtl';\n if (isRTL) {\n xCond = event.offsetX <= target.offsetWidth - target.clientWidth;\n }\n }\n if (xCond || canScrollX && event.offsetY > target.clientHeight) {\n return;\n }\n }\n const targetIsInsideChildren = tree && getChildren(tree.nodesRef.current, nodeId).some(node => {\n var _node$context;\n return isEventTargetWithin(event, (_node$context = node.context) == null ? void 0 : _node$context.elements.floating);\n });\n if (isEventTargetWithin(event, floating) || isEventTargetWithin(event, domReference) || targetIsInsideChildren) {\n return;\n }\n const children = tree ? getChildren(tree.nodesRef.current, nodeId) : [];\n if (children.length > 0) {\n let shouldDismiss = true;\n children.forEach(child => {\n var _child$context2;\n if ((_child$context2 = child.context) != null && _child$context2.open && !child.context.dataRef.current.__outsidePressBubbles) {\n shouldDismiss = false;\n return;\n }\n });\n if (!shouldDismiss) {\n return;\n }\n }\n events.emit('dismiss', {\n type: 'outsidePress',\n data: {\n returnFocus: nested ? {\n preventScroll: true\n } : isVirtualClick(event) || isVirtualPointerEvent(event)\n }\n });\n onOpenChange(false);\n }\n function onScroll() {\n onOpenChange(false);\n }\n const doc = getDocument(floating);\n escapeKey && doc.addEventListener('keydown', onKeyDown);\n outsidePress && doc.addEventListener(outsidePressEvent, onOutsidePress);\n let ancestors = [];\n if (ancestorScroll) {\n if (isElement(domReference)) {\n ancestors = getOverflowAncestors(domReference);\n }\n if (isElement(floating)) {\n ancestors = ancestors.concat(getOverflowAncestors(floating));\n }\n if (!isElement(reference) && reference && reference.contextElement) {\n ancestors = ancestors.concat(getOverflowAncestors(reference.contextElement));\n }\n }\n\n // Ignore the visual viewport for scrolling dismissal (allow pinch-zoom)\n ancestors = ancestors.filter(ancestor => {\n var _doc$defaultView;\n return ancestor !== ((_doc$defaultView = doc.defaultView) == null ? void 0 : _doc$defaultView.visualViewport);\n });\n ancestors.forEach(ancestor => {\n ancestor.addEventListener('scroll', onScroll, {\n passive: true\n });\n });\n return () => {\n escapeKey && doc.removeEventListener('keydown', onKeyDown);\n outsidePress && doc.removeEventListener(outsidePressEvent, onOutsidePress);\n ancestors.forEach(ancestor => {\n ancestor.removeEventListener('scroll', onScroll);\n });\n };\n }, [dataRef, floating, domReference, reference, escapeKey, outsidePress, outsidePressEvent, events, tree, nodeId, open, onOpenChange, ancestorScroll, enabled, escapeKeyBubbles, outsidePressBubbles, nested]);\n React.useEffect(() => {\n insideReactTreeRef.current = false;\n }, [outsidePress, outsidePressEvent]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n return {\n reference: {\n [bubbleHandlerKeys[referencePressEvent]]: () => {\n if (referencePress) {\n events.emit('dismiss', {\n type: 'referencePress',\n data: {\n returnFocus: false\n }\n });\n onOpenChange(false);\n }\n }\n },\n floating: {\n [captureHandlerKeys[outsidePressEvent]]: () => {\n insideReactTreeRef.current = true;\n }\n }\n };\n }, [enabled, events, referencePress, outsidePressEvent, referencePressEvent, onOpenChange]);\n};\n\n/**\n * Adds focus event listeners that change the open state, like CSS :focus.\n * @see https://floating-ui.com/docs/useFocus\n */\nconst useFocus = function (_ref, _temp) {\n let {\n open,\n onOpenChange,\n dataRef,\n events,\n refs,\n elements: {\n floating,\n domReference\n }\n } = _ref;\n let {\n enabled = true,\n keyboardOnly = true\n } = _temp === void 0 ? {} : _temp;\n const pointerTypeRef = React.useRef('');\n const blockFocusRef = React.useRef(false);\n const timeoutRef = React.useRef();\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n const doc = getDocument(floating);\n const win = doc.defaultView || window;\n\n // If the reference was focused and the user left the tab/window, and the\n // floating element was not open, the focus should be blocked when they\n // return to the tab/window.\n function onBlur() {\n if (!open && isHTMLElement(domReference) && domReference === activeElement$1(getDocument(domReference))) {\n blockFocusRef.current = true;\n }\n }\n win.addEventListener('blur', onBlur);\n return () => {\n win.removeEventListener('blur', onBlur);\n };\n }, [floating, domReference, open, enabled]);\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n function onDismiss(payload) {\n if (payload.type === 'referencePress' || payload.type === 'escapeKey') {\n blockFocusRef.current = true;\n }\n }\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n };\n }, [events, enabled]);\n React.useEffect(() => {\n return () => {\n clearTimeout(timeoutRef.current);\n };\n }, []);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n return {\n reference: {\n onPointerDown(_ref2) {\n let {\n pointerType\n } = _ref2;\n pointerTypeRef.current = pointerType;\n blockFocusRef.current = !!(pointerType && keyboardOnly);\n },\n onMouseLeave() {\n blockFocusRef.current = false;\n },\n onFocus(event) {\n var _dataRef$current$open;\n if (blockFocusRef.current) {\n return;\n }\n\n // Dismiss with click should ignore the subsequent `focus` trigger,\n // but only if the click originated inside the reference element.\n if (event.type === 'focus' && ((_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type) === 'mousedown' && dataRef.current.openEvent && isEventTargetWithin(dataRef.current.openEvent, domReference)) {\n return;\n }\n dataRef.current.openEvent = event.nativeEvent;\n onOpenChange(true);\n },\n onBlur(event) {\n blockFocusRef.current = false;\n const relatedTarget = event.relatedTarget;\n\n // Hit the non-modal focus management portal guard. Focus will be\n // moved into the floating element immediately after.\n const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute('data-floating-ui-focus-guard') && relatedTarget.getAttribute('data-type') === 'outside';\n\n // Wait for the window blur listener to fire.\n timeoutRef.current = setTimeout(() => {\n // When focusing the reference element (e.g. regular click), then\n // clicking into the floating element, prevent it from hiding.\n // Note: it must be focusable, e.g. `tabindex=\"-1\"`.\n if (contains(refs.floating.current, relatedTarget) || contains(domReference, relatedTarget) || movedToFocusGuard) {\n return;\n }\n onOpenChange(false);\n });\n }\n }\n };\n }, [enabled, keyboardOnly, domReference, refs, dataRef, onOpenChange]);\n};\n\nlet isPreventScrollSupported = false;\nconst ARROW_UP = 'ArrowUp';\nconst ARROW_DOWN = 'ArrowDown';\nconst ARROW_LEFT = 'ArrowLeft';\nconst ARROW_RIGHT = 'ArrowRight';\nfunction isDifferentRow(index, cols, prevRow) {\n return Math.floor(index / cols) !== prevRow;\n}\nfunction isIndexOutOfBounds(listRef, index) {\n return index < 0 || index >= listRef.current.length;\n}\nfunction findNonDisabledIndex(listRef, _temp) {\n let {\n startingIndex = -1,\n decrement = false,\n disabledIndices,\n amount = 1\n } = _temp === void 0 ? {} : _temp;\n const list = listRef.current;\n let index = startingIndex;\n do {\n var _list$index, _list$index2;\n index = index + (decrement ? -amount : amount);\n } while (index >= 0 && index <= list.length - 1 && (disabledIndices ? disabledIndices.includes(index) : list[index] == null || ((_list$index = list[index]) == null ? void 0 : _list$index.hasAttribute('disabled')) || ((_list$index2 = list[index]) == null ? void 0 : _list$index2.getAttribute('aria-disabled')) === 'true'));\n return index;\n}\nfunction doSwitch(orientation, vertical, horizontal) {\n switch (orientation) {\n case 'vertical':\n return vertical;\n case 'horizontal':\n return horizontal;\n default:\n return vertical || horizontal;\n }\n}\nfunction isMainOrientationKey(key, orientation) {\n const vertical = key === ARROW_UP || key === ARROW_DOWN;\n const horizontal = key === ARROW_LEFT || key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isMainOrientationToEndKey(key, orientation, rtl) {\n const vertical = key === ARROW_DOWN;\n const horizontal = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n return doSwitch(orientation, vertical, horizontal) || key === 'Enter' || key == ' ' || key === '';\n}\nfunction isCrossOrientationOpenKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_LEFT : key === ARROW_RIGHT;\n const horizontal = key === ARROW_DOWN;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction isCrossOrientationCloseKey(key, orientation, rtl) {\n const vertical = rtl ? key === ARROW_RIGHT : key === ARROW_LEFT;\n const horizontal = key === ARROW_UP;\n return doSwitch(orientation, vertical, horizontal);\n}\nfunction getMinIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n disabledIndices\n });\n}\nfunction getMaxIndex(listRef, disabledIndices) {\n return findNonDisabledIndex(listRef, {\n decrement: true,\n startingIndex: listRef.current.length,\n disabledIndices\n });\n}\n/**\n * Adds focus-managed indexed navigation via arrow keys to a list of items\n * within the floating element.\n * @see https://floating-ui.com/docs/useListNavigation\n */\nconst useListNavigation = function (_ref, _temp2) {\n let {\n open,\n onOpenChange,\n refs,\n elements: {\n domReference\n }\n } = _ref;\n let {\n listRef,\n activeIndex,\n onNavigate: unstable_onNavigate = () => {},\n enabled = true,\n selectedIndex = null,\n allowEscape = false,\n loop = false,\n nested = false,\n rtl = false,\n virtual = false,\n focusItemOnOpen = 'auto',\n focusItemOnHover = true,\n openOnArrowKeyDown = true,\n disabledIndices = undefined,\n orientation = 'vertical',\n cols = 1,\n scrollItemIntoView = true\n } = _temp2 === void 0 ? {\n listRef: {\n current: []\n },\n activeIndex: null,\n onNavigate: () => {}\n } : _temp2;\n if (process.env.NODE_ENV !== \"production\") {\n if (allowEscape) {\n if (!loop) {\n console.warn(['Floating UI: `useListNavigation` looping must be enabled to allow', 'escaping.'].join(' '));\n }\n if (!virtual) {\n console.warn(['Floating UI: `useListNavigation` must be virtual to allow', 'escaping.'].join(' '));\n }\n }\n if (orientation === 'vertical' && cols > 1) {\n console.warn(['Floating UI: In grid list navigation mode (`cols` > 1), the', '`orientation` should be either \"horizontal\" or \"both\".'].join(' '));\n }\n }\n const parentId = useFloatingParentNodeId();\n const tree = useFloatingTree();\n const onNavigate = useEvent(unstable_onNavigate);\n const focusItemOnOpenRef = React.useRef(focusItemOnOpen);\n const indexRef = React.useRef(selectedIndex != null ? selectedIndex : -1);\n const keyRef = React.useRef(null);\n const isPointerModalityRef = React.useRef(true);\n const previousOnNavigateRef = React.useRef(onNavigate);\n const previousOpenRef = React.useRef(open);\n const forceSyncFocus = React.useRef(false);\n const forceScrollIntoViewRef = React.useRef(false);\n const disabledIndicesRef = useLatestRef(disabledIndices);\n const latestOpenRef = useLatestRef(open);\n const scrollItemIntoViewRef = useLatestRef(scrollItemIntoView);\n const [activeId, setActiveId] = React.useState();\n const focusItem = React.useCallback(function (listRef, indexRef, forceScrollIntoView) {\n if (forceScrollIntoView === void 0) {\n forceScrollIntoView = false;\n }\n const item = listRef.current[indexRef.current];\n if (virtual) {\n setActiveId(item == null ? void 0 : item.id);\n } else {\n enqueueFocus(item, {\n preventScroll: true,\n // Mac Safari does not move the virtual cursor unless the focus call\n // is sync. However, for the very first focus call, we need to wait\n // for the position to be ready in order to prevent unwanted\n // scrolling. This means the virtual cursor will not move to the first\n // item when first opening the floating element, but will on\n // subsequent calls. `preventScroll` is supported in modern Safari,\n // so we can use that instead.\n // iOS Safari must be async or the first item will not be focused.\n sync: isMac() && isSafari() ? isPreventScrollSupported || forceSyncFocus.current : false\n });\n }\n requestAnimationFrame(() => {\n const scrollIntoViewOptions = scrollItemIntoViewRef.current;\n const shouldScrollIntoView = scrollIntoViewOptions && item && (forceScrollIntoView || !isPointerModalityRef.current);\n if (shouldScrollIntoView) {\n // JSDOM doesn't support `.scrollIntoView()` but it's widely supported\n // by all browsers.\n item.scrollIntoView == null ? void 0 : item.scrollIntoView(typeof scrollIntoViewOptions === 'boolean' ? {\n block: 'nearest',\n inline: 'nearest'\n } : scrollIntoViewOptions);\n }\n });\n }, [virtual, scrollItemIntoViewRef]);\n index(() => {\n document.createElement('div').focus({\n get preventScroll() {\n isPreventScrollSupported = true;\n return false;\n }\n });\n }, []);\n\n // Sync `selectedIndex` to be the `activeIndex` upon opening the floating\n // element. Also, reset `activeIndex` upon closing the floating element.\n index(() => {\n if (!enabled) {\n return;\n }\n if (open) {\n if (focusItemOnOpenRef.current && selectedIndex != null) {\n // Regardless of the pointer modality, we want to ensure the selected\n // item comes into view when the floating element is opened.\n forceScrollIntoViewRef.current = true;\n onNavigate(selectedIndex);\n }\n } else if (previousOpenRef.current) {\n // Since the user can specify `onNavigate` conditionally\n // (onNavigate: open ? setActiveIndex : setSelectedIndex),\n // we store and call the previous function.\n indexRef.current = -1;\n previousOnNavigateRef.current(null);\n }\n }, [enabled, open, selectedIndex, onNavigate]);\n\n // Sync `activeIndex` to be the focused item while the floating element is\n // open.\n index(() => {\n if (!enabled) {\n return;\n }\n if (open) {\n if (activeIndex == null) {\n forceSyncFocus.current = false;\n if (selectedIndex != null) {\n return;\n }\n\n // Reset while the floating element was open (e.g. the list changed).\n if (previousOpenRef.current) {\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n }\n\n // Initial sync.\n if (!previousOpenRef.current && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {\n indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinIndex(listRef, disabledIndicesRef.current) : getMaxIndex(listRef, disabledIndicesRef.current);\n onNavigate(indexRef.current);\n }\n } else if (!isIndexOutOfBounds(listRef, activeIndex)) {\n indexRef.current = activeIndex;\n focusItem(listRef, indexRef, forceScrollIntoViewRef.current);\n forceScrollIntoViewRef.current = false;\n }\n }\n }, [enabled, open, activeIndex, selectedIndex, nested, listRef, orientation, rtl, onNavigate, focusItem, disabledIndicesRef]);\n\n // Ensure the parent floating element has focus when a nested child closes\n // to allow arrow key navigation to work after the pointer leaves the child.\n index(() => {\n if (!enabled) {\n return;\n }\n if (previousOpenRef.current && !open) {\n var _tree$nodesRef$curren, _tree$nodesRef$curren2;\n const parentFloating = tree == null ? void 0 : (_tree$nodesRef$curren = tree.nodesRef.current.find(node => node.id === parentId)) == null ? void 0 : (_tree$nodesRef$curren2 = _tree$nodesRef$curren.context) == null ? void 0 : _tree$nodesRef$curren2.elements.floating;\n if (parentFloating && !contains(parentFloating, activeElement$1(getDocument(parentFloating)))) {\n parentFloating.focus({\n preventScroll: true\n });\n }\n }\n }, [enabled, open, tree, parentId]);\n index(() => {\n keyRef.current = null;\n previousOnNavigateRef.current = onNavigate;\n previousOpenRef.current = open;\n });\n const hasActiveIndex = activeIndex != null;\n const item = React.useMemo(() => {\n function syncCurrentTarget(currentTarget) {\n if (!open) return;\n const index = listRef.current.indexOf(currentTarget);\n if (index !== -1) {\n onNavigate(index);\n }\n }\n const props = {\n onFocus(_ref2) {\n let {\n currentTarget\n } = _ref2;\n syncCurrentTarget(currentTarget);\n },\n onClick: _ref3 => {\n let {\n currentTarget\n } = _ref3;\n return currentTarget.focus({\n preventScroll: true\n });\n },\n // Safari\n ...(focusItemOnHover && {\n onMouseMove(_ref4) {\n let {\n currentTarget\n } = _ref4;\n syncCurrentTarget(currentTarget);\n },\n onPointerLeave() {\n if (!isPointerModalityRef.current) {\n return;\n }\n indexRef.current = -1;\n focusItem(listRef, indexRef);\n\n // Virtual cursor with VoiceOver on iOS needs this to be flushed\n // synchronously or there is a glitch that prevents nested\n // submenus from being accessible.\n flushSync(() => onNavigate(null));\n if (!virtual) {\n var _refs$floating$curren;\n // This also needs to be sync to prevent fast mouse movements\n // from leaving behind a stale active item when landing on a\n // disabled button item.\n (_refs$floating$curren = refs.floating.current) == null ? void 0 : _refs$floating$curren.focus({\n preventScroll: true\n });\n }\n }\n })\n };\n return props;\n }, [open, refs, focusItem, focusItemOnHover, listRef, onNavigate, virtual]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n const disabledIndices = disabledIndicesRef.current;\n function onKeyDown(event) {\n isPointerModalityRef.current = false;\n forceSyncFocus.current = true;\n\n // If the floating element is animating out, ignore navigation. Otherwise,\n // the `activeIndex` gets set to 0 despite not being open so the next time\n // the user ArrowDowns, the first item won't be focused.\n if (!latestOpenRef.current && event.currentTarget === refs.floating.current) {\n return;\n }\n if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl)) {\n stopEvent(event);\n onOpenChange(false);\n if (isHTMLElement(domReference)) {\n domReference.focus();\n }\n return;\n }\n const currentIndex = indexRef.current;\n const minIndex = getMinIndex(listRef, disabledIndices);\n const maxIndex = getMaxIndex(listRef, disabledIndices);\n if (event.key === 'Home') {\n indexRef.current = minIndex;\n onNavigate(indexRef.current);\n }\n if (event.key === 'End') {\n indexRef.current = maxIndex;\n onNavigate(indexRef.current);\n }\n\n // Grid navigation.\n if (cols > 1) {\n const prevIndex = indexRef.current;\n if (event.key === ARROW_UP) {\n stopEvent(event);\n if (prevIndex === -1) {\n indexRef.current = maxIndex;\n } else {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n amount: cols,\n decrement: true,\n disabledIndices\n });\n if (loop && (prevIndex - cols < minIndex || indexRef.current < 0)) {\n const col = prevIndex % cols;\n const maxCol = maxIndex % cols;\n const offset = maxIndex - (maxCol - col);\n if (maxCol === col) {\n indexRef.current = maxIndex;\n } else {\n indexRef.current = maxCol > col ? offset : offset - cols;\n }\n }\n }\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n indexRef.current = prevIndex;\n }\n onNavigate(indexRef.current);\n }\n if (event.key === ARROW_DOWN) {\n stopEvent(event);\n if (prevIndex === -1) {\n indexRef.current = minIndex;\n } else {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n amount: cols,\n disabledIndices\n });\n if (loop && prevIndex + cols > maxIndex) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex % cols - cols,\n amount: cols,\n disabledIndices\n });\n }\n }\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n indexRef.current = prevIndex;\n }\n onNavigate(indexRef.current);\n }\n\n // Remains on the same row/column.\n if (orientation === 'both') {\n const prevRow = Math.floor(prevIndex / cols);\n if (event.key === ARROW_RIGHT) {\n stopEvent(event);\n if (prevIndex % cols !== cols - 1) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n disabledIndices\n });\n if (loop && isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n } else if (loop) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n }\n if (isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = prevIndex;\n }\n }\n if (event.key === ARROW_LEFT) {\n stopEvent(event);\n if (prevIndex % cols !== 0) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex,\n disabledIndices,\n decrement: true\n });\n if (loop && isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n } else if (loop) {\n indexRef.current = findNonDisabledIndex(listRef, {\n startingIndex: prevIndex + (cols - prevIndex % cols),\n decrement: true,\n disabledIndices\n });\n }\n if (isDifferentRow(indexRef.current, cols, prevRow)) {\n indexRef.current = prevIndex;\n }\n }\n const lastRow = Math.floor(maxIndex / cols) === prevRow;\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n if (loop && lastRow) {\n indexRef.current = event.key === ARROW_LEFT ? maxIndex : findNonDisabledIndex(listRef, {\n startingIndex: prevIndex - prevIndex % cols - 1,\n disabledIndices\n });\n } else {\n indexRef.current = prevIndex;\n }\n }\n onNavigate(indexRef.current);\n return;\n }\n }\n if (isMainOrientationKey(event.key, orientation)) {\n stopEvent(event);\n\n // Reset the index if no item is focused.\n if (open && !virtual && activeElement$1(event.currentTarget.ownerDocument) === event.currentTarget) {\n indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;\n onNavigate(indexRef.current);\n return;\n }\n if (isMainOrientationToEndKey(event.key, orientation, rtl)) {\n if (loop) {\n indexRef.current = currentIndex >= maxIndex ? allowEscape && currentIndex !== listRef.current.length ? -1 : minIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n });\n } else {\n indexRef.current = Math.min(maxIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n disabledIndices\n }));\n }\n } else {\n if (loop) {\n indexRef.current = currentIndex <= minIndex ? allowEscape && currentIndex !== -1 ? listRef.current.length : maxIndex : findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n });\n } else {\n indexRef.current = Math.max(minIndex, findNonDisabledIndex(listRef, {\n startingIndex: currentIndex,\n decrement: true,\n disabledIndices\n }));\n }\n }\n if (isIndexOutOfBounds(listRef, indexRef.current)) {\n onNavigate(null);\n } else {\n onNavigate(indexRef.current);\n }\n }\n }\n function checkVirtualMouse(event) {\n if (focusItemOnOpen === 'auto' && isVirtualClick(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n function checkVirtualPointer(event) {\n // `pointerdown` fires first, reset the state then perform the checks.\n focusItemOnOpenRef.current = focusItemOnOpen;\n if (focusItemOnOpen === 'auto' && isVirtualPointerEvent(event.nativeEvent)) {\n focusItemOnOpenRef.current = true;\n }\n }\n const ariaActiveDescendantProp = virtual && open && hasActiveIndex && {\n 'aria-activedescendant': activeId\n };\n return {\n reference: {\n ...ariaActiveDescendantProp,\n onKeyDown(event) {\n isPointerModalityRef.current = false;\n const isArrowKey = event.key.indexOf('Arrow') === 0;\n if (virtual && open) {\n return onKeyDown(event);\n }\n\n // If a floating element should not open on arrow key down, avoid\n // setting `activeIndex` while it's closed.\n if (!open && !openOnArrowKeyDown && isArrowKey) {\n return;\n }\n const isNavigationKey = isArrowKey || event.key === 'Enter' || event.key === ' ' || event.key === '';\n if (isNavigationKey) {\n keyRef.current = event.key;\n }\n if (nested) {\n if (isCrossOrientationOpenKey(event.key, orientation, rtl)) {\n stopEvent(event);\n if (open) {\n indexRef.current = getMinIndex(listRef, disabledIndices);\n onNavigate(indexRef.current);\n } else {\n onOpenChange(true);\n }\n }\n return;\n }\n if (isMainOrientationKey(event.key, orientation)) {\n if (selectedIndex != null) {\n indexRef.current = selectedIndex;\n }\n stopEvent(event);\n if (!open && openOnArrowKeyDown) {\n onOpenChange(true);\n } else {\n onKeyDown(event);\n }\n if (open) {\n onNavigate(indexRef.current);\n }\n }\n },\n onFocus() {\n if (open) {\n onNavigate(null);\n }\n },\n onPointerDown: checkVirtualPointer,\n onMouseDown: checkVirtualMouse,\n onClick: checkVirtualMouse\n },\n floating: {\n 'aria-orientation': orientation === 'both' ? undefined : orientation,\n ...ariaActiveDescendantProp,\n onKeyDown,\n onPointerMove() {\n isPointerModalityRef.current = true;\n }\n },\n item\n };\n }, [domReference, refs, activeId, disabledIndicesRef, latestOpenRef, listRef, enabled, orientation, rtl, virtual, open, hasActiveIndex, nested, selectedIndex, openOnArrowKeyDown, allowEscape, cols, loop, focusItemOnOpen, onNavigate, onOpenChange, item]);\n};\n\nfunction useMergeRefs(refs) {\n return React.useMemo(() => {\n if (refs.every(ref => ref == null)) {\n return null;\n }\n return value => {\n refs.forEach(ref => {\n if (typeof ref === 'function') {\n ref(value);\n } else if (ref != null) {\n ref.current = value;\n }\n });\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, refs);\n}\n\n/**\n * Adds relevant screen reader props for a given element `role`.\n * @see https://floating-ui.com/docs/useRole\n */\nconst useRole = function (_ref, _temp) {\n let {\n open\n } = _ref;\n let {\n enabled = true,\n role = 'dialog'\n } = _temp === void 0 ? {} : _temp;\n const rootId = useId();\n const referenceId = useId();\n return React.useMemo(() => {\n const floatingProps = {\n id: rootId,\n role\n };\n if (!enabled) {\n return {};\n }\n if (role === 'tooltip') {\n return {\n reference: {\n 'aria-describedby': open ? rootId : undefined\n },\n floating: floatingProps\n };\n }\n return {\n reference: {\n 'aria-expanded': open ? 'true' : 'false',\n 'aria-haspopup': role === 'alertdialog' ? 'dialog' : role,\n 'aria-controls': open ? rootId : undefined,\n ...(role === 'listbox' && {\n role: 'combobox'\n }),\n ...(role === 'menu' && {\n id: referenceId\n })\n },\n floating: {\n ...floatingProps,\n ...(role === 'menu' && {\n 'aria-labelledby': referenceId\n })\n }\n };\n }, [enabled, role, open, rootId, referenceId]);\n};\n\n// Converts a JS style key like `backgroundColor` to a CSS transition-property\n// like `background-color`.\nconst camelCaseToKebabCase = str => str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase());\nfunction useDelayUnmount(open, durationMs) {\n const [isMounted, setIsMounted] = React.useState(open);\n if (open && !isMounted) {\n setIsMounted(true);\n }\n React.useEffect(() => {\n if (!open) {\n const timeout = setTimeout(() => setIsMounted(false), durationMs);\n return () => clearTimeout(timeout);\n }\n }, [open, durationMs]);\n return isMounted;\n}\n/**\n * Provides a status string to apply CSS transitions to a floating element,\n * correctly handling placement-aware transitions.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstatus\n */\nfunction useTransitionStatus(_ref, _temp) {\n let {\n open,\n elements: {\n floating\n }\n } = _ref;\n let {\n duration = 250\n } = _temp === void 0 ? {} : _temp;\n const isNumberDuration = typeof duration === 'number';\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n const [initiated, setInitiated] = React.useState(false);\n const [status, setStatus] = React.useState('unmounted');\n const isMounted = useDelayUnmount(open, closeDuration);\n\n // `initiated` check prevents this `setState` call from breaking\n //
. This call is necessary to ensure subsequent opens\n // after the initial one allows the correct side animation to play when the\n // placement has changed.\n index(() => {\n if (initiated && !isMounted) {\n setStatus('unmounted');\n }\n }, [initiated, isMounted]);\n index(() => {\n if (!floating) return;\n if (open) {\n setStatus('initial');\n const frame = requestAnimationFrame(() => {\n setStatus('open');\n });\n return () => {\n cancelAnimationFrame(frame);\n };\n } else {\n setInitiated(true);\n setStatus('close');\n }\n }, [open, floating]);\n return {\n isMounted,\n status\n };\n}\n/**\n * Provides styles to apply CSS transitions to a floating element, correctly\n * handling placement-aware transitions. Wrapper around `useTransitionStatus`.\n * @see https://floating-ui.com/docs/useTransition#usetransitionstyles\n */\nfunction useTransitionStyles(context, _temp2) {\n let {\n initial: unstable_initial = {\n opacity: 0\n },\n open: unstable_open,\n close: unstable_close,\n common: unstable_common,\n duration = 250\n } = _temp2 === void 0 ? {} : _temp2;\n const placement = context.placement;\n const side = placement.split('-')[0];\n const [styles, setStyles] = React.useState({});\n const {\n isMounted,\n status\n } = useTransitionStatus(context, {\n duration\n });\n const initialRef = useLatestRef(unstable_initial);\n const openRef = useLatestRef(unstable_open);\n const closeRef = useLatestRef(unstable_close);\n const commonRef = useLatestRef(unstable_common);\n const isNumberDuration = typeof duration === 'number';\n const openDuration = (isNumberDuration ? duration : duration.open) || 0;\n const closeDuration = (isNumberDuration ? duration : duration.close) || 0;\n index(() => {\n const fnArgs = {\n side,\n placement\n };\n const initial = initialRef.current;\n const close = closeRef.current;\n const open = openRef.current;\n const common = commonRef.current;\n const initialStyles = typeof initial === 'function' ? initial(fnArgs) : initial;\n const closeStyles = typeof close === 'function' ? close(fnArgs) : close;\n const commonStyles = typeof common === 'function' ? common(fnArgs) : common;\n const openStyles = (typeof open === 'function' ? open(fnArgs) : open) || Object.keys(initialStyles).reduce((acc, key) => {\n acc[key] = '';\n return acc;\n }, {});\n if (status === 'initial') {\n setStyles(styles => ({\n transitionProperty: styles.transitionProperty,\n ...commonStyles,\n ...initialStyles\n }));\n }\n if (status === 'open') {\n setStyles({\n transitionProperty: Object.keys(openStyles).map(camelCaseToKebabCase).join(','),\n transitionDuration: openDuration + \"ms\",\n ...commonStyles,\n ...openStyles\n });\n }\n if (status === 'close') {\n const styles = closeStyles || initialStyles;\n setStyles({\n transitionProperty: Object.keys(styles).map(camelCaseToKebabCase).join(','),\n transitionDuration: closeDuration + \"ms\",\n ...commonStyles,\n ...styles\n });\n }\n }, [side, placement, closeDuration, closeRef, initialRef, openRef, commonRef, openDuration, status]);\n return {\n isMounted,\n styles\n };\n}\n\n/**\n * Provides a matching callback that can be used to focus an item as the user\n * types, often used in tandem with `useListNavigation()`.\n * @see https://floating-ui.com/docs/useTypeahead\n */\nconst useTypeahead = function (_ref, _temp) {\n var _ref2;\n let {\n open,\n dataRef\n } = _ref;\n let {\n listRef,\n activeIndex,\n onMatch: unstable_onMatch = () => {},\n enabled = true,\n findMatch = null,\n resetMs = 1000,\n ignoreKeys = [],\n selectedIndex = null\n } = _temp === void 0 ? {\n listRef: {\n current: []\n },\n activeIndex: null\n } : _temp;\n const timeoutIdRef = React.useRef();\n const stringRef = React.useRef('');\n const prevIndexRef = React.useRef((_ref2 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref2 : -1);\n const matchIndexRef = React.useRef(null);\n const onMatch = useEvent(unstable_onMatch);\n const findMatchRef = useLatestRef(findMatch);\n const ignoreKeysRef = useLatestRef(ignoreKeys);\n index(() => {\n if (open) {\n clearTimeout(timeoutIdRef.current);\n matchIndexRef.current = null;\n stringRef.current = '';\n }\n }, [open]);\n index(() => {\n // Sync arrow key navigation but not typeahead navigation.\n if (open && stringRef.current === '') {\n var _ref3;\n prevIndexRef.current = (_ref3 = selectedIndex != null ? selectedIndex : activeIndex) != null ? _ref3 : -1;\n }\n }, [open, selectedIndex, activeIndex]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n function onKeyDown(event) {\n // Correctly scope nested non-portalled floating elements. Since the nested\n // floating element is inside of the another, we find the closest role\n // that indicates the floating element scope.\n const target = getTarget(event.nativeEvent);\n if (isElement(target) && (activeElement$1(getDocument(target)) !== event.currentTarget ? target.closest('[role=\"dialog\"],[role=\"menu\"],[role=\"listbox\"],[role=\"tree\"],[role=\"grid\"]') !== event.currentTarget : false)) {\n return;\n }\n if (stringRef.current.length > 0 && stringRef.current[0] !== ' ') {\n dataRef.current.typing = true;\n if (event.key === ' ') {\n stopEvent(event);\n }\n }\n const listContent = listRef.current;\n if (listContent == null || ignoreKeysRef.current.includes(event.key) ||\n // Character key.\n event.key.length !== 1 ||\n // Modifier key.\n event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n\n // Bail out if the list contains a word like \"llama\" or \"aaron\". TODO:\n // allow it in this case, too.\n const allowRapidSuccessionOfFirstLetter = listContent.every(text => {\n var _text$, _text$2;\n return text ? ((_text$ = text[0]) == null ? void 0 : _text$.toLocaleLowerCase()) !== ((_text$2 = text[1]) == null ? void 0 : _text$2.toLocaleLowerCase()) : true;\n });\n\n // Allows the user to cycle through items that start with the same letter\n // in rapid succession.\n if (allowRapidSuccessionOfFirstLetter && stringRef.current === event.key) {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n }\n stringRef.current += event.key;\n clearTimeout(timeoutIdRef.current);\n timeoutIdRef.current = setTimeout(() => {\n stringRef.current = '';\n prevIndexRef.current = matchIndexRef.current;\n dataRef.current.typing = false;\n }, resetMs);\n const prevIndex = prevIndexRef.current;\n const orderedList = [...listContent.slice((prevIndex || 0) + 1), ...listContent.slice(0, (prevIndex || 0) + 1)];\n const str = findMatchRef.current ? findMatchRef.current(orderedList, stringRef.current) : orderedList.find(text => (text == null ? void 0 : text.toLocaleLowerCase().indexOf(stringRef.current.toLocaleLowerCase())) === 0);\n const index = str ? listContent.indexOf(str) : -1;\n if (index !== -1) {\n onMatch(index);\n matchIndexRef.current = index;\n }\n }\n return {\n reference: {\n onKeyDown\n },\n floating: {\n onKeyDown\n }\n };\n }, [enabled, dataRef, listRef, resetMs, ignoreKeysRef, findMatchRef, onMatch]);\n};\n\nfunction getArgsWithCustomFloatingHeight(args, height) {\n return {\n ...args,\n rects: {\n ...args.rects,\n floating: {\n ...args.rects.floating,\n height\n }\n }\n };\n}\n/**\n * Positions the floating element such that an inner element inside\n * of it is anchored to the reference element.\n * @see https://floating-ui.com/docs/inner\n */\nconst inner = props => ({\n name: 'inner',\n options: props,\n async fn(middlewareArguments) {\n const {\n listRef,\n overflowRef,\n onFallbackChange,\n offset: innerOffset = 0,\n index = 0,\n minItemsVisible = 4,\n referenceOverflowThreshold = 0,\n scrollRef,\n ...detectOverflowOptions\n } = props;\n const {\n rects,\n elements: {\n floating\n }\n } = middlewareArguments;\n const item = listRef.current[index];\n if (process.env.NODE_ENV !== \"production\") {\n if (!middlewareArguments.placement.startsWith('bottom')) {\n console.warn(['Floating UI: `placement` side must be \"bottom\" when using the', '`inner` middleware.'].join(' '));\n }\n }\n if (!item) {\n return {};\n }\n const nextArgs = {\n ...middlewareArguments,\n ...(await offset(-item.offsetTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(middlewareArguments))\n };\n const el = (scrollRef == null ? void 0 : scrollRef.current) || floating;\n const overflow = await detectOverflow(getArgsWithCustomFloatingHeight(nextArgs, el.scrollHeight), detectOverflowOptions);\n const refOverflow = await detectOverflow(nextArgs, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const diffY = Math.max(0, overflow.top);\n const nextY = nextArgs.y + diffY;\n const maxHeight = Math.max(0, el.scrollHeight - diffY - Math.max(0, overflow.bottom));\n el.style.maxHeight = maxHeight + \"px\";\n el.scrollTop = diffY;\n\n // There is not enough space, fallback to standard anchored positioning\n if (onFallbackChange) {\n if (el.offsetHeight < item.offsetHeight * Math.min(minItemsVisible, listRef.current.length - 1) - 1 || refOverflow.top >= -referenceOverflowThreshold || refOverflow.bottom >= -referenceOverflowThreshold) {\n flushSync(() => onFallbackChange(true));\n } else {\n flushSync(() => onFallbackChange(false));\n }\n }\n if (overflowRef) {\n overflowRef.current = await detectOverflow(getArgsWithCustomFloatingHeight({\n ...nextArgs,\n y: nextY\n }, el.offsetHeight), detectOverflowOptions);\n }\n return {\n y: nextY\n };\n }\n});\n/**\n * Changes the `inner` middleware's `offset` upon a `wheel` event to\n * expand the floating element's height, revealing more list items.\n * @see https://floating-ui.com/docs/inner\n */\nconst useInnerOffset = (_ref, _ref2) => {\n let {\n open,\n elements\n } = _ref;\n let {\n enabled = true,\n overflowRef,\n scrollRef,\n onChange: unstable_onChange\n } = _ref2;\n const onChange = useEvent(unstable_onChange);\n const controlledScrollingRef = React.useRef(false);\n const prevScrollTopRef = React.useRef(null);\n const initialOverflowRef = React.useRef(null);\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n function onWheel(e) {\n if (e.ctrlKey || !el || overflowRef.current == null) {\n return;\n }\n const dY = e.deltaY;\n const isAtTop = overflowRef.current.top >= -0.5;\n const isAtBottom = overflowRef.current.bottom >= -0.5;\n const remainingScroll = el.scrollHeight - el.clientHeight;\n const sign = dY < 0 ? -1 : 1;\n const method = dY < 0 ? 'max' : 'min';\n if (el.scrollHeight <= el.clientHeight) {\n return;\n }\n if (!isAtTop && dY > 0 || !isAtBottom && dY < 0) {\n e.preventDefault();\n flushSync(() => {\n onChange(d => d + Math[method](dY, remainingScroll * sign));\n });\n } else if (/firefox/i.test(getUserAgent())) {\n // Needed to propagate scrolling during momentum scrolling phase once\n // it gets limited by the boundary. UX improvement, not critical.\n el.scrollTop += dY;\n }\n }\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (open && el) {\n el.addEventListener('wheel', onWheel);\n\n // Wait for the position to be ready.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n if (overflowRef.current != null) {\n initialOverflowRef.current = {\n ...overflowRef.current\n };\n }\n });\n return () => {\n prevScrollTopRef.current = null;\n initialOverflowRef.current = null;\n el.removeEventListener('wheel', onWheel);\n };\n }\n }, [enabled, open, elements.floating, overflowRef, scrollRef, onChange]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n return {\n floating: {\n onKeyDown() {\n controlledScrollingRef.current = true;\n },\n onWheel() {\n controlledScrollingRef.current = false;\n },\n onPointerMove() {\n controlledScrollingRef.current = false;\n },\n onScroll() {\n const el = (scrollRef == null ? void 0 : scrollRef.current) || elements.floating;\n if (!overflowRef.current || !el || !controlledScrollingRef.current) {\n return;\n }\n if (prevScrollTopRef.current !== null) {\n const scrollDiff = el.scrollTop - prevScrollTopRef.current;\n if (overflowRef.current.bottom < -0.5 && scrollDiff < -1 || overflowRef.current.top < -0.5 && scrollDiff > 1) {\n flushSync(() => onChange(d => d + scrollDiff));\n }\n }\n\n // [Firefox] Wait for the height change to have been applied.\n requestAnimationFrame(() => {\n prevScrollTopRef.current = el.scrollTop;\n });\n }\n }\n };\n }, [enabled, overflowRef, elements.floating, scrollRef, onChange]);\n};\n\nfunction isPointInPolygon(point, polygon) {\n const [x, y] = point;\n let isInside = false;\n const length = polygon.length;\n for (let i = 0, j = length - 1; i < length; j = i++) {\n const [xi, yi] = polygon[i] || [0, 0];\n const [xj, yj] = polygon[j] || [0, 0];\n const intersect = yi >= y !== yj >= y && x <= (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) {\n isInside = !isInside;\n }\n }\n return isInside;\n}\nfunction isInside(point, rect) {\n return point[0] >= rect.x && point[0] <= rect.x + rect.width && point[1] >= rect.y && point[1] <= rect.y + rect.height;\n}\nfunction safePolygon(_temp) {\n let {\n restMs = 0,\n buffer = 0.5,\n blockPointerEvents = false\n } = _temp === void 0 ? {} : _temp;\n let timeoutId;\n let isInsideRect = false;\n let hasLanded = false;\n const fn = _ref => {\n let {\n x,\n y,\n placement,\n elements,\n onClose,\n nodeId,\n tree\n } = _ref;\n return function onMouseMove(event) {\n function close() {\n clearTimeout(timeoutId);\n onClose();\n }\n clearTimeout(timeoutId);\n if (!elements.domReference || !elements.floating || placement == null || x == null || y == null) {\n return;\n }\n const {\n clientX,\n clientY\n } = event;\n const clientPoint = [clientX, clientY];\n const target = getTarget(event);\n const isLeave = event.type === 'mouseleave';\n const isOverFloatingEl = contains(elements.floating, target);\n const isOverReferenceEl = contains(elements.domReference, target);\n const refRect = elements.domReference.getBoundingClientRect();\n const rect = elements.floating.getBoundingClientRect();\n const side = placement.split('-')[0];\n const cursorLeaveFromRight = x > rect.right - rect.width / 2;\n const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2;\n const isOverReferenceRect = isInside(clientPoint, refRect);\n if (isOverFloatingEl) {\n hasLanded = true;\n }\n if (isOverReferenceEl) {\n hasLanded = false;\n }\n if (isOverReferenceEl && !isLeave) {\n hasLanded = true;\n return;\n }\n\n // Prevent overlapping floating element from being stuck in an open-close\n // loop: https://github.com/floating-ui/floating-ui/issues/1910\n if (isLeave && isElement(event.relatedTarget) && contains(elements.floating, event.relatedTarget)) {\n return;\n }\n\n // If any nested child is open, abort.\n if (tree && getChildren(tree.nodesRef.current, nodeId).some(_ref2 => {\n let {\n context\n } = _ref2;\n return context == null ? void 0 : context.open;\n })) {\n return;\n }\n\n // If the pointer is leaving from the opposite side, the \"buffer\" logic\n // creates a point where the floating element remains open, but should be\n // ignored.\n // A constant of 1 handles floating point rounding errors.\n if (side === 'top' && y >= refRect.bottom - 1 || side === 'bottom' && y <= refRect.top + 1 || side === 'left' && x >= refRect.right - 1 || side === 'right' && x <= refRect.left + 1) {\n return close();\n }\n\n // Ignore when the cursor is within the rectangular trough between the\n // two elements. Since the triangle is created from the cursor point,\n // which can start beyond the ref element's edge, traversing back and\n // forth from the ref to the floating element can cause it to close. This\n // ensures it always remains open in that case.\n let rectPoly = [];\n switch (side) {\n case 'top':\n rectPoly = [[rect.left, refRect.top + 1], [rect.left, rect.bottom - 1], [rect.right, rect.bottom - 1], [rect.right, refRect.top + 1]];\n isInsideRect = clientX >= rect.left && clientX <= rect.right && clientY >= rect.top && clientY <= refRect.top + 1;\n break;\n case 'bottom':\n rectPoly = [[rect.left, rect.top + 1], [rect.left, refRect.bottom - 1], [rect.right, refRect.bottom - 1], [rect.right, rect.top + 1]];\n isInsideRect = clientX >= rect.left && clientX <= rect.right && clientY >= refRect.bottom - 1 && clientY <= rect.bottom;\n break;\n case 'left':\n rectPoly = [[rect.right - 1, rect.bottom], [rect.right - 1, rect.top], [refRect.left + 1, rect.top], [refRect.left + 1, rect.bottom]];\n isInsideRect = clientX >= rect.left && clientX <= refRect.left + 1 && clientY >= rect.top && clientY <= rect.bottom;\n break;\n case 'right':\n rectPoly = [[refRect.right - 1, rect.bottom], [refRect.right - 1, rect.top], [rect.left + 1, rect.top], [rect.left + 1, rect.bottom]];\n isInsideRect = clientX >= refRect.right - 1 && clientX <= rect.right && clientY >= rect.top && clientY <= rect.bottom;\n break;\n }\n function getPolygon(_ref3) {\n let [x, y] = _ref3;\n const isFloatingWider = rect.width > refRect.width;\n const isFloatingTaller = rect.height > refRect.height;\n switch (side) {\n case 'top':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y + buffer + 1];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.bottom - buffer : isFloatingWider ? rect.bottom - buffer : rect.top], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.bottom - buffer : rect.top : rect.bottom - buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'bottom':\n {\n const cursorPointOne = [isFloatingWider ? x + buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const cursorPointTwo = [isFloatingWider ? x - buffer / 2 : cursorLeaveFromRight ? x + buffer * 4 : x - buffer * 4, y - buffer];\n const commonPoints = [[rect.left, cursorLeaveFromRight ? rect.top + buffer : isFloatingWider ? rect.top + buffer : rect.bottom], [rect.right, cursorLeaveFromRight ? isFloatingWider ? rect.top + buffer : rect.bottom : rect.top + buffer]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n case 'left':\n {\n const cursorPointOne = [x + buffer + 1, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x + buffer + 1, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.right - buffer : isFloatingTaller ? rect.right - buffer : rect.left, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.right - buffer : rect.left : rect.right - buffer, rect.bottom]];\n return [...commonPoints, cursorPointOne, cursorPointTwo];\n }\n case 'right':\n {\n const cursorPointOne = [x - buffer, isFloatingTaller ? y + buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const cursorPointTwo = [x - buffer, isFloatingTaller ? y - buffer / 2 : cursorLeaveFromBottom ? y + buffer * 4 : y - buffer * 4];\n const commonPoints = [[cursorLeaveFromBottom ? rect.left + buffer : isFloatingTaller ? rect.left + buffer : rect.right, rect.top], [cursorLeaveFromBottom ? isFloatingTaller ? rect.left + buffer : rect.right : rect.left + buffer, rect.bottom]];\n return [cursorPointOne, cursorPointTwo, ...commonPoints];\n }\n }\n }\n const poly = isInsideRect ? rectPoly : getPolygon([x, y]);\n if (isInsideRect) {\n return;\n } else if (hasLanded && !isOverReferenceRect) {\n return close();\n }\n if (!isPointInPolygon([clientX, clientY], poly)) {\n close();\n } else if (restMs && !hasLanded) {\n timeoutId = setTimeout(close, restMs);\n }\n };\n };\n fn.__options = {\n blockPointerEvents\n };\n return fn;\n}\n\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n open = false,\n onOpenChange: unstable_onOpenChange,\n nodeId\n } = options;\n const position = useFloating$1(options);\n const tree = useFloatingTree();\n const domReferenceRef = React.useRef(null);\n const dataRef = React.useRef({});\n const events = React.useState(() => createPubSub())[0];\n const [domReference, setDomReference] = React.useState(null);\n const setPositionReference = React.useCallback(node => {\n const positionReference = isElement(node) ? {\n getBoundingClientRect: () => node.getBoundingClientRect(),\n contextElement: node\n } : node;\n position.refs.setReference(positionReference);\n }, [position.refs]);\n const setReference = React.useCallback(node => {\n if (isElement(node) || node === null) {\n domReferenceRef.current = node;\n setDomReference(node);\n }\n\n // Backwards-compatibility for passing a virtual element to `reference`\n // after it has set the DOM reference.\n if (isElement(position.refs.reference.current) || position.refs.reference.current === null ||\n // Don't allow setting virtual elements using the old technique back to\n // `null` to support `positionReference` + an unstable `reference`\n // callback ref.\n node !== null && !isElement(node)) {\n position.refs.setReference(node);\n }\n }, [position.refs]);\n const refs = React.useMemo(() => ({\n ...position.refs,\n setReference,\n setPositionReference,\n domReference: domReferenceRef\n }), [position.refs, setReference, setPositionReference]);\n const elements = React.useMemo(() => ({\n ...position.elements,\n domReference: domReference\n }), [position.elements, domReference]);\n const onOpenChange = useEvent(unstable_onOpenChange);\n const context = React.useMemo(() => ({\n ...position,\n refs,\n elements,\n dataRef,\n nodeId,\n events,\n open,\n onOpenChange\n }), [position, nodeId, events, open, onOpenChange, refs, elements]);\n index(() => {\n const node = tree == null ? void 0 : tree.nodesRef.current.find(node => node.id === nodeId);\n if (node) {\n node.context = context;\n }\n });\n return React.useMemo(() => ({\n ...position,\n context,\n refs,\n reference: setReference,\n positionReference: setPositionReference\n }), [position, refs, context, setReference, setPositionReference]);\n}\n\nfunction mergeProps(userProps, propsList, elementKey) {\n const map = new Map();\n return {\n ...(elementKey === 'floating' && {\n tabIndex: -1\n }),\n ...userProps,\n ...propsList.map(value => value ? value[elementKey] : null).concat(userProps).reduce((acc, props) => {\n if (!props) {\n return acc;\n }\n Object.entries(props).forEach(_ref => {\n let [key, value] = _ref;\n if (key.indexOf('on') === 0) {\n if (!map.has(key)) {\n map.set(key, []);\n }\n if (typeof value === 'function') {\n var _map$get;\n (_map$get = map.get(key)) == null ? void 0 : _map$get.push(value);\n acc[key] = function () {\n var _map$get2;\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n (_map$get2 = map.get(key)) == null ? void 0 : _map$get2.forEach(fn => fn(...args));\n };\n }\n } else {\n acc[key] = value;\n }\n });\n return acc;\n }, {})\n };\n}\nconst useInteractions = function (propsList) {\n if (propsList === void 0) {\n propsList = [];\n }\n // The dependencies are a dynamic array, so we can't use the linter's\n // suggestion to add it to the deps array.\n const deps = propsList;\n const getReferenceProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'reference'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n const getFloatingProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'floating'),\n // eslint-disable-next-line react-hooks/exhaustive-deps\n deps);\n const getItemProps = React.useCallback(userProps => mergeProps(userProps, propsList, 'item'),\n // Granularly check for `item` changes, because the `getItemProps` getter\n // should be as referentially stable as possible since it may be passed as\n // a prop to many components. All `item` key values must therefore be\n // memoized.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n propsList.map(key => key == null ? void 0 : key.item));\n return React.useMemo(() => ({\n getReferenceProps,\n getFloatingProps,\n getItemProps\n }), [getReferenceProps, getFloatingProps, getItemProps]);\n};\n\nexport { FloatingDelayGroup, FloatingFocusManager, FloatingNode, FloatingOverlay, FloatingPortal, FloatingTree, inner, safePolygon, useClick, useDelayGroup, useDelayGroupContext, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useFloatingPortalNode, useFloatingTree, useFocus, useHover, useId, useInnerOffset, useInteractions, useListNavigation, useMergeRefs, useRole, useTransitionStatus, useTransitionStyles, useTypeahead };\n","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{AccordionBody:function(){return AccordionBody},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _framerMotion=require(\"framer-motion\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _deepmerge=_interopRequireDefault(require(\"deepmerge\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _tailwindMerge=require(\"tailwind-merge\");var _accordionContext=require(\"./AccordionContext\");var _theme=require(\"../../context/theme\");var _accordion=require(\"../../types/components/accordion\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i
=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var AccordionBody=_react.default.forwardRef(function(_param,ref){var className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"children\"]);var _useAccordion=(0,_accordionContext.useAccordion)(),open=_useAccordion.open,animate=_useAccordion.animate;var accordion=(0,_theme.useTheme)().accordion;var base=accordion.styles.base;className=className!==null&&className!==void 0?className:\"\";var bodyClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.body)),className);var heightAnimation={unmount:{height:\"0px\",transition:{duration:.2,times:[.4,0,.2,1]}},mount:{height:\"auto\",transition:{duration:.2,times:[.4,0,.2,1]}}};var mainAnimation={unmount:{transition:{duration:.3,ease:\"linear\"}},mount:{transition:{duration:.3,ease:\"linear\"}}};var appliedAnimation=(0,_deepmerge.default)(heightAnimation,animate);return _react.default.createElement(_framerMotion.LazyMotion,{features:_framerMotion.domAnimation},_react.default.createElement(_framerMotion.m.div,{className:\"overflow-hidden\",initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:appliedAnimation},_react.default.createElement(_framerMotion.m.div,_extends({},rest,{ref:ref,className:bodyClasses,initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:mainAnimation}),children)))});AccordionBody.propTypes={className:_accordion.propTypesClassName,children:_accordion.propTypesChildren};AccordionBody.displayName=\"MaterialTailwind.AccordionBody\";var _default=AccordionBody;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{AccordionContext:function(){return AccordionContext},useAccordion:function(){return useAccordion},AccordionContextProvider:function(){return AccordionContextProvider}});var _react=_interopRequireDefault(require(\"react\"));var _accordion=require(\"../../types/components/accordion\");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var AccordionContext=_react.default.createContext(null);AccordionContext.displayName=\"MaterialTailwind.AccordionContext\";function useAccordion(){var context=_react.default.useContext(AccordionContext);if(!context){throw new Error(\"useAccordion() must be used within an Accordion. It happens when you use AccordionHeader or AccordionBody components outside the Accordion component.\")}return context}var AccordionContextProvider=function(param){var value=param.value,children=param.children;return _react.default.createElement(AccordionContext.Provider,{value:value},children)};AccordionContextProvider.propTypes={value:_accordion.propTypesValue,children:_accordion.propTypesChildren};AccordionContextProvider.displayName=\"MaterialTailwind.AccordionContextProvider\";","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{AccordionHeader:function(){return AccordionHeader},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _accordionContext=require(\"./AccordionContext\");var _theme=require(\"../../context/theme\");var _accordion=require(\"../../types/components/accordion\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var AccordionHeader=_react.default.forwardRef(function(_param,ref){var className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"children\"]);var _useAccordion=(0,_accordionContext.useAccordion)(),open=_useAccordion.open,icon=_useAccordion.icon,disabled=_useAccordion.disabled;var accordion=(0,_theme.useTheme)().accordion;var base=accordion.styles.base;className=className!==null&&className!==void 0?className:\"\";var buttonStyles=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.header.initial),_defineProperty({},(0,_objectsToString.default)(base.header.active),open)),className);var iconClasses=(0,_classnames.default)((0,_objectsToString.default)(base.header.icon));return _react.default.createElement(\"button\",_extends({},rest,{ref:ref,type:\"button\",disabled:disabled,className:buttonStyles}),children,_react.default.createElement(\"span\",{className:iconClasses},icon!==null&&icon!==void 0?icon:open?_react.default.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",fill:\"currentColor\"},_react.default.createElement(\"path\",{fillRule:\"evenodd\",d:\"M5 10a1 1 0 011-1h8a1 1 0 110 2H6a1 1 0 01-1-1z\",clipRule:\"evenodd\"})):_react.default.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",viewBox:\"0 0 20 20\",fill:\"currentColor\"},_react.default.createElement(\"path\",{fillRule:\"evenodd\",d:\"M10 5a1 1 0 011 1v3h3a1 1 0 110 2h-3v3a1 1 0 11-2 0v-3H6a1 1 0 110-2h3V6a1 1 0 011-1z\",clipRule:\"evenodd\"}))))});AccordionHeader.propTypes={className:_accordion.propTypesClassName,children:_accordion.propTypesChildren};AccordionHeader.displayName=\"MaterialTailwind.AccordionHeader\";var _default=AccordionHeader;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Accordion:function(){return Accordion},AccordionHeader:function(){return _accordionHeader.AccordionHeader},AccordionBody:function(){return _accordionBody.AccordionBody},useAccordion:function(){return _accordionContext.useAccordion},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _accordionContext=require(\"./AccordionContext\");var _accordion=require(\"../../types/components/accordion\");var _accordionHeader=require(\"./AccordionHeader\");var _accordionBody=require(\"./AccordionBody\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Accordion=_react.default.forwardRef(function(_param,ref){var open=_param.open,icon=_param.icon,animate=_param.animate,className=_param.className,disabled=_param.disabled,children=_param.children,rest=_objectWithoutProperties(_param,[\"open\",\"icon\",\"animate\",\"className\",\"disabled\",\"children\"]);var accordion=(0,_theme.useTheme)().accordion;var defaultProps=accordion.defaultProps,base=accordion.styles.base;icon=icon!==null&&icon!==void 0?icon:defaultProps.icon;animate=animate!==null&&animate!==void 0?animate:defaultProps.animate;disabled=disabled!==null&&disabled!==void 0?disabled:defaultProps.disabled;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var accordionClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.container),_defineProperty({},(0,_objectsToString.default)(base.disabled),disabled)),className);var contextValue=_react.default.useMemo(function(){return{open:open,icon:icon,animate:animate,disabled:disabled}},[open,icon,animate,disabled]);return _react.default.createElement(_accordionContext.AccordionContextProvider,{value:contextValue},_react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:accordionClasses}),children))});Accordion.propTypes={open:_accordion.propTypesOpen,icon:_accordion.propTypesIcon,animate:_accordion.propTypesAnimate,disabled:_accordion.propTypesDisabled,className:_accordion.propTypesClassName,children:_accordion.propTypesChildren};Accordion.displayName=\"MaterialTailwind.Accordion\";var _default=Object.assign(Accordion,{Header:_accordionHeader.AccordionHeader,Body:_accordionBody.AccordionBody});","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Alert:function(){return Alert},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _framerMotion=require(\"framer-motion\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _deepmerge=_interopRequireDefault(require(\"deepmerge\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _alert=require(\"../../types/components/alert\");var _iconButton=_interopRequireDefault(require(\"../IconButton\"));function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Alert=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,color=_param.color,icon=_param.icon,open=_param.open,action=_param.action,onClose=_param.onClose,animate=_param.animate,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"variant\",\"color\",\"icon\",\"open\",\"action\",\"onClose\",\"animate\",\"className\",\"children\"]);var alert=(0,_theme.useTheme)().alert;var defaultProps=alert.defaultProps,valid=alert.valid,styles=alert.styles;var base=styles.base,variants=styles.variants;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;color=color!==null&&color!==void 0?color:defaultProps.color;animate=animate!==null&&animate!==void 0?animate:defaultProps.animate;open=open!==null&&open!==void 0?open:defaultProps.open;action=action!==null&&action!==void 0?action:defaultProps.action;onClose=onClose!==null&&onClose!==void 0?onClose:defaultProps.onClose;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var alertBase=(0,_objectsToString.default)(base.alert);var alertAction=(0,_objectsToString.default)(base.action);var alertVariant=(0,_objectsToString.default)(variants[(0,_findMatch.default)(valid.variants,variant,\"filled\")][(0,_findMatch.default)(valid.colors,color,\"gray\")]);var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)(alertBase,alertVariant),className);var actionClasses=(0,_classnames.default)(alertAction);var mainAnimation={unmount:{opacity:0},mount:{opacity:1}};var appliedAnimation=(0,_deepmerge.default)(mainAnimation,animate);var iconTemplate=_react.default.createElement(\"div\",{className:\"shrink-0\"},icon);var NewAnimatePresence=_framerMotion.AnimatePresence;return _react.default.createElement(_framerMotion.LazyMotion,{features:_framerMotion.domAnimation},_react.default.createElement(NewAnimatePresence,null,open&&_react.default.createElement(_framerMotion.m.div,_extends({},rest,{ref:ref,role:\"alert\",className:\"\".concat(classes,\" flex\"),initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:appliedAnimation}),icon&&iconTemplate,_react.default.createElement(\"div\",{className:\"\".concat(icon?\"ml-3\":\"\",\" mr-12\")},children),onClose&&!action&&_react.default.createElement(_iconButton.default,{onClick:onClose,size:\"sm\",variant:\"text\",color:variant===\"outlined\"||variant===\"ghost\"?color:\"white\",className:actionClasses},_react.default.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",fill:\"none\",viewBox:\"0 0 24 24\",stroke:\"currentColor\",className:\"h-6 w-6\",strokeWidth:2},_react.default.createElement(\"path\",{strokeLinecap:\"round\",strokeLinejoin:\"round\",d:\"M6 18L18 6M6 6l12 12\"}))),action||null)))});Alert.propTypes={variant:_propTypes.default.oneOf(_alert.propTypesVariant),color:_propTypes.default.oneOf(_alert.propTypesColor),icon:_alert.propTypesIcon,open:_alert.propTypesOpen,action:_alert.propTypesAction,onClose:_alert.propTypesOnClose,animate:_alert.propTypesAnimate,className:_alert.propTypesClassName,children:_alert.propTypesChildren};Alert.displayName=\"MaterialTailwind.Alert\";var _default=Alert;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Avatar:function(){return Avatar},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _avatar=require(\"../../types/components/avatar\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Avatar=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,size=_param.size,className=_param.className,color=_param.color,withBorder=_param.withBorder,rest=_objectWithoutProperties(_param,[\"variant\",\"size\",\"className\",\"color\",\"withBorder\"]);var avatar=(0,_theme.useTheme)().avatar;var valid=avatar.valid,defaultProps=avatar.defaultProps,styles=avatar.styles;var base=styles.base,variants=styles.variants,sizes=styles.sizes,borderColor=styles.borderColor;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;size=size!==null&&size!==void 0?size:defaultProps.size;withBorder=withBorder!==null&&withBorder!==void 0?withBorder:defaultProps.withBorder;color=color!==null&&color!==void 0?color:defaultProps.color;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var avatarVariant=(0,_objectsToString.default)(variants[(0,_findMatch.default)(valid.variants,variant,\"rounded\")]);var avatarSize=(0,_objectsToString.default)(sizes[(0,_findMatch.default)(valid.sizes,size,\"md\")]);var avatarBorderColor=(0,_objectsToString.default)(borderColor[(0,_findMatch.default)(valid.colors,color,\"gray\")]);var _obj;var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.initial),avatarVariant,avatarSize,(_obj={},_defineProperty(_obj,(0,_objectsToString.default)(base.withBorder),withBorder),_defineProperty(_obj,avatarBorderColor,withBorder),_obj)),className);return _react.default.createElement(\"img\",_extends({},rest,{ref:ref,className:classes}))});Avatar.propTypes={variant:_propTypes.default.oneOf(_avatar.propTypesVariant),size:_propTypes.default.oneOf(_avatar.propTypesSize),className:_avatar.propTypesClassName,withBorder:_avatar.propTypesWithBorder,color:_propTypes.default.oneOf(_avatar.propTypesColor)};Avatar.displayName=\"MaterialTailwind.Avatar\";var _default=Avatar;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Badge:function(){return Badge},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _deepmerge=_interopRequireDefault(require(\"deepmerge\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _badge=require(\"../../types/components/badge\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Badge=_react.default.forwardRef(function(_param,ref){var color=_param.color,invisible=_param.invisible,withBorder=_param.withBorder,overlap=_param.overlap,placement=_param.placement,className=_param.className,content=_param.content,children=_param.children,containerProps=_param.containerProps,containerRef=_param.containerRef,rest=_objectWithoutProperties(_param,[\"color\",\"invisible\",\"withBorder\",\"overlap\",\"placement\",\"className\",\"content\",\"children\",\"containerProps\",\"containerRef\"]);var badge=(0,_theme.useTheme)().badge;var valid=badge.valid,defaultProps=badge.defaultProps,styles=badge.styles;var base=styles.base,placements=styles.placements,colors=styles.colors;color=color!==null&&color!==void 0?color:defaultProps.color;invisible=invisible!==null&&invisible!==void 0?invisible:defaultProps.invisible;withBorder=withBorder!==null&&withBorder!==void 0?withBorder:defaultProps.withBorder;overlap=overlap!==null&&overlap!==void 0?overlap:defaultProps.overlap;placement=placement!==null&&placement!==void 0?placement:defaultProps.placement;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var _merge;containerProps=(_merge=(0,_deepmerge.default)(containerProps,defaultProps.containerProps||{}))!==null&&_merge!==void 0?_merge:defaultProps.containerProps;var badgeInitialClasses=(0,_objectsToString.default)(base.badge.initial);var badgeWithBorderClasses=(0,_objectsToString.default)(base.badge.withBorder);var badgeWithContentClasses=(0,_objectsToString.default)(base.badge.withContent);var badgeColorClasses=(0,_objectsToString.default)(colors[(0,_findMatch.default)(valid.colors,color,\"red\")]);var badgePlacementClasses=(0,_objectsToString.default)(placements[(0,_findMatch.default)(valid.placements,placement,\"top-end\")][(0,_findMatch.default)(valid.overlaps,overlap,\"square\")]);var _obj;var badgeClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)(badgeInitialClasses,badgePlacementClasses,badgeColorClasses,(_obj={},_defineProperty(_obj,badgeWithBorderClasses,withBorder),_defineProperty(_obj,badgeWithContentClasses,content),_obj)),className);var badgeContainerClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.container),containerProps===null||containerProps===void 0?void 0:containerProps.className));return _react.default.createElement(\"div\",_extends({ref:containerRef},containerProps,{className:badgeContainerClasses}),children,!invisible&&_react.default.createElement(\"span\",_extends({},rest,{ref:ref,className:badgeClasses}),content))});Badge.propTypes={color:_propTypes.default.oneOf(_badge.propTypesColor),invisible:_badge.propTypesInvisible,withBorder:_badge.propTypesWithBorder,overlap:_propTypes.default.oneOf(_badge.propTypesOverlap),className:_badge.propTypesClassName,content:_badge.propTypesContent,children:_badge.propTypesChildren,placement:_propTypes.default.oneOf(_badge.propTypesPlacement),containerProps:_badge.propTypesContainerProps,containerRef:_badge.propTypesContainerRef};Badge.displayName=\"MaterialTailwind.Badge\";var _default=Badge;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Breadcrumbs:function(){return Breadcrumbs},default:function(){return _default}});var _react=_interopRequireWildcard(require(\"react\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _breadcrumbs=require(\"../../types/components/breadcrumbs\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Breadcrumbs=(0,_react.forwardRef)(function(_param,ref){var separator=_param.separator,fullWidth=_param.fullWidth,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"separator\",\"fullWidth\",\"className\",\"children\"]);var breadcrumbs=(0,_theme.useTheme)().breadcrumbs;var defaultProps=breadcrumbs.defaultProps,base=breadcrumbs.styles.base;separator=separator!==null&&separator!==void 0?separator:defaultProps.separator;fullWidth=fullWidth!==null&&fullWidth!==void 0?fullWidth:defaultProps.fullWidth;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var breadcrumbsRootClasses=(0,_classnames.default)((0,_objectsToString.default)(base.root.initial),_defineProperty({},(0,_objectsToString.default)(base.root.fullWidth),fullWidth));var breadcrumbsListClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.list)),className);var breadcrumbsItemClasses=(0,_classnames.default)((0,_objectsToString.default)(base.item.initial));var breadcrumbsSeparatorClasses=(0,_classnames.default)((0,_objectsToString.default)(base.separator));return _react.default.createElement(\"nav\",{\"aria-label\":\"breadcrumb\",className:breadcrumbsRootClasses},_react.default.createElement(\"ol\",_extends({},rest,{ref:ref,className:breadcrumbsListClasses}),_react.Children.map(children,function(child,index){if((0,_react.isValidElement)(child)){var _child_props;return _react.default.createElement(\"li\",{className:(0,_classnames.default)(breadcrumbsItemClasses,_defineProperty({},(0,_objectsToString.default)(base.item.disabled),child===null||child===void 0?void 0:(_child_props=child.props)===null||_child_props===void 0?void 0:_child_props.disabled))},child,index!==_react.Children.count(children)-1&&_react.default.createElement(\"span\",{className:breadcrumbsSeparatorClasses},separator))}return null})))});Breadcrumbs.propTypes={separator:_breadcrumbs.propTypesSeparator,fullWidth:_breadcrumbs.propTypesFullWidth,className:_breadcrumbs.propTypesClassName,children:_breadcrumbs.propTypesChildren};Breadcrumbs.displayName=\"MaterialTailwind.Breadcrumbs\";var _default=Breadcrumbs;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Button:function(){return Button},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _materialRippleEffects=_interopRequireDefault(require(\"material-ripple-effects\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _spinner=_interopRequireDefault(require(\"../Spinner\"));var _button=require(\"../../types/components/button\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Button=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,size=_param.size,color=_param.color,fullWidth=_param.fullWidth,ripple=_param.ripple,className=_param.className,children=_param.children,loading=_param.loading,rest=_objectWithoutProperties(_param,[\"variant\",\"size\",\"color\",\"fullWidth\",\"ripple\",\"className\",\"children\",\"loading\"]);var button=(0,_theme.useTheme)().button;var valid=button.valid,defaultProps=button.defaultProps,styles=button.styles;var base=styles.base,variants=styles.variants,sizes=styles.sizes;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;size=size!==null&&size!==void 0?size:defaultProps.size;color=color!==null&&color!==void 0?color:defaultProps.color;fullWidth=fullWidth!==null&&fullWidth!==void 0?fullWidth:defaultProps.fullWidth;ripple=ripple!==null&&ripple!==void 0?ripple:defaultProps.ripple;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var rippleEffect=ripple!==undefined&&new _materialRippleEffects.default;var buttonBase=(0,_objectsToString.default)(base.initial);var buttonVariant=(0,_objectsToString.default)(variants[(0,_findMatch.default)(valid.variants,variant,\"filled\")][(0,_findMatch.default)(valid.colors,color,\"gray\")]);var buttonSize=(0,_objectsToString.default)(sizes[(0,_findMatch.default)(valid.sizes,size,\"md\")]);var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)(buttonBase,buttonSize,buttonVariant,_defineProperty({},(0,_objectsToString.default)(base.fullWidth),fullWidth),{\"flex items-center gap-2\":loading,\"gap-3\":size===\"lg\"}),className);var spinnerClass=(0,_tailwindMerge.twMerge)((0,_classnames.default)({\"w-4 h-4\":true,\"w-5 h-5\":size===\"lg\"}));var _rest_disabled;return _react.default.createElement(\"button\",_extends({},rest,{disabled:(_rest_disabled=rest.disabled)!==null&&_rest_disabled!==void 0?_rest_disabled:loading,ref:ref,className:classes,type:rest.type||\"button\",onMouseDown:function(e){var onMouseDown=rest===null||rest===void 0?void 0:rest.onMouseDown;if(ripple){rippleEffect.create(e,(variant===\"filled\"||variant===\"gradient\")&&color!==\"white\"?\"light\":\"dark\")}return typeof onMouseDown===\"function\"&&onMouseDown(e)}}),loading&&_react.default.createElement(_spinner.default,{className:spinnerClass}),children)});Button.propTypes={variant:_propTypes.default.oneOf(_button.propTypesVariant),size:_propTypes.default.oneOf(_button.propTypesSize),color:_propTypes.default.oneOf(_button.propTypesColor),fullWidth:_button.propTypesFullWidth,ripple:_button.propTypesRipple,className:_button.propTypesClassName,children:_button.propTypesChildren,loading:_button.propTypesLoading};Button.displayName=\"MaterialTailwind.Button\";var _default=Button;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{ButtonGroup:function(){return ButtonGroup},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _button=require(\"../../types/components/button\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var ButtonGroup=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,size=_param.size,color=_param.color,fullWidth=_param.fullWidth,ripple=_param.ripple,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"variant\",\"size\",\"color\",\"fullWidth\",\"ripple\",\"className\",\"children\"]);var buttonGroup=(0,_theme.useTheme)().buttonGroup;var defaultProps=buttonGroup.defaultProps,styles=buttonGroup.styles,valid=buttonGroup.valid;var base=styles.base,dividerColor=styles.dividerColor;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;size=size!==null&&size!==void 0?size:defaultProps.size;color=color!==null&&color!==void 0?color:defaultProps.color;ripple=ripple!==null&&ripple!==void 0?ripple:defaultProps.ripple;fullWidth=fullWidth!==null&&fullWidth!==void 0?fullWidth:defaultProps.fullWidth;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var _obj;var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.initial),(_obj={},_defineProperty(_obj,(0,_objectsToString.default)(base.fullWidth),fullWidth),_defineProperty(_obj,\"divide-x\",variant!==\"outlined\"),_defineProperty(_obj,(0,_objectsToString.default)(dividerColor[(0,_findMatch.default)(valid.colors,color,\"gray\")]),variant!==\"outlined\"),_obj)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:classes}),_react.default.Children.map(children,function(child,index){var _child_props;return _react.default.isValidElement(child)&&_react.default.cloneElement(child,{variant:variant,size:size,color:color,ripple:ripple,fullWidth:fullWidth,className:(0,_tailwindMerge.twMerge)((0,_classnames.default)({\"rounded-r-none\":index!==_react.default.Children.count(children)-1,\"border-r-0\":index!==_react.default.Children.count(children)-1,\"rounded-l-none\":index!==0}),(_child_props=child.props)===null||_child_props===void 0?void 0:_child_props.className)})}))});ButtonGroup.propTypes={variant:_propTypes.default.oneOf(_button.propTypesVariant),size:_propTypes.default.oneOf(_button.propTypesSize),color:_propTypes.default.oneOf(_button.propTypesColor),fullWidth:_button.propTypesFullWidth,ripple:_button.propTypesRipple,className:_button.propTypesClassName,children:_button.propTypesChildren};ButtonGroup.displayName=\"MaterialTailwind.ButtonGroup\";var _default=ButtonGroup;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{CardBody:function(){return CardBody},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _card=require(\"../../types/components/card\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var CardBody=_react.default.forwardRef(function(_param,ref){var className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"children\"]);var cardBody=(0,_theme.useTheme)().cardBody;var defaultProps=cardBody.defaultProps,base=cardBody.styles.base;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var cardBodyClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:cardBodyClasses}),children)});CardBody.propTypes={className:_card.propTypesClassName,children:_card.propTypesChildren};CardBody.displayName=\"MaterialTailwind.CardBody\";var _default=CardBody;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{CardFooter:function(){return CardFooter},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _card=require(\"../../types/components/card\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var CardFooter=_react.default.forwardRef(function(_param,ref){var divider=_param.divider,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"divider\",\"className\",\"children\"]);var cardFooter=(0,_theme.useTheme)().cardFooter;var defaultProps=cardFooter.defaultProps,base=cardFooter.styles.base;divider=divider!==null&÷r!==void 0?divider:defaultProps.divider;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var cardFooterClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.initial),_defineProperty({},(0,_objectsToString.default)(base.divider),divider)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:cardFooterClasses}),children)});CardFooter.propTypes={divider:_card.propTypesDivider,className:_card.propTypesClassName,children:_card.propTypesChildren};CardFooter.displayName=\"MaterialTailwind.CardFooter\";var _default=CardFooter;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{CardHeader:function(){return CardHeader},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _card=require(\"../../types/components/card\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var CardHeader=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,color=_param.color,shadow=_param.shadow,floated=_param.floated,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"variant\",\"color\",\"shadow\",\"floated\",\"className\",\"children\"]);var cardHeader=(0,_theme.useTheme)().cardHeader;var defaultProps=cardHeader.defaultProps,styles=cardHeader.styles,valid=cardHeader.valid;var base=styles.base,variants=styles.variants;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;color=color!==null&&color!==void 0?color:defaultProps.color;shadow=shadow!==null&&shadow!==void 0?shadow:defaultProps.shadow;floated=floated!==null&&floated!==void 0?floated:defaultProps.floated;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var cardHeaderRoot=(0,_objectsToString.default)(base.initial);var cardHeaderVariant=(0,_objectsToString.default)(variants[(0,_findMatch.default)(valid.variants,variant,\"filled\")][(0,_findMatch.default)(valid.colors,color,\"white\")]);var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)(cardHeaderRoot,cardHeaderVariant,_defineProperty({},(0,_objectsToString.default)(base.shadow),shadow),_defineProperty({},(0,_objectsToString.default)(base.floated),floated)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:classes}),children)});CardHeader.propTypes={variant:_propTypes.default.oneOf(_card.propTypesVariant),color:_propTypes.default.oneOf(_card.propTypesColor),shadow:_card.propTypesShadow,floated:_card.propTypesFloated,className:_card.propTypesClassName,children:_card.propTypesChildren};CardHeader.displayName=\"MaterialTailwind.CardHeader\";var _default=CardHeader;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Card:function(){return Card},CardHeader:function(){return _cardHeader.CardHeader},CardBody:function(){return _cardBody.CardBody},CardFooter:function(){return _cardFooter.CardFooter},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _cardHeader=require(\"./CardHeader\");var _cardBody=require(\"./CardBody\");var _cardFooter=require(\"./CardFooter\");var _card=require(\"../../types/components/card\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Card=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,color=_param.color,shadow=_param.shadow,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"variant\",\"color\",\"shadow\",\"className\",\"children\"]);var card=(0,_theme.useTheme)().card;var defaultProps=card.defaultProps,styles=card.styles,valid=card.valid;var base=styles.base,variants=styles.variants;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;color=color!==null&&color!==void 0?color:defaultProps.color;shadow=shadow!==null&&shadow!==void 0?shadow:defaultProps.shadow;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var cardRoot=(0,_objectsToString.default)(base.initial);var cardVariant=(0,_objectsToString.default)(variants[(0,_findMatch.default)(valid.variants,variant,\"filled\")][(0,_findMatch.default)(valid.colors,color,\"white\")]);var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)(cardRoot,cardVariant,_defineProperty({},(0,_objectsToString.default)(base.shadow),shadow)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:classes}),children)});Card.propTypes={variant:_propTypes.default.oneOf(_card.propTypesVariant),color:_propTypes.default.oneOf(_card.propTypesColor),shadow:_card.propTypesShadow,className:_card.propTypesClassName,children:_card.propTypesChildren};Card.displayName=\"MaterialTailwind.Card\";var _default=Object.assign(Card,{Header:_cardHeader.CardHeader,Body:_cardBody.CardBody,Footer:_cardFooter.CardFooter});","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Carousel:function(){return Carousel},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _framerMotion=require(\"framer-motion\");var _react1=require(\"@floating-ui/react\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _carousel=require(\"../../types/components/carousel\");function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}function _slicedToArray(arr,i){return _arrayWithHoles(arr)||_iterableToArrayLimit(arr,i)||_unsupportedIterableToArray(arr,i)||_nonIterableRest()}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o===\"string\")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n===\"Object\"&&o.constructor)n=o.constructor.name;if(n===\"Map\"||n===\"Set\")return Array.from(n);if(n===\"Arguments\"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}var Carousel=_react.default.forwardRef(function(_param,ref){var children=_param.children,prevArrow=_param.prevArrow,nextArrow=_param.nextArrow,navigation=_param.navigation,autoplay=_param.autoplay,autoplayDelay=_param.autoplayDelay,transition=_param.transition,loop=_param.loop,className=_param.className,slideRef=_param.slideRef,rest=_objectWithoutProperties(_param,[\"children\",\"prevArrow\",\"nextArrow\",\"navigation\",\"autoplay\",\"autoplayDelay\",\"transition\",\"loop\",\"className\",\"slideRef\"]);var carousel=(0,_theme.useTheme)().carousel;var defaultProps=carousel.defaultProps,base=carousel.styles.base;var x=(0,_framerMotion.useMotionValue)(0);var containerRef=_react.default.useRef(null);var _React_useState=_slicedToArray(_react.default.useState(0),2),index=_React_useState[0],setIndex=_React_useState[1];var childrens=_react.default.Children.toArray(children);prevArrow=prevArrow!==null&&prevArrow!==void 0?prevArrow:defaultProps.prevArrow;nextArrow=nextArrow!==null&&nextArrow!==void 0?nextArrow:defaultProps.nextArrow;navigation=navigation!==null&&navigation!==void 0?navigation:defaultProps.navigation;autoplay=autoplay!==null&&autoplay!==void 0?autoplay:defaultProps.autoplay;autoplayDelay=autoplayDelay!==null&&autoplayDelay!==void 0?autoplayDelay:defaultProps.autoplayDelay;transition=transition!==null&&transition!==void 0?transition:defaultProps.transition;loop=loop!==null&&loop!==void 0?loop:defaultProps.loop;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var carouselClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.carousel)),className);var slideClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.slide)));var calculateNewX=_react.default.useCallback(function(){var _containerRef_current;return-index*(((_containerRef_current=containerRef.current)===null||_containerRef_current===void 0?void 0:_containerRef_current.clientWidth)||0)},[index]);var handleNext=_react.default.useCallback(function(){var idx=loop?0:index;setIndex(index+1===childrens.length?idx:index+1)},[index,loop,childrens.length]);var handlePrev=function(){var idx=loop?childrens.length-1:0;setIndex(index-1<0?idx:index-1)};_react.default.useEffect(function(){var controls=(0,_framerMotion.animate)(x,calculateNewX(),transition);return controls.stop},[calculateNewX,index,x,transition]);_react.default.useEffect(function(){window.addEventListener(\"resize\",function(){(0,_framerMotion.animate)(x,calculateNewX(),transition)})},[calculateNewX,transition,x]);_react.default.useEffect(function(){if(!autoplay){return}var timer=setInterval(function(){return handleNext()},autoplayDelay);return function(){return clearInterval(timer)}},[autoplay,handleNext,autoplayDelay]);var mergedRefs=(0,_react1.useMergeRefs)([containerRef,ref]);return _react.default.createElement(\"div\",_extends({},rest,{ref:mergedRefs,className:carouselClasses}),childrens.map(function(child,i){return _react.default.createElement(_framerMotion.LazyMotion,{key:i,features:_framerMotion.domAnimation},_react.default.createElement(_framerMotion.m.div,{ref:slideRef,className:slideClasses,style:{x:x,left:\"\".concat(i*100,\"%\"),right:\"\".concat(i*100,\"%\")}},child))}),prevArrow&&prevArrow({loop:loop,handlePrev:handlePrev,activeIndex:index,firstIndex:index===0}),nextArrow&&nextArrow({loop:loop,handleNext:handleNext,activeIndex:index,lastIndex:index===childrens.length-1}),navigation&&navigation({setActiveIndex:setIndex,activeIndex:index,length:childrens.length}))});Carousel.propTypes={className:_carousel.propTypesClassName,children:_carousel.propTypesChildren,nextArrow:_carousel.propTypesNextArrow,prevArrow:_carousel.propTypesPrevArrow,navigation:_carousel.propTypesNavigation,autoplay:_carousel.propTypesAutoplay,autoplayDelay:_carousel.propTypesAutoplayDelay,transition:_carousel.propTypesTransition,loop:_carousel.propTypesLoop,slideRef:_carousel.propTypesSlideRef};Carousel.displayName=\"MaterialTailwind.Carousel\";var _default=Carousel;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Checkbox:function(){return Checkbox},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _materialRippleEffects=_interopRequireDefault(require(\"material-ripple-effects\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _checkbox=require(\"../../types/components/checkbox\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Checkbox=_react.default.forwardRef(function(_param,ref){var color=_param.color,label=_param.label,icon=_param.icon,ripple=_param.ripple,className=_param.className,disabled=_param.disabled,containerProps=_param.containerProps,labelProps=_param.labelProps,iconProps=_param.iconProps,inputRef=_param.inputRef,rest=_objectWithoutProperties(_param,[\"color\",\"label\",\"icon\",\"ripple\",\"className\",\"disabled\",\"containerProps\",\"labelProps\",\"iconProps\",\"inputRef\"]);var checkbox=(0,_theme.useTheme)().checkbox;var defaultProps=checkbox.defaultProps,valid=checkbox.valid,styles=checkbox.styles;var base=styles.base,colors=styles.colors;var checkboxId=_react.default.useId();color=color!==null&&color!==void 0?color:defaultProps.color;label=label!==null&&label!==void 0?label:defaultProps.label;icon=icon!==null&&icon!==void 0?icon:defaultProps.icon;ripple=ripple!==null&&ripple!==void 0?ripple:defaultProps.ripple;disabled=disabled!==null&&disabled!==void 0?disabled:defaultProps.disabled;containerProps=containerProps!==null&&containerProps!==void 0?containerProps:defaultProps.containerProps;labelProps=labelProps!==null&&labelProps!==void 0?labelProps:defaultProps.labelProps;iconProps=iconProps!==null&&iconProps!==void 0?iconProps:defaultProps.iconProps;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var rippleEffect=ripple!==undefined&&new _materialRippleEffects.default;var rootClasses=(0,_classnames.default)((0,_objectsToString.default)(base.root),_defineProperty({},(0,_objectsToString.default)(base.disabled),disabled));var containerClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.container)),containerProps===null||containerProps===void 0?void 0:containerProps.className);var inputClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.input),(0,_objectsToString.default)(colors[(0,_findMatch.default)(valid.colors,color,\"gray\")])),className);var labelClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.label)),labelProps===null||labelProps===void 0?void 0:labelProps.className);var iconContainerClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.icon)),iconProps===null||iconProps===void 0?void 0:iconProps.className);return _react.default.createElement(\"div\",{ref:ref,className:rootClasses},_react.default.createElement(\"label\",_extends({},containerProps,{className:containerClasses,htmlFor:rest.id||checkboxId,onMouseDown:function(e){var onMouseDown=containerProps===null||containerProps===void 0?void 0:containerProps.onMouseDown;if(ripple){rippleEffect.create(e,\"dark\")}return typeof onMouseDown===\"function\"&&onMouseDown(e)}}),_react.default.createElement(\"input\",_extends({},rest,{ref:inputRef,type:\"checkbox\",disabled:disabled,className:inputClasses,id:rest.id||checkboxId})),_react.default.createElement(\"span\",{className:iconContainerClasses},icon||_react.default.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",className:\"h-3.5 w-3.5\",viewBox:\"0 0 20 20\",fill:\"currentColor\",stroke:\"currentColor\",strokeWidth:1},_react.default.createElement(\"path\",{fillRule:\"evenodd\",d:\"M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z\",clipRule:\"evenodd\"})))),label&&_react.default.createElement(\"label\",_extends({},labelProps,{className:labelClasses,htmlFor:rest.id||checkboxId}),label))});Checkbox.propTypes={color:_propTypes.default.oneOf(_checkbox.propTypesColor),label:_checkbox.propTypesLabel,icon:_checkbox.propTypesIcon,ripple:_checkbox.propTypesRipple,className:_checkbox.propTypesClassName,disabled:_checkbox.propTypesDisabled,containerProps:_checkbox.propTypesObject,labelProps:_checkbox.propTypesObject};Checkbox.displayName=\"MaterialTailwind.Checkbox\";var _default=Checkbox;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Chip:function(){return Chip},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _framerMotion=require(\"framer-motion\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _deepmerge=_interopRequireDefault(require(\"deepmerge\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _chip=require(\"../../types/components/chip\");var _iconButton=_interopRequireDefault(require(\"../IconButton\"));function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Chip=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,size=_param.size,color=_param.color,icon=_param.icon,open=_param.open,onClose=_param.onClose,action=_param.action,animate=_param.animate,className=_param.className,value=_param.value,rest=_objectWithoutProperties(_param,[\"variant\",\"size\",\"color\",\"icon\",\"open\",\"onClose\",\"action\",\"animate\",\"className\",\"value\"]);var chip=(0,_theme.useTheme)().chip;var defaultProps=chip.defaultProps,valid=chip.valid,styles=chip.styles;var base=styles.base,variants=styles.variants,sizes=styles.sizes;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;size=size!==null&&size!==void 0?size:defaultProps.size;color=color!==null&&color!==void 0?color:defaultProps.color;animate=animate!==null&&animate!==void 0?animate:defaultProps.animate;open=open!==null&&open!==void 0?open:defaultProps.open;action=action!==null&&action!==void 0?action:defaultProps.action;onClose=onClose!==null&&onClose!==void 0?onClose:defaultProps.onClose;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var chipBase=(0,_objectsToString.default)(base.chip);var chipAction=(0,_objectsToString.default)(base.action);var chipIcon=(0,_objectsToString.default)(base.icon);var chipVariant=(0,_objectsToString.default)(variants[(0,_findMatch.default)(valid.variants,variant,\"filled\")][(0,_findMatch.default)(valid.colors,color,\"gray\")]);var chipSize=(0,_objectsToString.default)(sizes[(0,_findMatch.default)(valid.sizes,size,\"md\")][\"chip\"]);var actionSize=(0,_objectsToString.default)(sizes[(0,_findMatch.default)(valid.sizes,size,\"md\")][\"action\"]);var iconSize=(0,_objectsToString.default)(sizes[(0,_findMatch.default)(valid.sizes,size,\"md\")][\"icon\"]);var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)(chipBase,chipVariant,chipSize),className);var actionClasses=(0,_classnames.default)(chipAction,actionSize);var iconClasses=(0,_classnames.default)(chipIcon,iconSize);var contentClasses=(0,_classnames.default)({\"ml-4\":icon&&size===\"sm\",\"ml-[18px]\":icon&&size===\"md\",\"ml-5\":icon&&size===\"lg\",\"mr-5\":onClose});var mainAnimation={unmount:{opacity:0},mount:{opacity:1}};var appliedAnimation=(0,_deepmerge.default)(mainAnimation,animate);var iconTemplate=_react.default.createElement(\"div\",{className:iconClasses},icon);var NewAnimatePresence=_framerMotion.AnimatePresence;return _react.default.createElement(_framerMotion.LazyMotion,{features:_framerMotion.domAnimation},_react.default.createElement(NewAnimatePresence,null,open&&_react.default.createElement(_framerMotion.m.div,_extends({},rest,{ref:ref,className:classes,initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:appliedAnimation}),icon&&iconTemplate,_react.default.createElement(\"span\",{className:contentClasses},value),onClose&&!action&&_react.default.createElement(_iconButton.default,{onClick:onClose,size:\"sm\",variant:\"text\",color:variant===\"outlined\"||variant===\"ghost\"?color:\"white\",className:actionClasses},_react.default.createElement(\"svg\",{xmlns:\"http://www.w3.org/2000/svg\",fill:\"none\",viewBox:\"0 0 24 24\",stroke:\"currentColor\",className:(0,_classnames.default)({\"h-3.5 w-3.5\":size===\"sm\",\"h-4 w-4\":size===\"md\",\"h-5 w-5\":size===\"lg\"}),strokeWidth:2},_react.default.createElement(\"path\",{strokeLinecap:\"round\",strokeLinejoin:\"round\",d:\"M6 18L18 6M6 6l12 12\"}))),action||null)))});Chip.propTypes={variant:_propTypes.default.oneOf(_chip.propTypesVariant),size:_propTypes.default.oneOf(_chip.propTypesSize),color:_propTypes.default.oneOf(_chip.propTypesColor),icon:_chip.propTypesIcon,open:_chip.propTypesOpen,onClose:_chip.propTypesOnClose,action:_chip.propTypesAction,animate:_chip.propTypesAnimate,className:_chip.propTypesClassName,value:_chip.propTypesValue};Chip.displayName=\"MaterialTailwind.Chip\";var _default=Chip;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Collapse:function(){return Collapse},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _framerMotion=require(\"framer-motion\");var _react1=require(\"@floating-ui/react\");var _deepmerge=_interopRequireDefault(require(\"deepmerge\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _collapse=require(\"../../types/components/collapse\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Collapse=_react.default.forwardRef(function(_param,ref){var open=_param.open,animate=_param.animate,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"open\",\"animate\",\"className\",\"children\"]);var mobileNavRef=_react.default.useRef(null);var collapse=(0,_theme.useTheme)().collapse;var styles=collapse.styles;var base=styles.base;animate=animate!==null&&animate!==void 0?animate:{};className=className!==null&&className!==void 0?className:\"\";var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base)),className);var mainAnimation={unmount:{height:\"0px\",transition:{duration:.3,times:[.4,0,.2,1]}},mount:{height:\"auto\",transition:{duration:.3,times:[.4,0,.2,1]}}};var appliedAnimation=(0,_deepmerge.default)(mainAnimation,animate);var NewAnimatePresence=_framerMotion.AnimatePresence;var mergedRef=(0,_react1.useMergeRefs)([ref,mobileNavRef]);return _react.default.createElement(_framerMotion.LazyMotion,{features:_framerMotion.domAnimation},_react.default.createElement(NewAnimatePresence,null,_react.default.createElement(_framerMotion.m.div,_extends({},rest,{ref:mergedRef,className:classes,initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:appliedAnimation}),children)))});Collapse.displayName=\"MaterialTailwind.Collapse\";Collapse.propTypes={open:_collapse.propTypesOpen,animate:_collapse.propTypesAnimate,className:_collapse.propTypesClassName,children:_collapse.propTypesChildren};var _default=Collapse;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{DialogBody:function(){return DialogBody},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _dialog=require(\"../../types/components/dialog\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var DialogBody=_react.default.forwardRef(function(_param,ref){var divider=_param.divider,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"divider\",\"className\",\"children\"]);var dialogBody=(0,_theme.useTheme)().dialogBody;var defaultProps=dialogBody.defaultProps,base=dialogBody.styles.base;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var dialogBodyClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.initial),_defineProperty({},(0,_objectsToString.default)(base.divider),divider)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:dialogBodyClasses}),children)});DialogBody.propTypes={divider:_dialog.propTypesDivider,className:_dialog.propTypesClassName,children:_dialog.propTypesChildren};DialogBody.displayName=\"MaterialTailwind.DialogBody\";var _default=DialogBody;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{DialogFooter:function(){return DialogFooter},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _dialog=require(\"../../types/components/dialog\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var DialogFooter=_react.default.forwardRef(function(_param,ref){var className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"children\"]);var dialogFooter=(0,_theme.useTheme)().dialogFooter;var defaultProps=dialogFooter.defaultProps,base=dialogFooter.styles.base;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var dialogFooterClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:dialogFooterClasses}),children)});DialogFooter.propTypes={className:_dialog.propTypesClassName,children:_dialog.propTypesChildren};DialogFooter.displayName=\"MaterialTailwind.DialogFooter\";var _default=DialogFooter;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{DialogHeader:function(){return DialogHeader},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _dialog=require(\"../../types/components/dialog\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var DialogHeader=_react.default.forwardRef(function(_param,ref){var className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"children\"]);var dialogHeader=(0,_theme.useTheme)().dialogHeader;var defaultProps=dialogHeader.defaultProps,base=dialogHeader.styles.base;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var dialogHeaderClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:dialogHeaderClasses}),children)});DialogHeader.propTypes={className:_dialog.propTypesClassName,children:_dialog.propTypesChildren};DialogHeader.displayName=\"MaterialTailwind.DialogHeader\";var _default=DialogHeader;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Dialog:function(){return Dialog},DialogHeader:function(){return _dialogHeader.DialogHeader},DialogBody:function(){return _dialogBody.DialogBody},DialogFooter:function(){return _dialogFooter.DialogFooter},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _react1=require(\"@floating-ui/react\");var _framerMotion=require(\"framer-motion\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _deepmerge=_interopRequireDefault(require(\"deepmerge\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _dialog=require(\"../../types/components/dialog\");var _dialogHeader=require(\"./DialogHeader\");var _dialogBody=require(\"./DialogBody\");var _dialogFooter=require(\"./DialogFooter\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Dialog=_react.default.forwardRef(function(_param,ref){var open=_param.open,handler=_param.handler,size=_param.size,dismiss=_param.dismiss,animate=_param.animate,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"open\",\"handler\",\"size\",\"dismiss\",\"animate\",\"className\",\"children\"]);var dialog=(0,_theme.useTheme)().dialog;var defaultProps=dialog.defaultProps,valid=dialog.valid,_dialog_styles=dialog.styles,base=_dialog_styles.base,sizes=_dialog_styles.sizes;handler=handler!==null&&handler!==void 0?handler:undefined;size=size!==null&&size!==void 0?size:defaultProps.size;dismiss=dismiss!==null&&dismiss!==void 0?dismiss:defaultProps.dismiss;animate=animate!==null&&animate!==void 0?animate:defaultProps.animate;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var backdropClasses=(0,_classnames.default)((0,_objectsToString.default)(base.backdrop));var dialogClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.container),(0,_objectsToString.default)(sizes[(0,_findMatch.default)(valid.sizes,size,\"md\")])),className);var animation={unmount:{opacity:0,y:-50,transition:{duration:.3}},mount:{opacity:1,y:0,transition:{duration:.3}}};var backdropAnimation={unmount:{opacity:0,transition:{delay:.2}},mount:{opacity:1}};var appliedAnimation=(0,_deepmerge.default)(animation,animate);var _useFloating=(0,_react1.useFloating)({open:open,onOpenChange:handler}),floating=_useFloating.floating,context=_useFloating.context;var id=(0,_react1.useId)();var labelId=\"\".concat(id,\"-label\");var descriptionId=\"\".concat(id,\"-description\");var getFloatingProps=(0,_react1.useInteractions)([(0,_react1.useClick)(context),(0,_react1.useRole)(context),(0,_react1.useDismiss)(context,dismiss)]).getFloatingProps;var mergedRef=(0,_react1.useMergeRefs)([ref,floating]);var NewAnimatePresence=_framerMotion.AnimatePresence;return _react.default.createElement(_framerMotion.LazyMotion,{features:_framerMotion.domAnimation},_react.default.createElement(_react1.FloatingPortal,null,_react.default.createElement(NewAnimatePresence,null,open&&_react.default.createElement(_react1.FloatingOverlay,{style:{zIndex:9999},lockScroll:true},_react.default.createElement(_react1.FloatingFocusManager,{context:context},_react.default.createElement(_framerMotion.m.div,{className:size===\"xxl\"?\"\":backdropClasses,initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:backdropAnimation,transition:{duration:.2}},_react.default.createElement(_framerMotion.m.div,_extends({},getFloatingProps(_objectSpreadProps(_objectSpread({},rest),{ref:mergedRef,className:dialogClasses,\"aria-labelledby\":labelId,\"aria-describedby\":descriptionId})),{initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:appliedAnimation}),children)))))))});Dialog.propTypes={open:_dialog.propTypesOpen,handler:_dialog.propTypesHandler,size:_propTypes.default.oneOf(_dialog.propTypesSize),dismiss:_dialog.propTypesDismiss,animate:_dialog.propTypesAnimate,className:_dialog.propTypesClassName,children:_dialog.propTypesChildren};Dialog.displayName=\"MaterialTailwind.Dialog\";var _default=Object.assign(Dialog,{Header:_dialogHeader.DialogHeader,Body:_dialogBody.DialogBody,Footer:_dialogFooter.DialogFooter});","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Drawer:function(){return Drawer},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _framerMotion=require(\"framer-motion\");var _react1=require(\"@floating-ui/react\");var _deepmerge=_interopRequireDefault(require(\"deepmerge\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _drawer=require(\"../../types/components/drawer\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Drawer=_react.default.forwardRef(function(_param,ref){var open=_param.open,size=_param.size,overlay=_param.overlay,children=_param.children,placement=_param.placement,overlayProps=_param.overlayProps,className=_param.className,onClose=_param.onClose,dismiss=_param.dismiss,transition=_param.transition,overlayRef=_param.overlayRef,rest=_objectWithoutProperties(_param,[\"open\",\"size\",\"overlay\",\"children\",\"placement\",\"overlayProps\",\"className\",\"onClose\",\"dismiss\",\"transition\",\"overlayRef\"]);var drawer=(0,_theme.useTheme)().drawer;var defaultProps=drawer.defaultProps,base=drawer.styles.base;var constrols=(0,_framerMotion.useAnimation)();size=size!==null&&size!==void 0?size:defaultProps.size;overlay=overlay!==null&&overlay!==void 0?overlay:defaultProps.overlay;placement=placement!==null&&placement!==void 0?placement:defaultProps.placement;overlayProps=overlayProps!==null&&overlayProps!==void 0?overlayProps:defaultProps.overlayProps;onClose=onClose!==null&&onClose!==void 0?onClose:defaultProps.onClose;var _merge;dismiss=(_merge=(0,_deepmerge.default)(defaultProps.dismiss,dismiss||{}))!==null&&_merge!==void 0?_merge:defaultProps.dismiss;transition=transition!==null&&transition!==void 0?transition:defaultProps.transition;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var drawerClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.drawer),{\"top-0 right-0\":placement===\"right\",\"bottom-0 left-0\":placement===\"bottom\",\"top-0 left-0\":placement===\"top\"||placement===\"left\"}),className);var overlayClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.overlay)),overlayProps===null||overlayProps===void 0?void 0:overlayProps.className);var context=(0,_react1.useFloating)({open:open,onOpenChange:onClose}).context;var getFloatingProps=(0,_react1.useInteractions)([(0,_react1.useDismiss)(context,dismiss)]).getFloatingProps;_react.default.useEffect(function(){constrols.start(open?\"open\":\"close\")},[open,constrols,placement]);var drawerAnimation={open:{x:0,y:0},close:{x:placement===\"left\"?-size:placement===\"right\"?size:0,y:placement===\"top\"?-size:placement===\"bottom\"?size:0}};var backdropAnimation={unmount:{opacity:0,transition:{delay:.3}},mount:{opacity:1}};return _react.default.createElement(_react.default.Fragment,null,_react.default.createElement(_framerMotion.LazyMotion,{features:_framerMotion.domAnimation},_react.default.createElement(_framerMotion.AnimatePresence,null,overlay&&open&&_react.default.createElement(_framerMotion.m.div,{ref:overlayRef,className:overlayClasses,initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:backdropAnimation,transition:{duration:.3}})),_react.default.createElement(_framerMotion.m.div,_extends({},getFloatingProps(_objectSpread({ref:ref},rest)),{className:drawerClasses,style:{maxWidth:placement===\"left\"||placement===\"right\"?size:\"100%\",maxHeight:placement===\"top\"||placement===\"bottom\"?size:\"100%\",height:placement===\"left\"||placement===\"right\"?\"100vh\":\"100%\"},initial:\"close\",animate:constrols,variants:drawerAnimation,transition:transition}),children)))});Drawer.propTypes={open:_drawer.propTypesOpen,size:_drawer.propTypesSize,overlay:_drawer.propTypesOverlay,children:_drawer.propTypesChildren,placement:_propTypes.default.oneOf(_drawer.propTypesPlacement),overlayProps:_drawer.propTypesOverlayProps,className:_drawer.propTypesClassName,onClose:_drawer.propTypesOnClose,dismiss:_drawer.propTypesDismiss,transition:_drawer.propTypesTransition,overlayRef:_drawer.propTypesOverlayRef};Drawer.displayName=\"MaterialTailwind.Drawer\";var _default=Drawer;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{IconButton:function(){return IconButton},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _materialRippleEffects=_interopRequireDefault(require(\"material-ripple-effects\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _button=require(\"../../types/components/button\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var IconButton=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,size=_param.size,color=_param.color,ripple=_param.ripple,className=_param.className,children=_param.children,fullWidth=_param.fullWidth,rest=_objectWithoutProperties(_param,[\"variant\",\"size\",\"color\",\"ripple\",\"className\",\"children\",\"fullWidth\"]);var iconButton=(0,_theme.useTheme)().iconButton;var valid=iconButton.valid,defaultProps=iconButton.defaultProps,styles=iconButton.styles;var base=styles.base,variants=styles.variants,sizes=styles.sizes;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;size=size!==null&&size!==void 0?size:defaultProps.size;color=color!==null&&color!==void 0?color:defaultProps.color;ripple=ripple!==null&&ripple!==void 0?ripple:defaultProps.ripple;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var rippleEffect=ripple!==undefined&&new _materialRippleEffects.default;var buttonBase=(0,_objectsToString.default)(base);var buttonVariant=(0,_objectsToString.default)(variants[(0,_findMatch.default)(valid.variants,variant,\"filled\")][(0,_findMatch.default)(valid.colors,color,\"gray\")]);var buttonSize=(0,_objectsToString.default)(sizes[(0,_findMatch.default)(valid.sizes,size,\"md\")]);var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)(buttonBase,buttonSize,buttonVariant),className);return _react.default.createElement(\"button\",_extends({},rest,{ref:ref,className:classes,type:rest.type||\"button\",onMouseDown:function(e){var onMouseDown=rest===null||rest===void 0?void 0:rest.onMouseDown;if(ripple){rippleEffect.create(e,(variant===\"filled\"||variant===\"gradient\")&&color!==\"white\"?\"light\":\"dark\")}return typeof onMouseDown===\"function\"&&onMouseDown(e)}}),_react.default.createElement(\"span\",{className:\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 transform\"},children))});IconButton.propTypes={variant:_propTypes.default.oneOf(_button.propTypesVariant),size:_propTypes.default.oneOf(_button.propTypesSize),color:_propTypes.default.oneOf(_button.propTypesColor),ripple:_button.propTypesRipple,className:_button.propTypesClassName,children:_button.propTypesChildren};IconButton.displayName=\"MaterialTailwind.IconButton\";var _default=IconButton;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Input:function(){return Input},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _input=require(\"../../types/components/input\");var _tailwindMerge=require(\"tailwind-merge\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Input=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,color=_param.color,size=_param.size,label=_param.label,error=_param.error,success=_param.success,icon=_param.icon,containerProps=_param.containerProps,labelProps=_param.labelProps,className=_param.className,shrink=_param.shrink,inputRef=_param.inputRef,rest=_objectWithoutProperties(_param,[\"variant\",\"color\",\"size\",\"label\",\"error\",\"success\",\"icon\",\"containerProps\",\"labelProps\",\"className\",\"shrink\",\"inputRef\"]);var input=(0,_theme.useTheme)().input;var defaultProps=input.defaultProps,valid=input.valid,styles=input.styles;var base=styles.base,variants=styles.variants;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;size=size!==null&&size!==void 0?size:defaultProps.size;color=color!==null&&color!==void 0?color:defaultProps.color;label=label!==null&&label!==void 0?label:defaultProps.label;labelProps=labelProps!==null&&labelProps!==void 0?labelProps:defaultProps.labelProps;containerProps=containerProps!==null&&containerProps!==void 0?containerProps:defaultProps.containerProps;shrink=shrink!==null&&shrink!==void 0?shrink:defaultProps.shrink;icon=icon!==null&&icon!==void 0?icon:defaultProps.icon;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var inputVariant=variants[(0,_findMatch.default)(valid.variants,variant,\"outlined\")];var inputSize=inputVariant.sizes[(0,_findMatch.default)(valid.sizes,size,\"md\")];var inputError=(0,_objectsToString.default)(inputVariant.error.input);var inputSuccess=(0,_objectsToString.default)(inputVariant.success.input);var inputShrink=(0,_objectsToString.default)(inputVariant.shrink.input);var inputColor=(0,_objectsToString.default)(inputVariant.colors.input[(0,_findMatch.default)(valid.colors,color,\"gray\")]);var labelError=(0,_objectsToString.default)(inputVariant.error.label);var labelSuccess=(0,_objectsToString.default)(inputVariant.success.label);var labelShrink=(0,_objectsToString.default)(inputVariant.shrink.label);var labelColor=(0,_objectsToString.default)(inputVariant.colors.label[(0,_findMatch.default)(valid.colors,color,\"gray\")]);var containerClasses=(0,_classnames.default)((0,_objectsToString.default)(base.container),(0,_objectsToString.default)(inputSize.container),containerProps===null||containerProps===void 0?void 0:containerProps.className);var inputClasses=(0,_classnames.default)((0,_objectsToString.default)(base.input),(0,_objectsToString.default)(inputVariant.base.input),(0,_objectsToString.default)(inputSize.input),_defineProperty({},(0,_objectsToString.default)(inputVariant.base.inputWithIcon),icon),_defineProperty({},inputColor,!error&&!success),_defineProperty({},inputError,error),_defineProperty({},inputSuccess,success),_defineProperty({},inputShrink,shrink),className);var labelClasses=(0,_classnames.default)((0,_objectsToString.default)(base.label),(0,_objectsToString.default)(inputVariant.base.label),(0,_objectsToString.default)(inputSize.label),_defineProperty({},labelColor,!error&&!success),_defineProperty({},labelError,error),_defineProperty({},labelSuccess,success),_defineProperty({},labelShrink,shrink),labelProps===null||labelProps===void 0?void 0:labelProps.className);var iconClasses=(0,_classnames.default)((0,_objectsToString.default)(base.icon),(0,_objectsToString.default)(inputVariant.base.icon),(0,_objectsToString.default)(inputSize.icon));var asteriskClasses=(0,_classnames.default)((0,_objectsToString.default)(base.asterisk));return _react.default.createElement(\"div\",_extends({},containerProps,{ref:ref,className:containerClasses}),icon&&_react.default.createElement(\"div\",{className:iconClasses},icon),_react.default.createElement(\"input\",_extends({},rest,{ref:inputRef,className:inputClasses,placeholder:(rest===null||rest===void 0?void 0:rest.placeholder)||\" \"})),_react.default.createElement(\"label\",_extends({},labelProps,{className:labelClasses}),label,\" \",rest.required?_react.default.createElement(\"span\",{className:asteriskClasses},\"*\"):\"\"))});Input.propTypes={variant:_propTypes.default.oneOf(_input.propTypesVariant),size:_propTypes.default.oneOf(_input.propTypesSize),color:_propTypes.default.oneOf(_input.propTypesColor),label:_input.propTypesLabel,error:_input.propTypesError,success:_input.propTypesSuccess,icon:_input.propTypesIcon,labelProps:_input.propTypesLabelProps,containerProps:_input.propTypesContainerProps,shrink:_input.propTypesShrink,className:_input.propTypesClassName};Input.displayName=\"MaterialTailwind.Input\";var _default=Input;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{ListItem:function(){return ListItem},ListItemPrefix:function(){return _listItemPrefix.ListItemPrefix},ListItemSuffix:function(){return _listItemSuffix.ListItemSuffix},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _theme=require(\"../../context/theme\");var _materialRippleEffects=_interopRequireDefault(require(\"material-ripple-effects\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _list=require(\"../../types/components/list\");var _listItemPrefix=require(\"./ListItemPrefix\");var _listItemSuffix=require(\"./ListItemSuffix\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var ListItem=_react.default.forwardRef(function(_param,ref){var className=_param.className,disabled=_param.disabled,selected=_param.selected,ripple=_param.ripple,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"disabled\",\"selected\",\"ripple\",\"children\"]);var list=(0,_theme.useTheme)().list;var defaultProps=list.defaultProps,base=list.styles.base;ripple=ripple!==null&&ripple!==void 0?ripple:defaultProps.ripple;var rippleEffect=ripple!==undefined&&new _materialRippleEffects.default;var _obj;var listItemClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.item.initial),(_obj={},_defineProperty(_obj,(0,_objectsToString.default)(base.item.disabled),disabled),_defineProperty(_obj,(0,_objectsToString.default)(base.item.selected),selected&&!disabled),_obj)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,role:\"button\",tabIndex:0,className:listItemClasses,onMouseDown:function(e){var onMouseDown=rest===null||rest===void 0?void 0:rest.onMouseDown;if(ripple)rippleEffect.create(e,\"dark\");return typeof onMouseDown===\"function\"&&onMouseDown(e)}}),children)});ListItem.propTypes={className:_list.propTypesClassName,selected:_list.propTypesSelected,disabled:_list.propTypesDisabled,ripple:_list.propTypesRipple,children:_list.propTypesChildren};ListItem.displayName=\"MaterialTailwind.ListItem\";var _default=Object.assign(ListItem,{Prefix:_listItemPrefix.ListItemPrefix,Suffix:_listItemSuffix.ListItemSuffix});","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{ListItemPrefix:function(){return ListItemPrefix},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _theme=require(\"../../context/theme\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _list=require(\"../../types/components/list\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var ListItemPrefix=_react.default.forwardRef(function(_param,ref){var className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"children\"]);var list=(0,_theme.useTheme)().list;var base=list.styles.base;var listItemPrefixClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.itemPrefix)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:listItemPrefixClasses}),children)});ListItemPrefix.propTypes={className:_list.propTypesClassName,children:_list.propTypesChildren};ListItemPrefix.displayName=\"MaterialTailwind.ListItemPrefix\";var _default=ListItemPrefix;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{ListItemSuffix:function(){return ListItemSuffix},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _theme=require(\"../../context/theme\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _list=require(\"../../types/components/list\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var ListItemSuffix=_react.default.forwardRef(function(_param,ref){var className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"children\"]);var list=(0,_theme.useTheme)().list;var base=list.styles.base;var listItemSuffixClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.itemSuffix)),className);return _react.default.createElement(\"div\",_extends({},rest,{ref:ref,className:listItemSuffixClasses}),children)});ListItemSuffix.propTypes={className:_list.propTypesClassName,children:_list.propTypesChildren};ListItemSuffix.displayName=\"MaterialTailwind.ListItemSuffix\";var _default=ListItemSuffix;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{List:function(){return List},ListItem:function(){return _listItem.ListItem},ListItemPrefix:function(){return _listItemPrefix.ListItemPrefix},ListItemSuffix:function(){return _listItemSuffix.ListItemSuffix},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _theme=require(\"../../context/theme\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _list=require(\"../../types/components/list\");var _listItem=require(\"./ListItem\");var _listItemPrefix=require(\"./ListItemPrefix\");var _listItemSuffix=require(\"./ListItemSuffix\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var List=_react.default.forwardRef(function(_param,ref){var className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"children\"]);var list=(0,_theme.useTheme)().list;var defaultProps=list.defaultProps,base=list.styles.base;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var listClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.list)),className);return _react.default.createElement(\"nav\",_extends({},rest,{ref:ref,className:listClasses}),children)});List.propTypes={className:_list.propTypesClassName,children:_list.propTypesChildren};List.displayName=\"MaterialTailwind.List\";var _default=Object.assign(List,{Item:_listItem.ListItem,ItemPrefix:_listItemPrefix.ListItemPrefix,ItemSuffix:_listItemSuffix.ListItemSuffix});","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{MenuContext:function(){return MenuContext},useMenu:function(){return useMenu},MenuContextProvider:function(){return MenuContextProvider}});var _react=_interopRequireDefault(require(\"react\"));var _menu=require(\"../../types/components/menu\");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var MenuContext=_react.default.createContext(null);MenuContext.displayName=\"MaterialTailwind.MenuContext\";function useMenu(){var context=_react.default.useContext(MenuContext);if(!context){throw new Error(\"useMenu() must be used within a Menu. It happens when you use MenuCore, MenuHandler, MenuItem or MenuList components outside the Menu component.\")}return context}var MenuContextProvider=function(param){var value=param.value,children=param.children;return _react.default.createElement(MenuContext.Provider,{value:value},children)};MenuContextProvider.prototypes={value:_menu.propTypesContextValue,children:_menu.propTypesChildren};MenuContextProvider.displayName=\"MaterialTailwind.MenuContextProvider\";","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{MenuCore:function(){return MenuCore},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _react1=require(\"@floating-ui/react\");var _deepmerge=_interopRequireDefault(require(\"deepmerge\"));var _theme=require(\"../../context/theme\");var _menuContext=require(\"./MenuContext\");var _menu=require(\"../../types/components/menu\");function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var MenuHandler=_react.default.forwardRef(function(_param,ref){var children=_param.children,rest=_objectWithoutProperties(_param,[\"children\"]);var _useMenu=(0,_menuContext.useMenu)(),getReferenceProps=_useMenu.getReferenceProps,reference=_useMenu.reference,nested=_useMenu.nested;var mergedRef=(0,_react1.useMergeRefs)([ref,reference]);return _react.default.cloneElement(children,_objectSpread({},getReferenceProps(_objectSpread(_objectSpreadProps(_objectSpread({},rest),{ref:mergedRef,onClick:function onClick(event){event.stopPropagation()}}),nested&&{role:\"menuitem\"}))))});MenuHandler.propTypes={children:_menu.propTypesChildren};MenuHandler.displayName=\"MaterialTailwind.MenuHandler\";var _default=MenuHandler;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{MenuItem:function(){return MenuItem},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _menu=require(\"../../types/components/menu\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var MenuItem=_react.default.forwardRef(function(_param,ref){var _param_className=_param.className,className=_param_className===void 0?\"\":_param_className,_param_disabled=_param.disabled,disabled=_param_disabled===void 0?false:_param_disabled,children=_param.children,rest=_objectWithoutProperties(_param,[\"className\",\"disabled\",\"children\"]);var menu=(0,_theme.useTheme)().menu;var base=menu.styles.base;var menuItemClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.item.initial),_defineProperty({},(0,_objectsToString.default)(base.item.disabled),disabled)),className);return _react.default.createElement(\"button\",_extends({},rest,{ref:ref,role:\"menuitem\",className:menuItemClasses}),children)});MenuItem.propTypes={className:_menu.propTypesClassName,disabled:_menu.propTypesDisabled,children:_menu.propTypesChildren};MenuItem.displayName=\"MaterialTailwind.MenuItem\";var _default=MenuItem;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{MenuList:function(){return MenuList},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _react1=require(\"@floating-ui/react\");var _framerMotion=require(\"framer-motion\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _menuContext=require(\"./MenuContext\");var _menu=require(\"../../types/components/menu\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var MenuList=_react.default.forwardRef(function(_param,ref){var children=_param.children,className=_param.className,rest=_objectWithoutProperties(_param,[\"children\",\"className\"]);var menu=(0,_theme.useTheme)().menu;var base=menu.styles.base;var _useMenu=(0,_menuContext.useMenu)(),open=_useMenu.open,handler=_useMenu.handler,strategy=_useMenu.strategy,x=_useMenu.x,y=_useMenu.y,floating=_useMenu.floating,listItemsRef=_useMenu.listItemsRef,getFloatingProps=_useMenu.getFloatingProps,getItemProps=_useMenu.getItemProps,appliedAnimation=_useMenu.appliedAnimation,lockScroll=_useMenu.lockScroll,context=_useMenu.context,activeIndex=_useMenu.activeIndex,tree=_useMenu.tree,allowHover=_useMenu.allowHover,internalAllowHover=_useMenu.internalAllowHover,setActiveIndex=_useMenu.setActiveIndex,nested=_useMenu.nested;className=className!==null&&className!==void 0?className:\"\";var menuClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base.menu)),className);var mergedRef=(0,_react1.useMergeRefs)([ref,floating]);var NewAnimatePresence=_framerMotion.AnimatePresence;var menuComponent=_react.default.createElement(_framerMotion.m.div,_extends({},rest,{ref:mergedRef,style:{position:strategy,top:y!==null&&y!==void 0?y:0,left:x!==null&&x!==void 0?x:0},className:menuClasses},getFloatingProps({onKeyDown:function onKeyDown(event){if(event.key===\"Tab\"){handler(false);if(event.shiftKey){event.preventDefault()}}}}),{initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:appliedAnimation}),_react.default.Children.map(children,function(child,index){return _react.default.isValidElement(child)&&_react.default.cloneElement(child,getItemProps({tabIndex:activeIndex===index?0:-1,role:\"menuitem\",className:child.props.className,ref:function ref(node){listItemsRef.current[index]=node},onClick:function onClick(event){if(child.props.onClick){var _child_props,_child_props_onClick;(_child_props_onClick=(_child_props=child.props).onClick)===null||_child_props_onClick===void 0?void 0:_child_props_onClick.call(_child_props,event)}tree===null||tree===void 0?void 0:tree.events.emit(\"click\")},onMouseEnter:function onMouseEnter(){if(allowHover&&open||internalAllowHover&&open){setActiveIndex(index)}}}))}));return _react.default.createElement(_framerMotion.LazyMotion,{features:_framerMotion.domAnimation},_react.default.createElement(_react1.FloatingPortal,null,_react.default.createElement(NewAnimatePresence,null,open&&_react.default.createElement(_react.default.Fragment,null,lockScroll?_react.default.createElement(_react1.FloatingOverlay,{lockScroll:true},_react.default.createElement(_react1.FloatingFocusManager,{context:context,modal:!nested,initialFocus:nested?-1:0,returnFocus:!nested,visuallyHiddenDismiss:true},menuComponent)):_react.default.createElement(_react1.FloatingFocusManager,{context:context,modal:!nested,initialFocus:nested?-1:0,returnFocus:!nested,visuallyHiddenDismiss:true},menuComponent)))))});MenuList.propTypes={className:_menu.propTypesClassName,children:_menu.propTypesChildren};MenuList.displayName=\"MaterialTailwind.MenuList\";var _default=MenuList;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Menu:function(){return Menu},MenuHandler:function(){return _menuHandler.MenuHandler},MenuList:function(){return _menuList.MenuList},MenuItem:function(){return _menuItem.MenuItem},useMenu:function(){return _menuContext.useMenu},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _react1=require(\"@floating-ui/react\");var _menuContext=require(\"./MenuContext\");var _menuCore=require(\"./MenuCore\");var _menuHandler=require(\"./MenuHandler\");var _menuList=require(\"./MenuList\");var _menuItem=require(\"./MenuItem\");function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var MobileNav=_react.default.forwardRef(function(_param,ref){var open=_param.open,animate=_param.animate,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"open\",\"animate\",\"className\",\"children\"]);var _mobileNavRef_current;console.error(\" will be deprecated in the future versions of @material-tailwind/react use instead.\\n \\nMore details: https://www.material-tailwind.com/docs/react/collapse\\n \");var mobileNavRef=_react.default.useRef(null);var navbar=(0,_theme.useTheme)().navbar;var styles=navbar.styles;var mobileNav=styles.base.mobileNav;animate=animate!==null&&animate!==void 0?animate:{};className=className!==null&&className!==void 0?className:\"\";var classes=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(mobileNav)),className);var mainAnimation={unmount:{height:0,opacity:0,transition:{duration:.3,times:\"[0.4, 0, 0.2, 1]\"}},mount:{opacity:1,height:\"\".concat((_mobileNavRef_current=mobileNavRef.current)===null||_mobileNavRef_current===void 0?void 0:_mobileNavRef_current.scrollHeight,\"px\"),transition:{duration:.3,times:\"[0.4, 0, 0.2, 1]\"}}};var appliedAnimation=(0,_deepmerge.default)(mainAnimation,animate);var NewAnimatePresence=_framerMotion.AnimatePresence;var mergedRef=(0,_react1.useMergeRefs)([ref,mobileNavRef]);return _react.default.createElement(_framerMotion.LazyMotion,{features:_framerMotion.domAnimation},_react.default.createElement(NewAnimatePresence,null,_react.default.createElement(_framerMotion.m.div,_extends({},rest,{ref:mergedRef,className:classes,initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:appliedAnimation}),children)))});MobileNav.displayName=\"MaterialTailwind.MobileNav\";MobileNav.propTypes={open:_navbar.propTypesOpen,animate:_navbar.propTypesAnimate,className:_navbar.propTypesClassName,children:_navbar.propTypesChildren};var _default=MobileNav;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{Navbar:function(){return Navbar},MobileNav:function(){return _mobileNav.MobileNav},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _propTypes=_interopRequireDefault(require(\"prop-types\"));var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _findMatch=_interopRequireDefault(require(\"../../utils/findMatch\"));var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _mobileNav=require(\"./MobileNav\");var _navbar=require(\"../../types/components/navbar\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var Navbar=_react.default.forwardRef(function(_param,ref){var variant=_param.variant,color=_param.color,shadow=_param.shadow,blurred=_param.blurred,fullWidth=_param.fullWidth,className=_param.className,children=_param.children,rest=_objectWithoutProperties(_param,[\"variant\",\"color\",\"shadow\",\"blurred\",\"fullWidth\",\"className\",\"children\"]);var navbar=(0,_theme.useTheme)().navbar;var defaultProps=navbar.defaultProps,valid=navbar.valid,styles=navbar.styles;var base=styles.base,variants=styles.variants;variant=variant!==null&&variant!==void 0?variant:defaultProps.variant;color=color!==null&&color!==void 0?color:defaultProps.color;shadow=shadow!==null&&shadow!==void 0?shadow:defaultProps.shadow;blurred=blurred!==null&&blurred!==void 0?blurred:defaultProps.blurred;fullWidth=fullWidth!==null&&fullWidth!==void 0?fullWidth:defaultProps.fullWidth;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var _obj;var navbarRoot=(0,_classnames.default)((0,_objectsToString.default)(base.navbar.initial),(_obj={},_defineProperty(_obj,(0,_objectsToString.default)(base.navbar.shadow),shadow),_defineProperty(_obj,(0,_objectsToString.default)(base.navbar.blurred),blurred&&color===\"white\"),_defineProperty(_obj,(0,_objectsToString.default)(base.navbar.fullWidth),fullWidth),_obj));var navbarVariant=(0,_classnames.default)((0,_objectsToString.default)(variants[(0,_findMatch.default)(valid.variants,variant,\"filled\")][(0,_findMatch.default)(valid.colors,color,\"white\")]));var navbarClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)(navbarRoot,navbarVariant),className);return _react.default.createElement(\"nav\",_extends({},rest,{ref:ref,className:navbarClasses}),children)});Navbar.propTypes={variant:_propTypes.default.oneOf(_navbar.propTypesVariant),color:_propTypes.default.oneOf(_navbar.propTypesColor),shadow:_navbar.propTypesShadow,blurred:_navbar.propTypesBlurred,fullWidth:_navbar.propTypesFullWidth,className:_navbar.propTypesClassName,children:_navbar.propTypesChildren};Navbar.displayName=\"MaterialTailwind.Navbar\";var _default=Object.assign(Navbar,{MobileNav:_mobileNav.MobileNav});","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{PopoverContent:function(){return PopoverContent},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _react1=require(\"@floating-ui/react\");var _framerMotion=require(\"framer-motion\");var _classnames=_interopRequireDefault(require(\"classnames\"));var _tailwindMerge=require(\"tailwind-merge\");var _objectsToString=_interopRequireDefault(require(\"../../utils/objectsToString\"));var _theme=require(\"../../context/theme\");var _popoverContext=require(\"./PopoverContext\");var _popover=require(\"../../types/components/popover\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _extends(){_extends=Object.assign||function(target){for(var i=1;i=0)continue;if(!Object.prototype.propertyIsEnumerable.call(source,key))continue;target[key]=source[key]}}return target}function _objectWithoutPropertiesLoose(source,excluded){if(source==null)return{};var target={};var sourceKeys=Object.keys(source);var key,i;for(i=0;i=0)continue;target[key]=source[key]}return target}var PopoverContent=_react.default.forwardRef(function(_param,ref){var children=_param.children,className=_param.className,rest=_objectWithoutProperties(_param,[\"children\",\"className\"]);var popover=(0,_theme.useTheme)().popover;var defaultProps=popover.defaultProps,base=popover.styles.base;var _usePopover=(0,_popoverContext.usePopover)(),open=_usePopover.open,strategy=_usePopover.strategy,x=_usePopover.x,y=_usePopover.y,context=_usePopover.context,floating=_usePopover.floating,getFloatingProps=_usePopover.getFloatingProps,appliedAnimation=_usePopover.appliedAnimation,labelId=_usePopover.labelId,descriptionId=_usePopover.descriptionId;className=(0,_tailwindMerge.twMerge)(defaultProps.className||\"\",className);var popoverClasses=(0,_tailwindMerge.twMerge)((0,_classnames.default)((0,_objectsToString.default)(base)),className);var mergedRef=(0,_react1.useMergeRefs)([ref,floating]);var NewAnimatePresence=_framerMotion.AnimatePresence;return _react.default.createElement(_framerMotion.LazyMotion,{features:_framerMotion.domAnimation},_react.default.createElement(_react1.FloatingPortal,null,_react.default.createElement(NewAnimatePresence,null,open&&_react.default.createElement(_react1.FloatingFocusManager,{context:context},_react.default.createElement(_framerMotion.m.div,_extends({},getFloatingProps(_objectSpreadProps(_objectSpread({},rest),{ref:mergedRef,className:popoverClasses,style:{position:strategy,top:y!==null&&y!==void 0?y:\"\",left:x!==null&&x!==void 0?x:\"\"},\"aria-labelledby\":labelId,\"aria-describedby\":descriptionId})),{initial:\"unmount\",exit:\"unmount\",animate:open?\"mount\":\"unmount\",variants:appliedAnimation}),children)))))});PopoverContent.propTypes={className:_popover.propTypesClassName,children:_popover.propTypesChildren};PopoverContent.displayName=\"MaterialTailwind.PopoverContent\";var _default=PopoverContent;","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{PopoverContext:function(){return PopoverContext},usePopover:function(){return usePopover},PopoverContextProvider:function(){return PopoverContextProvider}});var _react=_interopRequireDefault(require(\"react\"));var _popover=require(\"../../types/components/popover\");function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}var PopoverContext=_react.default.createContext(null);PopoverContext.displayName=\"MaterialTailwind.PopoverContext\";function usePopover(){var context=_react.default.useContext(PopoverContext);if(!context){throw new Error(\"usePopover() must be used within a Popover. It happens when you use PopoverHandler or PopoverContent components outside the Popover component.\")}return context}var PopoverContextProvider=function(param){var value=param.value,children=param.children;return _react.default.createElement(PopoverContext.Provider,{value:value},children)};PopoverContextProvider.propTypes={value:_popover.propTypesContextValue,children:_popover.propTypesChildren};PopoverContextProvider.displayName=\"MaterialTailwind.PopoverContextProvider\";","\"use strict\";Object.defineProperty(exports,\"__esModule\",{value:true});function _export(target,all){for(var name in all)Object.defineProperty(target,name,{enumerable:true,get:all[name]})}_export(exports,{PopoverHandler:function(){return PopoverHandler},default:function(){return _default}});var _react=_interopRequireDefault(require(\"react\"));var _react1=require(\"@floating-ui/react\");var _popoverContext=require(\"./PopoverContext\");var _popover=require(\"../../types/components/popover\");function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}function _objectSpread(target){for(var i=1;i