ivt 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accordion/index.mjs +1 -1
- package/dist/alert/index.mjs +1 -1
- package/dist/alert-dialog/index.mjs +1 -1
- package/dist/avatar/index.mjs +1 -1
- package/dist/badge/index.mjs +1 -1
- package/dist/base/index.mjs +1 -1
- package/dist/base/index.mjs.map +1 -1
- package/dist/button/index.mjs +1 -1
- package/dist/calendar/index.mjs +1 -1
- package/dist/card/index.mjs +1 -1
- package/dist/checkbox/index.mjs +1 -1
- package/dist/chunks/{accordion-BIDBqkzp.mjs → accordion-LstSopx4.mjs} +2 -2
- package/dist/chunks/{accordion-BIDBqkzp.mjs.map → accordion-LstSopx4.mjs.map} +1 -1
- package/dist/chunks/{badge-Crkpk9z-.mjs → badge-BpvI4lxd.mjs} +2 -2
- package/dist/chunks/{badge-Crkpk9z-.mjs.map → badge-BpvI4lxd.mjs.map} +1 -1
- package/dist/chunks/bundle-mjs-BVqH9Xiz.mjs +2 -0
- package/dist/chunks/bundle-mjs-BVqH9Xiz.mjs.map +1 -0
- package/dist/chunks/{button-CzvqIZ8x.mjs → button-bpYD_OCh.mjs} +2 -2
- package/dist/chunks/{button-CzvqIZ8x.mjs.map → button-bpYD_OCh.mjs.map} +1 -1
- package/dist/chunks/calendar-B7NC5f3S.mjs +2 -0
- package/dist/chunks/calendar-B7NC5f3S.mjs.map +1 -0
- package/dist/chunks/check-C1S8oGnA.mjs +2 -0
- package/dist/chunks/{check-DwxiwVdL.mjs.map → check-C1S8oGnA.mjs.map} +1 -1
- package/dist/chunks/chevron-down-LNM8QSJt.mjs +2 -0
- package/dist/chunks/{chevron-down-DDbMNTUh.mjs.map → chevron-down-LNM8QSJt.mjs.map} +1 -1
- package/dist/chunks/chevron-left-DGTU0tN0.mjs +2 -0
- package/dist/chunks/{chevron-left-Nq3OZhzU.mjs.map → chevron-left-DGTU0tN0.mjs.map} +1 -1
- package/dist/chunks/chevron-right-BZ-GCzPm.mjs +2 -0
- package/dist/chunks/{chevron-right-JC2xkPwU.mjs.map → chevron-right-BZ-GCzPm.mjs.map} +1 -1
- package/dist/chunks/{command-BfhQKbG7.mjs → command-BrYRDhVo.mjs} +2 -2
- package/dist/chunks/{command-BfhQKbG7.mjs.map → command-BrYRDhVo.mjs.map} +1 -1
- package/dist/chunks/{createLucideIcon-DODpMbL1.mjs → createLucideIcon-JNrPx34C.mjs} +1 -1
- package/dist/chunks/{createLucideIcon-DODpMbL1.mjs.map → createLucideIcon-JNrPx34C.mjs.map} +1 -1
- package/dist/chunks/{dialog-hqBsyFIm.mjs → dialog-qeEDGLRF.mjs} +2 -2
- package/dist/chunks/{dialog-hqBsyFIm.mjs.map → dialog-qeEDGLRF.mjs.map} +1 -1
- package/dist/chunks/{hover-card-BqYHz0TY.mjs → hover-card-Ch_WNrXf.mjs} +2 -2
- package/dist/chunks/{hover-card-BqYHz0TY.mjs.map → hover-card-Ch_WNrXf.mjs.map} +1 -1
- package/dist/chunks/{index-Dq1ur1Tt.mjs → index-9Wr-AbGf.mjs} +2 -2
- package/dist/chunks/{index-Dq1ur1Tt.mjs.map → index-9Wr-AbGf.mjs.map} +1 -1
- package/dist/chunks/{index-BCS8JLlu.mjs → index-B7JXO_ZL.mjs} +2 -2
- package/dist/chunks/{index-BCS8JLlu.mjs.map → index-B7JXO_ZL.mjs.map} +1 -1
- package/dist/chunks/{index-By-2lawf.mjs → index-BF_rlJfV.mjs} +1 -1
- package/dist/chunks/{index-By-2lawf.mjs.map → index-BF_rlJfV.mjs.map} +1 -1
- package/dist/chunks/{index-B9IG-aGl.mjs → index-BSTiUDx6.mjs} +1 -1
- package/dist/chunks/{index-B9IG-aGl.mjs.map → index-BSTiUDx6.mjs.map} +1 -1
- package/dist/chunks/{index-C-wyvA9Y.mjs → index-BVxX50NR.mjs} +2 -2
- package/dist/chunks/{index-C-wyvA9Y.mjs.map → index-BVxX50NR.mjs.map} +1 -1
- package/dist/chunks/{index-BX1w0_z_.mjs → index-BWIrjh6G.mjs} +2 -2
- package/dist/chunks/{index-BX1w0_z_.mjs.map → index-BWIrjh6G.mjs.map} +1 -1
- package/dist/chunks/index-CJdBH2dA.mjs +2 -0
- package/dist/chunks/index-CJdBH2dA.mjs.map +1 -0
- package/dist/chunks/{index-CtowYOV1.mjs → index-C_f5Fx2v.mjs} +1 -1
- package/dist/chunks/{index-CtowYOV1.mjs.map → index-C_f5Fx2v.mjs.map} +1 -1
- package/dist/chunks/{index-D5qrkYzi.mjs → index-D1v3PdP0.mjs} +2 -2
- package/dist/chunks/{index-D5qrkYzi.mjs.map → index-D1v3PdP0.mjs.map} +1 -1
- package/dist/chunks/{index-CAfYtpma.mjs → index-Dw-nLa3V.mjs} +2 -2
- package/dist/chunks/{index-CAfYtpma.mjs.map → index-Dw-nLa3V.mjs.map} +1 -1
- package/dist/chunks/{index-C9z8vXb2.mjs → index-Ga0tRLIX.mjs} +2 -2
- package/dist/chunks/{index-C9z8vXb2.mjs.map → index-Ga0tRLIX.mjs.map} +1 -1
- package/dist/chunks/{index-D1CAbWF5.mjs → index-Jch-kFOs.mjs} +2 -2
- package/dist/chunks/{index-D1CAbWF5.mjs.map → index-Jch-kFOs.mjs.map} +1 -1
- package/dist/chunks/{index-CldmvP4a.mjs → index-cC12OKKn.mjs} +1 -1
- package/dist/chunks/{index-CldmvP4a.mjs.map → index-cC12OKKn.mjs.map} +1 -1
- package/dist/chunks/{index-DIH-sx20.mjs → index-qIY9XpbL.mjs} +2 -2
- package/dist/chunks/{index-DIH-sx20.mjs.map → index-qIY9XpbL.mjs.map} +1 -1
- package/dist/chunks/{index-CGiKhmTw.mjs → index-vjATIVlG.mjs} +1 -1
- package/dist/chunks/{index-CGiKhmTw.mjs.map → index-vjATIVlG.mjs.map} +1 -1
- package/dist/chunks/{input-tCLL6Wag.mjs → input-WGTUuQwx.mjs} +2 -2
- package/dist/chunks/{input-tCLL6Wag.mjs.map → input-WGTUuQwx.mjs.map} +1 -1
- package/dist/chunks/{label-AIwucBj-.mjs → label-C9fmItRi.mjs} +2 -2
- package/dist/chunks/{label-AIwucBj-.mjs.map → label-C9fmItRi.mjs.map} +1 -1
- package/dist/chunks/{pagination-Bf7ENC51.mjs → pagination-CwfzF6ZA.mjs} +2 -2
- package/dist/chunks/{pagination-Bf7ENC51.mjs.map → pagination-CwfzF6ZA.mjs.map} +1 -1
- package/dist/chunks/{popover-Bzt13jKn.mjs → popover-DWUH3762.mjs} +2 -2
- package/dist/chunks/{popover-Bzt13jKn.mjs.map → popover-DWUH3762.mjs.map} +1 -1
- package/dist/chunks/{progress-D14txtgz.mjs → progress-4uCJqswH.mjs} +2 -2
- package/dist/chunks/{progress-D14txtgz.mjs.map → progress-4uCJqswH.mjs.map} +1 -1
- package/dist/chunks/{scroll-area-sPJ30O8-.mjs → scroll-area-k2fAfAN1.mjs} +2 -2
- package/dist/chunks/{scroll-area-sPJ30O8-.mjs.map → scroll-area-k2fAfAN1.mjs.map} +1 -1
- package/dist/chunks/{select-BhU-ychz.mjs → select-DScrQSU7.mjs} +2 -2
- package/dist/chunks/{select-BhU-ychz.mjs.map → select-DScrQSU7.mjs.map} +1 -1
- package/dist/chunks/{skeleton-CVWv0wrj.mjs → skeleton-BOGCHPea.mjs} +2 -2
- package/dist/chunks/{skeleton-CVWv0wrj.mjs.map → skeleton-BOGCHPea.mjs.map} +1 -1
- package/dist/chunks/{sortable-DCp-B983.mjs → sortable-gbvqGC-N.mjs} +2 -2
- package/dist/chunks/{sortable-DCp-B983.mjs.map → sortable-gbvqGC-N.mjs.map} +1 -1
- package/dist/chunks/{table-P-qxwuu2.mjs → table-B3Ju2kvw.mjs} +2 -2
- package/dist/chunks/{table-P-qxwuu2.mjs.map → table-B3Ju2kvw.mjs.map} +1 -1
- package/dist/chunks/{tslib.es6-BSLL1h-C.mjs → tslib.es6-DNj8ZlM2.mjs} +1 -1
- package/dist/chunks/{tslib.es6-BSLL1h-C.mjs.map → tslib.es6-DNj8ZlM2.mjs.map} +1 -1
- package/dist/chunks/{utils-D72sTWl4.mjs → utils-Bv9f_FMv.mjs} +2 -2
- package/dist/chunks/{utils-D72sTWl4.mjs.map → utils-Bv9f_FMv.mjs.map} +1 -1
- package/dist/chunks/x-CyVCd2U8.mjs +2 -0
- package/dist/chunks/{x-CSzM0CiJ.mjs.map → x-CyVCd2U8.mjs.map} +1 -1
- package/dist/command/index.mjs +1 -1
- package/dist/data-table/index.d.ts +19 -7
- package/dist/data-table/index.mjs +1 -1
- package/dist/data-table/index.mjs.map +1 -1
- package/dist/dialog/index.mjs +1 -1
- package/dist/dropdown-menu/index.mjs +1 -1
- package/dist/dropzone/index.mjs +1 -1
- package/dist/form/index.mjs +1 -1
- package/dist/form/index.mjs.map +1 -1
- package/dist/hover-card/index.mjs +1 -1
- package/dist/icon/index.mjs +1 -1
- package/dist/index.css +1 -1
- package/dist/input/index.mjs +1 -1
- package/dist/label/index.mjs +1 -1
- package/dist/pagination/index.mjs +1 -1
- package/dist/popover/index.mjs +1 -1
- package/dist/progress/index.mjs +1 -1
- package/dist/scroll-area/index.mjs +1 -1
- package/dist/select/index.mjs +1 -1
- package/dist/separator/index.mjs +1 -1
- package/dist/sheet/index.mjs +1 -1
- package/dist/skeleton/index.mjs +1 -1
- package/dist/sortable/index.mjs +1 -1
- package/dist/table/index.mjs +1 -1
- package/dist/tabs/index.mjs +1 -1
- package/dist/toast/index.mjs +1 -1
- package/dist/tooltip/index.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunks/bundle-mjs-BzWySkoH.mjs +0 -2
- package/dist/chunks/bundle-mjs-BzWySkoH.mjs.map +0 -1
- package/dist/chunks/calendar-BfJtFJt1.mjs +0 -2
- package/dist/chunks/calendar-BfJtFJt1.mjs.map +0 -1
- package/dist/chunks/check-DwxiwVdL.mjs +0 -2
- package/dist/chunks/chevron-down-DDbMNTUh.mjs +0 -2
- package/dist/chunks/chevron-left-Nq3OZhzU.mjs +0 -2
- package/dist/chunks/chevron-right-JC2xkPwU.mjs +0 -2
- package/dist/chunks/index-xxvFw8CT.mjs +0 -2
- package/dist/chunks/index-xxvFw8CT.mjs.map +0 -1
- package/dist/chunks/x-CSzM0CiJ.mjs +0 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-Dq1ur1Tt.mjs","sources":["../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../node_modules/@radix-ui/primitive/dist/index.mjs","../../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/core/primitive/src/primitive.tsx\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nexport {\n composeEventHandlers\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/presence.tsx\nimport * as React2 from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// src/presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef(null);\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n stylesRef.current = node2 ? getComputedStyle(node2) : null;\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["setRef","ref","value","current","composeRefs","refs","node","hasCleanup","cleanups","map","cleanup","i","length","useComposedRefs","React","useCallback","composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","defaultPrevented","Presence","props","present","children","presence","setNode","React2","useState","stylesRef","useRef","prevPresentRef","prevAnimationNameRef","initialState","state","send","useStateMachine","mounted","UNMOUNT","ANIMATION_OUT","unmountSuspended","MOUNT","ANIMATION_END","unmounted","useEffect","currentAnimationName","getAnimationName","useLayoutEffect","styles","wasPresent","prevAnimationName","display","timeoutId","ownerWindow","ownerDocument","defaultView","window","handleAnimationEnd","isCurrentAnimation","includes","animationName","target","currentFillMode","style","animationFillMode","setTimeout","handleAnimationStart","addEventListener","clearTimeout","removeEventListener","isPresent","getComputedStyle","usePresence","child","Children","only","element","getter","Object","getOwnPropertyDescriptor","get","mayWarn","isReactWarning","getElementRef","cloneElement","displayName"],"mappings":"iEAQA,SAASA,EAAUC,EAAqBC,GACtC,GAAmB,mBAARD,EACT,OAAOA,EAAIC,GACFD,UACTA,EAAIE,QAAUD,EAElB,CAMA,SAASE,KAAkBC,GACzB,OAAQC,IACN,IAAIC,GAAa,EACjB,MAAMC,EAAWH,EAAKI,KAAKR,IACzB,MAAMS,EAAUV,EAAOC,EAAKK,GAI5B,OAHKC,GAAgC,mBAAXG,IACxBH,GAAa,GAERG,CAAA,IAOT,GAAIH,EACF,MAAO,KACL,IAAA,IAASI,EAAI,EAAGA,EAAIH,EAASI,OAAQD,IAAK,CACxC,MAAMD,EAAUF,EAASG,GACH,mBAAXD,EACTA,IAEAV,EAAOK,EAAKM,GAAI,KAEpB,EAEJ,CAEJ,CAMA,SAASE,KAAsBR,GAE7B,OAAaS,EAAAC,YAAYX,KAAeC,GAAOA,EACjD,CCzDA,SAASW,EACPC,EACAC,GACAC,yBAAEA,GAA2B,GAAS,IAEtC,OAAO,SAAqBC,GAG1B,GAFAH,IAAuBG,IAEU,IAA7BD,IAAuCC,EAAMC,iBAC/C,OAAOH,IAAkBE,EAE7B,CACF,CCFM,IAAAE,EAAqCC,IACzC,MAAMC,QAAEA,EAAAC,SAASA,GAAaF,EACxBG,EAmBR,SAAqBF,G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[0,1,2]}
|
1
|
+
{"version":3,"file":"index-9Wr-AbGf.mjs","sources":["../../node_modules/@radix-ui/react-compose-refs/dist/index.mjs","../../node_modules/@radix-ui/primitive/dist/index.mjs","../../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["// packages/react/compose-refs/src/compose-refs.tsx\nimport * as React from \"react\";\nfunction setRef(ref, value) {\n if (typeof ref === \"function\") {\n return ref(value);\n } else if (ref !== null && ref !== void 0) {\n ref.current = value;\n }\n}\nfunction composeRefs(...refs) {\n return (node) => {\n let hasCleanup = false;\n const cleanups = refs.map((ref) => {\n const cleanup = setRef(ref, node);\n if (!hasCleanup && typeof cleanup == \"function\") {\n hasCleanup = true;\n }\n return cleanup;\n });\n if (hasCleanup) {\n return () => {\n for (let i = 0; i < cleanups.length; i++) {\n const cleanup = cleanups[i];\n if (typeof cleanup == \"function\") {\n cleanup();\n } else {\n setRef(refs[i], null);\n }\n }\n };\n }\n };\n}\nfunction useComposedRefs(...refs) {\n return React.useCallback(composeRefs(...refs), refs);\n}\nexport {\n composeRefs,\n useComposedRefs\n};\n//# sourceMappingURL=index.mjs.map\n","// packages/core/primitive/src/primitive.tsx\nfunction composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler?.(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) {\n return ourEventHandler?.(event);\n }\n };\n}\nexport {\n composeEventHandlers\n};\n//# sourceMappingURL=index.mjs.map\n","\"use client\";\n\n// src/presence.tsx\nimport * as React2 from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// src/presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef(null);\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n stylesRef.current = node2 ? getComputedStyle(node2) : null;\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["setRef","ref","value","current","composeRefs","refs","node","hasCleanup","cleanups","map","cleanup","i","length","useComposedRefs","React","useCallback","composeEventHandlers","originalEventHandler","ourEventHandler","checkForDefaultPrevented","event","defaultPrevented","Presence","props","present","children","presence","setNode","React2","useState","stylesRef","useRef","prevPresentRef","prevAnimationNameRef","initialState","state","send","useStateMachine","mounted","UNMOUNT","ANIMATION_OUT","unmountSuspended","MOUNT","ANIMATION_END","unmounted","useEffect","currentAnimationName","getAnimationName","useLayoutEffect","styles","wasPresent","prevAnimationName","display","timeoutId","ownerWindow","ownerDocument","defaultView","window","handleAnimationEnd","isCurrentAnimation","includes","animationName","target","currentFillMode","style","animationFillMode","setTimeout","handleAnimationStart","addEventListener","clearTimeout","removeEventListener","isPresent","getComputedStyle","usePresence","child","Children","only","element","getter","Object","getOwnPropertyDescriptor","get","mayWarn","isReactWarning","getElementRef","cloneElement","displayName"],"mappings":"iEAQA,SAASA,EAAUC,EAAqBC,GACtC,GAAmB,mBAARD,EACT,OAAOA,EAAIC,GACFD,UACTA,EAAIE,QAAUD,EAElB,CAMA,SAASE,KAAkBC,GACzB,OAAQC,IACN,IAAIC,GAAa,EACjB,MAAMC,EAAWH,EAAKI,KAAKR,IACzB,MAAMS,EAAUV,EAAOC,EAAKK,GAI5B,OAHKC,GAAgC,mBAAXG,IACxBH,GAAa,GAERG,CAAA,IAOT,GAAIH,EACF,MAAO,KACL,IAAA,IAASI,EAAI,EAAGA,EAAIH,EAASI,OAAQD,IAAK,CACxC,MAAMD,EAAUF,EAASG,GACH,mBAAXD,EACTA,IAEAV,EAAOK,EAAKM,GAAI,KAEpB,EAEJ,CAEJ,CAMA,SAASE,KAAsBR,GAE7B,OAAaS,EAAAC,YAAYX,KAAeC,GAAOA,EACjD,CCzDA,SAASW,EACPC,EACAC,GACAC,yBAAEA,GAA2B,GAAS,IAEtC,OAAO,SAAqBC,GAG1B,GAFAH,IAAuBG,IAEU,IAA7BD,IAAuCC,EAAMC,iBAC/C,OAAOH,IAAkBE,EAE7B,CACF,CCFM,IAAAE,EAAqCC,IACzC,MAAMC,QAAEA,EAAAC,SAASA,GAAaF,EACxBG,EAmBR,SAAqBF,GACnB,MAAOlB,EAAMqB,GAAiBC,EAAAC,WACxBC,EAAkBF,EAAAG,OAAmC,MACrDC,EAAuBJ,EAAAG,OAAOP,GAC9BS,EAA6BL,EAAAG,OAAe,QAC5CG,EAAeV,EAAU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mBV,GACzCpD,EAAK8D,iBAAiB,eAAgBV,GAC/B,KACLJ,EAAYe,aAAahB,GACzB/C,EAAKgE,oBAAoB,iBAAkBH,GAC3C7D,EAAKgE,oBAAoB,kBAAmBZ,GAC5CpD,EAAKgE,oBAAoB,eAAgBZ,EAAkB,EAK7DtB,EAAK,gBACP,GACC,CAAC9B,EAAM8B,IAEH,CACLmC,UAAW,CAAC,UAAW,oBAAoBX,SAASzB,GACpDlC,IAAW2B,EAAAb,aAAaT,IACtBwB,EAAU3B,QAAUG,EAAOkE,iBAAiBlE,GAAQ,KACpDqB,EAAQrB,EAAI,GACX,IAEP,CAnJmBmE,CAAYjD,GAEvBkD,EACgB,mBAAbjD,EACHA,EAAS,CAAED,QAASE,EAAS6C,YACvB3C,EAAA+C,SAASC,KAAKnD,GAGpBxB,EAAMY,EAAgBa,EAASzB,IAwJvC,SAAuB4E,GAErB,IAAIC,EAASC,OAAOC,yBAAyBH,EAAQtD,MAAO,QAAQ0D,IAChEC,EAAUJ,GAAU,mBAAoBA,GAAUA,EAAOK,eAC7D,GAAID,EACF,OAAQL,EAAgB5E,IAM1B,GAFA6E,EAASC,OAAOC,yBAAyBH,EAAS,QAAQI,IAC1DC,EAAUJ,GAAU,mBAAoBA,GAAUA,EAAOK,eACrDD,EACF,OAAOL,EAAQtD,MAAMtB,IAIvB,OAAO4E,EAAQtD,MAAMtB,KAAQ4E,EAAgB5E,GAC/C,CAzK4CmF,CAAcV,IAExD,MADuC,mBAAbjD,GACLC,EAAS6C,UAAkB3C,EAAAyD,aAAaX,EAAO,CAAEzE,QAAS,IAAA,EA6IjF,SAAS8C,EAAiBE,GACxB,OAAOA,GAAQY,eAAiB,MAClC,CA5IAvC,EAASgE,YAAc","x_google_ignoreList":[0,1,2]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as e from"react";import{c as o,u as r}from"./index-
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as e from"react";import{c as o,u as r}from"./index-9Wr-AbGf.mjs";import{createCollection as t}from"@radix-ui/react-collection";import{c as n}from"./index-BSTiUDx6.mjs";import{u as a}from"./index-Jch-kFOs.mjs";import{P as i}from"./index-vjATIVlG.mjs";import{u as s}from"./index-BF_rlJfV.mjs";import{u}from"./index-qIY9XpbL.mjs";import{u as c}from"./index-cC12OKKn.mjs";import{jsx as l}from"react/jsx-runtime";var f="rovingFocusGroup.onEntryFocus",p={bubbles:!1,cancelable:!0},d="RovingFocusGroup",[m,v,b]=t(d),[w,g]=n(d,[b]),[F,I]=w(d),h=e.forwardRef(((e,o)=>l(m.Provider,{scope:e.__scopeRovingFocusGroup,children:l(m.Slot,{scope:e.__scopeRovingFocusGroup,children:l(R,{...e,ref:o})})})));h.displayName=d;var R=e.forwardRef(((t,n)=>{const{__scopeRovingFocusGroup:a,orientation:m,loop:b=!1,dir:w,currentTabStopId:g,defaultCurrentTabStopId:I,onCurrentTabStopIdChange:h,onEntryFocus:R,preventScrollOnEntryFocus:y=!1,...S}=t,x=e.useRef(null),A=r(n,x),E=c(w),[D,C]=u({prop:g,defaultProp:I??null,onChange:h,caller:d}),[j,_]=e.useState(!1),G=s(R),K=v(a),k=e.useRef(!1),[L,P]=e.useState(0);return e.useEffect((()=>{const e=x.current;if(e)return e.addEventListener(f,G),()=>e.removeEventListener(f,G)}),[G]),l(F,{scope:a,orientation:m,dir:E,loop:b,currentTabStopId:D,onItemFocus:e.useCallback((e=>C(e)),[C]),onItemShiftTab:e.useCallback((()=>_(!0)),[]),onFocusableItemAdd:e.useCallback((()=>P((e=>e+1))),[]),onFocusableItemRemove:e.useCallback((()=>P((e=>e-1))),[]),children:l(i.div,{tabIndex:j||0===L?-1:0,"data-orientation":m,...S,ref:A,style:{outline:"none",...t.style},onMouseDown:o(t.onMouseDown,(()=>{k.current=!0})),onFocus:o(t.onFocus,(e=>{const o=!k.current;if(e.target===e.currentTarget&&o&&!j){const o=new CustomEvent(f,p);if(e.currentTarget.dispatchEvent(o),!o.defaultPrevented){const e=K().filter((e=>e.focusable));T([e.find((e=>e.active)),e.find((e=>e.id===D)),...e].filter(Boolean).map((e=>e.ref.current)),y)}}k.current=!1})),onBlur:o(t.onBlur,(()=>_(!1)))})})})),y="RovingFocusGroupItem",S=e.forwardRef(((r,t)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:u=!1,tabStopId:c,children:f,...p}=r,d=a(),b=c||d,w=I(y,n),g=w.currentTabStopId===b,F=v(n),{onFocusableItemAdd:h,onFocusableItemRemove:R,currentTabStopId:S}=w;return e.useEffect((()=>{if(s)return h(),()=>R()}),[s,h,R]),l(m.ItemSlot,{scope:n,id:b,focusable:s,active:u,children:l(i.span,{tabIndex:g?0:-1,"data-orientation":w.orientation,...p,ref:t,onMouseDown:o(r.onMouseDown,(e=>{s?w.onItemFocus(b):e.preventDefault()})),onFocus:o(r.onFocus,(()=>w.onItemFocus(b))),onKeyDown:o(r.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void w.onItemShiftTab();if(e.target!==e.currentTarget)return;const o=function(e,o,r){const t=function(e,o){return"rtl"!==o?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);return"vertical"===o&&["ArrowLeft","ArrowRight"].includes(t)||"horizontal"===o&&["ArrowUp","ArrowDown"].includes(t)?void 0:x[t]}(e,w.orientation,w.dir);if(void 0!==o){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=F().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===o)n.reverse();else if("prev"===o||"next"===o){"prev"===o&&n.reverse();const a=n.indexOf(e.currentTarget);n=w.loop?(t=a+1,(r=n).map(((e,o)=>r[(t+o)%r.length]))):n.slice(a+1)}setTimeout((()=>T(n)))}var r,t})),children:"function"==typeof f?f({isCurrentTabStop:g,hasTabStop:null!=S}):f})})}));S.displayName=y;var x={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function T(e,o=!1){const r=document.activeElement;for(const t of e){if(t===r)return;if(t.focus({preventScroll:o}),document.activeElement!==r)return}}var A=h,E=S;export{E as I,A as R,g as c};
|
2
|
+
//# sourceMappingURL=index-B7JXO_ZL.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-BCS8JLlu.mjs","sources":["../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["ENTRY_FOCUS","EVENT_OPTIONS","bubbles","cancelable","GROUP_NAME","Collection","useCollection","createCollectionScope","createCollection","createRovingFocusGroupContext","createRovingFocusGroupScope","createContextScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React","forwardRef","props","forwardedRef","jsx","Provider","scope","__scopeRovingFocusGroup","children","Slot","RovingFocusGroupImpl","ref","displayName","orientation","loop","dir","currentTabStopId","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","useRef","composedRefs","useComposedRefs","direction","useDirection","setCurrentTabStopId","useControllableState","prop","defaultProp","onChange","caller","isTabbingBackOut","setIsTabbingBackOut","useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","useEffect","node","current","addEventListener","removeEventListener","onItemFocus","useCallback","tabStopId","onItemShiftTab","onFocusableItemAdd","prevCount","onFocusableItemRemove","Primitive","div","tabIndex","style","outline","onMouseDown","composeEventHandlers","onFocus","event","isKeyboardFocus","target","currentTarget","entryFocusEvent","CustomEvent","dispatchEvent","defaultPrevented","items","filter","item","focusable","focusFirst","find","active","id","Boolean","map","onBlur","ITEM_NAME","RovingFocusGroupItem","itemProps","autoId","useId","context","isCurrentTabStop","ItemSlot","span","preventDefault","onKeyDown","key","shiftKey","focusIntent","getDirectionAwareKey","includes","MAP_KEY_TO_FOCUS_INTENT","getFocusIntent","metaKey","ctrlKey","altKey","candidateNodes","reverse","currentIndex","indexOf","startIndex","array","_","index","length","slice","setTimeout","hasTabStop","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","PageUp","Home","PageDown","End","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","document","activeElement","candidate","focus","Root","Item"],"mappings":"+ZAaA,IAAMA,EAAc,gCACdC,EAAgB,CAAEC,SAAS,EAAOC,YAAY,GAM9CC,EAAa,oBAGZC,EAAYC,EAAeC,GAAyBC,EAGzDJ,IAGKK,EAA+BC,GAA+BC,EACnEP,EACA,CAACG,KA+BIK,EAAqBC,GAC1BJ,EAAkDL,GAK9CU,EAAyBC,EAAAC,YAC7B,CAACC,EAA2CC,IAExCC,EAACd,EAAWe,SAAX,CAAoBC,MAAOJ,EAAMK,wBAChCC,SAAAJ,EAACd,EAAWmB,KAAX,CAAgBH,MAAOJ,EAAMK,wBAC5BC,SAAAJ,EAACM,EAAA,IAAyBR,EAAOS,IAAKR,UAOhDJ,EAAiBa,YAAcvB,EAgB/B,IAAMqB,EAA6BV,EAAAC,YAGjC,CAACC,EAA+CC,KAChD,MAAMI,wBACJA,EAAAM,YACAA,EAAAC,KACAA,GAAO,EAAAC,IACPA,EACAC,iBAAkBC,EAAAC,wBAClBA,EAAAC,yBACAA,EAAAC,aACAA,EAAAC,0BACAA,GAA4B,KACzBC,GACDpB,EACES,EAAYX,EAAAuB,OAAoC,MAChDC,EAAeC,EAAgBtB,EAAcQ,GAC7Ce,EAAYC,EAAaZ,IACxBC,EAAkBY,GAAuBC,EAAqB,CACnEC,KAAMb,EACNc,YAAab,GAA2B,KACxCc,SAAUb,EACVc,OAAQ5C,KAEH6C,EAAkBC,GAA6BnC,EAAAoC,UAAS,GACzDC,EAAmBC,EAAelB,GAClCmB,EAAWhD,EAAcgB,GACzBiC,EAAwBxC,EAAAuB,QAAO,IAC9BkB,EAAqBC,GAAgC1C,EAAAoC,SAAS,GAUrE,OARMpC,EAAA2C,WAAU,KACd,MAAMC,EAAOjC,EAAIkC,Q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file":"index-B7JXO_ZL.mjs","sources":["../../node_modules/@radix-ui/react-roving-focus/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/roving-focus-group.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useId } from \"@radix-ui/react-id\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { useControllableState } from \"@radix-ui/react-use-controllable-state\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { jsx } from \"react/jsx-runtime\";\nvar ENTRY_FOCUS = \"rovingFocusGroup.onEntryFocus\";\nvar EVENT_OPTIONS = { bubbles: false, cancelable: true };\nvar GROUP_NAME = \"RovingFocusGroup\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(GROUP_NAME);\nvar [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\nvar [RovingFocusProvider, useRovingFocusContext] = createRovingFocusGroupContext(GROUP_NAME);\nvar RovingFocusGroup = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeRovingFocusGroup, children: /* @__PURE__ */ jsx(RovingFocusGroupImpl, { ...props, ref: forwardedRef }) }) });\n }\n);\nRovingFocusGroup.displayName = GROUP_NAME;\nvar RovingFocusGroupImpl = React.forwardRef((props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n return /* @__PURE__ */ jsx(\n RovingFocusProvider,\n {\n scope: __scopeRovingFocusGroup,\n orientation,\n dir: direction,\n loop,\n currentTabStopId,\n onItemFocus: React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n ),\n onItemShiftTab: React.useCallback(() => setIsTabbingBackOut(true), []),\n onFocusableItemAdd: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n ),\n onFocusableItemRemove: React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n ),\n children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n tabIndex: isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0,\n \"data-orientation\": orientation,\n ...groupProps,\n ref: composedRefs,\n style: { outline: \"none\", ...props.style },\n onMouseDown: composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n }),\n onFocus: composeEventHandlers(props.onFocus, (event) => {\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n );\n const candidateNodes = candidateItems.map((item) => item.ref.current);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))\n }\n )\n }\n );\n});\nvar ITEM_NAME = \"RovingFocusGroupItem\";\nvar RovingFocusGroupItem = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeRovingFocusGroup,\n id,\n focusable,\n active,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation,\n ...itemProps,\n ref: forwardedRef,\n onMouseDown: composeEventHandlers(props.onMouseDown, (event) => {\n if (!focusable) event.preventDefault();\n else context.onItemFocus(id);\n }),\n onFocus: composeEventHandlers(props.onFocus, () => context.onItemFocus(id)),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === \"Tab\" && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== void 0) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current);\n if (focusIntent === \"last\") candidateNodes.reverse();\n else if (focusIntent === \"prev\" || focusIntent === \"next\") {\n if (focusIntent === \"prev\") candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n setTimeout(() => focusFirst(candidateNodes));\n }\n }),\n children: typeof children === \"function\" ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null }) : children\n }\n )\n }\n );\n }\n);\nRovingFocusGroupItem.displayName = ITEM_NAME;\nvar MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: \"prev\",\n ArrowUp: \"prev\",\n ArrowRight: \"next\",\n ArrowDown: \"next\",\n PageUp: \"first\",\n Home: \"first\",\n PageDown: \"last\",\n End: \"last\"\n};\nfunction getDirectionAwareKey(key, dir) {\n if (dir !== \"rtl\") return key;\n return key === \"ArrowLeft\" ? \"ArrowRight\" : key === \"ArrowRight\" ? \"ArrowLeft\" : key;\n}\nfunction getFocusIntent(event, orientation, dir) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === \"vertical\" && [\"ArrowLeft\", \"ArrowRight\"].includes(key)) return void 0;\n if (orientation === \"horizontal\" && [\"ArrowUp\", \"ArrowDown\"].includes(key)) return void 0;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction focusFirst(candidates, preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nvar Root = RovingFocusGroup;\nvar Item = RovingFocusGroupItem;\nexport {\n Item,\n Root,\n RovingFocusGroup,\n RovingFocusGroupItem,\n createRovingFocusGroupScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["ENTRY_FOCUS","EVENT_OPTIONS","bubbles","cancelable","GROUP_NAME","Collection","useCollection","createCollectionScope","createCollection","createRovingFocusGroupContext","createRovingFocusGroupScope","createContextScope","RovingFocusProvider","useRovingFocusContext","RovingFocusGroup","React","forwardRef","props","forwardedRef","jsx","Provider","scope","__scopeRovingFocusGroup","children","Slot","RovingFocusGroupImpl","ref","displayName","orientation","loop","dir","currentTabStopId","currentTabStopIdProp","defaultCurrentTabStopId","onCurrentTabStopIdChange","onEntryFocus","preventScrollOnEntryFocus","groupProps","useRef","composedRefs","useComposedRefs","direction","useDirection","setCurrentTabStopId","useControllableState","prop","defaultProp","onChange","caller","isTabbingBackOut","setIsTabbingBackOut","useState","handleEntryFocus","useCallbackRef","getItems","isClickFocusRef","focusableItemsCount","setFocusableItemsCount","useEffect","node","current","addEventListener","removeEventListener","onItemFocus","useCallback","tabStopId","onItemShiftTab","onFocusableItemAdd","prevCount","onFocusableItemRemove","Primitive","div","tabIndex","style","outline","onMouseDown","composeEventHandlers","onFocus","event","isKeyboardFocus","target","currentTarget","entryFocusEvent","CustomEvent","dispatchEvent","defaultPrevented","items","filter","item","focusable","focusFirst","find","active","id","Boolean","map","onBlur","ITEM_NAME","RovingFocusGroupItem","itemProps","autoId","useId","context","isCurrentTabStop","ItemSlot","span","preventDefault","onKeyDown","key","shiftKey","focusIntent","getDirectionAwareKey","includes","MAP_KEY_TO_FOCUS_INTENT","getFocusIntent","metaKey","ctrlKey","altKey","candidateNodes","reverse","currentIndex","indexOf","startIndex","array","_","index","length","slice","setTimeout","hasTabStop","ArrowLeft","ArrowUp","ArrowRight","ArrowDown","PageUp","Home","PageDown","End","candidates","preventScroll","PREVIOUSLY_FOCUSED_ELEMENT","document","activeElement","candidate","focus","Root","Item"],"mappings":"+ZAaA,I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B,SAAU,OACtE/B,EAAM4B,iBAEN,IAAIY,EADUhE,IAAWiC,QAAQC,GAASA,EAAKC,YACpBM,KAAKP,GAASA,EAAK9D,IAAIkC,UAElD,GAAoB,SAAhBkD,EAAwBQ,EAAeC,eAAQ,GAC1B,SAAhBT,GAA0C,SAAhBA,EAAwB,CACrC,SAAhBA,GAAwBQ,EAAeC,UAC3C,MAAMC,EAAeF,EAAeG,QAAQ3C,EAAMG,eAClDqC,EAAiBhB,EAAQzE,MA8DP6F,EA7DYF,EAAe,GA6DvCG,EA7DQL,GA8DfvB,KAAO,CAAC6B,EAAGC,IAAUF,GAAOD,EAAaG,GAASF,EAAMG,WA7DnDR,EAAeS,MAAMP,EAAe,EAC1C,CAMAQ,YAAW,IAAMtC,EAAW4B,IAC9B,CAoDZ,IAAsBK,EAAYD,CApDtB,IAGDnG,SAAoB,mBAAbA,EACJA,EAAS,CAAEgF,mBAAkB0B,WAAgC,MAApBlG,IACzCR,KACN,IAMR2E,EAAqBvE,YAAcsE,EAKnC,IAAMgB,EAAuD,CAC3DiB,UAAW,OAAQC,QAAS,OAC5BC,WAAY,OAAQC,UAAW,OAC/BC,OAAQ,QAASC,KAAM,QACvBC,SAAU,OAAQC,IAAK,QAiBzB,SAAS/C,EAAWgD,EAA2BC,GAAgB,GAC7D,MAAMC,EAA6BC,SAASC,cAC5C,IAAA,MAAWC,KAAaL,EAAY,CAElC,GAAIK,IAAcH,EAA4B,OAE9C,GADAG,EAAUC,MAAM,CAAEL,kBACdE,SAASC,gBAAkBF,EAA4B,MAC7D,CACF,CAUA,IAAMK,EAAOnI,EACPoI,EAAOhD","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import*as e from"react";function r(r){const t=e.useRef(r);return e.useEffect((()=>{t.current=r})),e.useMemo((()=>(...e)=>t.current?.(...e)),[])}export{r as u};
|
2
|
-
//# sourceMappingURL=index-
|
2
|
+
//# sourceMappingURL=index-BF_rlJfV.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-
|
1
|
+
{"version":3,"file":"index-BF_rlJfV.mjs","sources":["../../node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs"],"sourcesContent":["// packages/react/use-callback-ref/src/use-callback-ref.tsx\nimport * as React from \"react\";\nfunction useCallbackRef(callback) {\n const callbackRef = React.useRef(callback);\n React.useEffect(() => {\n callbackRef.current = callback;\n });\n return React.useMemo(() => (...args) => callbackRef.current?.(...args), []);\n}\nexport {\n useCallbackRef\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useCallbackRef","callback","callbackRef","React","useRef","useEffect","current","useMemo","args"],"mappings":"wBAMA,SAASA,EAAkDC,GACzD,MAAMC,EAAoBC,EAAAC,OAAOH,GAOjC,OALME,EAAAE,WAAU,KACdH,EAAYI,QAAUL,CAAA,IAIXE,EAAAI,SAAQ,IAAO,IAAIC,IAASN,EAAYI,aAAaE,IAAa,GACjF","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
1
|
import*as e from"react";import{jsx as t}from"react/jsx-runtime";function r(r,n){const o=e.createContext(n),c=r=>{const{children:n,...c}=r,s=e.useMemo((()=>c),Object.values(c));return t(o.Provider,{value:s,children:n})};return c.displayName=r+"Provider",[c,function(t){const c=e.useContext(o);if(c)return c;if(void 0!==n)return n;throw new Error(`\`${t}\` must be used within \`${r}\``)}]}function n(r,n=[]){let c=[];const s=()=>{const t=c.map((t=>e.createContext(t)));return function(n){const o=n?.[r]||t;return e.useMemo((()=>({[`__scope${r}`]:{...n,[r]:o}})),[n,o])}};return s.scopeName=r,[function(n,o){const s=e.createContext(o),u=c.length;c=[...c,o];const i=n=>{const{scope:o,children:c,...i}=n,a=o?.[r]?.[u]||s,m=e.useMemo((()=>i),Object.values(i));return t(a.Provider,{value:m,children:c})};return i.displayName=n+"Provider",[i,function(t,c){const i=c?.[r]?.[u]||s,a=e.useContext(i);if(a)return a;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},o(s,...n)]}function o(...t){const r=t[0];if(1===t.length)return r;const n=()=>{const n=t.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(t){const o=n.reduce(((e,{useScope:r,scopeName:n})=>({...e,...r(t)[`__scope${n}`]})),{});return e.useMemo((()=>({[`__scope${r.scopeName}`]:o})),[o])}};return n.scopeName=r.scopeName,n}export{r as a,n as c};
|
2
|
-
//# sourceMappingURL=index-
|
2
|
+
//# sourceMappingURL=index-BSTiUDx6.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-
|
1
|
+
{"version":3,"file":"index-BSTiUDx6.mjs","sources":["../../node_modules/@radix-ui/react-context/dist/index.mjs"],"sourcesContent":["// packages/react/context/src/create-context.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createContext2(rootComponentName, defaultContext) {\n const Context = React.createContext(defaultContext);\n const Provider = (props) => {\n const { children, ...context } = props;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName) {\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n}\nfunction createContextScope(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n function createContext3(rootComponentName, defaultContext) {\n const BaseContext = React.createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [...defaultContexts, defaultContext];\n const Provider = (props) => {\n const { scope, children, ...context } = props;\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const value = React.useMemo(() => context, Object.values(context));\n return /* @__PURE__ */ jsx(Context.Provider, { value, children });\n };\n Provider.displayName = rootComponentName + \"Provider\";\n function useContext2(consumerName, scope) {\n const Context = scope?.[scopeName]?.[index] || BaseContext;\n const context = React.useContext(Context);\n if (context) return context;\n if (defaultContext !== void 0) return defaultContext;\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n return [Provider, useContext2];\n }\n const createScope = () => {\n const scopeContexts = defaultContexts.map((defaultContext) => {\n return React.createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = scope?.[scopeName] || scopeContexts;\n return React.useMemo(\n () => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),\n [scope, contexts]\n );\n };\n };\n createScope.scopeName = scopeName;\n return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];\n}\nfunction composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope = () => {\n const scopeHooks = scopes.map((createScope2) => ({\n useScope: createScope2(),\n scopeName: createScope2.scopeName\n }));\n return function useComposedScopes(overrideScopes) {\n const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return { ...nextScopes2, ...currentScope };\n }, {});\n return React.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);\n };\n };\n createScope.scopeName = baseScope.scopeName;\n return createScope;\n}\nexport {\n createContext2 as createContext,\n createContextScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createContext","rootComponentName","defaultContext","Context","React","Provider","props","children","context","value","useMemo","Object","values","jsx","displayName","consumerName","useContext","Error","createContextScope","scopeName","createContextScopeDeps","defaultContexts","createScope","scopeContexts","map","scope","contexts","BaseContext","index","length","composeContextScopes","scopes","baseScope","scopeHooks","useScope","overrideScopes","nextScopes","reduce"],"mappings":"gEAEA,SAASA,EACPC,EACAC,GAEA,MAAMC,EAAgBC,EAAAJ,cAA4CE,GAE5DG,EAAwEC,IAC5E,MAAMC,SAAEA,KAAaC,GAAYF,EAG3BG,EAAcL,EAAAM,SAAQ,IAAMF,GAASG,OAAOC,OAAOJ,IACzD,OAAOK,EAACV,EAAQE,SAAR,CAAiBI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AASU,KAAwBC,GAC/B,MAAMC,EAAYD,EAAO,GACzB,GAAsB,IAAlBA,EAAOF,OAAc,OAAOG,EAEhC,MAAMV,EAA2B,KAC/B,MAAMW,EAAaF,EAAOP,KAAKF,IAAiB,CAC9CY,SAAUZ,IACVH,UAAWG,EAAYH,cAGzB,OAAO,SAA2BgB,GAChC,MAAMC,EAAaH,EAAWI,QAAO,CAACD,GAAcF,WAAUf,gBAMrD,IAAKiB,KAFOF,EAASC,GACI,UAAUhB,QAEzC,IAEH,OAAaf,EAAAM,SAAQ,KAAO,CAAE,CAAC,UAAUsB,EAAUb,aAAciB,KAAe,CAACA,GACnF,CAAA,EAIF,OADAd,EAAYH,UAAYa,EAAUb,UAC3BG,CACT","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as r from"react";import{P as e}from"./index-
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as r from"react";import{P as e}from"./index-vjATIVlG.mjs";import{jsx as a}from"react/jsx-runtime";var i=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),o=r.forwardRef(((r,o)=>a(e.span,{...r,ref:o,style:{...i,...r.style}})));o.displayName="VisuallyHidden";var t=o;export{t as R,o as V};
|
2
|
+
//# sourceMappingURL=index-BVxX50NR.mjs.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index-
|
1
|
+
{"version":3,"file":"index-BVxX50NR.mjs","sources":["../../node_modules/@radix-ui/react-visually-hidden/dist/index.mjs"],"sourcesContent":["// src/visually-hidden.tsx\nimport * as React from \"react\";\nimport { Primitive } from \"@radix-ui/react-primitive\";\nimport { jsx } from \"react/jsx-runtime\";\nvar VISUALLY_HIDDEN_STYLES = Object.freeze({\n // See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss\n position: \"absolute\",\n border: 0,\n width: 1,\n height: 1,\n padding: 0,\n margin: -1,\n overflow: \"hidden\",\n clip: \"rect(0, 0, 0, 0)\",\n whiteSpace: \"nowrap\",\n wordWrap: \"normal\"\n});\nvar NAME = \"VisuallyHidden\";\nvar VisuallyHidden = React.forwardRef(\n (props, forwardedRef) => {\n return /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...props,\n ref: forwardedRef,\n style: { ...VISUALLY_HIDDEN_STYLES, ...props.style }\n }\n );\n }\n);\nVisuallyHidden.displayName = NAME;\nvar Root = VisuallyHidden;\nexport {\n Root,\n VISUALLY_HIDDEN_STYLES,\n VisuallyHidden\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["VISUALLY_HIDDEN_STYLES","Object","freeze","position","border","width","height","padding","margin","overflow","clip","whiteSpace","wordWrap","VisuallyHidden","React","forwardRef","props","forwardedRef","jsx","Primitive","span","ref","style","displayName","Root"],"mappings":"yGAOA,IAAMA,EAAyBC,OAAOC,OAAO,CAE3CC,SAAU,WACVC,OAAQ,EACRC,MAAO,EACPC,OAAQ,EACRC,QAAS,EACTC,QAAQ,EACRC,SAAU,SACVC,KAAM,mBACNC,WAAY,SACZC,SAAU,WASNC,EAAuBC,EAAAC,YAC3B,CAACC,EAAOC,IAEJC,EAACC,EAAUC,KAAV,IACKJ,EACJK,IAAKJ,EACLK,MAAO,IAAKtB,KAA2BgB,EAAMM,WAMrDT,EAAeU,YAlBF,iBAsBb,IAAMC,EAAOX","x_google_ignoreList":[0]}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import*as t from"react";import{useLayoutEffect as e,useEffect as n}from"react";import*as r from"react-dom";import{P as o}from"./index-CGiKhmTw.mjs";import{jsx as i}from"react/jsx-runtime";import{u as l}from"./index-Dq1ur1Tt.mjs";import{c as a}from"./index-B9IG-aGl.mjs";import{u as s}from"./index-By-2lawf.mjs";import{u as c}from"./index-CtowYOV1.mjs";import{u as f}from"./index-C9z8vXb2.mjs";const u=["top","right","bottom","left"],d=Math.min,p=Math.max,m=Math.round,h=Math.floor,g=t=>({x:t,y:t}),y={left:"right",right:"left",bottom:"top",top:"bottom"},w={start:"end",end:"start"};function x(t,e,n){return p(t,d(e,n))}function v(t,e){return"function"==typeof t?t(e):t}function b(t){return t.split("-")[0]}function R(t){return t.split("-")[1]}function A(t){return"x"===t?"y":"x"}function P(t){return"y"===t?"height":"width"}function S(t){return["top","bottom"].includes(b(t))?"y":"x"}function O(t){return A(S(t))}function T(t){return t.replace(/start|end/g,(t=>w[t]))}function L(t){return t.replace(/left|right|bottom|top/g,(t=>y[t]))}function C(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function E(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function D(t,e,n){let{reference:r,floating:o}=t;const i=S(e),l=O(e),a=P(l),s=b(e),c="y"===i,f=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let p;switch(s){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(R(e)){case"start":p[l]-=d*(n&&c?-1:1);break;case"end":p[l]+=d*(n&&c?-1:1)}return p}async function H(t,e){var n;void 0===e&&(e={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=v(e,t),m=C(p),h=a[d?"floating"===u?"reference":"floating":u],g=E(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:s})),y="floating"===u?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=E(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:s}):y);return{top:(g.top-b.top+m.top)/x.y,bottom:(b.bottom-g.bottom+m.bottom)/x.y,left:(g.left-b.left+m.left)/x.x,right:(b.right-g.right+m.right)/x.x}}function k(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function F(t){return u.some((e=>t[e]>=0))}function W(){return"undefined"!=typeof window}function B(t){return j(t)?(t.nodeName||"").toLowerCase():"#document"}function M(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function $(t){var e;return null==(e=(j(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function j(t){return!!W()&&(t instanceof Node||t instanceof M(t).Node)}function N(t){return!!W()&&(t instanceof Element||t instanceof M(t).Element)}function _(t){return!!W()&&(t instanceof HTMLElement||t instanceof M(t).HTMLElement)}function z(t){return!(!W()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof M(t).ShadowRoot)}function V(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=J(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(o)}function Y(t){return["table","td","th"].includes(B(t))}function X(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function I(t){const e=q(),n=N(t)?J(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function q(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function G(t){return["html","body","#document"].includes(B(t))}function J(t){return M(t).getComputedStyle(t)}function K(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Q(t){if("html"===B(t))return t;const e=t.assignedSlot||t.parentNode||z(t)&&t.host||$(t);return z(e)?e.host:e}function U(t){const e=Q(t);return G(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&V(e)?e:U(e)}function Z(t,e,n){var r;void 0===e&&(e=[]),void 0===n&&(n=!0);const o=U(t),i=o===(null==(r=t.ownerDocument)?void 0:r.body),l=M(o);if(i){const t=tt(l);return e.concat(l,l.visualViewport||[],V(o)?o:[],t&&n?Z(t):[])}return e.concat(o,Z(o,[],n))}function tt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function et(t){const e=J(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=_(t),i=o?t.offsetWidth:n,l=o?t.offsetHeight:r,a=m(n)!==i||m(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function nt(t){return N(t)?t:t.contextElement}function rt(t){const e=nt(t);if(!_(e))return g(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=et(e);let l=(i?m(n.width):n.width)/r,a=(i?m(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const ot=g(0);function it(t){const e=M(t);return q()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ot}function lt(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),i=nt(t);let l=g(1);e&&(r?N(r)&&(l=rt(r)):l=rt(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==M(t))&&e}(i,n,r)?it(i):g(0);let s=(o.left+a.x)/l.x,c=(o.top+a.y)/l.y,f=o.width/l.x,u=o.height/l.y;if(i){const t=M(i),e=r&&N(r)?M(r):r;let n=t,o=tt(n);for(;o&&r&&e!==n;){const t=rt(o),e=o.getBoundingClientRect(),r=J(o),i=e.left+(o.clientLeft+parseFloat(r.paddingLeft))*t.x,l=e.top+(o.clientTop+parseFloat(r.paddingTop))*t.y;s*=t.x,c*=t.y,f*=t.x,u*=t.y,s+=i,c+=l,n=M(o),o=tt(n)}}return E({width:f,height:u,x:s,y:c})}function at(t,e){const n=K(t).scrollLeft;return e?e.left+n:lt($(t)).left+n}function st(t,e,n){void 0===n&&(n=!1);const r=t.getBoundingClientRect();return{x:r.left+e.scrollLeft-(n?0:at(t,r)),y:r.top+e.scrollTop}}function ct(t,e,n){let r;if("viewport"===e)r=function(t,e){const n=M(t),r=$(t),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const t=q();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(t,n);else if("document"===e)r=function(t){const e=$(t),n=K(t),r=t.ownerDocument.body,o=p(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=p(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+at(t);const a=-n.scrollTop;return"rtl"===J(r).direction&&(l+=p(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}($(t));else if(N(e))r=function(t,e){const n=lt(t,!0,"fixed"===e),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=_(t)?rt(t):g(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:o*i.x,y:r*i.y}}(e,n);else{const n=it(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return E(r)}function ft(t,e){const n=Q(t);return!(n===e||!N(n)||G(n))&&("fixed"===J(n).position||ft(n,e))}function ut(t,e,n){const r=_(e),o=$(e),i="fixed"===n,l=lt(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const s=g(0);function c(){s.x=at(o)}if(r||!r&&!i)if(("body"!==B(e)||V(o))&&(a=K(e)),r){const t=lt(e,!0,i,e);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else o&&c();i&&!r&&o&&c();const f=!o||r||i?g(0):st(o,a);return{x:l.left+a.scrollLeft-s.x-f.x,y:l.top+a.scrollTop-s.y-f.y,width:l.width,height:l.height}}function dt(t){return"static"===J(t).position}function pt(t,e){if(!_(t)||"fixed"===J(t).position)return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function mt(t,e){const n=M(t);if(X(t))return n;if(!_(t)){let e=Q(t);for(;e&&!G(e);){if(N(e)&&!dt(e))return e;e=Q(e)}return n}let r=pt(t,e);for(;r&&Y(r)&&dt(r);)r=pt(r,e);return r&&G(r)&&dt(r)&&!I(r)?n:r||function(t){let e=Q(t);for(;_(e)&&!G(e);){if(I(e))return e;if(X(e))return null;e=Q(e)}return null}(t)||n}const ht={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const i="fixed"===o,l=$(r),a=!!e&&X(e.floating);if(r===l||a&&i)return n;let s={scrollLeft:0,scrollTop:0},c=g(1);const f=g(0),u=_(r);if((u||!u&&!i)&&(("body"!==B(r)||V(l))&&(s=K(r)),_(r))){const t=lt(r);c=rt(r),f.x=t.x+r.clientLeft,f.y=t.y+r.clientTop}const d=!l||u||i?g(0):st(l,s,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-s.scrollTop*c.y+f.y+d.y}},getDocumentElement:$,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[..."clippingAncestors"===n?X(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let r=Z(t,[],!1).filter((t=>N(t)&&"body"!==B(t))),o=null;const i="fixed"===J(t).position;let l=i?Q(t):t;for(;N(l)&&!G(l);){const e=J(l),n=I(l);n||"fixed"!==e.position||(o=null),(i?!n&&!o:!n&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||V(l)&&!n&&ft(t,l))?r=r.filter((t=>t!==l)):o=e,l=Q(l)}return e.set(t,r),r}(e,this._c):[].concat(n),r],l=i[0],a=i.reduce(((t,n)=>{const r=ct(e,n,o);return t.top=p(r.top,t.top),t.right=d(r.right,t.right),t.bottom=d(r.bottom,t.bottom),t.left=p(r.left,t.left),t}),ct(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:mt,getElementRects:async function(t){const e=this.getOffsetParent||mt,n=this.getDimensions,r=await n(t.floating);return{reference:ut(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=et(t);return{width:e,height:n}},getScale:rt,isElement:N,isRTL:function(t){return"rtl"===J(t).direction}};function gt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function yt(t,e,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=nt(t),f=o||i?[...c?Z(c):[],...Z(e)]:[];f.forEach((t=>{o&&t.addEventListener("scroll",n,{passive:!0}),i&&t.addEventListener("resize",n)}));const u=c&&a?function(t,e){let n,r=null;const o=$(t);function i(){var t;clearTimeout(n),null==(t=r)||t.disconnect(),r=null}return function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const c=t.getBoundingClientRect(),{left:f,top:u,width:m,height:g}=c;if(a||e(),!m||!g)return;const y={rootMargin:-h(u)+"px "+-h(o.clientWidth-(f+m))+"px "+-h(o.clientHeight-(u+g))+"px "+-h(f)+"px",threshold:p(0,d(1,s))||1};let w=!0;function x(e){const r=e[0].intersectionRatio;if(r!==s){if(!w)return l();r?l(!1,r):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}1!==r||gt(c,t.getBoundingClientRect())||l(),w=!1}try{r=new IntersectionObserver(x,{...y,root:o.ownerDocument})}catch(t){r=new IntersectionObserver(x,y)}r.observe(t)}(!0),i}(c,n):null;let m,g=-1,y=null;l&&(y=new ResizeObserver((t=>{let[r]=t;r&&r.target===c&&y&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),c&&!s&&y.observe(c),y.observe(e));let w=s?lt(t):null;return s&&function e(){const r=lt(t);w&&!gt(w,r)&&n();w=r,m=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach((t=>{o&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)})),null==u||u(),null==(t=y)||t.disconnect(),y=null,s&&cancelAnimationFrame(m)}}const wt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:l,middlewareData:a}=e,s=await async function(t,e){const{placement:n,platform:r,elements:o}=t,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=b(n),a=R(n),s="y"===S(n),c=["left","top"].includes(l)?-1:1,f=i&&s?-1:1,u=v(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*f,y:d*c}:{x:d*c,y:p*f}}(e,t);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}},xt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...s}=v(t,e),c={x:n,y:r},f=await H(e,s),u=S(b(o)),d=A(u);let p=c[d],m=c[u];if(i){const t="y"===d?"bottom":"right";p=x(p+f["y"===d?"top":"left"],p,p-f[t])}if(l){const t="y"===u?"bottom":"right";m=x(m+f["y"===u?"top":"left"],m,m-f[t])}const h=a.fn({...e,[d]:p,[u]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[d]:i,[u]:l}}}}}},vt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:a,platform:s,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=v(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=b(o),w=S(a),x=b(a)===a,A=await(null==s.isRTL?void 0:s.isRTL(c.floating)),C=d||(x||!h?[L(a)]:function(t){const e=L(t);return[T(t),e,T(e)]}(a)),E="none"!==m;!d&&E&&C.push(...function(t,e,n,r){const o=R(t);let i=function(t,e,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:r:e?r:o;case"left":case"right":return e?i:l;default:return[]}}(b(t),"start"===n,r);return o&&(i=i.map((t=>t+"-"+o)),e&&(i=i.concat(i.map(T)))),i}(a,h,m,A));const D=[a,...C],k=await H(e,g),F=[];let W=(null==(r=i.flip)?void 0:r.overflows)||[];if(f&&F.push(k[y]),u){const t=function(t,e,n){void 0===n&&(n=!1);const r=R(t),o=O(t),i=P(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[i]>e.floating[i]&&(l=L(l)),[l,L(l)]}(o,l,A);F.push(k[t[0]],k[t[1]])}if(W=[...W,{placement:o,overflows:F}],!F.every((t=>t<=0))){var B,M;const t=((null==(B=i.flip)?void 0:B.index)||0)+1,e=D[t];if(e){var $;const n="alignment"===u&&w!==S(e),r=(null==($=W[0])?void 0:$.overflows[0])>0;if(!n||r)return{data:{index:t,overflows:W},reset:{placement:e}}}let n=null==(M=W.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var j;const t=null==(j=W.filter((t=>{if(E){const e=S(t.placement);return e===w||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:j[0];t&&(n=t);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},bt=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:i,platform:l,elements:a}=e,{apply:s=()=>{},...c}=v(t,e),f=await H(e,c),u=b(o),m=R(o),h="y"===S(o),{width:g,height:y}=i.floating;let w,x;"top"===u||"bottom"===u?(w=u,x=m===(await(null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(x=u,w="end"===m?"top":"bottom");const A=y-f.top-f.bottom,P=g-f.left-f.right,O=d(y-f[w],A),T=d(g-f[x],P),L=!e.middlewareData.shift;let C=O,E=T;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(E=P),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(C=A),L&&!m){const t=p(f.left,0),e=p(f.right,0),n=p(f.top,0),r=p(f.bottom,0);h?E=g-2*(0!==t||0!==e?t+e:p(f.left,f.right)):C=y-2*(0!==n||0!==r?n+r:p(f.top,f.bottom))}await s({...e,availableWidth:E,availableHeight:C});const D=await l.getDimensions(a.floating);return g!==D.width||y!==D.height?{reset:{rects:!0}}:{}}}},Rt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=v(t,e);switch(r){case"referenceHidden":{const t=k(await H(e,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:F(t)}}}case"escaped":{const t=k(await H(e,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:F(t)}}}default:return{}}}}},At=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:l,elements:a,middlewareData:s}=e,{element:c,padding:f=0}=v(t,e)||{};if(null==c)return{};const u=C(f),p={x:n,y:r},m=O(o),h=P(m),g=await l.getDimensions(c),y="y"===m,w=y?"top":"left",b=y?"bottom":"right",A=y?"clientHeight":"clientWidth",S=i.reference[h]+i.reference[m]-p[m]-i.floating[h],T=p[m]-i.reference[m],L=await(null==l.getOffsetParent?void 0:l.getOffsetParent(c));let E=L?L[A]:0;E&&await(null==l.isElement?void 0:l.isElement(L))||(E=a.floating[A]||i.floating[h]);const D=S/2-T/2,H=E/2-g[h]/2-1,k=d(u[w],H),F=d(u[b],H),W=k,B=E-g[h]-F,M=E/2-g[h]/2+D,$=x(W,M,B),j=!s.arrow&&null!=R(o)&&M!==$&&i.reference[h]/2-(M<W?k:F)-g[h]/2<0,N=j?M<W?M-W:M-B:0;return{[m]:p[m]+N,data:{[m]:$,centerOffset:M-$-N,...j&&{alignmentOffset:N}},reset:j}}}),Pt=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=v(t,e),f={x:n,y:r},u=S(o),d=A(u);let p=f[d],m=f[u];const h=v(a,e),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){const t="y"===d?"height":"width",e=i.reference[d]-i.floating[t]+g.mainAxis,n=i.reference[d]+i.reference[t]-g.mainAxis;p<e?p=e:p>n&&(p=n)}if(c){var y,w;const t="y"===d?"width":"height",e=["top","left"].includes(b(o)),n=i.reference[u]-i.floating[t]+(e&&(null==(y=l.offset)?void 0:y[u])||0)+(e?0:g.crossAxis),r=i.reference[u]+i.reference[t]+(e?0:(null==(w=l.offset)?void 0:w[u])||0)-(e?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[d]:p,[u]:m}}}},St=(t,e,n)=>{const r=new Map,o={platform:ht,...n},i={...o.platform,_c:r};return(async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=D(c,r,s),d=r,p={},m=0;for(let n=0;n<a.length;n++){const{name:i,fn:h}=a[n],{x:g,y:y,data:w,reset:x}=await h({x:f,y:u,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=y?y:u,p={...p,[i]:{...p[i],...w}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(c=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:o}):x.rects),({x:f,y:u}=D(c,d,s))),n=-1)}return{x:f,y:u,placement:d,strategy:o,middlewareData:p}})(t,e,{...o,platform:i})};var Ot="undefined"!=typeof document?e:n;function Tt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;0!=r--;)if(!Tt(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!t.$$typeof)&&!Tt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function Lt(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ct(t,e){const n=Lt(t);return Math.round(e*n)/n}function Et(e){const n=t.useRef(e);return Ot((()=>{n.current=e})),n}const Dt=t=>({name:"arrow",options:t,fn(e){const{element:n,padding:r}="function"==typeof t?t(e):t;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?At({element:n.current,padding:r}).fn(e):{}:n?At({element:n,padding:r}).fn(e):{};var o}}),Ht=(t,e)=>({...xt(t),options:[t,e]}),kt=(t,e)=>({...Pt(t),options:[t,e]}),Ft=(t,e)=>({...vt(t),options:[t,e]}),Wt=(t,e)=>({...bt(t),options:[t,e]}),Bt=(t,e)=>({...Rt(t),options:[t,e]}),Mt=(t,e)=>({...Dt(t),options:[t,e]});var $t=t.forwardRef(((t,e)=>{const{children:n,width:r=10,height:l=5,...a}=t;return i(o.svg,{...a,ref:e,width:r,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:i("polygon",{points:"0,0 30,0 15,10"})})}));$t.displayName="Arrow";var jt=$t,Nt="Popper",[_t,zt]=a(Nt),[Vt,Yt]=_t(Nt),Xt=e=>{const{__scopePopper:n,children:r}=e,[o,l]=t.useState(null);return i(Vt,{scope:n,anchor:o,onAnchorChange:l,children:r})};Xt.displayName=Nt;var It="PopperAnchor",qt=t.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:a,...s}=e,c=Yt(It,r),f=t.useRef(null),u=l(n,f);return t.useEffect((()=>{c.onAnchorChange(a?.current||f.current)})),a?null:i(o.div,{...s,ref:u})}));qt.displayName=It;var Gt="PopperContent",[Jt,Kt]=_t(Gt),Qt=t.forwardRef(((e,n)=>{const{__scopePopper:a,side:u="bottom",sideOffset:d=0,align:p="center",alignOffset:m=0,arrowPadding:h=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:w=0,sticky:x="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:R,...A}=e,P=Yt(Gt,a),[S,O]=t.useState(null),T=l(n,(t=>O(t))),[L,C]=t.useState(null),E=f(L),D=E?.width??0,H=E?.height??0,k=u+("center"!==p?"-"+p:""),F="number"==typeof w?w:{top:0,right:0,bottom:0,left:0,...w},W=Array.isArray(y)?y:[y],B=W.length>0,M={padding:F,boundary:W.filter(ee),altBoundary:B},{refs:$,floatingStyles:j,placement:N,isPositioned:_,middlewareData:z}=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:f,open:u}=e,[d,p]=t.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=t.useState(i);Tt(m,i)||h(i);const[g,y]=t.useState(null),[w,x]=t.useState(null),v=t.useCallback((t=>{t!==P.current&&(P.current=t,y(t))}),[]),b=t.useCallback((t=>{t!==S.current&&(S.current=t,x(t))}),[]),R=a||g,A=s||w,P=t.useRef(null),S=t.useRef(null),O=t.useRef(d),T=null!=f,L=Et(f),C=Et(l),E=Et(u),D=t.useCallback((()=>{if(!P.current||!S.current)return;const t={placement:n,strategy:o,middleware:m};C.current&&(t.platform=C.current),St(P.current,S.current,t).then((t=>{const e={...t,isPositioned:!1!==E.current};H.current&&!Tt(O.current,e)&&(O.current=e,r.flushSync((()=>{p(e)})))}))}),[m,n,o,C,E]);Ot((()=>{!1===u&&O.current.isPositioned&&(O.current.isPositioned=!1,p((t=>({...t,isPositioned:!1}))))}),[u]);const H=t.useRef(!1);Ot((()=>(H.current=!0,()=>{H.current=!1})),[]),Ot((()=>{if(R&&(P.current=R),A&&(S.current=A),R&&A){if(L.current)return L.current(R,A,D);D()}}),[R,A,D,L,T]);const k=t.useMemo((()=>({reference:P,floating:S,setReference:v,setFloating:b})),[v,b]),F=t.useMemo((()=>({reference:R,floating:A})),[R,A]),W=t.useMemo((()=>{const t={position:o,left:0,top:0};if(!F.floating)return t;const e=Ct(F.floating,d.x),n=Ct(F.floating,d.y);return c?{...t,transform:"translate("+e+"px, "+n+"px)",...Lt(F.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:e,top:n}}),[o,c,F.floating,d.x,d.y]);return t.useMemo((()=>({...d,update:D,refs:k,elements:F,floatingStyles:W})),[d,D,k,F,W])}({strategy:"fixed",placement:k,whileElementsMounted:(...t)=>yt(...t,{animationFrame:"always"===b}),elements:{reference:P.anchor},middleware:[(V={mainAxis:d+H,alignmentAxis:m},{...wt(V),options:[V,Y]}),g&&Ht({mainAxis:!0,crossAxis:!1,limiter:"partial"===x?kt():void 0,...M}),g&&Ft({...M}),Wt({...M,apply:({elements:t,rects:e,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=e.reference,l=t.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${o}px`),l.setProperty("--radix-popper-anchor-height",`${i}px`)}}),L&&Mt({element:L,padding:h}),ne({arrowWidth:D,arrowHeight:H}),v&&Bt({strategy:"referenceHidden",...M})]});var V,Y;const[X,I]=re(N),q=s(R);c((()=>{_&&q?.()}),[_,q]);const G=z.arrow?.x,J=z.arrow?.y,K=0!==z.arrow?.centerOffset,[Q,U]=t.useState();return c((()=>{S&&U(window.getComputedStyle(S).zIndex)}),[S]),i("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:_?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i(Jt,{scope:a,placedSide:X,onArrowChange:C,arrowX:G,arrowY:J,shouldHideArrow:K,children:i(o.div,{"data-side":X,"data-align":I,...A,ref:T,style:{...A.style,animation:_?void 0:"none"}})})})}));Qt.displayName=Gt;var Ut="PopperArrow",Zt={top:"bottom",right:"left",bottom:"top",left:"right"},te=t.forwardRef((function(t,e){const{__scopePopper:n,...r}=t,o=Kt(Ut,n),l=Zt[o.placedSide];return i("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i(jt,{...r,ref:e,style:{...r.style,display:"block"}})})}));function ee(t){return null!==t}te.displayName=Ut;var ne=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:o}=e,i=0!==o.arrow?.centerOffset,l=i?0:t.arrowWidth,a=i?0:t.arrowHeight,[s,c]=re(n),f={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+l/2,d=(o.arrow?.y??0)+a/2;let p="",m="";return"bottom"===s?(p=i?f:`${u}px`,m=-a+"px"):"top"===s?(p=i?f:`${u}px`,m=`${r.floating.height+a}px`):"right"===s?(p=-a+"px",m=i?f:`${d}px`):"left"===s&&(p=`${r.floating.width+a}px`,m=i?f:`${d}px`),{data:{x:p,y:m}}}});function re(t){const[e,n="center"]=t.split("-");return[e,n]}var oe=Xt,ie=qt,le=Qt,ae=te;export{ie as A,le as C,oe as R,ae as a,zt as c};
|
2
|
-
//# sourceMappingURL=index-
|
1
|
+
import*as t from"react";import{useLayoutEffect as e,useEffect as n}from"react";import*as r from"react-dom";import{P as o}from"./index-vjATIVlG.mjs";import{jsx as i}from"react/jsx-runtime";import{u as l}from"./index-9Wr-AbGf.mjs";import{c as a}from"./index-BSTiUDx6.mjs";import{u as s}from"./index-BF_rlJfV.mjs";import{u as c}from"./index-C_f5Fx2v.mjs";import{u as f}from"./index-Ga0tRLIX.mjs";const u=["top","right","bottom","left"],d=Math.min,p=Math.max,m=Math.round,h=Math.floor,g=t=>({x:t,y:t}),y={left:"right",right:"left",bottom:"top",top:"bottom"},w={start:"end",end:"start"};function x(t,e,n){return p(t,d(e,n))}function v(t,e){return"function"==typeof t?t(e):t}function b(t){return t.split("-")[0]}function R(t){return t.split("-")[1]}function A(t){return"x"===t?"y":"x"}function P(t){return"y"===t?"height":"width"}function S(t){return["top","bottom"].includes(b(t))?"y":"x"}function O(t){return A(S(t))}function T(t){return t.replace(/start|end/g,(t=>w[t]))}function L(t){return t.replace(/left|right|bottom|top/g,(t=>y[t]))}function C(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function E(t){const{x:e,y:n,width:r,height:o}=t;return{width:r,height:o,top:n,left:e,right:e+r,bottom:n+o,x:e,y:n}}function D(t,e,n){let{reference:r,floating:o}=t;const i=S(e),l=O(e),a=P(l),s=b(e),c="y"===i,f=r.x+r.width/2-o.width/2,u=r.y+r.height/2-o.height/2,d=r[a]/2-o[a]/2;let p;switch(s){case"top":p={x:f,y:r.y-o.height};break;case"bottom":p={x:f,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:u};break;case"left":p={x:r.x-o.width,y:u};break;default:p={x:r.x,y:r.y}}switch(R(e)){case"start":p[l]-=d*(n&&c?-1:1);break;case"end":p[l]+=d*(n&&c?-1:1)}return p}async function H(t,e){var n;void 0===e&&(e={});const{x:r,y:o,platform:i,rects:l,elements:a,strategy:s}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:d=!1,padding:p=0}=v(e,t),m=C(p),h=a[d?"floating"===u?"reference":"floating":u],g=E(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(h)))||n?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:f,strategy:s})),y="floating"===u?{x:r,y:o,width:l.floating.width,height:l.floating.height}:l.reference,w=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),x=await(null==i.isElement?void 0:i.isElement(w))&&await(null==i.getScale?void 0:i.getScale(w))||{x:1,y:1},b=E(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:w,strategy:s}):y);return{top:(g.top-b.top+m.top)/x.y,bottom:(b.bottom-g.bottom+m.bottom)/x.y,left:(g.left-b.left+m.left)/x.x,right:(b.right-g.right+m.right)/x.x}}function k(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function F(t){return u.some((e=>t[e]>=0))}function W(){return"undefined"!=typeof window}function B(t){return j(t)?(t.nodeName||"").toLowerCase():"#document"}function M(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function $(t){var e;return null==(e=(j(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function j(t){return!!W()&&(t instanceof Node||t instanceof M(t).Node)}function N(t){return!!W()&&(t instanceof Element||t instanceof M(t).Element)}function _(t){return!!W()&&(t instanceof HTMLElement||t instanceof M(t).HTMLElement)}function z(t){return!(!W()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof M(t).ShadowRoot)}function V(t){const{overflow:e,overflowX:n,overflowY:r,display:o}=J(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(o)}function Y(t){return["table","td","th"].includes(B(t))}function X(t){return[":popover-open",":modal"].some((e=>{try{return t.matches(e)}catch(t){return!1}}))}function I(t){const e=q(),n=N(t)?J(t):t;return["transform","translate","scale","rotate","perspective"].some((t=>!!n[t]&&"none"!==n[t]))||!!n.containerType&&"normal"!==n.containerType||!e&&!!n.backdropFilter&&"none"!==n.backdropFilter||!e&&!!n.filter&&"none"!==n.filter||["transform","translate","scale","rotate","perspective","filter"].some((t=>(n.willChange||"").includes(t)))||["paint","layout","strict","content"].some((t=>(n.contain||"").includes(t)))}function q(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function G(t){return["html","body","#document"].includes(B(t))}function J(t){return M(t).getComputedStyle(t)}function K(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Q(t){if("html"===B(t))return t;const e=t.assignedSlot||t.parentNode||z(t)&&t.host||$(t);return z(e)?e.host:e}function U(t){const e=Q(t);return G(e)?t.ownerDocument?t.ownerDocument.body:t.body:_(e)&&V(e)?e:U(e)}function Z(t,e,n){var r;void 0===e&&(e=[]),void 0===n&&(n=!0);const o=U(t),i=o===(null==(r=t.ownerDocument)?void 0:r.body),l=M(o);if(i){const t=tt(l);return e.concat(l,l.visualViewport||[],V(o)?o:[],t&&n?Z(t):[])}return e.concat(o,Z(o,[],n))}function tt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function et(t){const e=J(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const o=_(t),i=o?t.offsetWidth:n,l=o?t.offsetHeight:r,a=m(n)!==i||m(r)!==l;return a&&(n=i,r=l),{width:n,height:r,$:a}}function nt(t){return N(t)?t:t.contextElement}function rt(t){const e=nt(t);if(!_(e))return g(1);const n=e.getBoundingClientRect(),{width:r,height:o,$:i}=et(e);let l=(i?m(n.width):n.width)/r,a=(i?m(n.height):n.height)/o;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const ot=g(0);function it(t){const e=M(t);return q()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:ot}function lt(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n=!1);const o=t.getBoundingClientRect(),i=nt(t);let l=g(1);e&&(r?N(r)&&(l=rt(r)):l=rt(t));const a=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==M(t))&&e}(i,n,r)?it(i):g(0);let s=(o.left+a.x)/l.x,c=(o.top+a.y)/l.y,f=o.width/l.x,u=o.height/l.y;if(i){const t=M(i),e=r&&N(r)?M(r):r;let n=t,o=tt(n);for(;o&&r&&e!==n;){const t=rt(o),e=o.getBoundingClientRect(),r=J(o),i=e.left+(o.clientLeft+parseFloat(r.paddingLeft))*t.x,l=e.top+(o.clientTop+parseFloat(r.paddingTop))*t.y;s*=t.x,c*=t.y,f*=t.x,u*=t.y,s+=i,c+=l,n=M(o),o=tt(n)}}return E({width:f,height:u,x:s,y:c})}function at(t,e){const n=K(t).scrollLeft;return e?e.left+n:lt($(t)).left+n}function st(t,e,n){void 0===n&&(n=!1);const r=t.getBoundingClientRect();return{x:r.left+e.scrollLeft-(n?0:at(t,r)),y:r.top+e.scrollTop}}function ct(t,e,n){let r;if("viewport"===e)r=function(t,e){const n=M(t),r=$(t),o=n.visualViewport;let i=r.clientWidth,l=r.clientHeight,a=0,s=0;if(o){i=o.width,l=o.height;const t=q();(!t||t&&"fixed"===e)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:i,height:l,x:a,y:s}}(t,n);else if("document"===e)r=function(t){const e=$(t),n=K(t),r=t.ownerDocument.body,o=p(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=p(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+at(t);const a=-n.scrollTop;return"rtl"===J(r).direction&&(l+=p(e.clientWidth,r.clientWidth)-o),{width:o,height:i,x:l,y:a}}($(t));else if(N(e))r=function(t,e){const n=lt(t,!0,"fixed"===e),r=n.top+t.clientTop,o=n.left+t.clientLeft,i=_(t)?rt(t):g(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:o*i.x,y:r*i.y}}(e,n);else{const n=it(t);r={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return E(r)}function ft(t,e){const n=Q(t);return!(n===e||!N(n)||G(n))&&("fixed"===J(n).position||ft(n,e))}function ut(t,e,n){const r=_(e),o=$(e),i="fixed"===n,l=lt(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const s=g(0);function c(){s.x=at(o)}if(r||!r&&!i)if(("body"!==B(e)||V(o))&&(a=K(e)),r){const t=lt(e,!0,i,e);s.x=t.x+e.clientLeft,s.y=t.y+e.clientTop}else o&&c();i&&!r&&o&&c();const f=!o||r||i?g(0):st(o,a);return{x:l.left+a.scrollLeft-s.x-f.x,y:l.top+a.scrollTop-s.y-f.y,width:l.width,height:l.height}}function dt(t){return"static"===J(t).position}function pt(t,e){if(!_(t)||"fixed"===J(t).position)return null;if(e)return e(t);let n=t.offsetParent;return $(t)===n&&(n=n.ownerDocument.body),n}function mt(t,e){const n=M(t);if(X(t))return n;if(!_(t)){let e=Q(t);for(;e&&!G(e);){if(N(e)&&!dt(e))return e;e=Q(e)}return n}let r=pt(t,e);for(;r&&Y(r)&&dt(r);)r=pt(r,e);return r&&G(r)&&dt(r)&&!I(r)?n:r||function(t){let e=Q(t);for(;_(e)&&!G(e);){if(I(e))return e;if(X(e))return null;e=Q(e)}return null}(t)||n}const ht={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:r,strategy:o}=t;const i="fixed"===o,l=$(r),a=!!e&&X(e.floating);if(r===l||a&&i)return n;let s={scrollLeft:0,scrollTop:0},c=g(1);const f=g(0),u=_(r);if((u||!u&&!i)&&(("body"!==B(r)||V(l))&&(s=K(r)),_(r))){const t=lt(r);c=rt(r),f.x=t.x+r.clientLeft,f.y=t.y+r.clientTop}const d=!l||u||i?g(0):st(l,s,!0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+f.x+d.x,y:n.y*c.y-s.scrollTop*c.y+f.y+d.y}},getDocumentElement:$,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:r,strategy:o}=t;const i=[..."clippingAncestors"===n?X(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let r=Z(t,[],!1).filter((t=>N(t)&&"body"!==B(t))),o=null;const i="fixed"===J(t).position;let l=i?Q(t):t;for(;N(l)&&!G(l);){const e=J(l),n=I(l);n||"fixed"!==e.position||(o=null),(i?!n&&!o:!n&&"static"===e.position&&o&&["absolute","fixed"].includes(o.position)||V(l)&&!n&&ft(t,l))?r=r.filter((t=>t!==l)):o=e,l=Q(l)}return e.set(t,r),r}(e,this._c):[].concat(n),r],l=i[0],a=i.reduce(((t,n)=>{const r=ct(e,n,o);return t.top=p(r.top,t.top),t.right=d(r.right,t.right),t.bottom=d(r.bottom,t.bottom),t.left=p(r.left,t.left),t}),ct(e,l,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:mt,getElementRects:async function(t){const e=this.getOffsetParent||mt,n=this.getDimensions,r=await n(t.floating);return{reference:ut(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=et(t);return{width:e,height:n}},getScale:rt,isElement:N,isRTL:function(t){return"rtl"===J(t).direction}};function gt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function yt(t,e,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=r,c=nt(t),f=o||i?[...c?Z(c):[],...Z(e)]:[];f.forEach((t=>{o&&t.addEventListener("scroll",n,{passive:!0}),i&&t.addEventListener("resize",n)}));const u=c&&a?function(t,e){let n,r=null;const o=$(t);function i(){var t;clearTimeout(n),null==(t=r)||t.disconnect(),r=null}return function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const c=t.getBoundingClientRect(),{left:f,top:u,width:m,height:g}=c;if(a||e(),!m||!g)return;const y={rootMargin:-h(u)+"px "+-h(o.clientWidth-(f+m))+"px "+-h(o.clientHeight-(u+g))+"px "+-h(f)+"px",threshold:p(0,d(1,s))||1};let w=!0;function x(e){const r=e[0].intersectionRatio;if(r!==s){if(!w)return l();r?l(!1,r):n=setTimeout((()=>{l(!1,1e-7)}),1e3)}1!==r||gt(c,t.getBoundingClientRect())||l(),w=!1}try{r=new IntersectionObserver(x,{...y,root:o.ownerDocument})}catch(t){r=new IntersectionObserver(x,y)}r.observe(t)}(!0),i}(c,n):null;let m,g=-1,y=null;l&&(y=new ResizeObserver((t=>{let[r]=t;r&&r.target===c&&y&&(y.unobserve(e),cancelAnimationFrame(g),g=requestAnimationFrame((()=>{var t;null==(t=y)||t.observe(e)}))),n()})),c&&!s&&y.observe(c),y.observe(e));let w=s?lt(t):null;return s&&function e(){const r=lt(t);w&&!gt(w,r)&&n();w=r,m=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach((t=>{o&&t.removeEventListener("scroll",n),i&&t.removeEventListener("resize",n)})),null==u||u(),null==(t=y)||t.disconnect(),y=null,s&&cancelAnimationFrame(m)}}const wt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:o,y:i,placement:l,middlewareData:a}=e,s=await async function(t,e){const{placement:n,platform:r,elements:o}=t,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),l=b(n),a=R(n),s="y"===S(n),c=["left","top"].includes(l)?-1:1,f=i&&s?-1:1,u=v(e,t);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*f,y:d*c}:{x:d*c,y:p*f}}(e,t);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+s.x,y:i+s.y,data:{...s,placement:l}}}}},xt=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:o}=e,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...s}=v(t,e),c={x:n,y:r},f=await H(e,s),u=S(b(o)),d=A(u);let p=c[d],m=c[u];if(i){const t="y"===d?"bottom":"right";p=x(p+f["y"===d?"top":"left"],p,p-f[t])}if(l){const t="y"===u?"bottom":"right";m=x(m+f["y"===u?"top":"left"],m,m-f[t])}const h=a.fn({...e,[d]:p,[u]:m});return{...h,data:{x:h.x-n,y:h.y-r,enabled:{[d]:i,[u]:l}}}}}},vt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,r;const{placement:o,middlewareData:i,rects:l,initialPlacement:a,platform:s,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:h=!0,...g}=v(t,e);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=b(o),w=S(a),x=b(a)===a,A=await(null==s.isRTL?void 0:s.isRTL(c.floating)),C=d||(x||!h?[L(a)]:function(t){const e=L(t);return[T(t),e,T(e)]}(a)),E="none"!==m;!d&&E&&C.push(...function(t,e,n,r){const o=R(t);let i=function(t,e,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(t){case"top":case"bottom":return n?e?o:r:e?r:o;case"left":case"right":return e?i:l;default:return[]}}(b(t),"start"===n,r);return o&&(i=i.map((t=>t+"-"+o)),e&&(i=i.concat(i.map(T)))),i}(a,h,m,A));const D=[a,...C],k=await H(e,g),F=[];let W=(null==(r=i.flip)?void 0:r.overflows)||[];if(f&&F.push(k[y]),u){const t=function(t,e,n){void 0===n&&(n=!1);const r=R(t),o=O(t),i=P(o);let l="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return e.reference[i]>e.floating[i]&&(l=L(l)),[l,L(l)]}(o,l,A);F.push(k[t[0]],k[t[1]])}if(W=[...W,{placement:o,overflows:F}],!F.every((t=>t<=0))){var B,M;const t=((null==(B=i.flip)?void 0:B.index)||0)+1,e=D[t];if(e){var $;const n="alignment"===u&&w!==S(e),r=(null==($=W[0])?void 0:$.overflows[0])>0;if(!n||r)return{data:{index:t,overflows:W},reset:{placement:e}}}let n=null==(M=W.filter((t=>t.overflows[0]<=0)).sort(((t,e)=>t.overflows[1]-e.overflows[1]))[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var j;const t=null==(j=W.filter((t=>{if(E){const e=S(t.placement);return e===w||"y"===e}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,e)=>t+e),0)])).sort(((t,e)=>t[1]-e[1]))[0])?void 0:j[0];t&&(n=t);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},bt=function(t){return void 0===t&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:o,rects:i,platform:l,elements:a}=e,{apply:s=()=>{},...c}=v(t,e),f=await H(e,c),u=b(o),m=R(o),h="y"===S(o),{width:g,height:y}=i.floating;let w,x;"top"===u||"bottom"===u?(w=u,x=m===(await(null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(x=u,w="end"===m?"top":"bottom");const A=y-f.top-f.bottom,P=g-f.left-f.right,O=d(y-f[w],A),T=d(g-f[x],P),L=!e.middlewareData.shift;let C=O,E=T;if(null!=(n=e.middlewareData.shift)&&n.enabled.x&&(E=P),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(C=A),L&&!m){const t=p(f.left,0),e=p(f.right,0),n=p(f.top,0),r=p(f.bottom,0);h?E=g-2*(0!==t||0!==e?t+e:p(f.left,f.right)):C=y-2*(0!==n||0!==r?n+r:p(f.top,f.bottom))}await s({...e,availableWidth:E,availableHeight:C});const D=await l.getDimensions(a.floating);return g!==D.width||y!==D.height?{reset:{rects:!0}}:{}}}},Rt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...o}=v(t,e);switch(r){case"referenceHidden":{const t=k(await H(e,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:F(t)}}}case"escaped":{const t=k(await H(e,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:t,escaped:F(t)}}}default:return{}}}}},At=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:o,rects:i,platform:l,elements:a,middlewareData:s}=e,{element:c,padding:f=0}=v(t,e)||{};if(null==c)return{};const u=C(f),p={x:n,y:r},m=O(o),h=P(m),g=await l.getDimensions(c),y="y"===m,w=y?"top":"left",b=y?"bottom":"right",A=y?"clientHeight":"clientWidth",S=i.reference[h]+i.reference[m]-p[m]-i.floating[h],T=p[m]-i.reference[m],L=await(null==l.getOffsetParent?void 0:l.getOffsetParent(c));let E=L?L[A]:0;E&&await(null==l.isElement?void 0:l.isElement(L))||(E=a.floating[A]||i.floating[h]);const D=S/2-T/2,H=E/2-g[h]/2-1,k=d(u[w],H),F=d(u[b],H),W=k,B=E-g[h]-F,M=E/2-g[h]/2+D,$=x(W,M,B),j=!s.arrow&&null!=R(o)&&M!==$&&i.reference[h]/2-(M<W?k:F)-g[h]/2<0,N=j?M<W?M-W:M-B:0;return{[m]:p[m]+N,data:{[m]:$,centerOffset:M-$-N,...j&&{alignmentOffset:N}},reset:j}}}),Pt=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:o,rects:i,middlewareData:l}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=v(t,e),f={x:n,y:r},u=S(o),d=A(u);let p=f[d],m=f[u];const h=v(a,e),g="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){const t="y"===d?"height":"width",e=i.reference[d]-i.floating[t]+g.mainAxis,n=i.reference[d]+i.reference[t]-g.mainAxis;p<e?p=e:p>n&&(p=n)}if(c){var y,w;const t="y"===d?"width":"height",e=["top","left"].includes(b(o)),n=i.reference[u]-i.floating[t]+(e&&(null==(y=l.offset)?void 0:y[u])||0)+(e?0:g.crossAxis),r=i.reference[u]+i.reference[t]+(e?0:(null==(w=l.offset)?void 0:w[u])||0)-(e?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[d]:p,[u]:m}}}},St=(t,e,n)=>{const r=new Map,o={platform:ht,...n},i={...o.platform,_c:r};return(async(t,e,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),s=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:u}=D(c,r,s),d=r,p={},m=0;for(let n=0;n<a.length;n++){const{name:i,fn:h}=a[n],{x:g,y:y,data:w,reset:x}=await h({x:f,y:u,initialPlacement:r,placement:d,strategy:o,middlewareData:p,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=g?g:f,u=null!=y?y:u,p={...p,[i]:{...p[i],...w}},x&&m<=50&&(m++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(c=!0===x.rects?await l.getElementRects({reference:t,floating:e,strategy:o}):x.rects),({x:f,y:u}=D(c,d,s))),n=-1)}return{x:f,y:u,placement:d,strategy:o,middlewareData:p}})(t,e,{...o,platform:i})};var Ot="undefined"!=typeof document?e:n;function Tt(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if("function"==typeof t&&t.toString()===e.toString())return!0;let n,r,o;if(t&&e&&"object"==typeof t){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;0!==r--;)if(!Tt(t[r],e[r]))return!1;return!0}if(o=Object.keys(t),n=o.length,n!==Object.keys(e).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(e,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!t.$$typeof)&&!Tt(t[n],e[n]))return!1}return!0}return t!=t&&e!=e}function Lt(t){if("undefined"==typeof window)return 1;return(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Ct(t,e){const n=Lt(t);return Math.round(e*n)/n}function Et(e){const n=t.useRef(e);return Ot((()=>{n.current=e})),n}const Dt=t=>({name:"arrow",options:t,fn(e){const{element:n,padding:r}="function"==typeof t?t(e):t;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?At({element:n.current,padding:r}).fn(e):{}:n?At({element:n,padding:r}).fn(e):{};var o}}),Ht=(t,e)=>({...xt(t),options:[t,e]}),kt=(t,e)=>({...Pt(t),options:[t,e]}),Ft=(t,e)=>({...vt(t),options:[t,e]}),Wt=(t,e)=>({...bt(t),options:[t,e]}),Bt=(t,e)=>({...Rt(t),options:[t,e]}),Mt=(t,e)=>({...Dt(t),options:[t,e]});var $t=t.forwardRef(((t,e)=>{const{children:n,width:r=10,height:l=5,...a}=t;return i(o.svg,{...a,ref:e,width:r,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:i("polygon",{points:"0,0 30,0 15,10"})})}));$t.displayName="Arrow";var jt=$t,Nt="Popper",[_t,zt]=a(Nt),[Vt,Yt]=_t(Nt),Xt=e=>{const{__scopePopper:n,children:r}=e,[o,l]=t.useState(null);return i(Vt,{scope:n,anchor:o,onAnchorChange:l,children:r})};Xt.displayName=Nt;var It="PopperAnchor",qt=t.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:a,...s}=e,c=Yt(It,r),f=t.useRef(null),u=l(n,f);return t.useEffect((()=>{c.onAnchorChange(a?.current||f.current)})),a?null:i(o.div,{...s,ref:u})}));qt.displayName=It;var Gt="PopperContent",[Jt,Kt]=_t(Gt),Qt=t.forwardRef(((e,n)=>{const{__scopePopper:a,side:u="bottom",sideOffset:d=0,align:p="center",alignOffset:m=0,arrowPadding:h=0,avoidCollisions:g=!0,collisionBoundary:y=[],collisionPadding:w=0,sticky:x="partial",hideWhenDetached:v=!1,updatePositionStrategy:b="optimized",onPlaced:R,...A}=e,P=Yt(Gt,a),[S,O]=t.useState(null),T=l(n,(t=>O(t))),[L,C]=t.useState(null),E=f(L),D=E?.width??0,H=E?.height??0,k=u+("center"!==p?"-"+p:""),F="number"==typeof w?w:{top:0,right:0,bottom:0,left:0,...w},W=Array.isArray(y)?y:[y],B=W.length>0,M={padding:F,boundary:W.filter(ee),altBoundary:B},{refs:$,floatingStyles:j,placement:N,isPositioned:_,middlewareData:z}=function(e){void 0===e&&(e={});const{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:l,elements:{reference:a,floating:s}={},transform:c=!0,whileElementsMounted:f,open:u}=e,[d,p]=t.useState({x:0,y:0,strategy:o,placement:n,middlewareData:{},isPositioned:!1}),[m,h]=t.useState(i);Tt(m,i)||h(i);const[g,y]=t.useState(null),[w,x]=t.useState(null),v=t.useCallback((t=>{t!==P.current&&(P.current=t,y(t))}),[]),b=t.useCallback((t=>{t!==S.current&&(S.current=t,x(t))}),[]),R=a||g,A=s||w,P=t.useRef(null),S=t.useRef(null),O=t.useRef(d),T=null!=f,L=Et(f),C=Et(l),E=Et(u),D=t.useCallback((()=>{if(!P.current||!S.current)return;const t={placement:n,strategy:o,middleware:m};C.current&&(t.platform=C.current),St(P.current,S.current,t).then((t=>{const e={...t,isPositioned:!1!==E.current};H.current&&!Tt(O.current,e)&&(O.current=e,r.flushSync((()=>{p(e)})))}))}),[m,n,o,C,E]);Ot((()=>{!1===u&&O.current.isPositioned&&(O.current.isPositioned=!1,p((t=>({...t,isPositioned:!1}))))}),[u]);const H=t.useRef(!1);Ot((()=>(H.current=!0,()=>{H.current=!1})),[]),Ot((()=>{if(R&&(P.current=R),A&&(S.current=A),R&&A){if(L.current)return L.current(R,A,D);D()}}),[R,A,D,L,T]);const k=t.useMemo((()=>({reference:P,floating:S,setReference:v,setFloating:b})),[v,b]),F=t.useMemo((()=>({reference:R,floating:A})),[R,A]),W=t.useMemo((()=>{const t={position:o,left:0,top:0};if(!F.floating)return t;const e=Ct(F.floating,d.x),n=Ct(F.floating,d.y);return c?{...t,transform:"translate("+e+"px, "+n+"px)",...Lt(F.floating)>=1.5&&{willChange:"transform"}}:{position:o,left:e,top:n}}),[o,c,F.floating,d.x,d.y]);return t.useMemo((()=>({...d,update:D,refs:k,elements:F,floatingStyles:W})),[d,D,k,F,W])}({strategy:"fixed",placement:k,whileElementsMounted:(...t)=>yt(...t,{animationFrame:"always"===b}),elements:{reference:P.anchor},middleware:[(V={mainAxis:d+H,alignmentAxis:m},{...wt(V),options:[V,Y]}),g&&Ht({mainAxis:!0,crossAxis:!1,limiter:"partial"===x?kt():void 0,...M}),g&&Ft({...M}),Wt({...M,apply:({elements:t,rects:e,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=e.reference,l=t.floating.style;l.setProperty("--radix-popper-available-width",`${n}px`),l.setProperty("--radix-popper-available-height",`${r}px`),l.setProperty("--radix-popper-anchor-width",`${o}px`),l.setProperty("--radix-popper-anchor-height",`${i}px`)}}),L&&Mt({element:L,padding:h}),ne({arrowWidth:D,arrowHeight:H}),v&&Bt({strategy:"referenceHidden",...M})]});var V,Y;const[X,I]=re(N),q=s(R);c((()=>{_&&q?.()}),[_,q]);const G=z.arrow?.x,J=z.arrow?.y,K=0!==z.arrow?.centerOffset,[Q,U]=t.useState();return c((()=>{S&&U(window.getComputedStyle(S).zIndex)}),[S]),i("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...j,transform:_?j.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Q,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:i(Jt,{scope:a,placedSide:X,onArrowChange:C,arrowX:G,arrowY:J,shouldHideArrow:K,children:i(o.div,{"data-side":X,"data-align":I,...A,ref:T,style:{...A.style,animation:_?void 0:"none"}})})})}));Qt.displayName=Gt;var Ut="PopperArrow",Zt={top:"bottom",right:"left",bottom:"top",left:"right"},te=t.forwardRef((function(t,e){const{__scopePopper:n,...r}=t,o=Kt(Ut,n),l=Zt[o.placedSide];return i("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:i(jt,{...r,ref:e,style:{...r.style,display:"block"}})})}));function ee(t){return null!==t}te.displayName=Ut;var ne=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:r,middlewareData:o}=e,i=0!==o.arrow?.centerOffset,l=i?0:t.arrowWidth,a=i?0:t.arrowHeight,[s,c]=re(n),f={start:"0%",center:"50%",end:"100%"}[c],u=(o.arrow?.x??0)+l/2,d=(o.arrow?.y??0)+a/2;let p="",m="";return"bottom"===s?(p=i?f:`${u}px`,m=-a+"px"):"top"===s?(p=i?f:`${u}px`,m=`${r.floating.height+a}px`):"right"===s?(p=-a+"px",m=i?f:`${d}px`):"left"===s&&(p=`${r.floating.width+a}px`,m=i?f:`${d}px`),{data:{x:p,y:m}}}});function re(t){const[e,n="center"]=t.split("-");return[e,n]}var oe=Xt,ie=qt,le=Qt,ae=te;export{ie as A,le as C,oe as R,ae as a,zt as c};
|
2
|
+
//# sourceMappingURL=index-BWIrjh6G.mjs.map
|