@radui/ui 1.0.1 → 1.1.0

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 (238) hide show
  1. package/dist/components/Accordion.cjs +1 -1
  2. package/dist/components/Accordion.js +1 -1
  3. package/dist/components/AlertDialog.cjs +1 -1
  4. package/dist/components/AlertDialog.d.ts +61 -24
  5. package/dist/components/AlertDialog.js +1 -1
  6. package/dist/components/Avatar.cjs +1 -1
  7. package/dist/components/Avatar.d.ts +36 -6
  8. package/dist/components/Avatar.js +1 -1
  9. package/dist/components/AvatarGroup.cjs +1 -1
  10. package/dist/components/AvatarGroup.d.ts +39 -18
  11. package/dist/components/AvatarGroup.js +1 -1
  12. package/dist/components/{AvatarPrimitiveFallback-CBb0nHGD.cjs → AvatarPrimitiveFallback-BpUU1vNV.cjs} +1 -1
  13. package/dist/components/{AvatarPrimitiveFallback-C1siRii4.js → AvatarPrimitiveFallback-DIXB9Tnm.js} +1 -1
  14. package/dist/components/Badge.cjs +1 -1
  15. package/dist/components/Badge.js +1 -1
  16. package/dist/components/Breadcrumb.cjs +1 -1
  17. package/dist/components/Breadcrumb.js +1 -1
  18. package/dist/components/Button.cjs +1 -1
  19. package/dist/components/Button.js +1 -1
  20. package/dist/components/Callout.cjs +1 -1
  21. package/dist/components/Callout.d.ts +32 -18
  22. package/dist/components/Callout.js +1 -1
  23. package/dist/components/Card.cjs +1 -1
  24. package/dist/components/Card.d.ts +31 -16
  25. package/dist/components/Card.js +1 -1
  26. package/dist/components/Checkbox.cjs +1 -1
  27. package/dist/components/Checkbox.js +1 -1
  28. package/dist/components/CheckboxCards.cjs +1 -1
  29. package/dist/components/CheckboxCards.js +1 -1
  30. package/dist/components/CheckboxGroup.cjs +1 -1
  31. package/dist/components/CheckboxGroup.d.ts +6 -2
  32. package/dist/components/CheckboxGroup.js +1 -1
  33. package/dist/components/{CheckboxGroupPrimitive-DfHQYkep.js → CheckboxGroupPrimitive-BRCGIztp.js} +1 -1
  34. package/dist/components/{CheckboxGroupPrimitive-d9yBl6m5.cjs → CheckboxGroupPrimitive-C21WO4L3.cjs} +1 -1
  35. package/dist/components/Collapsible.cjs +1 -1
  36. package/dist/components/Collapsible.d.ts +34 -4
  37. package/dist/components/Collapsible.js +1 -1
  38. package/dist/components/Combobox.cjs +1 -1
  39. package/dist/components/Combobox.d.ts +57 -45
  40. package/dist/components/Combobox.js +1 -1
  41. package/dist/components/ComboboxPrimitive-BdX2jgpQ.js +1 -0
  42. package/dist/components/ComboboxPrimitive-CyO6ZH5T.cjs +1 -0
  43. package/dist/components/Command.cjs +1 -1
  44. package/dist/components/Command.d.ts +36 -8
  45. package/dist/components/Command.js +1 -1
  46. package/dist/components/ContextMenu.cjs +1 -1
  47. package/dist/components/ContextMenu.d.ts +25 -11
  48. package/dist/components/ContextMenu.js +1 -1
  49. package/dist/components/Dialog.cjs +1 -1
  50. package/dist/components/Dialog.d.ts +29 -4
  51. package/dist/components/Dialog.js +1 -1
  52. package/dist/components/Disclosure.cjs +1 -1
  53. package/dist/components/Disclosure.js +1 -1
  54. package/dist/components/Drawer.cjs +1 -1
  55. package/dist/components/Drawer.d.ts +31 -3
  56. package/dist/components/Drawer.js +1 -1
  57. package/dist/components/DropdownMenu.cjs +1 -1
  58. package/dist/components/DropdownMenu.d.ts +25 -11
  59. package/dist/components/DropdownMenu.js +1 -1
  60. package/dist/components/HoverCard.cjs +1 -1
  61. package/dist/components/HoverCard.d.ts +15 -1
  62. package/dist/components/HoverCard.js +1 -1
  63. package/dist/components/Label.cjs +1 -0
  64. package/dist/components/Label.d.ts +18 -0
  65. package/dist/components/Label.js +1 -0
  66. package/dist/components/Link.cjs +1 -1
  67. package/dist/components/Link.js +1 -1
  68. package/dist/components/LiveRegion.cjs +1 -1
  69. package/dist/components/LiveRegion.d.ts +2 -5
  70. package/dist/components/LiveRegion.js +1 -1
  71. package/dist/components/MenuPrimitive-Ctqo21Vd.cjs +1 -0
  72. package/dist/components/MenuPrimitive-Cy_MJfjG.js +1 -0
  73. package/dist/components/Menubar.cjs +1 -1
  74. package/dist/components/Menubar.d.ts +45 -16
  75. package/dist/components/Menubar.js +1 -1
  76. package/dist/components/Meter.cjs +1 -0
  77. package/dist/components/Meter.d.ts +44 -0
  78. package/dist/components/Meter.js +1 -0
  79. package/dist/components/Minimap.cjs +1 -1
  80. package/dist/components/Minimap.js +1 -1
  81. package/dist/components/NavigationMenu.cjs +1 -1
  82. package/dist/components/NavigationMenu.d.ts +2 -0
  83. package/dist/components/NavigationMenu.js +1 -1
  84. package/dist/components/Popover.cjs +1 -1
  85. package/dist/components/Popover.d.ts +64 -5
  86. package/dist/components/Popover.js +1 -1
  87. package/dist/components/Progress.cjs +1 -1
  88. package/dist/components/Progress.d.ts +14 -2
  89. package/dist/components/Progress.js +1 -1
  90. package/dist/components/Radio.cjs +1 -1
  91. package/dist/components/Radio.js +1 -1
  92. package/dist/components/RadioCards.cjs +1 -1
  93. package/dist/components/RadioCards.d.ts +22 -1
  94. package/dist/components/RadioCards.js +1 -1
  95. package/dist/components/RadioGroup.cjs +1 -1
  96. package/dist/components/RadioGroup.d.ts +27 -7
  97. package/dist/components/RadioGroup.js +1 -1
  98. package/dist/components/RadioGroupPrimitive-B0CrM2bi.cjs +1 -0
  99. package/dist/components/RadioGroupPrimitive-CnPy0zgW.js +1 -0
  100. package/dist/components/ScrollArea.cjs +1 -1
  101. package/dist/components/ScrollArea.d.ts +24 -13
  102. package/dist/components/ScrollArea.js +1 -1
  103. package/dist/components/Select.cjs +1 -1
  104. package/dist/components/Select.d.ts +52 -44
  105. package/dist/components/Select.js +1 -1
  106. package/dist/components/Separator.cjs +1 -1
  107. package/dist/components/Separator.d.ts +8 -1
  108. package/dist/components/Separator.js +1 -1
  109. package/dist/components/Slider.cjs +1 -1
  110. package/dist/components/Slider.js +1 -1
  111. package/dist/components/Steps.cjs +1 -1
  112. package/dist/components/Steps.d.ts +33 -16
  113. package/dist/components/Steps.js +1 -1
  114. package/dist/components/Switch.cjs +1 -1
  115. package/dist/components/Switch.d.ts +14 -2
  116. package/dist/components/Switch.js +1 -1
  117. package/dist/components/TabNav.cjs +1 -1
  118. package/dist/components/TabNav.d.ts +5 -0
  119. package/dist/components/TabNav.js +1 -1
  120. package/dist/components/Table.cjs +1 -1
  121. package/dist/components/Table.d.ts +23 -12
  122. package/dist/components/Table.js +1 -1
  123. package/dist/components/Tabs.cjs +1 -1
  124. package/dist/components/Tabs.js +1 -1
  125. package/dist/components/Theme.cjs +1 -1
  126. package/dist/components/Theme.d.ts +2 -0
  127. package/dist/components/Theme.js +1 -1
  128. package/dist/components/Toast.cjs +1 -1
  129. package/dist/components/Toast.js +1 -1
  130. package/dist/components/Toggle.cjs +1 -1
  131. package/dist/components/Toggle.js +1 -1
  132. package/dist/components/ToggleGroup.cjs +1 -1
  133. package/dist/components/ToggleGroup.js +1 -1
  134. package/dist/components/Toolbar.cjs +1 -1
  135. package/dist/components/Toolbar.d.ts +8 -1
  136. package/dist/components/Toolbar.js +1 -1
  137. package/dist/components/Tooltip.cjs +1 -1
  138. package/dist/components/Tooltip.d.ts +7 -1
  139. package/dist/components/Tooltip.js +1 -1
  140. package/dist/components/Tree.cjs +1 -1
  141. package/dist/components/Tree.d.ts +8 -1
  142. package/dist/components/Tree.js +1 -1
  143. package/dist/components/VisuallyHidden.cjs +1 -1
  144. package/dist/components/VisuallyHidden.d.ts +6 -1
  145. package/dist/components/VisuallyHidden.js +1 -1
  146. package/dist/components/{floating-ui.react-2kiGB4sW.js → floating-ui.react-CZf-mCiA.js} +1 -1
  147. package/dist/components/{index-WGIYLuwZ.cjs → index-BZO29jsF.cjs} +1 -1
  148. package/dist/components/index-B_OPdW20.js +1 -0
  149. package/dist/components/{index-436yWBk4.cjs → index-BbvJO-A-.cjs} +1 -1
  150. package/dist/components/index-Bg-UeWCo.cjs +1 -0
  151. package/dist/components/index-BidxkqdT.js +1 -0
  152. package/dist/components/{index-DMX7gpdp.js → index-CAD0hWja.js} +1 -1
  153. package/dist/components/{index-xlB--dex.js → index-CXv1Y-O3.js} +1 -1
  154. package/dist/components/{index-CukraWfT.cjs → index-C_Yiql9j.cjs} +1 -1
  155. package/dist/components/{index-nYRBURkR.js → index-Cp5L_alO.js} +1 -1
  156. package/dist/components/{index-C7dBo_Ry.js → index-D8QLtYJh.js} +1 -1
  157. package/dist/components/{index-FITGoHty.js → index-DH-14XDv.js} +1 -1
  158. package/dist/components/{index-CoPhBYnZ.cjs → index-K0sE1H4u.cjs} +1 -1
  159. package/dist/components/{index-BeakeOqt.cjs → index-rUSzFrhJ.cjs} +1 -1
  160. package/dist/index.cjs +2 -0
  161. package/dist/index.d.ts +2 -0
  162. package/dist/index.js +2 -0
  163. package/dist/styles/clarity/Accordion/accordion.clarity.scss +147 -0
  164. package/dist/styles/clarity/AlertDialog/alert-dialog.clarity.scss +199 -0
  165. package/dist/styles/clarity/Avatar/_avatar-base.clarity.scss +87 -0
  166. package/dist/styles/clarity/Avatar/avatar.clarity.scss +1 -0
  167. package/dist/styles/clarity/AvatarGroup/avatar-group.clarity.scss +122 -0
  168. package/dist/styles/clarity/Badge/badge.clarity.scss +118 -0
  169. package/dist/styles/clarity/BlockQuote/blockquote.clarity.scss +123 -0
  170. package/dist/styles/clarity/Breadcrumb/breadcrumb.clarity.scss +50 -0
  171. package/dist/styles/clarity/Button/button.clarity.scss +132 -0
  172. package/dist/styles/clarity/Callout/callout.clarity.scss +183 -0
  173. package/dist/styles/clarity/Card/card.clarity.scss +121 -0
  174. package/dist/styles/clarity/Checkbox/checkbox.clarity.scss +75 -0
  175. package/dist/styles/clarity/CheckboxCards/checkbox-cards.clarity.scss +143 -0
  176. package/dist/styles/clarity/CheckboxGroup/checkbox-group.clarity.scss +92 -0
  177. package/dist/styles/clarity/Code/code.clarity.scss +42 -0
  178. package/dist/styles/clarity/Collapsible/collapsible.clarity.scss +84 -0
  179. package/dist/styles/clarity/Combobox/combobox.clarity.scss +157 -0
  180. package/dist/styles/clarity/Command/command.clarity.scss +231 -0
  181. package/dist/styles/clarity/ContextMenu/context-menu.clarity.scss +272 -0
  182. package/dist/styles/clarity/DataList/data-list.clarity.scss +60 -0
  183. package/dist/styles/clarity/Dialog/dialog.clarity.scss +205 -0
  184. package/dist/styles/clarity/Disclosure/disclosure.clarity.scss +56 -0
  185. package/dist/styles/clarity/Drawer/drawer.clarity.scss +331 -0
  186. package/dist/styles/clarity/DropdownMenu/dropdown-menu.clarity.scss +187 -0
  187. package/dist/styles/clarity/Em/em.clarity.scss +3 -0
  188. package/dist/styles/clarity/Fieldset/fieldset.clarity.scss +49 -0
  189. package/dist/styles/clarity/Heading/heading.clarity.scss +46 -0
  190. package/dist/styles/clarity/HoverCard/hover-card.clarity.scss +43 -0
  191. package/dist/styles/clarity/Kbd/kbd.clarity.scss +55 -0
  192. package/dist/styles/clarity/Label/label.clarity.scss +11 -0
  193. package/dist/styles/clarity/Link/link.clarity.scss +41 -0
  194. package/dist/styles/clarity/Menubar/menubar.clarity.scss +149 -0
  195. package/dist/styles/clarity/Meter/meter.clarity.scss +39 -0
  196. package/dist/styles/clarity/Minimap/minimap.clarity.scss +92 -0
  197. package/dist/styles/clarity/NavigationMenu/navigation-menu.clarity.scss +128 -0
  198. package/dist/styles/clarity/NumberField/number-field.clarity.scss +135 -0
  199. package/dist/styles/clarity/Popover/popover.clarity.scss +106 -0
  200. package/dist/styles/clarity/Progress/progress.clarity.scss +38 -0
  201. package/dist/styles/clarity/Quote/quote.clarity.scss +26 -0
  202. package/dist/styles/clarity/Radio/radio.clarity.scss +76 -0
  203. package/dist/styles/clarity/RadioCards/radiocards.clarity.scss +134 -0
  204. package/dist/styles/clarity/RadioGroup/radio-group.clarity.scss +99 -0
  205. package/dist/styles/clarity/ScrollArea/scroll-area.clarity.scss +112 -0
  206. package/dist/styles/clarity/Select/select.clarity.scss +228 -0
  207. package/dist/styles/clarity/Separator/separator.clarity.scss +23 -0
  208. package/dist/styles/clarity/Skeleton/skeleton.clarity.scss +33 -0
  209. package/dist/styles/clarity/Slider/slider.clarity.scss +203 -0
  210. package/dist/styles/clarity/Spinner/spinner.clarity.scss +52 -0
  211. package/dist/styles/clarity/Splitter/splitter.clarity.scss +151 -0
  212. package/dist/styles/clarity/Steps/steps.clarity.scss +143 -0
  213. package/dist/styles/clarity/Strong/strong.clarity.scss +6 -0
  214. package/dist/styles/clarity/Switch/switch.clarity.scss +89 -0
  215. package/dist/styles/clarity/TabNav/tab-nav.clarity.scss +69 -0
  216. package/dist/styles/clarity/Table/table.clarity.scss +128 -0
  217. package/dist/styles/clarity/Tabs/tabs.clarity.scss +91 -0
  218. package/dist/styles/clarity/Text/text.clarity.scss +5 -0
  219. package/dist/styles/clarity/TextArea/textarea.clarity.scss +146 -0
  220. package/dist/styles/clarity/TextField/text-field.clarity.scss +120 -0
  221. package/dist/styles/clarity/Toast/toast.clarity.scss +203 -0
  222. package/dist/styles/clarity/Toggle/toggle.clarity.scss +51 -0
  223. package/dist/styles/clarity/ToggleGroup/toggle-group.clarity.scss +103 -0
  224. package/dist/styles/clarity/Toolbar/toolbar.clarity.scss +140 -0
  225. package/dist/styles/clarity/Tooltip/tooltip.clarity.scss +37 -0
  226. package/dist/styles/clarity/Tree/tree.clarity.scss +103 -0
  227. package/dist/themes/baremetal.css +1 -1
  228. package/dist/themes/default.css +1 -1
  229. package/package.json +21 -2
  230. package/dist/components/ComboboxPrimitive-DQcJ8pzQ.js +0 -1
  231. package/dist/components/ComboboxPrimitive-kFYDdMUS.cjs +0 -1
  232. package/dist/components/MenuPrimitive-B1-7Sfhj.cjs +0 -1
  233. package/dist/components/MenuPrimitive-D9VMz2TZ.js +0 -1
  234. package/dist/components/RadioGroupPrimitive-CpA06FS_.cjs +0 -1
  235. package/dist/components/RadioGroupPrimitive-D1PP4y2M.js +0 -1
  236. package/dist/components/index-CbKtybdA.cjs +0 -1
  237. package/dist/components/index-D8I-rMwz.js +0 -1
  238. package/dist/components/index-XF8itt-H.js +0 -1
@@ -2,4 +2,4 @@
2
2
  /*!
3
3
  * tabbable 6.2.0
4
4
  * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
5
- */var ie=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),ue="undefined"==typeof Element,le=ue?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ce=!ue&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},se=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},ae=function(e,t,n){if(se(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ie));return t&&le.call(e,ie)&&r.unshift(e),r=r.filter(n)},fe=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var u=i.shift();if(!se(u,!1))if("SLOT"===u.tagName){var l=u.assignedElements(),c=e(l.length?l:u.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:u,candidates:c})}else{le.call(u,ie)&&r.filter(u)&&(n||!t.includes(u))&&o.push(u);var s=u.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(u),a=!se(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(u));if(s&&a){var f=e(!0===s?u.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:u,candidates:f})}else i.unshift.apply(i,u.children)}}return o},de=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},me=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!de(e)?0:e.tabIndex},pe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ve=function(e){return"INPUT"===e.tagName},ge=function(e){return function(e){return ve(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ce(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},he=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ye=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=le.call(e,"details>summary:first-of-type")?e.parentElement:e;if(le.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return he(e)}else{if("function"==typeof r){for(var i=e;e;){var u=e.parentElement,l=ce(e);if(u&&!u.shadowRoot&&!0===r(u))return he(e);e=e.assignedSlot?e.assignedSlot:u||l===e.ownerDocument?u:l.host}e=i}if(function(e){var t,n,r,o,i=e&&ce(e),u=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&u;){var c,s,a;l=!(null===(s=u=null===(c=i=ce(u))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(u))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},we=function(e,t){return!(t.disabled||se(t)||function(e){return ve(e)&&"hidden"===e.type}(t)||ye(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!le.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},be=function(e,t){return!(ge(t)||me(t)<0||!we(e,t))},xe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Re=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,u=i?t.scopeParent:t,l=function(e,t){var n=me(e);return n<0&&t&&!de(e)?0:n}(u,i),c=i?e(t.candidates):u;0===l?i?n.push.apply(n,c):n.push(u):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:c})})),r.sort(pe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ee=function(e,t){var n;return n=(t=t||{}).getShadowRoot?fe([e],t.includeContainer,{filter:be.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:xe}):ae(e,t.includeContainer,be.bind(null,t)),Re(n)},ke=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==le.call(e,ie)&&be(t,e)};function Ie(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Ce(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function Se(){return/apple/i.test(navigator.vendor)}function Ae(){const e=/android/i;return e.test(Ie())||e.test(Ce())}function Le(){return Ce().includes("jsdom/")}const Me="data-floating-ui-focusable",Te="ArrowLeft",Oe="ArrowRight";function De(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Pe(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ne(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Fe(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function We(e){return(null==e?void 0:e.ownerDocument)||document}function Be(e){return d(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function _e(e){return!!e&&("combobox"===e.getAttribute("role")&&Be(e))}function He(e){return e?e.hasAttribute(Me)?e:e.querySelector("["+Me+"]")||e:null}function Ke(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))})).flatMap((t=>[t,...Ke(e,t.id,n)]))}function Ve(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function qe(e){e.preventDefault(),e.stopPropagation()}function ze(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Ae()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function je(e){return!Le()&&(!Ae()&&0===e.width&&0===e.height||Ae()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function Ue(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Xe="undefined"!=typeof document?t:function(){};function Ye(t){const n=e.useRef(t);return Xe((()=>{n.current=t})),n}const $e={...e}.useInsertionEffect||(e=>e());function Ge(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return $e((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}function Qe(e,t,n){return Math.floor(e/t)!==n}function Ze(e,t){return t<0||t>=e.current.length}function Je(e,t){return tt(e,{disabledIndices:t})}function et(e,t){return tt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function tt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t,u=n;do{u+=r?-i:i}while(u>=0&&u<=e.current.length-1&&ut(e,u,o));return u}function nt(e,t){let{event:n,orientation:r,loop:o,rtl:i,cols:u,disabledIndices:l,minIndex:c,maxIndex:s,prevIndex:a,stopEvent:f=!1}=t,d=a;if("ArrowUp"===n.key){if(f&&qe(n),-1===a)d=s;else if(d=tt(e,{startingIndex:d,amount:u,decrement:!0,disabledIndices:l}),o&&(a-u<c||d<0)){const e=a%u,t=s%u,n=s-(t-e);d=t===e?s:t>e?n:n-u}Ze(e,d)&&(d=a)}if("ArrowDown"===n.key&&(f&&qe(n),-1===a?d=c:(d=tt(e,{startingIndex:a,amount:u,disabledIndices:l}),o&&a+u>s&&(d=tt(e,{startingIndex:a%u-u,amount:u,disabledIndices:l}))),Ze(e,d)&&(d=a)),"both"===r){const t=W(a/u);n.key===(i?Te:Oe)&&(f&&qe(n),a%u!=u-1?(d=tt(e,{startingIndex:a,disabledIndices:l}),o&&Qe(d,u,t)&&(d=tt(e,{startingIndex:a-a%u-1,disabledIndices:l}))):o&&(d=tt(e,{startingIndex:a-a%u-1,disabledIndices:l})),Qe(d,u,t)&&(d=a)),n.key===(i?Oe:Te)&&(f&&qe(n),a%u!=0?(d=tt(e,{startingIndex:a,decrement:!0,disabledIndices:l}),o&&Qe(d,u,t)&&(d=tt(e,{startingIndex:a+(u-a%u),decrement:!0,disabledIndices:l}))):o&&(d=tt(e,{startingIndex:a+(u-a%u),decrement:!0,disabledIndices:l})),Qe(d,u,t)&&(d=a));const r=W(s/u)===t;Ze(e,d)&&(d=o&&r?n.key===(i?Oe:Te)?s:tt(e,{startingIndex:a-a%u-1,disabledIndices:l}):a)}return d}function rt(e,t,n){const r=[];let o=0;return e.forEach(((e,i)=>{let{width:u,height:l}=e;if(u>t&&"production"!==process.env.NODE_ENV)throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const e=[];for(let n=0;n<u;n++)for(let r=0;r<l;r++)e.push(o+n+r*t);o%t+u<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=i})),c=!0):o++}})),[...r]}function ot(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),u=t[e];switch(o){case"tl":return i;case"tr":return u?i+u.width-1:i;case"bl":return u?i+(u.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function it(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function ut(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);const r=e.current[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}const lt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ct(e,t){const n=Ee(e,lt()),r=n.length;if(0===r)return;const o=De(We(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function st(e){return ct(We(e).body,1)||e}function at(e){return ct(We(e).body,-1)||e}function ft(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Pe(n,r)}function dt(e){Ee(e,lt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function mt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}function pt(e,t,n){let{reference:r,floating:o}=e;const i=Y(t),u=$(t),l=U(u),c=q(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:a,y:r.y-o.height};break;case"bottom":m={x:a,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(z(t)){case"start":m[u]-=d*(n&&s?-1:1);break;case"end":m[u]+=d*(n&&s?-1:1)}return m}async function vt(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:u,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=V(t,e),p=re(m),v=l[d?"floating"===f?"reference":"floating":f],g=oe(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:a,strategy:c})),h="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=oe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:h,offsetParent:y,strategy:c}):h);return{top:(g.top-b.top+p.top)/w.y,bottom:(b.bottom-g.bottom+p.bottom)/w.y,left:(g.left-b.left+p.left)/w.x,right:(b.right-g.right+p.right)/w.x}}function gt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ht(e){return D.some((t=>e[t]>=0))}const yt=new Set(["left","top"]);function wt(e){const t=S(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=d(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,l=F(n)!==i||F(r)!==u;return l&&(n=i,r=u),{width:n,height:r,$:l}}function bt(e){return f(e)?e:e.contextElement}function xt(e){const t=bt(e);if(!d(t))return B(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=wt(t);let u=(i?F(n.width):n.width)/r,l=(i?F(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),l&&Number.isFinite(l)||(l=1),{x:u,y:l}}const Rt=B(0);function Et(e){const t=c(e);return k()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Rt}function kt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=bt(e);let u=B(1);t&&(r?f(r)&&(u=xt(r)):u=xt(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==c(e))&&t}(i,n,r)?Et(i):B(0);let s=(o.left+l.x)/u.x,a=(o.top+l.y)/u.y,d=o.width/u.x,m=o.height/u.y;if(i){const e=c(i),t=r&&f(r)?c(r):r;let n=e,o=O(n);for(;o&&r&&t!==n;){const e=xt(o),t=o.getBoundingClientRect(),r=S(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,u=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,a*=e.y,d*=e.x,m*=e.y,s+=i,a+=u,n=c(o),o=O(n)}}return oe({width:d,height:m,x:s,y:a})}function It(e,t){const n=A(e).scrollLeft;return t?t.left+n:kt(s(e)).left+n}function Ct(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-It(e,n),y:n.top+t.scrollTop}}const St=new Set(["absolute","fixed"]);function At(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=c(e),r=s(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,l=0,a=0;if(o){i=o.width,u=o.height;const e=k();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,a=o.offsetTop)}const f=It(r);if(f<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,u=Math.abs(r.clientWidth-t.clientWidth-o);u<=25&&(i-=u)}else f<=25&&(i+=f);return{width:i,height:u,x:l,y:a}}(e,n);else if("document"===t)r=function(e){const t=s(e),n=A(e),r=e.ownerDocument.body,o=N(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=N(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+It(e);const l=-n.scrollTop;return"rtl"===S(r).direction&&(u+=N(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:l}}(s(e));else if(f(t))r=function(e,t){const n=kt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=d(e)?xt(e):B(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oe(r)}function Lt(e,t){const n=L(e);return!(n===t||!f(n)||C(n))&&("fixed"===S(n).position||Lt(n,t))}function Mt(e,t,n){const r=d(t),o=s(t),i="fixed"===n,u=kt(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const a=B(0);function f(){a.x=It(o)}if(r||!r&&!i)if(("body"!==l(t)||v(o))&&(c=A(t)),r){const e=kt(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&f();i&&!r&&o&&f();const m=!o||r||i?B(0):Ct(o,c);return{x:u.left+c.scrollLeft-a.x-m.x,y:u.top+c.scrollTop-a.y-m.y,width:u.width,height:u.height}}function Tt(e){return"static"===S(e).position}function Ot(e,t){if(!d(e)||"fixed"===S(e).position)return null;if(t)return t(e);let n=e.offsetParent;return s(e)===n&&(n=n.ownerDocument.body),n}function Dt(e,t){const n=c(e);if(w(e))return n;if(!d(e)){let t=L(e);for(;t&&!C(t);){if(f(t)&&!Tt(t))return t;t=L(t)}return n}let r=Ot(e,t);for(;r&&h(r)&&Tt(r);)r=Ot(r,t);return r&&C(r)&&Tt(r)&&!E(r)?n:r||function(e){let t=L(e);for(;d(t)&&!C(t);){if(E(t))return t;if(w(t))return null;t=L(t)}return null}(e)||n}const Pt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=s(r),c=!!t&&w(t.floating);if(r===u||c&&i)return n;let a={scrollLeft:0,scrollTop:0},f=B(1);const m=B(0),p=d(r);if((p||!p&&!i)&&(("body"!==l(r)||v(u))&&(a=A(r)),d(r))){const e=kt(r);f=xt(r),m.x=e.x+r.clientLeft,m.y=e.y+r.clientTop}const g=!u||p||i?B(0):Ct(u,a);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+m.x+g.x,y:n.y*f.y-a.scrollTop*f.y+m.y+g.y}},getDocumentElement:s,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?w(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=T(e,[],!1).filter((e=>f(e)&&"body"!==l(e))),o=null;const i="fixed"===S(e).position;let u=i?L(e):e;for(;f(u)&&!C(u);){const t=S(u),n=E(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&St.has(o.position)||v(u)&&!n&&Lt(e,u))?r=r.filter((e=>e!==u)):o=t,u=L(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=i[0],c=i.reduce(((e,n)=>{const r=At(t,n,o);return e.top=N(r.top,e.top),e.right=P(r.right,e.right),e.bottom=P(r.bottom,e.bottom),e.left=N(r.left,e.left),e}),At(t,u,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Dt,getElementRects:async function(e){const t=this.getOffsetParent||Dt,n=this.getDimensions,r=await n(e.floating);return{reference:Mt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=wt(e);return{width:t,height:n}},getScale:xt,isElement:f,isRTL:function(e){return"rtl"===S(e).direction}};function Nt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ft(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,a=bt(e),f=o||i?[...a?T(a):[],...T(t)]:[];f.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=a&&l?function(e,t){let n,r=null;const o=s(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function u(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),i();const s=e.getBoundingClientRect(),{left:a,top:f,width:d,height:m}=s;if(l||t(),!d||!m)return;const p={rootMargin:-W(f)+"px "+-W(o.clientWidth-(a+d))+"px "+-W(o.clientHeight-(f+m))+"px "+-W(a)+"px",threshold:N(0,P(1,c))||1};let v=!0;function g(t){const r=t[0].intersectionRatio;if(r!==c){if(!v)return u();r?u(!1,r):n=setTimeout((()=>{u(!1,1e-7)}),1e3)}1!==r||Nt(s,e.getBoundingClientRect())||u(),v=!1}try{r=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),i}(a,n):null;let m,p=-1,v=null;u&&(v=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=v)||e.observe(t)}))),n()})),a&&!c&&v.observe(a),v.observe(t));let g=c?kt(e):null;return c&&function t(){const r=kt(e);g&&!Nt(g,r)&&n();g=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=v)||e.disconnect(),v=null,c&&cancelAnimationFrame(m)}}const Wt=vt,Bt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:u,middlewareData:l}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),u=q(n),l=z(n),c="y"===Y(n),s=yt.has(u)?-1:1,a=i&&c?-1:1,f=V(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof p&&(m="end"===l?-1*p:p),c?{x:m*a,y:d*s}:{x:d*s,y:m*a}}(t,e);return u===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:u}}}}},_t=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:u=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=V(e,t),s={x:n,y:r},a=await vt(t,c),f=Y(q(o)),d=j(f);let m=s[d],p=s[f];if(i){const e="y"===d?"bottom":"right";m=K(m+a["y"===d?"top":"left"],m,m-a[e])}if(u){const e="y"===f?"bottom":"right";p=K(p+a["y"===f?"top":"left"],p,p-a[e])}const v=l.fn({...t,[d]:m,[f]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:u}}}}}},Ht=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:u,initialPlacement:l,platform:c,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=V(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=q(o),y=Y(l),w=q(l)===l,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[ne(l)]:function(e){const t=ne(e);return[G(e),t,G(t)]}(l)),R="none"!==p;!d&&R&&x.push(...te(l,v,p,b));const E=[l,...x],k=await vt(t,g),I=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&I.push(k[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=z(e),o=$(e),i=U(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=ne(u)),[u,ne(u)]}(o,u,b);I.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:I}],!I.every((e=>e<=0))){var S,A;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=E[e];if(t){if(!("alignment"===f&&y!==Y(t))||C.every((e=>Y(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(A=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(m){case"bestFit":{var L;const e=null==(L=C.filter((e=>{if(R){const t=Y(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},Kt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:u,elements:l}=t,{apply:c=()=>{},...s}=V(e,t),a=await vt(t,s),f=q(o),d=z(o),m="y"===Y(o),{width:p,height:v}=i.floating;let g,h;"top"===f||"bottom"===f?(g=f,h=d===(await(null==u.isRTL?void 0:u.isRTL(l.floating))?"start":"end")?"left":"right"):(h=f,g="end"===d?"top":"bottom");const y=v-a.top-a.bottom,w=p-a.left-a.right,b=P(v-a[g],y),x=P(p-a[h],w),R=!t.middlewareData.shift;let E=b,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),R&&!d){const e=N(a.left,0),t=N(a.right,0),n=N(a.top,0),r=N(a.bottom,0);m?k=p-2*(0!==e||0!==t?e+t:N(a.left,a.right)):E=v-2*(0!==n||0!==r?n+r:N(a.top,a.bottom))}await c({...t,availableWidth:k,availableHeight:E});const I=await u.getDimensions(l.floating);return p!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}},Vt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=V(e,t);switch(r){case"referenceHidden":{const e=gt(await vt(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ht(e)}}}case"escaped":{const e=gt(await vt(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ht(e)}}}default:return{}}}}},qt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:u,elements:l,middlewareData:c}=t,{element:s,padding:a=0}=V(e,t)||{};if(null==s)return{};const f=re(a),d={x:n,y:r},m=$(o),p=U(m),v=await u.getDimensions(s),g="y"===m,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[m]-d[m]-i.floating[p],x=d[m]-i.reference[m],R=await(null==u.getOffsetParent?void 0:u.getOffsetParent(s));let E=R?R[w]:0;E&&await(null==u.isElement?void 0:u.isElement(R))||(E=l.floating[w]||i.floating[p]);const k=b/2-x/2,I=E/2-v[p]/2-1,C=P(f[h],I),S=P(f[y],I),A=C,L=E-v[p]-S,M=E/2-v[p]/2+k,T=K(A,M,L),O=!c.arrow&&null!=z(o)&&M!==T&&i.reference[p]/2-(M<A?C:S)-v[p]/2<0,D=O?M<A?M-A:M-L:0;return{[m]:d[m]+D,data:{[m]:T,centerOffset:M-T-D,...O&&{alignmentOffset:D}},reset:O}}}),zt=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:u}=t,{offset:l=0,mainAxis:c=!0,crossAxis:s=!0}=V(e,t),a={x:n,y:r},f=Y(o),d=j(f);let m=a[d],p=a[f];const v=V(l,t),g="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+g.mainAxis,n=i.reference[d]+i.reference[e]-g.mainAxis;m<t?m=t:m>n&&(m=n)}if(s){var h,y;const e="y"===d?"width":"height",t=yt.has(q(o)),n=i.reference[f]-i.floating[e]+(t&&(null==(h=u.offset)?void 0:h[f])||0)+(t?0:g.crossAxis),r=i.reference[f]+i.reference[e]+(t?0:(null==(y=u.offset)?void 0:y[f])||0)-(t?g.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[d]:m,[f]:p}}}},jt=(e,t,n)=>{const r=new Map,o={platform:Pt,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,l=i.filter(Boolean),c=await(null==u.isRTL?void 0:u.isRTL(t));let s=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=pt(s,r,c),d=r,m={},p=0;for(let n=0;n<l.length;n++){const{name:i,fn:v}=l[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:s,platform:u,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,m={...m,[i]:{...m[i],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await u.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=pt(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var Ut="undefined"!=typeof document?t:function(){};function Xt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Xt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Xt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Yt(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $t(e,t){const n=Yt(e);return Math.round(t*n)/n}function Gt(t){const n=e.useRef(t);return Ut((()=>{n.current=t})),n}const Qt=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?qt({element:n.current,padding:r}).fn(t):{}:n?qt({element:n,padding:r}).fn(t):{};var o}}),Zt=(e,t)=>({...Bt(e),options:[e,t]}),Jt=(e,t)=>({..._t(e),options:[e,t]}),en=(e,t)=>({...zt(e),options:[e,t]}),tn=(e,t)=>({...Ht(e),options:[e,t]}),nn=(e,t)=>({...Kt(e),options:[e,t]}),rn=(e,t)=>({...Vt(e),options:[e,t]}),on=(e,t)=>({...Qt(e),options:[e,t]});function un(t){const n=e.useRef(void 0),r=e.useCallback((e=>{const n=t.map((t=>{if(null!=t){if("function"==typeof t){const n=t,r=n(e);return"function"==typeof r?r:()=>{n(null)}}return t.current=e,()=>{t.current=null}}}));return()=>{n.forEach((e=>null==e?void 0:e()))}}),t);return e.useMemo((()=>t.every((e=>null==e))?null:e=>{n.current&&(n.current(),n.current=void 0),null!=e&&(n.current=r(e))}),t)}function ln(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const cn=e.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function sn(t){const{children:r,elementsRef:o,labelsRef:i}=t,[u,l]=e.useState((()=>new Set)),c=e.useCallback((e=>{l((t=>new Set(t).add(e)))}),[]),s=e.useCallback((e=>{l((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),a=e.useMemo((()=>{const e=new Map;return Array.from(u.keys()).sort(ln).forEach(((t,n)=>{e.set(t,n)})),e}),[u]);return n(cn.Provider,{value:e.useMemo((()=>({register:c,unregister:s,map:a,elementsRef:o,labelsRef:i})),[c,s,a,o,i]),children:r})}function an(t){void 0===t&&(t={});const{label:n}=t,{register:r,unregister:o,map:i,elementsRef:u,labelsRef:l}=e.useContext(cn),[c,s]=e.useState(null),a=e.useRef(null),f=e.useCallback((e=>{if(a.current=e,null!==c&&(u.current[c]=e,l)){var t;const r=void 0!==n;l.current[c]=r?n:null!=(t=null==e?void 0:e.textContent)?t:null}}),[c,u,l,n]);return Xe((()=>{const e=a.current;if(e)return r(e),()=>{o(e)}}),[r,o]),Xe((()=>{const e=a.current?i.get(a.current):null;null!=e&&s(e)}),[i]),e.useMemo((()=>({ref:f,index:null==c?-1:c})),[c,f])}const fn="data-floating-ui-focusable",dn="active",mn="selected",pn="ArrowLeft",vn="ArrowRight",gn="ArrowUp",hn="ArrowDown";function yn(t,r){return"function"==typeof t?t(r):t?e.cloneElement(t,r):n("div",{...r})}const wn=e.createContext({activeIndex:0,onNavigate:()=>{}}),bn=[pn,vn],xn=[gn,hn],Rn=[...bn,...xn],En=e.forwardRef((function(t,r){const{render:o,orientation:i="both",loop:u=!0,rtl:l=!1,cols:c=1,disabledIndices:s,activeIndex:a,onNavigate:f,itemSizes:d,dense:m=!1,...p}=t,[v,g]=e.useState(0),h=null!=a?a:v,y=Ge(null!=f?f:g),w=e.useRef([]),b=o&&"function"!=typeof o?o.props:{},x=e.useMemo((()=>({activeIndex:h,onNavigate:y})),[h,y]),R=c>1;const E={...p,...b,ref:r,"aria-orientation":"both"===i?void 0:i,onKeyDown(e){null==p.onKeyDown||p.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!Rn.includes(e.key))return;let t=h;const n=Je(w,s),r=et(w,s),o=l?pn:vn,a=l?vn:pn;if(R){const a=d||Array.from({length:w.current.length},(()=>({width:1,height:1}))),f=rt(a,c,m),p=f.findIndex((e=>null!=e&&!ut(w,e,s))),v=f.reduce(((e,t,n)=>null==t||ut(w,t,s)?e:n),-1),g=f[nt({current:f.map((e=>e?w.current[e]:null))},{event:e,orientation:i,loop:u,rtl:l,cols:c,disabledIndices:it([...("function"!=typeof s?s:null)||w.current.map(((e,t)=>ut(w,t,s)?t:void 0)),void 0],f),minIndex:p,maxIndex:v,prevIndex:ot(h>r?n:h,a,f,c,e.key===hn?"bl":e.key===o?"tr":"tl")})];null!=g&&(t=g)}const f={horizontal:[o],vertical:[hn],both:[o,hn]}[i],p={horizontal:[a],vertical:[gn],both:[a,gn]}[i],v=R?Rn:{horizontal:bn,vertical:xn,both:Rn}[i];var g;t===h&&[...f,...p].includes(e.key)&&(t=u&&t===r&&f.includes(e.key)?n:u&&t===n&&p.includes(e.key)?r:tt(w,{startingIndex:t,decrement:p.includes(e.key),disabledIndices:s})),t===h||Ze(w,t)||(e.stopPropagation(),v.includes(e.key)&&e.preventDefault(),y(t),null==(g=w.current[t])||g.focus())}(e)}};return n(wn.Provider,{value:x,children:n(sn,{elementsRef:w,children:yn(o,E)})})})),kn=e.forwardRef((function(t,n){const{render:r,...o}=t,i=r&&"function"!=typeof r?r.props:{},{activeIndex:u,onNavigate:l}=e.useContext(wn),{ref:c,index:s}=an(),a=un([c,n,i.ref]),f=u===s;return yn(r,{...o,...i,ref:a,tabIndex:f?0:-1,"data-active":f?"":void 0,onFocus(e){null==o.onFocus||o.onFocus(e),null==i.onFocus||i.onFocus(e),l(s)}})})),In={...e};let Cn=!1,Sn=0;const An=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Sn++;const Ln=In.useId||function(){const[t,n]=e.useState((()=>Cn?An():void 0));return Xe((()=>{null==t&&n(An())}),[]),e.useEffect((()=>{Cn=!0}),[]),t};let Mn;function Tn(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Mn)&&e.has(o)||(null==(i=Mn)||i.add(o),console.warn(o))}"production"!==process.env.NODE_ENV&&(Mn=new Set);const On=e.forwardRef((function(t,o){const{context:{placement:i,elements:{floating:u},middlewareData:{arrow:l,shift:c}},width:s=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:m,stroke:p,d:v,style:{transform:g,...h}={},...y}=t;"production"!==process.env.NODE_ENV&&(o||Tn("The `ref` prop is required for `FloatingArrow`."));const w=Ln(),[b,x]=e.useState(!1);if(Xe((()=>{if(!u)return;"rtl"===S(u).direction&&x(!0)}),[u]),!u)return null;const[R,E]=i.split("-"),k="top"===R||"bottom"===R;let I=m;(k&&null!=c&&c.x||!k&&null!=c&&c.y)&&(I=null);const C=2*d,A=C/2,L=s/2*(f/-8+1),M=a/2*f/4,T=!!v,O=I&&"end"===E?"bottom":"top";let D=I&&"end"===E?"right":"left";I&&b&&(D="end"===E?"left":"right");const P=null!=(null==l?void 0:l.x)?I||l.x:"",N=null!=(null==l?void 0:l.y)?I||l.y:"",F=v||"M0,0 H"+s+" L"+(s-L)+","+(a-M)+" Q"+s/2+","+a+" "+L+","+(a-M)+" Z",W={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[R];return r("svg",{...y,"aria-hidden":!0,ref:o,width:T?s:s+C,height:s,viewBox:"0 0 "+s+" "+(a>s?a:s),style:{position:"absolute",pointerEvents:"none",[D]:P,[O]:N,[R]:k||T?"100%":"calc(100% - "+C/2+"px)",transform:[W,g].filter((e=>!!e)).join(" "),...h},children:[C>0&&n("path",{clipPath:"url(#"+w+")",fill:"none",stroke:p,strokeWidth:C+(v?0:1),d:F}),n("path",{stroke:C&&!v?y.fill:"none",d:F}),n("clipPath",{id:w,children:n("rect",{x:-A,y:A*(T?-1:1),width:s+C,height:s})})]})}));function Dn(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}const Pn=e.createContext(null),Nn=e.createContext(null),Fn=()=>{var t;return(null==(t=e.useContext(Pn))?void 0:t.id)||null},Wn=()=>e.useContext(Nn);function Bn(e){const t=Ln(),n=Wn(),r=Fn(),o=e||r;return Xe((()=>{if(!t)return;const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function _n(t){const{children:r,id:o}=t,i=Fn();return n(Pn.Provider,{value:e.useMemo((()=>({id:o,parentId:i})),[o,i]),children:r})}function Hn(t){const{children:r}=t,o=e.useRef([]),i=e.useCallback((e=>{o.current=[...o.current,e]}),[]),u=e.useCallback((e=>{o.current=o.current.filter((t=>t!==e))}),[]),[l]=e.useState((()=>Dn()));return n(Nn.Provider,{value:e.useMemo((()=>({nodesRef:o,addNode:i,removeNode:u,events:l})),[i,u,l]),children:r})}function Kn(e){return"data-floating-ui-"+e}function Vn(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const qn=Kn("safe-polygon");function zn(e,t,n){if(n&&!Ue(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function jn(e){return"function"==typeof e?e():e}function Un(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:u,elements:l}=t,{enabled:c=!0,delay:s=0,handleClose:a=null,mouseOnly:d=!1,restMs:m=0,move:p=!0}=n,v=Wn(),g=Fn(),h=Ye(a),y=Ye(s),w=Ye(r),b=Ye(m),x=e.useRef(),R=e.useRef(-1),E=e.useRef(),k=e.useRef(-1),I=e.useRef(!0),C=e.useRef(!1),S=e.useRef((()=>{})),A=e.useRef(!1),L=Ge((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}));e.useEffect((()=>{if(c)return u.on("openchange",e),()=>{u.off("openchange",e)};function e(e){let{open:t}=e;t||(Vn(R),Vn(k),I.current=!0,A.current=!1)}}),[c,u]),e.useEffect((()=>{if(!c)return;if(!h.current)return;if(!r)return;function e(e){L()&&o(!1,e,"hover")}const t=We(l.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l.floating,r,o,c,h,L]);const M=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=zn(y.current,"close",x.current);r&&!E.current?(Vn(R),R.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(Vn(R),o(!1,e,n))}),[y,o]),T=Ge((()=>{S.current(),E.current=void 0})),O=Ge((()=>{if(C.current){const e=We(l.floating).body;e.style.pointerEvents="",e.removeAttribute(qn),C.current=!1}})),D=Ge((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&f(l.domReference)){const o=l.domReference,i=l.floating;return r&&o.addEventListener("mouseleave",n),p&&o.addEventListener("mousemove",e,{once:!0}),o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",t),i&&(i.addEventListener("mouseleave",n),i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",s)),()=>{r&&o.removeEventListener("mouseleave",n),p&&o.removeEventListener("mousemove",e),o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",t),i&&(i.removeEventListener("mouseleave",n),i.removeEventListener("mouseenter",u),i.removeEventListener("mouseleave",s))}}function e(e){if(Vn(R),I.current=!1,d&&!Ue(x.current)||jn(b.current)>0&&!zn(y.current,"open"))return;const t=zn(y.current,"open",x.current);t?R.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function t(e){if(D())return void O();S.current();const t=We(l.floating);if(Vn(k),A.current=!1,h.current&&i.current.floatingContext){r||Vn(R),E.current=h.current({...i.current.floatingContext,tree:v,x:e.clientX,y:e.clientY,onClose(){O(),T(),D()||M(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==x.current||!Pe(l.floating,e.relatedTarget))&&M(e)}function n(e){D()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:v,x:e.clientX,y:e.clientY,onClose(){O(),T(),D()||M(e)}})(e))}function u(){Vn(R)}function s(e){D()||M(e,!1)}}),[l,c,t,d,p,M,T,O,o,r,w,v,y,h,i,D,b]),Xe((()=>{var e;if(c&&r&&null!=(e=h.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&L()){C.current=!0;const e=l.floating;if(f(l.domReference)&&e){var t;const n=We(l.floating).body;n.setAttribute(qn,"");const r=l.domReference,o=null==v||null==(t=v.nodesRef.current.find((e=>e.id===g)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[c,r,g,l,v,h,L]),Xe((()=>{r||(x.current=void 0,A.current=!1,T(),O())}),[r,T,O]),e.useEffect((()=>()=>{T(),Vn(R),Vn(k),O()}),[c,l.domReference,T,O]);const P=e.useMemo((()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){I.current||w.current||o(!0,t,"hover")}d&&!Ue(x.current)||r||0===jn(b.current)||A.current&&e.movementX**2+e.movementY**2<2||(Vn(k),"touch"===x.current?n():(A.current=!0,k.current=window.setTimeout(n,jn(b.current))))}}}),[d,o,r,w,b]);return e.useMemo((()=>c?{reference:P}:{}),[c,P])}let Xn=0;function Yn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Xn);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Xn=requestAnimationFrame(i)}function $n(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Gn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Qn(e){return"inert"===e?Gn.inert:"aria-hidden"===e?Gn["aria-hidden"]:Gn.none}let Zn=new WeakSet,Jn={},er=0;const tr=e=>e&&(e.host||tr(e.parentNode));function nr(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=(c=t,e.map((e=>{if(c.contains(e))return e;const t=tr(e);return c.contains(t)?t:null})).filter((e=>null!=e)));var c;const s=new Set,a=new Set(u),f=[];Jn[o]||(Jn[o]=new WeakMap);const d=Jn[o];return u.forEach((function e(t){if(!t||s.has(t))return;s.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||a.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==l(t))if(s.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Qn(i),u=(r.get(t)||0)+1,l=(d.get(t)||0)+1;r.set(t,u),d.set(t,l),f.push(t),1===u&&n&&Zn.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}}))}(t),s.clear(),er++,()=>{f.forEach((e=>{const t=Qn(i),n=(t.get(e)||0)-1,r=(d.get(e)||0)-1;t.set(e,n),d.set(e,r),n||(!Zn.has(e)&&i&&e.removeAttribute(i),Zn.delete(e)),r||e.removeAttribute(o)})),er--,er||(Gn.inert=new WeakMap,Gn["aria-hidden"]=new WeakMap,Gn.none=new WeakMap,Zn=new WeakSet,Jn={})}}function rr(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=(o=e[0],(null==o?void 0:o.ownerDocument)||document).body;var o;return nr(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const or={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},ir=e.forwardRef((function(t,r){const[o,i]=e.useState();Xe((()=>{Se()&&i("button")}),[]);const u={ref:r,tabIndex:0,role:o,"aria-hidden":!o||void 0,[Kn("focus-guard")]:"",style:or};return n("span",{...t,...u})})),ur=e.createContext(null),lr=Kn("portal");function cr(t){const{children:o,id:u,root:l,preserveTabOrder:c=!0}=t,s=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=Ln(),i=sr(),[u,l]=e.useState(null),c=e.useRef(null);return Xe((()=>()=>{null==u||u.remove(),queueMicrotask((()=>{c.current=null}))}),[u]),Xe((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(lr,""),e.appendChild(t),c.current=t,l(t)}),[n,o]),Xe((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!a(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const u=document.createElement("div");u.id=o,u.setAttribute(lr,""),e=t||e,e.appendChild(u),c.current=u,l(u)}),[n,r,o,i]),u}({id:u,root:l}),[f,d]=e.useState(null),m=e.useRef(null),p=e.useRef(null),v=e.useRef(null),g=e.useRef(null),h=null==f?void 0:f.modal,y=null==f?void 0:f.open,w=!!f&&!f.modal&&f.open&&c&&!(!l&&!s);return e.useEffect((()=>{if(s&&c&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){if(s&&ft(e)){("focusin"===e.type?mt:dt)(s)}}}),[s,c,h]),e.useEffect((()=>{s&&(y||mt(s))}),[y,s]),r(ur.Provider,{value:e.useMemo((()=>({preserveTabOrder:c,beforeOutsideRef:m,afterOutsideRef:p,beforeInsideRef:v,afterInsideRef:g,portalNode:s,setFocusManagerState:d})),[c,s]),children:[w&&s&&n(ir,{"data-type":"outside",ref:m,onFocus:e=>{if(ft(e,s)){var t;null==(t=v.current)||t.focus()}else{const e=at(f?f.domReference:null);null==e||e.focus()}}}),w&&s&&n("span",{"aria-owns":s.id,style:or}),s&&i.createPortal(o,s),w&&s&&n(ir,{"data-type":"outside",ref:p,onFocus:e=>{if(ft(e,s)){var t;null==(t=g.current)||t.focus()}else{const t=st(f?f.domReference:null);null==t||t.focus(),(null==f?void 0:f.closeOnFocusOut)&&(null==f||f.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const sr=()=>e.useContext(ur);function ar(t){return e.useMemo((()=>e=>{t.forEach((t=>{t&&(t.current=e)}))}),t)}let fr=[];function dr(){fr=fr.filter((e=>e.isConnected))}function mr(){return dr(),fr[fr.length-1]}function pr(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=lt(),o=function(e,t){return(t=t||{}).getShadowRoot?fe([e],t.includeContainer,{filter:we.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ae(e,t.includeContainer,we.bind(null,t))}(e,r),i=o.filter((e=>{const t=e.getAttribute("data-tabindex")||"";return ke(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")})),u=e.getAttribute("tabindex");t.current.includes("floating")||0===i.length?"0"!==u&&e.setAttribute("tabindex","0"):("-1"!==u||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const vr=e.forwardRef((function(e,t){return n("button",{...e,type:"button",ref:t,tabIndex:-1,style:or})}));function gr(t){const{context:i,children:u,disabled:c=!1,order:s=["content"],guards:a=!0,initialFocus:f=0,returnFocus:m=!0,restoreFocus:p=!1,modal:v=!0,visuallyHiddenDismiss:g=!1,closeOnFocusOut:h=!0,outsideElementsInert:y=!1,getInsideElements:w=()=>[]}=t,{open:b,onOpenChange:x,events:R,dataRef:E,elements:{domReference:k,floating:I}}=i,C=Ge((()=>{var e;return null==(e=E.current.floatingContext)?void 0:e.nodeId})),S=Ge(w),A="number"==typeof f&&f<0,L=_e(k)&&A,M="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,T=!M||a,O=!T||M&&y,D=Ye(s),P=Ye(f),N=Ye(m),F=Wn(),W=sr(),B=e.useRef(null),_=e.useRef(null),H=e.useRef(!1),K=e.useRef(!1),V=e.useRef(-1),q=e.useRef(-1),z=null!=W,j=He(I),U=Ge((function(e){return void 0===e&&(e=j),e?Ee(e,lt()):[]})),X=Ge((e=>{const t=U(e);return D.current.map((e=>k&&"reference"===e?k:j&&"floating"===e?j:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(c)return;if(!v)return;function e(e){if("Tab"===e.key){Pe(j,De(We(j)))&&0===U().length&&!L&&qe(e);const t=X(),n=Ne(e);"reference"===D.current[0]&&n===k&&(qe(e),e.shiftKey?Yn(t[t.length-1]):Yn(t[1])),"floating"===D.current[1]&&n===j&&e.shiftKey&&(qe(e),Yn(t[0]))}}const t=We(j);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[c,k,j,v,D,L,U,X]),e.useEffect((()=>{if(!c&&I)return I.addEventListener("focusin",e),()=>{I.removeEventListener("focusin",e)};function e(e){const t=Ne(e),n=U().indexOf(t);-1!==n&&(V.current=n)}}),[c,I,U]),e.useEffect((()=>{if(c)return;if(!h)return;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget,n=e.currentTarget,r=Ne(e);queueMicrotask((()=>{const o=C(),i=!(Pe(k,t)||Pe(I,t)||Pe(t,I)||Pe(null==W?void 0:W.portalNode,t)||null!=t&&t.hasAttribute(Kn("focus-guard"))||F&&(Ke(F.nodesRef.current,o).find((e=>{var n,r;return Pe(null==(n=e.context)?void 0:n.elements.floating,t)||Pe(null==(r=e.context)?void 0:r.elements.domReference,t)}))||Ve(F.nodesRef.current,o).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,He(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(n===k&&j&&pr(j,D),p&&n!==k&&(null==r||!r.isConnected)&&De(We(j))===We(j).body){d(j)&&j.focus();const e=V.current,t=U(),n=t[e]||t[t.length-1]||j;d(n)&&n.focus()}E.current.insideReactTree?E.current.insideReactTree=!1:!L&&v||!t||!i||K.current||t===mr()||(H.current=!0,x(!1,e,"focus-out"))}))}const n=Boolean(!F&&W);function r(){Vn(q),E.current.insideReactTree=!0,q.current=window.setTimeout((()=>{E.current.insideReactTree=!1}))}return I&&d(k)?(k.addEventListener("focusout",t),k.addEventListener("pointerdown",e),I.addEventListener("focusout",t),n&&I.addEventListener("focusout",r,!0),()=>{k.removeEventListener("focusout",t),k.removeEventListener("pointerdown",e),I.removeEventListener("focusout",t),n&&I.removeEventListener("focusout",r,!0)}):void 0}),[c,k,I,j,v,F,W,x,h,p,U,L,C,D,E]);const Y=e.useRef(null),$=e.useRef(null),G=ar([Y,null==W?void 0:W.beforeInsideRef]),Q=ar([$,null==W?void 0:W.afterInsideRef]);function Z(e){return!c&&g&&v?n(vr,{ref:"start"===e?B:_,onClick:e=>x(!1,e.nativeEvent),children:"string"==typeof g?g:"Dismiss"}):null}e.useEffect((()=>{var e,t;if(c)return;if(!I)return;const n=Array.from((null==W||null==(e=W.portalNode)?void 0:e.querySelectorAll("["+Kn("portal")+"]"))||[]),r=null==(t=(F?Ve(F.nodesRef.current,C()):[]).find((e=>{var t;return _e((null==(t=e.context)?void 0:t.elements.domReference)||null)})))||null==(t=t.context)?void 0:t.elements.domReference,o=[I,r,...n,...S(),B.current,_.current,Y.current,$.current,null==W?void 0:W.beforeOutsideRef.current,null==W?void 0:W.afterOutsideRef.current,D.current.includes("reference")||L?k:null].filter((e=>null!=e)),i=v||L?rr(o,!O,O):rr(o);return()=>{i()}}),[c,k,I,v,D,W,L,T,O,F,C,S]),Xe((()=>{if(c||!d(j))return;const e=De(We(j));queueMicrotask((()=>{const t=X(j),n=P.current,r=("number"==typeof n?t[n]:n.current)||j,o=Pe(j,e);A||o||!b||Yn(r,{preventScroll:r===j})}))}),[c,b,j,A,X,P]),Xe((()=>{if(c||!j)return;const e=We(j),t=De(e);var n;function r(e){let{reason:t,event:n,nested:r}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&(H.current=!0),"outside-press"===t)if(r)H.current=!1;else if(ze(n)||je(n))H.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),H.current=!e}}n=t,dr(),n&&"body"!==l(n)&&(fr.push(n),fr.length>20&&(fr=fr.slice(-20))),R.on("openchange",r);const o=e.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,or),z&&k&&k.insertAdjacentElement("afterend",o),()=>{R.off("openchange",r);const t=De(e),n=Pe(I,t)||F&&Ke(F.nodesRef.current,C(),!1).some((e=>{var n;return Pe(null==(n=e.context)?void 0:n.elements.floating,t)})),i=function(){if("boolean"==typeof N.current){const e=k||mr();return e&&e.isConnected?e:o}return N.current.current||o}();queueMicrotask((()=>{const r=function(e){const t=lt();return ke(e,t)?e:Ee(e,t)[0]||e}(i);N.current&&!H.current&&d(r)&&(r===t||t===e.body||n)&&r.focus({preventScroll:!0}),o.remove()}))}}),[c,I,j,N,E,R,F,z,k,C]),e.useEffect((()=>(queueMicrotask((()=>{H.current=!1})),()=>{queueMicrotask(dr)})),[c]),Xe((()=>{if(!c&&W)return W.setFocusManagerState({modal:v,closeOnFocusOut:h,open:b,onOpenChange:x,domReference:k}),()=>{W.setFocusManagerState(null)}}),[c,W,v,b,x,h,k]),Xe((()=>{c||j&&pr(j,D)}),[c,j,D]);const J=!c&&T&&(!v||!L)&&(z||v);return r(o,{children:[J&&n(ir,{"data-type":"inside",ref:G,onFocus:e=>{if(v){const e=X();Yn("reference"===s[0]?e[0]:e[e.length-1])}else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(H.current=!1,ft(e,W.portalNode)){const e=st(k);null==e||e.focus()}else{var t;null==(t=W.beforeOutsideRef.current)||t.focus()}}}),!L&&Z("start"),u,Z("end"),J&&n(ir,{"data-type":"inside",ref:Q,onFocus:e=>{if(v)Yn(X()[0]);else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(h&&(H.current=!0),ft(e,W.portalNode)){const e=at(k);null==e||e.focus()}else{var t;null==(t=W.afterOutsideRef.current)||t.focus()}}})]})}let hr=0;const yr="--floating-ui-scrollbar-width";let wr=()=>{};const br=e.forwardRef((function(e,t){const{lockScroll:r=!1,...o}=e;return Xe((()=>{if(r)return hr++,1===hr&&(wr=function(){const e=Ie(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,i=n.left?parseFloat(n.left):window.scrollX,u=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(yr,o+"px"),o&&(n[r]=o+"px"),t){var l,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,t=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(u-Math.floor(t))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[r]:""}),n.removeProperty(yr),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(i,u))}}()),()=>{hr--,0===hr&&wr()}}),[r]),n("div",{ref:t,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})}));function xr(e){return d(e.target)&&"BUTTON"===e.target.tagName}function Rr(e){return Be(e)}function Er(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,elements:{domReference:u}}=t,{enabled:l=!0,event:c="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0,stickIfOpen:m=!0}=n,p=e.useRef(),v=e.useRef(!1),g=e.useMemo((()=>({onPointerDown(e){p.current=e.pointerType},onMouseDown(e){const t=p.current;0===e.button&&"click"!==c&&(Ue(t,!0)&&a||(!r||!s||i.current.openEvent&&m&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent,"click")):o(!1,e.nativeEvent,"click")))},onClick(e){const t=p.current;"mousedown"===c&&p.current?p.current=void 0:Ue(t,!0)&&a||(!r||!s||i.current.openEvent&&m&&"click"!==i.current.openEvent.type?o(!0,e.nativeEvent,"click"):o(!1,e.nativeEvent,"click"))},onKeyDown(e){p.current=void 0,e.defaultPrevented||!f||xr(e)||(" "!==e.key||Rr(u)||(e.preventDefault(),v.current=!0),function(e){return d(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&o(!r||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||xr(e)||Rr(u)||" "===e.key&&v.current&&(v.current=!1,o(!r||!s,e.nativeEvent,"click"))}})),[i,u,c,a,f,o,r,m,s]);return e.useMemo((()=>l?{reference:g}:{}),[l,g])}const kr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ir={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Cr=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Sr(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:u}=t,{enabled:l=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:v=!1,bubbles:g,capture:h}=n,y=Wn(),w=Ge("function"==typeof s?s:()=>!1),b="function"==typeof s?w:s,x=e.useRef(!1),{escapeKey:R,outsidePress:E}=Cr(g),{escapeKey:I,outsidePress:A}=Cr(h),M=e.useRef(!1),O=Ge((e=>{var t;if(!r||!l||!c||"Escape"!==e.key)return;if(M.current)return;const n=null==(t=u.current.floatingContext)?void 0:t.nodeId,i=y?Ke(y.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),D=Ge((e=>{var t;const n=()=>{var t;O(e),null==(t=Ne(e))||t.removeEventListener("keydown",n)};null==(t=Ne(e))||t.addEventListener("keydown",n)})),P=Ge((e=>{var t;const n=u.current.insideReactTree;u.current.insideReactTree=!1;const r=x.current;if(x.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const l=Ne(e),c="["+Kn("inert")+"]",s=We(i.floating).querySelectorAll(c);let m=f(l)?l:null;for(;m&&!C(m);){const e=L(m);if(C(e)||!f(e))break;m=e}if(s.length&&f(l)&&!l.matches("html,body")&&!Pe(l,i.floating)&&Array.from(s).every((e=>!Pe(m,e))))return;if(d(l)&&W){const t=C(l),n=S(l),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),u=o&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,c=i&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=l.offsetWidth-l.clientWidth:e.offsetX>l.clientWidth),f=u&&e.offsetY>l.clientHeight;if(a||f)return}const p=null==(t=u.current.floatingContext)?void 0:t.nodeId,v=y&&Ke(y.nodesRef.current,p).some((t=>{var n;return Fe(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Fe(e,i.floating)||Fe(e,i.domReference)||v)return;const g=y?Ke(y.nodesRef.current,p):[];if(g.length>0){let e=!0;if(g.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),N=Ge((e=>{var t;const n=()=>{var t;P(e),null==(t=Ne(e))||t.removeEventListener(a,n)};null==(t=Ne(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!l)return;u.current.__escapeKeyBubbles=R,u.current.__outsidePressBubbles=E;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),M.current=!0}function s(){e=window.setTimeout((()=>{M.current=!1}),k()?5:0)}const d=We(i.floating);c&&(d.addEventListener("keydown",I?D:O,I),d.addEventListener("compositionstart",n),d.addEventListener("compositionend",s)),b&&d.addEventListener(a,A?N:P,A);let m=[];return v&&(f(i.domReference)&&(m=T(i.domReference)),f(i.floating)&&(m=m.concat(T(i.floating))),!f(i.reference)&&i.reference&&i.reference.contextElement&&(m=m.concat(T(i.reference.contextElement)))),m=m.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),m.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{c&&(d.removeEventListener("keydown",I?D:O,I),d.removeEventListener("compositionstart",n),d.removeEventListener("compositionend",s)),b&&d.removeEventListener(a,A?N:P,A),m.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[u,i,c,b,a,r,o,v,l,R,E,O,I,D,P,A,N]),e.useEffect((()=>{u.current.insideReactTree=!1}),[u,b,a]);const F=e.useMemo((()=>({onKeyDown:O,...m&&{[kr[p]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[O,o,m,p]),W=e.useMemo((()=>({onKeyDown:O,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Ir[a]]:()=>{u.current.insideReactTree=!0}})),[O,a,u]);return e.useMemo((()=>l?{reference:F,floating:W}:{}),[l,F,W])}function Ar(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=Ln(),u=e.useRef({}),[l]=e.useState((()=>Dn())),c=null!=Fn();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!f(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Mn)&&e.has(o)||(null==(i=Mn)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),d=Ge(((e,t,n)=>{u.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),m=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:u,open:n,onOpenChange:d,elements:p,events:l,floatingId:i,refs:m})),[n,d,p,l,i,m])}function Lr(t){void 0===t&&(t={});const{nodeId:n}=t,r=Ar({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,u=o.elements,[l,c]=e.useState(null),[s,a]=e.useState(null),d=(null==u?void 0:u.domReference)||l,m=e.useRef(null),p=Wn();Xe((()=>{d&&(m.current=d)}),[d]);const v=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:u,elements:{reference:l,floating:c}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,m]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,v]=e.useState(o);Xt(p,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==k.current&&(k.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==I.current&&(I.current=e,w(e))}),[]),R=l||g,E=c||y,k=e.useRef(null),I=e.useRef(null),C=e.useRef(d),S=null!=a,A=Gt(a),L=Gt(u),M=Gt(f),T=e.useCallback((()=>{if(!k.current||!I.current)return;const e={placement:n,strategy:r,middleware:p};L.current&&(e.platform=L.current),jt(k.current,I.current,e).then((e=>{const t={...e,isPositioned:!1!==M.current};O.current&&!Xt(C.current,t)&&(C.current=t,i.flushSync((()=>{m(t)})))}))}),[p,n,r,L,M]);Ut((()=>{!1===f&&C.current.isPositioned&&(C.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[f]);const O=e.useRef(!1);Ut((()=>(O.current=!0,()=>{O.current=!1})),[]),Ut((()=>{if(R&&(k.current=R),E&&(I.current=E),R&&E){if(A.current)return A.current(R,E,T);T()}}),[R,E,T,A,S]);const D=e.useMemo((()=>({reference:k,floating:I,setReference:b,setFloating:x})),[b,x]),P=e.useMemo((()=>({reference:R,floating:E})),[R,E]),N=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!P.floating)return e;const t=$t(P.floating,d.x),n=$t(P.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...Yt(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,P.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:T,refs:D,elements:P,floatingStyles:N})),[d,T,D,P,N])}({...t,elements:{...u,...s&&{reference:s}}}),g=e.useCallback((e=>{const t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;a(t),v.refs.setReference(t)}),[v.refs]),h=e.useCallback((e=>{(f(e)||null===e)&&(m.current=e,c(e)),(f(v.refs.reference.current)||null===v.refs.reference.current||null!==e&&!f(e))&&v.refs.setReference(e)}),[v.refs]),y=e.useMemo((()=>({...v.refs,setReference:h,setPositionReference:g,domReference:m})),[v.refs,h,g]),w=e.useMemo((()=>({...v.elements,domReference:d})),[v.elements,d]),b=e.useMemo((()=>({...v,...o,refs:y,elements:w,nodeId:n})),[v,y,w,n,o]);return Xe((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...v,context:b,refs:y,elements:w})),[v,y,w,b])}function Mr(){return Ie().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Se()}function Tr(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,dataRef:u,elements:l}=t,{enabled:s=!0,visibleOnly:a=!0}=n,m=e.useRef(!1),p=e.useRef(-1),v=e.useRef(!0);e.useEffect((()=>{if(!s)return;const e=c(l.domReference);function t(){!r&&d(l.domReference)&&l.domReference===De(We(l.domReference))&&(m.current=!0)}function n(){v.current=!0}function o(){v.current=!1}return e.addEventListener("blur",t),Mr()&&(e.addEventListener("keydown",n,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),Mr()&&(e.removeEventListener("keydown",n,!0),e.removeEventListener("pointerdown",o,!0))}}),[l.domReference,r,s]),e.useEffect((()=>{if(s)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(m.current=!0)}}),[i,s]),e.useEffect((()=>()=>{Vn(p)}),[]);const g=e.useMemo((()=>({onMouseLeave(){m.current=!1},onFocus(e){if(m.current)return;const t=Ne(e.nativeEvent);if(a&&f(t))if(Mr()&&!e.relatedTarget){if(!v.current&&!Be(t))return}else if(!function(e){if(!e||Le())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;o(!0,e.nativeEvent,"focus")},onBlur(e){m.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=f(t)&&t.hasAttribute(Kn("focus-guard"))&&"outside"===t.getAttribute("data-type");p.current=window.setTimeout((()=>{var e;const i=De(l.domReference?l.domReference.ownerDocument:document);(t||i!==l.domReference)&&(Pe(null==(e=u.current.floatingContext)?void 0:e.refs.floating.current,i)||Pe(l.domReference,i)||r||o(!1,n,"focus"))}))}})),[u,l.domReference,o,a]);return e.useMemo((()=>s?{reference:g}:{}),[s,g])}function Or(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[dn]:t,[mn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[fn]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var u;o&&[dn,mn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(u=r.get(n))||u.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}function Dr(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>Or(e,t,"reference")),n),u=e.useCallback((e=>Or(e,t,"floating")),r),l=e.useCallback((e=>Or(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:u,getItemProps:l})),[i,u,l])}function Pr(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Nr(e,t){return Pr(t,e===gn||e===hn,e===pn||e===vn)}function Fr(e,t,n){return Pr(t,e===hn,n?e===pn:e===vn)||"Enter"===e||" "===e||""===e}function Wr(e,t,n){return Pr(t,n?e===pn:e===vn,e===hn)}function Br(e,t,n,r){return"both"===t||"horizontal"===t&&r&&r>1?"Escape"===e:Pr(t,n?e===vn:e===pn,e===gn)}function _r(t,n){const{open:r,onOpenChange:o,elements:i,floatingId:u}=t,{listRef:l,activeIndex:c,onNavigate:s=()=>{},enabled:a=!0,selectedIndex:f=null,allowEscape:m=!1,loop:p=!1,nested:v=!1,rtl:g=!1,virtual:h=!1,focusItemOnOpen:y="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:R="vertical",parentOrientation:E,cols:k=1,scrollItemIntoView:I=!0,virtualItemRef:C,itemSizes:S,dense:A=!1}=n;"production"!==process.env.NODE_ENV&&(m&&(p||Tn("`useListNavigation` looping must be enabled to allow escaping."),h||Tn("`useListNavigation` must be virtual to allow escaping.")),"vertical"===R&&k>1&&Tn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const L=Ye(He(i.floating)),M=Fn(),T=Wn();Xe((()=>{t.dataRef.current.orientation=R}),[t,R]);const O=Ge((()=>{s(-1===N.current?null:N.current)})),D=_e(i.domReference),P=e.useRef(y),N=e.useRef(null!=f?f:-1),F=e.useRef(null),W=e.useRef(!0),B=e.useRef(O),_=e.useRef(!!i.floating),H=e.useRef(r),K=e.useRef(!1),V=e.useRef(!1),q=Ye(x),z=Ye(r),j=Ye(I),U=Ye(f),[X,Y]=e.useState(),[$,G]=e.useState(),Q=Ge((()=>{function e(e){var t;h?(null!=(t=e.id)&&t.endsWith("-fui-option")&&(e.id=u+"-"+Math.random().toString(16).slice(2,10)),Y(e.id),null==T||T.events.emit("virtualfocus",e),C&&(C.current=e)):Yn(e,{sync:K.current,preventScroll:!0})}const t=l.current[N.current],n=V.current;t&&e(t);(K.current?e=>e():requestAnimationFrame)((()=>{const r=l.current[N.current]||t;if(!r)return;t||e(r);const o=j.current;o&&J&&(n||!W.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof o?{block:"nearest",inline:"nearest"}:o))}))}));Xe((()=>{a&&(r&&i.floating?P.current&&null!=f&&(V.current=!0,N.current=f,O()):_.current&&(N.current=-1,B.current()))}),[a,r,i.floating,f,O]),Xe((()=>{if(a&&r&&i.floating)if(null==c){if(K.current=!1,null!=U.current)return;if(_.current&&(N.current=-1,Q()),(!H.current||!_.current)&&P.current&&(null!=F.current||!0===P.current&&null==F.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else N.current=null==F.current||Fr(F.current,R,g)||v?Je(l,q.current):et(l,q.current),F.current=null,O()};t()}}else Ze(l,c)||(N.current=c,Q(),V.current=!1)}),[a,r,i.floating,c,U,v,l,R,g,O,Q,q]),Xe((()=>{var e;if(!a||i.floating||!T||h||!_.current)return;const t=T.nodesRef.current,n=null==(e=t.find((e=>e.id===M)))||null==(e=e.context)?void 0:e.elements.floating,r=De(We(i.floating)),o=t.some((e=>e.context&&Pe(e.context.elements.floating,r)));n&&!o&&W.current&&n.focus({preventScroll:!0})}),[a,i.floating,T,M,h]),Xe((()=>{if(a&&T&&h&&!M)return T.events.on("virtualfocus",e),()=>{T.events.off("virtualfocus",e)};function e(e){G(e.id),C&&(C.current=e)}}),[a,T,h,M,C]),Xe((()=>{B.current=O,H.current=r,_.current=!!i.floating})),Xe((()=>{r||(F.current=null,P.current=y)}),[r,y]);const Z=null!=c,J=e.useMemo((()=>{function e(e){if(!z.current)return;const t=l.current.indexOf(e);-1!==t&&N.current!==t&&(N.current=t,O())}return{onFocus(t){let{currentTarget:n}=t;K.current=!0,e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},onMouseMove(t){let{currentTarget:n}=t;K.current=!0,V.current=!1,w&&e(n)},onPointerLeave(e){let{pointerType:t}=e;var n;W.current&&"touch"!==t&&(K.current=!0,w&&(N.current=-1,O(),h||null==(n=L.current)||n.focus({preventScroll:!0})))}}}),[z,L,w,l,O,h]),ee=e.useCallback((()=>{var e;return null!=E?E:null==T||null==(e=T.nodesRef.current.find((e=>e.id===M)))||null==(e=e.context)||null==(e=e.dataRef)?void 0:e.current.orientation}),[M,T,E]),te=Ge((e=>{if(W.current=!1,K.current=!0,229===e.which)return;if(!z.current&&e.currentTarget===L.current)return;if(v&&Br(e.key,R,g,k))return Nr(e.key,ee())||qe(e),o(!1,e.nativeEvent,"list-navigation"),void(d(i.domReference)&&(h?null==T||T.events.emit("virtualfocus",i.domReference):i.domReference.focus()));const t=N.current,n=Je(l,x),u=et(l,x);if(D||("Home"===e.key&&(qe(e),N.current=n,O()),"End"===e.key&&(qe(e),N.current=u,O())),k>1){const t=S||Array.from({length:l.current.length},(()=>({width:1,height:1}))),r=rt(t,k,A),o=r.findIndex((e=>null!=e&&!ut(l,e,x))),i=r.reduce(((e,t,n)=>null==t||ut(l,t,x)?e:n),-1),c=r[nt({current:r.map((e=>null!=e?l.current[e]:null))},{event:e,orientation:R,loop:p,rtl:g,cols:k,disabledIndices:it([...("function"!=typeof x?x:null)||l.current.map(((e,t)=>ut(l,t,x)?t:void 0)),void 0],r),minIndex:o,maxIndex:i,prevIndex:ot(N.current>u?n:N.current,t,r,k,e.key===hn?"bl":e.key===(g?pn:vn)?"tr":"tl"),stopEvent:!0})];if(null!=c&&(N.current=c,O()),"both"===R)return}if(Nr(e.key,R)){if(qe(e),r&&!h&&De(e.currentTarget.ownerDocument)===e.currentTarget)return N.current=Fr(e.key,R,g)?n:u,void O();Fr(e.key,R,g)?N.current=p?t>=u?m&&t!==l.current.length?-1:n:tt(l,{startingIndex:t,disabledIndices:x}):Math.min(u,tt(l,{startingIndex:t,disabledIndices:x})):N.current=p?t<=n?m&&-1!==t?l.current.length:u:tt(l,{startingIndex:t,decrement:!0,disabledIndices:x}):Math.max(n,tt(l,{startingIndex:t,decrement:!0,disabledIndices:x})),Ze(l,N.current)&&(N.current=-1),O()}})),ne=e.useMemo((()=>h&&r&&Z&&{"aria-activedescendant":$||X}),[h,r,Z,$,X]),re=e.useMemo((()=>({"aria-orientation":"both"===R?void 0:R,...D?{}:ne,onKeyDown:te,onPointerMove(){W.current=!0}})),[ne,te,R,D]),oe=e.useMemo((()=>{function e(e){"auto"===y&&ze(e.nativeEvent)&&(P.current=!0)}function t(e){P.current=y,"auto"===y&&je(e.nativeEvent)&&(P.current=!0)}return{...ne,onKeyDown(e){W.current=!1;const t=e.key.startsWith("Arrow"),n=["Home","End"].includes(e.key),i=t||n,u=Wr(e.key,R,g),c=Br(e.key,R,g,k),s=Wr(e.key,ee(),g),a=Nr(e.key,R),d=(v?s:a)||"Enter"===e.key||""===e.key.trim();if(h&&r){const t=null==T?void 0:T.nodesRef.current.find((e=>null==e.parentId)),r=T&&t?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),Ke(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(T.nodesRef.current,t.id):null;if(i&&r&&C){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(u||c){var m,p;const n=(null==(m=r.context)?void 0:m.elements.domReference)===e.currentTarget,o=c&&!n?null==(p=r.context)?void 0:p.elements.domReference:u?l.current.find((e=>(null==e?void 0:e.id)===X)):null;o&&(qe(e),o.dispatchEvent(t),G(void 0))}var y;if((a||n)&&r.context)if(r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return qe(e),void(null==(y=r.context.elements.domReference)||y.dispatchEvent(t))}return te(e)}if(r||b||!t){if(d){const t=Nr(e.key,ee());F.current=v&&t?null:e.key}v?s&&(qe(e),r?(N.current=Je(l,q.current),O()):o(!0,e.nativeEvent,"list-navigation")):a&&(null!=f&&(N.current=f),qe(e),!r&&b?o(!0,e.nativeEvent,"list-navigation"):te(e),r&&O())}},onFocus(){r&&!h&&(N.current=-1,O())},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}}),[X,ne,k,te,q,y,l,v,O,o,r,b,R,ee,g,f,T,h,C]);return e.useMemo((()=>a?{reference:oe,floating:re,item:J}:{}),[a,oe,re,J])}const Hr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Kr(t,n){var r,o;void 0===n&&(n={});const{open:i,elements:u,floatingId:l}=t,{enabled:c=!0,role:s="dialog"}=n,a=Ln(),f=(null==(r=u.domReference)?void 0:r.id)||a,d=e.useMemo((()=>{var e;return(null==(e=He(u.floating))?void 0:e.id)||l}),[u.floating,l]),m=null!=(o=Hr.get(s))?o:s,p=null!=Fn(),v=e.useMemo((()=>"tooltip"===m||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:i?d:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":"alertdialog"===m?"dialog":m,"aria-controls":i?d:void 0,..."listbox"===m&&{role:"combobox"},..."menu"===m&&{id:f},..."menu"===m&&p&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}}),[m,d,p,i,f,s]),g=e.useMemo((()=>{const e={id:d,...m&&{role:m}};return"tooltip"===m||"label"===s?e:{...e,..."menu"===m&&{"aria-labelledby":f}}}),[m,d,f,s]),h=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...r,"aria-selected":n}}return{}}),[d,s]);return e.useMemo((()=>c?{reference:v,floating:g,item:h}:{}),[c,v,g,h])}function Vr(t,n){var r;const{open:o,dataRef:i}=t,{listRef:u,activeIndex:l,onMatch:c,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:p=null}=n,v=e.useRef(-1),g=e.useRef(""),h=e.useRef(null!=(r=null!=p?p:l)?r:-1),y=e.useRef(null),w=Ge(c),b=Ge(s),x=Ye(f),R=Ye(m);Xe((()=>{o&&(Vn(v),y.current=null,g.current="")}),[o]),Xe((()=>{var e;o&&""===g.current&&(h.current=null!=(e=null!=p?p:l)?e:-1)}),[o,p,l]);const E=Ge((e=>{e?i.current.typing||(i.current.typing=e,b(e)):i.current.typing&&(i.current.typing=e,b(e))})),k=Ge((e=>{function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=u.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?E(!1):" "===e.key&&qe(e)),null==n||R.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;o&&" "!==e.key&&(qe(e),E(!0));n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===e.key&&(g.current="",h.current=y.current),g.current+=e.key,Vn(v),v.current=window.setTimeout((()=>{g.current="",h.current=y.current,E(!1)}),d);const r=h.current,i=t(n,[...n.slice((r||0)+1),...n.slice(0,(r||0)+1)],g.current);-1!==i?(w(i),y.current=i):" "!==e.key&&(g.current="",E(!1))})),I=e.useMemo((()=>({onKeyDown:k})),[k]),C=e.useMemo((()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&E(!1)}})),[k,E]);return e.useMemo((()=>a?{reference:I,floating:C}:{}),[a,I,C])}function qr(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))})).flatMap((t=>[t,...qr(e,t.id,n)]))}function zr(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,u=i-1;e<i;u=e++){const[i,l]=t[e]||[0,0],[c,s]=t[u]||[0,0];l>=r!=s>=r&&n<=(c-i)*(r-l)/(s-l)+i&&(o=!o)}return o}function jr(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1};let i=!1,u=null,l=null,c="undefined"!=typeof performance?performance.now():0;const s=e=>{let{x:n,y:s,placement:a,elements:d,onClose:m,nodeId:p,tree:v}=e;return function(e){function g(){Vn(o),m()}if(Vn(o),!d.domReference||!d.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:y}=e,w=[h,y],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,R=$n(d.floating,b),E=$n(d.domReference,b),k=d.domReference.getBoundingClientRect(),I=d.floating.getBoundingClientRect(),C=a.split("-")[0],S=n>I.right-I.width/2,A=s>I.bottom-I.height/2,L=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(w,k),M=I.width>k.width,T=I.height>k.height,O=(M?k:I).left,D=(M?k:I).right,P=(T?k:I).top,N=(T?k:I).bottom;if(R&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&f(e.relatedTarget)&&$n(d.floating,e.relatedTarget))return;if(v&&qr(v.nodesRef.current,p).length)return;if("top"===C&&s>=k.bottom-1||"bottom"===C&&s<=k.top+1||"left"===C&&n>=k.right-1||"right"===C&&n<=k.left+1)return g();let F=[];switch(C){case"top":F=[[O,k.top+1],[O,I.bottom-1],[D,I.bottom-1],[D,k.top+1]];break;case"bottom":F=[[O,I.top+1],[O,k.bottom-1],[D,k.bottom-1],[D,I.top+1]];break;case"left":F=[[I.right-1,N],[I.right-1,P],[k.left+1,P],[k.left+1,N]];break;case"right":F=[[k.right-1,N],[k.right-1,P],[I.left+1,P],[I.left+1,N]]}if(!zr([h,y],F)){if(i&&!L)return g();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-c;if(null===u||null===l||0===r)return u=e,l=t,c=n,null;const o=e-u,i=t-l,s=Math.sqrt(o*o+i*i);return u=e,l=t,c=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}zr([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[M?n+t/2:S?n+4*t:n-4*t,r+t+1],[M?n-t/2:S?n+4*t:n-4*t,r+t+1],...[[I.left,S||M?I.bottom-t:I.top],[I.right,S?M?I.bottom-t:I.top:I.bottom-t]]];case"bottom":return[[M?n+t/2:S?n+4*t:n-4*t,r-t],[M?n-t/2:S?n+4*t:n-4*t,r-t],...[[I.left,S||M?I.top+t:I.bottom],[I.right,S?M?I.top+t:I.bottom:I.top+t]]];case"left":{const e=[n+t+1,T?r+t/2:A?r+4*t:r-4*t],o=[n+t+1,T?r-t/2:A?r+4*t:r-4*t];return[...[[A||T?I.right-t:I.left,I.top],[A?T?I.right-t:I.left:I.right-t,I.bottom]],e,o]}case"right":return[[n-t,T?r+t/2:A?r+4*t:r-4*t],[n-t,T?r-t/2:A?r+4*t:r-4*t],...[[A||T?I.left+t:I.right,I.top],[A?T?I.left+t:I.right:I.left+t,I.bottom]]]}}([n,s]))?!i&&r&&(o.current=window.setTimeout(g,40)):g()}}};return s.__options={blockPointerEvents:n},s}export{sn as A,_r as B,kn as C,Ft as D,Lr as E,Hn as F,gr as G,br as H,cr as I,Bn as a,Ln as b,En as c,Wt as d,Jt as e,tn as f,st as g,rn as h,Un as i,Sr as j,Dr as k,en as l,Tr as m,Kr as n,Zt as o,on as p,_n as q,Wn as r,nn as s,Fn as t,un as u,jr as v,On as w,an as x,Vr as y,Er as z};
5
+ */var ie=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"].join(","),ue="undefined"==typeof Element,le=ue?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ce=!ue&&Element.prototype.getRootNode?function(e){var t;return null==e||null===(t=e.getRootNode)||void 0===t?void 0:t.call(e)}:function(e){return null==e?void 0:e.ownerDocument},se=function e(t,n){var r;void 0===n&&(n=!0);var o=null==t||null===(r=t.getAttribute)||void 0===r?void 0:r.call(t,"inert");return""===o||"true"===o||n&&t&&e(t.parentNode)},ae=function(e,t,n){if(se(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(ie));return t&&le.call(e,ie)&&r.unshift(e),r=r.filter(n)},fe=function e(t,n,r){for(var o=[],i=Array.from(t);i.length;){var u=i.shift();if(!se(u,!1))if("SLOT"===u.tagName){var l=u.assignedElements(),c=e(l.length?l:u.children,!0,r);r.flatten?o.push.apply(o,c):o.push({scopeParent:u,candidates:c})}else{le.call(u,ie)&&r.filter(u)&&(n||!t.includes(u))&&o.push(u);var s=u.shadowRoot||"function"==typeof r.getShadowRoot&&r.getShadowRoot(u),a=!se(s,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(u));if(s&&a){var f=e(!0===s?u.children:s.children,!0,r);r.flatten?o.push.apply(o,f):o.push({scopeParent:u,candidates:f})}else i.unshift.apply(i,u.children)}}return o},de=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},me=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||function(e){var t,n=null==e||null===(t=e.getAttribute)||void 0===t?void 0:t.call(e,"contenteditable");return""===n||"true"===n}(e))&&!de(e)?0:e.tabIndex},pe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ve=function(e){return"INPUT"===e.tagName},ge=function(e){return function(e){return ve(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t,n=e.form||ce(e),r=function(e){return n.querySelectorAll('input[type="radio"][name="'+e+'"]')};if("undefined"!=typeof window&&void 0!==window.CSS&&"function"==typeof window.CSS.escape)t=r(window.CSS.escape(e.name));else try{t=r(e.name)}catch(e){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",e.message),!1}var o=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]}(t,e.form);return!o||o===e}(e)},he=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return 0===n&&0===r},ye=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if("hidden"===getComputedStyle(e).visibility)return!0;var o=le.call(e,"details>summary:first-of-type")?e.parentElement:e;if(le.call(o,"details:not([open]) *"))return!0;if(n&&"full"!==n&&"legacy-full"!==n){if("non-zero-area"===n)return he(e)}else{if("function"==typeof r){for(var i=e;e;){var u=e.parentElement,l=ce(e);if(u&&!u.shadowRoot&&!0===r(u))return he(e);e=e.assignedSlot?e.assignedSlot:u||l===e.ownerDocument?u:l.host}e=i}if(function(e){var t,n,r,o,i=e&&ce(e),u=null===(t=i)||void 0===t?void 0:t.host,l=!1;if(i&&i!==e)for(l=!!(null!==(n=u)&&void 0!==n&&null!==(r=n.ownerDocument)&&void 0!==r&&r.contains(u)||null!=e&&null!==(o=e.ownerDocument)&&void 0!==o&&o.contains(e));!l&&u;){var c,s,a;l=!(null===(s=u=null===(c=i=ce(u))||void 0===c?void 0:c.host)||void 0===s||null===(a=s.ownerDocument)||void 0===a||!a.contains(u))}return l}(e))return!e.getClientRects().length;if("legacy-full"!==n)return!0}return!1},we=function(e,t){return!(t.disabled||se(t)||function(e){return ve(e)&&"hidden"===e.type}(t)||ye(t,e)||function(e){return"DETAILS"===e.tagName&&Array.prototype.slice.apply(e.children).some((function(e){return"SUMMARY"===e.tagName}))}(t)||function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if("FIELDSET"===t.tagName&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if("LEGEND"===r.tagName)return!!le.call(t,"fieldset[disabled] *")||!r.contains(e)}return!0}t=t.parentElement}return!1}(t))},be=function(e,t){return!(ge(t)||me(t)<0||!we(e,t))},xe=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},Re=function e(t){var n=[],r=[];return t.forEach((function(t,o){var i=!!t.scopeParent,u=i?t.scopeParent:t,l=function(e,t){var n=me(e);return n<0&&t&&!de(e)?0:n}(u,i),c=i?e(t.candidates):u;0===l?i?n.push.apply(n,c):n.push(u):r.push({documentOrder:o,tabIndex:l,item:t,isScope:i,content:c})})),r.sort(pe).reduce((function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e}),[]).concat(n)},Ee=function(e,t){var n;return n=(t=t||{}).getShadowRoot?fe([e],t.includeContainer,{filter:be.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:xe}):ae(e,t.includeContainer,be.bind(null,t)),Re(n)},ke=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return!1!==le.call(e,ie)&&be(t,e)};function Ie(){const e=navigator.userAgentData;return null!=e&&e.platform?e.platform:navigator.platform}function Ce(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map((e=>{let{brand:t,version:n}=e;return t+"/"+n})).join(" "):navigator.userAgent}function Se(){return/apple/i.test(navigator.vendor)}function Ae(){const e=/android/i;return e.test(Ie())||e.test(Ce())}function Le(){return Ce().includes("jsdom/")}const Me="data-floating-ui-focusable",Te="ArrowLeft",Oe="ArrowRight";function De(e){let t=e.activeElement;for(;null!=(null==(n=t)||null==(n=n.shadowRoot)?void 0:n.activeElement);){var n;t=t.shadowRoot.activeElement}return t}function Pe(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function Ne(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Fe(e,t){if(null==t)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return null!=n.target&&t.contains(n.target)}function We(e){return(null==e?void 0:e.ownerDocument)||document}function Be(e){return d(e)&&e.matches("input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])")}function _e(e){return!!e&&("combobox"===e.getAttribute("role")&&Be(e))}function He(e){return e?e.hasAttribute(Me)?e:e.querySelector("["+Me+"]")||e:null}function Ke(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))})).flatMap((t=>[t,...Ke(e,t.id,n)]))}function Ve(e,t){var n;let r=[],o=null==(n=e.find((e=>e.id===t)))?void 0:n.parentId;for(;o;){const t=e.find((e=>e.id===o));o=null==t?void 0:t.parentId,t&&(r=r.concat(t))}return r}function qe(e){e.preventDefault(),e.stopPropagation()}function ze(e){return!(0!==e.mozInputSource||!e.isTrusted)||(Ae()&&e.pointerType?"click"===e.type&&1===e.buttons:0===e.detail&&!e.pointerType)}function je(e){return!Le()&&(!Ae()&&0===e.width&&0===e.height||Ae()&&1===e.width&&1===e.height&&0===e.pressure&&0===e.detail&&"mouse"===e.pointerType||e.width<1&&e.height<1&&0===e.pressure&&0===e.detail&&"touch"===e.pointerType)}function Ue(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}var Xe="undefined"!=typeof document?t:function(){};function Ye(t){const n=e.useRef(t);return Xe((()=>{n.current=t})),n}const $e={...e}.useInsertionEffect||(e=>e());function Ge(t){const n=e.useRef((()=>{if("production"!==process.env.NODE_ENV)throw new Error("Cannot call an event handler while rendering.")}));return $e((()=>{n.current=t})),e.useCallback((function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return null==n.current?void 0:n.current(...t)}),[])}function Qe(e,t,n){return Math.floor(e/t)!==n}function Ze(e,t){return t<0||t>=e.current.length}function Je(e,t){return tt(e,{disabledIndices:t})}function et(e,t){return tt(e,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function tt(e,t){let{startingIndex:n=-1,decrement:r=!1,disabledIndices:o,amount:i=1}=void 0===t?{}:t,u=n;do{u+=r?-i:i}while(u>=0&&u<=e.current.length-1&&ut(e,u,o));return u}function nt(e,t){let{event:n,orientation:r,loop:o,rtl:i,cols:u,disabledIndices:l,minIndex:c,maxIndex:s,prevIndex:a,stopEvent:f=!1}=t,d=a;if("ArrowUp"===n.key){if(f&&qe(n),-1===a)d=s;else if(d=tt(e,{startingIndex:d,amount:u,decrement:!0,disabledIndices:l}),o&&(a-u<c||d<0)){const e=a%u,t=s%u,n=s-(t-e);d=t===e?s:t>e?n:n-u}Ze(e,d)&&(d=a)}if("ArrowDown"===n.key&&(f&&qe(n),-1===a?d=c:(d=tt(e,{startingIndex:a,amount:u,disabledIndices:l}),o&&a+u>s&&(d=tt(e,{startingIndex:a%u-u,amount:u,disabledIndices:l}))),Ze(e,d)&&(d=a)),"both"===r){const t=W(a/u);n.key===(i?Te:Oe)&&(f&&qe(n),a%u!=u-1?(d=tt(e,{startingIndex:a,disabledIndices:l}),o&&Qe(d,u,t)&&(d=tt(e,{startingIndex:a-a%u-1,disabledIndices:l}))):o&&(d=tt(e,{startingIndex:a-a%u-1,disabledIndices:l})),Qe(d,u,t)&&(d=a)),n.key===(i?Oe:Te)&&(f&&qe(n),a%u!=0?(d=tt(e,{startingIndex:a,decrement:!0,disabledIndices:l}),o&&Qe(d,u,t)&&(d=tt(e,{startingIndex:a+(u-a%u),decrement:!0,disabledIndices:l}))):o&&(d=tt(e,{startingIndex:a+(u-a%u),decrement:!0,disabledIndices:l})),Qe(d,u,t)&&(d=a));const r=W(s/u)===t;Ze(e,d)&&(d=o&&r?n.key===(i?Oe:Te)?s:tt(e,{startingIndex:a-a%u-1,disabledIndices:l}):a)}return d}function rt(e,t,n){const r=[];let o=0;return e.forEach(((e,i)=>{let{width:u,height:l}=e;if(u>t&&"production"!==process.env.NODE_ENV)throw new Error("[Floating UI]: Invalid grid - item width at index "+i+" is greater than grid columns");let c=!1;for(n&&(o=0);!c;){const e=[];for(let n=0;n<u;n++)for(let r=0;r<l;r++)e.push(o+n+r*t);o%t+u<=t&&e.every((e=>null==r[e]))?(e.forEach((e=>{r[e]=i})),c=!0):o++}})),[...r]}function ot(e,t,n,r,o){if(-1===e)return-1;const i=n.indexOf(e),u=t[e];switch(o){case"tl":return i;case"tr":return u?i+u.width-1:i;case"bl":return u?i+(u.height-1)*r:i;case"br":return n.lastIndexOf(e)}}function it(e,t){return t.flatMap(((t,n)=>e.includes(t)?[n]:[]))}function ut(e,t,n){if("function"==typeof n)return n(t);if(n)return n.includes(t);const r=e.current[t];return null==r||r.hasAttribute("disabled")||"true"===r.getAttribute("aria-disabled")}const lt=()=>({getShadowRoot:!0,displayCheck:"function"==typeof ResizeObserver&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function ct(e,t){const n=Ee(e,lt()),r=n.length;if(0===r)return;const o=De(We(e)),i=n.indexOf(o);return n[-1===i?1===t?0:r-1:i+t]}function st(e){return ct(We(e).body,1)||e}function at(e){return ct(We(e).body,-1)||e}function ft(e,t){const n=t||e.currentTarget,r=e.relatedTarget;return!r||!Pe(n,r)}function dt(e){Ee(e,lt()).forEach((e=>{e.dataset.tabindex=e.getAttribute("tabindex")||"",e.setAttribute("tabindex","-1")}))}function mt(e){e.querySelectorAll("[data-tabindex]").forEach((e=>{const t=e.dataset.tabindex;delete e.dataset.tabindex,t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")}))}function pt(e,t,n){let{reference:r,floating:o}=e;const i=Y(t),u=$(t),l=U(u),c=q(t),s="y"===i,a=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,d=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:a,y:r.y-o.height};break;case"bottom":m={x:a,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(z(t)){case"start":m[u]-=d*(n&&s?-1:1);break;case"end":m[u]+=d*(n&&s?-1:1)}return m}async function vt(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:u,elements:l,strategy:c}=e,{boundary:s="clippingAncestors",rootBoundary:a="viewport",elementContext:f="floating",altBoundary:d=!1,padding:m=0}=V(t,e),p=re(m),v=l[d?"floating"===f?"reference":"floating":f],g=oe(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(l.floating)),boundary:s,rootBoundary:a,strategy:c})),h="floating"===f?{x:r,y:o,width:u.floating.width,height:u.floating.height}:u.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(l.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=oe(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:h,offsetParent:y,strategy:c}):h);return{top:(g.top-b.top+p.top)/w.y,bottom:(b.bottom-g.bottom+p.bottom)/w.y,left:(g.left-b.left+p.left)/w.x,right:(b.right-g.right+p.right)/w.x}}function gt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ht(e){return D.some((t=>e[t]>=0))}const yt=new Set(["left","top"]);function wt(e){const t=S(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=d(e),i=o?e.offsetWidth:n,u=o?e.offsetHeight:r,l=F(n)!==i||F(r)!==u;return l&&(n=i,r=u),{width:n,height:r,$:l}}function bt(e){return f(e)?e:e.contextElement}function xt(e){const t=bt(e);if(!d(t))return B(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=wt(t);let u=(i?F(n.width):n.width)/r,l=(i?F(n.height):n.height)/o;return u&&Number.isFinite(u)||(u=1),l&&Number.isFinite(l)||(l=1),{x:u,y:l}}const Rt=B(0);function Et(e){const t=c(e);return k()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Rt}function kt(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=bt(e);let u=B(1);t&&(r?f(r)&&(u=xt(r)):u=xt(e));const l=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==c(e))&&t}(i,n,r)?Et(i):B(0);let s=(o.left+l.x)/u.x,a=(o.top+l.y)/u.y,d=o.width/u.x,m=o.height/u.y;if(i){const e=c(i),t=r&&f(r)?c(r):r;let n=e,o=O(n);for(;o&&r&&t!==n;){const e=xt(o),t=o.getBoundingClientRect(),r=S(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,u=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;s*=e.x,a*=e.y,d*=e.x,m*=e.y,s+=i,a+=u,n=c(o),o=O(n)}}return oe({width:d,height:m,x:s,y:a})}function It(e,t){const n=A(e).scrollLeft;return t?t.left+n:kt(s(e)).left+n}function Ct(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-It(e,n),y:n.top+t.scrollTop}}const St=new Set(["absolute","fixed"]);function At(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=c(e),r=s(e),o=n.visualViewport;let i=r.clientWidth,u=r.clientHeight,l=0,a=0;if(o){i=o.width,u=o.height;const e=k();(!e||e&&"fixed"===t)&&(l=o.offsetLeft,a=o.offsetTop)}const f=It(r);if(f<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,u=Math.abs(r.clientWidth-t.clientWidth-o);u<=25&&(i-=u)}else f<=25&&(i+=f);return{width:i,height:u,x:l,y:a}}(e,n);else if("document"===t)r=function(e){const t=s(e),n=A(e),r=e.ownerDocument.body,o=N(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=N(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let u=-n.scrollLeft+It(e);const l=-n.scrollTop;return"rtl"===S(r).direction&&(u+=N(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:u,y:l}}(s(e));else if(f(t))r=function(e,t){const n=kt(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=d(e)?xt(e):B(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=Et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return oe(r)}function Lt(e,t){const n=L(e);return!(n===t||!f(n)||C(n))&&("fixed"===S(n).position||Lt(n,t))}function Mt(e,t,n){const r=d(t),o=s(t),i="fixed"===n,u=kt(e,!0,i,t);let c={scrollLeft:0,scrollTop:0};const a=B(0);function f(){a.x=It(o)}if(r||!r&&!i)if(("body"!==l(t)||v(o))&&(c=A(t)),r){const e=kt(t,!0,i,t);a.x=e.x+t.clientLeft,a.y=e.y+t.clientTop}else o&&f();i&&!r&&o&&f();const m=!o||r||i?B(0):Ct(o,c);return{x:u.left+c.scrollLeft-a.x-m.x,y:u.top+c.scrollTop-a.y-m.y,width:u.width,height:u.height}}function Tt(e){return"static"===S(e).position}function Ot(e,t){if(!d(e)||"fixed"===S(e).position)return null;if(t)return t(e);let n=e.offsetParent;return s(e)===n&&(n=n.ownerDocument.body),n}function Dt(e,t){const n=c(e);if(w(e))return n;if(!d(e)){let t=L(e);for(;t&&!C(t);){if(f(t)&&!Tt(t))return t;t=L(t)}return n}let r=Ot(e,t);for(;r&&h(r)&&Tt(r);)r=Ot(r,t);return r&&C(r)&&Tt(r)&&!E(r)?n:r||function(e){let t=L(e);for(;d(t)&&!C(t);){if(E(t))return t;if(w(t))return null;t=L(t)}return null}(e)||n}const Pt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,u=s(r),c=!!t&&w(t.floating);if(r===u||c&&i)return n;let a={scrollLeft:0,scrollTop:0},f=B(1);const m=B(0),p=d(r);if((p||!p&&!i)&&(("body"!==l(r)||v(u))&&(a=A(r)),d(r))){const e=kt(r);f=xt(r),m.x=e.x+r.clientLeft,m.y=e.y+r.clientTop}const g=!u||p||i?B(0):Ct(u,a);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-a.scrollLeft*f.x+m.x+g.x,y:n.y*f.y-a.scrollTop*f.y+m.y+g.y}},getDocumentElement:s,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?w(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=T(e,[],!1).filter((e=>f(e)&&"body"!==l(e))),o=null;const i="fixed"===S(e).position;let u=i?L(e):e;for(;f(u)&&!C(u);){const t=S(u),n=E(u);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&St.has(o.position)||v(u)&&!n&&Lt(e,u))?r=r.filter((e=>e!==u)):o=t,u=L(u)}return t.set(e,r),r}(t,this._c):[].concat(n),r],u=i[0],c=i.reduce(((e,n)=>{const r=At(t,n,o);return e.top=N(r.top,e.top),e.right=P(r.right,e.right),e.bottom=P(r.bottom,e.bottom),e.left=N(r.left,e.left),e}),At(t,u,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}},getOffsetParent:Dt,getElementRects:async function(e){const t=this.getOffsetParent||Dt,n=this.getDimensions,r=await n(e.floating);return{reference:Mt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=wt(e);return{width:t,height:n}},getScale:xt,isElement:f,isRTL:function(e){return"rtl"===S(e).direction}};function Nt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Ft(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:u="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:c=!1}=r,a=bt(e),f=o||i?[...a?T(a):[],...T(t)]:[];f.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=a&&l?function(e,t){let n,r=null;const o=s(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function u(l,c){void 0===l&&(l=!1),void 0===c&&(c=1),i();const s=e.getBoundingClientRect(),{left:a,top:f,width:d,height:m}=s;if(l||t(),!d||!m)return;const p={rootMargin:-W(f)+"px "+-W(o.clientWidth-(a+d))+"px "+-W(o.clientHeight-(f+m))+"px "+-W(a)+"px",threshold:N(0,P(1,c))||1};let v=!0;function g(t){const r=t[0].intersectionRatio;if(r!==c){if(!v)return u();r?u(!1,r):n=setTimeout((()=>{u(!1,1e-7)}),1e3)}1!==r||Nt(s,e.getBoundingClientRect())||u(),v=!1}try{r=new IntersectionObserver(g,{...p,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,p)}r.observe(e)}(!0),i}(a,n):null;let m,p=-1,v=null;u&&(v=new ResizeObserver((e=>{let[r]=e;r&&r.target===a&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{var e;null==(e=v)||e.observe(t)}))),n()})),a&&!c&&v.observe(a),v.observe(t));let g=c?kt(e):null;return c&&function t(){const r=kt(e);g&&!Nt(g,r)&&n();g=r,m=requestAnimationFrame(t)}(),n(),()=>{var e;f.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=v)||e.disconnect(),v=null,c&&cancelAnimationFrame(m)}}const Wt=vt,Bt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:u,middlewareData:l}=t,c=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),u=q(n),l=z(n),c="y"===Y(n),s=yt.has(u)?-1:1,a=i&&c?-1:1,f=V(t,e);let{mainAxis:d,crossAxis:m,alignmentAxis:p}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&"number"==typeof p&&(m="end"===l?-1*p:p),c?{x:m*a,y:d*s}:{x:d*s,y:m*a}}(t,e);return u===(null==(n=l.offset)?void 0:n.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:u}}}}},_t=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:u=!1,limiter:l={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=V(e,t),s={x:n,y:r},a=await vt(t,c),f=Y(q(o)),d=j(f);let m=s[d],p=s[f];if(i){const e="y"===d?"bottom":"right";m=K(m+a["y"===d?"top":"left"],m,m-a[e])}if(u){const e="y"===f?"bottom":"right";p=K(p+a["y"===f?"top":"left"],p,p-a[e])}const v=l.fn({...t,[d]:m,[f]:p});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[d]:i,[f]:u}}}}}},Ht=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:u,initialPlacement:l,platform:c,elements:s}=t,{mainAxis:a=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...g}=V(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const h=q(o),y=Y(l),w=q(l)===l,b=await(null==c.isRTL?void 0:c.isRTL(s.floating)),x=d||(w||!v?[ne(l)]:function(e){const t=ne(e);return[G(e),t,G(t)]}(l)),R="none"!==p;!d&&R&&x.push(...te(l,v,p,b));const E=[l,...x],k=await vt(t,g),I=[];let C=(null==(r=i.flip)?void 0:r.overflows)||[];if(a&&I.push(k[h]),f){const e=function(e,t,n){void 0===n&&(n=!1);const r=z(e),o=$(e),i=U(o);let u="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(u=ne(u)),[u,ne(u)]}(o,u,b);I.push(k[e[0]],k[e[1]])}if(C=[...C,{placement:o,overflows:I}],!I.every((e=>e<=0))){var S,A;const e=((null==(S=i.flip)?void 0:S.index)||0)+1,t=E[e];if(t){if(!("alignment"===f&&y!==Y(t))||C.every((e=>Y(e.placement)!==y||e.overflows[0]>0)))return{data:{index:e,overflows:C},reset:{placement:t}}}let n=null==(A=C.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:A.placement;if(!n)switch(m){case"bestFit":{var L;const e=null==(L=C.filter((e=>{if(R){const t=Y(e.placement);return t===y||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:L[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}},Kt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:u,elements:l}=t,{apply:c=()=>{},...s}=V(e,t),a=await vt(t,s),f=q(o),d=z(o),m="y"===Y(o),{width:p,height:v}=i.floating;let g,h;"top"===f||"bottom"===f?(g=f,h=d===(await(null==u.isRTL?void 0:u.isRTL(l.floating))?"start":"end")?"left":"right"):(h=f,g="end"===d?"top":"bottom");const y=v-a.top-a.bottom,w=p-a.left-a.right,b=P(v-a[g],y),x=P(p-a[h],w),R=!t.middlewareData.shift;let E=b,k=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=w),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=y),R&&!d){const e=N(a.left,0),t=N(a.right,0),n=N(a.top,0),r=N(a.bottom,0);m?k=p-2*(0!==e||0!==t?e+t:N(a.left,a.right)):E=v-2*(0!==n||0!==r?n+r:N(a.top,a.bottom))}await c({...t,availableWidth:k,availableHeight:E});const I=await u.getDimensions(l.floating);return p!==I.width||v!==I.height?{reset:{rects:!0}}:{}}}},Vt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=V(e,t);switch(r){case"referenceHidden":{const e=gt(await vt(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ht(e)}}}case"escaped":{const e=gt(await vt(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ht(e)}}}default:return{}}}}},qt=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:u,elements:l,middlewareData:c}=t,{element:s,padding:a=0}=V(e,t)||{};if(null==s)return{};const f=re(a),d={x:n,y:r},m=$(o),p=U(m),v=await u.getDimensions(s),g="y"===m,h=g?"top":"left",y=g?"bottom":"right",w=g?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[m]-d[m]-i.floating[p],x=d[m]-i.reference[m],R=await(null==u.getOffsetParent?void 0:u.getOffsetParent(s));let E=R?R[w]:0;E&&await(null==u.isElement?void 0:u.isElement(R))||(E=l.floating[w]||i.floating[p]);const k=b/2-x/2,I=E/2-v[p]/2-1,C=P(f[h],I),S=P(f[y],I),A=C,L=E-v[p]-S,M=E/2-v[p]/2+k,T=K(A,M,L),O=!c.arrow&&null!=z(o)&&M!==T&&i.reference[p]/2-(M<A?C:S)-v[p]/2<0,D=O?M<A?M-A:M-L:0;return{[m]:d[m]+D,data:{[m]:T,centerOffset:M-T-D,...O&&{alignmentOffset:D}},reset:O}}}),zt=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:u}=t,{offset:l=0,mainAxis:c=!0,crossAxis:s=!0}=V(e,t),a={x:n,y:r},f=Y(o),d=j(f);let m=a[d],p=a[f];const v=V(l,t),g="number"==typeof v?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const e="y"===d?"height":"width",t=i.reference[d]-i.floating[e]+g.mainAxis,n=i.reference[d]+i.reference[e]-g.mainAxis;m<t?m=t:m>n&&(m=n)}if(s){var h,y;const e="y"===d?"width":"height",t=yt.has(q(o)),n=i.reference[f]-i.floating[e]+(t&&(null==(h=u.offset)?void 0:h[f])||0)+(t?0:g.crossAxis),r=i.reference[f]+i.reference[e]+(t?0:(null==(y=u.offset)?void 0:y[f])||0)-(t?g.crossAxis:0);p<n?p=n:p>r&&(p=r)}return{[d]:m,[f]:p}}}},jt=(e,t,n)=>{const r=new Map,o={platform:Pt,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:u}=n,l=i.filter(Boolean),c=await(null==u.isRTL?void 0:u.isRTL(t));let s=await u.getElementRects({reference:e,floating:t,strategy:o}),{x:a,y:f}=pt(s,r,c),d=r,m={},p=0;for(let n=0;n<l.length;n++){const{name:i,fn:v}=l[n],{x:g,y:h,data:y,reset:w}=await v({x:a,y:f,initialPlacement:r,placement:d,strategy:o,middlewareData:m,rects:s,platform:u,elements:{reference:e,floating:t}});a=null!=g?g:a,f=null!=h?h:f,m={...m,[i]:{...m[i],...y}},w&&p<=50&&(p++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await u.getElementRects({reference:e,floating:t,strategy:o}):w.rects),({x:a,y:f}=pt(s,d,c))),n=-1)}return{x:a,y:f,placement:d,strategy:o,middlewareData:m}})(e,t,{...o,platform:i})};var Ut="undefined"!=typeof document?t:function(){};function Xt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!=r--;)if(!Xt(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!=r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!=r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Xt(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Yt(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $t(e,t){const n=Yt(e);return Math.round(t*n)/n}function Gt(t){const n=e.useRef(t);return Ut((()=>{n.current=t})),n}const Qt=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?qt({element:n.current,padding:r}).fn(t):{}:n?qt({element:n,padding:r}).fn(t):{};var o}}),Zt=(e,t)=>({...Bt(e),options:[e,t]}),Jt=(e,t)=>({..._t(e),options:[e,t]}),en=(e,t)=>({...zt(e),options:[e,t]}),tn=(e,t)=>({...Ht(e),options:[e,t]}),nn=(e,t)=>({...Kt(e),options:[e,t]}),rn=(e,t)=>({...Vt(e),options:[e,t]}),on=(e,t)=>({...Qt(e),options:[e,t]});function un(t){const n=e.useRef(void 0),r=e.useCallback((e=>{const n=t.map((t=>{if(null!=t){if("function"==typeof t){const n=t,r=n(e);return"function"==typeof r?r:()=>{n(null)}}return t.current=e,()=>{t.current=null}}}));return()=>{n.forEach((e=>null==e?void 0:e()))}}),t);return e.useMemo((()=>t.every((e=>null==e))?null:e=>{n.current&&(n.current(),n.current=void 0),null!=e&&(n.current=r(e))}),t)}function ln(e,t){const n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}const cn=e.createContext({register:()=>{},unregister:()=>{},map:new Map,elementsRef:{current:[]}});function sn(t){const{children:r,elementsRef:o,labelsRef:i}=t,[u,l]=e.useState((()=>new Set)),c=e.useCallback((e=>{l((t=>new Set(t).add(e)))}),[]),s=e.useCallback((e=>{l((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),a=e.useMemo((()=>{const e=new Map;return Array.from(u.keys()).sort(ln).forEach(((t,n)=>{e.set(t,n)})),e}),[u]);return n(cn.Provider,{value:e.useMemo((()=>({register:c,unregister:s,map:a,elementsRef:o,labelsRef:i})),[c,s,a,o,i]),children:r})}function an(t){void 0===t&&(t={});const{label:n}=t,{register:r,unregister:o,map:i,elementsRef:u,labelsRef:l}=e.useContext(cn),[c,s]=e.useState(null),a=e.useRef(null),f=e.useCallback((e=>{if(a.current=e,null!==c&&(u.current[c]=e,l)){var t;const r=void 0!==n;l.current[c]=r?n:null!=(t=null==e?void 0:e.textContent)?t:null}}),[c,u,l,n]);return Xe((()=>{const e=a.current;if(e)return r(e),()=>{o(e)}}),[r,o]),Xe((()=>{const e=a.current?i.get(a.current):null;null!=e&&s(e)}),[i]),e.useMemo((()=>({ref:f,index:null==c?-1:c})),[c,f])}const fn="data-floating-ui-focusable",dn="active",mn="selected",pn="ArrowLeft",vn="ArrowRight",gn="ArrowUp",hn="ArrowDown";function yn(t,r){return"function"==typeof t?t(r):t?e.cloneElement(t,r):n("div",{...r})}const wn=e.createContext({activeIndex:0,onNavigate:()=>{}}),bn=[pn,vn],xn=[gn,hn],Rn=[...bn,...xn],En=e.forwardRef((function(t,r){const{render:o,orientation:i="both",loop:u=!0,rtl:l=!1,cols:c=1,disabledIndices:s,activeIndex:a,onNavigate:f,itemSizes:d,dense:m=!1,...p}=t,[v,g]=e.useState(0),h=null!=a?a:v,y=Ge(null!=f?f:g),w=e.useRef([]),b=o&&"function"!=typeof o?o.props:{},x=e.useMemo((()=>({activeIndex:h,onNavigate:y})),[h,y]),R=c>1;const E={...p,...b,ref:r,"aria-orientation":"both"===i?void 0:i,onKeyDown(e){null==p.onKeyDown||p.onKeyDown(e),null==b.onKeyDown||b.onKeyDown(e),function(e){if(!Rn.includes(e.key))return;let t=h;const n=Je(w,s),r=et(w,s),o=l?pn:vn,a=l?vn:pn;if(R){const a=d||Array.from({length:w.current.length},(()=>({width:1,height:1}))),f=rt(a,c,m),p=f.findIndex((e=>null!=e&&!ut(w,e,s))),v=f.reduce(((e,t,n)=>null==t||ut(w,t,s)?e:n),-1),g=f[nt({current:f.map((e=>e?w.current[e]:null))},{event:e,orientation:i,loop:u,rtl:l,cols:c,disabledIndices:it([...("function"!=typeof s?s:null)||w.current.map(((e,t)=>ut(w,t,s)?t:void 0)),void 0],f),minIndex:p,maxIndex:v,prevIndex:ot(h>r?n:h,a,f,c,e.key===hn?"bl":e.key===o?"tr":"tl")})];null!=g&&(t=g)}const f={horizontal:[o],vertical:[hn],both:[o,hn]}[i],p={horizontal:[a],vertical:[gn],both:[a,gn]}[i],v=R?Rn:{horizontal:bn,vertical:xn,both:Rn}[i];var g;t===h&&[...f,...p].includes(e.key)&&(t=u&&t===r&&f.includes(e.key)?n:u&&t===n&&p.includes(e.key)?r:tt(w,{startingIndex:t,decrement:p.includes(e.key),disabledIndices:s})),t===h||Ze(w,t)||(e.stopPropagation(),v.includes(e.key)&&e.preventDefault(),y(t),null==(g=w.current[t])||g.focus())}(e)}};return n(wn.Provider,{value:x,children:n(sn,{elementsRef:w,children:yn(o,E)})})})),kn=e.forwardRef((function(t,n){const{render:r,...o}=t,i=r&&"function"!=typeof r?r.props:{},{activeIndex:u,onNavigate:l}=e.useContext(wn),{ref:c,index:s}=an(),a=un([c,n,i.ref]),f=u===s;return yn(r,{...o,...i,ref:a,tabIndex:f?0:-1,"data-active":f?"":void 0,onFocus(e){null==o.onFocus||o.onFocus(e),null==i.onFocus||i.onFocus(e),l(s)}})})),In={...e};let Cn=!1,Sn=0;const An=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Sn++;const Ln=In.useId||function(){const[t,n]=e.useState((()=>Cn?An():void 0));return Xe((()=>{null==t&&n(An())}),[]),e.useEffect((()=>{Cn=!0}),[]),t};let Mn;function Tn(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Mn)&&e.has(o)||(null==(i=Mn)||i.add(o),console.warn(o))}"production"!==process.env.NODE_ENV&&(Mn=new Set);const On=e.forwardRef((function(t,o){const{context:{placement:i,elements:{floating:u},middlewareData:{arrow:l,shift:c}},width:s=14,height:a=7,tipRadius:f=0,strokeWidth:d=0,staticOffset:m,stroke:p,d:v,style:{transform:g,...h}={},...y}=t;"production"!==process.env.NODE_ENV&&(o||Tn("The `ref` prop is required for `FloatingArrow`."));const w=Ln(),[b,x]=e.useState(!1);if(Xe((()=>{if(!u)return;"rtl"===S(u).direction&&x(!0)}),[u]),!u)return null;const[R,E]=i.split("-"),k="top"===R||"bottom"===R;let I=m;(k&&null!=c&&c.x||!k&&null!=c&&c.y)&&(I=null);const C=2*d,A=C/2,L=s/2*(f/-8+1),M=a/2*f/4,T=!!v,O=I&&"end"===E?"bottom":"top";let D=I&&"end"===E?"right":"left";I&&b&&(D="end"===E?"left":"right");const P=null!=(null==l?void 0:l.x)?I||l.x:"",N=null!=(null==l?void 0:l.y)?I||l.y:"",F=v||"M0,0 H"+s+" L"+(s-L)+","+(a-M)+" Q"+s/2+","+a+" "+L+","+(a-M)+" Z",W={top:T?"rotate(180deg)":"",left:T?"rotate(90deg)":"rotate(-90deg)",bottom:T?"":"rotate(180deg)",right:T?"rotate(-90deg)":"rotate(90deg)"}[R];return r("svg",{...y,"aria-hidden":!0,ref:o,width:T?s:s+C,height:s,viewBox:"0 0 "+s+" "+(a>s?a:s),style:{position:"absolute",pointerEvents:"none",[D]:P,[O]:N,[R]:k||T?"100%":"calc(100% - "+C/2+"px)",transform:[W,g].filter((e=>!!e)).join(" "),...h},children:[C>0&&n("path",{clipPath:"url(#"+w+")",fill:"none",stroke:p,strokeWidth:C+(v?0:1),d:F}),n("path",{stroke:C&&!v?y.fill:"none",d:F}),n("clipPath",{id:w,children:n("rect",{x:-A,y:A*(T?-1:1),width:s+C,height:s})})]})}));function Dn(){const e=new Map;return{emit(t,n){var r;null==(r=e.get(t))||r.forEach((e=>e(n)))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;null==(r=e.get(t))||r.delete(n)}}}const Pn=e.createContext(null),Nn=e.createContext(null),Fn=()=>{var t;return(null==(t=e.useContext(Pn))?void 0:t.id)||null},Wn=()=>e.useContext(Nn);function Bn(e){const t=Ln(),n=Wn(),r=Fn(),o=e||r;return Xe((()=>{if(!t)return;const e={id:t,parentId:o};return null==n||n.addNode(e),()=>{null==n||n.removeNode(e)}}),[n,t,o]),t}function _n(t){const{children:r,id:o}=t,i=Fn();return n(Pn.Provider,{value:e.useMemo((()=>({id:o,parentId:i})),[o,i]),children:r})}function Hn(t){const{children:r}=t,o=e.useRef([]),i=e.useCallback((e=>{o.current=[...o.current,e]}),[]),u=e.useCallback((e=>{o.current=o.current.filter((t=>t!==e))}),[]),[l]=e.useState((()=>Dn()));return n(Nn.Provider,{value:e.useMemo((()=>({nodesRef:o,addNode:i,removeNode:u,events:l})),[i,u,l]),children:r})}function Kn(e){return"data-floating-ui-"+e}function Vn(e){-1!==e.current&&(clearTimeout(e.current),e.current=-1)}const qn=Kn("safe-polygon");function zn(e,t,n){if(n&&!Ue(n))return 0;if("number"==typeof e)return e;if("function"==typeof e){const n=e();return"number"==typeof n?n:null==n?void 0:n[t]}return null==e?void 0:e[t]}function jn(e){return"function"==typeof e?e():e}function Un(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,events:u,elements:l}=t,{enabled:c=!0,delay:s=0,handleClose:a=null,mouseOnly:d=!1,restMs:m=0,move:p=!0}=n,v=Wn(),g=Fn(),h=Ye(a),y=Ye(s),w=Ye(r),b=Ye(m),x=e.useRef(),R=e.useRef(-1),E=e.useRef(),k=e.useRef(-1),I=e.useRef(!0),C=e.useRef(!1),S=e.useRef((()=>{})),A=e.useRef(!1),L=Ge((()=>{var e;const t=null==(e=i.current.openEvent)?void 0:e.type;return(null==t?void 0:t.includes("mouse"))&&"mousedown"!==t}));e.useEffect((()=>{if(c)return u.on("openchange",e),()=>{u.off("openchange",e)};function e(e){let{open:t}=e;t||(Vn(R),Vn(k),I.current=!0,A.current=!1)}}),[c,u]),e.useEffect((()=>{if(!c)return;if(!h.current)return;if(!r)return;function e(e){L()&&o(!1,e,"hover")}const t=We(l.floating).documentElement;return t.addEventListener("mouseleave",e),()=>{t.removeEventListener("mouseleave",e)}}),[l.floating,r,o,c,h,L]);const M=e.useCallback((function(e,t,n){void 0===t&&(t=!0),void 0===n&&(n="hover");const r=zn(y.current,"close",x.current);r&&!E.current?(Vn(R),R.current=window.setTimeout((()=>o(!1,e,n)),r)):t&&(Vn(R),o(!1,e,n))}),[y,o]),T=Ge((()=>{S.current(),E.current=void 0})),O=Ge((()=>{if(C.current){const e=We(l.floating).body;e.style.pointerEvents="",e.removeAttribute(qn),C.current=!1}})),D=Ge((()=>!!i.current.openEvent&&["click","mousedown"].includes(i.current.openEvent.type)));e.useEffect((()=>{if(c&&f(l.domReference)){const o=l.domReference,i=l.floating;return r&&o.addEventListener("mouseleave",n),p&&o.addEventListener("mousemove",e,{once:!0}),o.addEventListener("mouseenter",e),o.addEventListener("mouseleave",t),i&&(i.addEventListener("mouseleave",n),i.addEventListener("mouseenter",u),i.addEventListener("mouseleave",s)),()=>{r&&o.removeEventListener("mouseleave",n),p&&o.removeEventListener("mousemove",e),o.removeEventListener("mouseenter",e),o.removeEventListener("mouseleave",t),i&&(i.removeEventListener("mouseleave",n),i.removeEventListener("mouseenter",u),i.removeEventListener("mouseleave",s))}}function e(e){if(Vn(R),I.current=!1,d&&!Ue(x.current)||jn(b.current)>0&&!zn(y.current,"open"))return;const t=zn(y.current,"open",x.current);t?R.current=window.setTimeout((()=>{w.current||o(!0,e,"hover")}),t):r||o(!0,e,"hover")}function t(e){if(D())return void O();S.current();const t=We(l.floating);if(Vn(k),A.current=!1,h.current&&i.current.floatingContext){r||Vn(R),E.current=h.current({...i.current.floatingContext,tree:v,x:e.clientX,y:e.clientY,onClose(){O(),T(),D()||M(e,!0,"safe-polygon")}});const n=E.current;return t.addEventListener("mousemove",n),void(S.current=()=>{t.removeEventListener("mousemove",n)})}("touch"!==x.current||!Pe(l.floating,e.relatedTarget))&&M(e)}function n(e){D()||i.current.floatingContext&&(null==h.current||h.current({...i.current.floatingContext,tree:v,x:e.clientX,y:e.clientY,onClose(){O(),T(),D()||M(e)}})(e))}function u(){Vn(R)}function s(e){D()||M(e,!1)}}),[l,c,t,d,p,M,T,O,o,r,w,v,y,h,i,D,b]),Xe((()=>{var e;if(c&&r&&null!=(e=h.current)&&null!=(e=e.__options)&&e.blockPointerEvents&&L()){C.current=!0;const e=l.floating;if(f(l.domReference)&&e){var t;const n=We(l.floating).body;n.setAttribute(qn,"");const r=l.domReference,o=null==v||null==(t=v.nodesRef.current.find((e=>e.id===g)))||null==(t=t.context)?void 0:t.elements.floating;return o&&(o.style.pointerEvents=""),n.style.pointerEvents="none",r.style.pointerEvents="auto",e.style.pointerEvents="auto",()=>{n.style.pointerEvents="",r.style.pointerEvents="",e.style.pointerEvents=""}}}}),[c,r,g,l,v,h,L]),Xe((()=>{r||(x.current=void 0,A.current=!1,T(),O())}),[r,T,O]),e.useEffect((()=>()=>{T(),Vn(R),Vn(k),O()}),[c,l.domReference,T,O]);const P=e.useMemo((()=>{function e(e){x.current=e.pointerType}return{onPointerDown:e,onPointerEnter:e,onMouseMove(e){const{nativeEvent:t}=e;function n(){I.current||w.current||o(!0,t,"hover")}d&&!Ue(x.current)||r||0===jn(b.current)||A.current&&e.movementX**2+e.movementY**2<2||(Vn(k),"touch"===x.current?n():(A.current=!0,k.current=window.setTimeout(n,jn(b.current))))}}}),[d,o,r,w,b]);return e.useMemo((()=>c?{reference:P}:{}),[c,P])}let Xn=0;function Yn(e,t){void 0===t&&(t={});const{preventScroll:n=!1,cancelPrevious:r=!0,sync:o=!1}=t;r&&cancelAnimationFrame(Xn);const i=()=>null==e?void 0:e.focus({preventScroll:n});o?i():Xn=requestAnimationFrame(i)}function $n(e,t){if(!e||!t)return!1;const n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&m(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}const Gn={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function Qn(e){return"inert"===e?Gn.inert:"aria-hidden"===e?Gn["aria-hidden"]:Gn.none}let Zn=new WeakSet,Jn={},er=0;const tr=e=>e&&(e.host||tr(e.parentNode));function nr(e,t,n,r){const o="data-floating-ui-inert",i=r?"inert":n?"aria-hidden":null,u=(c=t,e.map((e=>{if(c.contains(e))return e;const t=tr(e);return c.contains(t)?t:null})).filter((e=>null!=e)));var c;const s=new Set,a=new Set(u),f=[];Jn[o]||(Jn[o]=new WeakMap);const d=Jn[o];return u.forEach((function e(t){if(!t||s.has(t))return;s.add(t),t.parentNode&&e(t.parentNode)})),function e(t){if(!t||a.has(t))return;[].forEach.call(t.children,(t=>{if("script"!==l(t))if(s.has(t))e(t);else{const e=i?t.getAttribute(i):null,n=null!==e&&"false"!==e,r=Qn(i),u=(r.get(t)||0)+1,l=(d.get(t)||0)+1;r.set(t,u),d.set(t,l),f.push(t),1===u&&n&&Zn.add(t),1===l&&t.setAttribute(o,""),!n&&i&&t.setAttribute(i,"inert"===i?"":"true")}}))}(t),s.clear(),er++,()=>{f.forEach((e=>{const t=Qn(i),n=(t.get(e)||0)-1,r=(d.get(e)||0)-1;t.set(e,n),d.set(e,r),n||(!Zn.has(e)&&i&&e.removeAttribute(i),Zn.delete(e)),r||e.removeAttribute(o)})),er--,er||(Gn.inert=new WeakMap,Gn["aria-hidden"]=new WeakMap,Gn.none=new WeakMap,Zn=new WeakSet,Jn={})}}function rr(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=(o=e[0],(null==o?void 0:o.ownerDocument)||document).body;var o;return nr(e.concat(Array.from(r.querySelectorAll('[aria-live],[role="status"],output'))),r,t,n)}const or={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},ir=e.forwardRef((function(t,r){const[o,i]=e.useState();Xe((()=>{Se()&&i("button")}),[]);const u={ref:r,tabIndex:0,role:o,"aria-hidden":!o||void 0,[Kn("focus-guard")]:"",style:or};return n("span",{...t,...u})})),ur=e.createContext(null),lr=Kn("portal");function cr(t){const{children:o,id:u,root:l,preserveTabOrder:c=!0}=t,s=function(t){void 0===t&&(t={});const{id:n,root:r}=t,o=Ln(),i=sr(),[u,l]=e.useState(null),c=e.useRef(null);return Xe((()=>()=>{null==u||u.remove(),queueMicrotask((()=>{c.current=null}))}),[u]),Xe((()=>{if(!o)return;if(c.current)return;const e=n?document.getElementById(n):null;if(!e)return;const t=document.createElement("div");t.id=o,t.setAttribute(lr,""),e.appendChild(t),c.current=t,l(t)}),[n,o]),Xe((()=>{if(null===r)return;if(!o)return;if(c.current)return;let e=r||(null==i?void 0:i.portalNode);e&&!a(e)&&(e=e.current),e=e||document.body;let t=null;n&&(t=document.createElement("div"),t.id=n,e.appendChild(t));const u=document.createElement("div");u.id=o,u.setAttribute(lr,""),e=t||e,e.appendChild(u),c.current=u,l(u)}),[n,r,o,i]),u}({id:u,root:l}),[f,d]=e.useState(null),m=e.useRef(null),p=e.useRef(null),v=e.useRef(null),g=e.useRef(null),h=null==f?void 0:f.modal,y=null==f?void 0:f.open,w=!!f&&!f.modal&&f.open&&c&&!(!l&&!s);return e.useEffect((()=>{if(s&&c&&!h)return s.addEventListener("focusin",e,!0),s.addEventListener("focusout",e,!0),()=>{s.removeEventListener("focusin",e,!0),s.removeEventListener("focusout",e,!0)};function e(e){if(s&&ft(e)){("focusin"===e.type?mt:dt)(s)}}}),[s,c,h]),e.useEffect((()=>{s&&(y||mt(s))}),[y,s]),r(ur.Provider,{value:e.useMemo((()=>({preserveTabOrder:c,beforeOutsideRef:m,afterOutsideRef:p,beforeInsideRef:v,afterInsideRef:g,portalNode:s,setFocusManagerState:d})),[c,s]),children:[w&&s&&n(ir,{"data-type":"outside",ref:m,onFocus:e=>{if(ft(e,s)){var t;null==(t=v.current)||t.focus()}else{const e=at(f?f.domReference:null);null==e||e.focus()}}}),w&&s&&n("span",{"aria-owns":s.id,style:or}),s&&i.createPortal(o,s),w&&s&&n(ir,{"data-type":"outside",ref:p,onFocus:e=>{if(ft(e,s)){var t;null==(t=g.current)||t.focus()}else{const t=st(f?f.domReference:null);null==t||t.focus(),(null==f?void 0:f.closeOnFocusOut)&&(null==f||f.onOpenChange(!1,e.nativeEvent,"focus-out"))}}})]})}const sr=()=>e.useContext(ur);function ar(t){return e.useMemo((()=>e=>{t.forEach((t=>{t&&(t.current=e)}))}),t)}let fr=[];function dr(){fr=fr.filter((e=>e.isConnected))}function mr(){return dr(),fr[fr.length-1]}function pr(e,t){var n;if(!(t.current.includes("floating")||null!=(n=e.getAttribute("role"))&&n.includes("dialog")))return;const r=lt(),o=function(e,t){return(t=t||{}).getShadowRoot?fe([e],t.includeContainer,{filter:we.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):ae(e,t.includeContainer,we.bind(null,t))}(e,r),i=o.filter((e=>{const t=e.getAttribute("data-tabindex")||"";return ke(e,r)||e.hasAttribute("data-tabindex")&&!t.startsWith("-")})),u=e.getAttribute("tabindex");t.current.includes("floating")||0===i.length?"0"!==u&&e.setAttribute("tabindex","0"):("-1"!==u||e.hasAttribute("data-tabindex")&&"-1"!==e.getAttribute("data-tabindex"))&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const vr=e.forwardRef((function(e,t){return n("button",{...e,type:"button",ref:t,tabIndex:-1,style:or})}));function gr(t){const{context:i,children:u,disabled:c=!1,order:s=["content"],guards:a=!0,initialFocus:f=0,returnFocus:m=!0,restoreFocus:p=!1,modal:v=!0,visuallyHiddenDismiss:g=!1,closeOnFocusOut:h=!0,outsideElementsInert:y=!1,getInsideElements:w=()=>[]}=t,{open:b,onOpenChange:x,events:R,dataRef:E,elements:{domReference:k,floating:I}}=i,C=Ge((()=>{var e;return null==(e=E.current.floatingContext)?void 0:e.nodeId})),S=Ge(w),A="number"==typeof f&&f<0,L=_e(k)&&A,M="undefined"!=typeof HTMLElement&&"inert"in HTMLElement.prototype,T=!M||a,O=!T||M&&y,D=Ye(s),P=Ye(f),N=Ye(m),F=Wn(),W=sr(),B=e.useRef(null),_=e.useRef(null),H=e.useRef(!1),K=e.useRef(!1),V=e.useRef(-1),q=e.useRef(-1),z=null!=W,j=He(I),U=Ge((function(e){return void 0===e&&(e=j),e?Ee(e,lt()):[]})),X=Ge((e=>{const t=U(e);return D.current.map((e=>k&&"reference"===e?k:j&&"floating"===e?j:t)).filter(Boolean).flat()}));e.useEffect((()=>{if(c)return;if(!v)return;function e(e){if("Tab"===e.key){Pe(j,De(We(j)))&&0===U().length&&!L&&qe(e);const t=X(),n=Ne(e);"reference"===D.current[0]&&n===k&&(qe(e),e.shiftKey?Yn(t[t.length-1]):Yn(t[1])),"floating"===D.current[1]&&n===j&&e.shiftKey&&(qe(e),Yn(t[0]))}}const t=We(j);return t.addEventListener("keydown",e),()=>{t.removeEventListener("keydown",e)}}),[c,k,j,v,D,L,U,X]),e.useEffect((()=>{if(!c&&I)return I.addEventListener("focusin",e),()=>{I.removeEventListener("focusin",e)};function e(e){const t=Ne(e),n=U().indexOf(t);-1!==n&&(V.current=n)}}),[c,I,U]),e.useEffect((()=>{if(c)return;if(!h)return;function e(){K.current=!0,setTimeout((()=>{K.current=!1}))}function t(e){const t=e.relatedTarget,n=e.currentTarget,r=Ne(e);queueMicrotask((()=>{const o=C(),i=!(Pe(k,t)||Pe(I,t)||Pe(t,I)||Pe(null==W?void 0:W.portalNode,t)||null!=t&&t.hasAttribute(Kn("focus-guard"))||F&&(Ke(F.nodesRef.current,o).find((e=>{var n,r;return Pe(null==(n=e.context)?void 0:n.elements.floating,t)||Pe(null==(r=e.context)?void 0:r.elements.domReference,t)}))||Ve(F.nodesRef.current,o).find((e=>{var n,r,o;return[null==(n=e.context)?void 0:n.elements.floating,He(null==(r=e.context)?void 0:r.elements.floating)].includes(t)||(null==(o=e.context)?void 0:o.elements.domReference)===t}))));if(n===k&&j&&pr(j,D),p&&n!==k&&(null==r||!r.isConnected)&&De(We(j))===We(j).body){d(j)&&j.focus();const e=V.current,t=U(),n=t[e]||t[t.length-1]||j;d(n)&&n.focus()}E.current.insideReactTree?E.current.insideReactTree=!1:!L&&v||!t||!i||K.current||t===mr()||(H.current=!0,x(!1,e,"focus-out"))}))}const n=Boolean(!F&&W);function r(){Vn(q),E.current.insideReactTree=!0,q.current=window.setTimeout((()=>{E.current.insideReactTree=!1}))}return I&&d(k)?(k.addEventListener("focusout",t),k.addEventListener("pointerdown",e),I.addEventListener("focusout",t),n&&I.addEventListener("focusout",r,!0),()=>{k.removeEventListener("focusout",t),k.removeEventListener("pointerdown",e),I.removeEventListener("focusout",t),n&&I.removeEventListener("focusout",r,!0)}):void 0}),[c,k,I,j,v,F,W,x,h,p,U,L,C,D,E]);const Y=e.useRef(null),$=e.useRef(null),G=ar([Y,null==W?void 0:W.beforeInsideRef]),Q=ar([$,null==W?void 0:W.afterInsideRef]);function Z(e){return!c&&g&&v?n(vr,{ref:"start"===e?B:_,onClick:e=>x(!1,e.nativeEvent),children:"string"==typeof g?g:"Dismiss"}):null}e.useEffect((()=>{var e,t;if(c)return;if(!I)return;const n=Array.from((null==W||null==(e=W.portalNode)?void 0:e.querySelectorAll("["+Kn("portal")+"]"))||[]),r=null==(t=(F?Ve(F.nodesRef.current,C()):[]).find((e=>{var t;return _e((null==(t=e.context)?void 0:t.elements.domReference)||null)})))||null==(t=t.context)?void 0:t.elements.domReference,o=[I,r,...n,...S(),B.current,_.current,Y.current,$.current,null==W?void 0:W.beforeOutsideRef.current,null==W?void 0:W.afterOutsideRef.current,D.current.includes("reference")||L?k:null].filter((e=>null!=e)),i=v||L?rr(o,!O,O):rr(o);return()=>{i()}}),[c,k,I,v,D,W,L,T,O,F,C,S]),Xe((()=>{if(c||!d(j))return;const e=De(We(j));queueMicrotask((()=>{const t=X(j),n=P.current,r=("number"==typeof n?t[n]:n.current)||j,o=Pe(j,e);A||o||!b||Yn(r,{preventScroll:r===j})}))}),[c,b,j,A,X,P]),Xe((()=>{if(c||!j)return;const e=We(j),t=De(e);var n;function r(e){let{reason:t,event:n,nested:r}=e;if(["hover","safe-polygon"].includes(t)&&"mouseleave"===n.type&&(H.current=!0),"outside-press"===t)if(r)H.current=!1;else if(ze(n)||je(n))H.current=!1;else{let e=!1;document.createElement("div").focus({get preventScroll(){return e=!0,!1}}),H.current=!e}}n=t,dr(),n&&"body"!==l(n)&&(fr.push(n),fr.length>20&&(fr=fr.slice(-20))),R.on("openchange",r);const o=e.createElement("span");return o.setAttribute("tabindex","-1"),o.setAttribute("aria-hidden","true"),Object.assign(o.style,or),z&&k&&k.insertAdjacentElement("afterend",o),()=>{R.off("openchange",r);const t=De(e),n=Pe(I,t)||F&&Ke(F.nodesRef.current,C(),!1).some((e=>{var n;return Pe(null==(n=e.context)?void 0:n.elements.floating,t)})),i=function(){if("boolean"==typeof N.current){const e=k||mr();return e&&e.isConnected?e:o}return N.current.current||o}();queueMicrotask((()=>{const r=function(e){const t=lt();return ke(e,t)?e:Ee(e,t)[0]||e}(i);N.current&&!H.current&&d(r)&&(r===t||t===e.body||n)&&r.focus({preventScroll:!0}),o.remove()}))}}),[c,I,j,N,E,R,F,z,k,C]),e.useEffect((()=>(queueMicrotask((()=>{H.current=!1})),()=>{queueMicrotask(dr)})),[c]),Xe((()=>{if(!c&&W)return W.setFocusManagerState({modal:v,closeOnFocusOut:h,open:b,onOpenChange:x,domReference:k}),()=>{W.setFocusManagerState(null)}}),[c,W,v,b,x,h,k]),Xe((()=>{c||j&&pr(j,D)}),[c,j,D]);const J=!c&&T&&(!v||!L)&&(z||v);return r(o,{children:[J&&n(ir,{"data-type":"inside",ref:G,onFocus:e=>{if(v){const e=X();Yn("reference"===s[0]?e[0]:e[e.length-1])}else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(H.current=!1,ft(e,W.portalNode)){const e=st(k);null==e||e.focus()}else{var t;null==(t=W.beforeOutsideRef.current)||t.focus()}}}),!L&&Z("start"),u,Z("end"),J&&n(ir,{"data-type":"inside",ref:Q,onFocus:e=>{if(v)Yn(X()[0]);else if(null!=W&&W.preserveTabOrder&&W.portalNode)if(h&&(H.current=!0),ft(e,W.portalNode)){const e=at(k);null==e||e.focus()}else{var t;null==(t=W.afterOutsideRef.current)||t.focus()}}})]})}let hr=0;const yr="--floating-ui-scrollbar-width";let wr=()=>{};const br=e.forwardRef((function(e,t){const{lockScroll:r=!1,...o}=e;return Xe((()=>{if(r)return hr++,1===hr&&(wr=function(){const e=Ie(),t=/iP(hone|ad|od)|iOS/.test(e)||"MacIntel"===e&&navigator.maxTouchPoints>1,n=document.body.style,r=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",o=window.innerWidth-document.documentElement.clientWidth,i=n.left?parseFloat(n.left):window.scrollX,u=n.top?parseFloat(n.top):window.scrollY;if(n.overflow="hidden",n.setProperty(yr,o+"px"),o&&(n[r]=o+"px"),t){var l,c;const e=(null==(l=window.visualViewport)?void 0:l.offsetLeft)||0,t=(null==(c=window.visualViewport)?void 0:c.offsetTop)||0;Object.assign(n,{position:"fixed",top:-(u-Math.floor(t))+"px",left:-(i-Math.floor(e))+"px",right:"0"})}return()=>{Object.assign(n,{overflow:"",[r]:""}),n.removeProperty(yr),t&&(Object.assign(n,{position:"",top:"",left:"",right:""}),window.scrollTo(i,u))}}()),()=>{hr--,0===hr&&wr()}}),[r]),n("div",{ref:t,...o,style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...o.style}})}));function xr(e){return d(e.target)&&"BUTTON"===e.target.tagName}function Rr(e){return Be(e)}function Er(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,dataRef:i,elements:{domReference:u}}=t,{enabled:l=!0,event:c="click",toggle:s=!0,ignoreMouse:a=!1,keyboardHandlers:f=!0,stickIfOpen:m=!0}=n,p=e.useRef(),v=e.useRef(!1),g=e.useMemo((()=>({onPointerDown(e){p.current=e.pointerType},onMouseDown(e){const t=p.current;0===e.button&&"click"!==c&&(Ue(t,!0)&&a||(!r||!s||i.current.openEvent&&m&&"mousedown"!==i.current.openEvent.type?(e.preventDefault(),o(!0,e.nativeEvent,"click")):o(!1,e.nativeEvent,"click")))},onClick(e){const t=p.current;"mousedown"===c&&p.current?p.current=void 0:Ue(t,!0)&&a||(!r||!s||i.current.openEvent&&m&&"click"!==i.current.openEvent.type?o(!0,e.nativeEvent,"click"):o(!1,e.nativeEvent,"click"))},onKeyDown(e){p.current=void 0,e.defaultPrevented||!f||xr(e)||(" "!==e.key||Rr(u)||(e.preventDefault(),v.current=!0),function(e){return d(e.target)&&"A"===e.target.tagName}(e)||"Enter"===e.key&&o(!r||!s,e.nativeEvent,"click"))},onKeyUp(e){e.defaultPrevented||!f||xr(e)||Rr(u)||" "===e.key&&v.current&&(v.current=!1,o(!r||!s,e.nativeEvent,"click"))}})),[i,u,c,a,f,o,r,m,s]);return e.useMemo((()=>l?{reference:g}:{}),[l,g])}const kr={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ir={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Cr=e=>{var t,n;return{escapeKey:"boolean"==typeof e?e:null!=(t=null==e?void 0:e.escapeKey)&&t,outsidePress:"boolean"==typeof e?e:null==(n=null==e?void 0:e.outsidePress)||n}};function Sr(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,elements:i,dataRef:u}=t,{enabled:l=!0,escapeKey:c=!0,outsidePress:s=!0,outsidePressEvent:a="pointerdown",referencePress:m=!1,referencePressEvent:p="pointerdown",ancestorScroll:v=!1,bubbles:g,capture:h}=n,y=Wn(),w=Ge("function"==typeof s?s:()=>!1),b="function"==typeof s?w:s,x=e.useRef(!1),{escapeKey:R,outsidePress:E}=Cr(g),{escapeKey:I,outsidePress:A}=Cr(h),M=e.useRef(!1),O=Ge((e=>{var t;if(!r||!l||!c||"Escape"!==e.key)return;if(M.current)return;const n=null==(t=u.current.floatingContext)?void 0:t.nodeId,i=y?Ke(y.nodesRef.current,n):[];if(!R&&(e.stopPropagation(),i.length>0)){let e=!0;if(i.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__escapeKeyBubbles||(e=!1)})),!e)return}o(!1,function(e){return"nativeEvent"in e}(e)?e.nativeEvent:e,"escape-key")})),D=Ge((e=>{var t;const n=()=>{var t;O(e),null==(t=Ne(e))||t.removeEventListener("keydown",n)};null==(t=Ne(e))||t.addEventListener("keydown",n)})),P=Ge((e=>{var t;const n=u.current.insideReactTree;u.current.insideReactTree=!1;const r=x.current;if(x.current=!1,"click"===a&&r)return;if(n)return;if("function"==typeof b&&!b(e))return;const l=Ne(e),c="["+Kn("inert")+"]",s=We(i.floating).querySelectorAll(c);let m=f(l)?l:null;for(;m&&!C(m);){const e=L(m);if(C(e)||!f(e))break;m=e}if(s.length&&f(l)&&!l.matches("html,body")&&!Pe(l,i.floating)&&Array.from(s).every((e=>!Pe(m,e))))return;if(d(l)&&W){const t=C(l),n=S(l),r=/auto|scroll/,o=t||r.test(n.overflowX),i=t||r.test(n.overflowY),u=o&&l.clientWidth>0&&l.scrollWidth>l.clientWidth,c=i&&l.clientHeight>0&&l.scrollHeight>l.clientHeight,s="rtl"===n.direction,a=c&&(s?e.offsetX<=l.offsetWidth-l.clientWidth:e.offsetX>l.clientWidth),f=u&&e.offsetY>l.clientHeight;if(a||f)return}const p=null==(t=u.current.floatingContext)?void 0:t.nodeId,v=y&&Ke(y.nodesRef.current,p).some((t=>{var n;return Fe(e,null==(n=t.context)?void 0:n.elements.floating)}));if(Fe(e,i.floating)||Fe(e,i.domReference)||v)return;const g=y?Ke(y.nodesRef.current,p):[];if(g.length>0){let e=!0;if(g.forEach((t=>{var n;null==(n=t.context)||!n.open||t.context.dataRef.current.__outsidePressBubbles||(e=!1)})),!e)return}o(!1,e,"outside-press")})),N=Ge((e=>{var t;const n=()=>{var t;P(e),null==(t=Ne(e))||t.removeEventListener(a,n)};null==(t=Ne(e))||t.addEventListener(a,n)}));e.useEffect((()=>{if(!r||!l)return;u.current.__escapeKeyBubbles=R,u.current.__outsidePressBubbles=E;let e=-1;function t(e){o(!1,e,"ancestor-scroll")}function n(){window.clearTimeout(e),M.current=!0}function s(){e=window.setTimeout((()=>{M.current=!1}),k()?5:0)}const d=We(i.floating);c&&(d.addEventListener("keydown",I?D:O,I),d.addEventListener("compositionstart",n),d.addEventListener("compositionend",s)),b&&d.addEventListener(a,A?N:P,A);let m=[];return v&&(f(i.domReference)&&(m=T(i.domReference)),f(i.floating)&&(m=m.concat(T(i.floating))),!f(i.reference)&&i.reference&&i.reference.contextElement&&(m=m.concat(T(i.reference.contextElement)))),m=m.filter((e=>{var t;return e!==(null==(t=d.defaultView)?void 0:t.visualViewport)})),m.forEach((e=>{e.addEventListener("scroll",t,{passive:!0})})),()=>{c&&(d.removeEventListener("keydown",I?D:O,I),d.removeEventListener("compositionstart",n),d.removeEventListener("compositionend",s)),b&&d.removeEventListener(a,A?N:P,A),m.forEach((e=>{e.removeEventListener("scroll",t)})),window.clearTimeout(e)}}),[u,i,c,b,a,r,o,v,l,R,E,O,I,D,P,A,N]),e.useEffect((()=>{u.current.insideReactTree=!1}),[u,b,a]);const F=e.useMemo((()=>({onKeyDown:O,...m&&{[kr[p]]:e=>{o(!1,e.nativeEvent,"reference-press")},..."click"!==p&&{onClick(e){o(!1,e.nativeEvent,"reference-press")}}}})),[O,o,m,p]),W=e.useMemo((()=>({onKeyDown:O,onMouseDown(){x.current=!0},onMouseUp(){x.current=!0},[Ir[a]]:()=>{u.current.insideReactTree=!0}})),[O,a,u]);return e.useMemo((()=>l?{reference:F,floating:W}:{}),[l,F,W])}function Ar(t){const{open:n=!1,onOpenChange:r,elements:o}=t,i=Ln(),u=e.useRef({}),[l]=e.useState((()=>Dn())),c=null!=Fn();if("production"!==process.env.NODE_ENV){const e=o.reference;e&&!f(e)&&function(){for(var e,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const o="Floating UI: "+n.join(" ");var i;null!=(e=Mn)&&e.has(o)||(null==(i=Mn)||i.add(o),console.error(o))}("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[s,a]=e.useState(o.reference),d=Ge(((e,t,n)=>{u.current.openEvent=e?t:void 0,l.emit("openchange",{open:e,event:t,reason:n,nested:c}),null==r||r(e,t,n)})),m=e.useMemo((()=>({setPositionReference:a})),[]),p=e.useMemo((()=>({reference:s||o.reference||null,floating:o.floating||null,domReference:o.reference})),[s,o.reference,o.floating]);return e.useMemo((()=>({dataRef:u,open:n,onOpenChange:d,elements:p,events:l,floatingId:i,refs:m})),[n,d,p,l,i,m])}function Lr(t){void 0===t&&(t={});const{nodeId:n}=t,r=Ar({...t,elements:{reference:null,floating:null,...t.elements}}),o=t.rootContext||r,u=o.elements,[l,c]=e.useState(null),[s,a]=e.useState(null),d=(null==u?void 0:u.domReference)||l,m=e.useRef(null),p=Wn();Xe((()=>{d&&(m.current=d)}),[d]);const v=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:u,elements:{reference:l,floating:c}={},transform:s=!0,whileElementsMounted:a,open:f}=t,[d,m]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[p,v]=e.useState(o);Xt(p,o)||v(o);const[g,h]=e.useState(null),[y,w]=e.useState(null),b=e.useCallback((e=>{e!==k.current&&(k.current=e,h(e))}),[]),x=e.useCallback((e=>{e!==I.current&&(I.current=e,w(e))}),[]),R=l||g,E=c||y,k=e.useRef(null),I=e.useRef(null),C=e.useRef(d),S=null!=a,A=Gt(a),L=Gt(u),M=Gt(f),T=e.useCallback((()=>{if(!k.current||!I.current)return;const e={placement:n,strategy:r,middleware:p};L.current&&(e.platform=L.current),jt(k.current,I.current,e).then((e=>{const t={...e,isPositioned:!1!==M.current};O.current&&!Xt(C.current,t)&&(C.current=t,i.flushSync((()=>{m(t)})))}))}),[p,n,r,L,M]);Ut((()=>{!1===f&&C.current.isPositioned&&(C.current.isPositioned=!1,m((e=>({...e,isPositioned:!1}))))}),[f]);const O=e.useRef(!1);Ut((()=>(O.current=!0,()=>{O.current=!1})),[]),Ut((()=>{if(R&&(k.current=R),E&&(I.current=E),R&&E){if(A.current)return A.current(R,E,T);T()}}),[R,E,T,A,S]);const D=e.useMemo((()=>({reference:k,floating:I,setReference:b,setFloating:x})),[b,x]),P=e.useMemo((()=>({reference:R,floating:E})),[R,E]),N=e.useMemo((()=>{const e={position:r,left:0,top:0};if(!P.floating)return e;const t=$t(P.floating,d.x),n=$t(P.floating,d.y);return s?{...e,transform:"translate("+t+"px, "+n+"px)",...Yt(P.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}}),[r,s,P.floating,d.x,d.y]);return e.useMemo((()=>({...d,update:T,refs:D,elements:P,floatingStyles:N})),[d,T,D,P,N])}({...t,elements:{...u,...s&&{reference:s}}}),g=e.useCallback((e=>{const t=f(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;a(t),v.refs.setReference(t)}),[v.refs]),h=e.useCallback((e=>{(f(e)||null===e)&&(m.current=e,c(e)),(f(v.refs.reference.current)||null===v.refs.reference.current||null!==e&&!f(e))&&v.refs.setReference(e)}),[v.refs]),y=e.useMemo((()=>({...v.refs,setReference:h,setPositionReference:g,domReference:m})),[v.refs,h,g]),w=e.useMemo((()=>({...v.elements,domReference:d})),[v.elements,d]),b=e.useMemo((()=>({...v,...o,refs:y,elements:w,nodeId:n})),[v,y,w,n,o]);return Xe((()=>{o.dataRef.current.floatingContext=b;const e=null==p?void 0:p.nodesRef.current.find((e=>e.id===n));e&&(e.context=b)})),e.useMemo((()=>({...v,context:b,refs:y,elements:w})),[v,y,w,b])}function Mr(){return Ie().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints&&Se()}function Tr(t,n){void 0===n&&(n={});const{open:r,onOpenChange:o,events:i,dataRef:u,elements:l}=t,{enabled:s=!0,visibleOnly:a=!0}=n,m=e.useRef(!1),p=e.useRef(-1),v=e.useRef(!0);e.useEffect((()=>{if(!s)return;const e=c(l.domReference);function t(){!r&&d(l.domReference)&&l.domReference===De(We(l.domReference))&&(m.current=!0)}function n(){v.current=!0}function o(){v.current=!1}return e.addEventListener("blur",t),Mr()&&(e.addEventListener("keydown",n,!0),e.addEventListener("pointerdown",o,!0)),()=>{e.removeEventListener("blur",t),Mr()&&(e.removeEventListener("keydown",n,!0),e.removeEventListener("pointerdown",o,!0))}}),[l.domReference,r,s]),e.useEffect((()=>{if(s)return i.on("openchange",e),()=>{i.off("openchange",e)};function e(e){let{reason:t}=e;"reference-press"!==t&&"escape-key"!==t||(m.current=!0)}}),[i,s]),e.useEffect((()=>()=>{Vn(p)}),[]);const g=e.useMemo((()=>({onMouseLeave(){m.current=!1},onFocus(e){if(m.current)return;const t=Ne(e.nativeEvent);if(a&&f(t))if(Mr()&&!e.relatedTarget){if(!v.current&&!Be(t))return}else if(!function(e){if(!e||Le())return!0;try{return e.matches(":focus-visible")}catch(e){return!0}}(t))return;o(!0,e.nativeEvent,"focus")},onBlur(e){m.current=!1;const t=e.relatedTarget,n=e.nativeEvent,r=f(t)&&t.hasAttribute(Kn("focus-guard"))&&"outside"===t.getAttribute("data-type");p.current=window.setTimeout((()=>{var e;const i=De(l.domReference?l.domReference.ownerDocument:document);(t||i!==l.domReference)&&(Pe(null==(e=u.current.floatingContext)?void 0:e.refs.floating.current,i)||Pe(l.domReference,i)||r||o(!1,n,"focus"))}))}})),[u,l.domReference,o,a]);return e.useMemo((()=>s?{reference:g}:{}),[s,g])}function Or(e,t,n){const r=new Map,o="item"===n;let i=e;if(o&&e){const{[dn]:t,[mn]:n,...r}=e;i=r}return{..."floating"===n&&{tabIndex:-1,[fn]:""},...i,...t.map((t=>{const r=t?t[n]:null;return"function"==typeof r?e?r(e):null:r})).concat(e).reduce(((e,t)=>t?(Object.entries(t).forEach((t=>{let[n,i]=t;var u;o&&[dn,mn].includes(n)||(0===n.indexOf("on")?(r.has(n)||r.set(n,[]),"function"==typeof i&&(null==(u=r.get(n))||u.push(i),e[n]=function(){for(var e,t=arguments.length,o=new Array(t),i=0;i<t;i++)o[i]=arguments[i];return null==(e=r.get(n))?void 0:e.map((e=>e(...o))).find((e=>void 0!==e))})):e[n]=i)})),e):e),{})}}function Dr(t){void 0===t&&(t=[]);const n=t.map((e=>null==e?void 0:e.reference)),r=t.map((e=>null==e?void 0:e.floating)),o=t.map((e=>null==e?void 0:e.item)),i=e.useCallback((e=>Or(e,t,"reference")),n),u=e.useCallback((e=>Or(e,t,"floating")),r),l=e.useCallback((e=>Or(e,t,"item")),o);return e.useMemo((()=>({getReferenceProps:i,getFloatingProps:u,getItemProps:l})),[i,u,l])}function Pr(e,t,n){switch(e){case"vertical":return t;case"horizontal":return n;default:return t||n}}function Nr(e,t){return Pr(t,e===gn||e===hn,e===pn||e===vn)}function Fr(e,t,n){return Pr(t,e===hn,n?e===pn:e===vn)||"Enter"===e||" "===e||""===e}function Wr(e,t,n){return Pr(t,n?e===pn:e===vn,e===hn)}function Br(e,t,n,r){return"both"===t||"horizontal"===t&&r&&r>1?"Escape"===e:Pr(t,n?e===vn:e===pn,e===gn)}function _r(t,n){const{open:r,onOpenChange:o,elements:i,floatingId:u}=t,{listRef:l,activeIndex:c,onNavigate:s=()=>{},enabled:a=!0,selectedIndex:f=null,allowEscape:m=!1,loop:p=!1,nested:v=!1,rtl:g=!1,virtual:h=!1,focusItemOnOpen:y="auto",focusItemOnHover:w=!0,openOnArrowKeyDown:b=!0,disabledIndices:x,orientation:R="vertical",parentOrientation:E,cols:k=1,scrollItemIntoView:I=!0,virtualItemRef:C,itemSizes:S,dense:A=!1}=n;"production"!==process.env.NODE_ENV&&(m&&(p||Tn("`useListNavigation` looping must be enabled to allow escaping."),h||Tn("`useListNavigation` must be virtual to allow escaping.")),"vertical"===R&&k>1&&Tn("In grid list navigation mode (`cols` > 1), the `orientation` should",'be either "horizontal" or "both".'));const L=Ye(He(i.floating)),M=Fn(),T=Wn();Xe((()=>{t.dataRef.current.orientation=R}),[t,R]);const O=Ge((()=>{s(-1===N.current?null:N.current)})),D=_e(i.domReference),P=e.useRef(y),N=e.useRef(null!=f?f:-1),F=e.useRef(null),W=e.useRef(!0),B=e.useRef(O),_=e.useRef(!!i.floating),H=e.useRef(r),K=e.useRef(!1),V=e.useRef(!1),q=Ye(x),z=Ye(r),j=Ye(I),U=Ye(f),[X,Y]=e.useState(),[$,G]=e.useState(),Q=Ge((()=>{function e(e){var t;h?(null!=(t=e.id)&&t.endsWith("-fui-option")&&(e.id=u+"-"+Math.random().toString(16).slice(2,10)),Y(e.id),null==T||T.events.emit("virtualfocus",e),C&&(C.current=e)):Yn(e,{sync:K.current,preventScroll:!0})}const t=l.current[N.current],n=V.current;t&&e(t);(K.current?e=>e():requestAnimationFrame)((()=>{const r=l.current[N.current]||t;if(!r)return;t||e(r);const o=j.current;o&&J&&(n||!W.current)&&(null==r.scrollIntoView||r.scrollIntoView("boolean"==typeof o?{block:"nearest",inline:"nearest"}:o))}))}));Xe((()=>{a&&(r&&i.floating?P.current&&null!=f&&(V.current=!0,N.current=f,O()):_.current&&(N.current=-1,B.current()))}),[a,r,i.floating,f,O]),Xe((()=>{if(a&&r&&i.floating)if(null==c){if(K.current=!1,null!=U.current)return;if(_.current&&(N.current=-1,Q()),(!H.current||!_.current)&&P.current&&(null!=F.current||!0===P.current&&null==F.current)){let e=0;const t=()=>{if(null==l.current[0]){if(e<2){(e?requestAnimationFrame:queueMicrotask)(t)}e++}else N.current=null==F.current||Fr(F.current,R,g)||v?Je(l,q.current):et(l,q.current),F.current=null,O()};t()}}else Ze(l,c)||(N.current=c,Q(),V.current=!1)}),[a,r,i.floating,c,U,v,l,R,g,O,Q,q]),Xe((()=>{var e;if(!a||i.floating||!T||h||!_.current)return;const t=T.nodesRef.current,n=null==(e=t.find((e=>e.id===M)))||null==(e=e.context)?void 0:e.elements.floating,r=De(We(i.floating)),o=t.some((e=>e.context&&Pe(e.context.elements.floating,r)));n&&!o&&W.current&&n.focus({preventScroll:!0})}),[a,i.floating,T,M,h]),Xe((()=>{if(a&&T&&h&&!M)return T.events.on("virtualfocus",e),()=>{T.events.off("virtualfocus",e)};function e(e){G(e.id),C&&(C.current=e)}}),[a,T,h,M,C]),Xe((()=>{B.current=O,H.current=r,_.current=!!i.floating})),Xe((()=>{r||(F.current=null,P.current=y)}),[r,y]);const Z=null!=c,J=e.useMemo((()=>{function e(e){if(!z.current)return;const t=l.current.indexOf(e);-1!==t&&N.current!==t&&(N.current=t,O())}return{onFocus(t){let{currentTarget:n}=t;K.current=!0,e(n)},onClick:e=>{let{currentTarget:t}=e;return t.focus({preventScroll:!0})},onMouseMove(t){let{currentTarget:n}=t;K.current=!0,V.current=!1,w&&e(n)},onPointerLeave(e){let{pointerType:t}=e;var n;W.current&&"touch"!==t&&(K.current=!0,w&&(N.current=-1,O(),h||null==(n=L.current)||n.focus({preventScroll:!0})))}}}),[z,L,w,l,O,h]),ee=e.useCallback((()=>{var e;return null!=E?E:null==T||null==(e=T.nodesRef.current.find((e=>e.id===M)))||null==(e=e.context)||null==(e=e.dataRef)?void 0:e.current.orientation}),[M,T,E]),te=Ge((e=>{if(W.current=!1,K.current=!0,229===e.which)return;if(!z.current&&e.currentTarget===L.current)return;if(v&&Br(e.key,R,g,k))return Nr(e.key,ee())||qe(e),o(!1,e.nativeEvent,"list-navigation"),void(d(i.domReference)&&(h?null==T||T.events.emit("virtualfocus",i.domReference):i.domReference.focus()));const t=N.current,n=Je(l,x),u=et(l,x);if(D||("Home"===e.key&&(qe(e),N.current=n,O()),"End"===e.key&&(qe(e),N.current=u,O())),k>1){const t=S||Array.from({length:l.current.length},(()=>({width:1,height:1}))),r=rt(t,k,A),o=r.findIndex((e=>null!=e&&!ut(l,e,x))),i=r.reduce(((e,t,n)=>null==t||ut(l,t,x)?e:n),-1),c=r[nt({current:r.map((e=>null!=e?l.current[e]:null))},{event:e,orientation:R,loop:p,rtl:g,cols:k,disabledIndices:it([...("function"!=typeof x?x:null)||l.current.map(((e,t)=>ut(l,t,x)?t:void 0)),void 0],r),minIndex:o,maxIndex:i,prevIndex:ot(N.current>u?n:N.current,t,r,k,e.key===hn?"bl":e.key===(g?pn:vn)?"tr":"tl"),stopEvent:!0})];if(null!=c&&(N.current=c,O()),"both"===R)return}if(Nr(e.key,R)){if(qe(e),r&&!h&&De(e.currentTarget.ownerDocument)===e.currentTarget)return N.current=Fr(e.key,R,g)?n:u,void O();Fr(e.key,R,g)?N.current=p?t>=u?m&&t!==l.current.length?-1:n:tt(l,{startingIndex:t,disabledIndices:x}):Math.min(u,tt(l,{startingIndex:t,disabledIndices:x})):N.current=p?t<=n?m&&-1!==t?l.current.length:u:tt(l,{startingIndex:t,decrement:!0,disabledIndices:x}):Math.max(n,tt(l,{startingIndex:t,decrement:!0,disabledIndices:x})),Ze(l,N.current)&&(N.current=-1),O()}})),ne=e.useMemo((()=>h&&r&&Z&&{"aria-activedescendant":$||X}),[h,r,Z,$,X]),re=e.useMemo((()=>({"aria-orientation":"both"===R?void 0:R,...D?{}:ne,onKeyDown:te,onPointerMove(){W.current=!0}})),[ne,te,R,D]),oe=e.useMemo((()=>{function e(e){"auto"===y&&ze(e.nativeEvent)&&(P.current=!0)}function t(e){P.current=y,"auto"===y&&je(e.nativeEvent)&&(P.current=!0)}return{...ne,onKeyDown(e){W.current=!1;const t=e.key.startsWith("Arrow"),n=["Home","End"].includes(e.key),i=t||n,u=Wr(e.key,R,g),c=Br(e.key,R,g,k),s=Wr(e.key,ee(),g),a=Nr(e.key,R),d=(v?s:a)||"Enter"===e.key||""===e.key.trim();if(h&&r){const t=null==T?void 0:T.nodesRef.current.find((e=>null==e.parentId)),r=T&&t?function(e,t){let n,r=-1;return function t(o,i){i>r&&(n=o,r=i),Ke(e,o).forEach((e=>{t(e.id,i+1)}))}(t,0),e.find((e=>e.id===n))}(T.nodesRef.current,t.id):null;if(i&&r&&C){const t=new KeyboardEvent("keydown",{key:e.key,bubbles:!0});if(u||c){var m,p;const n=(null==(m=r.context)?void 0:m.elements.domReference)===e.currentTarget,o=c&&!n?null==(p=r.context)?void 0:p.elements.domReference:u?l.current.find((e=>(null==e?void 0:e.id)===X)):null;o&&(qe(e),o.dispatchEvent(t),G(void 0))}var y;if((a||n)&&r.context)if(r.context.open&&r.parentId&&e.currentTarget!==r.context.elements.domReference)return qe(e),void(null==(y=r.context.elements.domReference)||y.dispatchEvent(t))}return te(e)}if(r||b||!t){if(d){const t=Nr(e.key,ee());F.current=v&&t?null:e.key}v?s&&(qe(e),r?(N.current=Je(l,q.current),O()):o(!0,e.nativeEvent,"list-navigation")):a&&(null!=f&&(N.current=f),qe(e),!r&&b?o(!0,e.nativeEvent,"list-navigation"):te(e),r&&O())}},onFocus(){r&&!h&&(N.current=-1,O())},onPointerDown:t,onPointerEnter:t,onMouseDown:e,onClick:e}}),[X,ne,k,te,q,y,l,v,O,o,r,b,R,ee,g,f,T,h,C]);return e.useMemo((()=>a?{reference:oe,floating:re,item:J}:{}),[a,oe,re,J])}const Hr=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function Kr(t,n){var r,o;void 0===n&&(n={});const{open:i,elements:u,floatingId:l}=t,{enabled:c=!0,role:s="dialog"}=n,a=Ln(),f=(null==(r=u.domReference)?void 0:r.id)||a,d=e.useMemo((()=>{var e;return(null==(e=He(u.floating))?void 0:e.id)||l}),[u.floating,l]),m=null!=(o=Hr.get(s))?o:s,p=null!=Fn(),v=e.useMemo((()=>"tooltip"===m||"label"===s?{["aria-"+("label"===s?"labelledby":"describedby")]:i?d:void 0}:{"aria-expanded":i?"true":"false","aria-haspopup":"alertdialog"===m?"dialog":m,"aria-controls":i?d:void 0,..."listbox"===m&&{role:"combobox"},..."menu"===m&&{id:f},..."menu"===m&&p&&{role:"menuitem"},..."select"===s&&{"aria-autocomplete":"none"},..."combobox"===s&&{"aria-autocomplete":"list"}}),[m,d,p,i,f,s]),g=e.useMemo((()=>{const e={id:d,...m&&{role:m}};return"tooltip"===m||"label"===s?e:{...e,..."menu"===m&&{"aria-labelledby":f}}}),[m,d,f,s]),h=e.useCallback((e=>{let{active:t,selected:n}=e;const r={role:"option",...t&&{id:d+"-fui-option"}};switch(s){case"select":case"combobox":return{...r,"aria-selected":n}}return{}}),[d,s]);return e.useMemo((()=>c?{reference:v,floating:g,item:h}:{}),[c,v,g,h])}function Vr(t,n){var r;const{open:o,dataRef:i}=t,{listRef:u,activeIndex:l,onMatch:c,onTypingChange:s,enabled:a=!0,findMatch:f=null,resetMs:d=750,ignoreKeys:m=[],selectedIndex:p=null}=n,v=e.useRef(-1),g=e.useRef(""),h=e.useRef(null!=(r=null!=p?p:l)?r:-1),y=e.useRef(null),w=Ge(c),b=Ge(s),x=Ye(f),R=Ye(m);Xe((()=>{o&&(Vn(v),y.current=null,g.current="")}),[o]),Xe((()=>{var e;o&&""===g.current&&(h.current=null!=(e=null!=p?p:l)?e:-1)}),[o,p,l]);const E=Ge((e=>{e?i.current.typing||(i.current.typing=e,b(e)):i.current.typing&&(i.current.typing=e,b(e))})),k=Ge((e=>{function t(e,t,n){const r=x.current?x.current(t,n):t.find((e=>0===(null==e?void 0:e.toLocaleLowerCase().indexOf(n.toLocaleLowerCase()))));return r?e.indexOf(r):-1}const n=u.current;if(g.current.length>0&&" "!==g.current[0]&&(-1===t(n,n,g.current)?E(!1):" "===e.key&&qe(e)),null==n||R.current.includes(e.key)||1!==e.key.length||e.ctrlKey||e.metaKey||e.altKey)return;o&&" "!==e.key&&(qe(e),E(!0));n.every((e=>{var t,n;return!e||(null==(t=e[0])?void 0:t.toLocaleLowerCase())!==(null==(n=e[1])?void 0:n.toLocaleLowerCase())}))&&g.current===e.key&&(g.current="",h.current=y.current),g.current+=e.key,Vn(v),v.current=window.setTimeout((()=>{g.current="",h.current=y.current,E(!1)}),d);const r=h.current,i=t(n,[...n.slice((r||0)+1),...n.slice(0,(r||0)+1)],g.current);-1!==i?(w(i),y.current=i):" "!==e.key&&(g.current="",E(!1))})),I=e.useMemo((()=>({onKeyDown:k})),[k]),C=e.useMemo((()=>({onKeyDown:k,onKeyUp(e){" "===e.key&&E(!1)}})),[k,E]);return e.useMemo((()=>a?{reference:I,floating:C}:{}),[a,I,C])}function qr(e,t,n){void 0===n&&(n=!0);return e.filter((e=>{var r;return e.parentId===t&&(!n||(null==(r=e.context)?void 0:r.open))})).flatMap((t=>[t,...qr(e,t.id,n)]))}function zr(e,t){const[n,r]=e;let o=!1;const i=t.length;for(let e=0,u=i-1;e<i;u=e++){const[i,l]=t[e]||[0,0],[c,s]=t[u]||[0,0];l>=r!=s>=r&&n<=(c-i)*(r-l)/(s-l)+i&&(o=!o)}return o}function jr(e){void 0===e&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:r=!0}=e,o={current:-1};let i=!1,u=null,l=null,c="undefined"!=typeof performance?performance.now():0;const s=e=>{let{x:n,y:s,placement:a,elements:d,onClose:m,nodeId:p,tree:v}=e;return function(e){function g(){Vn(o),m()}if(Vn(o),!d.domReference||!d.floating||null==a||null==n||null==s)return;const{clientX:h,clientY:y}=e,w=[h,y],b=function(e){return"composedPath"in e?e.composedPath()[0]:e.target}(e),x="mouseleave"===e.type,R=$n(d.floating,b),E=$n(d.domReference,b),k=d.domReference.getBoundingClientRect(),I=d.floating.getBoundingClientRect(),C=a.split("-")[0],S=n>I.right-I.width/2,A=s>I.bottom-I.height/2,L=function(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}(w,k),M=I.width>k.width,T=I.height>k.height,O=(M?k:I).left,D=(M?k:I).right,P=(T?k:I).top,N=(T?k:I).bottom;if(R&&(i=!0,!x))return;if(E&&(i=!1),E&&!x)return void(i=!0);if(x&&f(e.relatedTarget)&&$n(d.floating,e.relatedTarget))return;if(v&&qr(v.nodesRef.current,p).length)return;if("top"===C&&s>=k.bottom-1||"bottom"===C&&s<=k.top+1||"left"===C&&n>=k.right-1||"right"===C&&n<=k.left+1)return g();let F=[];switch(C){case"top":F=[[O,k.top+1],[O,I.bottom-1],[D,I.bottom-1],[D,k.top+1]];break;case"bottom":F=[[O,I.top+1],[O,k.bottom-1],[D,k.bottom-1],[D,I.top+1]];break;case"left":F=[[I.right-1,N],[I.right-1,P],[k.left+1,P],[k.left+1,N]];break;case"right":F=[[k.right-1,N],[k.right-1,P],[I.left+1,P],[I.left+1,N]]}if(!zr([h,y],F)){if(i&&!L)return g();if(!x&&r){const t=function(e,t){const n=performance.now(),r=n-c;if(null===u||null===l||0===r)return u=e,l=t,c=n,null;const o=e-u,i=t-l,s=Math.sqrt(o*o+i*i);return u=e,l=t,c=n,s/r}(e.clientX,e.clientY);if(null!==t&&t<.1)return g()}zr([h,y],function(e){let[n,r]=e;switch(C){case"top":return[[M?n+t/2:S?n+4*t:n-4*t,r+t+1],[M?n-t/2:S?n+4*t:n-4*t,r+t+1],...[[I.left,S||M?I.bottom-t:I.top],[I.right,S?M?I.bottom-t:I.top:I.bottom-t]]];case"bottom":return[[M?n+t/2:S?n+4*t:n-4*t,r-t],[M?n-t/2:S?n+4*t:n-4*t,r-t],...[[I.left,S||M?I.top+t:I.bottom],[I.right,S?M?I.top+t:I.bottom:I.top+t]]];case"left":{const e=[n+t+1,T?r+t/2:A?r+4*t:r-4*t],o=[n+t+1,T?r-t/2:A?r+4*t:r-4*t];return[...[[A||T?I.right-t:I.left,I.top],[A?T?I.right-t:I.left:I.right-t,I.bottom]],e,o]}case"right":return[[n-t,T?r+t/2:A?r+4*t:r-4*t],[n-t,T?r-t/2:A?r+4*t:r-4*t],...[[A||T?I.left+t:I.right,I.top],[A?T?I.left+t:I.right:I.left+t,I.bottom]]]}}([n,s]))?!i&&r&&(o.current=window.setTimeout(g,40)):g()}}};return s.__options={blockPointerEvents:n},s}export{_r as A,Ft as B,kn as C,Lr as D,gr as E,Hn as F,br as G,cr as H,st as I,Bn as a,Ln as b,En as c,Wt as d,Jt as e,tn as f,Un as g,rn as h,Sr as i,Dr as j,Tr as k,en as l,Kr as m,on as n,Zt as o,_n as p,Wn as q,Fn as r,nn as s,jr as t,un as u,On as v,an as w,Vr as x,Er as y,sn as z};
@@ -1 +1 @@
1
- 'use client';"use strict";var e=require("react/jsx-runtime"),i=require("react"),r=require("./index-CbKtybdA.cjs");const t=i.forwardRef((({role:i="button",type:t="button",label:a="",description:d="",disabled:s=!1,children:l,...n},o)=>(a&&(n["aria-label"]=a),d&&(n["aria-description"]=d),s&&(n["aria-disabled"]="true"),e.jsx(r.Primitive.button,{ref:o,role:i,type:t,disabled:s,...n,children:l}))));t.displayName="ButtonPrimitive",exports.ButtonPrimitive=t;
1
+ 'use client';"use strict";var e=require("react/jsx-runtime"),i=require("react"),r=require("./index-Bg-UeWCo.cjs");const t=i.forwardRef((({role:i="button",type:t="button",label:a="",description:d="",disabled:s=!1,children:l,...n},o)=>(a&&(n["aria-label"]=a),d&&(n["aria-description"]=d),s&&(n["aria-disabled"]="true"),e.jsx(r.Primitive.button,{ref:o,role:i,type:t,disabled:s,...n,children:l}))));t.displayName="ButtonPrimitive",exports.ButtonPrimitive=t;
@@ -0,0 +1 @@
1
+ 'use client';import{a as s,b as a,C as e,c as o,u as t,d as i,s as u,o as r,h as l,l as n,e as g,f as d,g as f,i as F,j as m,k as c,m as p,n as I,F as h,p as v,q as w,r as y,t as C,v as N,w as L,x as P,y as T,z as j,A as k,B as x,D as z,E as A,G as D,H}from"./floating-ui.react-CZf-mCiA.js";const M={Portal:H,Overlay:D,FocusManager:A,useFloating:z,autoUpdate:x,useListNavigation:k,FloatingList:j,useClick:T,useTypeahead:P,useListItem:L,Arrow:N,useFloatingNodeId:s,safePolygon:C,useFloatingParentNodeId:y,useFloatingTree:w,FloatingNode:v,FloatingTree:h,arrow:I,useRole:p,useFocus:c,useInteractions:m,useDismiss:F,useHover:f,flip:d,shift:g,limitShift:n,hide:l,offset:r,size:u,detectOverflow:i,useMergeRefs:t,Composite:o,CompositeItem:e,useId:a};export{M as F};
@@ -1 +1 @@
1
- 'use client';"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("./index-WGIYLuwZ.cjs"),a=require("./index-DrMwbB8q.cjs"),s=require("./keyboard-BBlFllyi.cjs");const t=r.forwardRef((({children:t,label:d="",defaultPressed:n=!1,pressed:o,onPressedChange:l=()=>{},disabled:c,asChild:u=!1,...f},v)=>{const[b,m]=r.useState(n),p=void 0!==o,j=p?o:b,y=()=>{if(c)return;const e=!j;p||m(e),l(e)},g=d?{"aria-label":d}:{};return g["aria-pressed"]=j?"true":"false",g["aria-disabled"]=c?"true":"false",e.jsx(i.ButtonPrimitive,{ref:v,onClick:a.composeEventHandlers(f.onClick,y),onKeyDown:a.composeEventHandlers(f.onKeyDown,(e=>{s.isActivationKey(e.key)&&(e.preventDefault(),y())})),"data-state":j?"on":"off","data-disabled":c?"":void 0,disabled:c,asChild:u,...g,...f,children:t})}));t.displayName="TogglePrimitive",exports.TogglePrimitive=t;
1
+ 'use client';"use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("./index-BZO29jsF.cjs"),a=require("./index-DrMwbB8q.cjs"),s=require("./keyboard-BBlFllyi.cjs");const t=r.forwardRef((({children:t,label:d="",defaultPressed:n=!1,pressed:o,onPressedChange:l=()=>{},disabled:c,asChild:u=!1,...f},v)=>{const[b,m]=r.useState(n),p=void 0!==o,j=p?o:b,y=()=>{if(c)return;const e=!j;p||m(e),l(e)},g=d?{"aria-label":d}:{};return g["aria-pressed"]=j?"true":"false",g["aria-disabled"]=c?"true":"false",e.jsx(i.ButtonPrimitive,{ref:v,onClick:a.composeEventHandlers(f.onClick,y),onKeyDown:a.composeEventHandlers(f.onKeyDown,(e=>{s.isActivationKey(e.key)&&(e.preventDefault(),y())})),"data-state":j?"on":"off","data-disabled":c?"":void 0,disabled:c,asChild:u,...g,...f,children:t})}));t.displayName="TogglePrimitive",exports.TogglePrimitive=t;
@@ -0,0 +1 @@
1
+ 'use client';"use strict";var e=require("react"),r=require("./mergeProps-DW5qFqqJ.cjs");const t=["div","span","button","input","a","img","p","h2","h3","label","table","thead","tbody","tr","td","th"],i=t=>{const i=e.forwardRef(((i,n)=>{const{asChild:o=!1,children:l,...s}=i;if(o){if(e.isValidElement(l)&&l.type===e.Fragment)return console.warn(`Primitive.${t}: asChild prop does not support React.Fragment. Please provide a single element.`),e.createElement(t,{...s,ref:n},l);const i=e.Children.toArray(l);if(1!==i.length||!e.isValidElement(i[0]))return console.warn(`Primitive.${t}: asChild prop requires exactly one valid child element.`),e.createElement(t,{...s,ref:n},l);const o=i[0],a=r.getElementRef(o),c=r.composeRefs(n,a),m=r.mergeProps(s,o.props);return e.cloneElement(o,{...m,...c?{ref:c}:{}})}return e.createElement(t,{...s,ref:n},l)}));return i.displayName=`Primitive.${t}`,i},n={};for(const e of t)n[e]=i(e);exports.Primitive=n;
@@ -0,0 +1 @@
1
+ 'use client';import e from"react";import{g as r,c as t,m as n}from"./mergeProps-0RucjqeH.js";const i=["div","span","button","input","a","img","p","h2","h3","label","table","thead","tbody","tr","td","th"],a=i=>{const a=e.forwardRef(((a,o)=>{const{asChild:l=!1,children:s,...m}=a;if(l){if(e.isValidElement(s)&&s.type===e.Fragment)return console.warn(`Primitive.${i}: asChild prop does not support React.Fragment. Please provide a single element.`),e.createElement(i,{...m,ref:o},s);const a=e.Children.toArray(s);if(1!==a.length||!e.isValidElement(a[0]))return console.warn(`Primitive.${i}: asChild prop requires exactly one valid child element.`),e.createElement(i,{...m,ref:o},s);const l=a[0],c=r(l),p=t(o,c),d=n(m,l.props);return e.cloneElement(l,{...d,...p?{ref:p}:{}})}return e.createElement(i,{...m,ref:o},s)}));return a.displayName=`Primitive.${i}`,a},o={};for(const e of i)o[e]=a(e);export{o as P};
@@ -1 +1 @@
1
- 'use client';import{jsx as t}from"react/jsx-runtime";import e,{createContext as n,useContext as r,useId as i,useState as o,useEffect as a,useRef as c,useLayoutEffect as s}from"react";import{P as d}from"./index-XF8itt-H.js";import{u as l}from"./index-wRElCyvx.js";import{c as u}from"./mergeProps-0RucjqeH.js";import{B as m}from"./index-FITGoHty.js";import{K as p}from"./keyboard-BKF7hXqL.js";const h=n(void 0),v=()=>{const t=r(h);if(!t)throw new Error("Collapsible compound components must be used within a CollapsiblePrimitive.Root component");return t},f=e.forwardRef((({children:e,defaultOpen:n=!1,open:r,onOpenChange:o,disabled:a=!1,transitionDuration:c,transitionTimingFunction:s="linear",...u},m)=>{const p=i(),[v,f]=l(r,n,o);return t(h.Provider,{value:{open:v,onOpenChange:t=>{a||f(t)},disabled:a,contentId:p,transitionDuration:c,transitionTimingFunction:s},children:t(d.div,{...u,ref:m,"data-state":v?"open":"closed","data-disabled":a?"":void 0,children:e})})}));f.displayName="CollapsiblePrimitiveRoot";function g(){const[t,e]=o(!1);return a((()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=t=>{e(t.matches)};return n(t),"function"==typeof t.addEventListener?(t.addEventListener("change",n),()=>t.removeEventListener("change",n)):(t.addListener(n),()=>t.removeListener(n))}),[]),t}const y=e.forwardRef((({children:n,className:r,asChild:i=!1,forceMount:l=!1,style:m,...p},h)=>{const{open:f,contentId:y,transitionDuration:C,transitionTimingFunction:b}=v(),w=g(),P=void 0!==C?C:w?0:300,[F,x]=o(f?void 0:0),[T,D]=o(f||l),[,A]=o(0),R=c(),E=c(),$=c(null),j=c(0),q=c(0),L=c(),N=c(f||l);a((()=>{const t=requestAnimationFrame((()=>{N.current=!1}));return()=>cancelAnimationFrame(t)}),[]),s((()=>{R.current&&clearTimeout(R.current),E.current&&cancelAnimationFrame(E.current);const t=$.current;if(!t)return;L.current=L.current||{transitionDuration:t.style.transitionDuration,transitionProperty:t.style.transitionProperty,transitionTimingFunction:t.style.transitionTimingFunction},t.style.transitionDuration="0s",t.style.transitionProperty="none";const e=t.getBoundingClientRect(),n=e.height||t.scrollHeight,r=e.width||t.scrollWidth;return j.current=n,q.current=r,N.current||(t.style.transitionDuration=L.current.transitionDuration,t.style.transitionProperty=L.current.transitionProperty,t.style.transitionTimingFunction=L.current.transitionTimingFunction),0===P?(x(f?void 0:0),D(!(!f&&!l)),void(f&&A((t=>t+1)))):N.current&&f?(D(!0),void x(void 0)):(f?(D(!0),x(0),E.current=requestAnimationFrame((()=>{$.current,E.current=requestAnimationFrame((()=>{$.current&&x(j.current??$.current.scrollHeight)}))})),R.current=setTimeout((()=>{x(void 0)}),P)):(x(j.current??t.scrollHeight),E.current=requestAnimationFrame((()=>{$.current,E.current=requestAnimationFrame((()=>{x(0)}))})),R.current=setTimeout((()=>{l||D(!1)}),P)),()=>{R.current&&clearTimeout(R.current),E.current&&cancelAnimationFrame(E.current)})}),[f,P,l]),s((()=>{const t=$.current;if(!t||!f||void 0!==F)return;const e=t.getBoundingClientRect(),n=e.height||t.scrollHeight,r=e.width||t.scrollWidth;n===j.current&&r===q.current||(j.current=n,q.current=r,A((t=>t+1)))}),[n,f,F]);if(!(f||T||l))return null;const k={...m,overflow:"hidden",height:void 0!==F?`${F}px`:void 0,"--radix-collapsible-content-height":void 0!==j.current?`${j.current}px`:void 0,"--radix-collapsible-content-width":void 0!==q.current?`${q.current}px`:void 0,"--rad-collapsible-content-height":void 0!==j.current?`${j.current}px`:void 0,"--rad-collapsible-content-width":void 0!==q.current?`${q.current}px`:void 0,...P>0?{transition:`height ${P}ms ${b}`}:{}},H=i&&e.isValidElement(n);return t(d.div,{id:y,ref:u(h,$),"aria-hidden":!f,"data-state":f?"open":"closed",className:r,style:k,asChild:H,...p,children:n})}));y.displayName="CollapsiblePrimitiveContent";const C=e.forwardRef((({children:e,asChild:n=!1,...r},i)=>{const{open:o,onOpenChange:a,disabled:c,contentId:s}=v();return t(m,{...r,"aria-controls":s,"aria-expanded":o,"data-state":o?"open":"closed","data-disabled":c?"true":void 0,ref:i,onClick:t=>{r.onClick?.(t),c||a(!o)},onKeyDown:t=>{r.onKeyDown?.(t),t.defaultPrevented||t.key===p.ESCAPE&&o&&!c&&a(!1)},asChild:n,children:e})}));C.displayName="CollapsiblePrimitiveTrigger";const b=()=>(console.warn("Direct usage of CollapsiblePrimitive is not supported. Please use CollapsiblePrimitive.Root, CollapsiblePrimitive.Content, etc. instead."),null);b.Root=f,b.Content=y,b.Trigger=C;export{b as C,g as u};
1
+ 'use client';import{jsx as t}from"react/jsx-runtime";import e,{createContext as n,useContext as r,useId as i,useState as o,useEffect as a,useRef as c,useLayoutEffect as s}from"react";import{P as d}from"./index-BidxkqdT.js";import{u as l}from"./index-wRElCyvx.js";import{c as u}from"./mergeProps-0RucjqeH.js";import{B as m}from"./index-DH-14XDv.js";import{K as p}from"./keyboard-BKF7hXqL.js";const h=n(void 0),v=()=>{const t=r(h);if(!t)throw new Error("Collapsible compound components must be used within a CollapsiblePrimitive.Root component");return t},f=e.forwardRef((({children:e,defaultOpen:n=!1,open:r,onOpenChange:o,disabled:a=!1,transitionDuration:c,transitionTimingFunction:s="linear",...u},m)=>{const p=i(),[v,f]=l(r,n,o);return t(h.Provider,{value:{open:v,onOpenChange:t=>{a||f(t)},disabled:a,contentId:p,transitionDuration:c,transitionTimingFunction:s},children:t(d.div,{...u,ref:m,"data-state":v?"open":"closed","data-disabled":a?"":void 0,children:e})})}));f.displayName="CollapsiblePrimitiveRoot";function g(){const[t,e]=o(!1);return a((()=>{if("undefined"==typeof window||"function"!=typeof window.matchMedia)return;const t=window.matchMedia("(prefers-reduced-motion: reduce)"),n=t=>{e(t.matches)};return n(t),"function"==typeof t.addEventListener?(t.addEventListener("change",n),()=>t.removeEventListener("change",n)):(t.addListener(n),()=>t.removeListener(n))}),[]),t}const y=e.forwardRef((({children:n,className:r,asChild:i=!1,forceMount:l=!1,style:m,...p},h)=>{const{open:f,contentId:y,transitionDuration:C,transitionTimingFunction:b}=v(),w=g(),P=void 0!==C?C:w?0:300,[F,x]=o(f?void 0:0),[T,D]=o(f||l),[,A]=o(0),R=c(),E=c(),$=c(null),j=c(0),q=c(0),L=c(),N=c(f||l);a((()=>{const t=requestAnimationFrame((()=>{N.current=!1}));return()=>cancelAnimationFrame(t)}),[]),s((()=>{R.current&&clearTimeout(R.current),E.current&&cancelAnimationFrame(E.current);const t=$.current;if(!t)return;L.current=L.current||{transitionDuration:t.style.transitionDuration,transitionProperty:t.style.transitionProperty,transitionTimingFunction:t.style.transitionTimingFunction},t.style.transitionDuration="0s",t.style.transitionProperty="none";const e=t.getBoundingClientRect(),n=e.height||t.scrollHeight,r=e.width||t.scrollWidth;return j.current=n,q.current=r,N.current||(t.style.transitionDuration=L.current.transitionDuration,t.style.transitionProperty=L.current.transitionProperty,t.style.transitionTimingFunction=L.current.transitionTimingFunction),0===P?(x(f?void 0:0),D(!(!f&&!l)),void(f&&A((t=>t+1)))):N.current&&f?(D(!0),void x(void 0)):(f?(D(!0),x(0),E.current=requestAnimationFrame((()=>{$.current,E.current=requestAnimationFrame((()=>{$.current&&x(j.current??$.current.scrollHeight)}))})),R.current=setTimeout((()=>{x(void 0)}),P)):(x(j.current??t.scrollHeight),E.current=requestAnimationFrame((()=>{$.current,E.current=requestAnimationFrame((()=>{x(0)}))})),R.current=setTimeout((()=>{l||D(!1)}),P)),()=>{R.current&&clearTimeout(R.current),E.current&&cancelAnimationFrame(E.current)})}),[f,P,l]),s((()=>{const t=$.current;if(!t||!f||void 0!==F)return;const e=t.getBoundingClientRect(),n=e.height||t.scrollHeight,r=e.width||t.scrollWidth;n===j.current&&r===q.current||(j.current=n,q.current=r,A((t=>t+1)))}),[n,f,F]);if(!(f||T||l))return null;const k={...m,overflow:"hidden",height:void 0!==F?`${F}px`:void 0,"--radix-collapsible-content-height":void 0!==j.current?`${j.current}px`:void 0,"--radix-collapsible-content-width":void 0!==q.current?`${q.current}px`:void 0,"--rad-collapsible-content-height":void 0!==j.current?`${j.current}px`:void 0,"--rad-collapsible-content-width":void 0!==q.current?`${q.current}px`:void 0,...P>0?{transition:`height ${P}ms ${b}`}:{}},H=i&&e.isValidElement(n);return t(d.div,{id:y,ref:u(h,$),"aria-hidden":!f,"data-state":f?"open":"closed",className:r,style:k,asChild:H,...p,children:n})}));y.displayName="CollapsiblePrimitiveContent";const C=e.forwardRef((({children:e,asChild:n=!1,...r},i)=>{const{open:o,onOpenChange:a,disabled:c,contentId:s}=v();return t(m,{...r,"aria-controls":s,"aria-expanded":o,"data-state":o?"open":"closed","data-disabled":c?"true":void 0,ref:i,onClick:t=>{r.onClick?.(t),c||a(!o)},onKeyDown:t=>{r.onKeyDown?.(t),t.defaultPrevented||t.key===p.ESCAPE&&o&&!c&&a(!1)},asChild:n,children:e})}));C.displayName="CollapsiblePrimitiveTrigger";const b=()=>(console.warn("Direct usage of CollapsiblePrimitive is not supported. Please use CollapsiblePrimitive.Root, CollapsiblePrimitive.Content, etc. instead."),null);b.Root=f,b.Content=y,b.Trigger=C;export{b as C,g as u};
@@ -1 +1 @@
1
- 'use client';import{jsx as e,Fragment as n}from"react/jsx-runtime";import r,{createContext as t,forwardRef as i,useContext as o,useRef as l,useState as s,useEffect as a}from"react";import{F as c}from"./index-D8I-rMwz.js";import{u as d}from"./index-wRElCyvx.js";import{u}from"./index-CBcSLg6O.js";import{B as f}from"./index-FITGoHty.js";import{P as m}from"./index-XF8itt-H.js";import{T as p}from"./ThemeContext-Sm-iNANd.js";const g=t({isOpen:!1,handleOpenChange:()=>{},handleOverlayClick:()=>{},getItemProps:(e={})=>e,getReferenceProps:(e={})=>e,getFloatingProps:(e={})=>e,refs:{setReference:()=>{},setFloating:()=>{},reference:{current:null},floating:{current:null}},floatingStyles:{position:"absolute"}}),h="DialogPrimitive",C=i((({children:n,open:r,defaultOpen:t=!1,onOpenChange:i,onClickOutside:o=()=>{},className:l,disablePointerDismissal:s=!1,dismissOnOutsidePress:a=!0,...f},m)=>{const[p,h]=d(r,t,i),C=c.useFloatingNodeId();u(p);const P=e=>{h(e)},{context:v,refs:y,floatingStyles:O}=c.useFloating({open:p,nodeId:C,onOpenChange:P}),F=c.useDismiss(v,{bubbles:!1,escapeKey:!s,outsidePress:!s&&a}),b=c.useRole(v,{role:"dialog"}),{getReferenceProps:R,getFloatingProps:k,getItemProps:N}=c.useInteractions([F,b]),x={isOpen:p,handleOpenChange:P,floaterContext:v,handleOverlayClick:()=>{!s&&a&&(o(),P(!1))},getReferenceProps:R,getFloatingProps:k,getItemProps:N,refs:y,floatingStyles:O};return e(g.Provider,{value:x,children:e(c.FloatingNode,{id:C,children:e("div",{ref:m,"data-state":p?"open":"closed",...f,className:l,children:n})})})}));C.displayName=`${h}Inner`;const P=i((({disablePointerDismissal:n=!1,...r},t)=>c.useFloatingTree()?e(C,{ref:t,disablePointerDismissal:n,...r}):e(c.FloatingTree,{children:e(C,{ref:t,disablePointerDismissal:n,...r})})));P.displayName=h;const v=i((({children:n,asChild:r,onClick:t,...i},l)=>{const{handleOpenChange:s,getItemProps:a}=o(g);return e(f,{ref:l,asChild:r,...a({...i,onClick:e=>{t?.(e),s(!1)}}),children:n})}));v.displayName="DialogPrimitiveAction";const y=i((({children:n,asChild:r,onClick:t,...i},l)=>{const{handleOpenChange:s,getItemProps:a}=o(g);return e(f,{ref:l,asChild:r,...a({...i,onClick:e=>{t?.(e),s(!1)}}),children:n})}));y.displayName="DialogPrimitiveCancel";const O=i((({children:t,asChild:i=!1,forceMount:l=!1,initialFocus:s=!0,finalFocus:a=!0,trapFocus:d=!0,role:u="dialog","aria-modal":f=!0,"aria-labelledby":p,"aria-describedby":h,style:C,...P},v)=>{const{isOpen:y,getFloatingProps:O,refs:F,floaterContext:b}=o(g),R=r.useRef(null),k=r.useRef(y),N=F.reference?.current,x=c.useMergeRefs([F.setFloating,v]),D=y||l,M=y?"open":"closed";r.useEffect((()=>{if(y)return R.current=document.activeElement instanceof HTMLElement?document.activeElement:null,void(k.current=!0);if(!k.current)return;k.current=!1;const e=(()=>{if(!1===a)return null;if(!0===a)return N instanceof HTMLElement?N:R.current;if("current"in a)return a.current;const e=a();return!0===e?N instanceof HTMLElement?N:R.current:e instanceof HTMLElement?e:null})();e&&requestAnimationFrame((()=>{e.focus()}))}),[a,y,N]);const T=r.useMemo((()=>{if(!1===s)return-1;if(!0===s)return 0;if("current"in s)return s;const e=s();return!1===e||void 0===e?-1:!0===e?0:e}),[s]),I=P.style,j={...P};delete j.style;const E=e(m.div,{ref:x,asChild:i,...O({...j,style:{outline:"none",...C,...I},role:u,"aria-hidden":y?void 0:"true","aria-labelledby":y?p:void 0,"aria-describedby":y?h:void 0,"data-state":M,"aria-modal":f}),children:t});return e(n,{children:D&&(y?e(c.FocusManager,{context:b,modal:d,initialFocus:T,returnFocus:!1!==a,children:E}):E)})}));O.displayName="DialogPrimitiveContent";const F=i((({children:n,asChild:r,className:t="",disabled:i=!1,...l},s)=>{const{isOpen:a,handleOpenChange:d,getReferenceProps:u,refs:m}=o(g),{onClick:p,...h}=l,C=c.useMergeRefs([m.setReference,s]);return e(f,{ref:C,asChild:r,className:t,...u({...h,disabled:i,"aria-expanded":a,"data-state":a?"open":"closed","data-disabled":i?"":void 0,onClick(e){i||(p?.(e),e.defaultPrevented||d(!0))}}),children:n})}));F.displayName="DialogPrimitiveTrigger";const b=i((({asChild:r=!1,forceMount:t=!1,children:i,onClick:l,...s},a)=>{const{isOpen:d,handleOverlayClick:u}=o(g),f=d?"open":"closed";return e(n,{children:(d||t)&&e(c.Overlay,{ref:a,lockScroll:d,onClick:e=>{l?.(e),e.defaultPrevented||u()},"data-state":f,...s,children:i})})}));b.displayName="DialogPrimitiveOverlay";const R=i((({children:n,asChild:r=!1,...t},i)=>e(m.div,{ref:i,asChild:r,...t,children:n})));R.displayName="DialogPrimitiveFooter";const k={Root:P,Action:v,Cancel:y,Footer:R,Content:O,Trigger:F,Overlay:b,Portal:({children:n,container:r,forceMount:t=!1,keepMounted:i=!1,...d})=>{const u=o(p),f=l(null),[m,g]=s(!1);return a((()=>{f.current=r||(u?.portalRootRef.current??u?.containerRef.current??document.body),g(!0)}),[r,u]),m?e(c.Portal,{root:f.current,...d,children:n}):null}};export{k as D,g as a};
1
+ 'use client';import{jsx as e,Fragment as n}from"react/jsx-runtime";import r,{createContext as t,forwardRef as i,useContext as o,useRef as l,useState as s,useEffect as a}from"react";import{F as c}from"./index-B_OPdW20.js";import{u as d}from"./index-wRElCyvx.js";import{u}from"./index-CBcSLg6O.js";import{B as f}from"./index-DH-14XDv.js";import{P as m}from"./index-BidxkqdT.js";import{T as p}from"./ThemeContext-Sm-iNANd.js";const g=t({isOpen:!1,handleOpenChange:()=>{},handleOverlayClick:()=>{},getItemProps:(e={})=>e,getReferenceProps:(e={})=>e,getFloatingProps:(e={})=>e,refs:{setReference:()=>{},setFloating:()=>{},reference:{current:null},floating:{current:null}},floatingStyles:{position:"absolute"}}),h="DialogPrimitive",C=i((({children:n,open:r,defaultOpen:t=!1,onOpenChange:i,onClickOutside:o=()=>{},className:l,disablePointerDismissal:s=!1,dismissOnOutsidePress:a=!0,...f},m)=>{const[p,h]=d(r,t,i),C=c.useFloatingNodeId();u(p);const P=e=>{h(e)},{context:v,refs:y,floatingStyles:O}=c.useFloating({open:p,nodeId:C,onOpenChange:P}),F=c.useDismiss(v,{bubbles:!1,escapeKey:!s,outsidePress:!s&&a}),b=c.useRole(v,{role:"dialog"}),{getReferenceProps:R,getFloatingProps:k,getItemProps:N}=c.useInteractions([F,b]),x={isOpen:p,handleOpenChange:P,floaterContext:v,handleOverlayClick:()=>{!s&&a&&(o(),P(!1))},getReferenceProps:R,getFloatingProps:k,getItemProps:N,refs:y,floatingStyles:O};return e(g.Provider,{value:x,children:e(c.FloatingNode,{id:C,children:e("div",{ref:m,"data-state":p?"open":"closed",...f,className:l,children:n})})})}));C.displayName=`${h}Inner`;const P=i((({disablePointerDismissal:n=!1,...r},t)=>c.useFloatingTree()?e(C,{ref:t,disablePointerDismissal:n,...r}):e(c.FloatingTree,{children:e(C,{ref:t,disablePointerDismissal:n,...r})})));P.displayName=h;const v=i((({children:n,asChild:r,onClick:t,...i},l)=>{const{handleOpenChange:s,getItemProps:a}=o(g);return e(f,{ref:l,asChild:r,...a({...i,onClick:e=>{t?.(e),s(!1)}}),children:n})}));v.displayName="DialogPrimitiveAction";const y=i((({children:n,asChild:r,onClick:t,...i},l)=>{const{handleOpenChange:s,getItemProps:a}=o(g);return e(f,{ref:l,asChild:r,...a({...i,onClick:e=>{t?.(e),s(!1)}}),children:n})}));y.displayName="DialogPrimitiveCancel";const O=i((({children:t,asChild:i=!1,forceMount:l=!1,initialFocus:s=!0,finalFocus:a=!0,trapFocus:d=!0,role:u="dialog","aria-modal":f=!0,"aria-labelledby":p,"aria-describedby":h,style:C,...P},v)=>{const{isOpen:y,getFloatingProps:O,refs:F,floaterContext:b}=o(g),R=r.useRef(null),k=r.useRef(y),N=F.reference?.current,x=c.useMergeRefs([F.setFloating,v]),D=y||l,M=y?"open":"closed";r.useEffect((()=>{if(y)return R.current=document.activeElement instanceof HTMLElement?document.activeElement:null,void(k.current=!0);if(!k.current)return;k.current=!1;const e=(()=>{if(!1===a)return null;if(!0===a)return N instanceof HTMLElement?N:R.current;if("current"in a)return a.current;const e=a();return!0===e?N instanceof HTMLElement?N:R.current:e instanceof HTMLElement?e:null})();e&&requestAnimationFrame((()=>{e.focus()}))}),[a,y,N]);const T=r.useMemo((()=>{if(!1===s)return-1;if(!0===s)return 0;if("current"in s)return s;const e=s();return!1===e||void 0===e?-1:!0===e?0:e}),[s]),I=P.style,j={...P};delete j.style;const E=e(m.div,{ref:x,asChild:i,...O({...j,style:{outline:"none",...C,...I},role:u,"aria-hidden":y?void 0:"true","aria-labelledby":y?p:void 0,"aria-describedby":y?h:void 0,"data-state":M,"aria-modal":f}),children:t});return e(n,{children:D&&(y?e(c.FocusManager,{context:b,modal:d,initialFocus:T,returnFocus:!1!==a,children:E}):E)})}));O.displayName="DialogPrimitiveContent";const F=i((({children:n,asChild:r,className:t="",disabled:i=!1,...l},s)=>{const{isOpen:a,handleOpenChange:d,getReferenceProps:u,refs:m}=o(g),{onClick:p,...h}=l,C=c.useMergeRefs([m.setReference,s]);return e(f,{ref:C,asChild:r,className:t,...u({...h,disabled:i,"aria-expanded":a,"data-state":a?"open":"closed","data-disabled":i?"":void 0,onClick(e){i||(p?.(e),e.defaultPrevented||d(!0))}}),children:n})}));F.displayName="DialogPrimitiveTrigger";const b=i((({asChild:r=!1,forceMount:t=!1,children:i,onClick:l,...s},a)=>{const{isOpen:d,handleOverlayClick:u}=o(g),f=d?"open":"closed";return e(n,{children:(d||t)&&e(c.Overlay,{ref:a,lockScroll:d,onClick:e=>{l?.(e),e.defaultPrevented||u()},"data-state":f,...s,children:i})})}));b.displayName="DialogPrimitiveOverlay";const R=i((({children:n,asChild:r=!1,...t},i)=>e(m.div,{ref:i,asChild:r,...t,children:n})));R.displayName="DialogPrimitiveFooter";const k={Root:P,Action:v,Cancel:y,Footer:R,Content:O,Trigger:F,Overlay:b,Portal:({children:n,container:r,forceMount:t=!1,keepMounted:i=!1,...d})=>{const u=o(p),f=l(null),[m,g]=s(!1);return a((()=>{f.current=r||(u?.portalRootRef.current??u?.containerRef.current??document.body),g(!0)}),[r,u]),m?e(c.Portal,{root:f.current,...d,children:n}):null}};export{k as D,g as a};
@@ -1 +1 @@
1
- 'use client';"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./index-BudP4FIn.cjs"),n=require("./index-BwNOI8cB.cjs"),i=require("./index-CbdoW3TC.cjs"),o=require("./index-WGIYLuwZ.cjs"),s=require("./index-CbKtybdA.cjs"),l=require("./ThemeContext-t7IX-w6i.cjs");const a=r.createContext({isOpen:!1,handleOpenChange:()=>{},handleOverlayClick:()=>{},getItemProps:(e={})=>e,getReferenceProps:(e={})=>e,getFloatingProps:(e={})=>e,refs:{setReference:()=>{},setFloating:()=>{},reference:{current:null},floating:{current:null}},floatingStyles:{position:"absolute"}}),c="DialogPrimitive",d=r.forwardRef((({children:r,open:o,defaultOpen:s=!1,onOpenChange:l,onClickOutside:c=()=>{},className:d,disablePointerDismissal:u=!1,dismissOnOutsidePress:f=!0,...m},g)=>{const[h,p]=n.useControllableState(o,s,l),C=t.Floater.useFloatingNodeId();i.useRegisterDocumentOverlayOpen(h);const x=e=>{p(e)},{context:P,refs:v,floatingStyles:F}=t.Floater.useFloating({open:h,nodeId:C,onOpenChange:x}),y=t.Floater.useDismiss(P,{bubbles:!1,escapeKey:!u,outsidePress:!u&&f}),R=t.Floater.useRole(P,{role:"dialog"}),{getReferenceProps:O,getFloatingProps:j,getItemProps:b}=t.Floater.useInteractions([y,R]),D={isOpen:h,handleOpenChange:x,floaterContext:P,handleOverlayClick:()=>{!u&&f&&(c(),x(!1))},getReferenceProps:O,getFloatingProps:j,getItemProps:b,refs:v,floatingStyles:F};return e.jsx(a.Provider,{value:D,children:e.jsx(t.Floater.FloatingNode,{id:C,children:e.jsx("div",{ref:g,"data-state":h?"open":"closed",...m,className:d,children:r})})})}));d.displayName=`${c}Inner`;const u=r.forwardRef((({disablePointerDismissal:r=!1,...n},i)=>t.Floater.useFloatingTree()?e.jsx(d,{ref:i,disablePointerDismissal:r,...n}):e.jsx(t.Floater.FloatingTree,{children:e.jsx(d,{ref:i,disablePointerDismissal:r,...n})})));u.displayName=c;const f=r.forwardRef((({children:t,asChild:n,onClick:i,...s},l)=>{const{handleOpenChange:c,getItemProps:d}=r.useContext(a);return e.jsx(o.ButtonPrimitive,{ref:l,asChild:n,...d({...s,onClick:e=>{i?.(e),c(!1)}}),children:t})}));f.displayName="DialogPrimitiveAction";const m=r.forwardRef((({children:t,asChild:n,onClick:i,...s},l)=>{const{handleOpenChange:c,getItemProps:d}=r.useContext(a);return e.jsx(o.ButtonPrimitive,{ref:l,asChild:n,...d({...s,onClick:e=>{i?.(e),c(!1)}}),children:t})}));m.displayName="DialogPrimitiveCancel";const g=r.forwardRef((({children:n,asChild:i=!1,forceMount:o=!1,initialFocus:l=!0,finalFocus:c=!0,trapFocus:d=!0,role:u="dialog","aria-modal":f=!0,"aria-labelledby":m,"aria-describedby":g,style:h,...p},C)=>{const{isOpen:x,getFloatingProps:P,refs:v,floaterContext:F}=r.useContext(a),y=r.useRef(null),R=r.useRef(x),O=v.reference?.current,j=t.Floater.useMergeRefs([v.setFloating,C]),b=x||o,D=x?"open":"closed";r.useEffect((()=>{if(x)return y.current=document.activeElement instanceof HTMLElement?document.activeElement:null,void(R.current=!0);if(!R.current)return;R.current=!1;const e=(()=>{if(!1===c)return null;if(!0===c)return O instanceof HTMLElement?O:y.current;if("current"in c)return c.current;const e=c();return!0===e?O instanceof HTMLElement?O:y.current:e instanceof HTMLElement?e:null})();e&&requestAnimationFrame((()=>{e.focus()}))}),[c,x,O]);const k=r.useMemo((()=>{if(!1===l)return-1;if(!0===l)return 0;if("current"in l)return l;const e=l();return!1===e||void 0===e?-1:!0===e?0:e}),[l]),N=p.style,M={...p};delete M.style;const T=e.jsx(s.Primitive.div,{ref:j,asChild:i,...P({...M,style:{outline:"none",...h,...N},role:u,"aria-hidden":x?void 0:"true","aria-labelledby":x?m:void 0,"aria-describedby":x?g:void 0,"data-state":D,"aria-modal":f}),children:n});return e.jsx(e.Fragment,{children:b&&(x?e.jsx(t.Floater.FocusManager,{context:F,modal:d,initialFocus:k,returnFocus:!1!==c,children:T}):T)})}));g.displayName="DialogPrimitiveContent";const h=r.forwardRef((({children:n,asChild:i,className:s="",disabled:l=!1,...c},d)=>{const{isOpen:u,handleOpenChange:f,getReferenceProps:m,refs:g}=r.useContext(a),{onClick:h,...p}=c,C=t.Floater.useMergeRefs([g.setReference,d]),x=u?"open":"closed",P=l?"":void 0;return e.jsx(o.ButtonPrimitive,{ref:C,asChild:i,className:s,...m({...p,disabled:l,"aria-expanded":u,"data-state":x,"data-disabled":P,onClick(e){l||(h?.(e),e.defaultPrevented||f(!0))}}),children:n})}));h.displayName="DialogPrimitiveTrigger";const p=r.forwardRef((({asChild:n=!1,forceMount:i=!1,children:o,onClick:s,...l},c)=>{const{isOpen:d,handleOverlayClick:u}=r.useContext(a),f=d||i,m=d?"open":"closed";return e.jsx(e.Fragment,{children:f&&e.jsx(t.Floater.Overlay,{ref:c,lockScroll:d,onClick:e=>{s?.(e),e.defaultPrevented||u()},"data-state":m,...l,children:o})})}));p.displayName="DialogPrimitiveOverlay";const C=r.forwardRef((({children:r,asChild:t=!1,...n},i)=>e.jsx(s.Primitive.div,{ref:i,asChild:t,...n,children:r})));C.displayName="DialogPrimitiveFooter";const x={Root:u,Action:f,Cancel:m,Footer:C,Content:g,Trigger:h,Overlay:p,Portal:({children:n,container:i,forceMount:o=!1,keepMounted:s=!1,...a})=>{const c=r.useContext(l.ThemeContext),d=r.useRef(null),[u,f]=r.useState(!1);return r.useEffect((()=>{d.current=i||(c?.portalRootRef.current??c?.containerRef.current??document.body),f(!0)}),[i,c]),u?e.jsx(t.Floater.Portal,{root:d.current,...a,children:n}):null}};exports.DialogPrimitive=x,exports.DialogPrimitiveContext=a;
1
+ 'use client';"use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./index-BudP4FIn.cjs"),n=require("./index-BwNOI8cB.cjs"),i=require("./index-CbdoW3TC.cjs"),o=require("./index-BZO29jsF.cjs"),s=require("./index-Bg-UeWCo.cjs"),l=require("./ThemeContext-t7IX-w6i.cjs");const a=r.createContext({isOpen:!1,handleOpenChange:()=>{},handleOverlayClick:()=>{},getItemProps:(e={})=>e,getReferenceProps:(e={})=>e,getFloatingProps:(e={})=>e,refs:{setReference:()=>{},setFloating:()=>{},reference:{current:null},floating:{current:null}},floatingStyles:{position:"absolute"}}),c="DialogPrimitive",d=r.forwardRef((({children:r,open:o,defaultOpen:s=!1,onOpenChange:l,onClickOutside:c=()=>{},className:d,disablePointerDismissal:u=!1,dismissOnOutsidePress:f=!0,...m},g)=>{const[h,p]=n.useControllableState(o,s,l),C=t.Floater.useFloatingNodeId();i.useRegisterDocumentOverlayOpen(h);const x=e=>{p(e)},{context:P,refs:v,floatingStyles:F}=t.Floater.useFloating({open:h,nodeId:C,onOpenChange:x}),y=t.Floater.useDismiss(P,{bubbles:!1,escapeKey:!u,outsidePress:!u&&f}),R=t.Floater.useRole(P,{role:"dialog"}),{getReferenceProps:O,getFloatingProps:j,getItemProps:b}=t.Floater.useInteractions([y,R]),D={isOpen:h,handleOpenChange:x,floaterContext:P,handleOverlayClick:()=>{!u&&f&&(c(),x(!1))},getReferenceProps:O,getFloatingProps:j,getItemProps:b,refs:v,floatingStyles:F};return e.jsx(a.Provider,{value:D,children:e.jsx(t.Floater.FloatingNode,{id:C,children:e.jsx("div",{ref:g,"data-state":h?"open":"closed",...m,className:d,children:r})})})}));d.displayName=`${c}Inner`;const u=r.forwardRef((({disablePointerDismissal:r=!1,...n},i)=>t.Floater.useFloatingTree()?e.jsx(d,{ref:i,disablePointerDismissal:r,...n}):e.jsx(t.Floater.FloatingTree,{children:e.jsx(d,{ref:i,disablePointerDismissal:r,...n})})));u.displayName=c;const f=r.forwardRef((({children:t,asChild:n,onClick:i,...s},l)=>{const{handleOpenChange:c,getItemProps:d}=r.useContext(a);return e.jsx(o.ButtonPrimitive,{ref:l,asChild:n,...d({...s,onClick:e=>{i?.(e),c(!1)}}),children:t})}));f.displayName="DialogPrimitiveAction";const m=r.forwardRef((({children:t,asChild:n,onClick:i,...s},l)=>{const{handleOpenChange:c,getItemProps:d}=r.useContext(a);return e.jsx(o.ButtonPrimitive,{ref:l,asChild:n,...d({...s,onClick:e=>{i?.(e),c(!1)}}),children:t})}));m.displayName="DialogPrimitiveCancel";const g=r.forwardRef((({children:n,asChild:i=!1,forceMount:o=!1,initialFocus:l=!0,finalFocus:c=!0,trapFocus:d=!0,role:u="dialog","aria-modal":f=!0,"aria-labelledby":m,"aria-describedby":g,style:h,...p},C)=>{const{isOpen:x,getFloatingProps:P,refs:v,floaterContext:F}=r.useContext(a),y=r.useRef(null),R=r.useRef(x),O=v.reference?.current,j=t.Floater.useMergeRefs([v.setFloating,C]),b=x||o,D=x?"open":"closed";r.useEffect((()=>{if(x)return y.current=document.activeElement instanceof HTMLElement?document.activeElement:null,void(R.current=!0);if(!R.current)return;R.current=!1;const e=(()=>{if(!1===c)return null;if(!0===c)return O instanceof HTMLElement?O:y.current;if("current"in c)return c.current;const e=c();return!0===e?O instanceof HTMLElement?O:y.current:e instanceof HTMLElement?e:null})();e&&requestAnimationFrame((()=>{e.focus()}))}),[c,x,O]);const k=r.useMemo((()=>{if(!1===l)return-1;if(!0===l)return 0;if("current"in l)return l;const e=l();return!1===e||void 0===e?-1:!0===e?0:e}),[l]),N=p.style,M={...p};delete M.style;const T=e.jsx(s.Primitive.div,{ref:j,asChild:i,...P({...M,style:{outline:"none",...h,...N},role:u,"aria-hidden":x?void 0:"true","aria-labelledby":x?m:void 0,"aria-describedby":x?g:void 0,"data-state":D,"aria-modal":f}),children:n});return e.jsx(e.Fragment,{children:b&&(x?e.jsx(t.Floater.FocusManager,{context:F,modal:d,initialFocus:k,returnFocus:!1!==c,children:T}):T)})}));g.displayName="DialogPrimitiveContent";const h=r.forwardRef((({children:n,asChild:i,className:s="",disabled:l=!1,...c},d)=>{const{isOpen:u,handleOpenChange:f,getReferenceProps:m,refs:g}=r.useContext(a),{onClick:h,...p}=c,C=t.Floater.useMergeRefs([g.setReference,d]),x=u?"open":"closed",P=l?"":void 0;return e.jsx(o.ButtonPrimitive,{ref:C,asChild:i,className:s,...m({...p,disabled:l,"aria-expanded":u,"data-state":x,"data-disabled":P,onClick(e){l||(h?.(e),e.defaultPrevented||f(!0))}}),children:n})}));h.displayName="DialogPrimitiveTrigger";const p=r.forwardRef((({asChild:n=!1,forceMount:i=!1,children:o,onClick:s,...l},c)=>{const{isOpen:d,handleOverlayClick:u}=r.useContext(a),f=d||i,m=d?"open":"closed";return e.jsx(e.Fragment,{children:f&&e.jsx(t.Floater.Overlay,{ref:c,lockScroll:d,onClick:e=>{s?.(e),e.defaultPrevented||u()},"data-state":m,...l,children:o})})}));p.displayName="DialogPrimitiveOverlay";const C=r.forwardRef((({children:r,asChild:t=!1,...n},i)=>e.jsx(s.Primitive.div,{ref:i,asChild:t,...n,children:r})));C.displayName="DialogPrimitiveFooter";const x={Root:u,Action:f,Cancel:m,Footer:C,Content:g,Trigger:h,Overlay:p,Portal:({children:n,container:i,forceMount:o=!1,keepMounted:s=!1,...a})=>{const c=r.useContext(l.ThemeContext),d=r.useRef(null),[u,f]=r.useState(!1);return r.useEffect((()=>{d.current=i||(c?.portalRootRef.current??c?.containerRef.current??document.body),f(!0)}),[i,c]),u?e.jsx(t.Floater.Portal,{root:d.current,...a,children:n}):null}};exports.DialogPrimitive=x,exports.DialogPrimitiveContext=a;
@@ -1 +1 @@
1
- 'use client';import{jsx as e}from"react/jsx-runtime";import{forwardRef as a,useState as r}from"react";import{B as i}from"./index-FITGoHty.js";import{c as s}from"./index-CXzybYmm.js";import{i as o}from"./keyboard-BKF7hXqL.js";const d=a((({children:a,label:d="",defaultPressed:t=!1,pressed:l,onPressedChange:n=()=>{},disabled:f,asChild:m=!1,...c},p)=>{const[b,u]=r(t),h=void 0!==l,j=h?l:b,y=()=>{if(f)return;const e=!j;h||u(e),n(e)},C=d?{"aria-label":d}:{};return C["aria-pressed"]=j?"true":"false",C["aria-disabled"]=f?"true":"false",e(i,{ref:p,onClick:s(c.onClick,y),onKeyDown:s(c.onKeyDown,(e=>{o(e.key)&&(e.preventDefault(),y())})),"data-state":j?"on":"off","data-disabled":f?"":void 0,disabled:f,asChild:m,...C,...c,children:a})}));d.displayName="TogglePrimitive";export{d as T};
1
+ 'use client';import{jsx as e}from"react/jsx-runtime";import{forwardRef as a,useState as r}from"react";import{B as i}from"./index-DH-14XDv.js";import{c as s}from"./index-CXzybYmm.js";import{i as o}from"./keyboard-BKF7hXqL.js";const d=a((({children:a,label:d="",defaultPressed:t=!1,pressed:l,onPressedChange:n=()=>{},disabled:f,asChild:m=!1,...c},p)=>{const[b,u]=r(t),h=void 0!==l,j=h?l:b,y=()=>{if(f)return;const e=!j;h||u(e),n(e)},C=d?{"aria-label":d}:{};return C["aria-pressed"]=j?"true":"false",C["aria-disabled"]=f?"true":"false",e(i,{ref:p,onClick:s(c.onClick,y),onKeyDown:s(c.onKeyDown,(e=>{o(e.key)&&(e.preventDefault(),y())})),"data-state":j?"on":"off","data-disabled":f?"":void 0,disabled:f,asChild:m,...C,...c,children:a})}));d.displayName="TogglePrimitive";export{d as T};
@@ -1 +1 @@
1
- 'use client';import{jsx as e}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useId as n,useEffect as o,forwardRef as i,useContext as s}from"react";import{P as d}from"./index-XF8itt-H.js";import{B as u}from"./index-FITGoHty.js";import{K as c}from"./keyboard-BKF7hXqL.js";import{m as b}from"./mergeRefs-B8eZ_q-T.js";const f=r({orientation:"horizontal",loop:!0,dir:"ltr",disableTabIndexing:!1,mode:"default"}),m=new Set(["listbox","menu","menubar","radiogroup","scrollbar","select","separator","slider","tablist","toolbar","tree","treegrid"]),h=t.forwardRef((({children:r,orientation:l="horizontal",loop:a=!0,"aria-label":n,"aria-labelledby":o,disableTabIndexing:i=!1,mode:s="default",dir:u="ltr",asChild:c=!1,...b},h)=>{const p=c&&t.isValidElement(r)?r.props.role:void 0,I=b.role??p,g="both"!==l&&I&&m.has(I)?l:void 0,R={orientation:l,loop:a,disableTabIndexing:i,dir:u,mode:s};return e(f.Provider,{value:R,children:e(d.div,{"aria-orientation":g,"aria-label":n,"aria-labelledby":o,ref:h,asChild:c,...b,children:r})})}));h.displayName="RovingFocusRoot";const p=r({focusedItemId:null,setFocusedItemId:()=>{},focusItems:[],setFocusItems:()=>{},addFocusItem:()=>{},groupRef:null,itemRefs:new Map,registerItemRef:()=>{},unregisterItemRef:()=>{}}),I=i((({children:r,"aria-label":a,"aria-labelledby":i,role:m,type:h,handleRightKeyDown:I,handleLeftKeyDown:g,domId:R,...y},v)=>{const O=n(),C=R??O,D=l(null),{focusedItemId:F,setFocusedItemId:x,addFocusItem:N,focusItems:k,itemRefs:w,registerItemRef:A,unregisterItemRef:T}=s(p),{orientation:E,loop:P,disableTabIndexing:_,dir:W}=s(f),j=t.Children.toArray(r)[0],L=!0===j?.props?.disabled,M="a"===("string"==typeof j?.type?j.type.toLowerCase():"")||null!=j?.props?.href,z=m??(M?void 0:"button"),G=h??(M?void 0:"button"),K=_||!L&&F===C?0:-1;o((()=>(A(C,D),N(C),()=>{T(C)})),[C]);const S=e=>{x(e);const t=w.get(e);t?.current&&t.current.focus()},U=(e,t)=>{let r=e;for(let e=0;e<k.length;e++){if(r+=t,P)r<0&&(r=k.length-1),r>=k.length&&(r=0);else if(r<0||r>=k.length)return-1;const e=k[r],l=w.get(e);if(!l?.current)continue;if(!("true"===l.current.getAttribute("data-child-disabled")))return r}return-1},B=()=>{const e=k.indexOf(C),t=U(e,-1);-1!==t&&S(k[t])},H=()=>{const e=k.indexOf(C),t=U(e,1);-1!==t&&S(k[t])},V=M?d.button:u;return e(V,{asChild:!0,onFocus:e=>{L&&e.target.blur(),L||x(C)},tabIndex:K,ref:b(D,v),id:C,onKeyDown:e=>{if(!L)switch(e.key){case c.ARROW_UP:e.preventDefault(),"vertical"!==E&&"both"!==E||B();break;case c.ARROW_LEFT:e.preventDefault(),g&&g(),"horizontal"!==E&&"both"!==E||("rtl"===W?H():B());break;case c.ARROW_DOWN:e.preventDefault(),"vertical"!==E&&"both"!==E||H();break;case c.ARROW_RIGHT:e.preventDefault(),I&&I(),"horizontal"!==E&&"both"!==E||("rtl"===W?B():H());break;case c.HOME:e.preventDefault(),(()=>{if(k.length>0){const e=U(-1,1);-1!==e&&S(k[e])}})();break;case c.END:e.preventDefault(),(()=>{if(k.length>0){const e=U(k.length,-1);-1!==e&&S(k[e])}})();case c.TAB:}},"data-child-disabled":L,role:z,type:G,"aria-disabled":L,"aria-label":a,"aria-labelledby":i,...y,children:r})}));I.displayName="RovingFocusItem";const g={Root:h,Group:({children:r,"aria-label":i,"aria-labelledby":s,asChild:u,...c})=>{const b=l(null),[f,m]=a([]),[h,I]=a(null),g=n(),R=l(new Map),y=t.useCallback((e=>e.find((e=>{const t=R.current.get(e);return"true"!==t?.current?.getAttribute("data-child-disabled")}))??null),[]),v=t.useCallback(((e,t)=>{R.current.set(e,t)}),[]),O=t.useCallback((e=>{R.current.delete(e),m((t=>t.filter((t=>t!==e))))}),[]),C=t.useCallback((e=>{"undefined"==typeof window?m((t=>t.includes(e)?t:[...t,e])):m((t=>{if(t.includes(e))return t;const r=Array.from(R.current.entries()).filter((([,e])=>e.current));r.sort((([,e],[,t])=>{const r=e.current,l=t.current;if(!r||!l)return 0;const a=r.compareDocumentPosition(l);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0}));const l=r.map((([e])=>e));return l.length===t.length&&l.every(((e,r)=>e===t[r]))?t:l}))}),[]);o((()=>{if(0===f.length)return void(null!==h&&I(null));const e=h?R.current.get(h):null;if(!(null!=h&&"true"!==e?.current?.getAttribute("data-child-disabled"))){const e=y(f);e!==h&&I(e)}}),[y,f,h,I]);const D={focusedItemId:h,setFocusedItemId:I,focusItems:f,setFocusItems:m,addFocusItem:C,groupRef:b,itemRefs:R.current,registerItemRef:v,unregisterItemRef:O},F=t.Children.toArray(r),x=1===F.length&&t.isValidElement(F[0])&&F[0].type!==t.Fragment,N=u??x;return e(p.Provider,{value:D,children:e(d.div,{id:g,ref:b,role:"group","aria-label":i,"aria-labelledby":s,asChild:N,...c,children:r})})},Item:I};export{g as R,p as a};
1
+ 'use client';import{jsx as e}from"react/jsx-runtime";import t,{createContext as r,useRef as l,useState as a,useId as n,useEffect as o,forwardRef as i,useContext as s}from"react";import{P as d}from"./index-BidxkqdT.js";import{B as u}from"./index-DH-14XDv.js";import{K as c}from"./keyboard-BKF7hXqL.js";import{m as b}from"./mergeRefs-B8eZ_q-T.js";const f=r({orientation:"horizontal",loop:!0,dir:"ltr",disableTabIndexing:!1,mode:"default"}),m=new Set(["listbox","menu","menubar","radiogroup","scrollbar","select","separator","slider","tablist","toolbar","tree","treegrid"]),h=t.forwardRef((({children:r,orientation:l="horizontal",loop:a=!0,"aria-label":n,"aria-labelledby":o,disableTabIndexing:i=!1,mode:s="default",dir:u="ltr",asChild:c=!1,...b},h)=>{const p=c&&t.isValidElement(r)?r.props.role:void 0,I=b.role??p,g="both"!==l&&I&&m.has(I)?l:void 0,R={orientation:l,loop:a,disableTabIndexing:i,dir:u,mode:s};return e(f.Provider,{value:R,children:e(d.div,{"aria-orientation":g,"aria-label":n,"aria-labelledby":o,ref:h,asChild:c,...b,children:r})})}));h.displayName="RovingFocusRoot";const p=r({focusedItemId:null,setFocusedItemId:()=>{},focusItems:[],setFocusItems:()=>{},addFocusItem:()=>{},groupRef:null,itemRefs:new Map,registerItemRef:()=>{},unregisterItemRef:()=>{}}),I=i((({children:r,"aria-label":a,"aria-labelledby":i,role:m,type:h,handleRightKeyDown:I,handleLeftKeyDown:g,domId:R,...y},v)=>{const O=n(),C=R??O,D=l(null),{focusedItemId:F,setFocusedItemId:x,addFocusItem:N,focusItems:k,itemRefs:w,registerItemRef:A,unregisterItemRef:T}=s(p),{orientation:E,loop:P,disableTabIndexing:_,dir:W}=s(f),j=t.Children.toArray(r)[0],L=!0===j?.props?.disabled,M="a"===("string"==typeof j?.type?j.type.toLowerCase():"")||null!=j?.props?.href,z=m??(M?void 0:"button"),G=h??(M?void 0:"button"),K=_||!L&&F===C?0:-1;o((()=>(A(C,D),N(C),()=>{T(C)})),[C]);const S=e=>{x(e);const t=w.get(e);t?.current&&t.current.focus()},U=(e,t)=>{let r=e;for(let e=0;e<k.length;e++){if(r+=t,P)r<0&&(r=k.length-1),r>=k.length&&(r=0);else if(r<0||r>=k.length)return-1;const e=k[r],l=w.get(e);if(!l?.current)continue;if(!("true"===l.current.getAttribute("data-child-disabled")))return r}return-1},B=()=>{const e=k.indexOf(C),t=U(e,-1);-1!==t&&S(k[t])},H=()=>{const e=k.indexOf(C),t=U(e,1);-1!==t&&S(k[t])},V=M?d.button:u;return e(V,{asChild:!0,onFocus:e=>{L&&e.target.blur(),L||x(C)},tabIndex:K,ref:b(D,v),id:C,onKeyDown:e=>{if(!L)switch(e.key){case c.ARROW_UP:e.preventDefault(),"vertical"!==E&&"both"!==E||B();break;case c.ARROW_LEFT:e.preventDefault(),g&&g(),"horizontal"!==E&&"both"!==E||("rtl"===W?H():B());break;case c.ARROW_DOWN:e.preventDefault(),"vertical"!==E&&"both"!==E||H();break;case c.ARROW_RIGHT:e.preventDefault(),I&&I(),"horizontal"!==E&&"both"!==E||("rtl"===W?B():H());break;case c.HOME:e.preventDefault(),(()=>{if(k.length>0){const e=U(-1,1);-1!==e&&S(k[e])}})();break;case c.END:e.preventDefault(),(()=>{if(k.length>0){const e=U(k.length,-1);-1!==e&&S(k[e])}})();case c.TAB:}},"data-child-disabled":L,role:z,type:G,"aria-disabled":L,"aria-label":a,"aria-labelledby":i,...y,children:r})}));I.displayName="RovingFocusItem";const g={Root:h,Group:({children:r,"aria-label":i,"aria-labelledby":s,asChild:u,...c})=>{const b=l(null),[f,m]=a([]),[h,I]=a(null),g=n(),R=l(new Map),y=t.useCallback((e=>e.find((e=>{const t=R.current.get(e);return"true"!==t?.current?.getAttribute("data-child-disabled")}))??null),[]),v=t.useCallback(((e,t)=>{R.current.set(e,t)}),[]),O=t.useCallback((e=>{R.current.delete(e),m((t=>t.filter((t=>t!==e))))}),[]),C=t.useCallback((e=>{"undefined"==typeof window?m((t=>t.includes(e)?t:[...t,e])):m((t=>{if(t.includes(e))return t;const r=Array.from(R.current.entries()).filter((([,e])=>e.current));r.sort((([,e],[,t])=>{const r=e.current,l=t.current;if(!r||!l)return 0;const a=r.compareDocumentPosition(l);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0}));const l=r.map((([e])=>e));return l.length===t.length&&l.every(((e,r)=>e===t[r]))?t:l}))}),[]);o((()=>{if(0===f.length)return void(null!==h&&I(null));const e=h?R.current.get(h):null;if(!(null!=h&&"true"!==e?.current?.getAttribute("data-child-disabled"))){const e=y(f);e!==h&&I(e)}}),[y,f,h,I]);const D={focusedItemId:h,setFocusedItemId:I,focusItems:f,setFocusItems:m,addFocusItem:C,groupRef:b,itemRefs:R.current,registerItemRef:v,unregisterItemRef:O},F=t.Children.toArray(r),x=1===F.length&&t.isValidElement(F[0])&&F[0].type!==t.Fragment,N=u??x;return e(p.Provider,{value:D,children:e(d.div,{id:g,ref:b,role:"group","aria-label":i,"aria-labelledby":s,asChild:N,...c,children:r})})},Item:I};export{g as R,p as a};
@@ -1 +1 @@
1
- 'use client';import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{P as t}from"./index-XF8itt-H.js";const i=r((({role:r="button",type:i="button",label:a="",description:o="",disabled:d=!1,children:l,...n},s)=>(a&&(n["aria-label"]=a),o&&(n["aria-description"]=o),d&&(n["aria-disabled"]="true"),e(t.button,{ref:s,role:r,type:i,disabled:d,...n,children:l}))));i.displayName="ButtonPrimitive";export{i as B};
1
+ 'use client';import{jsx as e}from"react/jsx-runtime";import{forwardRef as r}from"react";import{P as t}from"./index-BidxkqdT.js";const i=r((({role:r="button",type:i="button",label:a="",description:o="",disabled:d=!1,children:l,...n},s)=>(a&&(n["aria-label"]=a),o&&(n["aria-description"]=o),d&&(n["aria-disabled"]="true"),e(t.button,{ref:s,role:r,type:i,disabled:d,...n,children:l}))));i.displayName="ButtonPrimitive";export{i as B};