@pdf-viewer/react 0.4.0-beta.1

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.
Files changed (306) hide show
  1. package/README.md +3 -0
  2. package/dist/Container.module-cb7b45b9.js +14 -0
  3. package/dist/RPSplitter.module-13d612c4.js +7 -0
  4. package/dist/RPTheme.module-f756e5cd.js +7 -0
  5. package/dist/Thumbnails-06fa1aa5.js +2657 -0
  6. package/dist/WrapperLayout.module-147bc943.js +6 -0
  7. package/dist/assets/Button.css +1 -0
  8. package/dist/assets/Checkbox.css +1 -0
  9. package/dist/assets/Container.css +1 -0
  10. package/dist/assets/DropDown.css +1 -0
  11. package/dist/assets/Input.css +1 -0
  12. package/dist/assets/LoaderIcon.css +1 -0
  13. package/dist/assets/MenuItem.css +1 -0
  14. package/dist/assets/MenuSeparator.css +1 -0
  15. package/dist/assets/PropertyItem.css +1 -0
  16. package/dist/assets/RPSplitter.css +1 -0
  17. package/dist/assets/RPTheme.css +1 -0
  18. package/dist/assets/RotateTool.css +1 -0
  19. package/dist/assets/Thumbnails.css +1 -0
  20. package/dist/assets/WrapperLayout.css +1 -0
  21. package/dist/clsx-0c6e471a.js +22 -0
  22. package/dist/components/RPConfig.js +1347 -0
  23. package/dist/components/RPController.js +49 -0
  24. package/dist/components/RPDocument.js +9 -0
  25. package/dist/components/RPDropFileZone.js +33 -0
  26. package/dist/components/RPTheme.js +21 -0
  27. package/dist/components/RPViewer.js +37 -0
  28. package/dist/components/icons/CheckIcon.js +22 -0
  29. package/dist/components/icons/ChevronUpIcon.js +22 -0
  30. package/dist/components/icons/ClearIcon.js +25 -0
  31. package/dist/components/icons/ClockwiseIcon.js +22 -0
  32. package/dist/components/icons/CloseIcon.js +22 -0
  33. package/dist/components/icons/DarkPdfIcon.js +15 -0
  34. package/dist/components/icons/DualPageIcon.js +22 -0
  35. package/dist/components/icons/FileDownloadDefaultIcon.js +23 -0
  36. package/dist/components/icons/FileUploadDefaultIcon.js +23 -0
  37. package/dist/components/icons/FullScreenIcon.js +22 -0
  38. package/dist/components/icons/GoToDownIcon.js +22 -0
  39. package/dist/components/icons/HandModeDefaultIcon.js +22 -0
  40. package/dist/components/icons/HorizontalScrollingIcon.js +24 -0
  41. package/dist/components/icons/InfoIcon.js +22 -0
  42. package/dist/components/icons/LightPdfIcon.js +15 -0
  43. package/dist/components/icons/LoaderIcon.js +17 -0
  44. package/dist/components/icons/MoonIcon.js +22 -0
  45. package/dist/components/icons/PageScrollingIcon.js +24 -0
  46. package/dist/components/icons/PrintDefaultIcon.js +23 -0
  47. package/dist/components/icons/SearchIcon.js +22 -0
  48. package/dist/components/icons/SinglePageIcon.js +22 -0
  49. package/dist/components/icons/SunIcon.js +25 -0
  50. package/dist/components/icons/TextSelectionDefaultIcon.js +23 -0
  51. package/dist/components/icons/ThreeDotIcon.js +22 -0
  52. package/dist/components/icons/Thumbnail.js +54 -0
  53. package/dist/components/icons/VerticalScrollingIcon.js +24 -0
  54. package/dist/components/icons/WrappedScrollingIcon.js +24 -0
  55. package/dist/components/icons/ZoomInIcon.js +22 -0
  56. package/dist/components/icons/ZoomOutIcon.js +22 -0
  57. package/dist/components/layout/Container.js +28 -0
  58. package/dist/components/layout/RPLayout.js +59 -0
  59. package/dist/components/layout/WrapperLayout.js +11 -0
  60. package/dist/components/layout/sidebar/RPSidebar.js +34 -0
  61. package/dist/components/layout/sidebar/RPSplitter.js +10 -0
  62. package/dist/components/layout/sidebar/Thumbnail.js +8 -0
  63. package/dist/components/layout/sidebar/Thumbnails.js +7 -0
  64. package/dist/components/layout/toolbar/DarkModeTool.js +23 -0
  65. package/dist/components/layout/toolbar/DocumentDialog.js +36 -0
  66. package/dist/components/layout/toolbar/DocumentProperties.js +19 -0
  67. package/dist/components/layout/toolbar/FileDownloadTool.js +11 -0
  68. package/dist/components/layout/toolbar/FileUploadTool.js +21 -0
  69. package/dist/components/layout/toolbar/FullScreenTool.js +46 -0
  70. package/dist/components/layout/toolbar/MenuItem.js +12 -0
  71. package/dist/components/layout/toolbar/MenuSeparator.js +8 -0
  72. package/dist/components/layout/toolbar/MostPageTool.js +36 -0
  73. package/dist/components/layout/toolbar/OtherTool.js +21 -0
  74. package/dist/components/layout/toolbar/Paginate.js +12 -0
  75. package/dist/components/layout/toolbar/PrintTool.js +11 -0
  76. package/dist/components/layout/toolbar/PropertyItem.js +12 -0
  77. package/dist/components/layout/toolbar/RPToolbar.js +8 -0
  78. package/dist/components/layout/toolbar/RPToolbarEnd.js +9 -0
  79. package/dist/components/layout/toolbar/RotateTool.js +33 -0
  80. package/dist/components/layout/toolbar/ScrollModeTool.js +54 -0
  81. package/dist/components/layout/toolbar/SearchTool.js +40 -0
  82. package/dist/components/layout/toolbar/SelectionModeTool.js +36 -0
  83. package/dist/components/layout/toolbar/ViewModeTool.js +31 -0
  84. package/dist/components/layout/toolbar/ZoomTool.js +41 -0
  85. package/dist/components/page/AnnotationLayer.js +37 -0
  86. package/dist/components/page/CanvasLayer.js +33 -0
  87. package/dist/components/page/DualPage.js +6 -0
  88. package/dist/components/page/RPPage.js +33 -0
  89. package/dist/components/page/SinglePage.js +6 -0
  90. package/dist/components/page/TextLayer.js +34 -0
  91. package/dist/components/ui/Button.js +22 -0
  92. package/dist/components/ui/Checkbox.js +301 -0
  93. package/dist/components/ui/DropDown.js +29 -0
  94. package/dist/components/ui/Input.js +26 -0
  95. package/dist/components/ui/LoadingIndicator.js +6 -0
  96. package/dist/contexts/ConfigContext.js +13 -0
  97. package/dist/contexts/DarkModeContext.js +28 -0
  98. package/dist/contexts/DropFileZoneContext.js +50 -0
  99. package/dist/contexts/FileInputContext.js +38 -0
  100. package/dist/contexts/FullScreenContext.js +18 -0
  101. package/dist/contexts/IconContext.js +11 -0
  102. package/dist/contexts/InitialStateContext.js +11 -0
  103. package/dist/contexts/LayerContext.js +8 -0
  104. package/dist/contexts/LayoutContainerContext.js +10 -0
  105. package/dist/contexts/LicenseContext.js +15 -0
  106. package/dist/contexts/OtherToolContext.js +18 -0
  107. package/dist/contexts/PageViewportContext.js +8 -0
  108. package/dist/contexts/PaginateContext.js +11 -0
  109. package/dist/contexts/PrintContext.js +8 -0
  110. package/dist/contexts/RPDocumentContext.js +49 -0
  111. package/dist/contexts/RenderedPagesCache.js +14 -0
  112. package/dist/contexts/RotateContext.js +23 -0
  113. package/dist/contexts/ScrollModeContext.js +21 -0
  114. package/dist/contexts/ScrollStateContext.js +13 -0
  115. package/dist/contexts/SearchContext.js +8 -0
  116. package/dist/contexts/SelectionModeContext.js +23 -0
  117. package/dist/contexts/ThemeContext.js +7 -0
  118. package/dist/contexts/ThumbnailsContext.js +8 -0
  119. package/dist/contexts/ToolbarComponentContext.js +41 -0
  120. package/dist/contexts/ViewModeContext.js +28 -0
  121. package/dist/contexts/ViewportContext.js +62 -0
  122. package/dist/contexts/VirtualGridContext.js +15 -0
  123. package/dist/contexts/VirtualScrollContext.js +53 -0
  124. package/dist/contexts/ZoomContext.js +46 -0
  125. package/dist/index-3459164c.js +3609 -0
  126. package/dist/index-743c36f0.js +139 -0
  127. package/dist/main.js +37 -0
  128. package/dist/types/components/RPConfig.d.ts +3 -0
  129. package/dist/types/components/RPController.d.ts +3 -0
  130. package/dist/types/components/RPDocument.d.ts +3 -0
  131. package/dist/types/components/RPDropFileZone.d.ts +2 -0
  132. package/dist/types/components/RPTheme.d.ts +3 -0
  133. package/dist/types/components/RPViewer.d.ts +2 -0
  134. package/dist/types/components/icons/CheckIcon.d.ts +2 -0
  135. package/dist/types/components/icons/ChevronUpIcon.d.ts +2 -0
  136. package/dist/types/components/icons/ClearIcon.d.ts +2 -0
  137. package/dist/types/components/icons/ClockwiseIcon.d.ts +2 -0
  138. package/dist/types/components/icons/CloseIcon.d.ts +2 -0
  139. package/dist/types/components/icons/DarkPdfIcon.d.ts +2 -0
  140. package/dist/types/components/icons/DualPageIcon.d.ts +2 -0
  141. package/dist/types/components/icons/FileDownloadDefaultIcon.d.ts +2 -0
  142. package/dist/types/components/icons/FileUploadDefaultIcon.d.ts +2 -0
  143. package/dist/types/components/icons/FullScreenIcon.d.ts +2 -0
  144. package/dist/types/components/icons/GoToDownIcon.d.ts +2 -0
  145. package/dist/types/components/icons/HandModeDefaultIcon.d.ts +2 -0
  146. package/dist/types/components/icons/HorizontalScrollingIcon.d.ts +2 -0
  147. package/dist/types/components/icons/InfoIcon.d.ts +2 -0
  148. package/dist/types/components/icons/LightPdfIcon.d.ts +2 -0
  149. package/dist/types/components/icons/LoaderIcon.d.ts +2 -0
  150. package/dist/types/components/icons/MoonIcon.d.ts +2 -0
  151. package/dist/types/components/icons/PageScrollingIcon.d.ts +2 -0
  152. package/dist/types/components/icons/PrintDefaultIcon.d.ts +2 -0
  153. package/dist/types/components/icons/SearchIcon.d.ts +2 -0
  154. package/dist/types/components/icons/SinglePageIcon.d.ts +2 -0
  155. package/dist/types/components/icons/SunIcon.d.ts +2 -0
  156. package/dist/types/components/icons/TextSelectionDefaultIcon.d.ts +2 -0
  157. package/dist/types/components/icons/ThreeDotIcon.d.ts +2 -0
  158. package/dist/types/components/icons/Thumbnail.d.ts +2 -0
  159. package/dist/types/components/icons/VerticalScrollingIcon.d.ts +2 -0
  160. package/dist/types/components/icons/WrappedScrollingIcon.d.ts +2 -0
  161. package/dist/types/components/icons/ZoomInIcon.d.ts +2 -0
  162. package/dist/types/components/icons/ZoomOutIcon.d.ts +2 -0
  163. package/dist/types/components/layout/Container.d.ts +9 -0
  164. package/dist/types/components/layout/RPLayout.d.ts +3 -0
  165. package/dist/types/components/layout/WrapperLayout.d.ts +2 -0
  166. package/dist/types/components/layout/sidebar/RPSidebar.d.ts +1 -0
  167. package/dist/types/components/layout/sidebar/RPSplitter.d.ts +7 -0
  168. package/dist/types/components/layout/sidebar/Thumbnail.d.ts +11 -0
  169. package/dist/types/components/layout/sidebar/Thumbnails.d.ts +5 -0
  170. package/dist/types/components/layout/toolbar/DarkModeTool.d.ts +1 -0
  171. package/dist/types/components/layout/toolbar/DocumentDialog.d.ts +2 -0
  172. package/dist/types/components/layout/toolbar/DocumentProperties.d.ts +1 -0
  173. package/dist/types/components/layout/toolbar/FileDownloadTool.d.ts +2 -0
  174. package/dist/types/components/layout/toolbar/FileUploadTool.d.ts +2 -0
  175. package/dist/types/components/layout/toolbar/FullScreenTool.d.ts +1 -0
  176. package/dist/types/components/layout/toolbar/MenuItem.d.ts +6 -0
  177. package/dist/types/components/layout/toolbar/MenuSeparator.d.ts +1 -0
  178. package/dist/types/components/layout/toolbar/MostPageTool.d.ts +1 -0
  179. package/dist/types/components/layout/toolbar/OtherTool.d.ts +1 -0
  180. package/dist/types/components/layout/toolbar/Paginate.d.ts +1 -0
  181. package/dist/types/components/layout/toolbar/PrintTool.d.ts +1 -0
  182. package/dist/types/components/layout/toolbar/PropertyItem.d.ts +7 -0
  183. package/dist/types/components/layout/toolbar/RPToolbar.d.ts +1 -0
  184. package/dist/types/components/layout/toolbar/RPToolbarEnd.d.ts +1 -0
  185. package/dist/types/components/layout/toolbar/RotateTool.d.ts +1 -0
  186. package/dist/types/components/layout/toolbar/ScrollModeTool.d.ts +1 -0
  187. package/dist/types/components/layout/toolbar/SearchTool.d.ts +2 -0
  188. package/dist/types/components/layout/toolbar/SelectionModeTool.d.ts +1 -0
  189. package/dist/types/components/layout/toolbar/ViewModeTool.d.ts +1 -0
  190. package/dist/types/components/layout/toolbar/ZoomTool.d.ts +1 -0
  191. package/dist/types/components/page/AnnotationLayer.d.ts +6 -0
  192. package/dist/types/components/page/CanvasLayer.d.ts +8 -0
  193. package/dist/types/components/page/DualPage.d.ts +5 -0
  194. package/dist/types/components/page/RPPage.d.ts +6 -0
  195. package/dist/types/components/page/SinglePage.d.ts +5 -0
  196. package/dist/types/components/page/TextLayer.d.ts +6 -0
  197. package/dist/types/components/ui/Button.d.ts +6 -0
  198. package/dist/types/components/ui/Checkbox.d.ts +8 -0
  199. package/dist/types/components/ui/DropDown.d.ts +9 -0
  200. package/dist/types/components/ui/Input.d.ts +6 -0
  201. package/dist/types/components/ui/LoadingIndicator.d.ts +6 -0
  202. package/dist/types/contexts/ConfigContext.d.ts +5 -0
  203. package/dist/types/contexts/DarkModeContext.d.ts +5 -0
  204. package/dist/types/contexts/DropFileZoneContext.d.ts +5 -0
  205. package/dist/types/contexts/FileInputContext.d.ts +7 -0
  206. package/dist/types/contexts/FullScreenContext.d.ts +7 -0
  207. package/dist/types/contexts/IconContext.d.ts +7 -0
  208. package/dist/types/contexts/InitialStateContext.d.ts +5 -0
  209. package/dist/types/contexts/LayerContext.d.ts +5 -0
  210. package/dist/types/contexts/LayoutContainerContext.d.ts +8 -0
  211. package/dist/types/contexts/LicenseContext.d.ts +7 -0
  212. package/dist/types/contexts/OtherToolContext.d.ts +9 -0
  213. package/dist/types/contexts/PageViewportContext.d.ts +4 -0
  214. package/dist/types/contexts/PaginateContext.d.ts +5 -0
  215. package/dist/types/contexts/PrintContext.d.ts +7 -0
  216. package/dist/types/contexts/RPDocumentContext.d.ts +10 -0
  217. package/dist/types/contexts/RenderedPagesCache.d.ts +10 -0
  218. package/dist/types/contexts/RotateContext.d.ts +5 -0
  219. package/dist/types/contexts/ScrollModeContext.d.ts +5 -0
  220. package/dist/types/contexts/ScrollStateContext.d.ts +8 -0
  221. package/dist/types/contexts/SearchContext.d.ts +7 -0
  222. package/dist/types/contexts/SelectionModeContext.d.ts +5 -0
  223. package/dist/types/contexts/ThemeContext.d.ts +4 -0
  224. package/dist/types/contexts/ThumbnailsContext.d.ts +7 -0
  225. package/dist/types/contexts/ToolbarComponentContext.d.ts +9 -0
  226. package/dist/types/contexts/ViewModeContext.d.ts +5 -0
  227. package/dist/types/contexts/ViewportContext.d.ts +28 -0
  228. package/dist/types/contexts/VirtualGridContext.d.ts +9 -0
  229. package/dist/types/contexts/VirtualScrollContext.d.ts +30 -0
  230. package/dist/types/contexts/ZoomContext.d.ts +5 -0
  231. package/dist/types/main.d.ts +20 -0
  232. package/dist/types/utils/appConsole.d.ts +24 -0
  233. package/dist/types/utils/charators.d.ts +12 -0
  234. package/dist/types/utils/constants.d.ts +2 -0
  235. package/dist/types/utils/convertPdfDate.d.ts +1 -0
  236. package/dist/types/utils/dateFormatter.d.ts +1 -0
  237. package/dist/types/utils/formatFileSize.d.ts +1 -0
  238. package/dist/types/utils/getThumbnailViewport.d.ts +5 -0
  239. package/dist/types/utils/getZoomLevel.d.ts +2 -0
  240. package/dist/types/utils/highlight.d.ts +8 -0
  241. package/dist/types/utils/hooks/useDarkMode.d.ts +2 -0
  242. package/dist/types/utils/hooks/useDarkModeProps.d.ts +2 -0
  243. package/dist/types/utils/hooks/useDebounce.d.ts +1 -0
  244. package/dist/types/utils/hooks/useElementSize.d.ts +8 -0
  245. package/dist/types/utils/hooks/useFileDownload.d.ts +3 -0
  246. package/dist/types/utils/hooks/useFullScreen.d.ts +6 -0
  247. package/dist/types/utils/hooks/useGrabScroll.d.ts +10 -0
  248. package/dist/types/utils/hooks/useInfiniteScroll.d.ts +6 -0
  249. package/dist/types/utils/hooks/useLicense.d.ts +2 -0
  250. package/dist/types/utils/hooks/useLoadPdf.d.ts +7 -0
  251. package/dist/types/utils/hooks/useLoadWorker.d.ts +3 -0
  252. package/dist/types/utils/hooks/useMousePressed.d.ts +7 -0
  253. package/dist/types/utils/hooks/usePageDimension.d.ts +4 -0
  254. package/dist/types/utils/hooks/usePaginate.d.ts +2 -0
  255. package/dist/types/utils/hooks/usePdfProperties.d.ts +9 -0
  256. package/dist/types/utils/hooks/usePrint.d.ts +11 -0
  257. package/dist/types/utils/hooks/useRequestAnimationFrame.d.ts +5 -0
  258. package/dist/types/utils/hooks/useResizeObserver.d.ts +6 -0
  259. package/dist/types/utils/hooks/useRotate.d.ts +4 -0
  260. package/dist/types/utils/hooks/useScrollToPage.d.ts +4 -0
  261. package/dist/types/utils/hooks/useSearch.d.ts +14 -0
  262. package/dist/types/utils/hooks/useThumbnail.d.ts +7 -0
  263. package/dist/types/utils/hooks/useVirtualReactWindow.d.ts +12 -0
  264. package/dist/types/utils/hooks/useWatermark.d.ts +4 -0
  265. package/dist/types/utils/link_service.d.ts +71 -0
  266. package/dist/types/utils/renderPage.d.ts +2 -0
  267. package/dist/types/utils/sanitizeExternalUrl.d.ts +1 -0
  268. package/dist/types/utils/types.d.ts +562 -0
  269. package/dist/utils/appConsole.js +42 -0
  270. package/dist/utils/charators.js +48 -0
  271. package/dist/utils/constants.js +5 -0
  272. package/dist/utils/convertPdfDate.js +25 -0
  273. package/dist/utils/dateFormatter.js +7 -0
  274. package/dist/utils/formatFileSize.js +9 -0
  275. package/dist/utils/getThumbnailViewport.js +7 -0
  276. package/dist/utils/getZoomLevel.js +18 -0
  277. package/dist/utils/highlight.js +145 -0
  278. package/dist/utils/hooks/useDarkMode.js +11 -0
  279. package/dist/utils/hooks/useDarkModeProps.js +12 -0
  280. package/dist/utils/hooks/useDebounce.js +15 -0
  281. package/dist/utils/hooks/useElementSize.js +21 -0
  282. package/dist/utils/hooks/useFileDownload.js +32 -0
  283. package/dist/utils/hooks/useFullScreen.js +29 -0
  284. package/dist/utils/hooks/useGrabScroll.js +45 -0
  285. package/dist/utils/hooks/useInfiniteScroll.js +19 -0
  286. package/dist/utils/hooks/useLicense.js +102 -0
  287. package/dist/utils/hooks/useLoadPdf.js +50 -0
  288. package/dist/utils/hooks/useLoadWorker.js +13 -0
  289. package/dist/utils/hooks/useMousePressed.js +20 -0
  290. package/dist/utils/hooks/usePageDimension.js +24 -0
  291. package/dist/utils/hooks/usePaginate.js +33 -0
  292. package/dist/utils/hooks/usePdfProperties.js +40 -0
  293. package/dist/utils/hooks/usePrint.js +33 -0
  294. package/dist/utils/hooks/useRequestAnimationFrame.js +17 -0
  295. package/dist/utils/hooks/useResizeObserver.js +22 -0
  296. package/dist/utils/hooks/useRotate.js +13 -0
  297. package/dist/utils/hooks/useScrollToPage.js +34 -0
  298. package/dist/utils/hooks/useSearch.js +33 -0
  299. package/dist/utils/hooks/useThumbnail.js +34 -0
  300. package/dist/utils/hooks/useVirtualReactWindow.js +34 -0
  301. package/dist/utils/hooks/useWatermark.js +62 -0
  302. package/dist/utils/link_service.js +98 -0
  303. package/dist/utils/renderPage.js +15 -0
  304. package/dist/utils/sanitizeExternalUrl.js +16 -0
  305. package/dist/utils/types.js +10 -0
  306. package/package.json +90 -0
