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EAnBN,SAAqB3gB,EAAMyiB,EAASvT,GAClC,MAAMwT,EAAK,CAAC,OAAQ,SACdC,EAAK,CAAC,QAAS,QACfC,EAAK,CAAC,MAAO,UACbC,EAAK,CAAC,SAAU,OACtB,OAAQ7iB,GACN,IAAK,MACL,IAAK,SACH,OAAIkP,EAAYuT,EAAUE,EAAKD,EACxBD,EAAUC,EAAKC,EACxB,IAAK,OACL,IAAK,QACH,OAAOF,EAAUG,EAAKC,EACxB,QACE,MAAO,GAEb,CAGaC,CAAYnB,EAAQ13B,GAA0B,UAAd4P,EAAuBqV,GAOlE,OANI2G,IACF8K,EAAOA,EAAKzyB,KAAI8R,GAAQA,EAAO,IAAM6V,IACjCvC,IACFqN,EAAOA,EAAKnqB,OAAOmqB,EAAKzyB,IAAIo0B,MAGzB3B,CACT,CACA,SAASwB,EAAqBl4B,GAC5B,OAAOA,EAAUs4B,QAAQ,0BAA0BviB,GAAQohB,EAAgBphB,IAC7E,CAUA,SAAS+iB,EAAiB16B,GACxB,MAA0B,iBAAZA,EAVhB,SAA6BA,GAC3B,MAAO,CACLgX,IAAK,EACLO,MAAO,EACPN,OAAQ,EACRI,KAAM,KACHrX,EAEP,CAEuC26B,CAAoB36B,GAAW,CAClEgX,IAAKhX,EACLuX,MAAOvX,EACPiX,OAAQjX,EACRqX,KAAMrX,EAEV,CACA,SAAS46B,EAAiBjS,GACxB,MAAO,IACFA,EACH3R,IAAK2R,EAAKtmB,EACVgV,KAAMsR,EAAKvmB,EACXmV,MAAOoR,EAAKvmB,EAAIumB,EAAKliB,MACrBwQ,OAAQ0R,EAAKtmB,EAAIsmB,EAAKjiB,OAE1B","sources":["webpack://@mydeal/web/./node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js","webpack://@mydeal/web/./node_modules/@floating-ui/react/dist/floating-ui.react.esm.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Floating/FloatingArrow/get-arrow-position-styles.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Floating/FloatingArrow/FloatingArrow.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Floating/get-floating-position/get-floating-position.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Floating/use-floating-auto-update.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/List/List.context.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/List/ListItem/ListItem.styles.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/List/ListItem/ListItem.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/List/List.styles.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/List/List.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Portal/Portal.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Portal/OptionalPortal.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Transition/transitions.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Transition/get-transition-styles/get-transition-styles.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Transition/Transition.js","webpack://@mydeal/web/./node_modules/@mantine/core/esm/Transition/use-transition.js","webpack://@mydeal/web/./node_modules/@mantine/hooks/esm/use-uncontrolled/use-uncontrolled.js","webpack://@mydeal/web/./node_modules/@mantine/styles/esm/theme/utils/get-default-z-index/get-default-z-index.js","webpack://@mydeal/web/./node_modules/@mantine/utils/esm/is-element/is-element.js","webpack://@mydeal/web/./node_modules/@babel/runtime/helpers/regeneratorRuntime.js","webpack://@mydeal/web/./node_modules/@babel/runtime/helpers/typeof.js","webpack://@mydeal/web/./node_modules/@babel/runtime/regenerator/index.js","webpack://@mydeal/web/./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js","webpack://@mydeal/web/./node_modules/@floating-ui/core/dist/floating-ui.core.mjs","webpack://@mydeal/web/./node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","webpack://@mydeal/web/./node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","webpack://@mydeal/web/./node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs"],"sourcesContent":["import { arrow as arrow$1, computePosition } from '@floating-ui/dom';\nexport { autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size } from '@floating-ui/dom';\nimport * as React from 'react';\nimport { useLayoutEffect, useEffect } from 'react';\nimport * as ReactDOM from 'react-dom';\n\n/**\n * A data provider that provides data to position an inner element of the\n * floating element (usually a triangle or caret) so that it is centered to the\n * reference element.\n * This wraps the core `arrow` middleware to allow React refs as the element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => {\n const {\n element,\n padding\n } = options;\n function isRef(value) {\n return Object.prototype.hasOwnProperty.call(value, 'current');\n }\n return {\n name: 'arrow',\n options,\n fn(args) {\n if (isRef(element)) {\n if (element.current != null) {\n return arrow$1({\n element: element.current,\n padding\n }).fn(args);\n }\n return {};\n } else if (element) {\n return arrow$1({\n element,\n padding\n }).fn(args);\n }\n return {};\n }\n };\n};\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\n// Fork of `fast-deep-equal` that only does the comparisons we need and compares\n// functions\nfunction deepEqual(a, b) {\n if (a === b) {\n return true;\n }\n if (typeof a !== typeof b) {\n return false;\n }\n if (typeof a === 'function' && a.toString() === b.toString()) {\n return true;\n }\n let length, i, keys;\n if (a && b && typeof a == 'object') {\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) {\n if (!deepEqual(a[i], b[i])) {\n return false;\n }\n }\n return true;\n }\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) {\n return false;\n }\n for (i = length; i-- !== 0;) {\n if (!Object.prototype.hasOwnProperty.call(b, keys[i])) {\n return false;\n }\n }\n for (i = length; i-- !== 0;) {\n const key = keys[i];\n if (key === '_owner' && a.$$typeof) {\n continue;\n }\n if (!deepEqual(a[key], b[key])) {\n return false;\n }\n }\n return true;\n }\n return a !== a && b !== b;\n}\n\nfunction useLatestRef(value) {\n const ref = React.useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\n/**\n * Provides data to position a floating element.\n * @see https://floating-ui.com/docs/react\n */\nfunction useFloating(options) {\n if (options === void 0) {\n options = {};\n }\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform,\n whileElementsMounted,\n open\n } = options;\n const [data, setData] = React.useState({\n x: null,\n y: null,\n strategy,\n placement,\n middlewareData: {},\n isPositioned: false\n });\n const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);\n if (!deepEqual(latestMiddleware, middleware)) {\n setLatestMiddleware(middleware);\n }\n const referenceRef = React.useRef(null);\n const floatingRef = React.useRef(null);\n const dataRef = React.useRef(data);\n const whileElementsMountedRef = useLatestRef(whileElementsMounted);\n const platformRef = useLatestRef(platform);\n const [reference, _setReference] = React.useState(null);\n const [floating, _setFloating] = React.useState(null);\n const setReference = React.useCallback(node => {\n if (referenceRef.current !== node) {\n referenceRef.current = node;\n _setReference(node);\n }\n }, []);\n const setFloating = React.useCallback(node => {\n if (floatingRef.current !== node) {\n floatingRef.current = node;\n _setFloating(node);\n }\n }, []);\n const update = React.useCallback(() => {\n if (!referenceRef.current || !floatingRef.current) {\n return;\n }\n const config = {\n placement,\n strategy,\n middleware: latestMiddleware\n };\n if (platformRef.current) {\n config.platform = platformRef.current;\n }\n computePosition(referenceRef.current, floatingRef.current, config).then(data => {\n const fullData = {\n ...data,\n isPositioned: true\n };\n if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {\n dataRef.current = fullData;\n ReactDOM.flushSync(() => {\n setData(fullData);\n });\n }\n });\n }, [latestMiddleware, placement, strategy, platformRef]);\n index(() => {\n if (open === false && dataRef.current.isPositioned) {\n dataRef.current.isPositioned = false;\n setData(data => ({\n ...data,\n isPositioned: false\n }));\n }\n }, [open]);\n const isMountedRef = React.useRef(false);\n index(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n }, []);\n index(() => {\n if (reference && floating) {\n if (whileElementsMountedRef.current) {\n return whileElementsMountedRef.current(reference, floating, update);\n } else {\n update();\n }\n }\n }, [reference, floating, update, whileElementsMountedRef]);\n const refs = React.useMemo(() => ({\n reference: referenceRef,\n floating: floatingRef,\n setReference,\n setFloating\n }), [setReference, setFloating]);\n const elements = React.useMemo(() => ({\n reference,\n floating\n }), [reference, floating]);\n return React.useMemo(() => ({\n ...data,\n update,\n refs,\n elements,\n reference: setReference,\n floating: setFloating\n }), [data, update, refs, elements, setReference, setFloating]);\n}\n\nexport { arrow, useFloating };\n","import * as React from 'react';\nimport { useLayoutEffect, useEffect, useRef } from 'react';\nimport { hideOthers } from 'aria-hidden';\nimport { tabbable } from 'tabbable';\nimport { createPortal, flushSync } from 'react-dom';\nimport { getOverflowAncestors, offset, detectOverflow, useFloating as useFloating$1 } from '@floating-ui/react-dom';\nexport { arrow, autoPlacement, autoUpdate, computePosition, detectOverflow, flip, getOverflowAncestors, hide, inline, limitShift, offset, platform, shift, size } from '@floating-ui/react-dom';\n\nvar index = typeof document !== 'undefined' ? useLayoutEffect : useEffect;\n\nlet serverHandoffComplete = false;\nlet count = 0;\nconst genId = () => \"floating-ui-\" + count++;\nfunction useFloatingId() {\n const [id, setId] = React.useState(() => serverHandoffComplete ? genId() : undefined);\n index(() => {\n if (id == null) {\n setId(genId());\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n React.useEffect(() => {\n if (!serverHandoffComplete) {\n serverHandoffComplete = true;\n }\n }, []);\n return id;\n}\n\n// `toString()` prevents bundlers from trying to `import { useId } from 'react'`\nconst useReactId = React[/*#__PURE__*/'useId'.toString()];\n\n/**\n * Uses React 18's built-in `useId()` when available, or falls back to a\n * slightly less performant (requiring a double render) implementation for\n * earlier React versions.\n * @see https://floating-ui.com/docs/useId\n */\nconst useId = useReactId || useFloatingId;\n\nfunction createPubSub() {\n const map = new Map();\n return {\n emit(event, data) {\n var _map$get;\n (_map$get = map.get(event)) == null ? void 0 : _map$get.forEach(handler => handler(data));\n },\n on(event, listener) {\n map.set(event, [...(map.get(event) || []), listener]);\n },\n off(event, listener) {\n map.set(event, (map.get(event) || []).filter(l => l !== listener));\n }\n };\n}\n\nconst FloatingNodeContext = /*#__PURE__*/React.createContext(null);\nconst FloatingTreeContext = /*#__PURE__*/React.createContext(null);\nconst useFloatingParentNodeId = () => {\n var _React$useContext;\n return ((_React$useContext = React.useContext(FloatingNodeContext)) == null ? void 0 : _React$useContext.id) || null;\n};\nconst useFloatingTree = () => React.useContext(FloatingTreeContext);\n\n/**\n * Registers a node into the floating tree, returning its id.\n */\nconst useFloatingNodeId = customParentId => {\n const id = useId();\n const tree = useFloatingTree();\n const reactParentId = useFloatingParentNodeId();\n const parentId = customParentId || reactParentId;\n index(() => {\n const node = {\n id,\n parentId\n };\n tree == null ? void 0 : tree.addNode(node);\n return () => {\n tree == null ? void 0 : tree.removeNode(node);\n };\n }, [tree, id, parentId]);\n return id;\n};\n\n/**\n * Provides parent node context for nested floating elements.\n * @see https://floating-ui.com/docs/FloatingTree\n */\nconst FloatingNode = _ref => {\n let {\n children,\n id\n } = _ref;\n const parentId = useFloatingParentNodeId();\n return /*#__PURE__*/React.createElement(FloatingNodeContext.Provider, {\n value: React.useMemo(() => ({\n id,\n parentId\n }), [id, parentId])\n }, children);\n};\n\n/**\n * Provides context for nested floating elements when they are not children of\n * each other on the DOM (i.e. portalled to a common node, rather than their\n * respective parent).\n * @see https://floating-ui.com/docs/FloatingTree\n */\nconst FloatingTree = _ref2 => {\n let {\n children\n } = _ref2;\n const nodesRef = React.useRef([]);\n const addNode = React.useCallback(node => {\n nodesRef.current = [...nodesRef.current, node];\n }, []);\n const removeNode = React.useCallback(node => {\n nodesRef.current = nodesRef.current.filter(n => n !== node);\n }, []);\n const events = React.useState(() => createPubSub())[0];\n return /*#__PURE__*/React.createElement(FloatingTreeContext.Provider, {\n value: React.useMemo(() => ({\n nodesRef,\n addNode,\n removeNode,\n events\n }), [nodesRef, addNode, removeNode, events])\n }, children);\n};\n\nfunction getDocument(node) {\n return (node == null ? void 0 : node.ownerDocument) || document;\n}\n\n// Avoid Chrome DevTools blue warning.\nfunction getPlatform() {\n const uaData = navigator.userAgentData;\n if (uaData != null && uaData.platform) {\n return uaData.platform;\n }\n return navigator.platform;\n}\nfunction getUserAgent() {\n const uaData = navigator.userAgentData;\n if (uaData && Array.isArray(uaData.brands)) {\n return uaData.brands.map(_ref => {\n let {\n brand,\n version\n } = _ref;\n return brand + \"/\" + version;\n }).join(' ');\n }\n return navigator.userAgent;\n}\n\nfunction getWindow(value) {\n return getDocument(value).defaultView || window;\n}\nfunction isElement(value) {\n return value ? value instanceof getWindow(value).Element : false;\n}\nfunction isHTMLElement(value) {\n return value ? value instanceof getWindow(value).HTMLElement : false;\n}\nfunction isShadowRoot(node) {\n // Browsers without `ShadowRoot` support\n if (typeof ShadowRoot === 'undefined') {\n return false;\n }\n const OwnElement = getWindow(node).ShadowRoot;\n return node instanceof OwnElement || node instanceof ShadowRoot;\n}\n\n// License: https://github.com/adobe/react-spectrum/blob/b35d5c02fe900badccd0cf1a8f23bb593419f238/packages/@react-aria/utils/src/isVirtualEvent.ts\nfunction isVirtualClick(event) {\n if (event.mozInputSource === 0 && event.isTrusted) {\n return true;\n }\n const androidRe = /Android/i;\n if ((androidRe.test(getPlatform()) || androidRe.test(getUserAgent())) && event.pointerType) {\n return event.type === 'click' && event.buttons === 1;\n }\n return event.detail === 0 && !event.pointerType;\n}\nfunction isVirtualPointerEvent(event) {\n return event.width === 0 && event.height === 0 || event.width === 1 && event.height === 1 && event.pressure === 0 && event.detail === 0 && event.pointerType !== 'mouse' ||\n // iOS VoiceOver returns 0.333• for width/height.\n event.width < 1 && event.height < 1 && event.pressure === 0 && event.detail === 0;\n}\nfunction isSafari() {\n // Chrome DevTools does not complain about navigator.vendor\n return /apple/i.test(navigator.vendor);\n}\nfunction isMac() {\n return getPlatform().toLowerCase().startsWith('mac') && !navigator.maxTouchPoints;\n}\nfunction isMouseLikePointerType(pointerType, strict) {\n // On some Linux machines with Chromium, mouse inputs return a `pointerType`\n // of \"pen\": https://github.com/floating-ui/floating-ui/issues/2015\n const values = ['mouse', 'pen'];\n if (!strict) {\n values.push('', undefined);\n }\n return values.includes(pointerType);\n}\n\nfunction useLatestRef(value) {\n const ref = useRef(value);\n index(() => {\n ref.current = value;\n });\n return ref;\n}\n\nconst safePolygonIdentifier = 'data-floating-ui-safe-polygon';\nfunction getDelay(value, prop, pointerType) {\n if (pointerType && !isMouseLikePointerType(pointerType)) {\n return 0;\n }\n if (typeof value === 'number') {\n return value;\n }\n return value == null ? void 0 : value[prop];\n}\n/**\n * Opens the floating element while hovering over the reference element, like\n * CSS `:hover`.\n * @see https://floating-ui.com/docs/useHover\n */\nconst useHover = function (context, _temp) {\n let {\n enabled = true,\n delay = 0,\n handleClose = null,\n mouseOnly = false,\n restMs = 0,\n move = true\n } = _temp === void 0 ? {} : _temp;\n const {\n open,\n onOpenChange,\n dataRef,\n events,\n elements: {\n domReference,\n floating\n },\n refs\n } = context;\n const tree = useFloatingTree();\n const parentId = useFloatingParentNodeId();\n const handleCloseRef = useLatestRef(handleClose);\n const delayRef = useLatestRef(delay);\n const pointerTypeRef = React.useRef();\n const timeoutRef = React.useRef();\n const handlerRef = React.useRef();\n const restTimeoutRef = React.useRef();\n const blockMouseMoveRef = React.useRef(true);\n const performedPointerEventsMutationRef = React.useRef(false);\n const unbindMouseMoveRef = React.useRef(() => {});\n const isHoverOpen = React.useCallback(() => {\n var _dataRef$current$open;\n const type = (_dataRef$current$open = dataRef.current.openEvent) == null ? void 0 : _dataRef$current$open.type;\n return (type == null ? void 0 : type.includes('mouse')) && type !== 'mousedown';\n }, [dataRef]);\n\n // When dismissing before opening, clear the delay timeouts to cancel it\n // from showing.\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n function onDismiss() {\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n blockMouseMoveRef.current = true;\n }\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n };\n }, [enabled, events]);\n React.useEffect(() => {\n if (!enabled || !handleCloseRef.current || !open) {\n return;\n }\n function onLeave() {\n if (isHoverOpen()) {\n onOpenChange(false);\n }\n }\n const html = getDocument(floating).documentElement;\n html.addEventListener('mouseleave', onLeave);\n return () => {\n html.removeEventListener('mouseleave', onLeave);\n };\n }, [floating, open, onOpenChange, enabled, handleCloseRef, dataRef, isHoverOpen]);\n const closeWithDelay = React.useCallback(function (runElseBranch) {\n if (runElseBranch === void 0) {\n runElseBranch = true;\n }\n const closeDelay = getDelay(delayRef.current, 'close', pointerTypeRef.current);\n if (closeDelay && !handlerRef.current) {\n clearTimeout(timeoutRef.current);\n timeoutRef.current = setTimeout(() => onOpenChange(false), closeDelay);\n } else if (runElseBranch) {\n clearTimeout(timeoutRef.current);\n onOpenChange(false);\n }\n }, [delayRef, onOpenChange]);\n const cleanupMouseMoveHandler = React.useCallback(() => {\n unbindMouseMoveRef.current();\n handlerRef.current = undefined;\n }, []);\n const clearPointerEvents = React.useCallback(() => {\n if (performedPointerEventsMutationRef.current) {\n const body = getDocument(refs.floating.current).body;\n body.style.pointerEvents = '';\n body.removeAttribute(safePolygonIdentifier);\n performedPointerEventsMutationRef.current = false;\n }\n }, [refs]);\n\n // Registering the mouse events on the reference directly to bypass React's\n // delegation system. If the cursor was on a disabled element and then entered\n // the reference (no gap), `mouseenter` doesn't fire in the delegation system.\n React.useEffect(() => {\n if (!enabled) {\n return;\n }\n function isClickLikeOpenEvent() {\n return dataRef.current.openEvent ? ['click', 'mousedown'].includes(dataRef.current.openEvent.type) : false;\n }\n function onMouseEnter(event) {\n clearTimeout(timeoutRef.current);\n blockMouseMoveRef.current = false;\n if (mouseOnly && !isMouseLikePointerType(pointerTypeRef.current) || restMs > 0 && getDelay(delayRef.current, 'open') === 0) {\n return;\n }\n dataRef.current.openEvent = event;\n const openDelay = getDelay(delayRef.current, 'open', pointerTypeRef.current);\n if (openDelay) {\n timeoutRef.current = setTimeout(() => {\n onOpenChange(true);\n }, openDelay);\n } else {\n onOpenChange(true);\n }\n }\n function onMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n return;\n }\n unbindMouseMoveRef.current();\n const doc = getDocument(floating);\n clearTimeout(restTimeoutRef.current);\n if (handleCloseRef.current) {\n // Prevent clearing `onScrollMouseLeave` timeout.\n if (!open) {\n clearTimeout(timeoutRef.current);\n }\n handlerRef.current = handleCloseRef.current({\n ...context,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n closeWithDelay();\n }\n });\n const handler = handlerRef.current;\n doc.addEventListener('mousemove', handler);\n unbindMouseMoveRef.current = () => {\n doc.removeEventListener('mousemove', handler);\n };\n return;\n }\n closeWithDelay();\n }\n\n // Ensure the floating element closes after scrolling even if the pointer\n // did not move.\n // https://github.com/floating-ui/floating-ui/discussions/1692\n function onScrollMouseLeave(event) {\n if (isClickLikeOpenEvent()) {\n return;\n }\n handleCloseRef.current == null ? void 0 : handleCloseRef.current({\n ...context,\n tree,\n x: event.clientX,\n y: event.clientY,\n onClose() {\n clearPointerEvents();\n cleanupMouseMoveHandler();\n closeWithDelay();\n }\n })(event);\n }\n if (isElement(domReference)) {\n const ref = domReference;\n open && ref.addEventListener('mouseleave', onScrollMouseLeave);\n floating == null ? void 0 : floating.addEventListener('mouseleave', onScrollMouseLeave);\n move && ref.addEventListener('mousemove', onMouseEnter, {\n once: true\n });\n ref.addEventListener('mouseenter', onMouseEnter);\n ref.addEventListener('mouseleave', onMouseLeave);\n return () => {\n open && ref.removeEventListener('mouseleave', onScrollMouseLeave);\n floating == null ? void 0 : floating.removeEventListener('mouseleave', onScrollMouseLeave);\n move && ref.removeEventListener('mousemove', onMouseEnter);\n ref.removeEventListener('mouseenter', onMouseEnter);\n ref.removeEventListener('mouseleave', onMouseLeave);\n };\n }\n }, [domReference, floating, enabled, context, mouseOnly, restMs, move, closeWithDelay, cleanupMouseMoveHandler, clearPointerEvents, onOpenChange, open, tree, delayRef, handleCloseRef, dataRef]);\n\n // Block pointer-events of every element other than the reference and floating\n // while the floating element is open and has a `handleClose` handler. Also\n // handles nested floating elements.\n // https://github.com/floating-ui/floating-ui/issues/1722\n index(() => {\n var _handleCloseRef$curre;\n if (!enabled) {\n return;\n }\n if (open && (_handleCloseRef$curre = handleCloseRef.current) != null && _handleCloseRef$curre.__options.blockPointerEvents && isHoverOpen()) {\n const body = getDocument(floating).body;\n body.setAttribute(safePolygonIdentifier, '');\n body.style.pointerEvents = 'none';\n performedPointerEventsMutationRef.current = true;\n if (isElement(domReference) && floating) {\n var _tree$nodesRef$curren, _tree$nodesRef$curren2;\n const ref = domReference;\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) {\n parentFloating.style.pointerEvents = '';\n }\n ref.style.pointerEvents = 'auto';\n floating.style.pointerEvents = 'auto';\n return () => {\n ref.style.pointerEvents = '';\n floating.style.pointerEvents = '';\n };\n }\n }\n }, [enabled, open, parentId, floating, domReference, tree, handleCloseRef, dataRef, isHoverOpen]);\n index(() => {\n if (!open) {\n pointerTypeRef.current = undefined;\n cleanupMouseMoveHandler();\n clearPointerEvents();\n }\n }, [open, cleanupMouseMoveHandler, clearPointerEvents]);\n React.useEffect(() => {\n return () => {\n cleanupMouseMoveHandler();\n clearTimeout(timeoutRef.current);\n clearTimeout(restTimeoutRef.current);\n clearPointerEvents();\n };\n }, [enabled, cleanupMouseMoveHandler, clearPointerEvents]);\n return React.useMemo(() => {\n if (!enabled) {\n return {};\n }\n function setPointerRef(event) {\n pointerTypeRef.current = event.pointerType;\n }\n return {\n reference: {\n onPointerDown: setPointerRef,\n onPointerEnter: setPointerRef,\n onMouseMove() {\n if (open || restMs === 0) {\n return;\n }\n clearTimeout(restTimeoutRef.current);\n restTimeoutRef.current = setTimeout(() => {\n if (!blockMouseMoveRef.current) {\n onOpenChange(true);\n }\n }, restMs);\n }\n },\n floating: {\n onMouseEnter() {\n clearTimeout(timeoutRef.current);\n },\n onMouseLeave() {\n events.emit('dismiss', {\n type: 'mouseLeave',\n data: {\n returnFocus: false\n }\n });\n closeWithDelay(false);\n }\n }\n };\n }, [events, enabled, restMs, open, onOpenChange, closeWithDelay]);\n};\n\nconst FloatingDelayGroupContext = /*#__PURE__*/React.createContext({\n delay: 0,\n initialDelay: 0,\n timeoutMs: 0,\n currentId: null,\n setCurrentId: () => {},\n setState: () => {},\n isInstantPhase: false\n});\nconst useDelayGroupContext = () => React.useContext(FloatingDelayGroupContext);\n\n/**\n * Provides context for a group of floating elements that should share a\n * `delay`.\n * @see https://floating-ui.com/docs/FloatingDelayGroup\n */\nconst FloatingDelayGroup = _ref => {\n let {\n children,\n delay,\n timeoutMs = 0\n } = _ref;\n const [state, setState] = React.useReducer((prev, next) => ({\n ...prev,\n ...next\n }), {\n delay,\n timeoutMs,\n initialDelay: delay,\n currentId: null,\n isInstantPhase: false\n });\n const initialCurrentIdRef = React.useRef(null);\n const setCurrentId = React.useCallback(currentId => {\n setState({\n currentId\n });\n }, []);\n index(() => {\n if (state.currentId) {\n if (initialCurrentIdRef.current === null) {\n initialCurrentIdRef.current = state.currentId;\n } else {\n setState({\n isInstantPhase: true\n });\n }\n } else {\n setState({\n isInstantPhase: false\n });\n initialCurrentIdRef.current = null;\n }\n }, [state.currentId]);\n return /*#__PURE__*/React.createElement(FloatingDelayGroupContext.Provider, {\n value: React.useMemo(() => ({\n ...state,\n setState,\n setCurrentId\n }), [state, setState, setCurrentId])\n }, children);\n};\nconst useDelayGroup = (_ref2, _ref3) => {\n let {\n open,\n onOpenChange\n } = _ref2;\n let {\n id\n } = _ref3;\n const {\n currentId,\n setCurrentId,\n initialDelay,\n setState,\n timeoutMs\n } = useDelayGroupContext();\n React.useEffect(() => {\n if (currentId) {\n setState({\n delay: {\n open: 1,\n close: getDelay(initialDelay, 'close')\n }\n });\n if (currentId !== id) {\n onOpenChange(false);\n }\n }\n }, [id, onOpenChange, setState, currentId, initialDelay]);\n React.useEffect(() => {\n function unset() {\n onOpenChange(false);\n setState({\n delay: initialDelay,\n currentId: null\n });\n }\n if (!open && currentId === id) {\n if (timeoutMs) {\n const timeout = window.setTimeout(unset, timeoutMs);\n return () => {\n clearTimeout(timeout);\n };\n } else {\n unset();\n }\n }\n }, [open, setState, currentId, id, onOpenChange, initialDelay, timeoutMs]);\n React.useEffect(() => {\n if (open) {\n setCurrentId(id);\n }\n }, [open, setCurrentId, id]);\n};\n\nfunction _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n return target;\n };\n return _extends.apply(this, arguments);\n}\n\n/**\n * Find the real active element. Traverses into shadowRoots.\n */\nfunction activeElement$1(doc) {\n let activeElement = doc.activeElement;\n while (((_activeElement = activeElement) == null ? void 0 : (_activeElement$shadow = _activeElement.shadowRoot) == null ? void 0 : _activeElement$shadow.activeElement) != null) {\n var _activeElement, _activeElement$shadow;\n activeElement = activeElement.shadowRoot.activeElement;\n }\n return activeElement;\n}\n\nfunction contains(parent, child) {\n if (!parent || !child) {\n return false;\n }\n const rootNode = child.getRootNode && child.getRootNode();\n\n // First, attempt with faster native method\n if (parent.contains(child)) {\n return true;\n }\n // then fallback to custom implementation with Shadow DOM support\n else if (rootNode && isShadowRoot(rootNode)) {\n let next = child;\n do {\n if (next && parent === next) {\n return true;\n }\n // @ts-ignore\n next = next.parentNode || next.host;\n } while (next);\n }\n\n // Give up, the result is false\n return false;\n}\n\nlet rafId = 0;\nfunction enqueueFocus(el, options) {\n if (options === void 0) {\n options = {};\n }\n const {\n preventScroll = false,\n cancelPrevious = true,\n sync = false\n } = options;\n cancelPrevious && cancelAnimationFrame(rafId);\n const exec = () => el == null ? void 0 : el.focus({\n preventScroll\n });\n if (sync) {\n exec();\n } else {\n rafId = requestAnimationFrame(exec);\n }\n}\n\nfunction getAncestors(nodes, id) {\n var _nodes$find;\n let allAncestors = [];\n let currentParentId = (_nodes$find = nodes.find(node => node.id === id)) == null ? void 0 : _nodes$find.parentId;\n while (currentParentId) {\n const currentNode = nodes.find(node => node.id === currentParentId);\n currentParentId = currentNode == null ? void 0 : currentNode.parentId;\n if (currentNode) {\n allAncestors = allAncestors.concat(currentNode);\n }\n }\n return allAncestors;\n}\n\nfunction getChildren(nodes, id) {\n let allChildren = nodes.filter(node => {\n var _node$context;\n return node.parentId === id && ((_node$context = node.context) == null ? void 0 : _node$context.open);\n }) || [];\n let currentChildren = allChildren;\n while (currentChildren.length) {\n currentChildren = nodes.filter(node => {\n var _currentChildren;\n return (_currentChildren = currentChildren) == null ? void 0 : _currentChildren.some(n => {\n var _node$context2;\n return node.parentId === n.id && ((_node$context2 = node.context) == null ? void 0 : _node$context2.open);\n });\n }) || [];\n allChildren = allChildren.concat(currentChildren);\n }\n return allChildren;\n}\n\nfunction getTarget(event) {\n if ('composedPath' in event) {\n return event.composedPath()[0];\n }\n\n // TS thinks `event` is of type never as it assumes all browsers support\n // `composedPath()`, but browsers without shadow DOM don't.\n return event.target;\n}\n\nconst TYPEABLE_SELECTOR = \"input:not([type='hidden']):not([disabled]),\" + \"[contenteditable]:not([contenteditable='false']),textarea:not([disabled])\";\nfunction isTypeableElement(element) {\n return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR);\n}\n\nfunction stopEvent(event) {\n event.preventDefault();\n event.stopPropagation();\n}\n\nconst getTabbableOptions = () => ({\n getShadowRoot: true,\n displayCheck:\n // JSDOM does not support the `tabbable` library. To solve this we can\n // check if `ResizeObserver` is a real function (not polyfilled), which\n // determines if the current environment is JSDOM-like.\n typeof ResizeObserver === 'function' && ResizeObserver.toString().includes('[native code]') ? 'full' : 'none'\n});\nfunction getTabbableIn(container, direction) {\n const allTabbable = tabbable(container, getTabbableOptions());\n if (direction === 'prev') {\n allTabbable.reverse();\n }\n const activeIndex = allTabbable.indexOf(activeElement$1(getDocument(container)));\n const nextTabbableElements = allTabbable.slice(activeIndex + 1);\n return nextTabbableElements[0];\n}\nfunction getNextTabbable() {\n return getTabbableIn(document.body, 'next');\n}\nfunction getPreviousTabbable() {\n return getTabbableIn(document.body, 'prev');\n}\nfunction isOutsideEvent(event, container) {\n const containerElement = container || event.currentTarget;\n const relatedTarget = event.relatedTarget;\n return !relatedTarget || !contains(containerElement, relatedTarget);\n}\nfunction disableFocusInside(container) {\n const tabbableElements = tabbable(container, getTabbableOptions());\n tabbableElements.forEach(element => {\n element.dataset.tabindex = element.getAttribute('tabindex') || '';\n element.setAttribute('tabindex', '-1');\n });\n}\nfunction enableFocusInside(container) {\n const elements = container.querySelectorAll('[data-tabindex]');\n elements.forEach(element => {\n const tabindex = element.dataset.tabindex;\n delete element.dataset.tabindex;\n if (tabindex) {\n element.setAttribute('tabindex', tabindex);\n } else {\n element.removeAttribute('tabindex');\n }\n });\n}\n\n// `toString()` prevents bundlers from trying to `import { useInsertionEffect } from 'react'`\nconst useInsertionEffect = React[/*#__PURE__*/'useInsertionEffect'.toString()];\nconst useSafeInsertionEffect = useInsertionEffect || (fn => fn());\nfunction useEvent(callback) {\n const ref = React.useRef(() => {\n if (process.env.NODE_ENV !== \"production\") {\n throw new Error('Cannot call an event handler while rendering.');\n }\n });\n useSafeInsertionEffect(() => {\n ref.current = callback;\n });\n return React.useCallback(function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n return ref.current == null ? void 0 : ref.current(...args);\n }, []);\n}\n\n// See Diego Haz's Sandbox for making this logic work well on Safari/iOS:\n// https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/FocusTrap.tsx\n\nconst HIDDEN_STYLES = {\n border: 0,\n clip: 'rect(0 0 0 0)',\n height: '1px',\n margin: '-1px',\n overflow: 'hidden',\n padding: 0,\n position: 'fixed',\n whiteSpace: 'nowrap',\n width: '1px',\n top: 0,\n left: 0\n};\nlet activeElement;\nlet timeoutId;\nfunction setActiveElementOnTab(event) {\n if (event.key === 'Tab') {\n activeElement = event.target;\n clearTimeout(timeoutId);\n }\n}\nfunction isTabFocus(event) {\n const result = activeElement === event.relatedTarget;\n activeElement = event.relatedTarget;\n clearTimeout(timeoutId);\n return result;\n}\nconst FocusGuard = /*#__PURE__*/React.forwardRef(function FocusGuard(props, ref) {\n const onFocus = useEvent(props.onFocus);\n const [role, setRole] = React.useState();\n index(() => {\n if (isSafari()) {\n // Unlike other screen readers such as NVDA and JAWS, the virtual cursor\n // on VoiceOver does trigger the onFocus event, so we can use the focus\n // trap element. On Safari, only buttons trigger the onFocus event.\n // NB: \"group\" role in the Sandbox no longer appears to work, must be a\n // button role.\n setRole('button');\n }\n document.addEventListener('keydown', setActiveElementOnTab);\n return () => {\n document.removeEventListener('keydown', setActiveElementOnTab);\n };\n }, []);\n return /*#__PURE__*/React.createElement(\"span\", _extends({}, props, {\n ref: ref,\n tabIndex: 0\n // Role is only for VoiceOver\n ,\n role: role,\n \"aria-hidden\": role ? undefined : true,\n \"data-floating-ui-focus-guard\": \"\",\n style: HIDDEN_STYLES,\n onFocus: event => {\n if (isSafari() && isMac() && !isTabFocus(event)) {\n // On macOS we need to wait a little bit before moving\n // focus again.\n event.persist();\n timeoutId = window.setTimeout(() => {\n onFocus(event);\n }, 50);\n } else {\n onFocus(event);\n }\n }\n }));\n});\n\nconst PortalContext = /*#__PURE__*/React.createContext(null);\nconst useFloatingPortalNode = function (_temp) {\n let {\n id,\n enabled = true\n } = _temp === void 0 ? {} : _temp;\n const [portalEl, setPortalEl] = React.useState(null);\n const uniqueId = useId();\n const portalContext = usePortalContext();\n index(() => {\n if (!enabled) {\n return;\n }\n const rootNode = id ? document.getElementById(id) : null;\n if (rootNode) {\n rootNode.setAttribute('data-floating-ui-portal', '');\n setPortalEl(rootNode);\n } else {\n const newPortalEl = document.createElement('div');\n if (id !== '') {\n newPortalEl.id = id || uniqueId;\n }\n newPortalEl.setAttribute('data-floating-ui-portal', '');\n setPortalEl(newPortalEl);\n const container = (portalContext == null ? void 0 : portalContext.portalNode) || document.body;\n container.appendChild(newPortalEl);\n return () => {\n container.removeChild(newPortalEl);\n };\n }\n }, [id, portalContext, uniqueId, enabled]);\n return portalEl;\n};\n\n/**\n * Portals the floating element into a given container element — by default,\n * outside of the app root and into the body.\n * @see https://floating-ui.com/docs/FloatingPortal\n */\nconst FloatingPortal = _ref => {\n let {\n children,\n id,\n root = null,\n preserveTabOrder = true\n } = _ref;\n const portalNode = useFloatingPortalNode({\n id,\n enabled: !root\n });\n const [focusManagerState, setFocusManagerState] = React.useState(null);\n const beforeOutsideRef = React.useRef(null);\n const afterOutsideRef = React.useRef(null);\n const beforeInsideRef = React.useRef(null);\n const afterInsideRef = React.useRef(null);\n const shouldRenderGuards =\n // The FocusManager and therefore floating element are currently open/\n // rendered.\n !!focusManagerState &&\n // Guards are only for non-modal focus management.\n !focusManagerState.modal && !!(root || portalNode) && preserveTabOrder;\n\n // https://codesandbox.io/s/tabbable-portal-f4tng?file=/src/TabbablePortal.tsx\n React.useEffect(() => {\n if (!portalNode || !preserveTabOrder || focusManagerState != null && focusManagerState.modal) {\n return;\n }\n\n // Make sure elements inside the portal element are tabbable only when the\n // portal has already been focused, either by tabbing into a focus trap\n // element outside or using the mouse.\n function onFocus(event) {\n if (portalNode && isOutsideEvent(event)) {\n const focusing = event.type === 'focusin';\n const manageFocus = focusing ? enableFocusInside : disableFocusInside;\n manageFocus(portalNode);\n }\n }\n // Listen to the event on the capture phase so they run before the focus\n // trap elements onFocus prop is called.\n portalNode.addEventListener('focusin', onFocus, true);\n portalNode.addEventListener('focusout', onFocus, true);\n return () => {\n portalNode.removeEventListener('focusin', onFocus, true);\n portalNode.removeEventListener('focusout', onFocus, true);\n };\n }, [portalNode, preserveTabOrder, focusManagerState == null ? void 0 : focusManagerState.modal]);\n return /*#__PURE__*/React.createElement(PortalContext.Provider, {\n value: React.useMemo(() => ({\n preserveTabOrder,\n beforeOutsideRef,\n afterOutsideRef,\n beforeInsideRef,\n afterInsideRef,\n portalNode,\n setFocusManagerState\n }), [preserveTabOrder, portalNode])\n }, shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"outside\",\n ref: beforeOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _beforeInsideRef$curr;\n (_beforeInsideRef$curr = beforeInsideRef.current) == null ? void 0 : _beforeInsideRef$curr.focus();\n } else {\n const prevTabbable = getPreviousTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);\n prevTabbable == null ? void 0 : prevTabbable.focus();\n }\n }\n }), shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(\"span\", {\n \"aria-owns\": portalNode.id,\n style: HIDDEN_STYLES\n }), root ? /*#__PURE__*/createPortal(children, root) : portalNode ? /*#__PURE__*/createPortal(children, portalNode) : null, shouldRenderGuards && portalNode && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"outside\",\n ref: afterOutsideRef,\n onFocus: event => {\n if (isOutsideEvent(event, portalNode)) {\n var _afterInsideRef$curre;\n (_afterInsideRef$curre = afterInsideRef.current) == null ? void 0 : _afterInsideRef$curre.focus();\n } else {\n const nextTabbable = getNextTabbable() || (focusManagerState == null ? void 0 : focusManagerState.refs.domReference.current);\n nextTabbable == null ? void 0 : nextTabbable.focus();\n (focusManagerState == null ? void 0 : focusManagerState.closeOnFocusOut) && (focusManagerState == null ? void 0 : focusManagerState.onOpenChange(false));\n }\n }\n }));\n};\nconst usePortalContext = () => React.useContext(PortalContext);\n\nconst VisuallyHiddenDismiss = /*#__PURE__*/React.forwardRef(function VisuallyHiddenDismiss(props, ref) {\n return /*#__PURE__*/React.createElement(\"button\", _extends({}, props, {\n type: \"button\",\n ref: ref,\n tabIndex: -1,\n style: HIDDEN_STYLES\n }));\n});\n/**\n * Provides focus management for the floating element.\n * @see https://floating-ui.com/docs/FloatingFocusManager\n */\nfunction FloatingFocusManager(_ref) {\n let {\n context,\n children,\n order = ['content'],\n guards = true,\n initialFocus = 0,\n returnFocus = true,\n modal = true,\n visuallyHiddenDismiss = false,\n closeOnFocusOut = true\n } = _ref;\n const {\n refs,\n nodeId,\n onOpenChange,\n events,\n dataRef,\n elements: {\n domReference,\n floating\n }\n } = context;\n const orderRef = useLatestRef(order);\n const tree = useFloatingTree();\n const portalContext = usePortalContext();\n const [tabbableContentLength, setTabbableContentLength] = React.useState(null);\n\n // Controlled by `useListNavigation`.\n const ignoreInitialFocus = typeof initialFocus === 'number' && initialFocus < 0;\n const startDismissButtonRef = React.useRef(null);\n const endDismissButtonRef = React.useRef(null);\n const preventReturnFocusRef = React.useRef(false);\n const previouslyFocusedElementRef = React.useRef(null);\n const isPointerDownRef = React.useRef(false);\n const isInsidePortal = portalContext != null;\n\n // If the reference is a combobox and is typeable (e.g. input/textarea),\n // there are different focus semantics. The guards should not be rendered, but\n // aria-hidden should be applied to all nodes still. Further, the visually\n // hidden dismiss button should only appear at the end of the list, not the\n // start.\n const isTypeableCombobox = domReference && domReference.getAttribute('role') === 'combobox' && isTypeableElement(domReference);\n const getTabbableContent = React.useCallback(function (container) {\n if (container === void 0) {\n container = floating;\n }\n return container ? tabbable(container, getTabbableOptions()) : [];\n }, [floating]);\n const getTabbableElements = React.useCallback(container => {\n const content = getTabbableContent(container);\n return orderRef.current.map(type => {\n if (domReference && type === 'reference') {\n return domReference;\n }\n if (floating && type === 'floating') {\n return floating;\n }\n return content;\n }).filter(Boolean).flat();\n }, [domReference, floating, orderRef, getTabbableContent]);\n React.useEffect(() => {\n if (!modal) {\n return;\n }\n function onKeyDown(event) {\n if (event.key === 'Tab') {\n // The focus guards have nothing to focus, so we need to stop the event.\n if (getTabbableContent().length === 0 && !isTypeableCombobox) {\n stopEvent(event);\n }\n const els = getTabbableElements();\n const target = getTarget(event);\n if (orderRef.current[0] === 'reference' && target === domReference) {\n stopEvent(event);\n if (event.shiftKey) {\n enqueueFocus(els[els.length - 1]);\n } else {\n enqueueFocus(els[1]);\n }\n }\n if (orderRef.current[1] === 'floating' && target === floating && event.shiftKey) {\n stopEvent(event);\n enqueueFocus(els[0]);\n }\n }\n }\n const doc = getDocument(floating);\n doc.addEventListener('keydown', onKeyDown);\n return () => {\n doc.removeEventListener('keydown', onKeyDown);\n };\n }, [domReference, floating, modal, orderRef, refs, isTypeableCombobox, getTabbableContent, getTabbableElements]);\n React.useEffect(() => {\n if (!closeOnFocusOut) {\n return;\n }\n\n // In Safari, buttons lose focus when pressing them.\n function handlePointerDown() {\n isPointerDownRef.current = true;\n setTimeout(() => {\n isPointerDownRef.current = false;\n });\n }\n function handleFocusOutside(event) {\n const relatedTarget = event.relatedTarget;\n const movedToUnrelatedNode = !(contains(domReference, relatedTarget) || contains(floating, relatedTarget) || contains(relatedTarget, floating) || contains(portalContext == null ? void 0 : portalContext.portalNode, relatedTarget) || relatedTarget != null && relatedTarget.hasAttribute('data-floating-ui-focus-guard') || tree && (getChildren(tree.nodesRef.current, nodeId).find(node => {\n var _node$context, _node$context2;\n return contains((_node$context = node.context) == null ? void 0 : _node$context.elements.floating, relatedTarget) || contains((_node$context2 = node.context) == null ? void 0 : _node$context2.elements.domReference, relatedTarget);\n }) || getAncestors(tree.nodesRef.current, nodeId).find(node => {\n var _node$context3, _node$context4;\n return ((_node$context3 = node.context) == null ? void 0 : _node$context3.elements.floating) === relatedTarget || ((_node$context4 = node.context) == null ? void 0 : _node$context4.elements.domReference) === relatedTarget;\n })));\n\n // Focus did not move inside the floating tree, and there are no tabbable\n // portal guards to handle closing.\n if (relatedTarget && movedToUnrelatedNode && !isPointerDownRef.current &&\n // Fix React 18 Strict Mode returnFocus due to double rendering.\n relatedTarget !== previouslyFocusedElementRef.current) {\n preventReturnFocusRef.current = true;\n // On iOS VoiceOver, dismissing the nested submenu will cause the\n // first item of the list to receive focus. Delaying it appears to fix\n // the issue.\n setTimeout(() => onOpenChange(false));\n }\n }\n if (floating && isHTMLElement(domReference)) {\n domReference.addEventListener('focusout', handleFocusOutside);\n domReference.addEventListener('pointerdown', handlePointerDown);\n !modal && floating.addEventListener('focusout', handleFocusOutside);\n return () => {\n domReference.removeEventListener('focusout', handleFocusOutside);\n domReference.removeEventListener('pointerdown', handlePointerDown);\n !modal && floating.removeEventListener('focusout', handleFocusOutside);\n };\n }\n }, [domReference, floating, modal, nodeId, tree, portalContext, onOpenChange, closeOnFocusOut]);\n React.useEffect(() => {\n var _portalContext$portal;\n // Don't hide portals nested within the parent portal.\n const portalNodes = Array.from((portalContext == null ? void 0 : (_portalContext$portal = portalContext.portalNode) == null ? void 0 : _portalContext$portal.querySelectorAll('[data-floating-ui-portal]')) || []);\n function getDismissButtons() {\n return [startDismissButtonRef.current, endDismissButtonRef.current].filter(Boolean);\n }\n if (floating && modal) {\n const insideNodes = [floating, ...portalNodes, ...getDismissButtons()];\n const cleanup = hideOthers(orderRef.current.includes('reference') || isTypeableCombobox ? insideNodes.concat(domReference || []) : insideNodes);\n return () => {\n cleanup();\n };\n }\n }, [domReference, floating, modal, orderRef, portalContext, isTypeableCombobox]);\n React.useEffect(() => {\n if (modal && !guards && floating) {\n const tabIndexValues = [];\n const options = getTabbableOptions();\n const allTabbable = tabbable(getDocument(floating).body, options);\n const floatingTabbable = getTabbableElements();\n\n // Exclude all tabbable elements that are part of the order\n const elements = allTabbable.filter(el => !floatingTabbable.includes(el));\n elements.forEach((el, i) => {\n tabIndexValues[i] = el.getAttribute('tabindex');\n el.setAttribute('tabindex', '-1');\n });\n return () => {\n elements.forEach((el, i) => {\n const value = tabIndexValues[i];\n if (value == null) {\n el.removeAttribute('tabindex');\n } else {\n el.setAttribute('tabindex', value);\n }\n });\n };\n }\n }, [floating, modal, guards, getTabbableElements]);\n index(() => {\n if (!floating) return;\n const doc = getDocument(floating);\n let returnFocusValue = returnFocus;\n let preventReturnFocusScroll = false;\n const previouslyFocusedElement = activeElement$1(doc);\n const contextData = dataRef.current;\n previouslyFocusedElementRef.current = previouslyFocusedElement;\n const focusableElements = getTabbableElements(floating);\n const elToFocus = (typeof initialFocus === 'number' ? focusableElements[initialFocus] : initialFocus.current) || floating;\n\n // If the `useListNavigation` hook is active, always ignore `initialFocus`\n // because it has its own handling of the initial focus.\n !ignoreInitialFocus && enqueueFocus(elToFocus, {\n preventScroll: elToFocus === floating\n });\n\n // Dismissing via outside press should always ignore `returnFocus` to\n // prevent unwanted scrolling.\n function onDismiss(payload) {\n if (payload.type === 'escapeKey' && refs.domReference.current) {\n previouslyFocusedElementRef.current = refs.domReference.current;\n }\n if (['referencePress', 'escapeKey'].includes(payload.type)) {\n return;\n }\n const returnFocus = payload.data.returnFocus;\n if (typeof returnFocus === 'object') {\n returnFocusValue = true;\n preventReturnFocusScroll = returnFocus.preventScroll;\n } else {\n returnFocusValue = returnFocus;\n }\n }\n events.on('dismiss', onDismiss);\n return () => {\n events.off('dismiss', onDismiss);\n if (contains(floating, activeElement$1(doc)) && refs.domReference.current) {\n previouslyFocusedElementRef.current = refs.domReference.current;\n }\n if (returnFocusValue && isHTMLElement(previouslyFocusedElementRef.current) && !preventReturnFocusRef.current) {\n // `isPointerDownRef.current` to avoid the focus ring from appearing on\n // the reference element when click-toggling it.\n if (!refs.domReference.current || isPointerDownRef.current) {\n enqueueFocus(previouslyFocusedElementRef.current, {\n // When dismissing nested floating elements, by the time the rAF has\n // executed, the menus will all have been unmounted. When they try\n // to get focused, the calls get ignored — leaving the root\n // reference focused as desired.\n cancelPrevious: false,\n preventScroll: preventReturnFocusScroll\n });\n } else {\n var _previouslyFocusedEle;\n // If the user has specified a `keydown` listener that calls\n // setOpen(false) (e.g. selecting an item and closing the floating\n // element), then sync return focus causes `useClick` to immediately\n // re-open it, unless they call `event.preventDefault()` in the\n // `keydown` listener. This helps keep backwards compatibility with\n // older examples.\n contextData.__syncReturnFocus = true;\n\n // In Safari, `useListNavigation` moves focus sync, so making this\n // sync ensures the initial item remains focused despite this being\n // invoked in Strict Mode due to double-invoked useEffects. This also\n // has the positive side effect of closing a modally focus-managed\n // on `Tab` keydown to move naturally to the next focusable\n // element.\n (_previouslyFocusedEle = previouslyFocusedElementRef.current) == null ? void 0 : _previouslyFocusedEle.focus({\n preventScroll: preventReturnFocusScroll\n });\n setTimeout(() => {\n // This isn't an actual property the user should access, make sure\n // it doesn't persist.\n delete contextData.__syncReturnFocus;\n });\n }\n }\n };\n }, [floating, getTabbableElements, initialFocus, returnFocus, dataRef, refs, events, ignoreInitialFocus]);\n\n // Synchronize the `context` & `modal` value to the FloatingPortal context.\n // It will decide whether or not it needs to render its own guards.\n index(() => {\n if (!portalContext) return;\n portalContext.setFocusManagerState({\n ...context,\n modal,\n closeOnFocusOut\n // Not concerned about the generic type.\n });\n\n return () => {\n portalContext.setFocusManagerState(null);\n };\n }, [portalContext, modal, closeOnFocusOut, context]);\n index(() => {\n if (ignoreInitialFocus || !floating) return;\n function setState() {\n setTabbableContentLength(getTabbableContent().length);\n }\n setState();\n if (typeof MutationObserver === 'function') {\n const observer = new MutationObserver(setState);\n observer.observe(floating, {\n childList: true,\n subtree: true\n });\n return () => {\n observer.disconnect();\n };\n }\n }, [floating, getTabbableContent, ignoreInitialFocus, refs]);\n const shouldRenderGuards = guards && (isInsidePortal || modal) && !isTypeableCombobox;\n function renderDismissButton(location) {\n return visuallyHiddenDismiss && modal ? /*#__PURE__*/React.createElement(VisuallyHiddenDismiss, {\n ref: location === 'start' ? startDismissButtonRef : endDismissButtonRef,\n onClick: () => onOpenChange(false)\n }, typeof visuallyHiddenDismiss === 'string' ? visuallyHiddenDismiss : 'Dismiss') : null;\n }\n return /*#__PURE__*/React.createElement(React.Fragment, null, shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"inside\",\n ref: portalContext == null ? void 0 : portalContext.beforeInsideRef,\n onFocus: event => {\n if (modal) {\n const els = getTabbableElements();\n enqueueFocus(order[0] === 'reference' ? els[0] : els[els.length - 1]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n preventReturnFocusRef.current = false;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const nextTabbable = getNextTabbable() || domReference;\n nextTabbable == null ? void 0 : nextTabbable.focus();\n } else {\n var _portalContext$before;\n (_portalContext$before = portalContext.beforeOutsideRef.current) == null ? void 0 : _portalContext$before.focus();\n }\n }\n }\n }), isTypeableCombobox ? null : renderDismissButton('start'), /*#__PURE__*/React.cloneElement(children, tabbableContentLength === 0 || order.includes('floating') ? {\n tabIndex: 0\n } : {}), renderDismissButton('end'), shouldRenderGuards && /*#__PURE__*/React.createElement(FocusGuard, {\n \"data-type\": \"inside\",\n ref: portalContext == null ? void 0 : portalContext.afterInsideRef,\n onFocus: event => {\n if (modal) {\n enqueueFocus(getTabbableElements()[0]);\n } else if (portalContext != null && portalContext.preserveTabOrder && portalContext.portalNode) {\n preventReturnFocusRef.current = true;\n if (isOutsideEvent(event, portalContext.portalNode)) {\n const prevTabbable = getPreviousTabbable() || domReference;\n prevTabbable == null ? void 0 : prevTabbable.focus();\n } else {\n var _portalContext$afterO;\n (_portalContext$afterO = portalContext.afterOutsideRef.current) == null ? void 0 : _portalContext$afterO.focus();\n }\n }\n }\n }));\n}\n\nconst identifier = 'data-floating-ui-scroll-lock';\n\n/**\n * Provides base styling for a fixed overlay element to dim content or block\n * pointer events behind a floating element.\n * It's a regular `
`, 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 * Opens or closes the floating element when clicking the reference element.\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 * Closes the floating element when a dismissal is requested — by default, when\n * the user presses the `escape` key or outside of the floating element.\n * @see https://floating-ui.com/docs/useDismiss\n */\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 * Opens the floating element while the reference element has focus, like CSS\n * `: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 arrow key-based navigation of a list of items, either using real DOM\n * focus or virtual focus.\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\n/**\n * Merges an array of refs into a single memoized callback ref or `null`.\n * @see https://floating-ui.com/docs/useMergeRefs\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 base screen reader props to the reference and floating elements for a\n * given floating 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' || status === 'unmounted') {\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 refs\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 var _refs$floating$curren;\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 ? (_refs$floating$curren = refs.floating.current) != null && _refs$floating$curren.contains(target) ? target.closest('[role=\"dialog\"],[role=\"menu\"],[role=\"listbox\"],[role=\"tree\"],[role=\"grid\"]') !== event.currentTarget : false : !event.currentTarget.contains(target))) {\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, refs]);\n};\n\nfunction getArgsWithCustomFloatingHeight(state, height) {\n return {\n ...state,\n rects: {\n ...state.rects,\n floating: {\n ...state.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(state) {\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 } = state;\n const item = listRef.current[index];\n if (process.env.NODE_ENV !== \"production\") {\n if (!state.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 ...state,\n ...(await offset(-item.offsetTop - rects.reference.height / 2 - item.offsetHeight / 2 - innerOffset).fn(state))\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 if (!isLeave) {\n return;\n }\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\n/**\n * Provides data to position a floating element and context to add interactions.\n * @see https://floating-ui.com/docs/react\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","import { rem } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nfunction horizontalSide(placement, arrowY, arrowOffset, arrowPosition) {\n if (placement === \"center\" || arrowPosition === \"center\") {\n return { top: arrowY };\n }\n if (placement === \"end\") {\n return { bottom: arrowOffset };\n }\n if (placement === \"start\") {\n return { top: arrowOffset };\n }\n return {};\n}\nfunction verticalSide(placement, arrowX, arrowOffset, arrowPosition, dir) {\n if (placement === \"center\" || arrowPosition === \"center\") {\n return { left: arrowX };\n }\n if (placement === \"end\") {\n return { [dir === \"ltr\" ? \"right\" : \"left\"]: arrowOffset };\n }\n if (placement === \"start\") {\n return { [dir === \"ltr\" ? \"left\" : \"right\"]: arrowOffset };\n }\n return {};\n}\nconst radiusByFloatingSide = {\n bottom: \"borderTopLeftRadius\",\n left: \"borderTopRightRadius\",\n right: \"borderBottomLeftRadius\",\n top: \"borderBottomRightRadius\"\n};\nfunction getArrowPositionStyles({\n position,\n arrowSize,\n arrowOffset,\n arrowRadius,\n arrowPosition,\n arrowX,\n arrowY,\n dir\n}) {\n const [side, placement = \"center\"] = position.split(\"-\");\n const baseStyles = {\n width: rem(arrowSize),\n height: rem(arrowSize),\n transform: \"rotate(45deg)\",\n position: \"absolute\",\n [radiusByFloatingSide[side]]: rem(arrowRadius)\n };\n const arrowPlacement = rem(-arrowSize / 2);\n if (side === \"left\") {\n return __spreadProps(__spreadValues(__spreadValues({}, baseStyles), horizontalSide(placement, arrowY, arrowOffset, arrowPosition)), {\n right: arrowPlacement,\n borderLeftColor: \"transparent\",\n borderBottomColor: \"transparent\"\n });\n }\n if (side === \"right\") {\n return __spreadProps(__spreadValues(__spreadValues({}, baseStyles), horizontalSide(placement, arrowY, arrowOffset, arrowPosition)), {\n left: arrowPlacement,\n borderRightColor: \"transparent\",\n borderTopColor: \"transparent\"\n });\n }\n if (side === \"top\") {\n return __spreadProps(__spreadValues(__spreadValues({}, baseStyles), verticalSide(placement, arrowX, arrowOffset, arrowPosition, dir)), {\n bottom: arrowPlacement,\n borderTopColor: \"transparent\",\n borderLeftColor: \"transparent\"\n });\n }\n if (side === \"bottom\") {\n return __spreadProps(__spreadValues(__spreadValues({}, baseStyles), verticalSide(placement, arrowX, arrowOffset, arrowPosition, dir)), {\n top: arrowPlacement,\n borderBottomColor: \"transparent\",\n borderRightColor: \"transparent\"\n });\n }\n return {};\n}\n\nexport { getArrowPositionStyles };\n//# sourceMappingURL=get-arrow-position-styles.js.map\n","import React, { forwardRef } from 'react';\nimport { useMantineTheme } from '@mantine/styles';\nimport { getArrowPositionStyles } from './get-arrow-position-styles.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst FloatingArrow = forwardRef((_a, ref) => {\n var _b = _a, {\n position,\n arrowSize,\n arrowOffset,\n arrowRadius,\n arrowPosition,\n visible,\n arrowX,\n arrowY\n } = _b, others = __objRest(_b, [\n \"position\",\n \"arrowSize\",\n \"arrowOffset\",\n \"arrowRadius\",\n \"arrowPosition\",\n \"visible\",\n \"arrowX\",\n \"arrowY\"\n ]);\n const theme = useMantineTheme();\n if (!visible) {\n return null;\n }\n return /* @__PURE__ */ React.createElement(\"div\", __spreadProps(__spreadValues({}, others), {\n ref,\n style: getArrowPositionStyles({\n position,\n arrowSize,\n arrowOffset,\n arrowRadius,\n arrowPosition,\n dir: theme.dir,\n arrowX,\n arrowY\n })\n }));\n});\nFloatingArrow.displayName = \"@mantine/core/FloatingArrow\";\n\nexport { FloatingArrow };\n//# sourceMappingURL=FloatingArrow.js.map\n","function getFloatingPosition(dir, position) {\n if (dir === \"rtl\" && (position.includes(\"right\") || position.includes(\"left\"))) {\n const [side, placement] = position.split(\"-\");\n const flippedPosition = side === \"right\" ? \"left\" : \"right\";\n return placement === void 0 ? flippedPosition : `${flippedPosition}-${placement}`;\n }\n return position;\n}\n\nexport { getFloatingPosition };\n//# sourceMappingURL=get-floating-position.js.map\n","import { useState, useEffect } from 'react';\nimport { autoUpdate } from '@floating-ui/react';\nimport { useDidUpdate } from '@mantine/hooks';\n\nfunction useFloatingAutoUpdate({\n opened,\n floating,\n position,\n positionDependencies\n}) {\n const [delayedUpdate, setDelayedUpdate] = useState(0);\n useEffect(() => {\n if (floating.refs.reference.current && floating.refs.floating.current) {\n return autoUpdate(floating.refs.reference.current, floating.refs.floating.current, floating.update);\n }\n return void 0;\n }, [\n floating.refs.reference.current,\n floating.refs.floating.current,\n opened,\n delayedUpdate,\n position\n ]);\n useDidUpdate(() => {\n floating.update();\n }, positionDependencies);\n useDidUpdate(() => {\n setDelayedUpdate((c) => c + 1);\n }, [opened]);\n}\n\nexport { useFloatingAutoUpdate };\n//# sourceMappingURL=use-floating-auto-update.js.map\n","import { createSafeContext } from '@mantine/utils';\n\nconst [ListProvider, useListContext] = createSafeContext(\"List component was not found in tree\");\n\nexport { ListProvider, useListContext };\n//# sourceMappingURL=List.context.js.map\n","import { createStyles, getStylesRef, getSize } from '@mantine/styles';\n\nvar useStyles = createStyles((theme, { spacing, center }) => ({\n itemWrapper: {\n ref: getStylesRef(\"itemWrapper\"),\n display: \"inline-flex\",\n flexDirection: \"column\",\n whiteSpace: \"normal\"\n },\n item: {\n whiteSpace: \"nowrap\",\n lineHeight: center ? 1 : theme.lineHeight,\n \"&:not(:first-of-type)\": {\n marginTop: getSize({ size: spacing, sizes: theme.spacing })\n },\n \"&[data-with-icon]\": {\n listStyle: \"none\",\n [`& .${getStylesRef(\"itemWrapper\")}`]: {\n display: \"inline-flex\",\n alignItems: center ? \"center\" : \"flex-start\",\n flexDirection: \"row\"\n }\n }\n },\n itemIcon: {\n display: \"inline-block\",\n verticalAlign: \"middle\",\n marginRight: theme.spacing.sm\n }\n}));\n\nexport default useStyles;\n//# sourceMappingURL=ListItem.styles.js.map\n","import React, { forwardRef } from 'react';\nimport { useComponentDefaultProps } from '@mantine/styles';\nimport { useListContext } from '../List.context.js';\nimport useStyles from './ListItem.styles.js';\nimport { Box } from '../../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst defaultProps = {};\nconst ListItem = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"ListItem\", defaultProps, props), { className, children, icon } = _a, others = __objRest(_a, [\"className\", \"children\", \"icon\"]);\n const {\n icon: ctxIcon,\n spacing,\n center,\n listStyleType,\n size,\n withPadding,\n classNames,\n styles,\n unstyled,\n variant\n } = useListContext();\n const _icon = icon || ctxIcon;\n const { classes, cx } = useStyles({ withPadding, listStyleType, center, spacing }, { classNames, styles, unstyled, name: \"List\", variant, size });\n return /* @__PURE__ */ React.createElement(Box, __spreadValues({\n component: \"li\",\n className: cx(classes.item, className),\n \"data-with-icon\": !!_icon || void 0,\n ref\n }, others), /* @__PURE__ */ React.createElement(\"div\", {\n className: classes.itemWrapper\n }, _icon && /* @__PURE__ */ React.createElement(\"span\", {\n className: classes.itemIcon\n }, _icon), /* @__PURE__ */ React.createElement(\"span\", null, children)));\n});\nListItem.displayName = \"@mantine/core/ListItem\";\n\nexport { ListItem };\n//# sourceMappingURL=ListItem.js.map\n","import { createStyles, getSize } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar useStyles = createStyles((theme, { withPadding, listStyleType }, { size }) => ({\n root: __spreadProps(__spreadValues({}, theme.fn.fontStyles()), {\n listStyleType,\n color: theme.colorScheme === \"dark\" ? theme.colors.dark[0] : theme.black,\n fontSize: getSize({ size, sizes: theme.fontSizes }),\n lineHeight: theme.lineHeight,\n margin: 0,\n paddingLeft: withPadding ? theme.spacing.xl : 0,\n listStylePosition: \"inside\"\n })\n}));\n\nexport default useStyles;\n//# sourceMappingURL=List.styles.js.map\n","import React, { forwardRef } from 'react';\nimport { useComponentDefaultProps } from '@mantine/styles';\nimport { ListItem } from './ListItem/ListItem.js';\nimport { ListProvider } from './List.context.js';\nimport useStyles from './List.styles.js';\nimport { Box } from '../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst defaultProps = {\n type: \"unordered\",\n size: \"md\",\n spacing: 0\n};\nconst List = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"List\", defaultProps, props), {\n children,\n type,\n size,\n listStyleType,\n withPadding,\n center,\n spacing,\n icon,\n className,\n styles,\n classNames,\n unstyled,\n variant\n } = _a, others = __objRest(_a, [\n \"children\",\n \"type\",\n \"size\",\n \"listStyleType\",\n \"withPadding\",\n \"center\",\n \"spacing\",\n \"icon\",\n \"className\",\n \"styles\",\n \"classNames\",\n \"unstyled\",\n \"variant\"\n ]);\n const { classes, cx } = useStyles({ withPadding, listStyleType, center, spacing }, { classNames, styles, name: \"List\", unstyled, size, variant });\n return /* @__PURE__ */ React.createElement(ListProvider, {\n value: {\n spacing,\n center,\n icon,\n listStyleType,\n size,\n withPadding,\n classNames,\n styles,\n unstyled,\n variant\n }\n }, /* @__PURE__ */ React.createElement(Box, __spreadValues({\n component: type === \"unordered\" ? \"ul\" : \"ol\",\n className: cx(classes.root, className),\n ref\n }, others), children));\n});\nList.Item = ListItem;\nList.displayName = \"@mantine/core/List\";\n\nexport { List };\n//# sourceMappingURL=List.js.map\n","import React, { useState, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useIsomorphicEffect } from '@mantine/hooks';\nimport { useComponentDefaultProps, useMantineTheme } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction Portal(props) {\n const _a = useComponentDefaultProps(\"Portal\", {}, props), { children, target, className, innerRef } = _a, others = __objRest(_a, [\"children\", \"target\", \"className\", \"innerRef\"]);\n const theme = useMantineTheme();\n const [mounted, setMounted] = useState(false);\n const ref = useRef();\n useIsomorphicEffect(() => {\n setMounted(true);\n ref.current = !target ? document.createElement(\"div\") : typeof target === \"string\" ? document.querySelector(target) : target;\n if (!target) {\n document.body.appendChild(ref.current);\n }\n return () => {\n !target && document.body.removeChild(ref.current);\n };\n }, [target]);\n if (!mounted) {\n return null;\n }\n return createPortal(/* @__PURE__ */ React.createElement(\"div\", __spreadProps(__spreadValues({\n className,\n dir: theme.dir\n }, others), {\n ref: innerRef\n }), children), ref.current);\n}\nPortal.displayName = \"@mantine/core/Portal\";\n\nexport { Portal };\n//# sourceMappingURL=Portal.js.map\n","import React from 'react';\nimport { Portal } from './Portal.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction OptionalPortal(_a) {\n var _b = _a, { withinPortal = true, children } = _b, others = __objRest(_b, [\"withinPortal\", \"children\"]);\n if (withinPortal) {\n return /* @__PURE__ */ React.createElement(Portal, __spreadValues({}, others), children);\n }\n return /* @__PURE__ */ React.createElement(React.Fragment, null, children);\n}\nOptionalPortal.displayName = \"@mantine/core/OptionalPortal\";\n\nexport { OptionalPortal };\n//# sourceMappingURL=OptionalPortal.js.map\n","import { rem } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst popIn = {\n in: { opacity: 1, transform: \"scale(1)\" },\n out: { opacity: 0, transform: `scale(.9) translateY(${rem(10)})` },\n transitionProperty: \"transform, opacity\"\n};\nconst transitions = {\n fade: {\n in: { opacity: 1 },\n out: { opacity: 0 },\n transitionProperty: \"opacity\"\n },\n scale: {\n in: { opacity: 1, transform: \"scale(1)\" },\n out: { opacity: 0, transform: \"scale(0)\" },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"scale-y\": {\n in: { opacity: 1, transform: \"scaleY(1)\" },\n out: { opacity: 0, transform: \"scaleY(0)\" },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"scale-x\": {\n in: { opacity: 1, transform: \"scaleX(1)\" },\n out: { opacity: 0, transform: \"scaleX(0)\" },\n common: { transformOrigin: \"left\" },\n transitionProperty: \"transform, opacity\"\n },\n \"skew-up\": {\n in: { opacity: 1, transform: \"translateY(0) skew(0deg, 0deg)\" },\n out: { opacity: 0, transform: `translateY(-${rem(20)}) skew(-10deg, -5deg)` },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"skew-down\": {\n in: { opacity: 1, transform: \"translateY(0) skew(0deg, 0deg)\" },\n out: { opacity: 0, transform: `translateY(${rem(20)}) skew(-10deg, -5deg)` },\n common: { transformOrigin: \"bottom\" },\n transitionProperty: \"transform, opacity\"\n },\n \"rotate-left\": {\n in: { opacity: 1, transform: \"translateY(0) rotate(0deg)\" },\n out: { opacity: 0, transform: `translateY(${rem(20)}) rotate(-5deg)` },\n common: { transformOrigin: \"bottom\" },\n transitionProperty: \"transform, opacity\"\n },\n \"rotate-right\": {\n in: { opacity: 1, transform: \"translateY(0) rotate(0deg)\" },\n out: { opacity: 0, transform: `translateY(${rem(20)}) rotate(5deg)` },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"slide-down\": {\n in: { opacity: 1, transform: \"translateY(0)\" },\n out: { opacity: 0, transform: \"translateY(-100%)\" },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"slide-up\": {\n in: { opacity: 1, transform: \"translateY(0)\" },\n out: { opacity: 0, transform: \"translateY(100%)\" },\n common: { transformOrigin: \"bottom\" },\n transitionProperty: \"transform, opacity\"\n },\n \"slide-left\": {\n in: { opacity: 1, transform: \"translateX(0)\" },\n out: { opacity: 0, transform: \"translateX(100%)\" },\n common: { transformOrigin: \"left\" },\n transitionProperty: \"transform, opacity\"\n },\n \"slide-right\": {\n in: { opacity: 1, transform: \"translateX(0)\" },\n out: { opacity: 0, transform: \"translateX(-100%)\" },\n common: { transformOrigin: \"right\" },\n transitionProperty: \"transform, opacity\"\n },\n pop: __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"center center\" }\n }),\n \"pop-bottom-left\": __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"bottom left\" }\n }),\n \"pop-bottom-right\": __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"bottom right\" }\n }),\n \"pop-top-left\": __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"top left\" }\n }),\n \"pop-top-right\": __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"top right\" }\n })\n};\n\nexport { transitions };\n//# sourceMappingURL=transitions.js.map\n","import { transitions } from '../transitions.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst transitionStatuses = {\n entering: \"in\",\n entered: \"in\",\n exiting: \"out\",\n exited: \"out\",\n \"pre-exiting\": \"out\",\n \"pre-entering\": \"out\"\n};\nfunction getTransitionStyles({\n transition,\n state,\n duration,\n timingFunction\n}) {\n const shared = {\n transitionDuration: `${duration}ms`,\n transitionTimingFunction: timingFunction\n };\n if (typeof transition === \"string\") {\n if (!(transition in transitions)) {\n return null;\n }\n return __spreadValues(__spreadValues(__spreadValues({\n transitionProperty: transitions[transition].transitionProperty\n }, shared), transitions[transition].common), transitions[transition][transitionStatuses[state]]);\n }\n return __spreadValues(__spreadValues(__spreadValues({\n transitionProperty: transition.transitionProperty\n }, shared), transition.common), transition[transitionStatuses[state]]);\n}\n\nexport { getTransitionStyles };\n//# sourceMappingURL=get-transition-styles.js.map\n","import React from 'react';\nimport { getTransitionStyles } from './get-transition-styles/get-transition-styles.js';\nimport { useTransition } from './use-transition.js';\n\nfunction Transition({\n keepMounted,\n transition,\n duration = 250,\n exitDuration = duration,\n mounted,\n children,\n timingFunction,\n onExit,\n onEntered,\n onEnter,\n onExited\n}) {\n const { transitionDuration, transitionStatus, transitionTimingFunction } = useTransition({\n mounted,\n exitDuration,\n duration,\n timingFunction,\n onExit,\n onEntered,\n onEnter,\n onExited\n });\n if (transitionDuration === 0) {\n return mounted ? /* @__PURE__ */ React.createElement(React.Fragment, null, children({})) : keepMounted ? children({ display: \"none\" }) : null;\n }\n return transitionStatus === \"exited\" ? keepMounted ? children({ display: \"none\" }) : null : /* @__PURE__ */ React.createElement(React.Fragment, null, children(getTransitionStyles({\n transition,\n duration: transitionDuration,\n state: transitionStatus,\n timingFunction: transitionTimingFunction\n })));\n}\nTransition.displayName = \"@mantine/core/Transition\";\n\nexport { Transition };\n//# sourceMappingURL=Transition.js.map\n","import { useState, useRef, useEffect } from 'react';\nimport { useReducedMotion, useDidUpdate } from '@mantine/hooks';\nimport { useMantineTheme } from '@mantine/styles';\n\nfunction useTransition({\n duration,\n exitDuration,\n timingFunction,\n mounted,\n onEnter,\n onExit,\n onEntered,\n onExited\n}) {\n const theme = useMantineTheme();\n const shouldReduceMotion = useReducedMotion();\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const [transitionDuration, setTransitionDuration] = useState(reduceMotion ? 0 : duration);\n const [transitionStatus, setStatus] = useState(mounted ? \"entered\" : \"exited\");\n const timeoutRef = useRef(-1);\n const handleStateChange = (shouldMount) => {\n const preHandler = shouldMount ? onEnter : onExit;\n const handler = shouldMount ? onEntered : onExited;\n setStatus(shouldMount ? \"pre-entering\" : \"pre-exiting\");\n window.clearTimeout(timeoutRef.current);\n const newTransitionDuration = reduceMotion ? 0 : shouldMount ? duration : exitDuration;\n setTransitionDuration(newTransitionDuration);\n if (newTransitionDuration === 0) {\n typeof preHandler === \"function\" && preHandler();\n typeof handler === \"function\" && handler();\n setStatus(shouldMount ? \"entered\" : \"exited\");\n } else {\n const preStateTimeout = window.setTimeout(() => {\n typeof preHandler === \"function\" && preHandler();\n setStatus(shouldMount ? \"entering\" : \"exiting\");\n }, 10);\n timeoutRef.current = window.setTimeout(() => {\n window.clearTimeout(preStateTimeout);\n typeof handler === \"function\" && handler();\n setStatus(shouldMount ? \"entered\" : \"exited\");\n }, newTransitionDuration);\n }\n };\n useDidUpdate(() => {\n handleStateChange(mounted);\n }, [mounted]);\n useEffect(() => () => window.clearTimeout(timeoutRef.current), []);\n return {\n transitionDuration,\n transitionStatus,\n transitionTimingFunction: timingFunction || theme.transitionTimingFunction\n };\n}\n\nexport { useTransition };\n//# sourceMappingURL=use-transition.js.map\n","import { useState } from 'react';\n\nfunction useUncontrolled({\n value,\n defaultValue,\n finalValue,\n onChange = () => {\n }\n}) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue !== void 0 ? defaultValue : finalValue);\n const handleUncontrolledChange = (val) => {\n setUncontrolledValue(val);\n onChange == null ? void 0 : onChange(val);\n };\n if (value !== void 0) {\n return [value, onChange, true];\n }\n return [uncontrolledValue, handleUncontrolledChange, false];\n}\n\nexport { useUncontrolled };\n//# sourceMappingURL=use-uncontrolled.js.map\n","const elevations = {\n app: 100,\n modal: 200,\n popover: 300,\n overlay: 400,\n max: 9999\n};\nfunction getDefaultZIndex(level) {\n return elevations[level];\n}\n\nexport { getDefaultZIndex };\n//# sourceMappingURL=get-default-z-index.js.map\n","import React from 'react';\n\nfunction isElement(value) {\n if (Array.isArray(value) || value === null) {\n return false;\n }\n if (typeof value === \"object\") {\n if (value.type === React.Fragment) {\n return false;\n }\n return true;\n }\n return false;\n}\n\nexport { isElement };\n//# sourceMappingURL=is-element.js.map\n","var _typeof = require(\"./typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;","// TODO(Babel 8): Remove this file.\n\nvar runtime = require(\"../helpers/regeneratorRuntime\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n","function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nexport default function _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n ...rects.floating,\n x,\n y\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$map$so;\n const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: 0,\n crossAxis: 0,\n alignmentAxis: null,\n ...rawValue\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const overflowAvailableHeight = height - overflow[heightSide];\n const overflowAvailableWidth = width - overflow[widthSide];\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if (isYAxis) {\n const maximumClippingWidth = width - overflow.left - overflow.right;\n availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;\n } else {\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","import { rectToClientRect, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nexport { detectOverflow, offset } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getDocumentElement, getNodeName, isOverflowElement, getNodeScroll, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = currentWin.frameElement;\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = currentWin.frameElement;\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\nconst topLayerSelectors = [':popover-open', ':modal'];\nfunction isTopLayer(floating) {\n return topLayerSelectors.some(selector => {\n try {\n return floating.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\nfunction getWindowScrollBarX(element) {\n // If has a CSS width greater than the viewport, then this will be\n // incorrect for RTL.\n return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n ...clippingAncestor,\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const x = rect.left + scroll.scrollLeft - offsets.x;\n const y = rect.top + scroll.scrollTop - offsets.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n return element.offsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const window = getWindow(element);\n if (!isHTMLElement(element) || isTopLayer(element)) {\n return window;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {\n return window;\n }\n return offsetParent || getContainingBlock(element) || window;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n ...(await getDimensionsFn(data.floating))\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const {\n left,\n top,\n width,\n height\n } = element.getBoundingClientRect();\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 100);\n } else {\n refresh(false, ratio);\n }\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle