@koide-labs/ui 0.0.14 → 0.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 (310) hide show
  1. package/dist/-utils.d.ts +2 -2
  2. package/dist/-utils.js +1 -1
  3. package/dist/{Button-DrPFFzo7.js → Button-BmcVHRRW.js} +2 -2
  4. package/dist/{CompositeRoot-CVk5a-pR.js → CompositeRoot-CCgh2M64.js} +6 -6
  5. package/dist/{FloatingPortal-tWyuKRSN.js → FloatingPortal-BQsQhvIr.js} +27 -27
  6. package/dist/{FloatingPortalLite-DVyq6YhV.js → FloatingPortalLite-_ECdFE7b.js} +1 -1
  7. package/dist/{InternalBackdrop-jYAiOJ8v.js → InternalBackdrop-BSMKU-hc.js} +13 -13
  8. package/dist/{LabelableContext-BMvjVwor.js → LabelableContext-Be1u-eFg.js} +2 -2
  9. package/dist/accordion.css +1 -0
  10. package/dist/alert-dialog.css +1 -0
  11. package/dist/anchor.css +1 -0
  12. package/dist/avatar.css +1 -0
  13. package/dist/badge.css +1 -0
  14. package/dist/button.css +1 -0
  15. package/dist/checkbox.css +1 -0
  16. package/dist/code.css +1 -0
  17. package/dist/collapse.css +1 -0
  18. package/dist/command.css +1 -0
  19. package/dist/components/accordion/accordion.d.ts +19 -0
  20. package/dist/components/accordion/accordion.js +701 -0
  21. package/dist/components/accordion/index.d.ts +1 -12
  22. package/dist/components/accordion/index.js +2 -697
  23. package/dist/components/alert-dialog/alert-dialog.d.ts +36 -0
  24. package/dist/components/alert-dialog/alert-dialog.js +138 -0
  25. package/dist/components/alert-dialog/index.d.ts +1 -26
  26. package/dist/components/alert-dialog/index.js +2 -134
  27. package/dist/components/anchor/anchor.d.ts +12 -0
  28. package/dist/components/anchor/anchor.js +21 -0
  29. package/dist/components/anchor/index.d.ts +1 -8
  30. package/dist/components/anchor/index.js +2 -19
  31. package/dist/components/avatar/avatar.d.ts +25 -0
  32. package/dist/components/avatar/avatar.js +161 -0
  33. package/dist/components/avatar/index.d.ts +1 -21
  34. package/dist/components/avatar/index.js +2 -159
  35. package/dist/components/badge/badge.d.ts +20 -0
  36. package/dist/components/badge/badge.js +42 -0
  37. package/dist/components/badge/index.d.ts +1 -16
  38. package/dist/components/badge/index.js +2 -40
  39. package/dist/components/button/button.d.ts +27 -0
  40. package/dist/components/button/button.js +47 -0
  41. package/dist/components/button/index.d.ts +1 -24
  42. package/dist/components/button/index.js +2 -45
  43. package/dist/components/checkbox/checkbox.d.ts +13 -0
  44. package/dist/components/checkbox/checkbox.js +269 -0
  45. package/dist/components/checkbox/index.d.ts +1 -9
  46. package/dist/components/checkbox/index.js +2 -267
  47. package/dist/components/code/code.d.ts +13 -0
  48. package/dist/components/code/code.js +1206 -0
  49. package/dist/components/code/index.d.ts +1 -9
  50. package/dist/components/code/index.js +2 -1204
  51. package/dist/components/collapse/collapse.d.ts +14 -0
  52. package/dist/components/collapse/collapse.js +35 -0
  53. package/dist/components/collapse/index.d.ts +1 -11
  54. package/dist/components/collapse/index.js +2 -33
  55. package/dist/components/command/command.d.ts +36 -0
  56. package/dist/components/command/command.js +1695 -0
  57. package/dist/components/command/index.d.ts +1 -15
  58. package/dist/components/command/index.js +2 -1693
  59. package/dist/components/context-menu/context-menu.d.ts +82 -0
  60. package/dist/components/context-menu/context-menu.js +1445 -0
  61. package/dist/components/context-menu/index.d.ts +1 -42
  62. package/dist/components/context-menu/index.js +2 -1442
  63. package/dist/components/dialog/dialog.d.ts +22 -0
  64. package/dist/components/dialog/dialog.js +140 -0
  65. package/dist/components/dialog/dialog.types.d.ts +38 -0
  66. package/dist/components/dialog/index.d.ts +1 -48
  67. package/dist/components/dialog/index.js +2 -136
  68. package/dist/components/heading/heading.d.ts +25 -0
  69. package/dist/components/heading/heading.js +36 -0
  70. package/dist/components/heading/index.d.ts +1 -44
  71. package/dist/components/heading/index.js +2 -49
  72. package/dist/components/icon/icon.d.ts +28 -0
  73. package/dist/components/icon/icon.js +43 -0
  74. package/dist/components/icon/{icon-names.d.ts → icon.types.d.ts} +4 -0
  75. package/dist/components/icon/icon.types.js +1 -0
  76. package/dist/components/icon/index.d.ts +2 -24
  77. package/dist/components/icon/index.js +2 -41
  78. package/dist/components/icon-button/icon-button.d.ts +16 -0
  79. package/dist/components/icon-button/icon-button.js +46 -0
  80. package/dist/components/icon-button/index.d.ts +1 -12
  81. package/dist/components/icon-button/index.js +2 -44
  82. package/dist/components/inline-code/index.d.ts +1 -6
  83. package/dist/components/inline-code/index.js +2 -20
  84. package/dist/components/inline-code/inline-code.d.ts +10 -0
  85. package/dist/components/inline-code/inline-code.js +25 -0
  86. package/dist/components/input/index.d.ts +1 -3
  87. package/dist/components/input/index.js +2 -117
  88. package/dist/components/input/input.d.ts +9 -0
  89. package/dist/components/input/input.js +126 -0
  90. package/dist/components/meter/index.d.ts +1 -18
  91. package/dist/components/meter/index.js +2 -163
  92. package/dist/components/meter/meter.d.ts +22 -0
  93. package/dist/components/meter/meter.js +165 -0
  94. package/dist/components/multiline-input/index.d.ts +1 -6
  95. package/dist/components/multiline-input/index.js +2 -98
  96. package/dist/components/multiline-input/multiline-input.d.ts +10 -0
  97. package/dist/components/multiline-input/multiline-input.js +100 -0
  98. package/dist/components/number-input/index.d.ts +1 -10
  99. package/dist/components/number-input/index.js +2 -1167
  100. package/dist/components/number-input/number-input.d.ts +14 -0
  101. package/dist/components/number-input/number-input.js +1169 -0
  102. package/dist/components/password-input/index.d.ts +1 -2
  103. package/dist/components/password-input/index.js +2 -27
  104. package/dist/components/password-input/password-input.d.ts +7 -0
  105. package/dist/components/password-input/password-input.js +29 -0
  106. package/dist/components/pill/index.d.ts +1 -13
  107. package/dist/components/pill/index.js +2 -36
  108. package/dist/components/pill/pill.d.ts +17 -0
  109. package/dist/components/pill/pill.js +38 -0
  110. package/dist/components/popover/index.d.ts +1 -21
  111. package/dist/components/popover/index.js +2 -634
  112. package/dist/components/popover/popover.d.ts +22 -0
  113. package/dist/components/popover/popover.js +634 -0
  114. package/dist/components/preview-card/index.d.ts +1 -17
  115. package/dist/components/preview-card/index.js +2 -400
  116. package/dist/components/preview-card/preview-card.d.ts +21 -0
  117. package/dist/components/preview-card/preview-card.js +402 -0
  118. package/dist/components/radio-group/index.d.ts +1 -0
  119. package/dist/components/radio-group/index.js +5 -0
  120. package/dist/components/radio-group/radio-group.d.ts +25 -0
  121. package/dist/components/{radio/index.js → radio-group/radio-group.js} +91 -90
  122. package/dist/components/search-bar/index.d.ts +1 -12
  123. package/dist/components/search-bar/index.js +2 -46
  124. package/dist/components/search-bar/search-bar.d.ts +16 -0
  125. package/dist/components/search-bar/search-bar.js +43 -0
  126. package/dist/components/select/index.d.ts +1 -16
  127. package/dist/components/select/index.js +2 -1261
  128. package/dist/components/select/select.d.ts +22 -0
  129. package/dist/components/select/select.js +1263 -0
  130. package/dist/components/separator/index.d.ts +1 -7
  131. package/dist/components/separator/index.js +2 -4
  132. package/dist/components/separator/separator.d.ts +10 -0
  133. package/dist/components/separator/separator.js +6 -0
  134. package/dist/components/slider/index.d.ts +1 -5
  135. package/dist/components/slider/index.js +2 -900
  136. package/dist/components/slider/slider.d.ts +10 -0
  137. package/dist/components/slider/slider.js +899 -0
  138. package/dist/components/spinner/index.d.ts +1 -2
  139. package/dist/components/spinner/index.js +2 -11
  140. package/dist/components/spinner/spinner.d.ts +7 -0
  141. package/dist/components/spinner/spinner.js +13 -0
  142. package/dist/components/stacked-avatars/index.d.ts +1 -14
  143. package/dist/components/stacked-avatars/index.js +2 -90
  144. package/dist/components/stacked-avatars/stacked-avatars.d.ts +18 -0
  145. package/dist/components/stacked-avatars/stacked-avatars.js +92 -0
  146. package/dist/components/status-banner/index.d.ts +1 -17
  147. package/dist/components/status-banner/index.js +2 -69
  148. package/dist/components/status-banner/status-banner.d.ts +22 -0
  149. package/dist/components/status-banner/status-banner.js +71 -0
  150. package/dist/components/surface/index.d.ts +2 -27
  151. package/dist/components/surface/index.js +2 -39
  152. package/dist/components/surface/surface.d.ts +26 -0
  153. package/dist/components/surface/surface.js +36 -0
  154. package/dist/components/surface/surface.types.d.ts +1 -0
  155. package/dist/components/surface/surface.types.js +1 -0
  156. package/dist/components/switch/index.d.ts +1 -5
  157. package/dist/components/switch/index.js +2 -194
  158. package/dist/components/switch/switch.d.ts +10 -0
  159. package/dist/components/switch/switch.js +193 -0
  160. package/dist/components/tabs/index.d.ts +1 -18
  161. package/dist/components/tabs/index.js +2 -507
  162. package/dist/components/tabs/tabs.d.ts +28 -0
  163. package/dist/components/tabs/tabs.js +511 -0
  164. package/dist/components/text/index.d.ts +1 -26
  165. package/dist/components/text/index.js +2 -46
  166. package/dist/components/text/text.d.ts +29 -0
  167. package/dist/components/text/text.js +48 -0
  168. package/dist/components/theme-provider/index.d.ts +1 -1
  169. package/dist/components/theme-provider/theme-provider.d.ts +8 -4
  170. package/dist/components/theme-provider/theme-provider.js +3 -3
  171. package/dist/components/timestamp/index.d.ts +1 -23
  172. package/dist/components/timestamp/index.js +2 -1390
  173. package/dist/components/timestamp/timestamp.d.ts +26 -0
  174. package/dist/components/timestamp/timestamp.js +1391 -0
  175. package/dist/components/toaster/index.d.ts +2 -0
  176. package/dist/components/toaster/index.js +7 -0
  177. package/dist/components/toaster/toaster.d.ts +7 -0
  178. package/dist/components/toaster/toaster.js +923 -0
  179. package/dist/components/{toast → toaster}/use-toast-manager.d.ts +3 -3
  180. package/dist/components/tooltip/index.d.ts +1 -14
  181. package/dist/components/tooltip/index.js +2 -710
  182. package/dist/components/tooltip/tooltip.d.ts +24 -0
  183. package/dist/components/tooltip/tooltip.js +9 -0
  184. package/dist/components/view/index.d.ts +2 -30
  185. package/dist/components/view/index.js +2 -79
  186. package/dist/components/view/view.d.ts +31 -0
  187. package/dist/components/view/view.js +83 -0
  188. package/dist/components/view/view.types.d.ts +5 -0
  189. package/dist/components/view/view.types.js +1 -0
  190. package/dist/components/visually-hidden/index.d.ts +5 -1
  191. package/dist/{composite-Bx7Szd_T.js → composite-BZzP-LlG.js} +3 -3
  192. package/dist/{composite-C9L5QmZL.js → composite-BwEK5cWH.js} +1 -1
  193. package/dist/context-menu.css +1 -0
  194. package/dist/{createBaseUIEventDetails-D8M2Yl-a.js → createBaseUIEventDetails-CCSfZ2vM.js} +7 -7
  195. package/dist/{detectBrowser-I-s3yzIE.js → detectBrowser-Bl8Ki_1I.js} +2 -2
  196. package/dist/dialog.css +1 -1
  197. package/dist/{dialog.module-BeF-6XAo.js → dialog.module-DsbQRp-d.js} +55 -55
  198. package/dist/{element-CZEOj04G.js → element-u5WgOZX1.js} +7 -7
  199. package/dist/{event-CKoGyQEJ.js → event-B89-Ng5h.js} +4 -4
  200. package/dist/{floating-ui.utils-C7pRWMZ_.js → floating-ui.utils-DUVaIF3G.js} +7 -7
  201. package/dist/{floating-ui.utils.dom-C7FS5id0.js → floating-ui.utils.dom-cbi420Pg.js} +4 -4
  202. package/dist/{getDisabledMountTransitionStyles-YfHPge6T.js → getDisabledMountTransitionStyles-E2x-_lte.js} +7 -7
  203. package/dist/heading.css +1 -0
  204. package/dist/icon-button.css +1 -0
  205. package/dist/icon.css +1 -0
  206. package/dist/index.d.ts +10 -10
  207. package/dist/index.js +86 -104
  208. package/dist/{inertValue-BCYGsdmf.js → inertValue-BTpPjX30.js} +1 -1
  209. package/dist/inline-code.css +1 -0
  210. package/dist/input.css +1 -1
  211. package/dist/input.module-CtE19OH8.js +8 -0
  212. package/dist/integrations/react-markdown/index.js +12 -12
  213. package/dist/meter.css +1 -0
  214. package/dist/number-input.css +1 -0
  215. package/dist/password-input.css +1 -0
  216. package/dist/pill.css +1 -0
  217. package/dist/popover.css +1 -0
  218. package/dist/preview-card.css +1 -0
  219. package/dist/radio-group.css +1 -0
  220. package/dist/safePolygon-DnkzOIur.js +558 -0
  221. package/dist/search-bar.css +1 -0
  222. package/dist/select.css +1 -0
  223. package/dist/{index-DVjyPAD4.js → separator-fh_wDZNf.js} +7 -11
  224. package/dist/separator.css +1 -0
  225. package/dist/slider.css +1 -0
  226. package/dist/spinner.css +1 -0
  227. package/dist/stacked-avatars.css +1 -0
  228. package/dist/status-banner.css +1 -0
  229. package/dist/styles/core.css +1 -1
  230. package/dist/surface.css +1 -0
  231. package/dist/switch.css +1 -0
  232. package/dist/tabs.css +1 -0
  233. package/dist/text.css +1 -0
  234. package/dist/timestamp.css +1 -0
  235. package/dist/toaster.css +1 -0
  236. package/dist/tooltip-oCp-elli.js +765 -0
  237. package/dist/tooltip.css +1 -0
  238. package/dist/transitions.css +1 -1
  239. package/dist/{transitions.module-CWX8e5cx.js → transitions.module-D9mMAtfI.js} +11 -11
  240. package/dist/{useAnimationFrame-451ugS_6.js → useAnimationFrame-DvK1s63A.js} +1 -1
  241. package/dist/{useButton-DfIwsdb8.js → useButton-d3_JgBNr.js} +3 -3
  242. package/dist/{useCompositeListItem-OkcAim_1.js → useCompositeListItem-CZp9WTnF.js} +2 -2
  243. package/dist/{useLabelableId-Ci_jDvmv.js → useLabelableId-CX4tcfzK.js} +3 -3
  244. package/dist/{useOpenChangeComplete-Dse9kY9E.js → useOpenChangeComplete-BHd-N7Ig.js} +5 -5
  245. package/dist/{useRender-CLx7dR_1.js → useRender-C3vlzS3t.js} +1 -1
  246. package/dist/{useRenderElement-DwToLA61.js → useRenderElement-DngNDu_P.js} +2 -2
  247. package/dist/{useRole-oDBdbuwQ.js → useRole-BD3OL1rr.js} +3 -3
  248. package/dist/{useStableCallback-CkTrVkNX.js → useStableCallback-DKZHlUAT.js} +1 -1
  249. package/dist/{useSyncedFloatingRootContext-Dorsv-jf.js → useSyncedFloatingRootContext-BB1vwkV-.js} +20 -20
  250. package/dist/{useTimeout-CflX-kz3.js → useTimeout-BNni6aw5.js} +1 -1
  251. package/dist/{useTransitionStatus-CUfcuGAV.js → useTransitionStatus-CmMyUh74.js} +1 -1
  252. package/dist/{useTypeahead-D85V2IUx.js → useTypeahead-BiL5IAVb.js} +11 -11
  253. package/dist/{useValueAsRef-HURLzret.js → useValueAsRef-B4EriRsI.js} +1 -1
  254. package/dist/{useValueChanged-DL757-yD.js → useValueChanged-MJRmEWz1.js} +1 -1
  255. package/dist/view.css +1 -1
  256. package/dist/view.module-Dj7wj0kk.js +6 -0
  257. package/dist/view2.css +1 -0
  258. package/package.json +16 -19
  259. package/dist/components/radio/index.d.ts +0 -13
  260. package/dist/components/toast/index.d.ts +0 -2
  261. package/dist/components/toast/index.js +0 -8
  262. package/dist/components/toast/toast.d.ts +0 -2
  263. package/dist/components/toast/toast.js +0 -921
  264. package/dist/components/tooltip/tooltip-arrow.d.ts +0 -3
  265. package/dist/components/tooltip/tooltip-arrow.js +0 -6
  266. package/dist/index10.css +0 -1
  267. package/dist/index11.css +0 -1
  268. package/dist/index12.css +0 -1
  269. package/dist/index13.css +0 -1
  270. package/dist/index14.css +0 -1
  271. package/dist/index15.css +0 -1
  272. package/dist/index16.css +0 -1
  273. package/dist/index17.css +0 -1
  274. package/dist/index18.css +0 -1
  275. package/dist/index19.css +0 -1
  276. package/dist/index20.css +0 -1
  277. package/dist/index21.css +0 -1
  278. package/dist/index22.css +0 -1
  279. package/dist/index23.css +0 -1
  280. package/dist/index24.css +0 -1
  281. package/dist/index25.css +0 -1
  282. package/dist/index26.css +0 -1
  283. package/dist/index27.css +0 -1
  284. package/dist/index28.css +0 -1
  285. package/dist/index29.css +0 -1
  286. package/dist/index3.css +0 -1
  287. package/dist/index30.css +0 -1
  288. package/dist/index31.css +0 -1
  289. package/dist/index32.css +0 -1
  290. package/dist/index33.css +0 -1
  291. package/dist/index34.css +0 -1
  292. package/dist/index35.css +0 -1
  293. package/dist/index36.css +0 -1
  294. package/dist/index37.css +0 -1
  295. package/dist/index4.css +0 -1
  296. package/dist/index5.css +0 -1
  297. package/dist/index6.css +0 -1
  298. package/dist/index7.css +0 -1
  299. package/dist/index8.css +0 -1
  300. package/dist/index9.css +0 -1
  301. package/dist/input.module-DDQY_Ij6.js +0 -7
  302. package/dist/safePolygon-DWy1dGKJ.js +0 -308
  303. package/dist/toast.css +0 -1
  304. package/dist/tooltip-arrow-cs6vjjqZ.js +0 -24
  305. package/dist/tooltip-arrow.css +0 -1
  306. package/dist/useHoverReferenceInteraction-SfOBPoXM.js +0 -264
  307. package/dist/usePopupAutoResize-CNR6Ekmx.js +0 -85
  308. package/dist/view.module-DfDLgJE0.js +0 -6
  309. /package/dist/components/{icon/icon-names.js → dialog/dialog.types.js} +0 -0
  310. /package/dist/components/{toast → toaster}/use-toast-manager.js +0 -0
@@ -1,1696 +1,5 @@
1
1
  "use client";
2
- import { jsx as E, jsxs as oe, Fragment as Qe } from "react/jsx-runtime";
3
- import * as a from "react";
4
- import { useState as Qt } from "react";
5
- import { c as ie, u as q, P as G } from "../../index-CeuccO-T.js";
6
- import * as Jt from "react-dom";
7
- import en from "react-dom";
8
- import { c as We } from "../../clsx-OuTLNxxd.js";
9
- import { textify as tn } from "../../-utils.js";
10
- import { Dialog as nn } from "../dialog/index.js";
11
- import { Icon as vt } from "../icon/index.js";
12
- import { S as rn } from "../../index-DVjyPAD4.js";
13
- import { Text as pt } from "../text/index.js";
14
- import { View as ye } from "../view/index.js";
15
- import '../../index36.css';var Je = 1, on = 0.9, an = 0.8, cn = 0.17, Ne = 0.1, Oe = 0.999, un = 0.9999, sn = 0.99, ln = /[\\\/_+.#"@\[\(\{&]/, dn = /[\\\/_+.#"@\[\(\{&]/g, fn = /[\s-]/, ht = /[\s-]/g;
16
- function Be(e, t, n, r, o, i, u) {
17
- if (i === t.length) return o === e.length ? Je : sn;
18
- var c = `${o},${i}`;
19
- if (u[c] !== void 0) return u[c];
20
- for (var m = r.charAt(i), s = n.indexOf(m, o), d = 0, f, p, h, _; s >= 0; ) f = Be(e, t, n, r, s + 1, i + 1, u), f > d && (s === o ? f *= Je : ln.test(e.charAt(s - 1)) ? (f *= an, h = e.slice(o, s - 1).match(dn), h && o > 0 && (f *= Math.pow(Oe, h.length))) : fn.test(e.charAt(s - 1)) ? (f *= on, _ = e.slice(o, s - 1).match(ht), _ && o > 0 && (f *= Math.pow(Oe, _.length))) : (f *= cn, o > 0 && (f *= Math.pow(Oe, s - o))), e.charAt(s) !== t.charAt(i) && (f *= un)), (f < Ne && n.charAt(s - 1) === r.charAt(i + 1) || r.charAt(i + 1) === r.charAt(i) && n.charAt(s - 1) !== r.charAt(i)) && (p = Be(e, t, n, r, s + 1, i + 2, u), p * Ne > f && (f = p * Ne)), f > d && (d = f), s = n.indexOf(m, s + 1);
21
- return u[c] = d, d;
22
- }
23
- function et(e) {
24
- return e.toLowerCase().replace(ht, " ");
25
- }
26
- function mn(e, t, n) {
27
- return e = n && n.length > 0 ? `${e + " " + n.join(" ")}` : e, Be(e, t, et(e), et(t), 0, 0, {});
28
- }
29
- function j(e, t, { checkForDefaultPrevented: n = !0 } = {}) {
30
- return function(o) {
31
- if (e?.(o), n === !1 || !o.defaultPrevented)
32
- return t?.(o);
33
- };
34
- }
35
- function vn(e, t) {
36
- const n = a.createContext(t), r = (i) => {
37
- const { children: u, ...c } = i, m = a.useMemo(() => c, Object.values(c));
38
- return /* @__PURE__ */ E(n.Provider, { value: m, children: u });
39
- };
40
- r.displayName = e + "Provider";
41
- function o(i) {
42
- const u = a.useContext(n);
43
- if (u) return u;
44
- if (t !== void 0) return t;
45
- throw new Error(`\`${i}\` must be used within \`${e}\``);
46
- }
47
- return [r, o];
48
- }
49
- function pn(e, t = []) {
50
- let n = [];
51
- function r(i, u) {
52
- const c = a.createContext(u), m = n.length;
53
- n = [...n, u];
54
- const s = (f) => {
55
- const { scope: p, children: h, ..._ } = f, v = p?.[e]?.[m] || c, y = a.useMemo(() => _, Object.values(_));
56
- return /* @__PURE__ */ E(v.Provider, { value: y, children: h });
57
- };
58
- s.displayName = i + "Provider";
59
- function d(f, p) {
60
- const h = p?.[e]?.[m] || c, _ = a.useContext(h);
61
- if (_) return _;
62
- if (u !== void 0) return u;
63
- throw new Error(`\`${f}\` must be used within \`${i}\``);
64
- }
65
- return [s, d];
66
- }
67
- const o = () => {
68
- const i = n.map((u) => a.createContext(u));
69
- return function(c) {
70
- const m = c?.[e] || i;
71
- return a.useMemo(
72
- () => ({ [`__scope${e}`]: { ...c, [e]: m } }),
73
- [c, m]
74
- );
75
- };
76
- };
77
- return o.scopeName = e, [r, hn(o, ...t)];
78
- }
79
- function hn(...e) {
80
- const t = e[0];
81
- if (e.length === 1) return t;
82
- const n = () => {
83
- const r = e.map((o) => ({
84
- useScope: o(),
85
- scopeName: o.scopeName
86
- }));
87
- return function(i) {
88
- const u = r.reduce((c, { useScope: m, scopeName: s }) => {
89
- const f = m(i)[`__scope${s}`];
90
- return { ...c, ...f };
91
- }, {});
92
- return a.useMemo(() => ({ [`__scope${t.scopeName}`]: u }), [u]);
93
- };
94
- };
95
- return n.scopeName = t.scopeName, n;
96
- }
97
- var se = globalThis?.document ? a.useLayoutEffect : () => {
98
- }, gn = a[" useId ".trim().toString()] || (() => {
99
- }), yn = 0;
100
- function $(e) {
101
- const [t, n] = a.useState(gn());
102
- return se(() => {
103
- n((r) => r ?? String(yn++));
104
- }, [e]), t ? `radix-${t}` : "";
105
- }
106
- var En = a[" useInsertionEffect ".trim().toString()] || se;
107
- function bn({
108
- prop: e,
109
- defaultProp: t,
110
- onChange: n = () => {
111
- },
112
- caller: r
113
- }) {
114
- const [o, i, u] = wn({
115
- defaultProp: t,
116
- onChange: n
117
- }), c = e !== void 0, m = c ? e : o;
118
- {
119
- const d = a.useRef(e !== void 0);
120
- a.useEffect(() => {
121
- const f = d.current;
122
- f !== c && console.warn(
123
- `${r} is changing from ${f ? "controlled" : "uncontrolled"} to ${c ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
124
- ), d.current = c;
125
- }, [c, r]);
126
- }
127
- const s = a.useCallback(
128
- (d) => {
129
- if (c) {
130
- const f = Cn(d) ? d(e) : d;
131
- f !== e && u.current?.(f);
132
- } else
133
- i(d);
134
- },
135
- [c, e, i, u]
136
- );
137
- return [m, s];
138
- }
139
- function wn({
140
- defaultProp: e,
141
- onChange: t
142
- }) {
143
- const [n, r] = a.useState(e), o = a.useRef(n), i = a.useRef(t);
144
- return En(() => {
145
- i.current = t;
146
- }, [t]), a.useEffect(() => {
147
- o.current !== n && (i.current?.(n), o.current = n);
148
- }, [n, o]), [n, r, i];
149
- }
150
- function Cn(e) {
151
- return typeof e == "function";
152
- }
153
- // @__NO_SIDE_EFFECTS__
154
- function gt(e) {
155
- const t = /* @__PURE__ */ Sn(e), n = a.forwardRef((r, o) => {
156
- const { children: i, ...u } = r, c = a.Children.toArray(i), m = c.find(_n);
157
- if (m) {
158
- const s = m.props.children, d = c.map((f) => f === m ? a.Children.count(s) > 1 ? a.Children.only(null) : a.isValidElement(s) ? s.props.children : null : f);
159
- return /* @__PURE__ */ E(t, { ...u, ref: o, children: a.isValidElement(s) ? a.cloneElement(s, void 0, d) : null });
160
- }
161
- return /* @__PURE__ */ E(t, { ...u, ref: o, children: i });
162
- });
163
- return n.displayName = `${e}.Slot`, n;
164
- }
165
- // @__NO_SIDE_EFFECTS__
166
- function Sn(e) {
167
- const t = a.forwardRef((n, r) => {
168
- const { children: o, ...i } = n;
169
- if (a.isValidElement(o)) {
170
- const u = Pn(o), c = Dn(i, o.props);
171
- return o.type !== a.Fragment && (c.ref = r ? ie(r, u) : u), a.cloneElement(o, c);
172
- }
173
- return a.Children.count(o) > 1 ? a.Children.only(null) : null;
174
- });
175
- return t.displayName = `${e}.SlotClone`, t;
176
- }
177
- var Rn = /* @__PURE__ */ Symbol("radix.slottable");
178
- function _n(e) {
179
- return a.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === Rn;
180
- }
181
- function Dn(e, t) {
182
- const n = { ...t };
183
- for (const r in t) {
184
- const o = e[r], i = t[r];
185
- /^on[A-Z]/.test(r) ? o && i ? n[r] = (...c) => {
186
- const m = i(...c);
187
- return o(...c), m;
188
- } : o && (n[r] = o) : r === "style" ? n[r] = { ...o, ...i } : r === "className" && (n[r] = [o, i].filter(Boolean).join(" "));
189
- }
190
- return { ...e, ...n };
191
- }
192
- function Pn(e) {
193
- let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
194
- return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
195
- }
196
- var Nn = [
197
- "a",
198
- "button",
199
- "div",
200
- "form",
201
- "h2",
202
- "h3",
203
- "img",
204
- "input",
205
- "label",
206
- "li",
207
- "nav",
208
- "ol",
209
- "p",
210
- "select",
211
- "span",
212
- "svg",
213
- "ul"
214
- ], U = Nn.reduce((e, t) => {
215
- const n = /* @__PURE__ */ gt(`Primitive.${t}`), r = a.forwardRef((o, i) => {
216
- const { asChild: u, ...c } = o, m = u ? n : t;
217
- return typeof window < "u" && (window[/* @__PURE__ */ Symbol.for("radix-ui")] = !0), /* @__PURE__ */ E(m, { ...c, ref: i });
218
- });
219
- return r.displayName = `Primitive.${t}`, { ...e, [t]: r };
220
- }, {});
221
- function On(e, t) {
222
- e && Jt.flushSync(() => e.dispatchEvent(t));
223
- }
224
- function le(e) {
225
- const t = a.useRef(e);
226
- return a.useEffect(() => {
227
- t.current = e;
228
- }), a.useMemo(() => (...n) => t.current?.(...n), []);
229
- }
230
- function In(e, t = globalThis?.document) {
231
- const n = le(e);
232
- a.useEffect(() => {
233
- const r = (o) => {
234
- o.key === "Escape" && n(o);
235
- };
236
- return t.addEventListener("keydown", r, { capture: !0 }), () => t.removeEventListener("keydown", r, { capture: !0 });
237
- }, [n, t]);
238
- }
239
- var An = "DismissableLayer", $e = "dismissableLayer.update", xn = "dismissableLayer.pointerDownOutside", Mn = "dismissableLayer.focusOutside", tt, yt = a.createContext({
240
- layers: /* @__PURE__ */ new Set(),
241
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
242
- branches: /* @__PURE__ */ new Set()
243
- }), Et = a.forwardRef(
244
- (e, t) => {
245
- const {
246
- disableOutsidePointerEvents: n = !1,
247
- onEscapeKeyDown: r,
248
- onPointerDownOutside: o,
249
- onFocusOutside: i,
250
- onInteractOutside: u,
251
- onDismiss: c,
252
- ...m
253
- } = e, s = a.useContext(yt), [d, f] = a.useState(null), p = d?.ownerDocument ?? globalThis?.document, [, h] = a.useState({}), _ = q(t, (b) => f(b)), v = Array.from(s.layers), [y] = [...s.layersWithOutsidePointerEventsDisabled].slice(-1), C = v.indexOf(y), D = d ? v.indexOf(d) : -1, I = s.layersWithOutsidePointerEventsDisabled.size > 0, P = D >= C, N = Ln((b) => {
254
- const k = b.target, F = [...s.branches].some((W) => W.contains(k));
255
- !P || F || (o?.(b), u?.(b), b.defaultPrevented || c?.());
256
- }, p), S = Fn((b) => {
257
- const k = b.target;
258
- [...s.branches].some((W) => W.contains(k)) || (i?.(b), u?.(b), b.defaultPrevented || c?.());
259
- }, p);
260
- return In((b) => {
261
- D === s.layers.size - 1 && (r?.(b), !b.defaultPrevented && c && (b.preventDefault(), c()));
262
- }, p), a.useEffect(() => {
263
- if (d)
264
- return n && (s.layersWithOutsidePointerEventsDisabled.size === 0 && (tt = p.body.style.pointerEvents, p.body.style.pointerEvents = "none"), s.layersWithOutsidePointerEventsDisabled.add(d)), s.layers.add(d), nt(), () => {
265
- n && s.layersWithOutsidePointerEventsDisabled.size === 1 && (p.body.style.pointerEvents = tt);
266
- };
267
- }, [d, p, n, s]), a.useEffect(() => () => {
268
- d && (s.layers.delete(d), s.layersWithOutsidePointerEventsDisabled.delete(d), nt());
269
- }, [d, s]), a.useEffect(() => {
270
- const b = () => h({});
271
- return document.addEventListener($e, b), () => document.removeEventListener($e, b);
272
- }, []), /* @__PURE__ */ E(
273
- U.div,
274
- {
275
- ...m,
276
- ref: _,
277
- style: {
278
- pointerEvents: I ? P ? "auto" : "none" : void 0,
279
- ...e.style
280
- },
281
- onFocusCapture: j(e.onFocusCapture, S.onFocusCapture),
282
- onBlurCapture: j(e.onBlurCapture, S.onBlurCapture),
283
- onPointerDownCapture: j(
284
- e.onPointerDownCapture,
285
- N.onPointerDownCapture
286
- )
287
- }
288
- );
289
- }
290
- );
291
- Et.displayName = An;
292
- var kn = "DismissableLayerBranch", Tn = a.forwardRef((e, t) => {
293
- const n = a.useContext(yt), r = a.useRef(null), o = q(t, r);
294
- return a.useEffect(() => {
295
- const i = r.current;
296
- if (i)
297
- return n.branches.add(i), () => {
298
- n.branches.delete(i);
299
- };
300
- }, [n.branches]), /* @__PURE__ */ E(U.div, { ...e, ref: o });
301
- });
302
- Tn.displayName = kn;
303
- function Ln(e, t = globalThis?.document) {
304
- const n = le(e), r = a.useRef(!1), o = a.useRef(() => {
305
- });
306
- return a.useEffect(() => {
307
- const i = (c) => {
308
- if (c.target && !r.current) {
309
- let m = function() {
310
- bt(
311
- xn,
312
- n,
313
- s,
314
- { discrete: !0 }
315
- );
316
- };
317
- const s = { originalEvent: c };
318
- c.pointerType === "touch" ? (t.removeEventListener("click", o.current), o.current = m, t.addEventListener("click", o.current, { once: !0 })) : m();
319
- } else
320
- t.removeEventListener("click", o.current);
321
- r.current = !1;
322
- }, u = window.setTimeout(() => {
323
- t.addEventListener("pointerdown", i);
324
- }, 0);
325
- return () => {
326
- window.clearTimeout(u), t.removeEventListener("pointerdown", i), t.removeEventListener("click", o.current);
327
- };
328
- }, [t, n]), {
329
- // ensures we check React component tree (not just DOM tree)
330
- onPointerDownCapture: () => r.current = !0
331
- };
332
- }
333
- function Fn(e, t = globalThis?.document) {
334
- const n = le(e), r = a.useRef(!1);
335
- return a.useEffect(() => {
336
- const o = (i) => {
337
- i.target && !r.current && bt(Mn, n, { originalEvent: i }, {
338
- discrete: !1
339
- });
340
- };
341
- return t.addEventListener("focusin", o), () => t.removeEventListener("focusin", o);
342
- }, [t, n]), {
343
- onFocusCapture: () => r.current = !0,
344
- onBlurCapture: () => r.current = !1
345
- };
346
- }
347
- function nt() {
348
- const e = new CustomEvent($e);
349
- document.dispatchEvent(e);
350
- }
351
- function bt(e, t, n, { discrete: r }) {
352
- const o = n.originalEvent.target, i = new CustomEvent(e, { bubbles: !1, cancelable: !0, detail: n });
353
- t && o.addEventListener(e, t, { once: !0 }), r ? On(o, i) : o.dispatchEvent(i);
354
- }
355
- var Ie = "focusScope.autoFocusOnMount", Ae = "focusScope.autoFocusOnUnmount", rt = { bubbles: !1, cancelable: !0 }, Wn = "FocusScope", wt = a.forwardRef((e, t) => {
356
- const {
357
- loop: n = !1,
358
- trapped: r = !1,
359
- onMountAutoFocus: o,
360
- onUnmountAutoFocus: i,
361
- ...u
362
- } = e, [c, m] = a.useState(null), s = le(o), d = le(i), f = a.useRef(null), p = q(t, (v) => m(v)), h = a.useRef({
363
- paused: !1,
364
- pause() {
365
- this.paused = !0;
366
- },
367
- resume() {
368
- this.paused = !1;
369
- }
370
- }).current;
371
- a.useEffect(() => {
372
- if (r) {
373
- let v = function(I) {
374
- if (h.paused || !c) return;
375
- const P = I.target;
376
- c.contains(P) ? f.current = P : K(f.current, { select: !0 });
377
- }, y = function(I) {
378
- if (h.paused || !c) return;
379
- const P = I.relatedTarget;
380
- P !== null && (c.contains(P) || K(f.current, { select: !0 }));
381
- }, C = function(I) {
382
- if (document.activeElement === document.body)
383
- for (const N of I)
384
- N.removedNodes.length > 0 && K(c);
385
- };
386
- document.addEventListener("focusin", v), document.addEventListener("focusout", y);
387
- const D = new MutationObserver(C);
388
- return c && D.observe(c, { childList: !0, subtree: !0 }), () => {
389
- document.removeEventListener("focusin", v), document.removeEventListener("focusout", y), D.disconnect();
390
- };
391
- }
392
- }, [r, c, h.paused]), a.useEffect(() => {
393
- if (c) {
394
- at.add(h);
395
- const v = document.activeElement;
396
- if (!c.contains(v)) {
397
- const C = new CustomEvent(Ie, rt);
398
- c.addEventListener(Ie, s), c.dispatchEvent(C), C.defaultPrevented || (Bn(jn(Ct(c)), { select: !0 }), document.activeElement === v && K(c));
399
- }
400
- return () => {
401
- c.removeEventListener(Ie, s), setTimeout(() => {
402
- const C = new CustomEvent(Ae, rt);
403
- c.addEventListener(Ae, d), c.dispatchEvent(C), C.defaultPrevented || K(v ?? document.body, { select: !0 }), c.removeEventListener(Ae, d), at.remove(h);
404
- }, 0);
405
- };
406
- }
407
- }, [c, s, d, h]);
408
- const _ = a.useCallback(
409
- (v) => {
410
- if (!n && !r || h.paused) return;
411
- const y = v.key === "Tab" && !v.altKey && !v.ctrlKey && !v.metaKey, C = document.activeElement;
412
- if (y && C) {
413
- const D = v.currentTarget, [I, P] = $n(D);
414
- I && P ? !v.shiftKey && C === P ? (v.preventDefault(), n && K(I, { select: !0 })) : v.shiftKey && C === I && (v.preventDefault(), n && K(P, { select: !0 })) : C === D && v.preventDefault();
415
- }
416
- },
417
- [n, r, h.paused]
418
- );
419
- return /* @__PURE__ */ E(U.div, { tabIndex: -1, ...u, ref: p, onKeyDown: _ });
420
- });
421
- wt.displayName = Wn;
422
- function Bn(e, { select: t = !1 } = {}) {
423
- const n = document.activeElement;
424
- for (const r of e)
425
- if (K(r, { select: t }), document.activeElement !== n) return;
426
- }
427
- function $n(e) {
428
- const t = Ct(e), n = ot(t, e), r = ot(t.reverse(), e);
429
- return [n, r];
430
- }
431
- function Ct(e) {
432
- const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
433
- acceptNode: (r) => {
434
- const o = r.tagName === "INPUT" && r.type === "hidden";
435
- return r.disabled || r.hidden || o ? NodeFilter.FILTER_SKIP : r.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
436
- }
437
- });
438
- for (; n.nextNode(); ) t.push(n.currentNode);
439
- return t;
440
- }
441
- function ot(e, t) {
442
- for (const n of e)
443
- if (!Un(n, { upTo: t })) return n;
444
- }
445
- function Un(e, { upTo: t }) {
446
- if (getComputedStyle(e).visibility === "hidden") return !0;
447
- for (; e; ) {
448
- if (t !== void 0 && e === t) return !1;
449
- if (getComputedStyle(e).display === "none") return !0;
450
- e = e.parentElement;
451
- }
452
- return !1;
453
- }
454
- function Vn(e) {
455
- return e instanceof HTMLInputElement && "select" in e;
456
- }
457
- function K(e, { select: t = !1 } = {}) {
458
- if (e && e.focus) {
459
- const n = document.activeElement;
460
- e.focus({ preventScroll: !0 }), e !== n && Vn(e) && t && e.select();
461
- }
462
- }
463
- var at = Kn();
464
- function Kn() {
465
- let e = [];
466
- return {
467
- add(t) {
468
- const n = e[0];
469
- t !== n && n?.pause(), e = it(e, t), e.unshift(t);
470
- },
471
- remove(t) {
472
- e = it(e, t), e[0]?.resume();
473
- }
474
- };
475
- }
476
- function it(e, t) {
477
- const n = [...e], r = n.indexOf(t);
478
- return r !== -1 && n.splice(r, 1), n;
479
- }
480
- function jn(e) {
481
- return e.filter((t) => t.tagName !== "A");
482
- }
483
- var Hn = "Portal", St = a.forwardRef((e, t) => {
484
- const { container: n, ...r } = e, [o, i] = a.useState(!1);
485
- se(() => i(!0), []);
486
- const u = n || o && globalThis?.document?.body;
487
- return u ? en.createPortal(/* @__PURE__ */ E(U.div, { ...r, ref: t }), u) : null;
488
- });
489
- St.displayName = Hn;
490
- function Gn(e, t) {
491
- return a.useReducer((n, r) => t[n][r] ?? n, e);
492
- }
493
- var Ce = (e) => {
494
- const { present: t, children: n } = e, r = zn(t), o = typeof n == "function" ? n({ present: r.isPresent }) : a.Children.only(n), i = q(r.ref, Yn(o));
495
- return typeof n == "function" || r.isPresent ? a.cloneElement(o, { ref: i }) : null;
496
- };
497
- Ce.displayName = "Presence";
498
- function zn(e) {
499
- const [t, n] = a.useState(), r = a.useRef(null), o = a.useRef(e), i = a.useRef("none"), u = e ? "mounted" : "unmounted", [c, m] = Gn(u, {
500
- mounted: {
501
- UNMOUNT: "unmounted",
502
- ANIMATION_OUT: "unmountSuspended"
503
- },
504
- unmountSuspended: {
505
- MOUNT: "mounted",
506
- ANIMATION_END: "unmounted"
507
- },
508
- unmounted: {
509
- MOUNT: "mounted"
510
- }
511
- });
512
- return a.useEffect(() => {
513
- const s = me(r.current);
514
- i.current = c === "mounted" ? s : "none";
515
- }, [c]), se(() => {
516
- const s = r.current, d = o.current;
517
- if (d !== e) {
518
- const p = i.current, h = me(s);
519
- e ? m("MOUNT") : h === "none" || s?.display === "none" ? m("UNMOUNT") : m(d && p !== h ? "ANIMATION_OUT" : "UNMOUNT"), o.current = e;
520
- }
521
- }, [e, m]), se(() => {
522
- if (t) {
523
- let s;
524
- const d = t.ownerDocument.defaultView ?? window, f = (h) => {
525
- const v = me(r.current).includes(CSS.escape(h.animationName));
526
- if (h.target === t && v && (m("ANIMATION_END"), !o.current)) {
527
- const y = t.style.animationFillMode;
528
- t.style.animationFillMode = "forwards", s = d.setTimeout(() => {
529
- t.style.animationFillMode === "forwards" && (t.style.animationFillMode = y);
530
- });
531
- }
532
- }, p = (h) => {
533
- h.target === t && (i.current = me(r.current));
534
- };
535
- return t.addEventListener("animationstart", p), t.addEventListener("animationcancel", f), t.addEventListener("animationend", f), () => {
536
- d.clearTimeout(s), t.removeEventListener("animationstart", p), t.removeEventListener("animationcancel", f), t.removeEventListener("animationend", f);
537
- };
538
- } else
539
- m("ANIMATION_END");
540
- }, [t, m]), {
541
- isPresent: ["mounted", "unmountSuspended"].includes(c),
542
- ref: a.useCallback((s) => {
543
- r.current = s ? getComputedStyle(s) : null, n(s);
544
- }, [])
545
- };
546
- }
547
- function me(e) {
548
- return e?.animationName || "none";
549
- }
550
- function Yn(e) {
551
- let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
552
- return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
553
- }
554
- var xe = 0;
555
- function Xn() {
556
- a.useEffect(() => {
557
- const e = document.querySelectorAll("[data-radix-focus-guard]");
558
- return document.body.insertAdjacentElement("afterbegin", e[0] ?? ct()), document.body.insertAdjacentElement("beforeend", e[1] ?? ct()), xe++, () => {
559
- xe === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), xe--;
560
- };
561
- }, []);
562
- }
563
- function ct() {
564
- const e = document.createElement("span");
565
- return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
566
- }
567
- var L = function() {
568
- return L = Object.assign || function(t) {
569
- for (var n, r = 1, o = arguments.length; r < o; r++) {
570
- n = arguments[r];
571
- for (var i in n) Object.prototype.hasOwnProperty.call(n, i) && (t[i] = n[i]);
572
- }
573
- return t;
574
- }, L.apply(this, arguments);
575
- };
576
- function Rt(e, t) {
577
- var n = {};
578
- for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
579
- if (e != null && typeof Object.getOwnPropertySymbols == "function")
580
- for (var o = 0, r = Object.getOwnPropertySymbols(e); o < r.length; o++)
581
- t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
582
- return n;
583
- }
584
- function qn(e, t, n) {
585
- if (n || arguments.length === 2) for (var r = 0, o = t.length, i; r < o; r++)
586
- (i || !(r in t)) && (i || (i = Array.prototype.slice.call(t, 0, r)), i[r] = t[r]);
587
- return e.concat(i || Array.prototype.slice.call(t));
588
- }
589
- var Ee = "right-scroll-bar-position", be = "width-before-scroll-bar", Zn = "with-scroll-bars-hidden", Qn = "--removed-body-scroll-bar-size";
590
- function Me(e, t) {
591
- return typeof e == "function" ? e(t) : e && (e.current = t), e;
592
- }
593
- function Jn(e, t) {
594
- var n = Qt(function() {
595
- return {
596
- // value
597
- value: e,
598
- // last callback
599
- callback: t,
600
- // "memoized" public interface
601
- facade: {
602
- get current() {
603
- return n.value;
604
- },
605
- set current(r) {
606
- var o = n.value;
607
- o !== r && (n.value = r, n.callback(r, o));
608
- }
609
- }
610
- };
611
- })[0];
612
- return n.callback = t, n.facade;
613
- }
614
- var er = typeof window < "u" ? a.useLayoutEffect : a.useEffect, ut = /* @__PURE__ */ new WeakMap();
615
- function tr(e, t) {
616
- var n = Jn(null, function(r) {
617
- return e.forEach(function(o) {
618
- return Me(o, r);
619
- });
620
- });
621
- return er(function() {
622
- var r = ut.get(n);
623
- if (r) {
624
- var o = new Set(r), i = new Set(e), u = n.current;
625
- o.forEach(function(c) {
626
- i.has(c) || Me(c, null);
627
- }), i.forEach(function(c) {
628
- o.has(c) || Me(c, u);
629
- });
630
- }
631
- ut.set(n, e);
632
- }, [e]), n;
633
- }
634
- function nr(e) {
635
- return e;
636
- }
637
- function rr(e, t) {
638
- t === void 0 && (t = nr);
639
- var n = [], r = !1, o = {
640
- read: function() {
641
- if (r)
642
- throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
643
- return n.length ? n[n.length - 1] : e;
644
- },
645
- useMedium: function(i) {
646
- var u = t(i, r);
647
- return n.push(u), function() {
648
- n = n.filter(function(c) {
649
- return c !== u;
650
- });
651
- };
652
- },
653
- assignSyncMedium: function(i) {
654
- for (r = !0; n.length; ) {
655
- var u = n;
656
- n = [], u.forEach(i);
657
- }
658
- n = {
659
- push: function(c) {
660
- return i(c);
661
- },
662
- filter: function() {
663
- return n;
664
- }
665
- };
666
- },
667
- assignMedium: function(i) {
668
- r = !0;
669
- var u = [];
670
- if (n.length) {
671
- var c = n;
672
- n = [], c.forEach(i), u = n;
673
- }
674
- var m = function() {
675
- var d = u;
676
- u = [], d.forEach(i);
677
- }, s = function() {
678
- return Promise.resolve().then(m);
679
- };
680
- s(), n = {
681
- push: function(d) {
682
- u.push(d), s();
683
- },
684
- filter: function(d) {
685
- return u = u.filter(d), n;
686
- }
687
- };
688
- }
689
- };
690
- return o;
691
- }
692
- function or(e) {
693
- e === void 0 && (e = {});
694
- var t = rr(null);
695
- return t.options = L({ async: !0, ssr: !1 }, e), t;
696
- }
697
- var _t = function(e) {
698
- var t = e.sideCar, n = Rt(e, ["sideCar"]);
699
- if (!t)
700
- throw new Error("Sidecar: please provide `sideCar` property to import the right car");
701
- var r = t.read();
702
- if (!r)
703
- throw new Error("Sidecar medium not found");
704
- return a.createElement(r, L({}, n));
705
- };
706
- _t.isSideCarExport = !0;
707
- function ar(e, t) {
708
- return e.useMedium(t), _t;
709
- }
710
- var Dt = or(), ke = function() {
711
- }, Se = a.forwardRef(function(e, t) {
712
- var n = a.useRef(null), r = a.useState({
713
- onScrollCapture: ke,
714
- onWheelCapture: ke,
715
- onTouchMoveCapture: ke
716
- }), o = r[0], i = r[1], u = e.forwardProps, c = e.children, m = e.className, s = e.removeScrollBar, d = e.enabled, f = e.shards, p = e.sideCar, h = e.noRelative, _ = e.noIsolation, v = e.inert, y = e.allowPinchZoom, C = e.as, D = C === void 0 ? "div" : C, I = e.gapMode, P = Rt(e, ["forwardProps", "children", "className", "removeScrollBar", "enabled", "shards", "sideCar", "noRelative", "noIsolation", "inert", "allowPinchZoom", "as", "gapMode"]), N = p, S = tr([n, t]), b = L(L({}, P), o);
717
- return a.createElement(
718
- a.Fragment,
719
- null,
720
- d && a.createElement(N, { sideCar: Dt, removeScrollBar: s, shards: f, noRelative: h, noIsolation: _, inert: v, setCallbacks: i, allowPinchZoom: !!y, lockRef: n, gapMode: I }),
721
- u ? a.cloneElement(a.Children.only(c), L(L({}, b), { ref: S })) : a.createElement(D, L({}, b, { className: m, ref: S }), c)
722
- );
723
- });
724
- Se.defaultProps = {
725
- enabled: !0,
726
- removeScrollBar: !0,
727
- inert: !1
728
- };
729
- Se.classNames = {
730
- fullWidth: be,
731
- zeroRight: Ee
732
- };
733
- var ir = function() {
734
- if (typeof __webpack_nonce__ < "u")
735
- return __webpack_nonce__;
736
- };
737
- function cr() {
738
- if (!document)
739
- return null;
740
- var e = document.createElement("style");
741
- e.type = "text/css";
742
- var t = ir();
743
- return t && e.setAttribute("nonce", t), e;
744
- }
745
- function ur(e, t) {
746
- e.styleSheet ? e.styleSheet.cssText = t : e.appendChild(document.createTextNode(t));
747
- }
748
- function sr(e) {
749
- var t = document.head || document.getElementsByTagName("head")[0];
750
- t.appendChild(e);
751
- }
752
- var lr = function() {
753
- var e = 0, t = null;
754
- return {
755
- add: function(n) {
756
- e == 0 && (t = cr()) && (ur(t, n), sr(t)), e++;
757
- },
758
- remove: function() {
759
- e--, !e && t && (t.parentNode && t.parentNode.removeChild(t), t = null);
760
- }
761
- };
762
- }, dr = function() {
763
- var e = lr();
764
- return function(t, n) {
765
- a.useEffect(function() {
766
- return e.add(t), function() {
767
- e.remove();
768
- };
769
- }, [t && n]);
770
- };
771
- }, Pt = function() {
772
- var e = dr(), t = function(n) {
773
- var r = n.styles, o = n.dynamic;
774
- return e(r, o), null;
775
- };
776
- return t;
777
- }, fr = {
778
- left: 0,
779
- top: 0,
780
- right: 0,
781
- gap: 0
782
- }, Te = function(e) {
783
- return parseInt(e || "", 10) || 0;
784
- }, mr = function(e) {
785
- var t = window.getComputedStyle(document.body), n = t[e === "padding" ? "paddingLeft" : "marginLeft"], r = t[e === "padding" ? "paddingTop" : "marginTop"], o = t[e === "padding" ? "paddingRight" : "marginRight"];
786
- return [Te(n), Te(r), Te(o)];
787
- }, vr = function(e) {
788
- if (e === void 0 && (e = "margin"), typeof window > "u")
789
- return fr;
790
- var t = mr(e), n = document.documentElement.clientWidth, r = window.innerWidth;
791
- return {
792
- left: t[0],
793
- top: t[1],
794
- right: t[2],
795
- gap: Math.max(0, r - n + t[2] - t[0])
796
- };
797
- }, pr = Pt(), ae = "data-scroll-locked", hr = function(e, t, n, r) {
798
- var o = e.left, i = e.top, u = e.right, c = e.gap;
799
- return n === void 0 && (n = "margin"), `
800
- .`.concat(Zn, ` {
801
- overflow: hidden `).concat(r, `;
802
- padding-right: `).concat(c, "px ").concat(r, `;
803
- }
804
- body[`).concat(ae, `] {
805
- overflow: hidden `).concat(r, `;
806
- overscroll-behavior: contain;
807
- `).concat([
808
- t && "position: relative ".concat(r, ";"),
809
- n === "margin" && `
810
- padding-left: `.concat(o, `px;
811
- padding-top: `).concat(i, `px;
812
- padding-right: `).concat(u, `px;
813
- margin-left:0;
814
- margin-top:0;
815
- margin-right: `).concat(c, "px ").concat(r, `;
816
- `),
817
- n === "padding" && "padding-right: ".concat(c, "px ").concat(r, ";")
818
- ].filter(Boolean).join(""), `
819
- }
820
-
821
- .`).concat(Ee, ` {
822
- right: `).concat(c, "px ").concat(r, `;
823
- }
824
-
825
- .`).concat(be, ` {
826
- margin-right: `).concat(c, "px ").concat(r, `;
827
- }
828
-
829
- .`).concat(Ee, " .").concat(Ee, ` {
830
- right: 0 `).concat(r, `;
831
- }
832
-
833
- .`).concat(be, " .").concat(be, ` {
834
- margin-right: 0 `).concat(r, `;
835
- }
836
-
837
- body[`).concat(ae, `] {
838
- `).concat(Qn, ": ").concat(c, `px;
839
- }
840
- `);
841
- }, st = function() {
842
- var e = parseInt(document.body.getAttribute(ae) || "0", 10);
843
- return isFinite(e) ? e : 0;
844
- }, gr = function() {
845
- a.useEffect(function() {
846
- return document.body.setAttribute(ae, (st() + 1).toString()), function() {
847
- var e = st() - 1;
848
- e <= 0 ? document.body.removeAttribute(ae) : document.body.setAttribute(ae, e.toString());
849
- };
850
- }, []);
851
- }, yr = function(e) {
852
- var t = e.noRelative, n = e.noImportant, r = e.gapMode, o = r === void 0 ? "margin" : r;
853
- gr();
854
- var i = a.useMemo(function() {
855
- return vr(o);
856
- }, [o]);
857
- return a.createElement(pr, { styles: hr(i, !t, o, n ? "" : "!important") });
858
- }, Ue = !1;
859
- if (typeof window < "u")
860
- try {
861
- var ve = Object.defineProperty({}, "passive", {
862
- get: function() {
863
- return Ue = !0, !0;
864
- }
865
- });
866
- window.addEventListener("test", ve, ve), window.removeEventListener("test", ve, ve);
867
- } catch {
868
- Ue = !1;
869
- }
870
- var J = Ue ? { passive: !1 } : !1, Er = function(e) {
871
- return e.tagName === "TEXTAREA";
872
- }, Nt = function(e, t) {
873
- if (!(e instanceof Element))
874
- return !1;
875
- var n = window.getComputedStyle(e);
876
- return (
877
- // not-not-scrollable
878
- n[t] !== "hidden" && // contains scroll inside self
879
- !(n.overflowY === n.overflowX && !Er(e) && n[t] === "visible")
880
- );
881
- }, br = function(e) {
882
- return Nt(e, "overflowY");
883
- }, wr = function(e) {
884
- return Nt(e, "overflowX");
885
- }, lt = function(e, t) {
886
- var n = t.ownerDocument, r = t;
887
- do {
888
- typeof ShadowRoot < "u" && r instanceof ShadowRoot && (r = r.host);
889
- var o = Ot(e, r);
890
- if (o) {
891
- var i = It(e, r), u = i[1], c = i[2];
892
- if (u > c)
893
- return !0;
894
- }
895
- r = r.parentNode;
896
- } while (r && r !== n.body);
897
- return !1;
898
- }, Cr = function(e) {
899
- var t = e.scrollTop, n = e.scrollHeight, r = e.clientHeight;
900
- return [
901
- t,
902
- n,
903
- r
904
- ];
905
- }, Sr = function(e) {
906
- var t = e.scrollLeft, n = e.scrollWidth, r = e.clientWidth;
907
- return [
908
- t,
909
- n,
910
- r
911
- ];
912
- }, Ot = function(e, t) {
913
- return e === "v" ? br(t) : wr(t);
914
- }, It = function(e, t) {
915
- return e === "v" ? Cr(t) : Sr(t);
916
- }, Rr = function(e, t) {
917
- return e === "h" && t === "rtl" ? -1 : 1;
918
- }, _r = function(e, t, n, r, o) {
919
- var i = Rr(e, window.getComputedStyle(t).direction), u = i * r, c = n.target, m = t.contains(c), s = !1, d = u > 0, f = 0, p = 0;
920
- do {
921
- if (!c)
922
- break;
923
- var h = It(e, c), _ = h[0], v = h[1], y = h[2], C = v - y - i * _;
924
- (_ || C) && Ot(e, c) && (f += C, p += _);
925
- var D = c.parentNode;
926
- c = D && D.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? D.host : D;
927
- } while (
928
- // portaled content
929
- !m && c !== document.body || // self content
930
- m && (t.contains(c) || t === c)
931
- );
932
- return (d && Math.abs(f) < 1 || !d && Math.abs(p) < 1) && (s = !0), s;
933
- }, pe = function(e) {
934
- return "changedTouches" in e ? [e.changedTouches[0].clientX, e.changedTouches[0].clientY] : [0, 0];
935
- }, dt = function(e) {
936
- return [e.deltaX, e.deltaY];
937
- }, ft = function(e) {
938
- return e && "current" in e ? e.current : e;
939
- }, Dr = function(e, t) {
940
- return e[0] === t[0] && e[1] === t[1];
941
- }, Pr = function(e) {
942
- return `
943
- .block-interactivity-`.concat(e, ` {pointer-events: none;}
944
- .allow-interactivity-`).concat(e, ` {pointer-events: all;}
945
- `);
946
- }, Nr = 0, ee = [];
947
- function Or(e) {
948
- var t = a.useRef([]), n = a.useRef([0, 0]), r = a.useRef(), o = a.useState(Nr++)[0], i = a.useState(Pt)[0], u = a.useRef(e);
949
- a.useEffect(function() {
950
- u.current = e;
951
- }, [e]), a.useEffect(function() {
952
- if (e.inert) {
953
- document.body.classList.add("block-interactivity-".concat(o));
954
- var v = qn([e.lockRef.current], (e.shards || []).map(ft), !0).filter(Boolean);
955
- return v.forEach(function(y) {
956
- return y.classList.add("allow-interactivity-".concat(o));
957
- }), function() {
958
- document.body.classList.remove("block-interactivity-".concat(o)), v.forEach(function(y) {
959
- return y.classList.remove("allow-interactivity-".concat(o));
960
- });
961
- };
962
- }
963
- }, [e.inert, e.lockRef.current, e.shards]);
964
- var c = a.useCallback(function(v, y) {
965
- if ("touches" in v && v.touches.length === 2 || v.type === "wheel" && v.ctrlKey)
966
- return !u.current.allowPinchZoom;
967
- var C = pe(v), D = n.current, I = "deltaX" in v ? v.deltaX : D[0] - C[0], P = "deltaY" in v ? v.deltaY : D[1] - C[1], N, S = v.target, b = Math.abs(I) > Math.abs(P) ? "h" : "v";
968
- if ("touches" in v && b === "h" && S.type === "range")
969
- return !1;
970
- var k = window.getSelection(), F = k && k.anchorNode, W = F ? F === S || F.contains(S) : !1;
971
- if (W)
972
- return !1;
973
- var V = lt(b, S);
974
- if (!V)
975
- return !0;
976
- if (V ? N = b : (N = b === "v" ? "h" : "v", V = lt(b, S)), !V)
977
- return !1;
978
- if (!r.current && "changedTouches" in v && (I || P) && (r.current = N), !N)
979
- return !0;
980
- var Z = r.current || N;
981
- return _r(Z, y, v, Z === "h" ? I : P);
982
- }, []), m = a.useCallback(function(v) {
983
- var y = v;
984
- if (!(!ee.length || ee[ee.length - 1] !== i)) {
985
- var C = "deltaY" in y ? dt(y) : pe(y), D = t.current.filter(function(N) {
986
- return N.name === y.type && (N.target === y.target || y.target === N.shadowParent) && Dr(N.delta, C);
987
- })[0];
988
- if (D && D.should) {
989
- y.cancelable && y.preventDefault();
990
- return;
991
- }
992
- if (!D) {
993
- var I = (u.current.shards || []).map(ft).filter(Boolean).filter(function(N) {
994
- return N.contains(y.target);
995
- }), P = I.length > 0 ? c(y, I[0]) : !u.current.noIsolation;
996
- P && y.cancelable && y.preventDefault();
997
- }
998
- }
999
- }, []), s = a.useCallback(function(v, y, C, D) {
1000
- var I = { name: v, delta: y, target: C, should: D, shadowParent: Ir(C) };
1001
- t.current.push(I), setTimeout(function() {
1002
- t.current = t.current.filter(function(P) {
1003
- return P !== I;
1004
- });
1005
- }, 1);
1006
- }, []), d = a.useCallback(function(v) {
1007
- n.current = pe(v), r.current = void 0;
1008
- }, []), f = a.useCallback(function(v) {
1009
- s(v.type, dt(v), v.target, c(v, e.lockRef.current));
1010
- }, []), p = a.useCallback(function(v) {
1011
- s(v.type, pe(v), v.target, c(v, e.lockRef.current));
1012
- }, []);
1013
- a.useEffect(function() {
1014
- return ee.push(i), e.setCallbacks({
1015
- onScrollCapture: f,
1016
- onWheelCapture: f,
1017
- onTouchMoveCapture: p
1018
- }), document.addEventListener("wheel", m, J), document.addEventListener("touchmove", m, J), document.addEventListener("touchstart", d, J), function() {
1019
- ee = ee.filter(function(v) {
1020
- return v !== i;
1021
- }), document.removeEventListener("wheel", m, J), document.removeEventListener("touchmove", m, J), document.removeEventListener("touchstart", d, J);
1022
- };
1023
- }, []);
1024
- var h = e.removeScrollBar, _ = e.inert;
1025
- return a.createElement(
1026
- a.Fragment,
1027
- null,
1028
- _ ? a.createElement(i, { styles: Pr(o) }) : null,
1029
- h ? a.createElement(yr, { noRelative: e.noRelative, gapMode: e.gapMode }) : null
1030
- );
1031
- }
1032
- function Ir(e) {
1033
- for (var t = null; e !== null; )
1034
- e instanceof ShadowRoot && (t = e.host, e = e.host), e = e.parentNode;
1035
- return t;
1036
- }
1037
- const Ar = ar(Dt, Or);
1038
- var At = a.forwardRef(function(e, t) {
1039
- return a.createElement(Se, L({}, e, { ref: t, sideCar: Ar }));
1040
- });
1041
- At.classNames = Se.classNames;
1042
- var xr = function(e) {
1043
- if (typeof document > "u")
1044
- return null;
1045
- var t = Array.isArray(e) ? e[0] : e;
1046
- return t.ownerDocument.body;
1047
- }, te = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), ge = {}, Le = 0, xt = function(e) {
1048
- return e && (e.host || xt(e.parentNode));
1049
- }, Mr = function(e, t) {
1050
- return t.map(function(n) {
1051
- if (e.contains(n))
1052
- return n;
1053
- var r = xt(n);
1054
- return r && e.contains(r) ? r : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
1055
- }).filter(function(n) {
1056
- return !!n;
1057
- });
1058
- }, kr = function(e, t, n, r) {
1059
- var o = Mr(t, Array.isArray(e) ? e : [e]);
1060
- ge[n] || (ge[n] = /* @__PURE__ */ new WeakMap());
1061
- var i = ge[n], u = [], c = /* @__PURE__ */ new Set(), m = new Set(o), s = function(f) {
1062
- !f || c.has(f) || (c.add(f), s(f.parentNode));
1063
- };
1064
- o.forEach(s);
1065
- var d = function(f) {
1066
- !f || m.has(f) || Array.prototype.forEach.call(f.children, function(p) {
1067
- if (c.has(p))
1068
- d(p);
1069
- else
1070
- try {
1071
- var h = p.getAttribute(r), _ = h !== null && h !== "false", v = (te.get(p) || 0) + 1, y = (i.get(p) || 0) + 1;
1072
- te.set(p, v), i.set(p, y), u.push(p), v === 1 && _ && he.set(p, !0), y === 1 && p.setAttribute(n, "true"), _ || p.setAttribute(r, "true");
1073
- } catch (C) {
1074
- console.error("aria-hidden: cannot operate on ", p, C);
1075
- }
1076
- });
1077
- };
1078
- return d(t), c.clear(), Le++, function() {
1079
- u.forEach(function(f) {
1080
- var p = te.get(f) - 1, h = i.get(f) - 1;
1081
- te.set(f, p), i.set(f, h), p || (he.has(f) || f.removeAttribute(r), he.delete(f)), h || f.removeAttribute(n);
1082
- }), Le--, Le || (te = /* @__PURE__ */ new WeakMap(), te = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), ge = {});
1083
- };
1084
- }, Tr = function(e, t, n) {
1085
- n === void 0 && (n = "data-aria-hidden");
1086
- var r = Array.from(Array.isArray(e) ? e : [e]), o = xr(e);
1087
- return o ? (r.push.apply(r, Array.from(o.querySelectorAll("[aria-live], script"))), kr(r, o, n, "aria-hidden")) : function() {
1088
- return null;
1089
- };
1090
- }, Re = "Dialog", [Mt] = pn(Re), [Lr, T] = Mt(Re), kt = (e) => {
1091
- const {
1092
- __scopeDialog: t,
1093
- children: n,
1094
- open: r,
1095
- defaultOpen: o,
1096
- onOpenChange: i,
1097
- modal: u = !0
1098
- } = e, c = a.useRef(null), m = a.useRef(null), [s, d] = bn({
1099
- prop: r,
1100
- defaultProp: o ?? !1,
1101
- onChange: i,
1102
- caller: Re
1103
- });
1104
- return /* @__PURE__ */ E(
1105
- Lr,
1106
- {
1107
- scope: t,
1108
- triggerRef: c,
1109
- contentRef: m,
1110
- contentId: $(),
1111
- titleId: $(),
1112
- descriptionId: $(),
1113
- open: s,
1114
- onOpenChange: d,
1115
- onOpenToggle: a.useCallback(() => d((f) => !f), [d]),
1116
- modal: u,
1117
- children: n
1118
- }
1119
- );
1120
- };
1121
- kt.displayName = Re;
1122
- var Tt = "DialogTrigger", Fr = a.forwardRef(
1123
- (e, t) => {
1124
- const { __scopeDialog: n, ...r } = e, o = T(Tt, n), i = q(t, o.triggerRef);
1125
- return /* @__PURE__ */ E(
1126
- U.button,
1127
- {
1128
- type: "button",
1129
- "aria-haspopup": "dialog",
1130
- "aria-expanded": o.open,
1131
- "aria-controls": o.contentId,
1132
- "data-state": He(o.open),
1133
- ...r,
1134
- ref: i,
1135
- onClick: j(e.onClick, o.onOpenToggle)
1136
- }
1137
- );
1138
- }
1139
- );
1140
- Fr.displayName = Tt;
1141
- var Ke = "DialogPortal", [Wr, Lt] = Mt(Ke, {
1142
- forceMount: void 0
1143
- }), Ft = (e) => {
1144
- const { __scopeDialog: t, forceMount: n, children: r, container: o } = e, i = T(Ke, t);
1145
- return /* @__PURE__ */ E(Wr, { scope: t, forceMount: n, children: a.Children.map(r, (u) => /* @__PURE__ */ E(Ce, { present: n || i.open, children: /* @__PURE__ */ E(St, { asChild: !0, container: o, children: u }) })) });
1146
- };
1147
- Ft.displayName = Ke;
1148
- var we = "DialogOverlay", Wt = a.forwardRef(
1149
- (e, t) => {
1150
- const n = Lt(we, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = T(we, e.__scopeDialog);
1151
- return i.modal ? /* @__PURE__ */ E(Ce, { present: r || i.open, children: /* @__PURE__ */ E($r, { ...o, ref: t }) }) : null;
1152
- }
1153
- );
1154
- Wt.displayName = we;
1155
- var Br = /* @__PURE__ */ gt("DialogOverlay.RemoveScroll"), $r = a.forwardRef(
1156
- (e, t) => {
1157
- const { __scopeDialog: n, ...r } = e, o = T(we, n);
1158
- return (
1159
- // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
1160
- // ie. when `Overlay` and `Content` are siblings
1161
- /* @__PURE__ */ E(At, { as: Br, allowPinchZoom: !0, shards: [o.contentRef], children: /* @__PURE__ */ E(
1162
- U.div,
1163
- {
1164
- "data-state": He(o.open),
1165
- ...r,
1166
- ref: t,
1167
- style: { pointerEvents: "auto", ...r.style }
1168
- }
1169
- ) })
1170
- );
1171
- }
1172
- ), Y = "DialogContent", Bt = a.forwardRef(
1173
- (e, t) => {
1174
- const n = Lt(Y, e.__scopeDialog), { forceMount: r = n.forceMount, ...o } = e, i = T(Y, e.__scopeDialog);
1175
- return /* @__PURE__ */ E(Ce, { present: r || i.open, children: i.modal ? /* @__PURE__ */ E(Ur, { ...o, ref: t }) : /* @__PURE__ */ E(Vr, { ...o, ref: t }) });
1176
- }
1177
- );
1178
- Bt.displayName = Y;
1179
- var Ur = a.forwardRef(
1180
- (e, t) => {
1181
- const n = T(Y, e.__scopeDialog), r = a.useRef(null), o = q(t, n.contentRef, r);
1182
- return a.useEffect(() => {
1183
- const i = r.current;
1184
- if (i) return Tr(i);
1185
- }, []), /* @__PURE__ */ E(
1186
- $t,
1187
- {
1188
- ...e,
1189
- ref: o,
1190
- trapFocus: n.open,
1191
- disableOutsidePointerEvents: !0,
1192
- onCloseAutoFocus: j(e.onCloseAutoFocus, (i) => {
1193
- i.preventDefault(), n.triggerRef.current?.focus();
1194
- }),
1195
- onPointerDownOutside: j(e.onPointerDownOutside, (i) => {
1196
- const u = i.detail.originalEvent, c = u.button === 0 && u.ctrlKey === !0;
1197
- (u.button === 2 || c) && i.preventDefault();
1198
- }),
1199
- onFocusOutside: j(
1200
- e.onFocusOutside,
1201
- (i) => i.preventDefault()
1202
- )
1203
- }
1204
- );
1205
- }
1206
- ), Vr = a.forwardRef(
1207
- (e, t) => {
1208
- const n = T(Y, e.__scopeDialog), r = a.useRef(!1), o = a.useRef(!1);
1209
- return /* @__PURE__ */ E(
1210
- $t,
1211
- {
1212
- ...e,
1213
- ref: t,
1214
- trapFocus: !1,
1215
- disableOutsidePointerEvents: !1,
1216
- onCloseAutoFocus: (i) => {
1217
- e.onCloseAutoFocus?.(i), i.defaultPrevented || (r.current || n.triggerRef.current?.focus(), i.preventDefault()), r.current = !1, o.current = !1;
1218
- },
1219
- onInteractOutside: (i) => {
1220
- e.onInteractOutside?.(i), i.defaultPrevented || (r.current = !0, i.detail.originalEvent.type === "pointerdown" && (o.current = !0));
1221
- const u = i.target;
1222
- n.triggerRef.current?.contains(u) && i.preventDefault(), i.detail.originalEvent.type === "focusin" && o.current && i.preventDefault();
1223
- }
1224
- }
1225
- );
1226
- }
1227
- ), $t = a.forwardRef(
1228
- (e, t) => {
1229
- const { __scopeDialog: n, trapFocus: r, onOpenAutoFocus: o, onCloseAutoFocus: i, ...u } = e, c = T(Y, n), m = a.useRef(null), s = q(t, m);
1230
- return Xn(), /* @__PURE__ */ oe(Qe, { children: [
1231
- /* @__PURE__ */ E(
1232
- wt,
1233
- {
1234
- asChild: !0,
1235
- loop: !0,
1236
- trapped: r,
1237
- onMountAutoFocus: o,
1238
- onUnmountAutoFocus: i,
1239
- children: /* @__PURE__ */ E(
1240
- Et,
1241
- {
1242
- role: "dialog",
1243
- id: c.contentId,
1244
- "aria-describedby": c.descriptionId,
1245
- "aria-labelledby": c.titleId,
1246
- "data-state": He(c.open),
1247
- ...u,
1248
- ref: s,
1249
- onDismiss: () => c.onOpenChange(!1)
1250
- }
1251
- )
1252
- }
1253
- ),
1254
- /* @__PURE__ */ oe(Qe, { children: [
1255
- /* @__PURE__ */ E(Gr, { titleId: c.titleId }),
1256
- /* @__PURE__ */ E(Yr, { contentRef: m, descriptionId: c.descriptionId })
1257
- ] })
1258
- ] });
1259
- }
1260
- ), je = "DialogTitle", Kr = a.forwardRef(
1261
- (e, t) => {
1262
- const { __scopeDialog: n, ...r } = e, o = T(je, n);
1263
- return /* @__PURE__ */ E(U.h2, { id: o.titleId, ...r, ref: t });
1264
- }
1265
- );
1266
- Kr.displayName = je;
1267
- var Ut = "DialogDescription", jr = a.forwardRef(
1268
- (e, t) => {
1269
- const { __scopeDialog: n, ...r } = e, o = T(Ut, n);
1270
- return /* @__PURE__ */ E(U.p, { id: o.descriptionId, ...r, ref: t });
1271
- }
1272
- );
1273
- jr.displayName = Ut;
1274
- var Vt = "DialogClose", Hr = a.forwardRef(
1275
- (e, t) => {
1276
- const { __scopeDialog: n, ...r } = e, o = T(Vt, n);
1277
- return /* @__PURE__ */ E(
1278
- U.button,
1279
- {
1280
- type: "button",
1281
- ...r,
1282
- ref: t,
1283
- onClick: j(e.onClick, () => o.onOpenChange(!1))
1284
- }
1285
- );
1286
- }
1287
- );
1288
- Hr.displayName = Vt;
1289
- function He(e) {
1290
- return e ? "open" : "closed";
1291
- }
1292
- var Kt = "DialogTitleWarning", [Mo, jt] = vn(Kt, {
1293
- contentName: Y,
1294
- titleName: je,
1295
- docsSlug: "dialog"
1296
- }), Gr = ({ titleId: e }) => {
1297
- const t = jt(Kt), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
1298
-
1299
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
1300
-
1301
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
1302
- return a.useEffect(() => {
1303
- e && (document.getElementById(e) || console.error(n));
1304
- }, [n, e]), null;
1305
- }, zr = "DialogDescriptionWarning", Yr = ({ contentRef: e, descriptionId: t }) => {
1306
- const r = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${jt(zr).contentName}}.`;
1307
- return a.useEffect(() => {
1308
- const o = e.current?.getAttribute("aria-describedby");
1309
- t && o && (document.getElementById(t) || console.warn(r));
1310
- }, [r, e, t]), null;
1311
- }, Xr = kt, qr = Ft, Zr = Wt, Qr = Bt, ue = '[cmdk-group=""]', Fe = '[cmdk-group-items=""]', Jr = '[cmdk-group-heading=""]', Ht = '[cmdk-item=""]', mt = `${Ht}:not([aria-disabled="true"])`, Ve = "cmdk-item-select", ne = "data-value", eo = (e, t, n) => mn(e, t, n), Gt = a.createContext(void 0), de = () => a.useContext(Gt), zt = a.createContext(void 0), Ge = () => a.useContext(zt), Yt = a.createContext(void 0), Xt = a.forwardRef((e, t) => {
1312
- let n = re(() => {
1313
- var l, w;
1314
- return { search: "", value: (w = (l = e.value) != null ? l : e.defaultValue) != null ? w : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
1315
- }), r = re(() => /* @__PURE__ */ new Set()), o = re(() => /* @__PURE__ */ new Map()), i = re(() => /* @__PURE__ */ new Map()), u = re(() => /* @__PURE__ */ new Set()), c = qt(e), { label: m, children: s, value: d, onValueChange: f, filter: p, shouldFilter: h, loop: _, disablePointerSelection: v = !1, vimBindings: y = !0, ...C } = e, D = $(), I = $(), P = $(), N = a.useRef(null), S = fo();
1316
- X(() => {
1317
- if (d !== void 0) {
1318
- let l = d.trim();
1319
- n.current.value = l, b.emit();
1320
- }
1321
- }, [d]), X(() => {
1322
- S(6, ze);
1323
- }, []);
1324
- let b = a.useMemo(() => ({ subscribe: (l) => (u.current.add(l), () => u.current.delete(l)), snapshot: () => n.current, setState: (l, w, R) => {
1325
- var g, O, A, M;
1326
- if (!Object.is(n.current[l], w)) {
1327
- if (n.current[l] = w, l === "search") Z(), W(), S(1, V);
1328
- else if (l === "value") {
1329
- if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
1330
- let x = document.getElementById(P);
1331
- x ? x.focus() : (g = document.getElementById(D)) == null || g.focus();
1332
- }
1333
- if (S(7, () => {
1334
- var x;
1335
- n.current.selectedItemId = (x = Q()) == null ? void 0 : x.id, b.emit();
1336
- }), R || S(5, ze), ((O = c.current) == null ? void 0 : O.value) !== void 0) {
1337
- let x = w ?? "";
1338
- (M = (A = c.current).onValueChange) == null || M.call(A, x);
1339
- return;
1340
- }
1341
- }
1342
- b.emit();
1343
- }
1344
- }, emit: () => {
1345
- u.current.forEach((l) => l());
1346
- } }), []), k = a.useMemo(() => ({ value: (l, w, R) => {
1347
- var g;
1348
- w !== ((g = i.current.get(l)) == null ? void 0 : g.value) && (i.current.set(l, { value: w, keywords: R }), n.current.filtered.items.set(l, F(w, R)), S(2, () => {
1349
- W(), b.emit();
1350
- }));
1351
- }, item: (l, w) => (r.current.add(l), w && (o.current.has(w) ? o.current.get(w).add(l) : o.current.set(w, /* @__PURE__ */ new Set([l]))), S(3, () => {
1352
- Z(), W(), n.current.value || V(), b.emit();
1353
- }), () => {
1354
- i.current.delete(l), r.current.delete(l), n.current.filtered.items.delete(l);
1355
- let R = Q();
1356
- S(4, () => {
1357
- Z(), R?.getAttribute("id") === l && V(), b.emit();
1358
- });
1359
- }), group: (l) => (o.current.has(l) || o.current.set(l, /* @__PURE__ */ new Set()), () => {
1360
- i.current.delete(l), o.current.delete(l);
1361
- }), filter: () => c.current.shouldFilter, label: m || e["aria-label"], getDisablePointerSelection: () => c.current.disablePointerSelection, listId: D, inputId: P, labelId: I, listInnerRef: N }), []);
1362
- function F(l, w) {
1363
- var R, g;
1364
- let O = (g = (R = c.current) == null ? void 0 : R.filter) != null ? g : eo;
1365
- return l ? O(l, n.current.search, w) : 0;
1366
- }
1367
- function W() {
1368
- if (!n.current.search || c.current.shouldFilter === !1) return;
1369
- let l = n.current.filtered.items, w = [];
1370
- n.current.filtered.groups.forEach((g) => {
1371
- let O = o.current.get(g), A = 0;
1372
- O.forEach((M) => {
1373
- let x = l.get(M);
1374
- A = Math.max(x, A);
1375
- }), w.push([g, A]);
1376
- });
1377
- let R = N.current;
1378
- ce().sort((g, O) => {
1379
- var A, M;
1380
- let x = g.getAttribute("id"), fe = O.getAttribute("id");
1381
- return ((A = l.get(fe)) != null ? A : 0) - ((M = l.get(x)) != null ? M : 0);
1382
- }).forEach((g) => {
1383
- let O = g.closest(Fe);
1384
- O ? O.appendChild(g.parentElement === O ? g : g.closest(`${Fe} > *`)) : R.appendChild(g.parentElement === R ? g : g.closest(`${Fe} > *`));
1385
- }), w.sort((g, O) => O[1] - g[1]).forEach((g) => {
1386
- var O;
1387
- let A = (O = N.current) == null ? void 0 : O.querySelector(`${ue}[${ne}="${encodeURIComponent(g[0])}"]`);
1388
- A?.parentElement.appendChild(A);
1389
- });
1390
- }
1391
- function V() {
1392
- let l = ce().find((R) => R.getAttribute("aria-disabled") !== "true"), w = l?.getAttribute(ne);
1393
- b.setState("value", w || void 0);
1394
- }
1395
- function Z() {
1396
- var l, w, R, g;
1397
- if (!n.current.search || c.current.shouldFilter === !1) {
1398
- n.current.filtered.count = r.current.size;
1399
- return;
1400
- }
1401
- n.current.filtered.groups = /* @__PURE__ */ new Set();
1402
- let O = 0;
1403
- for (let A of r.current) {
1404
- let M = (w = (l = i.current.get(A)) == null ? void 0 : l.value) != null ? w : "", x = (g = (R = i.current.get(A)) == null ? void 0 : R.keywords) != null ? g : [], fe = F(M, x);
1405
- n.current.filtered.items.set(A, fe), fe > 0 && O++;
1406
- }
1407
- for (let [A, M] of o.current) for (let x of M) if (n.current.filtered.items.get(x) > 0) {
1408
- n.current.filtered.groups.add(A);
1409
- break;
1410
- }
1411
- n.current.filtered.count = O;
1412
- }
1413
- function ze() {
1414
- var l, w, R;
1415
- let g = Q();
1416
- g && (((l = g.parentElement) == null ? void 0 : l.firstChild) === g && ((R = (w = g.closest(ue)) == null ? void 0 : w.querySelector(Jr)) == null || R.scrollIntoView({ block: "nearest" })), g.scrollIntoView({ block: "nearest" }));
1417
- }
1418
- function Q() {
1419
- var l;
1420
- return (l = N.current) == null ? void 0 : l.querySelector(`${Ht}[aria-selected="true"]`);
1421
- }
1422
- function ce() {
1423
- var l;
1424
- return Array.from(((l = N.current) == null ? void 0 : l.querySelectorAll(mt)) || []);
1425
- }
1426
- function De(l) {
1427
- let w = ce()[l];
1428
- w && b.setState("value", w.getAttribute(ne));
1429
- }
1430
- function Pe(l) {
1431
- var w;
1432
- let R = Q(), g = ce(), O = g.findIndex((M) => M === R), A = g[O + l];
1433
- (w = c.current) != null && w.loop && (A = O + l < 0 ? g[g.length - 1] : O + l === g.length ? g[0] : g[O + l]), A && b.setState("value", A.getAttribute(ne));
1434
- }
1435
- function Ye(l) {
1436
- let w = Q(), R = w?.closest(ue), g;
1437
- for (; R && !g; ) R = l > 0 ? so(R, ue) : lo(R, ue), g = R?.querySelector(mt);
1438
- g ? b.setState("value", g.getAttribute(ne)) : Pe(l);
1439
- }
1440
- let Xe = () => De(ce().length - 1), qe = (l) => {
1441
- l.preventDefault(), l.metaKey ? Xe() : l.altKey ? Ye(1) : Pe(1);
1442
- }, Ze = (l) => {
1443
- l.preventDefault(), l.metaKey ? De(0) : l.altKey ? Ye(-1) : Pe(-1);
1444
- };
1445
- return a.createElement(G.div, { ref: t, tabIndex: -1, ...C, "cmdk-root": "", onKeyDown: (l) => {
1446
- var w;
1447
- (w = C.onKeyDown) == null || w.call(C, l);
1448
- let R = l.nativeEvent.isComposing || l.keyCode === 229;
1449
- if (!(l.defaultPrevented || R)) switch (l.key) {
1450
- case "n":
1451
- case "j": {
1452
- y && l.ctrlKey && qe(l);
1453
- break;
1454
- }
1455
- case "ArrowDown": {
1456
- qe(l);
1457
- break;
1458
- }
1459
- case "p":
1460
- case "k": {
1461
- y && l.ctrlKey && Ze(l);
1462
- break;
1463
- }
1464
- case "ArrowUp": {
1465
- Ze(l);
1466
- break;
1467
- }
1468
- case "Home": {
1469
- l.preventDefault(), De(0);
1470
- break;
1471
- }
1472
- case "End": {
1473
- l.preventDefault(), Xe();
1474
- break;
1475
- }
1476
- case "Enter": {
1477
- l.preventDefault();
1478
- let g = Q();
1479
- if (g) {
1480
- let O = new Event(Ve);
1481
- g.dispatchEvent(O);
1482
- }
1483
- }
1484
- }
1485
- } }, a.createElement("label", { "cmdk-label": "", htmlFor: k.inputId, id: k.labelId, style: vo }, m), _e(e, (l) => a.createElement(zt.Provider, { value: b }, a.createElement(Gt.Provider, { value: k }, l))));
1486
- }), to = a.forwardRef((e, t) => {
1487
- var n, r;
1488
- let o = $(), i = a.useRef(null), u = a.useContext(Yt), c = de(), m = qt(e), s = (r = (n = m.current) == null ? void 0 : n.forceMount) != null ? r : u?.forceMount;
1489
- X(() => {
1490
- if (!s) return c.item(o, u?.id);
1491
- }, [s]);
1492
- let d = Zt(o, i, [e.value, e.children, i], e.keywords), f = Ge(), p = H((S) => S.value && S.value === d.current), h = H((S) => s || c.filter() === !1 ? !0 : S.search ? S.filtered.items.get(o) > 0 : !0);
1493
- a.useEffect(() => {
1494
- let S = i.current;
1495
- if (!(!S || e.disabled)) return S.addEventListener(Ve, _), () => S.removeEventListener(Ve, _);
1496
- }, [h, e.onSelect, e.disabled]);
1497
- function _() {
1498
- var S, b;
1499
- v(), (b = (S = m.current).onSelect) == null || b.call(S, d.current);
1500
- }
1501
- function v() {
1502
- f.setState("value", d.current, !0);
1503
- }
1504
- if (!h) return null;
1505
- let { disabled: y, value: C, onSelect: D, forceMount: I, keywords: P, ...N } = e;
1506
- return a.createElement(G.div, { ref: ie(i, t), ...N, id: o, "cmdk-item": "", role: "option", "aria-disabled": !!y, "aria-selected": !!p, "data-disabled": y ? !0 : void 0, "data-selected": y ? !0 : void 0, onPointerMove: y || c.getDisablePointerSelection() ? void 0 : v, onClick: y ? void 0 : _ }, e.children);
1507
- }), no = a.forwardRef((e, t) => {
1508
- let { heading: n, children: r, forceMount: o, ...i } = e, u = $(), c = a.useRef(null), m = a.useRef(null), s = $(), d = de(), f = H((h) => o || d.filter() === !1 ? !0 : h.search ? h.filtered.groups.has(u) : !0);
1509
- X(() => d.group(u), []), Zt(u, c, [e.value, e.heading, m]);
1510
- let p = a.useMemo(() => ({ id: u, forceMount: o }), [o]);
1511
- return a.createElement(G.div, { ref: ie(c, t), ...i, "cmdk-group": "", role: "presentation", hidden: f ? void 0 : !0 }, n && a.createElement("div", { ref: m, "cmdk-group-heading": "", "aria-hidden": !0, id: s }, n), _e(e, (h) => a.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? s : void 0 }, a.createElement(Yt.Provider, { value: p }, h))));
1512
- }), ro = a.forwardRef((e, t) => {
1513
- let { alwaysRender: n, ...r } = e, o = a.useRef(null), i = H((u) => !u.search);
1514
- return !n && !i ? null : a.createElement(G.div, { ref: ie(o, t), ...r, "cmdk-separator": "", role: "separator" });
1515
- }), oo = a.forwardRef((e, t) => {
1516
- let { onValueChange: n, ...r } = e, o = e.value != null, i = Ge(), u = H((s) => s.search), c = H((s) => s.selectedItemId), m = de();
1517
- return a.useEffect(() => {
1518
- e.value != null && i.setState("search", e.value);
1519
- }, [e.value]), a.createElement(G.input, { ref: t, ...r, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: !1, "aria-autocomplete": "list", role: "combobox", "aria-expanded": !0, "aria-controls": m.listId, "aria-labelledby": m.labelId, "aria-activedescendant": c, id: m.inputId, type: "text", value: o ? e.value : u, onChange: (s) => {
1520
- o || i.setState("search", s.target.value), n?.(s.target.value);
1521
- } });
1522
- }), ao = a.forwardRef((e, t) => {
1523
- let { children: n, label: r = "Suggestions", ...o } = e, i = a.useRef(null), u = a.useRef(null), c = H((s) => s.selectedItemId), m = de();
1524
- return a.useEffect(() => {
1525
- if (u.current && i.current) {
1526
- let s = u.current, d = i.current, f, p = new ResizeObserver(() => {
1527
- f = requestAnimationFrame(() => {
1528
- let h = s.offsetHeight;
1529
- d.style.setProperty("--cmdk-list-height", h.toFixed(1) + "px");
1530
- });
1531
- });
1532
- return p.observe(s), () => {
1533
- cancelAnimationFrame(f), p.unobserve(s);
1534
- };
1535
- }
1536
- }, []), a.createElement(G.div, { ref: ie(i, t), ...o, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": c, "aria-label": r, id: m.listId }, _e(e, (s) => a.createElement("div", { ref: ie(u, m.listInnerRef), "cmdk-list-sizer": "" }, s)));
1537
- }), io = a.forwardRef((e, t) => {
1538
- let { open: n, onOpenChange: r, overlayClassName: o, contentClassName: i, container: u, ...c } = e;
1539
- return a.createElement(Xr, { open: n, onOpenChange: r }, a.createElement(qr, { container: u }, a.createElement(Zr, { "cmdk-overlay": "", className: o }), a.createElement(Qr, { "aria-label": e.label, "cmdk-dialog": "", className: i }, a.createElement(Xt, { ref: t, ...c }))));
1540
- }), co = a.forwardRef((e, t) => H((n) => n.filtered.count === 0) ? a.createElement(G.div, { ref: t, ...e, "cmdk-empty": "", role: "presentation" }) : null), uo = a.forwardRef((e, t) => {
1541
- let { progress: n, children: r, label: o = "Loading...", ...i } = e;
1542
- return a.createElement(G.div, { ref: t, ...i, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": o }, _e(e, (u) => a.createElement("div", { "aria-hidden": !0 }, u)));
1543
- }), z = Object.assign(Xt, { List: ao, Item: to, Input: oo, Group: no, Separator: ro, Dialog: io, Empty: co, Loading: uo });
1544
- function so(e, t) {
1545
- let n = e.nextElementSibling;
1546
- for (; n; ) {
1547
- if (n.matches(t)) return n;
1548
- n = n.nextElementSibling;
1549
- }
1550
- }
1551
- function lo(e, t) {
1552
- let n = e.previousElementSibling;
1553
- for (; n; ) {
1554
- if (n.matches(t)) return n;
1555
- n = n.previousElementSibling;
1556
- }
1557
- }
1558
- function qt(e) {
1559
- let t = a.useRef(e);
1560
- return X(() => {
1561
- t.current = e;
1562
- }), t;
1563
- }
1564
- var X = typeof window > "u" ? a.useEffect : a.useLayoutEffect;
1565
- function re(e) {
1566
- let t = a.useRef();
1567
- return t.current === void 0 && (t.current = e()), t;
1568
- }
1569
- function H(e) {
1570
- let t = Ge(), n = () => e(t.snapshot());
1571
- return a.useSyncExternalStore(t.subscribe, n, n);
1572
- }
1573
- function Zt(e, t, n, r = []) {
1574
- let o = a.useRef(), i = de();
1575
- return X(() => {
1576
- var u;
1577
- let c = (() => {
1578
- var s;
1579
- for (let d of n) {
1580
- if (typeof d == "string") return d.trim();
1581
- if (typeof d == "object" && "current" in d) return d.current ? (s = d.current.textContent) == null ? void 0 : s.trim() : o.current;
1582
- }
1583
- })(), m = r.map((s) => s.trim());
1584
- i.value(e, c, m), (u = t.current) == null || u.setAttribute(ne, c), o.current = c;
1585
- }), o;
1586
- }
1587
- var fo = () => {
1588
- let [e, t] = a.useState(), n = re(() => /* @__PURE__ */ new Map());
1589
- return X(() => {
1590
- n.current.forEach((r) => r()), n.current = /* @__PURE__ */ new Map();
1591
- }, [e]), (r, o) => {
1592
- n.current.set(r, o), t({});
1593
- };
1594
- };
1595
- function mo(e) {
1596
- let t = e.type;
1597
- return typeof t == "function" ? t(e.props) : "render" in t ? t.render(e.props) : e;
1598
- }
1599
- function _e({ asChild: e, children: t }, n) {
1600
- return e && a.isValidElement(t) ? a.cloneElement(mo(t), { ref: t.ref }, n(t.props.children)) : n(t);
1601
- }
1602
- var vo = { position: "absolute", width: "1px", height: "1px", padding: "0", margin: "-1px", overflow: "hidden", clip: "rect(0, 0, 0, 0)", whiteSpace: "nowrap", borderWidth: "0" };
1603
- const po = "_command_v9d1p_1", ho = "_command__empty_v9d1p_14", go = "_command__input_v9d1p_20", yo = "_command__list_v9d1p_51", Eo = "_command__group_v9d1p_61", bo = "_command__item_v9d1p_74", wo = "_command__shortcut_v9d1p_87", B = {
1604
- command: po,
1605
- command__empty: ho,
1606
- "command__input-root": "_command__input-root_v9d1p_20",
1607
- command__input: go,
1608
- "command__input-icon": "_command__input-icon_v9d1p_45",
1609
- command__list: yo,
1610
- command__group: Eo,
1611
- command__item: bo,
1612
- command__shortcut: wo
1613
- };
1614
- function ko({
1615
- placeholder: e,
1616
- children: t,
1617
- ...n
1618
- }) {
1619
- return /* @__PURE__ */ E(
1620
- nn,
1621
- {
1622
- width: "sm",
1623
- background: "default",
1624
- className: B.command,
1625
- closable: !0,
1626
- ...n,
1627
- children: /* @__PURE__ */ oe(z, { children: [
1628
- /* @__PURE__ */ oe(ye, { className: B["command__input-root"], children: [
1629
- /* @__PURE__ */ E(
1630
- ye,
1631
- {
1632
- interactive: "fill-outline",
1633
- className: B.command__input,
1634
- render: /* @__PURE__ */ E(z.Input, { placeholder: e })
1635
- }
1636
- ),
1637
- /* @__PURE__ */ E(vt, { name: "search-line", className: B["command__input-icon"] })
1638
- ] }),
1639
- /* @__PURE__ */ oe(z.List, { className: B.command__list, children: [
1640
- /* @__PURE__ */ E(z.Empty, { children: /* @__PURE__ */ E(ye, { className: B.command__empty, children: /* @__PURE__ */ E(pt, { color: "dimmer", children: "No results found." }) }) }),
1641
- t
1642
- ] })
1643
- ] })
1644
- }
1645
- );
1646
- }
1647
- function To({
1648
- className: e,
1649
- ...t
1650
- }) {
1651
- return /* @__PURE__ */ E(
1652
- z.Group,
1653
- {
1654
- className: We(B.command__group, e),
1655
- ...t
1656
- }
1657
- );
1658
- }
1659
- function Lo(e) {
1660
- return /* @__PURE__ */ E(rn, { render: /* @__PURE__ */ E(z.Separator, { ...e }) });
1661
- }
1662
- function Fo({
1663
- shortcut: e,
1664
- icon: t,
1665
- className: n,
1666
- children: r,
1667
- ...o
1668
- }) {
1669
- return /* @__PURE__ */ oe(
1670
- ye,
1671
- {
1672
- interactive: "list-item",
1673
- className: We(B.command__item, n),
1674
- render: /* @__PURE__ */ E(z.Item, { ...o }),
1675
- children: [
1676
- t ? /* @__PURE__ */ E(vt, { name: t }) : void 0,
1677
- tn(r),
1678
- e ? /* @__PURE__ */ E(
1679
- pt,
1680
- {
1681
- className: We(B.command__shortcut),
1682
- color: "dimmer",
1683
- size: "sm",
1684
- children: e
1685
- }
1686
- ) : null
1687
- ]
1688
- }
1689
- );
1690
- }
2
+ import { Command as o } from "./command.js";
1691
3
  export {
1692
- ko as CommandDialog,
1693
- To as CommandGroup,
1694
- Fo as CommandItem,
1695
- Lo as CommandSeparator
4
+ o as Command
1696
5
  };