@@ -0,0 +1,3609 @@
1
+ import * as a from "react";
2
+ import le, { useLayoutEffect as jr, useEffect as Xr, useState as zr } from "react";
3
+ import { d as ne, u as ye, b as Zr, a as gn, c as wn } from "./index-743c36f0.js";
4
+ import * as yn from "react-dom";
5
+ import qr from "react-dom";
6
+ import { jsx as y, Fragment as Qr } from "react/jsx-runtime";
7
+ function O(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
8
+ return function(o) {
9
+ if (e == null || e(o), n === !1 || !o.defaultPrevented)
10
+ return t == null ? void 0 : t(o);
11
+ };
12
+ }
13
+ function Jr(e, t) {
14
+ typeof e == "function" ? e(t) : e != null && (e.current = t);
15
+ }
16
+ function tt(...e) {
17
+ return (t) => e.forEach((n) => Jr(n, t));
18
+ }
19
+ function G(...e) {
20
+ return a.useCallback(tt(...e), e);
21
+ }
22
+ var Oe = a.forwardRef((e, t) => {
23
+ const { children: n, ...r } = e, o = a.Children.toArray(n), i = o.find(to);
24
+ if (i) {
25
+ const c = i.props.children, s = o.map((f) => f === i ? a.Children.count(c) > 1 ? a.Children.only(null) : a.isValidElement(c) ? c.props.children : null : f);
26
+ return /* @__PURE__ */ y(yt, { ...r, ref: t, children: a.isValidElement(c) ? a.cloneElement(c, void 0, s) : null });
27
+ }
28
+ return /* @__PURE__ */ y(yt, { ...r, ref: t, children: n });
29
+ });
30
+ Oe.displayName = "Slot";
31
+ var yt = a.forwardRef((e, t) => {
32
+ const { children: n, ...r } = e;
33
+ if (a.isValidElement(n)) {
34
+ const o = ro(n);
35
+ return a.cloneElement(n, {
36
+ ...no(r, n.props),
37
+ // @ts-ignore
38
+ ref: t ? tt(t, o) : o
39
+ });
40
+ }
41
+ return a.Children.count(n) > 1 ? a.Children.only(null) : null;
42
+ });
43
+ yt.displayName = "SlotClone";
44
+ var eo = ({ children: e }) => /* @__PURE__ */ y(Qr, { children: e });
45
+ function to(e) {
46
+ return a.isValidElement(e) && e.type === eo;
47
+ }
48
+ function no(e, t) {
49
+ const n = { ...t };
50
+ for (const r in t) {
51
+ const o = e[r], i = t[r];
52
+ /^on[A-Z]/.test(r) ? o && i ? n[r] = (...s) => {
53
+ i(...s), o(...s);
54
+ } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
55
+ }
56
+ return { ...e, ...n };
57
+ }
58
+ function ro(e) {
59
+ var r, o;
60
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
61
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
62
+ }
63
+ var oo = [
64
+ "a",
65
+ "button",
66
+ "div",
67
+ "form",
68
+ "h2",
69
+ "h3",
70
+ "img",
71
+ "input",
72
+ "label",
73
+ "li",
74
+ "nav",
75
+ "ol",
76
+ "p",
77
+ "span",
78
+ "svg",
79
+ "ul"
80
+ ], U = oo.reduce((e, t) => {
81
+ const n = a.forwardRef((r, o) => {
82
+ const { asChild: i, ...c } = r, s = i ? Oe : t;
83
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ y(s, { ...c, ref: o });
84
+ });
85
+ return n.displayName = `Primitive.${t}`, { ...e, [t]: n };
86
+ }, {});
87
+ function bn(e, t) {
88
+ e && yn.flushSync(() => e.dispatchEvent(t));
89
+ }
90
+ function io(e, t = []) {
91
+ let n = [];
92
+ function r(i, c) {
93
+ const s = a.createContext(c), f = n.length;
94
+ n = [...n, c];
95
+ function l(u) {
96
+ const { scope: p, children: h, ...v } = u, m = (p == null ? void 0 : p[e][f]) || s, g = a.useMemo(() => v, Object.values(v));
97
+ return /* @__PURE__ */ y(m.Provider, { value: g, children: h });
98
+ }
99
+ function d(u, p) {
100
+ const h = (p == null ? void 0 : p[e][f]) || s, v = a.useContext(h);
101
+ if (v)
102
+ return v;
103
+ if (c !== void 0)
104
+ return c;
105
+ throw new Error(`\`${u}\` must be used within \`${i}\``);
106
+ }
107
+ return l.displayName = i + "Provider", [l, d];
108
+ }
109
+ const o = () => {
110
+ const i = n.map((c) => a.createContext(c));
111
+ return function(s) {
112
+ const f = (s == null ? void 0 : s[e]) || i;
113
+ return a.useMemo(
114
+ () => ({ [`__scope${e}`]: { ...s, [e]: f } }),
115
+ [s, f]
116
+ );
117
+ };
118
+ };
119
+ return o.scopeName = e, [r, co(o, ...t)];
120
+ }
121
+ function co(...e) {
122
+ const t = e[0];
123
+ if (e.length === 1)
124
+ return t;
125
+ const n = () => {
126
+ const r = e.map((o) => ({
127
+ useScope: o(),
128
+ scopeName: o.scopeName
129
+ }));
130
+ return function(i) {
131
+ const c = r.reduce((s, { useScope: f, scopeName: l }) => {
132
+ const u = f(i)[`__scope${l}`];
133
+ return { ...s, ...u };
134
+ }, {});
135
+ return a.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
136
+ };
137
+ };
138
+ return n.scopeName = t.scopeName, n;
139
+ }
140
+ function xn(e) {
141
+ const t = e + "CollectionProvider", [n, r] = io(t), [o, i] = n(
142
+ t,
143
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
144
+ ), c = (h) => {
145
+ const { scope: v, children: m } = h, g = le.useRef(null), w = le.useRef(/* @__PURE__ */ new Map()).current;
146
+ return /* @__PURE__ */ y(o, { scope: v, itemMap: w, collectionRef: g, children: m });
147
+ };
148
+ c.displayName = t;
149
+ const s = e + "CollectionSlot", f = le.forwardRef(
150
+ (h, v) => {
151
+ const { scope: m, children: g } = h, w = i(s, m), b = G(v, w.collectionRef);
152
+ return /* @__PURE__ */ y(Oe, { ref: b, children: g });
153
+ }
154
+ );
155
+ f.displayName = s;
156
+ const l = e + "CollectionItemSlot", d = "data-radix-collection-item", u = le.forwardRef(
157
+ (h, v) => {
158
+ const { scope: m, children: g, ...w } = h, b = le.useRef(null), x = G(v, b), C = i(l, m);
159
+ return le.useEffect(() => (C.itemMap.set(b, { ref: b, ...w }), () => void C.itemMap.delete(b))), /* @__PURE__ */ y(Oe, { [d]: "", ref: x, children: g });
160
+ }
161
+ );
162
+ u.displayName = l;
163
+ function p(h) {
164
+ const v = i(e + "CollectionConsumer", h);
165
+ return le.useCallback(() => {
166
+ const g = v.collectionRef.current;
167
+ if (!g)
168
+ return [];
169
+ const w = Array.from(g.querySelectorAll(`[${d}]`));
170
+ return Array.from(v.itemMap.values()).sort(
171
+ (C, E) => w.indexOf(C.ref.current) - w.indexOf(E.ref.current)
172
+ );
173
+ }, [v.collectionRef, v.itemMap]);
174
+ }
175
+ return [
176
+ { Provider: c, Slot: f, ItemSlot: u },
177
+ p,
178
+ r
179
+ ];
180
+ }
181
+ var so = a.createContext(void 0);
182
+ function Cn(e) {
183
+ const t = a.useContext(so);
184
+ return e || t || "ltr";
185
+ }
186
+ function ao(e, t = globalThis == null ? void 0 : globalThis.document) {
187
+ const n = ne(e);
188
+ a.useEffect(() => {
189
+ const r = (o) => {
190
+ o.key === "Escape" && n(o);
191
+ };
192
+ return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
193
+ }, [n, t]);
194
+ }
195
+ var uo = "DismissableLayer", bt = "dismissableLayer.update", lo = "dismissableLayer.pointerDownOutside", fo = "dismissableLayer.focusOutside", Xt, En = a.createContext({
196
+ layers: /* @__PURE__ */ new Set(),
197
+ layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
198
+ branches: /* @__PURE__ */ new Set()
199
+ }), Sn = a.forwardRef(
200
+ (e, t) => {
201
+ const {
202
+ disableOutsidePointerEvents: n = !1,
203
+ onEscapeKeyDown: r,
204
+ onPointerDownOutside: o,
205
+ onFocusOutside: i,
206
+ onInteractOutside: c,
207
+ onDismiss: s,
208
+ ...f
209
+ } = e, l = a.useContext(En), [d, u] = a.useState(null), p = (d == null ? void 0 : d.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, h] = a.useState({}), v = G(t, (R) => u(R)), m = Array.from(l.layers), [g] = [...l.layersWithOutsidePointerEventsDisabled].slice(-1), w = m.indexOf(g), b = d ? m.indexOf(d) : -1, x = l.layersWithOutsidePointerEventsDisabled.size > 0, C = b >= w, E = ho((R) => {
210
+ const P = R.target, D = [...l.branches].some((_) => _.contains(P));
211
+ !C || D || (o == null || o(R), c == null || c(R), R.defaultPrevented || s == null || s());
212
+ }, p), M = vo((R) => {
213
+ const P = R.target;
214
+ [...l.branches].some((_) => _.contains(P)) || (i == null || i(R), c == null || c(R), R.defaultPrevented || s == null || s());
215
+ }, p);
216
+ return ao((R) => {
217
+ b === l.layers.size - 1 && (r == null || r(R), !R.defaultPrevented && s && (R.preventDefault(), s()));
218
+ }, p), a.useEffect(() => {
219
+ if (d)
220
+ return n && (l.layersWithOutsidePointerEventsDisabled.size === 0 && (Xt = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), l.layersWithOutsidePointerEventsDisabled.add(d)), l.layers.add(d), zt(), () => {
221
+ n && l.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = Xt);
222
+ };
223
+ }, [d, p, n, l]), a.useEffect(() => () => {
224
+ d && (l.layers.delete(d), l.layersWithOutsidePointerEventsDisabled.delete(d), zt());
225
+ }, [d, l]), a.useEffect(() => {
226
+ const R = () => h({});
227
+ return document.addEventListener(bt, R), () => document.removeEventListener(bt, R);
228
+ }, []), /* @__PURE__ */ y(
229
+ U.div,
230
+ {
231
+ ...f,
232
+ ref: v,
233
+ style: {
234
+ pointerEvents: x ? C ? "auto" : "none" : void 0,
235
+ ...e.style
236
+ },
237
+ onFocusCapture: O(e.onFocusCapture, M.onFocusCapture),
238
+ onBlurCapture: O(e.onBlurCapture, M.onBlurCapture),
239
+ onPointerDownCapture: O(
240
+ e.onPointerDownCapture,
241
+ E.onPointerDownCapture
242
+ )
243
+ }
244
+ );
245
+ }
246
+ );
247
+ Sn.displayName = uo;
248
+ var po = "DismissableLayerBranch", mo = a.forwardRef((e, t) => {
249
+ const n = a.useContext(En), r = a.useRef(null), o = G(t, r);
250
+ return a.useEffect(() => {
251
+ const i = r.current;
252
+ if (i)
253
+ return n.branches.add(i), () => {
254
+ n.branches.delete(i);
255
+ };
256
+ }, [n.branches]), /* @__PURE__ */ y(U.div, { ...e, ref: o });
257
+ });
258
+ mo.displayName = po;
259
+ function ho(e, t = globalThis == null ? void 0 : globalThis.document) {
260
+ const n = ne(e), r = a.useRef(!1), o = a.useRef(() => {
261
+ });
262
+ return a.useEffect(() => {
263
+ const i = (s) => {
264
+ if (s.target && !r.current) {
265
+ let f = function() {
266
+ Rn(
267
+ lo,
268
+ n,
269
+ l,
270
+ { discrete: !0 }
271
+ );
272
+ };
273
+ const l = { originalEvent: s };
274
+ s.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = f, t.addEventListener("click", o.current, { once: !0 })) : f();
275
+ } else
276
+ t.removeEventListener("click", o.current);
277
+ r.current = !1;
278
+ }, c = window.setTimeout(() => {
279
+ t.addEventListener("pointerdown", i);
280
+ }, 0);
281
+ return () => {
282
+ window.clearTimeout(c), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
283
+ };
284
+ }, [t, n]), {
285
+ // ensures we check React component tree (not just DOM tree)
286
+ onPointerDownCapture: () => r.current = !0
287
+ };
288
+ }
289
+ function vo(e, t = globalThis == null ? void 0 : globalThis.document) {
290
+ const n = ne(e), r = a.useRef(!1);
291
+ return a.useEffect(() => {
292
+ const o = (i) => {
293
+ i.target && !r.current && Rn(fo, n, { originalEvent: i }, {
294
+ discrete: !1
295
+ });
296
+ };
297
+ return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
298
+ }, [t, n]), {
299
+ onFocusCapture: () => r.current = !0,
300
+ onBlurCapture: () => r.current = !1
301
+ };
302
+ }
303
+ function zt() {
304
+ const e = new CustomEvent(bt);
305
+ document.dispatchEvent(e);
306
+ }
307
+ function Rn(e, t, n, { discrete: r }) {
308
+ const o = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
309
+ t && o.addEventListener(e, t, { once: !0 }), r ? bn(o, i) : o.dispatchEvent(i);
310
+ }
311
+ var ut = 0;
312
+ function go() {
313
+ a.useEffect(() => {
314
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
315
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? Zt()), document.body.insertAdjacentElement("beforeend", e[1] ?? Zt()), ut++, () => {
316
+ ut === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), ut--;
317
+ };
318
+ }, []);
319
+ }
320
+ function Zt() {
321
+ const e = document.createElement("span");
322
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
323
+ }
324
+ var lt = "focusScope.autoFocusOnMount", ft = "focusScope.autoFocusOnUnmount", qt = { bubbles: !1, cancelable: !0 }, wo = "FocusScope", Mn = a.forwardRef((e, t) => {
325
+ const {
326
+ loop: n = !1,
327
+ trapped: r = !1,
328
+ onMountAutoFocus: o,
329
+ onUnmountAutoFocus: i,
330
+ ...c
331
+ } = e, [s, f] = a.useState(null), l = ne(o), d = ne(i), u = a.useRef(null), p = G(t, (m) => f(m)), h = a.useRef({
332
+ paused: !1,
333
+ pause() {
334
+ this.paused = !0;
335
+ },
336
+ resume() {
337
+ this.paused = !1;
338
+ }
339
+ }).current;
340
+ a.useEffect(() => {
341
+ if (r) {
342
+ let m = function(x) {
343
+ if (h.paused || !s)
344
+ return;
345
+ const C = x.target;
346
+ s.contains(C) ? u.current = C : ie(u.current, { select: !0 });
347
+ }, g = function(x) {
348
+ if (h.paused || !s)
349
+ return;
350
+ const C = x.relatedTarget;
351
+ C !== null && (s.contains(C) || ie(u.current, { select: !0 }));
352
+ }, w = function(x) {
353
+ if (document.activeElement === document.body)
354
+ for (const E of x)
355
+ E.removedNodes.length > 0 && ie(s);
356
+ };
357
+ document.addEventListener("focusin", m), document.addEventListener("focusout", g);
358
+ const b = new MutationObserver(w);
359
+ return s && b.observe(s, { childList: !0, subtree: !0 }), () => {
360
+ document.removeEventListener("focusin", m), document.removeEventListener("focusout", g), b.disconnect();
361
+ };
362
+ }
363
+ }, [r, s, h.paused]), a.useEffect(() => {
364
+ if (s) {
365
+ Jt.add(h);
366
+ const m = document.activeElement;
367
+ if (!s.contains(m)) {
368
+ const w = new CustomEvent(lt, qt);
369
+ s.addEventListener(lt, l), s.dispatchEvent(w), w.defaultPrevented || (yo(So(Pn(s)), { select: !0 }), document.activeElement === m && ie(s));
370
+ }
371
+ return () => {
372
+ s.removeEventListener(lt, l), setTimeout(() => {
373
+ const w = new CustomEvent(ft, qt);
374
+ s.addEventListener(ft, d), s.dispatchEvent(w), w.defaultPrevented || ie(m ?? document.body, { select: !0 }), s.removeEventListener(ft, d), Jt.remove(h);
375
+ }, 0);
376
+ };
377
+ }
378
+ }, [s, l, d, h]);
379
+ const v = a.useCallback(
380
+ (m) => {
381
+ if (!n && !r || h.paused)
382
+ return;
383
+ const g = m.key === "Tab" && !m.altKey && !m.ctrlKey && !m.metaKey, w = document.activeElement;
384
+ if (g && w) {
385
+ const b = m.currentTarget, [x, C] = bo(b);
386
+ x && C ? !m.shiftKey && w === C ? (m.preventDefault(), n && ie(x, { select: !0 })) : m.shiftKey && w === x && (m.preventDefault(), n && ie(C, { select: !0 })) : w === b && m.preventDefault();
387
+ }
388
+ },
389
+ [n, r, h.paused]
390
+ );
391
+ return /* @__PURE__ */ y(U.div, { tabIndex: -1, ...c, ref: p, onKeyDown: v });
392
+ });
393
+ Mn.displayName = wo;
394
+ function yo(e, { select: t = !1 } = {}) {
395
+ const n = document.activeElement;
396
+ for (const r of e)
397
+ if (ie(r, { select: t }), document.activeElement !== n)
398
+ return;
399
+ }
400
+ function bo(e) {
401
+ const t = Pn(e), n = Qt(t, e), r = Qt(t.reverse(), e);
402
+ return [n, r];
403
+ }
404
+ function Pn(e) {
405
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
406
+ acceptNode: (r) => {
407
+ const o = r.tagName === "INPUT" && r.type === "hidden";
408
+ return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
409
+ }
410
+ });
411
+ for (; n.nextNode(); )
412
+ t.push(n.currentNode);
413
+ return t;
414
+ }
415
+ function Qt(e, t) {
416
+ for (const n of e)
417
+ if (!xo(n, { upTo: t }))
418
+ return n;
419
+ }
420
+ function xo(e, { upTo: t }) {
421
+ if (getComputedStyle(e).visibility === "hidden")
422
+ return !0;
423
+ for (; e; ) {
424
+ if (t !== void 0 && e === t)
425
+ return !1;
426
+ if (getComputedStyle(e).display === "none")
427
+ return !0;
428
+ e = e.parentElement;
429
+ }
430
+ return !1;
431
+ }
432
+ function Co(e) {
433
+ return e instanceof HTMLInputElement && "select" in e;
434
+ }
435
+ function ie(e, { select: t = !1 } = {}) {
436
+ if (e && e.focus) {
437
+ const n = document.activeElement;
438
+ e.focus({ preventScroll: !0 }), e !== n && Co(e) && t && e.select();
439
+ }
440
+ }
441
+ var Jt = Eo();
442
+ function Eo() {
443
+ let e = [];
444
+ return {
445
+ add(t) {
446
+ const n = e[0];
447
+ t !== n && (n == null || n.pause()), e = en(e, t), e.unshift(t);
448
+ },
449
+ remove(t) {
450
+ var n;
451
+ e = en(e, t), (n = e[0]) == null || n.resume();
452
+ }
453
+ };
454
+ }
455
+ function en(e, t) {
456
+ const n = [...e], r = n.indexOf(t);
457
+ return r !== -1 && n.splice(r, 1), n;
458
+ }
459
+ function So(e) {
460
+ return e.filter((t) => t.tagName !== "A");
461
+ }
462
+ var Ro = a["useId".toString()] || (() => {
463
+ }), Mo = 0;
464
+ function xt(e) {
465
+ const [t, n] = a.useState(Ro());
466
+ return ye(() => {
467
+ e || n((r) => r ?? String(Mo++));
468
+ }, [e]), e || (t ? `radix-${t}` : "");
469
+ }
470
+ const Po = ["top", "right", "bottom", "left"], ce = Math.min, V = Math.max, ze = Math.round, We = Math.floor, Q = (e) => ({
471
+ x: e,
472
+ y: e
473
+ }), Ao = {
474
+ left: "right",
475
+ right: "left",
476
+ bottom: "top",
477
+ top: "bottom"
478
+ }, Oo = {
479
+ start: "end",
480
+ end: "start"
481
+ };
482
+ function Ct(e, t, n) {
483
+ return V(e, ce(t, n));
484
+ }
485
+ function re(e, t) {
486
+ return typeof e == "function" ? e(t) : e;
487
+ }
488
+ function oe(e) {
489
+ return e.split("-")[0];
490
+ }
491
+ function xe(e) {
492
+ return e.split("-")[1];
493
+ }
494
+ function At(e) {
495
+ return e === "x" ? "y" : "x";
496
+ }
497
+ function Ot(e) {
498
+ return e === "y" ? "height" : "width";
499
+ }
500
+ function se(e) {
501
+ return ["top", "bottom"].includes(oe(e)) ? "y" : "x";
502
+ }
503
+ function _t(e) {
504
+ return At(se(e));
505
+ }
506
+ function _o(e, t, n) {
507
+ n === void 0 && (n = !1);
508
+ const r = xe(e), o = _t(e), i = Ot(o);
509
+ let c = o === "x" ? r === (n ? "end" : "start") ? "right" : "left" : r === "start" ? "bottom" : "top";
510
+ return t.reference[i] > t.floating[i] && (c = Ze(c)), [c, Ze(c)];
511
+ }
512
+ function To(e) {
513
+ const t = Ze(e);
514
+ return [Et(e), t, Et(t)];
515
+ }
516
+ function Et(e) {
517
+ return e.replace(/start|end/g, (t) => Oo[t]);
518
+ }
519
+ function Do(e, t, n) {
520
+ const r = ["left", "right"], o = ["right", "left"], i = ["top", "bottom"], c = ["bottom", "top"];
521
+ switch (e) {
522
+ case "top":
523
+ case "bottom":
524
+ return n ? t ? o : r : t ? r : o;
525
+ case "left":
526
+ case "right":
527
+ return t ? i : c;
528
+ default:
529
+ return [];
530
+ }
531
+ }
532
+ function No(e, t, n, r) {
533
+ const o = xe(e);
534
+ let i = Do(oe(e), n === "start", r);
535
+ return o && (i = i.map((c) => c + "-" + o), t && (i = i.concat(i.map(Et)))), i;
536
+ }
537
+ function Ze(e) {
538
+ return e.replace(/left|right|bottom|top/g, (t) => Ao[t]);
539
+ }
540
+ function Io(e) {
541
+ return {
542
+ top: 0,
543
+ right: 0,
544
+ bottom: 0,
545
+ left: 0,
546
+ ...e
547
+ };
548
+ }
549
+ function An(e) {
550
+ return typeof e != "number" ? Io(e) : {
551
+ top: e,
552
+ right: e,
553
+ bottom: e,
554
+ left: e
555
+ };
556
+ }
557
+ function qe(e) {
558
+ const {
559
+ x: t,
560
+ y: n,
561
+ width: r,
562
+ height: o
563
+ } = e;
564
+ return {
565
+ width: r,
566
+ height: o,
567
+ top: n,
568
+ left: t,
569
+ right: t + r,
570
+ bottom: n + o,
571
+ x: t,
572
+ y: n
573
+ };
574
+ }
575
+ function tn(e, t, n) {
576
+ let {
577
+ reference: r,
578
+ floating: o
579
+ } = e;
580
+ const i = se(t), c = _t(t), s = Ot(c), f = oe(t), l = i === "y", d = r.x + r.width / 2 - o.width / 2, u = r.y + r.height / 2 - o.height / 2, p = r[s] / 2 - o[s] / 2;
581
+ let h;
582
+ switch (f) {
583
+ case "top":
584
+ h = {
585
+ x: d,
586
+ y: r.y - o.height
587
+ };
588
+ break;
589
+ case "bottom":
590
+ h = {
591
+ x: d,
592
+ y: r.y + r.height
593
+ };
594
+ break;
595
+ case "right":
596
+ h = {
597
+ x: r.x + r.width,
598
+ y: u
599
+ };
600
+ break;
601
+ case "left":
602
+ h = {
603
+ x: r.x - o.width,
604
+ y: u
605
+ };
606
+ break;
607
+ default:
608
+ h = {
609
+ x: r.x,
610
+ y: r.y
611
+ };
612
+ }
613
+ switch (xe(t)) {
614
+ case "start":
615
+ h[c] -= p * (n && l ? -1 : 1);
616
+ break;
617
+ case "end":
618
+ h[c] += p * (n && l ? -1 : 1);
619
+ break;
620
+ }
621
+ return h;
622
+ }
623
+ const Lo = async (e, t, n) => {
624
+ const {
625
+ placement: r = "bottom",
626
+ strategy: o = "absolute",
627
+ middleware: i = [],
628
+ platform: c
629
+ } = n, s = i.filter(Boolean), f = await (c.isRTL == null ? void 0 : c.isRTL(t));
630
+ let l = await c.getElementRects({
631
+ reference: e,
632
+ floating: t,
633
+ strategy: o
634
+ }), {
635
+ x: d,
636
+ y: u
637
+ } = tn(l, r, f), p = r, h = {}, v = 0;
638
+ for (let m = 0; m < s.length; m++) {
639
+ const {
640
+ name: g,
641
+ fn: w
642
+ } = s[m], {
643
+ x: b,
644
+ y: x,
645
+ data: C,
646
+ reset: E
647
+ } = await w({
648
+ x: d,
649
+ y: u,
650
+ initialPlacement: r,
651
+ placement: p,
652
+ strategy: o,
653
+ middlewareData: h,
654
+ rects: l,
655
+ platform: c,
656
+ elements: {
657
+ reference: e,
658
+ floating: t
659
+ }
660
+ });
661
+ d = b ?? d, u = x ?? u, h = {
662
+ ...h,
663
+ [g]: {
664
+ ...h[g],
665
+ ...C
666
+ }
667
+ }, E && v <= 50 && (v++, typeof E == "object" && (E.placement && (p = E.placement), E.rects && (l = E.rects === !0 ? await c.getElementRects({
668
+ reference: e,
669
+ floating: t,
670
+ strategy: o
671
+ }) : E.rects), {
672
+ x: d,
673
+ y: u
674
+ } = tn(l, p, f)), m = -1);
675
+ }
676
+ return {
677
+ x: d,
678
+ y: u,
679
+ placement: p,
680
+ strategy: o,
681
+ middlewareData: h
682
+ };
683
+ };
684
+ async function _e(e, t) {
685
+ var n;
686
+ t === void 0 && (t = {});
687
+ const {
688
+ x: r,
689
+ y: o,
690
+ platform: i,
691
+ rects: c,
692
+ elements: s,
693
+ strategy: f
694
+ } = e, {
695
+ boundary: l = "clippingAncestors",
696
+ rootBoundary: d = "viewport",
697
+ elementContext: u = "floating",
698
+ altBoundary: p = !1,
699
+ padding: h = 0
700
+ } = re(t, e), v = An(h), g = s[p ? u === "floating" ? "reference" : "floating" : u], w = qe(await i.getClippingRect({
701
+ element: (n = await (i.isElement == null ? void 0 : i.isElement(g))) == null || n ? g : g.contextElement || await (i.getDocumentElement == null ? void 0 : i.getDocumentElement(s.floating)),
702
+ boundary: l,
703
+ rootBoundary: d,
704
+ strategy: f
705
+ })), b = u === "floating" ? {
706
+ x: r,
707
+ y: o,
708
+ width: c.floating.width,
709
+ height: c.floating.height
710
+ } : c.reference, x = await (i.getOffsetParent == null ? void 0 : i.getOffsetParent(s.floating)), C = await (i.isElement == null ? void 0 : i.isElement(x)) ? await (i.getScale == null ? void 0 : i.getScale(x)) || {
711
+ x: 1,
712
+ y: 1
713
+ } : {
714
+ x: 1,
715
+ y: 1
716
+ }, E = qe(i.convertOffsetParentRelativeRectToViewportRelativeRect ? await i.convertOffsetParentRelativeRectToViewportRelativeRect({
717
+ elements: s,
718
+ rect: b,
719
+ offsetParent: x,
720
+ strategy: f
721
+ }) : b);
722
+ return {
723
+ top: (w.top - E.top + v.top) / C.y,
724
+ bottom: (E.bottom - w.bottom + v.bottom) / C.y,
725
+ left: (w.left - E.left + v.left) / C.x,
726
+ right: (E.right - w.right + v.right) / C.x
727
+ };
728
+ }
729
+ const Fo = (e) => ({
730
+ name: "arrow",
731
+ options: e,
732
+ async fn(t) {
733
+ const {
734
+ x: n,
735
+ y: r,
736
+ placement: o,
737
+ rects: i,
738
+ platform: c,
739
+ elements: s,
740
+ middlewareData: f
741
+ } = t, {
742
+ element: l,
743
+ padding: d = 0
744
+ } = re(e, t) || {};
745
+ if (l == null)
746
+ return {};
747
+ const u = An(d), p = {
748
+ x: n,
749
+ y: r
750
+ }, h = _t(o), v = Ot(h), m = await c.getDimensions(l), g = h === "y", w = g ? "top" : "left", b = g ? "bottom" : "right", x = g ? "clientHeight" : "clientWidth", C = i.reference[v] + i.reference[h] - p[h] - i.floating[v], E = p[h] - i.reference[h], M = await (c.getOffsetParent == null ? void 0 : c.getOffsetParent(l));
751
+ let R = M ? M[x] : 0;
752
+ (!R || !await (c.isElement == null ? void 0 : c.isElement(M))) && (R = s.floating[x] || i.floating[v]);
753
+ const P = C / 2 - E / 2, D = R / 2 - m[v] / 2 - 1, _ = ce(u[w], D), F = ce(u[b], D), k = _, I = R - m[v] - F, N = R / 2 - m[v] / 2 + P, B = Ct(k, N, I), T = !f.arrow && xe(o) != null && N !== B && i.reference[v] / 2 - (N < k ? _ : F) - m[v] / 2 < 0, $ = T ? N < k ? N - k : N - I : 0;
754
+ return {
755
+ [h]: p[h] + $,
756
+ data: {
757
+ [h]: B,
758
+ centerOffset: N - B - $,
759
+ ...T && {
760
+ alignmentOffset: $
761
+ }
762
+ },
763
+ reset: T
764
+ };
765
+ }
766
+ }), ko = function(e) {
767
+ return e === void 0 && (e = {}), {
768
+ name: "flip",
769
+ options: e,
770
+ async fn(t) {
771
+ var n, r;
772
+ const {
773
+ placement: o,
774
+ middlewareData: i,
775
+ rects: c,
776
+ initialPlacement: s,
777
+ platform: f,
778
+ elements: l
779
+ } = t, {
780
+ mainAxis: d = !0,
781
+ crossAxis: u = !0,
782
+ fallbackPlacements: p,
783
+ fallbackStrategy: h = "bestFit",
784
+ fallbackAxisSideDirection: v = "none",
785
+ flipAlignment: m = !0,
786
+ ...g
787
+ } = re(e, t);
788
+ if ((n = i.arrow) != null && n.alignmentOffset)
789
+ return {};
790
+ const w = oe(o), b = se(s), x = oe(s) === s, C = await (f.isRTL == null ? void 0 : f.isRTL(l.floating)), E = p || (x || !m ? [Ze(s)] : To(s)), M = v !== "none";
791
+ !p && M && E.push(...No(s, m, v, C));
792
+ const R = [s, ...E], P = await _e(t, g), D = [];
793
+ let _ = ((r = i.flip) == null ? void 0 : r.overflows) || [];
794
+ if (d && D.push(P[w]), u) {
795
+ const N = _o(o, c, C);
796
+ D.push(P[N[0]], P[N[1]]);
797
+ }
798
+ if (_ = [..._, {
799
+ placement: o,
800
+ overflows: D
801
+ }], !D.every((N) => N <= 0)) {
802
+ var F, k;
803
+ const N = (((F = i.flip) == null ? void 0 : F.index) || 0) + 1, B = R[N];
804
+ if (B)
805
+ return {
806
+ data: {
807
+ index: N,
808
+ overflows: _
809
+ },
810
+ reset: {
811
+ placement: B
812
+ }
813
+ };
814
+ let T = (k = _.filter(($) => $.overflows[0] <= 0).sort(($, A) => $.overflows[1] - A.overflows[1])[0]) == null ? void 0 : k.placement;
815
+ if (!T)
816
+ switch (h) {
817
+ case "bestFit": {
818
+ var I;
819
+ const $ = (I = _.filter((A) => {
820
+ if (M) {
821
+ const S = se(A.placement);
822
+ return S === b || // Create a bias to the `y` side axis due to horizontal
823
+ // reading directions favoring greater width.
824
+ S === "y";
825
+ }
826
+ return !0;
827
+ }).map((A) => [A.placement, A.overflows.filter((S) => S > 0).reduce((S, L) => S + L, 0)]).sort((A, S) => A[1] - S[1])[0]) == null ? void 0 : I[0];
828
+ $ && (T = $);
829
+ break;
830
+ }
831
+ case "initialPlacement":
832
+ T = s;
833
+ break;
834
+ }
835
+ if (o !== T)
836
+ return {
837
+ reset: {
838
+ placement: T
839
+ }
840
+ };
841
+ }
842
+ return {};
843
+ }
844
+ };
845
+ };
846
+ function nn(e, t) {
847
+ return {
848
+ top: e.top - t.height,
849
+ right: e.right - t.width,
850
+ bottom: e.bottom - t.height,
851
+ left: e.left - t.width
852
+ };
853
+ }
854
+ function rn(e) {
855
+ return Po.some((t) => e[t] >= 0);
856
+ }
857
+ const $o = function(e) {
858
+ return e === void 0 && (e = {}), {
859
+ name: "hide",
860
+ options: e,
861
+ async fn(t) {
862
+ const {
863
+ rects: n
864
+ } = t, {
865
+ strategy: r = "referenceHidden",
866
+ ...o
867
+ } = re(e, t);
868
+ switch (r) {
869
+ case "referenceHidden": {
870
+ const i = await _e(t, {
871
+ ...o,
872
+ elementContext: "reference"
873
+ }), c = nn(i, n.reference);
874
+ return {
875
+ data: {
876
+ referenceHiddenOffsets: c,
877
+ referenceHidden: rn(c)
878
+ }
879
+ };
880
+ }
881
+ case "escaped": {
882
+ const i = await _e(t, {
883
+ ...o,
884
+ altBoundary: !0
885
+ }), c = nn(i, n.floating);
886
+ return {
887
+ data: {
888
+ escapedOffsets: c,
889
+ escaped: rn(c)
890
+ }
891
+ };
892
+ }
893
+ default:
894
+ return {};
895
+ }
896
+ }
897
+ };
898
+ };
899
+ async function Bo(e, t) {
900
+ const {
901
+ placement: n,
902
+ platform: r,
903
+ elements: o
904
+ } = e, i = await (r.isRTL == null ? void 0 : r.isRTL(o.floating)), c = oe(n), s = xe(n), f = se(n) === "y", l = ["left", "top"].includes(c) ? -1 : 1, d = i && f ? -1 : 1, u = re(t, e);
905
+ let {
906
+ mainAxis: p,
907
+ crossAxis: h,
908
+ alignmentAxis: v
909
+ } = typeof u == "number" ? {
910
+ mainAxis: u,
911
+ crossAxis: 0,
912
+ alignmentAxis: null
913
+ } : {
914
+ mainAxis: u.mainAxis || 0,
915
+ crossAxis: u.crossAxis || 0,
916
+ alignmentAxis: u.alignmentAxis
917
+ };
918
+ return s && typeof v == "number" && (h = s === "end" ? v * -1 : v), f ? {
919
+ x: h * d,
920
+ y: p * l
921
+ } : {
922
+ x: p * l,
923
+ y: h * d
924
+ };
925
+ }
926
+ const Wo = function(e) {
927
+ return e === void 0 && (e = 0), {
928
+ name: "offset",
929
+ options: e,
930
+ async fn(t) {
931
+ var n, r;
932
+ const {
933
+ x: o,
934
+ y: i,
935
+ placement: c,
936
+ middlewareData: s
937
+ } = t, f = await Bo(t, e);
938
+ return c === ((n = s.offset) == null ? void 0 : n.placement) && (r = s.arrow) != null && r.alignmentOffset ? {} : {
939
+ x: o + f.x,
940
+ y: i + f.y,
941
+ data: {
942
+ ...f,
943
+ placement: c
944
+ }
945
+ };
946
+ }
947
+ };
948
+ }, Uo = function(e) {
949
+ return e === void 0 && (e = {}), {
950
+ name: "shift",
951
+ options: e,
952
+ async fn(t) {
953
+ const {
954
+ x: n,
955
+ y: r,
956
+ placement: o
957
+ } = t, {
958
+ mainAxis: i = !0,
959
+ crossAxis: c = !1,
960
+ limiter: s = {
961
+ fn: (g) => {
962
+ let {
963
+ x: w,
964
+ y: b
965
+ } = g;
966
+ return {
967
+ x: w,
968
+ y: b
969
+ };
970
+ }
971
+ },
972
+ ...f
973
+ } = re(e, t), l = {
974
+ x: n,
975
+ y: r
976
+ }, d = await _e(t, f), u = se(oe(o)), p = At(u);
977
+ let h = l[p], v = l[u];
978
+ if (i) {
979
+ const g = p === "y" ? "top" : "left", w = p === "y" ? "bottom" : "right", b = h + d[g], x = h - d[w];
980
+ h = Ct(b, h, x);
981
+ }
982
+ if (c) {
983
+ const g = u === "y" ? "top" : "left", w = u === "y" ? "bottom" : "right", b = v + d[g], x = v - d[w];
984
+ v = Ct(b, v, x);
985
+ }
986
+ const m = s.fn({
987
+ ...t,
988
+ [p]: h,
989
+ [u]: v
990
+ });
991
+ return {
992
+ ...m,
993
+ data: {
994
+ x: m.x - n,
995
+ y: m.y - r,
996
+ enabled: {
997
+ [p]: i,
998
+ [u]: c
999
+ }
1000
+ }
1001
+ };
1002
+ }
1003
+ };
1004
+ }, Ko = function(e) {
1005
+ return e === void 0 && (e = {}), {
1006
+ options: e,
1007
+ fn(t) {
1008
+ const {
1009
+ x: n,
1010
+ y: r,
1011
+ placement: o,
1012
+ rects: i,
1013
+ middlewareData: c
1014
+ } = t, {
1015
+ offset: s = 0,
1016
+ mainAxis: f = !0,
1017
+ crossAxis: l = !0
1018
+ } = re(e, t), d = {
1019
+ x: n,
1020
+ y: r
1021
+ }, u = se(o), p = At(u);
1022
+ let h = d[p], v = d[u];
1023
+ const m = re(s, t), g = typeof m == "number" ? {
1024
+ mainAxis: m,
1025
+ crossAxis: 0
1026
+ } : {
1027
+ mainAxis: 0,
1028
+ crossAxis: 0,
1029
+ ...m
1030
+ };
1031
+ if (f) {
1032
+ const x = p === "y" ? "height" : "width", C = i.reference[p] - i.floating[x] + g.mainAxis, E = i.reference[p] + i.reference[x] - g.mainAxis;
1033
+ h < C ? h = C : h > E && (h = E);
1034
+ }
1035
+ if (l) {
1036
+ var w, b;
1037
+ const x = p === "y" ? "width" : "height", C = ["top", "left"].includes(oe(o)), E = i.reference[u] - i.floating[x] + (C && ((w = c.offset) == null ? void 0 : w[u]) || 0) + (C ? 0 : g.crossAxis), M = i.reference[u] + i.reference[x] + (C ? 0 : ((b = c.offset) == null ? void 0 : b[u]) || 0) - (C ? g.crossAxis : 0);
1038
+ v < E ? v = E : v > M && (v = M);
1039
+ }
1040
+ return {
1041
+ [p]: h,
1042
+ [u]: v
1043
+ };
1044
+ }
1045
+ };
1046
+ }, Go = function(e) {
1047
+ return e === void 0 && (e = {}), {
1048
+ name: "size",
1049
+ options: e,
1050
+ async fn(t) {
1051
+ var n, r;
1052
+ const {
1053
+ placement: o,
1054
+ rects: i,
1055
+ platform: c,
1056
+ elements: s
1057
+ } = t, {
1058
+ apply: f = () => {
1059
+ },
1060
+ ...l
1061
+ } = re(e, t), d = await _e(t, l), u = oe(o), p = xe(o), h = se(o) === "y", {
1062
+ width: v,
1063
+ height: m
1064
+ } = i.floating;
1065
+ let g, w;
1066
+ u === "top" || u === "bottom" ? (g = u, w = p === (await (c.isRTL == null ? void 0 : c.isRTL(s.floating)) ? "start" : "end") ? "left" : "right") : (w = u, g = p === "end" ? "top" : "bottom");
1067
+ const b = m - d.top - d.bottom, x = v - d.left - d.right, C = ce(m - d[g], b), E = ce(v - d[w], x), M = !t.middlewareData.shift;
1068
+ let R = C, P = E;
1069
+ if ((n = t.middlewareData.shift) != null && n.enabled.x && (P = x), (r = t.middlewareData.shift) != null && r.enabled.y && (R = b), M && !p) {
1070
+ const _ = V(d.left, 0), F = V(d.right, 0), k = V(d.top, 0), I = V(d.bottom, 0);
1071
+ h ? P = v - 2 * (_ !== 0 || F !== 0 ? _ + F : V(d.left, d.right)) : R = m - 2 * (k !== 0 || I !== 0 ? k + I : V(d.top, d.bottom));
1072
+ }
1073
+ await f({
1074
+ ...t,
1075
+ availableWidth: P,
1076
+ availableHeight: R
1077
+ });
1078
+ const D = await c.getDimensions(s.floating);
1079
+ return v !== D.width || m !== D.height ? {
1080
+ reset: {
1081
+ rects: !0
1082
+ }
1083
+ } : {};
1084
+ }
1085
+ };
1086
+ };
1087
+ function nt() {
1088
+ return typeof window < "u";
1089
+ }
1090
+ function Ce(e) {
1091
+ return On(e) ? (e.nodeName || "").toLowerCase() : "#document";
1092
+ }
1093
+ function H(e) {
1094
+ var t;
1095
+ return (e == null || (t = e.ownerDocument) == null ? void 0 : t.defaultView) || window;
1096
+ }
1097
+ function ee(e) {
1098
+ var t;
1099
+ return (t = (On(e) ? e.ownerDocument : e.document) || window.document) == null ? void 0 : t.documentElement;
1100
+ }
1101
+ function On(e) {
1102
+ return nt() ? e instanceof Node || e instanceof H(e).Node : !1;
1103
+ }
1104
+ function X(e) {
1105
+ return nt() ? e instanceof Element || e instanceof H(e).Element : !1;
1106
+ }
1107
+ function J(e) {
1108
+ return nt() ? e instanceof HTMLElement || e instanceof H(e).HTMLElement : !1;
1109
+ }
1110
+ function on(e) {
1111
+ return !nt() || typeof ShadowRoot > "u" ? !1 : e instanceof ShadowRoot || e instanceof H(e).ShadowRoot;
1112
+ }
1113
+ function Ie(e) {
1114
+ const {
1115
+ overflow: t,
1116
+ overflowX: n,
1117
+ overflowY: r,
1118
+ display: o
1119
+ } = z(e);
1120
+ return /auto|scroll|overlay|hidden|clip/.test(t + r + n) && !["inline", "contents"].includes(o);
1121
+ }
1122
+ function Vo(e) {
1123
+ return ["table", "td", "th"].includes(Ce(e));
1124
+ }
1125
+ function rt(e) {
1126
+ return [":popover-open", ":modal"].some((t) => {
1127
+ try {
1128
+ return e.matches(t);
1129
+ } catch {
1130
+ return !1;
1131
+ }
1132
+ });
1133
+ }
1134
+ function Tt(e) {
1135
+ const t = Dt(), n = X(e) ? z(e) : e;
1136
+ return n.transform !== "none" || n.perspective !== "none" || (n.containerType ? n.containerType !== "normal" : !1) || !t && (n.backdropFilter ? n.backdropFilter !== "none" : !1) || !t && (n.filter ? n.filter !== "none" : !1) || ["transform", "perspective", "filter"].some((r) => (n.willChange || "").includes(r)) || ["paint", "layout", "strict", "content"].some((r) => (n.contain || "").includes(r));
1137
+ }
1138
+ function Ho(e) {
1139
+ let t = ae(e);
1140
+ for (; J(t) && !be(t); ) {
1141
+ if (Tt(t))
1142
+ return t;
1143
+ if (rt(t))
1144
+ return null;
1145
+ t = ae(t);
1146
+ }
1147
+ return null;
1148
+ }
1149
+ function Dt() {
1150
+ return typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter", "none");
1151
+ }
1152
+ function be(e) {
1153
+ return ["html", "body", "#document"].includes(Ce(e));
1154
+ }
1155
+ function z(e) {
1156
+ return H(e).getComputedStyle(e);
1157
+ }
1158
+ function ot(e) {
1159
+ return X(e) ? {
1160
+ scrollLeft: e.scrollLeft,
1161
+ scrollTop: e.scrollTop
1162
+ } : {
1163
+ scrollLeft: e.scrollX,
1164
+ scrollTop: e.scrollY
1165
+ };
1166
+ }
1167
+ function ae(e) {
1168
+ if (Ce(e) === "html")
1169
+ return e;
1170
+ const t = (
1171
+ // Step into the shadow DOM of the parent of a slotted node.
1172
+ e.assignedSlot || // DOM Element detected.
1173
+ e.parentNode || // ShadowRoot detected.
1174
+ on(e) && e.host || // Fallback.
1175
+ ee(e)
1176
+ );
1177
+ return on(t) ? t.host : t;
1178
+ }
1179
+ function _n(e) {
1180
+ const t = ae(e);
1181
+ return be(t) ? e.ownerDocument ? e.ownerDocument.body : e.body : J(t) && Ie(t) ? t : _n(t);
1182
+ }
1183
+ function Te(e, t, n) {
1184
+ var r;
1185
+ t === void 0 && (t = []), n === void 0 && (n = !0);
1186
+ const o = _n(e), i = o === ((r = e.ownerDocument) == null ? void 0 : r.body), c = H(o);
1187
+ if (i) {
1188
+ const s = St(c);
1189
+ return t.concat(c, c.visualViewport || [], Ie(o) ? o : [], s && n ? Te(s) : []);
1190
+ }
1191
+ return t.concat(o, Te(o, [], n));
1192
+ }
1193
+ function St(e) {
1194
+ return e.parent && Object.getPrototypeOf(e.parent) ? e.frameElement : null;
1195
+ }
1196
+ function Tn(e) {
1197
+ const t = z(e);
1198
+ let n = parseFloat(t.width) || 0, r = parseFloat(t.height) || 0;
1199
+ const o = J(e), i = o ? e.offsetWidth : n, c = o ? e.offsetHeight : r, s = ze(n) !== i || ze(r) !== c;
1200
+ return s && (n = i, r = c), {
1201
+ width: n,
1202
+ height: r,
1203
+ $: s
1204
+ };
1205
+ }
1206
+ function Nt(e) {
1207
+ return X(e) ? e : e.contextElement;
1208
+ }
1209
+ function ge(e) {
1210
+ const t = Nt(e);
1211
+ if (!J(t))
1212
+ return Q(1);
1213
+ const n = t.getBoundingClientRect(), {
1214
+ width: r,
1215
+ height: o,
1216
+ $: i
1217
+ } = Tn(t);
1218
+ let c = (i ? ze(n.width) : n.width) / r, s = (i ? ze(n.height) : n.height) / o;
1219
+ return (!c || !Number.isFinite(c)) && (c = 1), (!s || !Number.isFinite(s)) && (s = 1), {
1220
+ x: c,
1221
+ y: s
1222
+ };
1223
+ }
1224
+ const Yo = /* @__PURE__ */ Q(0);
1225
+ function Dn(e) {
1226
+ const t = H(e);
1227
+ return !Dt() || !t.visualViewport ? Yo : {
1228
+ x: t.visualViewport.offsetLeft,
1229
+ y: t.visualViewport.offsetTop
1230
+ };
1231
+ }
1232
+ function jo(e, t, n) {
1233
+ return t === void 0 && (t = !1), !n || t && n !== H(e) ? !1 : t;
1234
+ }
1235
+ function fe(e, t, n, r) {
1236
+ t === void 0 && (t = !1), n === void 0 && (n = !1);
1237
+ const o = e.getBoundingClientRect(), i = Nt(e);
1238
+ let c = Q(1);
1239
+ t && (r ? X(r) && (c = ge(r)) : c = ge(e));
1240
+ const s = jo(i, n, r) ? Dn(i) : Q(0);
1241
+ let f = (o.left + s.x) / c.x, l = (o.top + s.y) / c.y, d = o.width / c.x, u = o.height / c.y;
1242
+ if (i) {
1243
+ const p = H(i), h = r && X(r) ? H(r) : r;
1244
+ let v = p, m = St(v);
1245
+ for (; m && r && h !== v; ) {
1246
+ const g = ge(m), w = m.getBoundingClientRect(), b = z(m), x = w.left + (m.clientLeft + parseFloat(b.paddingLeft)) * g.x, C = w.top + (m.clientTop + parseFloat(b.paddingTop)) * g.y;
1247
+ f *= g.x, l *= g.y, d *= g.x, u *= g.y, f += x, l += C, v = H(m), m = St(v);
1248
+ }
1249
+ }
1250
+ return qe({
1251
+ width: d,
1252
+ height: u,
1253
+ x: f,
1254
+ y: l
1255
+ });
1256
+ }
1257
+ function It(e, t) {
1258
+ const n = ot(e).scrollLeft;
1259
+ return t ? t.left + n : fe(ee(e)).left + n;
1260
+ }
1261
+ function Nn(e, t, n) {
1262
+ n === void 0 && (n = !1);
1263
+ const r = e.getBoundingClientRect(), o = r.left + t.scrollLeft - (n ? 0 : (
1264
+ // RTL <body> scrollbar.
1265
+ It(e, r)
1266
+ )), i = r.top + t.scrollTop;
1267
+ return {
1268
+ x: o,
1269
+ y: i
1270
+ };
1271
+ }
1272
+ function Xo(e) {
1273
+ let {
1274
+ elements: t,
1275
+ rect: n,
1276
+ offsetParent: r,
1277
+ strategy: o
1278
+ } = e;
1279
+ const i = o === "fixed", c = ee(r), s = t ? rt(t.floating) : !1;
1280
+ if (r === c || s && i)
1281
+ return n;
1282
+ let f = {
1283
+ scrollLeft: 0,
1284
+ scrollTop: 0
1285
+ }, l = Q(1);
1286
+ const d = Q(0), u = J(r);
1287
+ if ((u || !u && !i) && ((Ce(r) !== "body" || Ie(c)) && (f = ot(r)), J(r))) {
1288
+ const h = fe(r);
1289
+ l = ge(r), d.x = h.x + r.clientLeft, d.y = h.y + r.clientTop;
1290
+ }
1291
+ const p = c && !u && !i ? Nn(c, f, !0) : Q(0);
1292
+ return {
1293
+ width: n.width * l.x,
1294
+ height: n.height * l.y,
1295
+ x: n.x * l.x - f.scrollLeft * l.x + d.x + p.x,
1296
+ y: n.y * l.y - f.scrollTop * l.y + d.y + p.y
1297
+ };
1298
+ }
1299
+ function zo(e) {
1300
+ return Array.from(e.getClientRects());
1301
+ }
1302
+ function Zo(e) {
1303
+ const t = ee(e), n = ot(e), r = e.ownerDocument.body, o = V(t.scrollWidth, t.clientWidth, r.scrollWidth, r.clientWidth), i = V(t.scrollHeight, t.clientHeight, r.scrollHeight, r.clientHeight);
1304
+ let c = -n.scrollLeft + It(e);
1305
+ const s = -n.scrollTop;
1306
+ return z(r).direction === "rtl" && (c += V(t.clientWidth, r.clientWidth) - o), {
1307
+ width: o,
1308
+ height: i,
1309
+ x: c,
1310
+ y: s
1311
+ };
1312
+ }
1313
+ function qo(e, t) {
1314
+ const n = H(e), r = ee(e), o = n.visualViewport;
1315
+ let i = r.clientWidth, c = r.clientHeight, s = 0, f = 0;
1316
+ if (o) {
1317
+ i = o.width, c = o.height;
1318
+ const l = Dt();
1319
+ (!l || l && t === "fixed") && (s = o.offsetLeft, f = o.offsetTop);
1320
+ }
1321
+ return {
1322
+ width: i,
1323
+ height: c,
1324
+ x: s,
1325
+ y: f
1326
+ };
1327
+ }
1328
+ function Qo(e, t) {
1329
+ const n = fe(e, !0, t === "fixed"), r = n.top + e.clientTop, o = n.left + e.clientLeft, i = J(e) ? ge(e) : Q(1), c = e.clientWidth * i.x, s = e.clientHeight * i.y, f = o * i.x, l = r * i.y;
1330
+ return {
1331
+ width: c,
1332
+ height: s,
1333
+ x: f,
1334
+ y: l
1335
+ };
1336
+ }
1337
+ function cn(e, t, n) {
1338
+ let r;
1339
+ if (t === "viewport")
1340
+ r = qo(e, n);
1341
+ else if (t === "document")
1342
+ r = Zo(ee(e));
1343
+ else if (X(t))
1344
+ r = Qo(t, n);
1345
+ else {
1346
+ const o = Dn(e);
1347
+ r = {
1348
+ x: t.x - o.x,
1349
+ y: t.y - o.y,
1350
+ width: t.width,
1351
+ height: t.height
1352
+ };
1353
+ }
1354
+ return qe(r);
1355
+ }
1356
+ function In(e, t) {
1357
+ const n = ae(e);
1358
+ return n === t || !X(n) || be(n) ? !1 : z(n).position === "fixed" || In(n, t);
1359
+ }
1360
+ function Jo(e, t) {
1361
+ const n = t.get(e);
1362
+ if (n)
1363
+ return n;
1364
+ let r = Te(e, [], !1).filter((s) => X(s) && Ce(s) !== "body"), o = null;
1365
+ const i = z(e).position === "fixed";
1366
+ let c = i ? ae(e) : e;
1367
+ for (; X(c) && !be(c); ) {
1368
+ const s = z(c), f = Tt(c);
1369
+ !f && s.position === "fixed" && (o = null), (i ? !f && !o : !f && s.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || Ie(c) && !f && In(e, c)) ? r = r.filter((d) => d !== c) : o = s, c = ae(c);
1370
+ }
1371
+ return t.set(e, r), r;
1372
+ }
1373
+ function ei(e) {
1374
+ let {
1375
+ element: t,
1376
+ boundary: n,
1377
+ rootBoundary: r,
1378
+ strategy: o
1379
+ } = e;
1380
+ const c = [...n === "clippingAncestors" ? rt(t) ? [] : Jo(t, this._c) : [].concat(n), r], s = c[0], f = c.reduce((l, d) => {
1381
+ const u = cn(t, d, o);
1382
+ return l.top = V(u.top, l.top), l.right = ce(u.right, l.right), l.bottom = ce(u.bottom, l.bottom), l.left = V(u.left, l.left), l;
1383
+ }, cn(t, s, o));
1384
+ return {
1385
+ width: f.right - f.left,
1386
+ height: f.bottom - f.top,
1387
+ x: f.left,
1388
+ y: f.top
1389
+ };
1390
+ }
1391
+ function ti(e) {
1392
+ const {
1393
+ width: t,
1394
+ height: n
1395
+ } = Tn(e);
1396
+ return {
1397
+ width: t,
1398
+ height: n
1399
+ };
1400
+ }
1401
+ function ni(e, t, n) {
1402
+ const r = J(t), o = ee(t), i = n === "fixed", c = fe(e, !0, i, t);
1403
+ let s = {
1404
+ scrollLeft: 0,
1405
+ scrollTop: 0
1406
+ };
1407
+ const f = Q(0);
1408
+ if (r || !r && !i)
1409
+ if ((Ce(t) !== "body" || Ie(o)) && (s = ot(t)), r) {
1410
+ const p = fe(t, !0, i, t);
1411
+ f.x = p.x + t.clientLeft, f.y = p.y + t.clientTop;
1412
+ } else
1413
+ o && (f.x = It(o));
1414
+ const l = o && !r && !i ? Nn(o, s) : Q(0), d = c.left + s.scrollLeft - f.x - l.x, u = c.top + s.scrollTop - f.y - l.y;
1415
+ return {
1416
+ x: d,
1417
+ y: u,
1418
+ width: c.width,
1419
+ height: c.height
1420
+ };
1421
+ }
1422
+ function dt(e) {
1423
+ return z(e).position === "static";
1424
+ }
1425
+ function sn(e, t) {
1426
+ if (!J(e) || z(e).position === "fixed")
1427
+ return null;
1428
+ if (t)
1429
+ return t(e);
1430
+ let n = e.offsetParent;
1431
+ return ee(e) === n && (n = n.ownerDocument.body), n;
1432
+ }
1433
+ function Ln(e, t) {
1434
+ const n = H(e);
1435
+ if (rt(e))
1436
+ return n;
1437
+ if (!J(e)) {
1438
+ let o = ae(e);
1439
+ for (; o && !be(o); ) {
1440
+ if (X(o) && !dt(o))
1441
+ return o;
1442
+ o = ae(o);
1443
+ }
1444
+ return n;
1445
+ }
1446
+ let r = sn(e, t);
1447
+ for (; r && Vo(r) && dt(r); )
1448
+ r = sn(r, t);
1449
+ return r && be(r) && dt(r) && !Tt(r) ? n : r || Ho(e) || n;
1450
+ }
1451
+ const ri = async function(e) {
1452
+ const t = this.getOffsetParent || Ln, n = this.getDimensions, r = await n(e.floating);
1453
+ return {
1454
+ reference: ni(e.reference, await t(e.floating), e.strategy),
1455
+ floating: {
1456
+ x: 0,
1457
+ y: 0,
1458
+ width: r.width,
1459
+ height: r.height
1460
+ }
1461
+ };
1462
+ };
1463
+ function oi(e) {
1464
+ return z(e).direction === "rtl";
1465
+ }
1466
+ const ii = {
1467
+ convertOffsetParentRelativeRectToViewportRelativeRect: Xo,
1468
+ getDocumentElement: ee,
1469
+ getClippingRect: ei,
1470
+ getOffsetParent: Ln,
1471
+ getElementRects: ri,
1472
+ getClientRects: zo,
1473
+ getDimensions: ti,
1474
+ getScale: ge,
1475
+ isElement: X,
1476
+ isRTL: oi
1477
+ };
1478
+ function ci(e, t) {
1479
+ let n = null, r;
1480
+ const o = ee(e);
1481
+ function i() {
1482
+ var s;
1483
+ clearTimeout(r), (s = n) == null || s.disconnect(), n = null;
1484
+ }
1485
+ function c(s, f) {
1486
+ s === void 0 && (s = !1), f === void 0 && (f = 1), i();
1487
+ const {
1488
+ left: l,
1489
+ top: d,
1490
+ width: u,
1491
+ height: p
1492
+ } = e.getBoundingClientRect();
1493
+ if (s || t(), !u || !p)
1494
+ return;
1495
+ const h = We(d), v = We(o.clientWidth - (l + u)), m = We(o.clientHeight - (d + p)), g = We(l), b = {
1496
+ rootMargin: -h + "px " + -v + "px " + -m + "px " + -g + "px",
1497
+ threshold: V(0, ce(1, f)) || 1
1498
+ };
1499
+ let x = !0;
1500
+ function C(E) {
1501
+ const M = E[0].intersectionRatio;
1502
+ if (M !== f) {
1503
+ if (!x)
1504
+ return c();
1505
+ M ? c(!1, M) : r = setTimeout(() => {
1506
+ c(!1, 1e-7);
1507
+ }, 1e3);
1508
+ }
1509
+ x = !1;
1510
+ }
1511
+ try {
1512
+ n = new IntersectionObserver(C, {
1513
+ ...b,
1514
+ // Handle <iframe>s
1515
+ root: o.ownerDocument
1516
+ });
1517
+ } catch {
1518
+ n = new IntersectionObserver(C, b);
1519
+ }
1520
+ n.observe(e);
1521
+ }
1522
+ return c(!0), i;
1523
+ }
1524
+ function si(e, t, n, r) {
1525
+ r === void 0 && (r = {});
1526
+ const {
1527
+ ancestorScroll: o = !0,
1528
+ ancestorResize: i = !0,
1529
+ elementResize: c = typeof ResizeObserver == "function",
1530
+ layoutShift: s = typeof IntersectionObserver == "function",
1531
+ animationFrame: f = !1
1532
+ } = r, l = Nt(e), d = o || i ? [...l ? Te(l) : [], ...Te(t)] : [];
1533
+ d.forEach((w) => {
1534
+ o && w.addEventListener("scroll", n, {
1535
+ passive: !0
1536
+ }), i && w.addEventListener("resize", n);
1537
+ });
1538
+ const u = l && s ? ci(l, n) : null;
1539
+ let p = -1, h = null;
1540
+ c && (h = new ResizeObserver((w) => {
1541
+ let [b] = w;
1542
+ b && b.target === l && h && (h.unobserve(t), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
1543
+ var x;
1544
+ (x = h) == null || x.observe(t);
1545
+ })), n();
1546
+ }), l && !f && h.observe(l), h.observe(t));
1547
+ let v, m = f ? fe(e) : null;
1548
+ f && g();
1549
+ function g() {
1550
+ const w = fe(e);
1551
+ m && (w.x !== m.x || w.y !== m.y || w.width !== m.width || w.height !== m.height) && n(), m = w, v = requestAnimationFrame(g);
1552
+ }
1553
+ return n(), () => {
1554
+ var w;
1555
+ d.forEach((b) => {
1556
+ o && b.removeEventListener("scroll", n), i && b.removeEventListener("resize", n);
1557
+ }), u == null || u(), (w = h) == null || w.disconnect(), h = null, f && cancelAnimationFrame(v);
1558
+ };
1559
+ }
1560
+ const ai = Wo, ui = Uo, li = ko, fi = Go, di = $o, an = Fo, pi = Ko, mi = (e, t, n) => {
1561
+ const r = /* @__PURE__ */ new Map(), o = {
1562
+ platform: ii,
1563
+ ...n
1564
+ }, i = {
1565
+ ...o.platform,
1566
+ _c: r
1567
+ };
1568
+ return Lo(e, t, {
1569
+ ...o,
1570
+ platform: i
1571
+ });
1572
+ };
1573
+ var Ye = typeof document < "u" ? jr : Xr;
1574
+ function Qe(e, t) {
1575
+ if (e === t)
1576
+ return !0;
1577
+ if (typeof e != typeof t)
1578
+ return !1;
1579
+ if (typeof e == "function" && e.toString() === t.toString())
1580
+ return !0;
1581
+ let n, r, o;
1582
+ if (e && t && typeof e == "object") {
1583
+ if (Array.isArray(e)) {
1584
+ if (n = e.length, n !== t.length)
1585
+ return !1;
1586
+ for (r = n; r-- !== 0; )
1587
+ if (!Qe(e[r], t[r]))
1588
+ return !1;
1589
+ return !0;
1590
+ }
1591
+ if (o = Object.keys(e), n = o.length, n !== Object.keys(t).length)
1592
+ return !1;
1593
+ for (r = n; r-- !== 0; )
1594
+ if (!{}.hasOwnProperty.call(t, o[r]))
1595
+ return !1;
1596
+ for (r = n; r-- !== 0; ) {
1597
+ const i = o[r];
1598
+ if (!(i === "_owner" && e.$$typeof) && !Qe(e[i], t[i]))
1599
+ return !1;
1600
+ }
1601
+ return !0;
1602
+ }
1603
+ return e !== e && t !== t;
1604
+ }
1605
+ function Fn(e) {
1606
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
1607
+ }
1608
+ function un(e, t) {
1609
+ const n = Fn(e);
1610
+ return Math.round(t * n) / n;
1611
+ }
1612
+ function pt(e) {
1613
+ const t = a.useRef(e);
1614
+ return Ye(() => {
1615
+ t.current = e;
1616
+ }), t;
1617
+ }
1618
+ function hi(e) {
1619
+ e === void 0 && (e = {});
1620
+ const {
1621
+ placement: t = "bottom",
1622
+ strategy: n = "absolute",
1623
+ middleware: r = [],
1624
+ platform: o,
1625
+ elements: {
1626
+ reference: i,
1627
+ floating: c
1628
+ } = {},
1629
+ transform: s = !0,
1630
+ whileElementsMounted: f,
1631
+ open: l
1632
+ } = e, [d, u] = a.useState({
1633
+ x: 0,
1634
+ y: 0,
1635
+ strategy: n,
1636
+ placement: t,
1637
+ middlewareData: {},
1638
+ isPositioned: !1
1639
+ }), [p, h] = a.useState(r);
1640
+ Qe(p, r) || h(r);
1641
+ const [v, m] = a.useState(null), [g, w] = a.useState(null), b = a.useCallback((A) => {
1642
+ A !== M.current && (M.current = A, m(A));
1643
+ }, []), x = a.useCallback((A) => {
1644
+ A !== R.current && (R.current = A, w(A));
1645
+ }, []), C = i || v, E = c || g, M = a.useRef(null), R = a.useRef(null), P = a.useRef(d), D = f != null, _ = pt(f), F = pt(o), k = pt(l), I = a.useCallback(() => {
1646
+ if (!M.current || !R.current)
1647
+ return;
1648
+ const A = {
1649
+ placement: t,
1650
+ strategy: n,
1651
+ middleware: p
1652
+ };
1653
+ F.current && (A.platform = F.current), mi(M.current, R.current, A).then((S) => {
1654
+ const L = {
1655
+ ...S,
1656
+ // The floating element's position may be recomputed while it's closed
1657
+ // but still mounted (such as when transitioning out). To ensure
1658
+ // `isPositioned` will be `false` initially on the next open, avoid
1659
+ // setting it to `true` when `open === false` (must be specified).
1660
+ isPositioned: k.current !== !1
1661
+ };
1662
+ N.current && !Qe(P.current, L) && (P.current = L, yn.flushSync(() => {
1663
+ u(L);
1664
+ }));
1665
+ });
1666
+ }, [p, t, n, F, k]);
1667
+ Ye(() => {
1668
+ l === !1 && P.current.isPositioned && (P.current.isPositioned = !1, u((A) => ({
1669
+ ...A,
1670
+ isPositioned: !1
1671
+ })));
1672
+ }, [l]);
1673
+ const N = a.useRef(!1);
1674
+ Ye(() => (N.current = !0, () => {
1675
+ N.current = !1;
1676
+ }), []), Ye(() => {
1677
+ if (C && (M.current = C), E && (R.current = E), C && E) {
1678
+ if (_.current)
1679
+ return _.current(C, E, I);
1680
+ I();
1681
+ }
1682
+ }, [C, E, I, _, D]);
1683
+ const B = a.useMemo(() => ({
1684
+ reference: M,
1685
+ floating: R,
1686
+ setReference: b,
1687
+ setFloating: x
1688
+ }), [b, x]), T = a.useMemo(() => ({
1689
+ reference: C,
1690
+ floating: E
1691
+ }), [C, E]), $ = a.useMemo(() => {
1692
+ const A = {
1693
+ position: n,
1694
+ left: 0,
1695
+ top: 0
1696
+ };
1697
+ if (!T.floating)
1698
+ return A;
1699
+ const S = un(T.floating, d.x), L = un(T.floating, d.y);
1700
+ return s ? {
1701
+ ...A,
1702
+ transform: "translate(" + S + "px, " + L + "px)",
1703
+ ...Fn(T.floating) >= 1.5 && {
1704
+ willChange: "transform"
1705
+ }
1706
+ } : {
1707
+ position: n,
1708
+ left: S,
1709
+ top: L
1710
+ };
1711
+ }, [n, s, T.floating, d.x, d.y]);
1712
+ return a.useMemo(() => ({
1713
+ ...d,
1714
+ update: I,
1715
+ refs: B,
1716
+ elements: T,
1717
+ floatingStyles: $
1718
+ }), [d, I, B, T, $]);
1719
+ }
1720
+ const vi = (e) => {
1721
+ function t(n) {
1722
+ return {}.hasOwnProperty.call(n, "current");
1723
+ }
1724
+ return {
1725
+ name: "arrow",
1726
+ options: e,
1727
+ fn(n) {
1728
+ const {
1729
+ element: r,
1730
+ padding: o
1731
+ } = typeof e == "function" ? e(n) : e;
1732
+ return r && t(r) ? r.current != null ? an({
1733
+ element: r.current,
1734
+ padding: o
1735
+ }).fn(n) : {} : r ? an({
1736
+ element: r,
1737
+ padding: o
1738
+ }).fn(n) : {};
1739
+ }
1740
+ };
1741
+ }, gi = (e, t) => ({
1742
+ ...ai(e),
1743
+ options: [e, t]
1744
+ }), wi = (e, t) => ({
1745
+ ...ui(e),
1746
+ options: [e, t]
1747
+ }), yi = (e, t) => ({
1748
+ ...pi(e),
1749
+ options: [e, t]
1750
+ }), bi = (e, t) => ({
1751
+ ...li(e),
1752
+ options: [e, t]
1753
+ }), xi = (e, t) => ({
1754
+ ...fi(e),
1755
+ options: [e, t]
1756
+ }), Ci = (e, t) => ({
1757
+ ...di(e),
1758
+ options: [e, t]
1759
+ }), Ei = (e, t) => ({
1760
+ ...vi(e),
1761
+ options: [e, t]
1762
+ });
1763
+ var Si = "Arrow", kn = a.forwardRef((e, t) => {
1764
+ const { children: n, width: r = 10, height: o = 5, ...i } = e;
1765
+ return /* @__PURE__ */ y(
1766
+ U.svg,
1767
+ {
1768
+ ...i,
1769
+ ref: t,
1770
+ width: r,
1771
+ height: o,
1772
+ viewBox: "0 0 30 10",
1773
+ preserveAspectRatio: "none",
1774
+ children: e.asChild ? n : /* @__PURE__ */ y("polygon", { points: "0,0 30,0 15,10" })
1775
+ }
1776
+ );
1777
+ });
1778
+ kn.displayName = Si;
1779
+ var Ri = kn;
1780
+ function Mi(e, t = []) {
1781
+ let n = [];
1782
+ function r(i, c) {
1783
+ const s = a.createContext(c), f = n.length;
1784
+ n = [...n, c];
1785
+ function l(u) {
1786
+ const { scope: p, children: h, ...v } = u, m = (p == null ? void 0 : p[e][f]) || s, g = a.useMemo(() => v, Object.values(v));
1787
+ return /* @__PURE__ */ y(m.Provider, { value: g, children: h });
1788
+ }
1789
+ function d(u, p) {
1790
+ const h = (p == null ? void 0 : p[e][f]) || s, v = a.useContext(h);
1791
+ if (v)
1792
+ return v;
1793
+ if (c !== void 0)
1794
+ return c;
1795
+ throw new Error(`\`${u}\` must be used within \`${i}\``);
1796
+ }
1797
+ return l.displayName = i + "Provider", [l, d];
1798
+ }
1799
+ const o = () => {
1800
+ const i = n.map((c) => a.createContext(c));
1801
+ return function(s) {
1802
+ const f = (s == null ? void 0 : s[e]) || i;
1803
+ return a.useMemo(
1804
+ () => ({ [`__scope${e}`]: { ...s, [e]: f } }),
1805
+ [s, f]
1806
+ );
1807
+ };
1808
+ };
1809
+ return o.scopeName = e, [r, Pi(o, ...t)];
1810
+ }
1811
+ function Pi(...e) {
1812
+ const t = e[0];
1813
+ if (e.length === 1)
1814
+ return t;
1815
+ const n = () => {
1816
+ const r = e.map((o) => ({
1817
+ useScope: o(),
1818
+ scopeName: o.scopeName
1819
+ }));
1820
+ return function(i) {
1821
+ const c = r.reduce((s, { useScope: f, scopeName: l }) => {
1822
+ const u = f(i)[`__scope${l}`];
1823
+ return { ...s, ...u };
1824
+ }, {});
1825
+ return a.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
1826
+ };
1827
+ };
1828
+ return n.scopeName = t.scopeName, n;
1829
+ }
1830
+ var Lt = "Popper", [$n, Bn] = Mi(Lt), [Ai, Wn] = $n(Lt), Un = (e) => {
1831
+ const { __scopePopper: t, children: n } = e, [r, o] = a.useState(null);
1832
+ return /* @__PURE__ */ y(Ai, { scope: t, anchor: r, onAnchorChange: o, children: n });
1833
+ };
1834
+ Un.displayName = Lt;
1835
+ var Kn = "PopperAnchor", Gn = a.forwardRef(
1836
+ (e, t) => {
1837
+ const { __scopePopper: n, virtualRef: r, ...o } = e, i = Wn(Kn, n), c = a.useRef(null), s = G(t, c);
1838
+ return a.useEffect(() => {
1839
+ i.onAnchorChange((r == null ? void 0 : r.current) || c.current);
1840
+ }), r ? null : /* @__PURE__ */ y(U.div, { ...o, ref: s });
1841
+ }
1842
+ );
1843
+ Gn.displayName = Kn;
1844
+ var Ft = "PopperContent", [Oi, _i] = $n(Ft), Vn = a.forwardRef(
1845
+ (e, t) => {
1846
+ var te, Re, Y, Me, Ht, Yt;
1847
+ const {
1848
+ __scopePopper: n,
1849
+ side: r = "bottom",
1850
+ sideOffset: o = 0,
1851
+ align: i = "center",
1852
+ alignOffset: c = 0,
1853
+ arrowPadding: s = 0,
1854
+ avoidCollisions: f = !0,
1855
+ collisionBoundary: l = [],
1856
+ collisionPadding: d = 0,
1857
+ sticky: u = "partial",
1858
+ hideWhenDetached: p = !1,
1859
+ updatePositionStrategy: h = "optimized",
1860
+ onPlaced: v,
1861
+ ...m
1862
+ } = e, g = Wn(Ft, n), [w, b] = a.useState(null), x = G(t, (Pe) => b(Pe)), [C, E] = a.useState(null), M = Zr(C), R = (M == null ? void 0 : M.width) ?? 0, P = (M == null ? void 0 : M.height) ?? 0, D = r + (i !== "center" ? "-" + i : ""), _ = typeof d == "number" ? d : { top: 0, right: 0, bottom: 0, left: 0, ...d }, F = Array.isArray(l) ? l : [l], k = F.length > 0, I = {
1863
+ padding: _,
1864
+ boundary: F.filter(Di),
1865
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
1866
+ altBoundary: k
1867
+ }, { refs: N, floatingStyles: B, placement: T, isPositioned: $, middlewareData: A } = hi({
1868
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
1869
+ strategy: "fixed",
1870
+ placement: D,
1871
+ whileElementsMounted: (...Pe) => si(...Pe, {
1872
+ animationFrame: h === "always"
1873
+ }),
1874
+ elements: {
1875
+ reference: g.anchor
1876
+ },
1877
+ middleware: [
1878
+ gi({ mainAxis: o + P, alignmentAxis: c }),
1879
+ f && wi({
1880
+ mainAxis: !0,
1881
+ crossAxis: !1,
1882
+ limiter: u === "partial" ? yi() : void 0,
1883
+ ...I
1884
+ }),
1885
+ f && bi({ ...I }),
1886
+ xi({
1887
+ ...I,
1888
+ apply: ({ elements: Pe, rects: jt, availableWidth: Gr, availableHeight: Vr }) => {
1889
+ const { width: Hr, height: Yr } = jt.reference, Be = Pe.floating.style;
1890
+ Be.setProperty("--radix-popper-available-width", `${Gr}px`), Be.setProperty("--radix-popper-available-height", `${Vr}px`), Be.setProperty("--radix-popper-anchor-width", `${Hr}px`), Be.setProperty("--radix-popper-anchor-height", `${Yr}px`);
1891
+ }
1892
+ }),
1893
+ C && Ei({ element: C, padding: s }),
1894
+ Ni({ arrowWidth: R, arrowHeight: P }),
1895
+ p && Ci({ strategy: "referenceHidden", ...I })
1896
+ ]
1897
+ }), [S, L] = jn(T), W = ne(v);
1898
+ ye(() => {
1899
+ $ && (W == null || W());
1900
+ }, [$, W]);
1901
+ const Z = (te = A.arrow) == null ? void 0 : te.x, Ee = (Re = A.arrow) == null ? void 0 : Re.y, Se = ((Y = A.arrow) == null ? void 0 : Y.centerOffset) !== 0, [$e, ue] = a.useState();
1902
+ return ye(() => {
1903
+ w && ue(window.getComputedStyle(w).zIndex);
1904
+ }, [w]), /* @__PURE__ */ y(
1905
+ "div",
1906
+ {
1907
+ ref: N.setFloating,
1908
+ "data-radix-popper-content-wrapper": "",
1909
+ style: {
1910
+ ...B,
1911
+ transform: $ ? B.transform : "translate(0, -200%)",
1912
+ // keep off the page when measuring
1913
+ minWidth: "max-content",
1914
+ zIndex: $e,
1915
+ "--radix-popper-transform-origin": [
1916
+ (Me = A.transformOrigin) == null ? void 0 : Me.x,
1917
+ (Ht = A.transformOrigin) == null ? void 0 : Ht.y
1918
+ ].join(" "),
1919
+ // hide the content if using the hide middleware and should be hidden
1920
+ // set visibility to hidden and disable pointer events so the UI behaves
1921
+ // as if the PopperContent isn't there at all
1922
+ ...((Yt = A.hide) == null ? void 0 : Yt.referenceHidden) && {
1923
+ visibility: "hidden",
1924
+ pointerEvents: "none"
1925
+ }
1926
+ },
1927
+ dir: e.dir,
1928
+ children: /* @__PURE__ */ y(
1929
+ Oi,
1930
+ {
1931
+ scope: n,
1932
+ placedSide: S,
1933
+ onArrowChange: E,
1934
+ arrowX: Z,
1935
+ arrowY: Ee,
1936
+ shouldHideArrow: Se,
1937
+ children: /* @__PURE__ */ y(
1938
+ U.div,
1939
+ {
1940
+ "data-side": S,
1941
+ "data-align": L,
1942
+ ...m,
1943
+ ref: x,
1944
+ style: {
1945
+ ...m.style,
1946
+ // if the PopperContent hasn't been placed yet (not all measurements done)
1947
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
1948
+ animation: $ ? void 0 : "none"
1949
+ }
1950
+ }
1951
+ )
1952
+ }
1953
+ )
1954
+ }
1955
+ );
1956
+ }
1957
+ );
1958
+ Vn.displayName = Ft;
1959
+ var Hn = "PopperArrow", Ti = {
1960
+ top: "bottom",
1961
+ right: "left",
1962
+ bottom: "top",
1963
+ left: "right"
1964
+ }, Yn = a.forwardRef(function(t, n) {
1965
+ const { __scopePopper: r, ...o } = t, i = _i(Hn, r), c = Ti[i.placedSide];
1966
+ return (
1967
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
1968
+ // doesn't report size as we'd expect on SVG elements.
1969
+ // it reports their bounding box which is effectively the largest path inside the SVG.
1970
+ /* @__PURE__ */ y(
1971
+ "span",
1972
+ {
1973
+ ref: i.onArrowChange,
1974
+ style: {
1975
+ position: "absolute",
1976
+ left: i.arrowX,
1977
+ top: i.arrowY,
1978
+ [c]: 0,
1979
+ transformOrigin: {
1980
+ top: "",
1981
+ right: "0 0",
1982
+ bottom: "center 0",
1983
+ left: "100% 0"
1984
+ }[i.placedSide],
1985
+ transform: {
1986
+ top: "translateY(100%)",
1987
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
1988
+ bottom: "rotate(180deg)",
1989
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
1990
+ }[i.placedSide],
1991
+ visibility: i.shouldHideArrow ? "hidden" : void 0
1992
+ },
1993
+ children: /* @__PURE__ */ y(
1994
+ Ri,
1995
+ {
1996
+ ...o,
1997
+ ref: n,
1998
+ style: {
1999
+ ...o.style,
2000
+ // ensures the element can be measured correctly (mostly for if SVG)
2001
+ display: "block"
2002
+ }
2003
+ }
2004
+ )
2005
+ }
2006
+ )
2007
+ );
2008
+ });
2009
+ Yn.displayName = Hn;
2010
+ function Di(e) {
2011
+ return e !== null;
2012
+ }
2013
+ var Ni = (e) => ({
2014
+ name: "transformOrigin",
2015
+ options: e,
2016
+ fn(t) {
2017
+ var g, w, b;
2018
+ const { placement: n, rects: r, middlewareData: o } = t, c = ((g = o.arrow) == null ? void 0 : g.centerOffset) !== 0, s = c ? 0 : e.arrowWidth, f = c ? 0 : e.arrowHeight, [l, d] = jn(n), u = { start: "0%", center: "50%", end: "100%" }[d], p = (((w = o.arrow) == null ? void 0 : w.x) ?? 0) + s / 2, h = (((b = o.arrow) == null ? void 0 : b.y) ?? 0) + f / 2;
2019
+ let v = "", m = "";
2020
+ return l === "bottom" ? (v = c ? u : `${p}px`, m = `${-f}px`) : l === "top" ? (v = c ? u : `${p}px`, m = `${r.floating.height + f}px`) : l === "right" ? (v = `${-f}px`, m = c ? u : `${h}px`) : l === "left" && (v = `${r.floating.width + f}px`, m = c ? u : `${h}px`), { data: { x: v, y: m } };
2021
+ }
2022
+ });
2023
+ function jn(e) {
2024
+ const [t, n = "center"] = e.split("-");
2025
+ return [t, n];
2026
+ }
2027
+ var Ii = Un, Li = Gn, Fi = Vn, ki = Yn, $i = "Portal", Xn = a.forwardRef((e, t) => {
2028
+ var s;
2029
+ const { container: n, ...r } = e, [o, i] = a.useState(!1);
2030
+ ye(() => i(!0), []);
2031
+ const c = n || o && ((s = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : s.body);
2032
+ return c ? qr.createPortal(/* @__PURE__ */ y(U.div, { ...r, ref: t }), c) : null;
2033
+ });
2034
+ Xn.displayName = $i;
2035
+ function Bi(e, t) {
2036
+ return a.useReducer((n, r) => t[n][r] ?? n, e);
2037
+ }
2038
+ var Le = (e) => {
2039
+ const { present: t, children: n } = e, r = Wi(t), o = typeof n == "function" ? n({ present: r.isPresent }) : a.Children.only(n), i = G(r.ref, Ui(o));
2040
+ return typeof n == "function" || r.isPresent ? a.cloneElement(o, { ref: i }) : null;
2041
+ };
2042
+ Le.displayName = "Presence";
2043
+ function Wi(e) {
2044
+ const [t, n] = a.useState(), r = a.useRef({}), o = a.useRef(e), i = a.useRef("none"), c = e ? "mounted" : "unmounted", [s, f] = Bi(c, {
2045
+ mounted: {
2046
+ UNMOUNT: "unmounted",
2047
+ ANIMATION_OUT: "unmountSuspended"
2048
+ },
2049
+ unmountSuspended: {
2050
+ MOUNT: "mounted",
2051
+ ANIMATION_END: "unmounted"
2052
+ },
2053
+ unmounted: {
2054
+ MOUNT: "mounted"
2055
+ }
2056
+ });
2057
+ return a.useEffect(() => {
2058
+ const l = Ue(r.current);
2059
+ i.current = s === "mounted" ? l : "none";
2060
+ }, [s]), ye(() => {
2061
+ const l = r.current, d = o.current;
2062
+ if (d !== e) {
2063
+ const p = i.current, h = Ue(l);
2064
+ e ? f("MOUNT") : h === "none" || (l == null ? void 0 : l.display) === "none" ? f("UNMOUNT") : f(d && p !== h ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
2065
+ }
2066
+ }, [e, f]), ye(() => {
2067
+ if (t) {
2068
+ let l;
2069
+ const d = t.ownerDocument.defaultView ?? window, u = (h) => {
2070
+ const m = Ue(r.current).includes(h.animationName);
2071
+ if (h.target === t && m && (f("ANIMATION_END"), !o.current)) {
2072
+ const g = t.style.animationFillMode;
2073
+ t.style.animationFillMode = "forwards", l = d.setTimeout(() => {
2074
+ t.style.animationFillMode === "forwards" && (t.style.animationFillMode = g);
2075
+ });
2076
+ }
2077
+ }, p = (h) => {
2078
+ h.target === t && (i.current = Ue(r.current));
2079
+ };
2080
+ return t.addEventListener("animationstart", p), t.addEventListener("animationcancel", u), t.addEventListener("animationend", u), () => {
2081
+ d.clearTimeout(l), t.removeEventListener("animationstart", p), t.removeEventListener("animationcancel", u), t.removeEventListener("animationend", u);
2082
+ };
2083
+ } else
2084
+ f("ANIMATION_END");
2085
+ }, [t, f]), {
2086
+ isPresent: ["mounted", "unmountSuspended"].includes(s),
2087
+ ref: a.useCallback((l) => {
2088
+ l && (r.current = getComputedStyle(l)), n(l);
2089
+ }, [])
2090
+ };
2091
+ }
2092
+ function Ue(e) {
2093
+ return (e == null ? void 0 : e.animationName) || "none";
2094
+ }
2095
+ function Ui(e) {
2096
+ var r, o;
2097
+ let t = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning;
2098
+ return n ? e.ref : (t = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
2099
+ }
2100
+ function Ki(e, t = []) {
2101
+ let n = [];
2102
+ function r(i, c) {
2103
+ const s = a.createContext(c), f = n.length;
2104
+ n = [...n, c];
2105
+ function l(u) {
2106
+ const { scope: p, children: h, ...v } = u, m = (p == null ? void 0 : p[e][f]) || s, g = a.useMemo(() => v, Object.values(v));
2107
+ return /* @__PURE__ */ y(m.Provider, { value: g, children: h });
2108
+ }
2109
+ function d(u, p) {
2110
+ const h = (p == null ? void 0 : p[e][f]) || s, v = a.useContext(h);
2111
+ if (v)
2112
+ return v;
2113
+ if (c !== void 0)
2114
+ return c;
2115
+ throw new Error(`\`${u}\` must be used within \`${i}\``);
2116
+ }
2117
+ return l.displayName = i + "Provider", [l, d];
2118
+ }
2119
+ const o = () => {
2120
+ const i = n.map((c) => a.createContext(c));
2121
+ return function(s) {
2122
+ const f = (s == null ? void 0 : s[e]) || i;
2123
+ return a.useMemo(
2124
+ () => ({ [`__scope${e}`]: { ...s, [e]: f } }),
2125
+ [s, f]
2126
+ );
2127
+ };
2128
+ };
2129
+ return o.scopeName = e, [r, Gi(o, ...t)];
2130
+ }
2131
+ function Gi(...e) {
2132
+ const t = e[0];
2133
+ if (e.length === 1)
2134
+ return t;
2135
+ const n = () => {
2136
+ const r = e.map((o) => ({
2137
+ useScope: o(),
2138
+ scopeName: o.scopeName
2139
+ }));
2140
+ return function(i) {
2141
+ const c = r.reduce((s, { useScope: f, scopeName: l }) => {
2142
+ const u = f(i)[`__scope${l}`];
2143
+ return { ...s, ...u };
2144
+ }, {});
2145
+ return a.useMemo(() => ({ [`__scope${t.scopeName}`]: c }), [c]);
2146
+ };
2147
+ };
2148
+ return n.scopeName = t.scopeName, n;
2149
+ }
2150
+ var mt = "rovingFocusGroup.onEntryFocus", Vi = { bubbles: !1, cancelable: !0 }, it = "RovingFocusGroup", [Rt, zn, Hi] = xn(it), [Yi, Zn] = Ki(
2151
+ it,
2152
+ [Hi]
2153
+ ), [ji, Xi] = Yi(it), qn = a.forwardRef(
2154
+ (e, t) => /* @__PURE__ */ y(Rt.Provider, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ y(Rt.Slot, { scope: e.__scopeRovingFocusGroup, children: /* @__PURE__ */ y(zi, { ...e, ref: t }) }) })
2155
+ );
2156
+ qn.displayName = it;
2157
+ var zi = a.forwardRef((e, t) => {
2158
+ const {
2159
+ __scopeRovingFocusGroup: n,
2160
+ orientation: r,
2161
+ loop: o = !1,
2162
+ dir: i,
2163
+ currentTabStopId: c,
2164
+ defaultCurrentTabStopId: s,
2165
+ onCurrentTabStopIdChange: f,
2166
+ onEntryFocus: l,
2167
+ preventScrollOnEntryFocus: d = !1,
2168
+ ...u
2169
+ } = e, p = a.useRef(null), h = G(t, p), v = Cn(i), [m = null, g] = gn({
2170
+ prop: c,
2171
+ defaultProp: s,
2172
+ onChange: f
2173
+ }), [w, b] = a.useState(!1), x = ne(l), C = zn(n), E = a.useRef(!1), [M, R] = a.useState(0);
2174
+ return a.useEffect(() => {
2175
+ const P = p.current;
2176
+ if (P)
2177
+ return P.addEventListener(mt, x), () => P.removeEventListener(mt, x);
2178
+ }, [x]), /* @__PURE__ */ y(
2179
+ ji,
2180
+ {
2181
+ scope: n,
2182
+ orientation: r,
2183
+ dir: v,
2184
+ loop: o,
2185
+ currentTabStopId: m,
2186
+ onItemFocus: a.useCallback(
2187
+ (P) => g(P),
2188
+ [g]
2189
+ ),
2190
+ onItemShiftTab: a.useCallback(() => b(!0), []),
2191
+ onFocusableItemAdd: a.useCallback(
2192
+ () => R((P) => P + 1),
2193
+ []
2194
+ ),
2195
+ onFocusableItemRemove: a.useCallback(
2196
+ () => R((P) => P - 1),
2197
+ []
2198
+ ),
2199
+ children: /* @__PURE__ */ y(
2200
+ U.div,
2201
+ {
2202
+ tabIndex: w || M === 0 ? -1 : 0,
2203
+ "data-orientation": r,
2204
+ ...u,
2205
+ ref: h,
2206
+ style: { outline: "none", ...e.style },
2207
+ onMouseDown: O(e.onMouseDown, () => {
2208
+ E.current = !0;
2209
+ }),
2210
+ onFocus: O(e.onFocus, (P) => {
2211
+ const D = !E.current;
2212
+ if (P.target === P.currentTarget && D && !w) {
2213
+ const _ = new CustomEvent(mt, Vi);
2214
+ if (P.currentTarget.dispatchEvent(_), !_.defaultPrevented) {
2215
+ const F = C().filter((T) => T.focusable), k = F.find((T) => T.active), I = F.find((T) => T.id === m), B = [k, I, ...F].filter(
2216
+ Boolean
2217
+ ).map((T) => T.ref.current);
2218
+ er(B, d);
2219
+ }
2220
+ }
2221
+ E.current = !1;
2222
+ }),
2223
+ onBlur: O(e.onBlur, () => b(!1))
2224
+ }
2225
+ )
2226
+ }
2227
+ );
2228
+ }), Qn = "RovingFocusGroupItem", Jn = a.forwardRef(
2229
+ (e, t) => {
2230
+ const {
2231
+ __scopeRovingFocusGroup: n,
2232
+ focusable: r = !0,
2233
+ active: o = !1,
2234
+ tabStopId: i,
2235
+ ...c
2236
+ } = e, s = xt(), f = i || s, l = Xi(Qn, n), d = l.currentTabStopId === f, u = zn(n), { onFocusableItemAdd: p, onFocusableItemRemove: h } = l;
2237
+ return a.useEffect(() => {
2238
+ if (r)
2239
+ return p(), () => h();
2240
+ }, [r, p, h]), /* @__PURE__ */ y(
2241
+ Rt.ItemSlot,
2242
+ {
2243
+ scope: n,
2244
+ id: f,
2245
+ focusable: r,
2246
+ active: o,
2247
+ children: /* @__PURE__ */ y(
2248
+ U.span,
2249
+ {
2250
+ tabIndex: d ? 0 : -1,
2251
+ "data-orientation": l.orientation,
2252
+ ...c,
2253
+ ref: t,
2254
+ onMouseDown: O(e.onMouseDown, (v) => {
2255
+ r ? l.onItemFocus(f) : v.preventDefault();
2256
+ }),
2257
+ onFocus: O(e.onFocus, () => l.onItemFocus(f)),
2258
+ onKeyDown: O(e.onKeyDown, (v) => {
2259
+ if (v.key === "Tab" && v.shiftKey) {
2260
+ l.onItemShiftTab();
2261
+ return;
2262
+ }
2263
+ if (v.target !== v.currentTarget)
2264
+ return;
2265
+ const m = Qi(v, l.orientation, l.dir);
2266
+ if (m !== void 0) {
2267
+ if (v.metaKey || v.ctrlKey || v.altKey || v.shiftKey)
2268
+ return;
2269
+ v.preventDefault();
2270
+ let w = u().filter((b) => b.focusable).map((b) => b.ref.current);
2271
+ if (m === "last")
2272
+ w.reverse();
2273
+ else if (m === "prev" || m === "next") {
2274
+ m === "prev" && w.reverse();
2275
+ const b = w.indexOf(v.currentTarget);
2276
+ w = l.loop ? Ji(w, b + 1) : w.slice(b + 1);
2277
+ }
2278
+ setTimeout(() => er(w));
2279
+ }
2280
+ })
2281
+ }
2282
+ )
2283
+ }
2284
+ );
2285
+ }
2286
+ );
2287
+ Jn.displayName = Qn;
2288
+ var Zi = {
2289
+ ArrowLeft: "prev",
2290
+ ArrowUp: "prev",
2291
+ ArrowRight: "next",
2292
+ ArrowDown: "next",
2293
+ PageUp: "first",
2294
+ Home: "first",
2295
+ PageDown: "last",
2296
+ End: "last"
2297
+ };
2298
+ function qi(e, t) {
2299
+ return t !== "rtl" ? e : e === "ArrowLeft" ? "ArrowRight" : e === "ArrowRight" ? "ArrowLeft" : e;
2300
+ }
2301
+ function Qi(e, t, n) {
2302
+ const r = qi(e.key, n);
2303
+ if (!(t === "vertical" && ["ArrowLeft", "ArrowRight"].includes(r)) && !(t === "horizontal" && ["ArrowUp", "ArrowDown"].includes(r)))
2304
+ return Zi[r];
2305
+ }
2306
+ function er(e, t = !1) {
2307
+ const n = document.activeElement;
2308
+ for (const r of e)
2309
+ if (r === n || (r.focus({ preventScroll: t }), document.activeElement !== n))
2310
+ return;
2311
+ }
2312
+ function Ji(e, t) {
2313
+ return e.map((n, r) => e[(t + r) % e.length]);
2314
+ }
2315
+ var ec = qn, tc = Jn, nc = function(e) {
2316
+ if (typeof document > "u")
2317
+ return null;
2318
+ var t = Array.isArray(e) ? e[0] : e;
2319
+ return t.ownerDocument.body;
2320
+ }, me = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Ge = {}, ht = 0, tr = function(e) {
2321
+ return e && (e.host || tr(e.parentNode));
2322
+ }, rc = function(e, t) {
2323
+ return t.map(function(n) {
2324
+ if (e.contains(n))
2325
+ return n;
2326
+ var r = tr(n);
2327
+ return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
2328
+ }).filter(function(n) {
2329
+ return !!n;
2330
+ });
2331
+ }, oc = function(e, t, n, r) {
2332
+ var o = rc(t, Array.isArray(e) ? e : [e]);
2333
+ Ge[n] || (Ge[n] = /* @__PURE__ */ new WeakMap());
2334
+ var i = Ge[n], c = [], s = /* @__PURE__ */ new Set(), f = new Set(o), l = function(u) {
2335
+ !u || s.has(u) || (s.add(u), l(u.parentNode));
2336
+ };
2337
+ o.forEach(l);
2338
+ var d = function(u) {
2339
+ !u || f.has(u) || Array.prototype.forEach.call(u.children, function(p) {
2340
+ if (s.has(p))
2341
+ d(p);
2342
+ else
2343
+ try {
2344
+ var h = p.getAttribute(r), v = h !== null && h !== "false", m = (me.get(p) || 0) + 1, g = (i.get(p) || 0) + 1;
2345
+ me.set(p, m), i.set(p, g), c.push(p), m === 1 && v && Ke.set(p, !0), g === 1 && p.setAttribute(n, "true"), v || p.setAttribute(r, "true");
2346
+ } catch (w) {
2347
+ console.error("aria-hidden: cannot operate on ", p, w);
2348
+ }
2349
+ });
2350
+ };
2351
+ return d(t), s.clear(), ht++, function() {
2352
+ c.forEach(function(u) {
2353
+ var p = me.get(u) - 1, h = i.get(u) - 1;
2354
+ me.set(u, p), i.set(u, h), p || (Ke.has(u) || u.removeAttribute(r), Ke.delete(u)), h || u.removeAttribute(n);
2355
+ }), ht--, ht || (me = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), Ke = /* @__PURE__ */ new WeakMap(), Ge = {});
2356
+ };
2357
+ }, ic = function(e, t, n) {
2358
+ n === void 0 && (n = "data-aria-hidden");
2359
+ var r = Array.from(Array.isArray(e) ? e : [e]), o = t || nc(e);
2360
+ return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live]"))), oc(r, o, n, "aria-hidden")) : function() {
2361
+ return null;
2362
+ };
2363
+ }, q = function() {
2364
+ return q = Object.assign || function(t) {
2365
+ for (var n, r = 1, o = arguments.length; r < o; r++) {
2366
+ n = arguments[r];
2367
+ for (var i in n)
2368
+ Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
2369
+ }
2370
+ return t;
2371
+ }, q.apply(this, arguments);
2372
+ };
2373
+ function nr(e, t) {
2374
+ var n = {};
2375
+ for (var r in e)
2376
+ Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
2377
+ if (e != null && typeof Object.getOwnPropertySymbols == "function")
2378
+ for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
2379
+ t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
2380
+ return n;
2381
+ }
2382
+ function cc(e, t, n) {
2383
+ if (n || arguments.length === 2)
2384
+ for (var r = 0, o = t.length, i; r < o; r++)
2385
+ (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
2386
+ return e.concat(i || Array.prototype.slice.call(t));
2387
+ }
2388
+ var je = "right-scroll-bar-position", Xe = "width-before-scroll-bar", sc = "with-scroll-bars-hidden", ac = "--removed-body-scroll-bar-size";
2389
+ function vt(e, t) {
2390
+ return typeof e == "function" ? e(t) : e && (e.current = t), e;
2391
+ }
2392
+ function uc(e, t) {
2393
+ var n = zr(function() {
2394
+ return {
2395
+ // value
2396
+ value: e,
2397
+ // last callback
2398
+ callback: t,
2399
+ // "memoized" public interface
2400
+ facade: {
2401
+ get current() {
2402
+ return n.value;
2403
+ },
2404
+ set current(r) {
2405
+ var o = n.value;
2406
+ o !== r && (n.value = r, n.callback(r, o));
2407
+ }
2408
+ }
2409
+ };
2410
+ })[0];
2411
+ return n.callback = t, n.facade;
2412
+ }
2413
+ var lc = typeof window < "u" ? a.useLayoutEffect : a.useEffect, ln = /* @__PURE__ */ new WeakMap();
2414
+ function fc(e, t) {
2415
+ var n = uc(t || null, function(r) {
2416
+ return e.forEach(function(o) {
2417
+ return vt(o, r);
2418
+ });
2419
+ });
2420
+ return lc(function() {
2421
+ var r = ln.get(n);
2422
+ if (r) {
2423
+ var o = new Set(r), i = new Set(e), c = n.current;
2424
+ o.forEach(function(s) {
2425
+ i.has(s) || vt(s, null);
2426
+ }), i.forEach(function(s) {
2427
+ o.has(s) || vt(s, c);
2428
+ });
2429
+ }
2430
+ ln.set(n, e);
2431
+ }, [e]), n;
2432
+ }
2433
+ function dc(e) {
2434
+ return e;
2435
+ }
2436
+ function pc(e, t) {
2437
+ t === void 0 && (t = dc);
2438
+ var n = [], r = !1, o = {
2439
+ read: function() {
2440
+ if (r)
2441
+ throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
2442
+ return n.length ? n[n.length - 1] : e;
2443
+ },
2444
+ useMedium: function(i) {
2445
+ var c = t(i, r);
2446
+ return n.push(c), function() {
2447
+ n = n.filter(function(s) {
2448
+ return s !== c;
2449
+ });
2450
+ };
2451
+ },
2452
+ assignSyncMedium: function(i) {
2453
+ for (r = !0; n.length; ) {
2454
+ var c = n;
2455
+ n = [], c.forEach(i);
2456
+ }
2457
+ n = {
2458
+ push: function(s) {
2459
+ return i(s);
2460
+ },
2461
+ filter: function() {
2462
+ return n;
2463
+ }
2464
+ };
2465
+ },
2466
+ assignMedium: function(i) {
2467
+ r = !0;
2468
+ var c = [];
2469
+ if (n.length) {
2470
+ var s = n;
2471
+ n = [], s.forEach(i), c = n;
2472
+ }
2473
+ var f = function() {
2474
+ var d = c;
2475
+ c = [], d.forEach(i);
2476
+ }, l = function() {
2477
+ return Promise.resolve().then(f);
2478
+ };
2479
+ l(), n = {
2480
+ push: function(d) {
2481
+ c.push(d), l();
2482
+ },
2483
+ filter: function(d) {
2484
+ return c = c.filter(d), n;
2485
+ }
2486
+ };
2487
+ }
2488
+ };
2489
+ return o;
2490
+ }
2491
+ function mc(e) {
2492
+ e === void 0 && (e = {});
2493
+ var t = pc(null);
2494
+ return t.options = q({ async: !0, ssr: !1 }, e), t;
2495
+ }
2496
+ var rr = function(e) {
2497
+ var t = e.sideCar, n = nr(e, ["sideCar"]);
2498
+ if (!t)
2499
+ throw new Error("Sidecar: please provide `sideCar` property to import the right car");
2500
+ var r = t.read();
2501
+ if (!r)
2502
+ throw new Error("Sidecar medium not found");
2503
+ return a.createElement(r, q({}, n));
2504
+ };
2505
+ rr.isSideCarExport = !0;
2506
+ function hc(e, t) {
2507
+ return e.useMedium(t), rr;
2508
+ }
2509
+ var or = mc(), gt = function() {
2510
+ }, ct = a.forwardRef(function(e, t) {
2511
+ var n = a.useRef(null), r = a.useState({
2512
+ onScrollCapture: gt,
2513
+ onWheelCapture: gt,
2514
+ onTouchMoveCapture: gt
2515
+ }), o = r[0], i = r[1], c = e.forwardProps, s = e.children, f = e.className, l = e.removeScrollBar, d = e.enabled, u = e.shards, p = e.sideCar, h = e.noIsolation, v = e.inert, m = e.allowPinchZoom, g = e.as, w = g === void 0 ? "div" : g, b = e.gapMode, x = nr(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), C = p, E = fc([n, t]), M = q(q({}, x), o);
2516
+ return a.createElement(
2517
+ a.Fragment,
2518
+ null,
2519
+ d && a.createElement(C, { sideCar: or, removeScrollBar: l, shards: u, noIsolation: h, inert: v, setCallbacks: i, allowPinchZoom: !!m, lockRef: n, gapMode: b }),
2520
+ c ? a.cloneElement(a.Children.only(s), q(q({}, M), { ref: E })) : a.createElement(w, q({}, M, { className: f, ref: E }), s)
2521
+ );
2522
+ });
2523
+ ct.defaultProps = {
2524
+ enabled: !0,
2525
+ removeScrollBar: !0,
2526
+ inert: !1
2527
+ };
2528
+ ct.classNames = {
2529
+ fullWidth: Xe,
2530
+ zeroRight: je
2531
+ };
2532
+ var fn, vc = function() {
2533
+ if (fn)
2534
+ return fn;
2535
+ if (typeof __webpack_nonce__ < "u")
2536
+ return __webpack_nonce__;
2537
+ };
2538
+ function gc() {
2539
+ if (!document)
2540
+ return null;
2541
+ var e = document.createElement("style");
2542
+ e.type = "text/css";
2543
+ var t = vc();
2544
+ return t && e.setAttribute("nonce", t), e;
2545
+ }
2546
+ function wc(e, t) {
2547
+ e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
2548
+ }
2549
+ function yc(e) {
2550
+ var t = document.head || document.getElementsByTagName("head")[0];
2551
+ t.appendChild(e);
2552
+ }
2553
+ var bc = function() {
2554
+ var e = 0, t = null;
2555
+ return {
2556
+ add: function(n) {
2557
+ e == 0 && (t = gc()) && (wc(t, n), yc(t)), e++;
2558
+ },
2559
+ remove: function() {
2560
+ e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
2561
+ }
2562
+ };
2563
+ }, xc = function() {
2564
+ var e = bc();
2565
+ return function(t, n) {
2566
+ a.useEffect(function() {
2567
+ return e.add(t), function() {
2568
+ e.remove();
2569
+ };
2570
+ }, [t && n]);
2571
+ };
2572
+ }, ir = function() {
2573
+ var e = xc(), t = function(n) {
2574
+ var r = n.styles, o = n.dynamic;
2575
+ return e(r, o), null;
2576
+ };
2577
+ return t;
2578
+ }, Cc = {
2579
+ left: 0,
2580
+ top: 0,
2581
+ right: 0,
2582
+ gap: 0
2583
+ }, wt = function(e) {
2584
+ return parseInt(e || "", 10) || 0;
2585
+ }, Ec = function(e) {
2586
+ var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
2587
+ return [wt(n), wt(r), wt(o)];
2588
+ }, Sc = function(e) {
2589
+ if (e === void 0 && (e = "margin"), typeof window > "u")
2590
+ return Cc;
2591
+ var t = Ec(e), n = document.documentElement.clientWidth, r = window.innerWidth;
2592
+ return {
2593
+ left: t[0],
2594
+ top: t[1],
2595
+ right: t[2],
2596
+ gap: Math.max(0, r - n + t[2] - t[0])
2597
+ };
2598
+ }, Rc = ir(), we = "data-scroll-locked", Mc = function(e, t, n, r) {
2599
+ var o = e.left, i = e.top, c = e.right, s = e.gap;
2600
+ return n === void 0 && (n = "margin"), `
2601
+ .`.concat(sc, ` {
2602
+ overflow: hidden `).concat(r, `;
2603
+ padding-right: `).concat(s, "px ").concat(r, `;
2604
+ }
2605
+ body[`).concat(we, `] {
2606
+ overflow: hidden `).concat(r, `;
2607
+ overscroll-behavior: contain;
2608
+ `).concat([
2609
+ t && "position: relative ".concat(r, ";"),
2610
+ n === "margin" && `
2611
+ padding-left: `.concat(o, `px;
2612
+ padding-top: `).concat(i, `px;
2613
+ padding-right: `).concat(c, `px;
2614
+ margin-left:0;
2615
+ margin-top:0;
2616
+ margin-right: `).concat(s, "px ").concat(r, `;
2617
+ `),
2618
+ n === "padding" && "padding-right: ".concat(s, "px ").concat(r, ";")
2619
+ ].filter(Boolean).join(""), `
2620
+ }
2621
+
2622
+ .`).concat(je, ` {
2623
+ right: `).concat(s, "px ").concat(r, `;
2624
+ }
2625
+
2626
+ .`).concat(Xe, ` {
2627
+ margin-right: `).concat(s, "px ").concat(r, `;
2628
+ }
2629
+
2630
+ .`).concat(je, " .").concat(je, ` {
2631
+ right: 0 `).concat(r, `;
2632
+ }
2633
+
2634
+ .`).concat(Xe, " .").concat(Xe, ` {
2635
+ margin-right: 0 `).concat(r, `;
2636
+ }
2637
+
2638
+ body[`).concat(we, `] {
2639
+ `).concat(ac, ": ").concat(s, `px;
2640
+ }
2641
+ `);
2642
+ }, dn = function() {
2643
+ var e = parseInt(document.body.getAttribute(we) || "0", 10);
2644
+ return isFinite(e) ? e : 0;
2645
+ }, Pc = function() {
2646
+ a.useEffect(function() {
2647
+ return document.body.setAttribute(we, (dn() + 1).toString()), function() {
2648
+ var e = dn() - 1;
2649
+ e <= 0 ? document.body.removeAttribute(we) : document.body.setAttribute(we, e.toString());
2650
+ };
2651
+ }, []);
2652
+ }, Ac = function(e) {
2653
+ var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
2654
+ Pc();
2655
+ var i = a.useMemo(function() {
2656
+ return Sc(o);
2657
+ }, [o]);
2658
+ return a.createElement(Rc, { styles: Mc(i, !t, o, n ? "" : "!important") });
2659
+ }, Mt = !1;
2660
+ if (typeof window < "u")
2661
+ try {
2662
+ var Ve = Object.defineProperty({}, "passive", {
2663
+ get: function() {
2664
+ return Mt = !0, !0;
2665
+ }
2666
+ });
2667
+ window.addEventListener("test", Ve, Ve), window.removeEventListener("test", Ve, Ve);
2668
+ } catch {
2669
+ Mt = !1;
2670
+ }
2671
+ var he = Mt ? { passive: !1 } : !1, Oc = function(e) {
2672
+ return e.tagName === "TEXTAREA";
2673
+ }, cr = function(e, t) {
2674
+ if (!(e instanceof Element))
2675
+ return !1;
2676
+ var n = window.getComputedStyle(e);
2677
+ return (
2678
+ // not-not-scrollable
2679
+ n[t] !== "hidden" && // contains scroll inside self
2680
+ !(n.overflowY === n.overflowX && !Oc(e) && n[t] === "visible")
2681
+ );
2682
+ }, _c = function(e) {
2683
+ return cr(e, "overflowY");
2684
+ }, Tc = function(e) {
2685
+ return cr(e, "overflowX");
2686
+ }, pn = function(e, t) {
2687
+ var n = t.ownerDocument, r = t;
2688
+ do {
2689
+ typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
2690
+ var o = sr(e, r);
2691
+ if (o) {
2692
+ var i = ar(e, r), c = i[1], s = i[2];
2693
+ if (c > s)
2694
+ return !0;
2695
+ }
2696
+ r = r.parentNode;
2697
+ } while (r && r !== n.body);
2698
+ return !1;
2699
+ }, Dc = function(e) {
2700
+ var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
2701
+ return [
2702
+ t,
2703
+ n,
2704
+ r
2705
+ ];
2706
+ }, Nc = function(e) {
2707
+ var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
2708
+ return [
2709
+ t,
2710
+ n,
2711
+ r
2712
+ ];
2713
+ }, sr = function(e, t) {
2714
+ return e === "v" ? _c(t) : Tc(t);
2715
+ }, ar = function(e, t) {
2716
+ return e === "v" ? Dc(t) : Nc(t);
2717
+ }, Ic = function(e, t) {
2718
+ return e === "h" && t === "rtl" ? -1 : 1;
2719
+ }, Lc = function(e, t, n, r, o) {
2720
+ var i = Ic(e, window.getComputedStyle(t).direction), c = i * r, s = n.target, f = t.contains(s), l = !1, d = c > 0, u = 0, p = 0;
2721
+ do {
2722
+ var h = ar(e, s), v = h[0], m = h[1], g = h[2], w = m - g - i * v;
2723
+ (v || w) && sr(e, s) && (u += w, p += v), s instanceof ShadowRoot ? s = s.host : s = s.parentNode;
2724
+ } while (
2725
+ // portaled content
2726
+ !f && s !== document.body || // self content
2727
+ f && (t.contains(s) || t === s)
2728
+ );
2729
+ return (d && (o && Math.abs(u) < 1 || !o && c > u) || !d && (o && Math.abs(p) < 1 || !o && -c > p)) && (l = !0), l;
2730
+ }, He = function(e) {
2731
+ return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
2732
+ }, mn = function(e) {
2733
+ return [e.deltaX, e.deltaY];
2734
+ }, hn = function(e) {
2735
+ return e && "current" in e ? e.current : e;
2736
+ }, Fc = function(e, t) {
2737
+ return e[0] === t[0] && e[1] === t[1];
2738
+ }, kc = function(e) {
2739
+ return `
2740
+ .block-interactivity-`.concat(e, ` {pointer-events: none;}
2741
+ .allow-interactivity-`).concat(e, ` {pointer-events: all;}
2742
+ `);
2743
+ }, $c = 0, ve = [];
2744
+ function Bc(e) {
2745
+ var t = a.useRef([]), n = a.useRef([0, 0]), r = a.useRef(), o = a.useState($c++)[0], i = a.useState(ir)[0], c = a.useRef(e);
2746
+ a.useEffect(function() {
2747
+ c.current = e;
2748
+ }, [e]), a.useEffect(function() {
2749
+ if (e.inert) {
2750
+ document.body.classList.add("block-interactivity-".concat(o));
2751
+ var m = cc([e.lockRef.current], (e.shards || []).map(hn), !0).filter(Boolean);
2752
+ return m.forEach(function(g) {
2753
+ return g.classList.add("allow-interactivity-".concat(o));
2754
+ }), function() {
2755
+ document.body.classList.remove("block-interactivity-".concat(o)), m.forEach(function(g) {
2756
+ return g.classList.remove("allow-interactivity-".concat(o));
2757
+ });
2758
+ };
2759
+ }
2760
+ }, [e.inert, e.lockRef.current, e.shards]);
2761
+ var s = a.useCallback(function(m, g) {
2762
+ if ("touches" in m && m.touches.length === 2 || m.type === "wheel" && m.ctrlKey)
2763
+ return !c.current.allowPinchZoom;
2764
+ var w = He(m), b = n.current, x = "deltaX" in m ? m.deltaX : b[0] - w[0], C = "deltaY" in m ? m.deltaY : b[1] - w[1], E, M = m.target, R = Math.abs(x) > Math.abs(C) ? "h" : "v";
2765
+ if ("touches" in m && R === "h" && M.type === "range")
2766
+ return !1;
2767
+ var P = pn(R, M);
2768
+ if (!P)
2769
+ return !0;
2770
+ if (P ? E = R : (E = R === "v" ? "h" : "v", P = pn(R, M)), !P)
2771
+ return !1;
2772
+ if (!r.current && "changedTouches" in m && (x || C) && (r.current = E), !E)
2773
+ return !0;
2774
+ var D = r.current || E;
2775
+ return Lc(D, g, m, D === "h" ? x : C, !0);
2776
+ }, []), f = a.useCallback(function(m) {
2777
+ var g = m;
2778
+ if (!(!ve.length || ve[ve.length - 1] !== i)) {
2779
+ var w = "deltaY" in g ? mn(g) : He(g), b = t.current.filter(function(E) {
2780
+ return E.name === g.type && (E.target === g.target || g.target === E.shadowParent) && Fc(E.delta, w);
2781
+ })[0];
2782
+ if (b && b.should) {
2783
+ g.cancelable && g.preventDefault();
2784
+ return;
2785
+ }
2786
+ if (!b) {
2787
+ var x = (c.current.shards || []).map(hn).filter(Boolean).filter(function(E) {
2788
+ return E.contains(g.target);
2789
+ }), C = x.length > 0 ? s(g, x[0]) : !c.current.noIsolation;
2790
+ C && g.cancelable && g.preventDefault();
2791
+ }
2792
+ }
2793
+ }, []), l = a.useCallback(function(m, g, w, b) {
2794
+ var x = { name: m, delta: g, target: w, should: b, shadowParent: Wc(w) };
2795
+ t.current.push(x), setTimeout(function() {
2796
+ t.current = t.current.filter(function(C) {
2797
+ return C !== x;
2798
+ });
2799
+ }, 1);
2800
+ }, []), d = a.useCallback(function(m) {
2801
+ n.current = He(m), r.current = void 0;
2802
+ }, []), u = a.useCallback(function(m) {
2803
+ l(m.type, mn(m), m.target, s(m, e.lockRef.current));
2804
+ }, []), p = a.useCallback(function(m) {
2805
+ l(m.type, He(m), m.target, s(m, e.lockRef.current));
2806
+ }, []);
2807
+ a.useEffect(function() {
2808
+ return ve.push(i), e.setCallbacks({
2809
+ onScrollCapture: u,
2810
+ onWheelCapture: u,
2811
+ onTouchMoveCapture: p
2812
+ }), document.addEventListener("wheel", f, he), document.addEventListener("touchmove", f, he), document.addEventListener("touchstart", d, he), function() {
2813
+ ve = ve.filter(function(m) {
2814
+ return m !== i;
2815
+ }), document.removeEventListener("wheel", f, he), document.removeEventListener("touchmove", f, he), document.removeEventListener("touchstart", d, he);
2816
+ };
2817
+ }, []);
2818
+ var h = e.removeScrollBar, v = e.inert;
2819
+ return a.createElement(
2820
+ a.Fragment,
2821
+ null,
2822
+ v ? a.createElement(i, { styles: kc(o) }) : null,
2823
+ h ? a.createElement(Ac, { gapMode: e.gapMode }) : null
2824
+ );
2825
+ }
2826
+ function Wc(e) {
2827
+ for (var t = null; e !== null; )
2828
+ e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
2829
+ return t;
2830
+ }
2831
+ const Uc = hc(or, Bc);
2832
+ var ur = a.forwardRef(function(e, t) {
2833
+ return a.createElement(ct, q({}, e, { ref: t, sideCar: Uc }));
2834
+ });
2835
+ ur.classNames = ct.classNames;
2836
+ const Kc = ur;
2837
+ var Pt = ["Enter", " "], Gc = ["ArrowDown", "PageUp", "Home"], lr = ["ArrowUp", "PageDown", "End"], Vc = [...Gc, ...lr], Hc = {
2838
+ ltr: [...Pt, "ArrowRight"],
2839
+ rtl: [...Pt, "ArrowLeft"]
2840
+ }, Yc = {
2841
+ ltr: ["ArrowLeft"],
2842
+ rtl: ["ArrowRight"]
2843
+ }, Fe = "Menu", [De, jc, Xc] = xn(Fe), [de, fr] = wn(Fe, [
2844
+ Xc,
2845
+ Bn,
2846
+ Zn
2847
+ ]), st = Bn(), dr = Zn(), [zc, pe] = de(Fe), [Zc, ke] = de(Fe), pr = (e) => {
2848
+ const { __scopeMenu: t, open: n = !1, children: r, dir: o, onOpenChange: i, modal: c = !0 } = e, s = st(t), [f, l] = a.useState(null), d = a.useRef(!1), u = ne(i), p = Cn(o);
2849
+ return a.useEffect(() => {
2850
+ const h = () => {
2851
+ d.current = !0, document.addEventListener("pointerdown", v, { capture: !0, once: !0 }), document.addEventListener("pointermove", v, { capture: !0, once: !0 });
2852
+ }, v = () => d.current = !1;
2853
+ return document.addEventListener("keydown", h, { capture: !0 }), () => {
2854
+ document.removeEventListener("keydown", h, { capture: !0 }), document.removeEventListener("pointerdown", v, { capture: !0 }), document.removeEventListener("pointermove", v, { capture: !0 });
2855
+ };
2856
+ }, []), /* @__PURE__ */ y(Ii, { ...s, children: /* @__PURE__ */ y(
2857
+ zc,
2858
+ {
2859
+ scope: t,
2860
+ open: n,
2861
+ onOpenChange: u,
2862
+ content: f,
2863
+ onContentChange: l,
2864
+ children: /* @__PURE__ */ y(
2865
+ Zc,
2866
+ {
2867
+ scope: t,
2868
+ onClose: a.useCallback(() => u(!1), [u]),
2869
+ isUsingKeyboardRef: d,
2870
+ dir: p,
2871
+ modal: c,
2872
+ children: r
2873
+ }
2874
+ )
2875
+ }
2876
+ ) });
2877
+ };
2878
+ pr.displayName = Fe;
2879
+ var qc = "MenuAnchor", kt = a.forwardRef(
2880
+ (e, t) => {
2881
+ const { __scopeMenu: n, ...r } = e, o = st(n);
2882
+ return /* @__PURE__ */ y(Li, { ...o, ...r, ref: t });
2883
+ }
2884
+ );
2885
+ kt.displayName = qc;
2886
+ var $t = "MenuPortal", [Qc, mr] = de($t, {
2887
+ forceMount: void 0
2888
+ }), hr = (e) => {
2889
+ const { __scopeMenu: t, forceMount: n, children: r, container: o } = e, i = pe($t, t);
2890
+ return /* @__PURE__ */ y(Qc, { scope: t, forceMount: n, children: /* @__PURE__ */ y(Le, { present: n || i.open, children: /* @__PURE__ */ y(Xn, { asChild: !0, container: o, children: r }) }) });
2891
+ };
2892
+ hr.displayName = $t;
2893
+ var j = "MenuContent", [Jc, Bt] = de(j), vr = a.forwardRef(
2894
+ (e, t) => {
2895
+ const n = mr(j, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, i = pe(j, e.__scopeMenu), c = ke(j, e.__scopeMenu);
2896
+ return /* @__PURE__ */ y(De.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ y(Le, { present: r || i.open, children: /* @__PURE__ */ y(De.Slot, { scope: e.__scopeMenu, children: c.modal ? /* @__PURE__ */ y(es, { ...o, ref: t }) : /* @__PURE__ */ y(ts, { ...o, ref: t }) }) }) });
2897
+ }
2898
+ ), es = a.forwardRef(
2899
+ (e, t) => {
2900
+ const n = pe(j, e.__scopeMenu), r = a.useRef(null), o = G(t, r);
2901
+ return a.useEffect(() => {
2902
+ const i = r.current;
2903
+ if (i)
2904
+ return ic(i);
2905
+ }, []), /* @__PURE__ */ y(
2906
+ Wt,
2907
+ {
2908
+ ...e,
2909
+ ref: o,
2910
+ trapFocus: n.open,
2911
+ disableOutsidePointerEvents: n.open,
2912
+ disableOutsideScroll: !0,
2913
+ onFocusOutside: O(
2914
+ e.onFocusOutside,
2915
+ (i) => i.preventDefault(),
2916
+ { checkForDefaultPrevented: !1 }
2917
+ ),
2918
+ onDismiss: () => n.onOpenChange(!1)
2919
+ }
2920
+ );
2921
+ }
2922
+ ), ts = a.forwardRef((e, t) => {
2923
+ const n = pe(j, e.__scopeMenu);
2924
+ return /* @__PURE__ */ y(
2925
+ Wt,
2926
+ {
2927
+ ...e,
2928
+ ref: t,
2929
+ trapFocus: !1,
2930
+ disableOutsidePointerEvents: !1,
2931
+ disableOutsideScroll: !1,
2932
+ onDismiss: () => n.onOpenChange(!1)
2933
+ }
2934
+ );
2935
+ }), Wt = a.forwardRef(
2936
+ (e, t) => {
2937
+ const {
2938
+ __scopeMenu: n,
2939
+ loop: r = !1,
2940
+ trapFocus: o,
2941
+ onOpenAutoFocus: i,
2942
+ onCloseAutoFocus: c,
2943
+ disableOutsidePointerEvents: s,
2944
+ onEntryFocus: f,
2945
+ onEscapeKeyDown: l,
2946
+ onPointerDownOutside: d,
2947
+ onFocusOutside: u,
2948
+ onInteractOutside: p,
2949
+ onDismiss: h,
2950
+ disableOutsideScroll: v,
2951
+ ...m
2952
+ } = e, g = pe(j, n), w = ke(j, n), b = st(n), x = dr(n), C = jc(n), [E, M] = a.useState(null), R = a.useRef(null), P = G(t, R, g.onContentChange), D = a.useRef(0), _ = a.useRef(""), F = a.useRef(0), k = a.useRef(null), I = a.useRef("right"), N = a.useRef(0), B = v ? Kc : a.Fragment, T = v ? { as: Oe, allowPinchZoom: !0 } : void 0, $ = (S) => {
2953
+ var te, Re;
2954
+ const L = _.current + S, W = C().filter((Y) => !Y.disabled), Z = document.activeElement, Ee = (te = W.find((Y) => Y.ref.current === Z)) == null ? void 0 : te.textValue, Se = W.map((Y) => Y.textValue), $e = ps(Se, L, Ee), ue = (Re = W.find((Y) => Y.textValue === $e)) == null ? void 0 : Re.ref.current;
2955
+ (function Y(Me) {
2956
+ _.current = Me, window.clearTimeout(D.current), Me !== "" && (D.current = window.setTimeout(() => Y(""), 1e3));
2957
+ })(L), ue && setTimeout(() => ue.focus());
2958
+ };
2959
+ a.useEffect(() => () => window.clearTimeout(D.current), []), go();
2960
+ const A = a.useCallback((S) => {
2961
+ var W, Z;
2962
+ return I.current === ((W = k.current) == null ? void 0 : W.side) && hs(S, (Z = k.current) == null ? void 0 : Z.area);
2963
+ }, []);
2964
+ return /* @__PURE__ */ y(
2965
+ Jc,
2966
+ {
2967
+ scope: n,
2968
+ searchRef: _,
2969
+ onItemEnter: a.useCallback(
2970
+ (S) => {
2971
+ A(S) && S.preventDefault();
2972
+ },
2973
+ [A]
2974
+ ),
2975
+ onItemLeave: a.useCallback(
2976
+ (S) => {
2977
+ var L;
2978
+ A(S) || ((L = R.current) == null || L.focus(), M(null));
2979
+ },
2980
+ [A]
2981
+ ),
2982
+ onTriggerLeave: a.useCallback(
2983
+ (S) => {
2984
+ A(S) && S.preventDefault();
2985
+ },
2986
+ [A]
2987
+ ),
2988
+ pointerGraceTimerRef: F,
2989
+ onPointerGraceIntentChange: a.useCallback((S) => {
2990
+ k.current = S;
2991
+ }, []),
2992
+ children: /* @__PURE__ */ y(B, { ...T, children: /* @__PURE__ */ y(
2993
+ Mn,
2994
+ {
2995
+ asChild: !0,
2996
+ trapped: o,
2997
+ onMountAutoFocus: O(i, (S) => {
2998
+ var L;
2999
+ S.preventDefault(), (L = R.current) == null || L.focus({ preventScroll: !0 });
3000
+ }),
3001
+ onUnmountAutoFocus: c,
3002
+ children: /* @__PURE__ */ y(
3003
+ Sn,
3004
+ {
3005
+ asChild: !0,
3006
+ disableOutsidePointerEvents: s,
3007
+ onEscapeKeyDown: l,
3008
+ onPointerDownOutside: d,
3009
+ onFocusOutside: u,
3010
+ onInteractOutside: p,
3011
+ onDismiss: h,
3012
+ children: /* @__PURE__ */ y(
3013
+ ec,
3014
+ {
3015
+ asChild: !0,
3016
+ ...x,
3017
+ dir: w.dir,
3018
+ orientation: "vertical",
3019
+ loop: r,
3020
+ currentTabStopId: E,
3021
+ onCurrentTabStopIdChange: M,
3022
+ onEntryFocus: O(f, (S) => {
3023
+ w.isUsingKeyboardRef.current || S.preventDefault();
3024
+ }),
3025
+ preventScrollOnEntryFocus: !0,
3026
+ children: /* @__PURE__ */ y(
3027
+ Fi,
3028
+ {
3029
+ role: "menu",
3030
+ "aria-orientation": "vertical",
3031
+ "data-state": Dr(g.open),
3032
+ "data-radix-menu-content": "",
3033
+ dir: w.dir,
3034
+ ...b,
3035
+ ...m,
3036
+ ref: P,
3037
+ style: { outline: "none", ...m.style },
3038
+ onKeyDown: O(m.onKeyDown, (S) => {
3039
+ const W = S.target.closest("[data-radix-menu-content]") === S.currentTarget, Z = S.ctrlKey || S.altKey || S.metaKey, Ee = S.key.length === 1;
3040
+ W && (S.key === "Tab" && S.preventDefault(), !Z && Ee && $(S.key));
3041
+ const Se = R.current;
3042
+ if (S.target !== Se || !Vc.includes(S.key))
3043
+ return;
3044
+ S.preventDefault();
3045
+ const ue = C().filter((te) => !te.disabled).map((te) => te.ref.current);
3046
+ lr.includes(S.key) && ue.reverse(), fs(ue);
3047
+ }),
3048
+ onBlur: O(e.onBlur, (S) => {
3049
+ S.currentTarget.contains(S.target) || (window.clearTimeout(D.current), _.current = "");
3050
+ }),
3051
+ onPointerMove: O(
3052
+ e.onPointerMove,
3053
+ Ne((S) => {
3054
+ const L = S.target, W = N.current !== S.clientX;
3055
+ if (S.currentTarget.contains(L) && W) {
3056
+ const Z = S.clientX > N.current ? "right" : "left";
3057
+ I.current = Z, N.current = S.clientX;
3058
+ }
3059
+ })
3060
+ )
3061
+ }
3062
+ )
3063
+ }
3064
+ )
3065
+ }
3066
+ )
3067
+ }
3068
+ ) })
3069
+ }
3070
+ );
3071
+ }
3072
+ );
3073
+ vr.displayName = j;
3074
+ var ns = "MenuGroup", Ut = a.forwardRef(
3075
+ (e, t) => {
3076
+ const { __scopeMenu: n, ...r } = e;
3077
+ return /* @__PURE__ */ y(U.div, { role: "group", ...r, ref: t });
3078
+ }
3079
+ );
3080
+ Ut.displayName = ns;
3081
+ var rs = "MenuLabel", gr = a.forwardRef(
3082
+ (e, t) => {
3083
+ const { __scopeMenu: n, ...r } = e;
3084
+ return /* @__PURE__ */ y(U.div, { ...r, ref: t });
3085
+ }
3086
+ );
3087
+ gr.displayName = rs;
3088
+ var Je = "MenuItem", vn = "menu.itemSelect", at = a.forwardRef(
3089
+ (e, t) => {
3090
+ const { disabled: n = !1, onSelect: r, ...o } = e, i = a.useRef(null), c = ke(Je, e.__scopeMenu), s = Bt(Je, e.__scopeMenu), f = G(t, i), l = a.useRef(!1), d = () => {
3091
+ const u = i.current;
3092
+ if (!n && u) {
3093
+ const p = new CustomEvent(vn, { bubbles: !0, cancelable: !0 });
3094
+ u.addEventListener(vn, (h) => r == null ? void 0 : r(h), { once: !0 }), bn(u, p), p.defaultPrevented ? l.current = !1 : c.onClose();
3095
+ }
3096
+ };
3097
+ return /* @__PURE__ */ y(
3098
+ wr,
3099
+ {
3100
+ ...o,
3101
+ ref: f,
3102
+ disabled: n,
3103
+ onClick: O(e.onClick, d),
3104
+ onPointerDown: (u) => {
3105
+ var p;
3106
+ (p = e.onPointerDown) == null || p.call(e, u), l.current = !0;
3107
+ },
3108
+ onPointerUp: O(e.onPointerUp, (u) => {
3109
+ var p;
3110
+ l.current || (p = u.currentTarget) == null || p.click();
3111
+ }),
3112
+ onKeyDown: O(e.onKeyDown, (u) => {
3113
+ const p = s.searchRef.current !== "";
3114
+ n || p && u.key === " " || Pt.includes(u.key) && (u.currentTarget.click(), u.preventDefault());
3115
+ })
3116
+ }
3117
+ );
3118
+ }
3119
+ );
3120
+ at.displayName = Je;
3121
+ var wr = a.forwardRef(
3122
+ (e, t) => {
3123
+ const { __scopeMenu: n, disabled: r = !1, textValue: o, ...i } = e, c = Bt(Je, n), s = dr(n), f = a.useRef(null), l = G(t, f), [d, u] = a.useState(!1), [p, h] = a.useState("");
3124
+ return a.useEffect(() => {
3125
+ const v = f.current;
3126
+ v && h((v.textContent ?? "").trim());
3127
+ }, [i.children]), /* @__PURE__ */ y(
3128
+ De.ItemSlot,
3129
+ {
3130
+ scope: n,
3131
+ disabled: r,
3132
+ textValue: o ?? p,
3133
+ children: /* @__PURE__ */ y(tc, { asChild: !0, ...s, focusable: !r, children: /* @__PURE__ */ y(
3134
+ U.div,
3135
+ {
3136
+ role: "menuitem",
3137
+ "data-highlighted": d ? "" : void 0,
3138
+ "aria-disabled": r || void 0,
3139
+ "data-disabled": r ? "" : void 0,
3140
+ ...i,
3141
+ ref: l,
3142
+ onPointerMove: O(
3143
+ e.onPointerMove,
3144
+ Ne((v) => {
3145
+ r ? c.onItemLeave(v) : (c.onItemEnter(v), v.defaultPrevented || v.currentTarget.focus({ preventScroll: !0 }));
3146
+ })
3147
+ ),
3148
+ onPointerLeave: O(
3149
+ e.onPointerLeave,
3150
+ Ne((v) => c.onItemLeave(v))
3151
+ ),
3152
+ onFocus: O(e.onFocus, () => u(!0)),
3153
+ onBlur: O(e.onBlur, () => u(!1))
3154
+ }
3155
+ ) })
3156
+ }
3157
+ );
3158
+ }
3159
+ ), os = "MenuCheckboxItem", yr = a.forwardRef(
3160
+ (e, t) => {
3161
+ const { checked: n = !1, onCheckedChange: r, ...o } = e;
3162
+ return /* @__PURE__ */ y(Sr, { scope: e.__scopeMenu, checked: n, children: /* @__PURE__ */ y(
3163
+ at,
3164
+ {
3165
+ role: "menuitemcheckbox",
3166
+ "aria-checked": et(n) ? "mixed" : n,
3167
+ ...o,
3168
+ ref: t,
3169
+ "data-state": Gt(n),
3170
+ onSelect: O(
3171
+ o.onSelect,
3172
+ () => r == null ? void 0 : r(et(n) ? !0 : !n),
3173
+ { checkForDefaultPrevented: !1 }
3174
+ )
3175
+ }
3176
+ ) });
3177
+ }
3178
+ );
3179
+ yr.displayName = os;
3180
+ var br = "MenuRadioGroup", [is, cs] = de(
3181
+ br,
3182
+ { value: void 0, onValueChange: () => {
3183
+ } }
3184
+ ), xr = a.forwardRef(
3185
+ (e, t) => {
3186
+ const { value: n, onValueChange: r, ...o } = e, i = ne(r);
3187
+ return /* @__PURE__ */ y(is, { scope: e.__scopeMenu, value: n, onValueChange: i, children: /* @__PURE__ */ y(Ut, { ...o, ref: t }) });
3188
+ }
3189
+ );
3190
+ xr.displayName = br;
3191
+ var Cr = "MenuRadioItem", Er = a.forwardRef(
3192
+ (e, t) => {
3193
+ const { value: n, ...r } = e, o = cs(Cr, e.__scopeMenu), i = n === o.value;
3194
+ return /* @__PURE__ */ y(Sr, { scope: e.__scopeMenu, checked: i, children: /* @__PURE__ */ y(
3195
+ at,
3196
+ {
3197
+ role: "menuitemradio",
3198
+ "aria-checked": i,
3199
+ ...r,
3200
+ ref: t,
3201
+ "data-state": Gt(i),
3202
+ onSelect: O(
3203
+ r.onSelect,
3204
+ () => {
3205
+ var c;
3206
+ return (c = o.onValueChange) == null ? void 0 : c.call(o, n);
3207
+ },
3208
+ { checkForDefaultPrevented: !1 }
3209
+ )
3210
+ }
3211
+ ) });
3212
+ }
3213
+ );
3214
+ Er.displayName = Cr;
3215
+ var Kt = "MenuItemIndicator", [Sr, ss] = de(
3216
+ Kt,
3217
+ { checked: !1 }
3218
+ ), Rr = a.forwardRef(
3219
+ (e, t) => {
3220
+ const { __scopeMenu: n, forceMount: r, ...o } = e, i = ss(Kt, n);
3221
+ return /* @__PURE__ */ y(
3222
+ Le,
3223
+ {
3224
+ present: r || et(i.checked) || i.checked === !0,
3225
+ children: /* @__PURE__ */ y(
3226
+ U.span,
3227
+ {
3228
+ ...o,
3229
+ ref: t,
3230
+ "data-state": Gt(i.checked)
3231
+ }
3232
+ )
3233
+ }
3234
+ );
3235
+ }
3236
+ );
3237
+ Rr.displayName = Kt;
3238
+ var as = "MenuSeparator", Mr = a.forwardRef(
3239
+ (e, t) => {
3240
+ const { __scopeMenu: n, ...r } = e;
3241
+ return /* @__PURE__ */ y(
3242
+ U.div,
3243
+ {
3244
+ role: "separator",
3245
+ "aria-orientation": "horizontal",
3246
+ ...r,
3247
+ ref: t
3248
+ }
3249
+ );
3250
+ }
3251
+ );
3252
+ Mr.displayName = as;
3253
+ var us = "MenuArrow", Pr = a.forwardRef(
3254
+ (e, t) => {
3255
+ const { __scopeMenu: n, ...r } = e, o = st(n);
3256
+ return /* @__PURE__ */ y(ki, { ...o, ...r, ref: t });
3257
+ }
3258
+ );
3259
+ Pr.displayName = us;
3260
+ var ls = "MenuSub", [ra, Ar] = de(ls), Ae = "MenuSubTrigger", Or = a.forwardRef(
3261
+ (e, t) => {
3262
+ const n = pe(Ae, e.__scopeMenu), r = ke(Ae, e.__scopeMenu), o = Ar(Ae, e.__scopeMenu), i = Bt(Ae, e.__scopeMenu), c = a.useRef(null), { pointerGraceTimerRef: s, onPointerGraceIntentChange: f } = i, l = { __scopeMenu: e.__scopeMenu }, d = a.useCallback(() => {
3263
+ c.current && window.clearTimeout(c.current), c.current = null;
3264
+ }, []);
3265
+ return a.useEffect(() => d, [d]), a.useEffect(() => {
3266
+ const u = s.current;
3267
+ return () => {
3268
+ window.clearTimeout(u), f(null);
3269
+ };
3270
+ }, [s, f]), /* @__PURE__ */ y(kt, { asChild: !0, ...l, children: /* @__PURE__ */ y(
3271
+ wr,
3272
+ {
3273
+ id: o.triggerId,
3274
+ "aria-haspopup": "menu",
3275
+ "aria-expanded": n.open,
3276
+ "aria-controls": o.contentId,
3277
+ "data-state": Dr(n.open),
3278
+ ...e,
3279
+ ref: tt(t, o.onTriggerChange),
3280
+ onClick: (u) => {
3281
+ var p;
3282
+ (p = e.onClick) == null || p.call(e, u), !(e.disabled || u.defaultPrevented) && (u.currentTarget.focus(), n.open || n.onOpenChange(!0));
3283
+ },
3284
+ onPointerMove: O(
3285
+ e.onPointerMove,
3286
+ Ne((u) => {
3287
+ i.onItemEnter(u), !u.defaultPrevented && !e.disabled && !n.open && !c.current && (i.onPointerGraceIntentChange(null), c.current = window.setTimeout(() => {
3288
+ n.onOpenChange(!0), d();
3289
+ }, 100));
3290
+ })
3291
+ ),
3292
+ onPointerLeave: O(
3293
+ e.onPointerLeave,
3294
+ Ne((u) => {
3295
+ var h, v;
3296
+ d();
3297
+ const p = (h = n.content) == null ? void 0 : h.getBoundingClientRect();
3298
+ if (p) {
3299
+ const m = (v = n.content) == null ? void 0 : v.dataset.side, g = m === "right", w = g ? -5 : 5, b = p[g ? "left" : "right"], x = p[g ? "right" : "left"];
3300
+ i.onPointerGraceIntentChange({
3301
+ area: [
3302
+ // Apply a bleed on clientX to ensure that our exit point is
3303
+ // consistently within polygon bounds
3304
+ { x: u.clientX + w, y: u.clientY },
3305
+ { x: b, y: p.top },
3306
+ { x, y: p.top },
3307
+ { x, y: p.bottom },
3308
+ { x: b, y: p.bottom }
3309
+ ],
3310
+ side: m
3311
+ }), window.clearTimeout(s.current), s.current = window.setTimeout(
3312
+ () => i.onPointerGraceIntentChange(null),
3313
+ 300
3314
+ );
3315
+ } else {
3316
+ if (i.onTriggerLeave(u), u.defaultPrevented)
3317
+ return;
3318
+ i.onPointerGraceIntentChange(null);
3319
+ }
3320
+ })
3321
+ ),
3322
+ onKeyDown: O(e.onKeyDown, (u) => {
3323
+ var h;
3324
+ const p = i.searchRef.current !== "";
3325
+ e.disabled || p && u.key === " " || Hc[r.dir].includes(u.key) && (n.onOpenChange(!0), (h = n.content) == null || h.focus(), u.preventDefault());
3326
+ })
3327
+ }
3328
+ ) });
3329
+ }
3330
+ );
3331
+ Or.displayName = Ae;
3332
+ var _r = "MenuSubContent", Tr = a.forwardRef(
3333
+ (e, t) => {
3334
+ const n = mr(j, e.__scopeMenu), { forceMount: r = n.forceMount, ...o } = e, i = pe(j, e.__scopeMenu), c = ke(j, e.__scopeMenu), s = Ar(_r, e.__scopeMenu), f = a.useRef(null), l = G(t, f);
3335
+ return /* @__PURE__ */ y(De.Provider, { scope: e.__scopeMenu, children: /* @__PURE__ */ y(Le, { present: r || i.open, children: /* @__PURE__ */ y(De.Slot, { scope: e.__scopeMenu, children: /* @__PURE__ */ y(
3336
+ Wt,
3337
+ {
3338
+ id: s.contentId,
3339
+ "aria-labelledby": s.triggerId,
3340
+ ...o,
3341
+ ref: l,
3342
+ align: "start",
3343
+ side: c.dir === "rtl" ? "left" : "right",
3344
+ disableOutsidePointerEvents: !1,
3345
+ disableOutsideScroll: !1,
3346
+ trapFocus: !1,
3347
+ onOpenAutoFocus: (d) => {
3348
+ var u;
3349
+ c.isUsingKeyboardRef.current && ((u = f.current) == null || u.focus()), d.preventDefault();
3350
+ },
3351
+ onCloseAutoFocus: (d) => d.preventDefault(),
3352
+ onFocusOutside: O(e.onFocusOutside, (d) => {
3353
+ d.target !== s.trigger && i.onOpenChange(!1);
3354
+ }),
3355
+ onEscapeKeyDown: O(e.onEscapeKeyDown, (d) => {
3356
+ c.onClose(), d.preventDefault();
3357
+ }),
3358
+ onKeyDown: O(e.onKeyDown, (d) => {
3359
+ var h;
3360
+ const u = d.currentTarget.contains(d.target), p = Yc[c.dir].includes(d.key);
3361
+ u && p && (i.onOpenChange(!1), (h = s.trigger) == null || h.focus(), d.preventDefault());
3362
+ })
3363
+ }
3364
+ ) }) }) });
3365
+ }
3366
+ );
3367
+ Tr.displayName = _r;
3368
+ function Dr(e) {
3369
+ return e ? "open" : "closed";
3370
+ }
3371
+ function et(e) {
3372
+ return e === "indeterminate";
3373
+ }
3374
+ function Gt(e) {
3375
+ return et(e) ? "indeterminate" : e ? "checked" : "unchecked";
3376
+ }
3377
+ function fs(e) {
3378
+ const t = document.activeElement;
3379
+ for (const n of e)
3380
+ if (n === t || (n.focus(), document.activeElement !== t))
3381
+ return;
3382
+ }
3383
+ function ds(e, t) {
3384
+ return e.map((n, r) => e[(t + r) % e.length]);
3385
+ }
3386
+ function ps(e, t, n) {
3387
+ const o = t.length > 1 && Array.from(t).every((l) => l === t[0]) ? t[0] : t, i = n ? e.indexOf(n) : -1;
3388
+ let c = ds(e, Math.max(i, 0));
3389
+ o.length === 1 && (c = c.filter((l) => l !== n));
3390
+ const f = c.find(
3391
+ (l) => l.toLowerCase().startsWith(o.toLowerCase())
3392
+ );
3393
+ return f !== n ? f : void 0;
3394
+ }
3395
+ function ms(e, t) {
3396
+ const { x: n, y: r } = e;
3397
+ let o = !1;
3398
+ for (let i = 0, c = t.length - 1; i < t.length; c = i++) {
3399
+ const s = t[i].x, f = t[i].y, l = t[c].x, d = t[c].y;
3400
+ f > r != d > r && n < (l - s) * (r - f) / (d - f) + s && (o = !o);
3401
+ }
3402
+ return o;
3403
+ }
3404
+ function hs(e, t) {
3405
+ if (!t)
3406
+ return !1;
3407
+ const n = { x: e.clientX, y: e.clientY };
3408
+ return ms(n, t);
3409
+ }
3410
+ function Ne(e) {
3411
+ return (t) => t.pointerType === "mouse" ? e(t) : void 0;
3412
+ }
3413
+ var vs = pr, gs = kt, ws = hr, ys = vr, bs = Ut, xs = gr, Cs = at, Es = yr, Ss = xr, Rs = Er, Ms = Rr, Ps = Mr, As = Pr, Os = Or, _s = Tr, Vt = "DropdownMenu", [Ts, oa] = wn(
3414
+ Vt,
3415
+ [fr]
3416
+ ), K = fr(), [Ds, Nr] = Ts(Vt), Ir = (e) => {
3417
+ const {
3418
+ __scopeDropdownMenu: t,
3419
+ children: n,
3420
+ dir: r,
3421
+ open: o,
3422
+ defaultOpen: i,
3423
+ onOpenChange: c,
3424
+ modal: s = !0
3425
+ } = e, f = K(t), l = a.useRef(null), [d = !1, u] = gn({
3426
+ prop: o,
3427
+ defaultProp: i,
3428
+ onChange: c
3429
+ });
3430
+ return /* @__PURE__ */ y(
3431
+ Ds,
3432
+ {
3433
+ scope: t,
3434
+ triggerId: xt(),
3435
+ triggerRef: l,
3436
+ contentId: xt(),
3437
+ open: d,
3438
+ onOpenChange: u,
3439
+ onOpenToggle: a.useCallback(() => u((p) => !p), [u]),
3440
+ modal: s,
3441
+ children: /* @__PURE__ */ y(vs, { ...f, open: d, onOpenChange: u, dir: r, modal: s, children: n })
3442
+ }
3443
+ );
3444
+ };
3445
+ Ir.displayName = Vt;
3446
+ var Lr = "DropdownMenuTrigger", Fr = a.forwardRef(
3447
+ (e, t) => {
3448
+ const { __scopeDropdownMenu: n, disabled: r = !1, ...o } = e, i = Nr(Lr, n), c = K(n);
3449
+ return /* @__PURE__ */ y(gs, { asChild: !0, ...c, children: /* @__PURE__ */ y(
3450
+ U.button,
3451
+ {
3452
+ type: "button",
3453
+ id: i.triggerId,
3454
+ "aria-haspopup": "menu",
3455
+ "aria-expanded": i.open,
3456
+ "aria-controls": i.open ? i.contentId : void 0,
3457
+ "data-state": i.open ? "open" : "closed",
3458
+ "data-disabled": r ? "" : void 0,
3459
+ disabled: r,
3460
+ ...o,
3461
+ ref: tt(t, i.triggerRef),
3462
+ onPointerDown: O(e.onPointerDown, (s) => {
3463
+ !r && s.button === 0 && s.ctrlKey === !1 && (i.onOpenToggle(), i.open || s.preventDefault());
3464
+ }),
3465
+ onKeyDown: O(e.onKeyDown, (s) => {
3466
+ r || (["Enter", " "].includes(s.key) && i.onOpenToggle(), s.key === "ArrowDown" && i.onOpenChange(!0), ["Enter", " ", "ArrowDown"].includes(s.key) && s.preventDefault());
3467
+ })
3468
+ }
3469
+ ) });
3470
+ }
3471
+ );
3472
+ Fr.displayName = Lr;
3473
+ var Ns = "DropdownMenuPortal", kr = (e) => {
3474
+ const { __scopeDropdownMenu: t, ...n } = e, r = K(t);
3475
+ return /* @__PURE__ */ y(ws, { ...r, ...n });
3476
+ };
3477
+ kr.displayName = Ns;
3478
+ var $r = "DropdownMenuContent", Br = a.forwardRef(
3479
+ (e, t) => {
3480
+ const { __scopeDropdownMenu: n, ...r } = e, o = Nr($r, n), i = K(n), c = a.useRef(!1);
3481
+ return /* @__PURE__ */ y(
3482
+ ys,
3483
+ {
3484
+ id: o.contentId,
3485
+ "aria-labelledby": o.triggerId,
3486
+ ...i,
3487
+ ...r,
3488
+ ref: t,
3489
+ onCloseAutoFocus: O(e.onCloseAutoFocus, (s) => {
3490
+ var f;
3491
+ c.current || (f = o.triggerRef.current) == null || f.focus(), c.current = !1, s.preventDefault();
3492
+ }),
3493
+ onInteractOutside: O(e.onInteractOutside, (s) => {
3494
+ const f = s.detail.originalEvent, l = f.button === 0 && f.ctrlKey === !0, d = f.button === 2 || l;
3495
+ (!o.modal || d) && (c.current = !0);
3496
+ }),
3497
+ style: {
3498
+ ...e.style,
3499
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
3500
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
3501
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
3502
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
3503
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
3504
+ }
3505
+ }
3506
+ );
3507
+ }
3508
+ );
3509
+ Br.displayName = $r;
3510
+ var Is = "DropdownMenuGroup", Wr = a.forwardRef(
3511
+ (e, t) => {
3512
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3513
+ return /* @__PURE__ */ y(bs, { ...o, ...r, ref: t });
3514
+ }
3515
+ );
3516
+ Wr.displayName = Is;
3517
+ var Ls = "DropdownMenuLabel", Fs = a.forwardRef(
3518
+ (e, t) => {
3519
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3520
+ return /* @__PURE__ */ y(xs, { ...o, ...r, ref: t });
3521
+ }
3522
+ );
3523
+ Fs.displayName = Ls;
3524
+ var ks = "DropdownMenuItem", Ur = a.forwardRef(
3525
+ (e, t) => {
3526
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3527
+ return /* @__PURE__ */ y(Cs, { ...o, ...r, ref: t });
3528
+ }
3529
+ );
3530
+ Ur.displayName = ks;
3531
+ var $s = "DropdownMenuCheckboxItem", Bs = a.forwardRef((e, t) => {
3532
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3533
+ return /* @__PURE__ */ y(Es, { ...o, ...r, ref: t });
3534
+ });
3535
+ Bs.displayName = $s;
3536
+ var Ws = "DropdownMenuRadioGroup", Us = a.forwardRef((e, t) => {
3537
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3538
+ return /* @__PURE__ */ y(Ss, { ...o, ...r, ref: t });
3539
+ });
3540
+ Us.displayName = Ws;
3541
+ var Ks = "DropdownMenuRadioItem", Gs = a.forwardRef((e, t) => {
3542
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3543
+ return /* @__PURE__ */ y(Rs, { ...o, ...r, ref: t });
3544
+ });
3545
+ Gs.displayName = Ks;
3546
+ var Vs = "DropdownMenuItemIndicator", Hs = a.forwardRef((e, t) => {
3547
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3548
+ return /* @__PURE__ */ y(Ms, { ...o, ...r, ref: t });
3549
+ });
3550
+ Hs.displayName = Vs;
3551
+ var Ys = "DropdownMenuSeparator", Kr = a.forwardRef((e, t) => {
3552
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3553
+ return /* @__PURE__ */ y(Ps, { ...o, ...r, ref: t });
3554
+ });
3555
+ Kr.displayName = Ys;
3556
+ var js = "DropdownMenuArrow", Xs = a.forwardRef(
3557
+ (e, t) => {
3558
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3559
+ return /* @__PURE__ */ y(As, { ...o, ...r, ref: t });
3560
+ }
3561
+ );
3562
+ Xs.displayName = js;
3563
+ var zs = "DropdownMenuSubTrigger", Zs = a.forwardRef((e, t) => {
3564
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3565
+ return /* @__PURE__ */ y(Os, { ...o, ...r, ref: t });
3566
+ });
3567
+ Zs.displayName = zs;
3568
+ var qs = "DropdownMenuSubContent", Qs = a.forwardRef((e, t) => {
3569
+ const { __scopeDropdownMenu: n, ...r } = e, o = K(n);
3570
+ return /* @__PURE__ */ y(
3571
+ _s,
3572
+ {
3573
+ ...o,
3574
+ ...r,
3575
+ ref: t,
3576
+ style: {
3577
+ ...e.style,
3578
+ "--radix-dropdown-menu-content-transform-origin": "var(--radix-popper-transform-origin)",
3579
+ "--radix-dropdown-menu-content-available-width": "var(--radix-popper-available-width)",
3580
+ "--radix-dropdown-menu-content-available-height": "var(--radix-popper-available-height)",
3581
+ "--radix-dropdown-menu-trigger-width": "var(--radix-popper-anchor-width)",
3582
+ "--radix-dropdown-menu-trigger-height": "var(--radix-popper-anchor-height)"
3583
+ }
3584
+ }
3585
+ );
3586
+ });
3587
+ Qs.displayName = qs;
3588
+ var ia = Ir, ca = Fr, sa = kr, aa = Br, ua = Wr, la = Ur, fa = Kr;
3589
+ export {
3590
+ aa as C,
3591
+ Sn as D,
3592
+ Mn as F,
3593
+ ua as G,
3594
+ la as I,
3595
+ sa as P,
3596
+ ia as R,
3597
+ fa as S,
3598
+ ca as T,
3599
+ U as a,
3600
+ Le as b,
3601
+ O as c,
3602
+ Kc as d,
3603
+ Oe as e,
3604
+ go as f,
3605
+ xt as g,
3606
+ ic as h,
3607
+ Xn as i,
3608
+ G as u
3609
+ };