@anoki/fse-ui 1.10.1-RC2 → 1.10.1-RC2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (312) hide show
  1. package/dist/components/ui/EditorialWidget/EditorialWidget.css +1 -1
  2. package/dist/components/ui/Section/Description/description.css +1 -1
  3. package/dist/index.cjs149.js +1 -1
  4. package/dist/index.cjs149.js.map +1 -1
  5. package/dist/index.cjs179.js +1 -1
  6. package/dist/index.cjs179.js.map +1 -1
  7. package/dist/index.cjs207.js +1 -1
  8. package/dist/index.cjs207.js.map +1 -1
  9. package/dist/index.cjs229.js +1 -1
  10. package/dist/index.cjs236.js +1 -1
  11. package/dist/index.cjs275.js +1 -1
  12. package/dist/index.cjs288.js +1 -1
  13. package/dist/index.cjs29.js +1 -1
  14. package/dist/index.cjs29.js.map +1 -1
  15. package/dist/index.cjs299.js +1 -1
  16. package/dist/index.cjs306.js +1 -1
  17. package/dist/index.cjs313.js +1 -1
  18. package/dist/index.cjs314.js +1 -1
  19. package/dist/index.cjs318.js +1 -1
  20. package/dist/index.cjs327.js +1 -1
  21. package/dist/index.cjs329.js +1 -1
  22. package/dist/index.cjs337.js +1 -1
  23. package/dist/index.cjs378.js +1 -1
  24. package/dist/index.cjs384.js +1 -1
  25. package/dist/index.cjs419.js +1 -1
  26. package/dist/index.cjs437.js +1 -1
  27. package/dist/index.cjs438.js +1 -1
  28. package/dist/index.cjs439.js +27 -1
  29. package/dist/index.cjs439.js.map +1 -1
  30. package/dist/index.cjs440.js +1 -2
  31. package/dist/index.cjs440.js.map +1 -1
  32. package/dist/index.cjs441.js +1 -27
  33. package/dist/index.cjs441.js.map +1 -1
  34. package/dist/index.cjs442.js +1 -1
  35. package/dist/index.cjs443.js +1 -1
  36. package/dist/index.cjs444.js +1 -1
  37. package/dist/index.cjs444.js.map +1 -1
  38. package/dist/index.cjs445.js +2 -1
  39. package/dist/index.cjs445.js.map +1 -1
  40. package/dist/index.cjs453.js +1 -1
  41. package/dist/index.cjs453.js.map +1 -1
  42. package/dist/index.cjs454.js +1 -1
  43. package/dist/index.cjs454.js.map +1 -1
  44. package/dist/index.cjs455.js +1 -1
  45. package/dist/index.cjs455.js.map +1 -1
  46. package/dist/index.cjs457.js +1 -1
  47. package/dist/index.cjs457.js.map +1 -1
  48. package/dist/index.cjs458.js +1 -1
  49. package/dist/index.cjs458.js.map +1 -1
  50. package/dist/index.cjs459.js +1 -1
  51. package/dist/index.cjs459.js.map +1 -1
  52. package/dist/index.cjs460.js +1 -1
  53. package/dist/index.cjs460.js.map +1 -1
  54. package/dist/index.cjs461.js +1 -1
  55. package/dist/index.cjs461.js.map +1 -1
  56. package/dist/index.cjs462.js +1 -1
  57. package/dist/index.cjs462.js.map +1 -1
  58. package/dist/index.cjs464.js +1 -1
  59. package/dist/index.cjs465.js +1 -1
  60. package/dist/index.cjs465.js.map +1 -1
  61. package/dist/index.cjs466.js +1 -1
  62. package/dist/index.cjs466.js.map +1 -1
  63. package/dist/index.cjs467.js +1 -1
  64. package/dist/index.cjs467.js.map +1 -1
  65. package/dist/index.cjs468.js +1 -1
  66. package/dist/index.cjs468.js.map +1 -1
  67. package/dist/index.cjs469.js +1 -1
  68. package/dist/index.cjs469.js.map +1 -1
  69. package/dist/index.cjs470.js +1 -1
  70. package/dist/index.cjs470.js.map +1 -1
  71. package/dist/index.cjs471.js +1 -1
  72. package/dist/index.cjs471.js.map +1 -1
  73. package/dist/index.cjs472.js +1 -1
  74. package/dist/index.cjs472.js.map +1 -1
  75. package/dist/index.cjs473.js +1 -1
  76. package/dist/index.cjs473.js.map +1 -1
  77. package/dist/index.cjs474.js +1 -1
  78. package/dist/index.cjs474.js.map +1 -1
  79. package/dist/index.cjs475.js +1 -1
  80. package/dist/index.cjs475.js.map +1 -1
  81. package/dist/index.cjs476.js +2 -0
  82. package/dist/index.cjs476.js.map +1 -0
  83. package/dist/{index.cjs479.js → index.cjs483.js} +2 -2
  84. package/dist/{index.cjs479.js.map → index.cjs483.js.map} +1 -1
  85. package/dist/{index.cjs480.js → index.cjs484.js} +2 -2
  86. package/dist/{index.cjs480.js.map → index.cjs484.js.map} +1 -1
  87. package/dist/{index.cjs481.js → index.cjs485.js} +2 -2
  88. package/dist/{index.cjs481.js.map → index.cjs485.js.map} +1 -1
  89. package/dist/{index.cjs482.js → index.cjs486.js} +2 -2
  90. package/dist/{index.cjs482.js.map → index.cjs486.js.map} +1 -1
  91. package/dist/{index.cjs488.js → index.cjs493.js} +1 -1
  92. package/dist/{index.cjs488.js.map → index.cjs493.js.map} +1 -1
  93. package/dist/index.cjs494.js +1 -1
  94. package/dist/index.cjs494.js.map +1 -1
  95. package/dist/index.cjs495.js +1 -1
  96. package/dist/index.cjs495.js.map +1 -1
  97. package/dist/index.cjs502.js +1 -1
  98. package/dist/index.cjs502.js.map +1 -1
  99. package/dist/index.cjs503.js +1 -1
  100. package/dist/index.cjs503.js.map +1 -1
  101. package/dist/index.cjs504.js +1 -1
  102. package/dist/index.cjs504.js.map +1 -1
  103. package/dist/{index.cjs498.js → index.cjs505.js} +2 -2
  104. package/dist/{index.cjs498.js.map → index.cjs505.js.map} +1 -1
  105. package/dist/{index.cjs499.js → index.cjs506.js} +2 -2
  106. package/dist/{index.cjs499.js.map → index.cjs506.js.map} +1 -1
  107. package/dist/index.cjs507.js +2 -0
  108. package/dist/index.cjs507.js.map +1 -0
  109. package/dist/index.cjs508.js +2 -0
  110. package/dist/index.cjs508.js.map +1 -0
  111. package/dist/index.cjs509.js +1 -1
  112. package/dist/index.cjs509.js.map +1 -1
  113. package/dist/index.cjs510.js +1 -1
  114. package/dist/index.cjs514.js +2 -0
  115. package/dist/index.cjs514.js.map +1 -0
  116. package/dist/index.cjs521.js +1 -1
  117. package/dist/index.cjs522.js +1 -1
  118. package/dist/index.cjs525.js +1 -1
  119. package/dist/index.cjs530.js +1 -1
  120. package/dist/index.cjs531.js +1 -1
  121. package/dist/index.cjs532.js +1 -1
  122. package/dist/index.cjs539.js +1 -1
  123. package/dist/index.cjs544.js +1 -1
  124. package/dist/index.cjs546.js +1 -1
  125. package/dist/index.cjs550.js +1 -1
  126. package/dist/index.cjs550.js.map +1 -1
  127. package/dist/index.cjs551.js +1 -1
  128. package/dist/index.cjs551.js.map +1 -1
  129. package/dist/index.cjs552.js +1 -1
  130. package/dist/index.cjs552.js.map +1 -1
  131. package/dist/index.cjs553.js +1 -1
  132. package/dist/index.cjs553.js.map +1 -1
  133. package/dist/index.cjs554.js +1 -1
  134. package/dist/index.cjs554.js.map +1 -1
  135. package/dist/index.cjs560.js +1 -1
  136. package/dist/index.cjs560.js.map +1 -1
  137. package/dist/index.cjs561.js +1 -1
  138. package/dist/index.cjs561.js.map +1 -1
  139. package/dist/index.cjs562.js +1 -1
  140. package/dist/index.cjs562.js.map +1 -1
  141. package/dist/{index.cjs568.js → index.cjs564.js} +2 -2
  142. package/dist/{index.cjs568.js.map → index.cjs564.js.map} +1 -1
  143. package/dist/{index.cjs569.js → index.cjs565.js} +1 -1
  144. package/dist/index.cjs565.js.map +1 -0
  145. package/dist/index.cjs655.js +1 -1
  146. package/dist/index.d.ts +2 -1
  147. package/dist/index.es149.js +38 -38
  148. package/dist/index.es149.js.map +1 -1
  149. package/dist/index.es179.js +6 -6
  150. package/dist/index.es179.js.map +1 -1
  151. package/dist/index.es207.js +6 -6
  152. package/dist/index.es207.js.map +1 -1
  153. package/dist/index.es229.js +1 -1
  154. package/dist/index.es236.js +2 -2
  155. package/dist/index.es275.js +6 -6
  156. package/dist/index.es288.js +7 -7
  157. package/dist/index.es29.js +12 -11
  158. package/dist/index.es29.js.map +1 -1
  159. package/dist/index.es299.js +1 -1
  160. package/dist/index.es306.js +12 -12
  161. package/dist/index.es313.js +1 -1
  162. package/dist/index.es314.js +1 -1
  163. package/dist/index.es318.js +1 -1
  164. package/dist/index.es327.js +1 -1
  165. package/dist/index.es329.js +1 -1
  166. package/dist/index.es337.js +6 -6
  167. package/dist/index.es378.js +3 -3
  168. package/dist/index.es384.js +1 -1
  169. package/dist/index.es419.js +1 -1
  170. package/dist/index.es437.js +1 -1
  171. package/dist/index.es438.js +1 -1
  172. package/dist/index.es439.js +3674 -5
  173. package/dist/index.es439.js.map +1 -1
  174. package/dist/index.es440.js +5 -528
  175. package/dist/index.es440.js.map +1 -1
  176. package/dist/index.es441.js +2 -3675
  177. package/dist/index.es441.js.map +1 -1
  178. package/dist/index.es442.js +2 -6
  179. package/dist/index.es442.js.map +1 -1
  180. package/dist/index.es443.js +2 -2
  181. package/dist/index.es444.js +6 -2
  182. package/dist/index.es444.js.map +1 -1
  183. package/dist/index.es445.js +529 -2
  184. package/dist/index.es445.js.map +1 -1
  185. package/dist/index.es453.js +25 -5
  186. package/dist/index.es453.js.map +1 -1
  187. package/dist/index.es454.js +64 -23
  188. package/dist/index.es454.js.map +1 -1
  189. package/dist/index.es455.js +5 -66
  190. package/dist/index.es455.js.map +1 -1
  191. package/dist/index.es457.js +5 -33
  192. package/dist/index.es457.js.map +1 -1
  193. package/dist/index.es458.js +24 -621
  194. package/dist/index.es458.js.map +1 -1
  195. package/dist/index.es459.js +68 -10
  196. package/dist/index.es459.js.map +1 -1
  197. package/dist/index.es460.js +33 -5
  198. package/dist/index.es460.js.map +1 -1
  199. package/dist/index.es461.js +621 -24
  200. package/dist/index.es461.js.map +1 -1
  201. package/dist/index.es462.js +10 -68
  202. package/dist/index.es462.js.map +1 -1
  203. package/dist/index.es464.js +1 -1
  204. package/dist/index.es465.js +13 -44
  205. package/dist/index.es465.js.map +1 -1
  206. package/dist/index.es466.js +45 -13
  207. package/dist/index.es466.js.map +1 -1
  208. package/dist/index.es467.js +13 -124
  209. package/dist/index.es467.js.map +1 -1
  210. package/dist/index.es468.js +122 -12
  211. package/dist/index.es468.js.map +1 -1
  212. package/dist/index.es469.js +14 -134
  213. package/dist/index.es469.js.map +1 -1
  214. package/dist/index.es470.js +127 -211
  215. package/dist/index.es470.js.map +1 -1
  216. package/dist/index.es471.js +218 -13
  217. package/dist/index.es471.js.map +1 -1
  218. package/dist/index.es472.js +14 -181
  219. package/dist/index.es472.js.map +1 -1
  220. package/dist/index.es473.js +180 -10
  221. package/dist/index.es473.js.map +1 -1
  222. package/dist/index.es474.js +11 -50
  223. package/dist/index.es474.js.map +1 -1
  224. package/dist/index.es475.js +50 -9
  225. package/dist/index.es475.js.map +1 -1
  226. package/dist/index.es476.js +12 -0
  227. package/dist/index.es476.js.map +1 -0
  228. package/dist/{index.es479.js → index.es483.js} +2 -2
  229. package/dist/{index.es479.js.map → index.es483.js.map} +1 -1
  230. package/dist/{index.es480.js → index.es484.js} +3 -3
  231. package/dist/{index.es480.js.map → index.es484.js.map} +1 -1
  232. package/dist/{index.es481.js → index.es485.js} +2 -2
  233. package/dist/{index.es481.js.map → index.es485.js.map} +1 -1
  234. package/dist/{index.es482.js → index.es486.js} +4 -4
  235. package/dist/{index.es482.js.map → index.es486.js.map} +1 -1
  236. package/dist/{index.es488.js → index.es493.js} +1 -1
  237. package/dist/{index.es488.js.map → index.es493.js.map} +1 -1
  238. package/dist/index.es494.js +29 -15
  239. package/dist/index.es494.js.map +1 -1
  240. package/dist/index.es495.js +5 -5
  241. package/dist/index.es495.js.map +1 -1
  242. package/dist/index.es502.js +5 -525
  243. package/dist/index.es502.js.map +1 -1
  244. package/dist/index.es503.js +3 -128
  245. package/dist/index.es503.js.map +1 -1
  246. package/dist/index.es504.js +22 -132
  247. package/dist/index.es504.js.map +1 -1
  248. package/dist/{index.es498.js → index.es505.js} +2 -2
  249. package/dist/{index.es498.js.map → index.es505.js.map} +1 -1
  250. package/dist/{index.es499.js → index.es506.js} +2 -2
  251. package/dist/{index.es499.js.map → index.es506.js.map} +1 -1
  252. package/dist/index.es507.js +528 -0
  253. package/dist/index.es507.js.map +1 -0
  254. package/dist/index.es508.js +131 -0
  255. package/dist/index.es508.js.map +1 -0
  256. package/dist/index.es509.js +130 -61
  257. package/dist/index.es509.js.map +1 -1
  258. package/dist/index.es510.js +1 -1
  259. package/dist/index.es514.js +68 -0
  260. package/dist/index.es514.js.map +1 -0
  261. package/dist/index.es521.js +1 -1
  262. package/dist/index.es522.js +2 -2
  263. package/dist/index.es525.js +3 -3
  264. package/dist/index.es530.js +2 -2
  265. package/dist/index.es531.js +1 -1
  266. package/dist/index.es532.js +13 -13
  267. package/dist/index.es539.js +8 -8
  268. package/dist/index.es544.js +7 -7
  269. package/dist/index.es546.js +1 -1
  270. package/dist/index.es550.js +6 -2
  271. package/dist/index.es550.js.map +1 -1
  272. package/dist/index.es551.js +16 -2
  273. package/dist/index.es551.js.map +1 -1
  274. package/dist/index.es552.js +2 -2
  275. package/dist/index.es552.js.map +1 -1
  276. package/dist/index.es553.js +2 -6
  277. package/dist/index.es553.js.map +1 -1
  278. package/dist/index.es554.js +2 -16
  279. package/dist/index.es554.js.map +1 -1
  280. package/dist/index.es560.js +4 -3
  281. package/dist/index.es560.js.map +1 -1
  282. package/dist/index.es561.js +3 -2
  283. package/dist/index.es561.js.map +1 -1
  284. package/dist/index.es562.js +2 -4
  285. package/dist/index.es562.js.map +1 -1
  286. package/dist/{index.es568.js → index.es564.js} +3 -3
  287. package/dist/{index.es568.js.map → index.es564.js.map} +1 -1
  288. package/dist/{index.es569.js → index.es565.js} +1 -1
  289. package/dist/index.es565.js.map +1 -0
  290. package/dist/index.es655.js +1 -1
  291. package/dist/sections/Slider/Slider.css +1 -1
  292. package/package.json +1 -1
  293. package/dist/index.cjs489.js +0 -2
  294. package/dist/index.cjs489.js.map +0 -1
  295. package/dist/index.cjs490.js +0 -2
  296. package/dist/index.cjs490.js.map +0 -1
  297. package/dist/index.cjs496.js +0 -2
  298. package/dist/index.cjs496.js.map +0 -1
  299. package/dist/index.cjs497.js +0 -2
  300. package/dist/index.cjs497.js.map +0 -1
  301. package/dist/index.cjs569.js.map +0 -1
  302. package/dist/index.es489.js +0 -32
  303. package/dist/index.es489.js.map +0 -1
  304. package/dist/index.es490.js +0 -8
  305. package/dist/index.es490.js.map +0 -1
  306. package/dist/index.es496.js +0 -6
  307. package/dist/index.es496.js.map +0 -1
  308. package/dist/index.es497.js +0 -27
  309. package/dist/index.es497.js.map +0 -1
  310. package/dist/index.es569.js.map +0 -1
  311. /package/dist/components/ui/{DoctorConfirmModal/DoctorConfirmModalContent/DoctorConfirmModalContent.css → ConsentModal/ConsentModalContent/ConsentModalContent.css} +0 -0
  312. /package/dist/components/ui/{DoctorConfirmModal/DoctorConfirmModalFooter/DoctorConfirmModalFooter.css → ConsentModal/ConsentModalFooter/ConsentModalFooter.css} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.es461.js","sources":["../node_modules/@radix-ui/react-use-size/dist/index.mjs"],"sourcesContent":["// packages/react/use-size/src/use-size.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nfunction useSize(element) {\n const [size, setSize] = React.useState(void 0);\n useLayoutEffect(() => {\n if (element) {\n setSize({ width: element.offsetWidth, height: element.offsetHeight });\n const resizeObserver = new ResizeObserver((entries) => {\n if (!Array.isArray(entries)) {\n return;\n }\n if (!entries.length) {\n return;\n }\n const entry = entries[0];\n let width;\n let height;\n if (\"borderBoxSize\" in entry) {\n const borderSizeEntry = entry[\"borderBoxSize\"];\n const borderSize = Array.isArray(borderSizeEntry) ? borderSizeEntry[0] : borderSizeEntry;\n width = borderSize[\"inlineSize\"];\n height = borderSize[\"blockSize\"];\n } else {\n width = element.offsetWidth;\n height = element.offsetHeight;\n }\n setSize({ width, height });\n });\n resizeObserver.observe(element, { box: \"border-box\" });\n return () => resizeObserver.unobserve(element);\n } else {\n setSize(void 0);\n }\n }, [element]);\n return size;\n}\nexport {\n useSize\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useSize","element","size","setSize","React","useLayoutEffect","resizeObserver","entries","entry","width","height","borderSizeEntry","borderSize"],"mappings":";;AAGA,SAASA,EAAQC,GAAS;AACxB,QAAM,CAACC,GAAMC,CAAO,IAAIC,EAAM,SAAS,MAAM;AAC7CC,SAAAA,EAAgB,MAAM;AACpB,QAAIJ,GAAS;AACX,MAAAE,EAAQ,EAAE,OAAOF,EAAQ,aAAa,QAAQA,EAAQ,cAAc;AACpE,YAAMK,IAAiB,IAAI,eAAe,CAACC,MAAY;AAIrD,YAHI,CAAC,MAAM,QAAQA,CAAO,KAGtB,CAACA,EAAQ;AACX;AAEF,cAAMC,IAAQD,EAAQ,CAAC;AACvB,YAAIE,GACAC;AACJ,YAAI,mBAAmBF,GAAO;AAC5B,gBAAMG,IAAkBH,EAAM,eACxBI,IAAa,MAAM,QAAQD,CAAe,IAAIA,EAAgB,CAAC,IAAIA;AACzE,UAAAF,IAAQG,EAAW,YACnBF,IAASE,EAAW;AAAA,QACtB;AACE,UAAAH,IAAQR,EAAQ,aAChBS,IAAST,EAAQ;AAEnB,QAAAE,EAAQ,EAAE,OAAAM,GAAO,QAAAC,GAAQ;AAAA,MAC3B,CAAC;AACD,aAAAJ,EAAe,QAAQL,GAAS,EAAE,KAAK,aAAY,CAAE,GAC9C,MAAMK,EAAe,UAAUL,CAAO;AAAA,IAC/C;AACE,MAAAE,EAAQ,MAAM;AAAA,EAElB,GAAG,CAACF,CAAO,CAAC,GACLC;AACT;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es461.js","sources":["../node_modules/@radix-ui/react-menu/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/menu.tsx\nimport * as React from \"react\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createCollection } from \"@radix-ui/react-collection\";\nimport { useComposedRefs, composeRefs } from \"@radix-ui/react-compose-refs\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useDirection } from \"@radix-ui/react-direction\";\nimport { DismissableLayer } from \"@radix-ui/react-dismissable-layer\";\nimport { useFocusGuards } from \"@radix-ui/react-focus-guards\";\nimport { FocusScope } from \"@radix-ui/react-focus-scope\";\nimport { useId } from \"@radix-ui/react-id\";\nimport * as PopperPrimitive from \"@radix-ui/react-popper\";\nimport { createPopperScope } from \"@radix-ui/react-popper\";\nimport { Portal as PortalPrimitive } from \"@radix-ui/react-portal\";\nimport { Presence } from \"@radix-ui/react-presence\";\nimport { Primitive, dispatchDiscreteCustomEvent } from \"@radix-ui/react-primitive\";\nimport * as RovingFocusGroup from \"@radix-ui/react-roving-focus\";\nimport { createRovingFocusGroupScope } from \"@radix-ui/react-roving-focus\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { useCallbackRef } from \"@radix-ui/react-use-callback-ref\";\nimport { hideOthers } from \"aria-hidden\";\nimport { RemoveScroll } from \"react-remove-scroll\";\nimport { jsx } from \"react/jsx-runtime\";\nvar SELECTION_KEYS = [\"Enter\", \" \"];\nvar FIRST_KEYS = [\"ArrowDown\", \"PageUp\", \"Home\"];\nvar LAST_KEYS = [\"ArrowUp\", \"PageDown\", \"End\"];\nvar FIRST_LAST_KEYS = [...FIRST_KEYS, ...LAST_KEYS];\nvar SUB_OPEN_KEYS = {\n ltr: [...SELECTION_KEYS, \"ArrowRight\"],\n rtl: [...SELECTION_KEYS, \"ArrowLeft\"]\n};\nvar SUB_CLOSE_KEYS = {\n ltr: [\"ArrowLeft\"],\n rtl: [\"ArrowRight\"]\n};\nvar MENU_NAME = \"Menu\";\nvar [Collection, useCollection, createCollectionScope] = createCollection(MENU_NAME);\nvar [createMenuContext, createMenuScope] = createContextScope(MENU_NAME, [\n createCollectionScope,\n createPopperScope,\n createRovingFocusGroupScope\n]);\nvar usePopperScope = createPopperScope();\nvar useRovingFocusGroupScope = createRovingFocusGroupScope();\nvar [MenuProvider, useMenuContext] = createMenuContext(MENU_NAME);\nvar [MenuRootProvider, useMenuRootContext] = createMenuContext(MENU_NAME);\nvar Menu = (props) => {\n const { __scopeMenu, open = false, children, dir, onOpenChange, modal = true } = props;\n const popperScope = usePopperScope(__scopeMenu);\n const [content, setContent] = React.useState(null);\n const isUsingKeyboardRef = React.useRef(false);\n const handleOpenChange = useCallbackRef(onOpenChange);\n const direction = useDirection(dir);\n React.useEffect(() => {\n const handleKeyDown = () => {\n isUsingKeyboardRef.current = true;\n document.addEventListener(\"pointerdown\", handlePointer, { capture: true, once: true });\n document.addEventListener(\"pointermove\", handlePointer, { capture: true, once: true });\n };\n const handlePointer = () => isUsingKeyboardRef.current = false;\n document.addEventListener(\"keydown\", handleKeyDown, { capture: true });\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown, { capture: true });\n document.removeEventListener(\"pointerdown\", handlePointer, { capture: true });\n document.removeEventListener(\"pointermove\", handlePointer, { capture: true });\n };\n }, []);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuRootProvider,\n {\n scope: __scopeMenu,\n onClose: React.useCallback(() => handleOpenChange(false), [handleOpenChange]),\n isUsingKeyboardRef,\n dir: direction,\n modal,\n children\n }\n )\n }\n ) });\n};\nMenu.displayName = MENU_NAME;\nvar ANCHOR_NAME = \"MenuAnchor\";\nvar MenuAnchor = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...anchorProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Anchor, { ...popperScope, ...anchorProps, ref: forwardedRef });\n }\n);\nMenuAnchor.displayName = ANCHOR_NAME;\nvar PORTAL_NAME = \"MenuPortal\";\nvar [PortalProvider, usePortalContext] = createMenuContext(PORTAL_NAME, {\n forceMount: void 0\n});\nvar MenuPortal = (props) => {\n const { __scopeMenu, forceMount, children, container } = props;\n const context = useMenuContext(PORTAL_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(PortalPrimitive, { asChild: true, container, children }) }) });\n};\nMenuPortal.displayName = PORTAL_NAME;\nvar CONTENT_NAME = \"MenuContent\";\nvar [MenuContentProvider, useMenuContentContext] = createMenuContext(CONTENT_NAME);\nvar MenuContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...contentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: rootContext.modal ? /* @__PURE__ */ jsx(MenuRootContentModal, { ...contentProps, ref: forwardedRef }) : /* @__PURE__ */ jsx(MenuRootContentNonModal, { ...contentProps, ref: forwardedRef }) }) }) });\n }\n);\nvar MenuRootContentModal = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n React.useEffect(() => {\n const content = ref.current;\n if (content) return hideOthers(content);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: composedRefs,\n trapFocus: context.open,\n disableOutsidePointerEvents: context.open,\n disableOutsideScroll: true,\n onFocusOutside: composeEventHandlers(\n props.onFocusOutside,\n (event) => event.preventDefault(),\n { checkForDefaultPrevented: false }\n ),\n onDismiss: () => context.onOpenChange(false)\n }\n );\n }\n);\nvar MenuRootContentNonModal = React.forwardRef((props, forwardedRef) => {\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n return /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n ...props,\n ref: forwardedRef,\n trapFocus: false,\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n onDismiss: () => context.onOpenChange(false)\n }\n );\n});\nvar Slot = createSlot(\"MenuContent.ScrollLock\");\nvar MenuContentImpl = React.forwardRef(\n (props, forwardedRef) => {\n const {\n __scopeMenu,\n loop = false,\n trapFocus,\n onOpenAutoFocus,\n onCloseAutoFocus,\n disableOutsidePointerEvents,\n onEntryFocus,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n disableOutsideScroll,\n ...contentProps\n } = props;\n const context = useMenuContext(CONTENT_NAME, __scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const getItems = useCollection(__scopeMenu);\n const [currentItemId, setCurrentItemId] = React.useState(null);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef, context.onContentChange);\n const timerRef = React.useRef(0);\n const searchRef = React.useRef(\"\");\n const pointerGraceTimerRef = React.useRef(0);\n const pointerGraceIntentRef = React.useRef(null);\n const pointerDirRef = React.useRef(\"right\");\n const lastPointerXRef = React.useRef(0);\n const ScrollLockWrapper = disableOutsideScroll ? RemoveScroll : React.Fragment;\n const scrollLockWrapperProps = disableOutsideScroll ? { as: Slot, allowPinchZoom: true } : void 0;\n const handleTypeaheadSearch = (key) => {\n const search = searchRef.current + key;\n const items = getItems().filter((item) => !item.disabled);\n const currentItem = document.activeElement;\n const currentMatch = items.find((item) => item.ref.current === currentItem)?.textValue;\n const values = items.map((item) => item.textValue);\n const nextMatch = getNextMatch(values, search, currentMatch);\n const newItem = items.find((item) => item.textValue === nextMatch)?.ref.current;\n (function updateSearch(value) {\n searchRef.current = value;\n window.clearTimeout(timerRef.current);\n if (value !== \"\") timerRef.current = window.setTimeout(() => updateSearch(\"\"), 1e3);\n })(search);\n if (newItem) {\n setTimeout(() => newItem.focus());\n }\n };\n React.useEffect(() => {\n return () => window.clearTimeout(timerRef.current);\n }, []);\n useFocusGuards();\n const isPointerMovingToSubmenu = React.useCallback((event) => {\n const isMovingTowards = pointerDirRef.current === pointerGraceIntentRef.current?.side;\n return isMovingTowards && isPointerInGraceArea(event, pointerGraceIntentRef.current?.area);\n }, []);\n return /* @__PURE__ */ jsx(\n MenuContentProvider,\n {\n scope: __scopeMenu,\n searchRef,\n onItemEnter: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n onItemLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) return;\n contentRef.current?.focus();\n setCurrentItemId(null);\n },\n [isPointerMovingToSubmenu]\n ),\n onTriggerLeave: React.useCallback(\n (event) => {\n if (isPointerMovingToSubmenu(event)) event.preventDefault();\n },\n [isPointerMovingToSubmenu]\n ),\n pointerGraceTimerRef,\n onPointerGraceIntentChange: React.useCallback((intent) => {\n pointerGraceIntentRef.current = intent;\n }, []),\n children: /* @__PURE__ */ jsx(ScrollLockWrapper, { ...scrollLockWrapperProps, children: /* @__PURE__ */ jsx(\n FocusScope,\n {\n asChild: true,\n trapped: trapFocus,\n onMountAutoFocus: composeEventHandlers(onOpenAutoFocus, (event) => {\n event.preventDefault();\n contentRef.current?.focus({ preventScroll: true });\n }),\n onUnmountAutoFocus: onCloseAutoFocus,\n children: /* @__PURE__ */ jsx(\n DismissableLayer,\n {\n asChild: true,\n disableOutsidePointerEvents,\n onEscapeKeyDown,\n onPointerDownOutside,\n onFocusOutside,\n onInteractOutside,\n onDismiss,\n children: /* @__PURE__ */ jsx(\n RovingFocusGroup.Root,\n {\n asChild: true,\n ...rovingFocusGroupScope,\n dir: rootContext.dir,\n orientation: \"vertical\",\n loop,\n currentTabStopId: currentItemId,\n onCurrentTabStopIdChange: setCurrentItemId,\n onEntryFocus: composeEventHandlers(onEntryFocus, (event) => {\n if (!rootContext.isUsingKeyboardRef.current) event.preventDefault();\n }),\n preventScrollOnEntryFocus: true,\n children: /* @__PURE__ */ jsx(\n PopperPrimitive.Content,\n {\n role: \"menu\",\n \"aria-orientation\": \"vertical\",\n \"data-state\": getOpenState(context.open),\n \"data-radix-menu-content\": \"\",\n dir: rootContext.dir,\n ...popperScope,\n ...contentProps,\n ref: composedRefs,\n style: { outline: \"none\", ...contentProps.style },\n onKeyDown: composeEventHandlers(contentProps.onKeyDown, (event) => {\n const target = event.target;\n const isKeyDownInside = target.closest(\"[data-radix-menu-content]\") === event.currentTarget;\n const isModifierKey = event.ctrlKey || event.altKey || event.metaKey;\n const isCharacterKey = event.key.length === 1;\n if (isKeyDownInside) {\n if (event.key === \"Tab\") event.preventDefault();\n if (!isModifierKey && isCharacterKey) handleTypeaheadSearch(event.key);\n }\n const content = contentRef.current;\n if (event.target !== content) return;\n if (!FIRST_LAST_KEYS.includes(event.key)) return;\n event.preventDefault();\n const items = getItems().filter((item) => !item.disabled);\n const candidateNodes = items.map((item) => item.ref.current);\n if (LAST_KEYS.includes(event.key)) candidateNodes.reverse();\n focusFirst(candidateNodes);\n }),\n onBlur: composeEventHandlers(props.onBlur, (event) => {\n if (!event.currentTarget.contains(event.target)) {\n window.clearTimeout(timerRef.current);\n searchRef.current = \"\";\n }\n }),\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n const target = event.target;\n const pointerXHasChanged = lastPointerXRef.current !== event.clientX;\n if (event.currentTarget.contains(target) && pointerXHasChanged) {\n const newDir = event.clientX > lastPointerXRef.current ? \"right\" : \"left\";\n pointerDirRef.current = newDir;\n lastPointerXRef.current = event.clientX;\n }\n })\n )\n }\n )\n }\n )\n }\n )\n }\n ) })\n }\n );\n }\n);\nMenuContent.displayName = CONTENT_NAME;\nvar GROUP_NAME = \"MenuGroup\";\nvar MenuGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...groupProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { role: \"group\", ...groupProps, ref: forwardedRef });\n }\n);\nMenuGroup.displayName = GROUP_NAME;\nvar LABEL_NAME = \"MenuLabel\";\nvar MenuLabel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...labelProps } = props;\n return /* @__PURE__ */ jsx(Primitive.div, { ...labelProps, ref: forwardedRef });\n }\n);\nMenuLabel.displayName = LABEL_NAME;\nvar ITEM_NAME = \"MenuItem\";\nvar ITEM_SELECT = \"menu.itemSelect\";\nvar MenuItem = React.forwardRef(\n (props, forwardedRef) => {\n const { disabled = false, onSelect, ...itemProps } = props;\n const ref = React.useRef(null);\n const rootContext = useMenuRootContext(ITEM_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(ITEM_NAME, props.__scopeMenu);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const isPointerDownRef = React.useRef(false);\n const handleSelect = () => {\n const menuItem = ref.current;\n if (!disabled && menuItem) {\n const itemSelectEvent = new CustomEvent(ITEM_SELECT, { bubbles: true, cancelable: true });\n menuItem.addEventListener(ITEM_SELECT, (event) => onSelect?.(event), { once: true });\n dispatchDiscreteCustomEvent(menuItem, itemSelectEvent);\n if (itemSelectEvent.defaultPrevented) {\n isPointerDownRef.current = false;\n } else {\n rootContext.onClose();\n }\n }\n };\n return /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n ...itemProps,\n ref: composedRefs,\n disabled,\n onClick: composeEventHandlers(props.onClick, handleSelect),\n onPointerDown: (event) => {\n props.onPointerDown?.(event);\n isPointerDownRef.current = true;\n },\n onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {\n if (!isPointerDownRef.current) event.currentTarget?.click();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (disabled || isTypingAhead && event.key === \" \") return;\n if (SELECTION_KEYS.includes(event.key)) {\n event.currentTarget.click();\n event.preventDefault();\n }\n })\n }\n );\n }\n);\nMenuItem.displayName = ITEM_NAME;\nvar MenuItemImpl = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, disabled = false, textValue, ...itemProps } = props;\n const contentContext = useMenuContentContext(ITEM_NAME, __scopeMenu);\n const rovingFocusGroupScope = useRovingFocusGroupScope(__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const [isFocused, setIsFocused] = React.useState(false);\n const [textContent, setTextContent] = React.useState(\"\");\n React.useEffect(() => {\n const menuItem = ref.current;\n if (menuItem) {\n setTextContent((menuItem.textContent ?? \"\").trim());\n }\n }, [itemProps.children]);\n return /* @__PURE__ */ jsx(\n Collection.ItemSlot,\n {\n scope: __scopeMenu,\n disabled,\n textValue: textValue ?? textContent,\n children: /* @__PURE__ */ jsx(RovingFocusGroup.Item, { asChild: true, ...rovingFocusGroupScope, focusable: !disabled, children: /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"menuitem\",\n \"data-highlighted\": isFocused ? \"\" : void 0,\n \"aria-disabled\": disabled || void 0,\n \"data-disabled\": disabled ? \"\" : void 0,\n ...itemProps,\n ref: composedRefs,\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n if (disabled) {\n contentContext.onItemLeave(event);\n } else {\n contentContext.onItemEnter(event);\n if (!event.defaultPrevented) {\n const item = event.currentTarget;\n item.focus({ preventScroll: true });\n }\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => contentContext.onItemLeave(event))\n ),\n onFocus: composeEventHandlers(props.onFocus, () => setIsFocused(true)),\n onBlur: composeEventHandlers(props.onBlur, () => setIsFocused(false))\n }\n ) })\n }\n );\n }\n);\nvar CHECKBOX_ITEM_NAME = \"MenuCheckboxItem\";\nvar MenuCheckboxItem = React.forwardRef(\n (props, forwardedRef) => {\n const { checked = false, onCheckedChange, ...checkboxItemProps } = props;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemcheckbox\",\n \"aria-checked\": isIndeterminate(checked) ? \"mixed\" : checked,\n ...checkboxItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n checkboxItemProps.onSelect,\n () => onCheckedChange?.(isIndeterminate(checked) ? true : !checked),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuCheckboxItem.displayName = CHECKBOX_ITEM_NAME;\nvar RADIO_GROUP_NAME = \"MenuRadioGroup\";\nvar [RadioGroupProvider, useRadioGroupContext] = createMenuContext(\n RADIO_GROUP_NAME,\n { value: void 0, onValueChange: () => {\n } }\n);\nvar MenuRadioGroup = React.forwardRef(\n (props, forwardedRef) => {\n const { value, onValueChange, ...groupProps } = props;\n const handleValueChange = useCallbackRef(onValueChange);\n return /* @__PURE__ */ jsx(RadioGroupProvider, { scope: props.__scopeMenu, value, onValueChange: handleValueChange, children: /* @__PURE__ */ jsx(MenuGroup, { ...groupProps, ref: forwardedRef }) });\n }\n);\nMenuRadioGroup.displayName = RADIO_GROUP_NAME;\nvar RADIO_ITEM_NAME = \"MenuRadioItem\";\nvar MenuRadioItem = React.forwardRef(\n (props, forwardedRef) => {\n const { value, ...radioItemProps } = props;\n const context = useRadioGroupContext(RADIO_ITEM_NAME, props.__scopeMenu);\n const checked = value === context.value;\n return /* @__PURE__ */ jsx(ItemIndicatorProvider, { scope: props.__scopeMenu, checked, children: /* @__PURE__ */ jsx(\n MenuItem,\n {\n role: \"menuitemradio\",\n \"aria-checked\": checked,\n ...radioItemProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(checked),\n onSelect: composeEventHandlers(\n radioItemProps.onSelect,\n () => context.onValueChange?.(value),\n { checkForDefaultPrevented: false }\n )\n }\n ) });\n }\n);\nMenuRadioItem.displayName = RADIO_ITEM_NAME;\nvar ITEM_INDICATOR_NAME = \"MenuItemIndicator\";\nvar [ItemIndicatorProvider, useItemIndicatorContext] = createMenuContext(\n ITEM_INDICATOR_NAME,\n { checked: false }\n);\nvar MenuItemIndicator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, forceMount, ...itemIndicatorProps } = props;\n const indicatorContext = useItemIndicatorContext(ITEM_INDICATOR_NAME, __scopeMenu);\n return /* @__PURE__ */ jsx(\n Presence,\n {\n present: forceMount || isIndeterminate(indicatorContext.checked) || indicatorContext.checked === true,\n children: /* @__PURE__ */ jsx(\n Primitive.span,\n {\n ...itemIndicatorProps,\n ref: forwardedRef,\n \"data-state\": getCheckedState(indicatorContext.checked)\n }\n )\n }\n );\n }\n);\nMenuItemIndicator.displayName = ITEM_INDICATOR_NAME;\nvar SEPARATOR_NAME = \"MenuSeparator\";\nvar MenuSeparator = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...separatorProps } = props;\n return /* @__PURE__ */ jsx(\n Primitive.div,\n {\n role: \"separator\",\n \"aria-orientation\": \"horizontal\",\n ...separatorProps,\n ref: forwardedRef\n }\n );\n }\n);\nMenuSeparator.displayName = SEPARATOR_NAME;\nvar ARROW_NAME = \"MenuArrow\";\nvar MenuArrow = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeMenu, ...arrowProps } = props;\n const popperScope = usePopperScope(__scopeMenu);\n return /* @__PURE__ */ jsx(PopperPrimitive.Arrow, { ...popperScope, ...arrowProps, ref: forwardedRef });\n }\n);\nMenuArrow.displayName = ARROW_NAME;\nvar SUB_NAME = \"MenuSub\";\nvar [MenuSubProvider, useMenuSubContext] = createMenuContext(SUB_NAME);\nvar MenuSub = (props) => {\n const { __scopeMenu, children, open = false, onOpenChange } = props;\n const parentMenuContext = useMenuContext(SUB_NAME, __scopeMenu);\n const popperScope = usePopperScope(__scopeMenu);\n const [trigger, setTrigger] = React.useState(null);\n const [content, setContent] = React.useState(null);\n const handleOpenChange = useCallbackRef(onOpenChange);\n React.useEffect(() => {\n if (parentMenuContext.open === false) handleOpenChange(false);\n return () => handleOpenChange(false);\n }, [parentMenuContext.open, handleOpenChange]);\n return /* @__PURE__ */ jsx(PopperPrimitive.Root, { ...popperScope, children: /* @__PURE__ */ jsx(\n MenuProvider,\n {\n scope: __scopeMenu,\n open,\n onOpenChange: handleOpenChange,\n content,\n onContentChange: setContent,\n children: /* @__PURE__ */ jsx(\n MenuSubProvider,\n {\n scope: __scopeMenu,\n contentId: useId(),\n triggerId: useId(),\n trigger,\n onTriggerChange: setTrigger,\n children\n }\n )\n }\n ) });\n};\nMenuSub.displayName = SUB_NAME;\nvar SUB_TRIGGER_NAME = \"MenuSubTrigger\";\nvar MenuSubTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const context = useMenuContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const contentContext = useMenuContentContext(SUB_TRIGGER_NAME, props.__scopeMenu);\n const openTimerRef = React.useRef(null);\n const { pointerGraceTimerRef, onPointerGraceIntentChange } = contentContext;\n const scope = { __scopeMenu: props.__scopeMenu };\n const clearOpenTimer = React.useCallback(() => {\n if (openTimerRef.current) window.clearTimeout(openTimerRef.current);\n openTimerRef.current = null;\n }, []);\n React.useEffect(() => clearOpenTimer, [clearOpenTimer]);\n React.useEffect(() => {\n const pointerGraceTimer = pointerGraceTimerRef.current;\n return () => {\n window.clearTimeout(pointerGraceTimer);\n onPointerGraceIntentChange(null);\n };\n }, [pointerGraceTimerRef, onPointerGraceIntentChange]);\n return /* @__PURE__ */ jsx(MenuAnchor, { asChild: true, ...scope, children: /* @__PURE__ */ jsx(\n MenuItemImpl,\n {\n id: subContext.triggerId,\n \"aria-haspopup\": \"menu\",\n \"aria-expanded\": context.open,\n \"aria-controls\": subContext.contentId,\n \"data-state\": getOpenState(context.open),\n ...props,\n ref: composeRefs(forwardedRef, subContext.onTriggerChange),\n onClick: (event) => {\n props.onClick?.(event);\n if (props.disabled || event.defaultPrevented) return;\n event.currentTarget.focus();\n if (!context.open) context.onOpenChange(true);\n },\n onPointerMove: composeEventHandlers(\n props.onPointerMove,\n whenMouse((event) => {\n contentContext.onItemEnter(event);\n if (event.defaultPrevented) return;\n if (!props.disabled && !context.open && !openTimerRef.current) {\n contentContext.onPointerGraceIntentChange(null);\n openTimerRef.current = window.setTimeout(() => {\n context.onOpenChange(true);\n clearOpenTimer();\n }, 100);\n }\n })\n ),\n onPointerLeave: composeEventHandlers(\n props.onPointerLeave,\n whenMouse((event) => {\n clearOpenTimer();\n const contentRect = context.content?.getBoundingClientRect();\n if (contentRect) {\n const side = context.content?.dataset.side;\n const rightSide = side === \"right\";\n const bleed = rightSide ? -5 : 5;\n const contentNearEdge = contentRect[rightSide ? \"left\" : \"right\"];\n const contentFarEdge = contentRect[rightSide ? \"right\" : \"left\"];\n contentContext.onPointerGraceIntentChange({\n area: [\n // Apply a bleed on clientX to ensure that our exit point is\n // consistently within polygon bounds\n { x: event.clientX + bleed, y: event.clientY },\n { x: contentNearEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.top },\n { x: contentFarEdge, y: contentRect.bottom },\n { x: contentNearEdge, y: contentRect.bottom }\n ],\n side\n });\n window.clearTimeout(pointerGraceTimerRef.current);\n pointerGraceTimerRef.current = window.setTimeout(\n () => contentContext.onPointerGraceIntentChange(null),\n 300\n );\n } else {\n contentContext.onTriggerLeave(event);\n if (event.defaultPrevented) return;\n contentContext.onPointerGraceIntentChange(null);\n }\n })\n ),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isTypingAhead = contentContext.searchRef.current !== \"\";\n if (props.disabled || isTypingAhead && event.key === \" \") return;\n if (SUB_OPEN_KEYS[rootContext.dir].includes(event.key)) {\n context.onOpenChange(true);\n context.content?.focus();\n event.preventDefault();\n }\n })\n }\n ) });\n }\n);\nMenuSubTrigger.displayName = SUB_TRIGGER_NAME;\nvar SUB_CONTENT_NAME = \"MenuSubContent\";\nvar MenuSubContent = React.forwardRef(\n (props, forwardedRef) => {\n const portalContext = usePortalContext(CONTENT_NAME, props.__scopeMenu);\n const { forceMount = portalContext.forceMount, ...subContentProps } = props;\n const context = useMenuContext(CONTENT_NAME, props.__scopeMenu);\n const rootContext = useMenuRootContext(CONTENT_NAME, props.__scopeMenu);\n const subContext = useMenuSubContext(SUB_CONTENT_NAME, props.__scopeMenu);\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n return /* @__PURE__ */ jsx(Collection.Provider, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Collection.Slot, { scope: props.__scopeMenu, children: /* @__PURE__ */ jsx(\n MenuContentImpl,\n {\n id: subContext.contentId,\n \"aria-labelledby\": subContext.triggerId,\n ...subContentProps,\n ref: composedRefs,\n align: \"start\",\n side: rootContext.dir === \"rtl\" ? \"left\" : \"right\",\n disableOutsidePointerEvents: false,\n disableOutsideScroll: false,\n trapFocus: false,\n onOpenAutoFocus: (event) => {\n if (rootContext.isUsingKeyboardRef.current) ref.current?.focus();\n event.preventDefault();\n },\n onCloseAutoFocus: (event) => event.preventDefault(),\n onFocusOutside: composeEventHandlers(props.onFocusOutside, (event) => {\n if (event.target !== subContext.trigger) context.onOpenChange(false);\n }),\n onEscapeKeyDown: composeEventHandlers(props.onEscapeKeyDown, (event) => {\n rootContext.onClose();\n event.preventDefault();\n }),\n onKeyDown: composeEventHandlers(props.onKeyDown, (event) => {\n const isKeyDownInside = event.currentTarget.contains(event.target);\n const isCloseKey = SUB_CLOSE_KEYS[rootContext.dir].includes(event.key);\n if (isKeyDownInside && isCloseKey) {\n context.onOpenChange(false);\n subContext.trigger?.focus();\n event.preventDefault();\n }\n })\n }\n ) }) }) });\n }\n);\nMenuSubContent.displayName = SUB_CONTENT_NAME;\nfunction getOpenState(open) {\n return open ? \"open\" : \"closed\";\n}\nfunction isIndeterminate(checked) {\n return checked === \"indeterminate\";\n}\nfunction getCheckedState(checked) {\n return isIndeterminate(checked) ? \"indeterminate\" : checked ? \"checked\" : \"unchecked\";\n}\nfunction focusFirst(candidates) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\nfunction wrapArray(array, startIndex) {\n return array.map((_, index) => array[(startIndex + index) % array.length]);\n}\nfunction getNextMatch(values, search, currentMatch) {\n const isRepeated = search.length > 1 && Array.from(search).every((char) => char === search[0]);\n const normalizedSearch = isRepeated ? search[0] : search;\n const currentMatchIndex = currentMatch ? values.indexOf(currentMatch) : -1;\n let wrappedValues = wrapArray(values, Math.max(currentMatchIndex, 0));\n const excludeCurrentMatch = normalizedSearch.length === 1;\n if (excludeCurrentMatch) wrappedValues = wrappedValues.filter((v) => v !== currentMatch);\n const nextMatch = wrappedValues.find(\n (value) => value.toLowerCase().startsWith(normalizedSearch.toLowerCase())\n );\n return nextMatch !== currentMatch ? nextMatch : void 0;\n}\nfunction isPointInPolygon(point, polygon) {\n const { x, y } = point;\n let inside = false;\n for (let i = 0, j = polygon.length - 1; i < polygon.length; j = i++) {\n const ii = polygon[i];\n const jj = polygon[j];\n const xi = ii.x;\n const yi = ii.y;\n const xj = jj.x;\n const yj = jj.y;\n const intersect = yi > y !== yj > y && x < (xj - xi) * (y - yi) / (yj - yi) + xi;\n if (intersect) inside = !inside;\n }\n return inside;\n}\nfunction isPointerInGraceArea(event, area) {\n if (!area) return false;\n const cursorPos = { x: event.clientX, y: event.clientY };\n return isPointInPolygon(cursorPos, area);\n}\nfunction whenMouse(handler) {\n return (event) => event.pointerType === \"mouse\" ? handler(event) : void 0;\n}\nvar Root3 = Menu;\nvar Anchor2 = MenuAnchor;\nvar Portal = MenuPortal;\nvar Content2 = MenuContent;\nvar Group = MenuGroup;\nvar Label = MenuLabel;\nvar Item2 = MenuItem;\nvar CheckboxItem = MenuCheckboxItem;\nvar RadioGroup = MenuRadioGroup;\nvar RadioItem = MenuRadioItem;\nvar ItemIndicator = MenuItemIndicator;\nvar Separator = MenuSeparator;\nvar Arrow2 = MenuArrow;\nvar Sub = MenuSub;\nvar SubTrigger = MenuSubTrigger;\nvar SubContent = MenuSubContent;\nexport {\n Anchor2 as Anchor,\n Arrow2 as Arrow,\n CheckboxItem,\n Content2 as Content,\n Group,\n Item2 as Item,\n ItemIndicator,\n Label,\n Menu,\n MenuAnchor,\n MenuArrow,\n MenuCheckboxItem,\n MenuContent,\n MenuGroup,\n MenuItem,\n MenuItemIndicator,\n MenuLabel,\n MenuPortal,\n MenuRadioGroup,\n MenuRadioItem,\n MenuSeparator,\n MenuSub,\n MenuSubContent,\n MenuSubTrigger,\n Portal,\n RadioGroup,\n RadioItem,\n Root3 as Root,\n Separator,\n Sub,\n SubContent,\n SubTrigger,\n createMenuScope\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["SELECTION_KEYS","FIRST_KEYS","LAST_KEYS","FIRST_LAST_KEYS","SUB_OPEN_KEYS","SUB_CLOSE_KEYS","MENU_NAME","Collection","useCollection","createCollectionScope","createCollection","createMenuContext","createMenuScope","createContextScope","createPopperScope","createRovingFocusGroupScope","usePopperScope","useRovingFocusGroupScope","MenuProvider","useMenuContext","MenuRootProvider","useMenuRootContext","Menu","props","__scopeMenu","open","children","dir","onOpenChange","modal","popperScope","content","setContent","React","isUsingKeyboardRef","handleOpenChange","useCallbackRef","direction","useDirection","handleKeyDown","handlePointer","jsx","PopperPrimitive.Root","ANCHOR_NAME","MenuAnchor","forwardedRef","anchorProps","PopperPrimitive.Anchor","PORTAL_NAME","PortalProvider","usePortalContext","MenuPortal","forceMount","container","context","Presence","PortalPrimitive","CONTENT_NAME","MenuContentProvider","useMenuContentContext","MenuContent","portalContext","contentProps","rootContext","MenuRootContentModal","MenuRootContentNonModal","ref","composedRefs","useComposedRefs","hideOthers","MenuContentImpl","composeEventHandlers","event","Slot","createSlot","loop","trapFocus","onOpenAutoFocus","onCloseAutoFocus","disableOutsidePointerEvents","onEntryFocus","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","disableOutsideScroll","rovingFocusGroupScope","getItems","currentItemId","setCurrentItemId","contentRef","timerRef","searchRef","pointerGraceTimerRef","pointerGraceIntentRef","pointerDirRef","lastPointerXRef","ScrollLockWrapper","RemoveScroll","scrollLockWrapperProps","handleTypeaheadSearch","key","search","items","item","currentItem","currentMatch","_a","values","nextMatch","getNextMatch","newItem","_b","updateSearch","value","useFocusGuards","isPointerMovingToSubmenu","isPointerInGraceArea","intent","FocusScope","DismissableLayer","RovingFocusGroup.Root","PopperPrimitive.Content","getOpenState","isKeyDownInside","isModifierKey","isCharacterKey","candidateNodes","focusFirst","whenMouse","target","pointerXHasChanged","newDir","GROUP_NAME","MenuGroup","groupProps","Primitive","LABEL_NAME","MenuLabel","labelProps","ITEM_NAME","ITEM_SELECT","MenuItem","disabled","onSelect","itemProps","contentContext","isPointerDownRef","handleSelect","menuItem","itemSelectEvent","dispatchDiscreteCustomEvent","MenuItemImpl","isTypingAhead","textValue","isFocused","setIsFocused","textContent","setTextContent","RovingFocusGroup.Item","CHECKBOX_ITEM_NAME","MenuCheckboxItem","checked","onCheckedChange","checkboxItemProps","ItemIndicatorProvider","isIndeterminate","getCheckedState","RADIO_GROUP_NAME","RadioGroupProvider","useRadioGroupContext","MenuRadioGroup","onValueChange","handleValueChange","RADIO_ITEM_NAME","MenuRadioItem","radioItemProps","ITEM_INDICATOR_NAME","useItemIndicatorContext","MenuItemIndicator","itemIndicatorProps","indicatorContext","SEPARATOR_NAME","MenuSeparator","separatorProps","ARROW_NAME","MenuArrow","arrowProps","PopperPrimitive.Arrow","SUB_NAME","MenuSubProvider","useMenuSubContext","SUB_TRIGGER_NAME","MenuSubTrigger","subContext","openTimerRef","onPointerGraceIntentChange","scope","clearOpenTimer","pointerGraceTimer","composeRefs","contentRect","side","rightSide","bleed","contentNearEdge","contentFarEdge","SUB_CONTENT_NAME","MenuSubContent","subContentProps","isCloseKey","candidates","PREVIOUSLY_FOCUSED_ELEMENT","candidate","wrapArray","array","startIndex","_","index","normalizedSearch","char","currentMatchIndex","wrappedValues","v","isPointInPolygon","point","polygon","x","y","inside","i","j","ii","jj","xi","yi","xj","yj","area","cursorPos","handler","Root3","Anchor2","Portal","Content2","Group","Label","Item2","CheckboxItem","RadioGroup","RadioItem","ItemIndicator","Separator","Arrow2","SubTrigger","SubContent"],"mappings":";;;;;;;;;;;;;;;;;;;AAyBA,IAAIA,IAAiB,CAAC,SAAS,GAAG,GAC9BC,KAAa,CAAC,aAAa,UAAU,MAAM,GAC3CC,KAAY,CAAC,WAAW,YAAY,KAAK,GACzCC,KAAkB,CAAC,GAAGF,IAAY,GAAGC,EAAS,GAC9CE,KAAgB;AAAA,EAClB,KAAK,CAAC,GAAGJ,GAAgB,YAAY;AAAA,EACrC,KAAK,CAAC,GAAGA,GAAgB,WAAW;AACtC,GACIK,KAAiB;AAAA,EACnB,KAAK,CAAC,WAAW;AAAA,EACjB,KAAK,CAAC,YAAY;AACpB,GACIC,IAAY,QACZ,CAACC,GAAYC,IAAeC,EAAqB,IAAIC,GAAiBJ,CAAS,GAC/E,CAACK,GAAmBC,EAAe,IAAIC,GAAmBP,GAAW;AAAA,EACvEG;AAAA,EACAK;AAAA,EACAC;AACF,CAAC,GACGC,IAAiBF,GAAiB,GAClCG,KAA2BF,GAA2B,GACtD,CAACG,IAAcC,CAAc,IAAIR,EAAkBL,CAAS,GAC5D,CAACc,IAAkBC,CAAkB,IAAIV,EAAkBL,CAAS,GACpEgB,KAAO,CAACC,MAAU;AACpB,QAAM,EAAE,aAAAC,GAAa,MAAAC,IAAO,IAAO,UAAAC,GAAU,KAAAC,GAAK,cAAAC,GAAc,OAAAC,IAAQ,GAAI,IAAKN,GAC3EO,IAAcd,EAAeQ,CAAW,GACxC,CAACO,GAASC,CAAU,IAAIC,EAAM,SAAS,IAAI,GAC3CC,IAAqBD,EAAM,OAAO,EAAK,GACvCE,IAAmBC,GAAeR,CAAY,GAC9CS,IAAYC,GAAaX,CAAG;AAClC,SAAAM,EAAM,UAAU,MAAM;AACpB,UAAMM,IAAgB,MAAM;AA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AAO,CAACzK,MAAUA,EAAM,gBAAgB,UAAUyK,EAAQzK,CAAK,IAAI;AACrE;AACG,IAAC0K,KAAQ5N,IACR6N,KAAUvM,IACVwM,KAASjM,IACTkM,KAAWzL,IACX0L,KAAQ/G,IACRgH,KAAQ5G,IACR6G,KAAQzG,GACR0G,KAAevF,IACfwF,KAAa9E,IACb+E,KAAY3E,IACZ4E,KAAgBxE,IAChByE,KAAYrE,IACZsE,KAASnE,IAEToE,KAAa7D,IACb8D,KAAa/C;","x_google_ignoreList":[0]}
@@ -1,72 +1,14 @@
1
- import * as a from "react";
2
- import { useComposedRefs as E } from "./index.es454.js";
3
- import { useLayoutEffect as A } from "./index.es463.js";
4
- function T(n, e) {
5
- return a.useReducer((r, t) => e[r][t] ?? r, n);
6
- }
7
- var R = (n) => {
8
- const { present: e, children: r } = n, t = v(e), i = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = E(t.ref, P(i));
9
- return typeof r == "function" || t.isPresent ? a.cloneElement(i, { ref: c }) : null;
10
- };
11
- R.displayName = "Presence";
12
- function v(n) {
13
- const [e, r] = a.useState(), t = a.useRef(null), i = a.useRef(n), c = a.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = T(p, {
14
- mounted: {
15
- UNMOUNT: "unmounted",
16
- ANIMATION_OUT: "unmountSuspended"
17
- },
18
- unmountSuspended: {
19
- MOUNT: "mounted",
20
- ANIMATION_END: "unmounted"
21
- },
22
- unmounted: {
23
- MOUNT: "mounted"
24
- }
25
- });
26
- return a.useEffect(() => {
27
- const o = l(t.current);
28
- c.current = N === "mounted" ? o : "none";
29
- }, [N]), A(() => {
30
- const o = t.current, m = i.current;
31
- if (m !== n) {
32
- const f = c.current, u = l(o);
33
- n ? s("MOUNT") : u === "none" || (o == null ? void 0 : o.display) === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), i.current = n;
34
- }
35
- }, [n, s]), A(() => {
36
- if (e) {
37
- let o;
38
- const m = e.ownerDocument.defaultView ?? window, d = (u) => {
39
- const g = l(t.current).includes(CSS.escape(u.animationName));
40
- if (u.target === e && g && (s("ANIMATION_END"), !i.current)) {
41
- const O = e.style.animationFillMode;
42
- e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
43
- e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
44
- });
45
- }
46
- }, f = (u) => {
47
- u.target === e && (c.current = l(t.current));
48
- };
49
- return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
50
- m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
51
- };
52
- } else
53
- s("ANIMATION_END");
54
- }, [e, s]), {
55
- isPresent: ["mounted", "unmountSuspended"].includes(N),
56
- ref: a.useCallback((o) => {
57
- t.current = o ? getComputedStyle(o) : null, r(o);
58
- }, [])
59
- };
60
- }
61
- function l(n) {
62
- return (n == null ? void 0 : n.animationName) || "none";
63
- }
64
- function P(n) {
65
- var t, i;
66
- let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
67
- return r ? n.ref : (e = (i = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : i.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
1
+ import * as o from "react";
2
+ import { useLayoutEffect as a } from "./index.es463.js";
3
+ var s = o[" useId ".trim().toString()] || (() => {
4
+ }), f = 0;
5
+ function i(t) {
6
+ const [e, r] = o.useState(s());
7
+ return a(() => {
8
+ r((u) => u ?? String(f++));
9
+ }, [t]), t || (e ? `radix-${e}` : "");
68
10
  }
69
11
  export {
70
- R as Presence
12
+ i as useId
71
13
  };
72
14
  //# sourceMappingURL=index.es462.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es462.js","sources":["../node_modules/@radix-ui/react-presence/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/presence.tsx\nimport * as React2 from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\n\n// src/use-state-machine.tsx\nimport * as React from \"react\";\nfunction useStateMachine(initialState, machine) {\n return React.useReducer((state, event) => {\n const nextState = machine[state][event];\n return nextState ?? state;\n }, initialState);\n}\n\n// src/presence.tsx\nvar Presence = (props) => {\n const { present, children } = props;\n const presence = usePresence(present);\n const child = typeof children === \"function\" ? children({ present: presence.isPresent }) : React2.Children.only(children);\n const ref = useComposedRefs(presence.ref, getElementRef(child));\n const forceMount = typeof children === \"function\";\n return forceMount || presence.isPresent ? React2.cloneElement(child, { ref }) : null;\n};\nPresence.displayName = \"Presence\";\nfunction usePresence(present) {\n const [node, setNode] = React2.useState();\n const stylesRef = React2.useRef(null);\n const prevPresentRef = React2.useRef(present);\n const prevAnimationNameRef = React2.useRef(\"none\");\n const initialState = present ? \"mounted\" : \"unmounted\";\n const [state, send] = useStateMachine(initialState, {\n mounted: {\n UNMOUNT: \"unmounted\",\n ANIMATION_OUT: \"unmountSuspended\"\n },\n unmountSuspended: {\n MOUNT: \"mounted\",\n ANIMATION_END: \"unmounted\"\n },\n unmounted: {\n MOUNT: \"mounted\"\n }\n });\n React2.useEffect(() => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === \"mounted\" ? currentAnimationName : \"none\";\n }, [state]);\n useLayoutEffect(() => {\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = getAnimationName(styles);\n if (present) {\n send(\"MOUNT\");\n } else if (currentAnimationName === \"none\" || styles?.display === \"none\") {\n send(\"UNMOUNT\");\n } else {\n const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) {\n send(\"ANIMATION_OUT\");\n } else {\n send(\"UNMOUNT\");\n }\n }\n prevPresentRef.current = present;\n }\n }, [present, send]);\n useLayoutEffect(() => {\n if (node) {\n let timeoutId;\n const ownerWindow = node.ownerDocument.defaultView ?? window;\n const handleAnimationEnd = (event) => {\n const currentAnimationName = getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));\n if (event.target === node && isCurrentAnimation) {\n send(\"ANIMATION_END\");\n if (!prevPresentRef.current) {\n const currentFillMode = node.style.animationFillMode;\n node.style.animationFillMode = \"forwards\";\n timeoutId = ownerWindow.setTimeout(() => {\n if (node.style.animationFillMode === \"forwards\") {\n node.style.animationFillMode = currentFillMode;\n }\n });\n }\n }\n };\n const handleAnimationStart = (event) => {\n if (event.target === node) {\n prevAnimationNameRef.current = getAnimationName(stylesRef.current);\n }\n };\n node.addEventListener(\"animationstart\", handleAnimationStart);\n node.addEventListener(\"animationcancel\", handleAnimationEnd);\n node.addEventListener(\"animationend\", handleAnimationEnd);\n return () => {\n ownerWindow.clearTimeout(timeoutId);\n node.removeEventListener(\"animationstart\", handleAnimationStart);\n node.removeEventListener(\"animationcancel\", handleAnimationEnd);\n node.removeEventListener(\"animationend\", handleAnimationEnd);\n };\n } else {\n send(\"ANIMATION_END\");\n }\n }, [node, send]);\n return {\n isPresent: [\"mounted\", \"unmountSuspended\"].includes(state),\n ref: React2.useCallback((node2) => {\n stylesRef.current = node2 ? getComputedStyle(node2) : null;\n setNode(node2);\n }, [])\n };\n}\nfunction getAnimationName(styles) {\n return styles?.animationName || \"none\";\n}\nfunction getElementRef(element) {\n let getter = Object.getOwnPropertyDescriptor(element.props, \"ref\")?.get;\n let mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.ref;\n }\n getter = Object.getOwnPropertyDescriptor(element, \"ref\")?.get;\n mayWarn = getter && \"isReactWarning\" in getter && getter.isReactWarning;\n if (mayWarn) {\n return element.props.ref;\n }\n return element.props.ref || element.ref;\n}\nvar Root = Presence;\nexport {\n Presence,\n Root\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useStateMachine","initialState","machine","React","state","event","Presence","props","present","children","presence","usePresence","child","React2","ref","useComposedRefs","getElementRef","node","setNode","stylesRef","prevPresentRef","prevAnimationNameRef","send","currentAnimationName","getAnimationName","useLayoutEffect","styles","wasPresent","prevAnimationName","timeoutId","ownerWindow","handleAnimationEnd","isCurrentAnimation","currentFillMode","handleAnimationStart","node2","element","getter","_a","mayWarn","_b"],"mappings":";;;AASA,SAASA,EAAgBC,GAAcC,GAAS;AAC9C,SAAOC,EAAM,WAAW,CAACC,GAAOC,MACZH,EAAQE,CAAK,EAAEC,CAAK,KAClBD,GACnBH,CAAY;AACjB;AAGG,IAACK,IAAW,CAACC,MAAU;AACxB,QAAM,EAAE,SAAAC,GAAS,UAAAC,EAAQ,IAAKF,GACxBG,IAAWC,EAAYH,CAAO,GAC9BI,IAAQ,OAAOH,KAAa,aAAaA,EAAS,EAAE,SAASC,EAAS,UAAS,CAAE,IAAIG,EAAO,SAAS,KAAKJ,CAAQ,GAClHK,IAAMC,EAAgBL,EAAS,KAAKM,EAAcJ,CAAK,CAAC;AAE9D,SADmB,OAAOH,KAAa,cAClBC,EAAS,YAAYG,EAAO,aAAaD,GAAO,EAAE,KAAAE,EAAG,CAAE,IAAI;AAClF;AACAR,EAAS,cAAc;AACvB,SAASK,EAAYH,GAAS;AAC5B,QAAM,CAACS,GAAMC,CAAO,IAAIL,EAAO,SAAQ,GACjCM,IAAYN,EAAO,OAAO,IAAI,GAC9BO,IAAiBP,EAAO,OAAOL,CAAO,GACtCa,IAAuBR,EAAO,OAAO,MAAM,GAC3CZ,IAAeO,IAAU,YAAY,aACrC,CAACJ,GAAOkB,CAAI,IAAItB,EAAgBC,GAAc;AAAA,IAClD,SAAS;AAAA,MACP,SAAS;AAAA,MACT,eAAe;AAAA,IACrB;AAAA,IACI,kBAAkB;AAAA,MAChB,OAAO;AAAA,MACP,eAAe;AAAA,IACrB;AAAA,IACI,WAAW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CAAoB,GAC5DjB,EAAK,iBAAiB,mBAAmBc,CAAkB,GAC3Dd,EAAK,iBAAiB,gBAAgBc,CAAkB,GACjD,MAAM;AACX,QAAAD,EAAY,aAAaD,CAAS,GAClCZ,EAAK,oBAAoB,kBAAkBiB,CAAoB,GAC/DjB,EAAK,oBAAoB,mBAAmBc,CAAkB,GAC9Dd,EAAK,oBAAoB,gBAAgBc,CAAkB;AAAA,MAC7D;AAAA,IACF;AACE,MAAAT,EAAK,eAAe;AAAA,EAExB,GAAG,CAACL,GAAMK,CAAI,CAAC,GACR;AAAA,IACL,WAAW,CAAC,WAAW,kBAAkB,EAAE,SAASlB,CAAK;AAAA,IACzD,KAAKS,EAAO,YAAY,CAACsB,MAAU;AACjC,MAAAhB,EAAU,UAAUgB,IAAQ,iBAAiBA,CAAK,IAAI,MACtDjB,EAAQiB,CAAK;AAAA,IACf,GAAG,CAAA,CAAE;AAAA,EACT;AACA;AACA,SAASX,EAAiBE,GAAQ;AAChC,UAAOA,KAAA,gBAAAA,EAAQ,kBAAiB;AAClC;AACA,SAASV,EAAcoB,GAAS;;AAC9B,MAAIC,KAASC,IAAA,OAAO,yBAAyBF,EAAQ,OAAO,KAAK,MAApD,gBAAAE,EAAuD,KAChEC,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO;AAC7D,SAAIE,IACKH,EAAQ,OAEjBC,KAASG,IAAA,OAAO,yBAAyBJ,GAAS,KAAK,MAA9C,gBAAAI,EAAiD,KAC1DD,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO,gBACrDE,IACKH,EAAQ,MAAM,MAEhBA,EAAQ,MAAM,OAAOA,EAAQ;AACtC;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es462.js","sources":["../node_modules/@radix-ui/react-id/dist/index.mjs"],"sourcesContent":["// packages/react/id/src/id.tsx\nimport * as React from \"react\";\nimport { useLayoutEffect } from \"@radix-ui/react-use-layout-effect\";\nvar useReactId = React[\" useId \".trim().toString()] || (() => void 0);\nvar count = 0;\nfunction useId(deterministicId) {\n const [id, setId] = React.useState(useReactId());\n useLayoutEffect(() => {\n if (!deterministicId) setId((reactId) => reactId ?? String(count++));\n }, [deterministicId]);\n return deterministicId || (id ? `radix-${id}` : \"\");\n}\nexport {\n useId\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["useReactId","React","count","useId","deterministicId","id","setId","useLayoutEffect","reactId"],"mappings":";;AAGA,IAAIA,IAAaC,EAAM,UAAU,KAAI,EAAG,SAAQ,CAAE,MAAM,MAAA;AAAA,IACpDC,IAAQ;AACZ,SAASC,EAAMC,GAAiB;AAC9B,QAAM,CAACC,GAAIC,CAAK,IAAIL,EAAM,SAASD,GAAY;AAC/CO,SAAAA,EAAgB,MAAM;AACE,IAAAD,EAAM,CAACE,MAAYA,KAAW,OAAON,GAAO,CAAC;AAAA,EACrE,GAAG,CAACE,CAAe,CAAC,GACbA,MAAoBC,IAAK,SAASA,CAAE,KAAK;AAClD;","x_google_ignoreList":[0]}
@@ -1,5 +1,5 @@
1
1
  import * as l from "react";
2
- import { composeRefs as y } from "./index.es454.js";
2
+ import { composeRefs as y } from "./index.es453.js";
3
3
  import { j as p } from "./index.es225.js";
4
4
  // @__NO_SIDE_EFFECTS__
5
5
  function S(e) {
@@ -1,49 +1,18 @@
1
- import r from "react";
2
- import { createContextScope as y } from "./index.es455.js";
3
- import { useComposedRefs as S } from "./index.es454.js";
4
- import { createSlot as M } from "./index.es464.js";
5
- import { j as d } from "./index.es225.js";
6
- function D(s) {
7
- const m = s + "CollectionProvider", [A, E] = y(m), [N, f] = A(
8
- m,
9
- { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
- ), p = (c) => {
11
- const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
12
- return /* @__PURE__ */ d.jsx(N, { scope: e, itemMap: t, collectionRef: o, children: l });
13
- };
14
- p.displayName = m;
15
- const a = s + "CollectionSlot", _ = M(a), C = r.forwardRef(
16
- (c, e) => {
17
- const { scope: l, children: o } = c, t = f(a, l), n = S(e, t.collectionRef);
18
- return /* @__PURE__ */ d.jsx(_, { ref: n, children: o });
1
+ import { useState as n, useCallback as i } from "react";
2
+ import "./index.es654.js";
3
+ function c() {
4
+ const [t, o] = n(null), e = i(async (r) => {
5
+ if (!(navigator != null && navigator.clipboard))
6
+ return console.warn("Clipboard not supported"), !1;
7
+ try {
8
+ return await navigator.clipboard.writeText(r), o(r), !0;
9
+ } catch (a) {
10
+ return console.warn("Copy failed", a), o(null), !1;
19
11
  }
20
- );
21
- C.displayName = a;
22
- const u = s + "CollectionItemSlot", R = "data-radix-collection-item", T = M(u), x = r.forwardRef(
23
- (c, e) => {
24
- const { scope: l, children: o, ...t } = c, n = r.useRef(null), I = S(e, n), i = f(u, l);
25
- return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ d.jsx(T, { [R]: "", ref: I, children: o });
26
- }
27
- );
28
- x.displayName = u;
29
- function O(c) {
30
- const e = f(s + "CollectionConsumer", c);
31
- return r.useCallback(() => {
32
- const o = e.collectionRef.current;
33
- if (!o) return [];
34
- const t = Array.from(o.querySelectorAll(`[${R}]`));
35
- return Array.from(e.itemMap.values()).sort(
36
- (i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
37
- );
38
- }, [e.collectionRef, e.itemMap]);
39
- }
40
- return [
41
- { Provider: p, Slot: C, ItemSlot: x },
42
- O,
43
- E
44
- ];
12
+ }, []);
13
+ return [t, e];
45
14
  }
46
15
  export {
47
- D as createCollection
16
+ c as useCopyToClipboard
48
17
  };
49
18
  //# sourceMappingURL=index.es465.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es465.js","sources":["../node_modules/@radix-ui/react-collection/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/collection-legacy.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\n\n// src/collection.tsx\nimport React2 from \"react\";\nimport { createContextScope as createContextScope2 } from \"@radix-ui/react-context\";\nimport { useComposedRefs as useComposedRefs2 } from \"@radix-ui/react-compose-refs\";\nimport { createSlot as createSlot2 } from \"@radix-ui/react-slot\";\n\n// src/ordered-dictionary.ts\nvar __instanciated = /* @__PURE__ */ new WeakMap();\nvar OrderedDict = class _OrderedDict extends Map {\n #keys;\n constructor(entries) {\n super(entries);\n this.#keys = [...super.keys()];\n __instanciated.set(this, true);\n }\n set(key, value) {\n if (__instanciated.get(this)) {\n if (this.has(key)) {\n this.#keys[this.#keys.indexOf(key)] = key;\n } else {\n this.#keys.push(key);\n }\n }\n super.set(key, value);\n return this;\n }\n insert(index, key, value) {\n const has = this.has(key);\n const length = this.#keys.length;\n const relativeIndex = toSafeInteger(index);\n let actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n const safeIndex = actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {\n this.set(key, value);\n return this;\n }\n const size = this.size + (has ? 0 : 1);\n if (relativeIndex < 0) {\n actualIndex++;\n }\n const keys = [...this.#keys];\n let nextValue;\n let shouldSkip = false;\n for (let i = actualIndex; i < size; i++) {\n if (actualIndex === i) {\n let nextKey = keys[i];\n if (keys[i] === key) {\n nextKey = keys[i + 1];\n }\n if (has) {\n this.delete(key);\n }\n nextValue = this.get(nextKey);\n this.set(key, value);\n } else {\n if (!shouldSkip && keys[i - 1] === key) {\n shouldSkip = true;\n }\n const currentKey = keys[shouldSkip ? i : i - 1];\n const currentValue = nextValue;\n nextValue = this.get(currentKey);\n this.delete(currentKey);\n this.set(currentKey, currentValue);\n }\n }\n return this;\n }\n with(index, key, value) {\n const copy = new _OrderedDict(this);\n copy.insert(index, key, value);\n return copy;\n }\n before(key) {\n const index = this.#keys.indexOf(key) - 1;\n if (index < 0) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position before the given key.\n */\n setBefore(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index, newKey, value);\n }\n after(key) {\n let index = this.#keys.indexOf(key);\n index = index === -1 || index === this.size - 1 ? -1 : index + 1;\n if (index === -1) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position after the given key.\n */\n setAfter(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index + 1, newKey, value);\n }\n first() {\n return this.entryAt(0);\n }\n last() {\n return this.entryAt(-1);\n }\n clear() {\n this.#keys = [];\n return super.clear();\n }\n delete(key) {\n const deleted = super.delete(key);\n if (deleted) {\n this.#keys.splice(this.#keys.indexOf(key), 1);\n }\n return deleted;\n }\n deleteAt(index) {\n const key = this.keyAt(index);\n if (key !== void 0) {\n return this.delete(key);\n }\n return false;\n }\n at(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return this.get(key);\n }\n }\n entryAt(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return [key, this.get(key)];\n }\n }\n indexOf(key) {\n return this.#keys.indexOf(key);\n }\n keyAt(index) {\n return at(this.#keys, index);\n }\n from(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.at(dest);\n }\n keyFrom(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.keyAt(dest);\n }\n find(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return entry;\n }\n index++;\n }\n return void 0;\n }\n findIndex(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return index;\n }\n index++;\n }\n return -1;\n }\n filter(predicate, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n entries.push(entry);\n }\n index++;\n }\n return new _OrderedDict(entries);\n }\n map(callbackfn, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index, this])]);\n index++;\n }\n return new _OrderedDict(entries);\n }\n reduce(...args) {\n const [callbackfn, initialValue] = args;\n let index = 0;\n let accumulator = initialValue ?? this.at(0);\n for (const entry of this) {\n if (index === 0 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n index++;\n }\n return accumulator;\n }\n reduceRight(...args) {\n const [callbackfn, initialValue] = args;\n let accumulator = initialValue ?? this.at(-1);\n for (let index = this.size - 1; index >= 0; index--) {\n const entry = this.at(index);\n if (index === this.size - 1 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n }\n return accumulator;\n }\n toSorted(compareFn) {\n const entries = [...this.entries()].sort(compareFn);\n return new _OrderedDict(entries);\n }\n toReversed() {\n const reversed = new _OrderedDict();\n for (let index = this.size - 1; index >= 0; index--) {\n const key = this.keyAt(index);\n const element = this.get(key);\n reversed.set(key, element);\n }\n return reversed;\n }\n toSpliced(...args) {\n const entries = [...this.entries()];\n entries.splice(...args);\n return new _OrderedDict(entries);\n }\n slice(start, end) {\n const result = new _OrderedDict();\n let stop = this.size - 1;\n if (start === void 0) {\n return result;\n }\n if (start < 0) {\n start = start + this.size;\n }\n if (end !== void 0 && end > 0) {\n stop = end - 1;\n }\n for (let index = start; index <= stop; index++) {\n const key = this.keyAt(index);\n const element = this.get(key);\n result.set(key, element);\n }\n return result;\n }\n every(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (!Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return false;\n }\n index++;\n }\n return true;\n }\n some(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return true;\n }\n index++;\n }\n return false;\n }\n};\nfunction at(array, index) {\n if (\"at\" in Array.prototype) {\n return Array.prototype.at.call(array, index);\n }\n const actualIndex = toSafeIndex(array, index);\n return actualIndex === -1 ? void 0 : array[actualIndex];\n}\nfunction toSafeIndex(array, index) {\n const length = array.length;\n const relativeIndex = toSafeInteger(index);\n const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n}\nfunction toSafeInteger(number) {\n return number !== number || number === 0 ? 0 : Math.trunc(number);\n}\n\n// src/collection.tsx\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nfunction createCollection2(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope2(PROVIDER_NAME);\n const [CollectionContextProvider, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n {\n collectionElement: null,\n collectionRef: { current: null },\n collectionRefObject: { current: null },\n itemMap: new OrderedDict(),\n setItemMap: () => void 0\n }\n );\n const CollectionProvider = ({ state, ...props }) => {\n return state ? /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx2(CollectionInit, { ...props });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const CollectionInit = (props) => {\n const state = useInitCollection();\n return /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state });\n };\n CollectionInit.displayName = PROVIDER_NAME + \"Init\";\n const CollectionProviderImpl = (props) => {\n const { scope, children, state } = props;\n const ref = React2.useRef(null);\n const [collectionElement, setCollectionElement] = React2.useState(\n null\n );\n const composeRefs = useComposedRefs2(ref, setCollectionElement);\n const [itemMap, setItemMap] = state;\n React2.useEffect(() => {\n if (!collectionElement) return;\n const observer = getChildListObserver(() => {\n });\n observer.observe(collectionElement, {\n childList: true,\n subtree: true\n });\n return () => {\n observer.disconnect();\n };\n }, [collectionElement]);\n return /* @__PURE__ */ jsx2(\n CollectionContextProvider,\n {\n scope,\n itemMap,\n setItemMap,\n collectionRef: composeRefs,\n collectionRefObject: ref,\n collectionElement,\n children\n }\n );\n };\n CollectionProviderImpl.displayName = PROVIDER_NAME + \"Impl\";\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);\n const CollectionSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx2(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);\n const CollectionItemSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React2.useRef(null);\n const [element, setElement] = React2.useState(null);\n const composedRefs = useComposedRefs2(forwardedRef, ref, setElement);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n const { setItemMap } = context;\n const itemDataRef = React2.useRef(itemData);\n if (!shallowEqual(itemDataRef.current, itemData)) {\n itemDataRef.current = itemData;\n }\n const memoizedItemData = itemDataRef.current;\n React2.useEffect(() => {\n const itemData2 = memoizedItemData;\n setItemMap((map) => {\n if (!element) {\n return map;\n }\n if (!map.has(element)) {\n map.set(element, { ...itemData2, element });\n return map.toSorted(sortByDocumentPosition);\n }\n return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);\n });\n return () => {\n setItemMap((map) => {\n if (!element || !map.has(element)) {\n return map;\n }\n map.delete(element);\n return new OrderedDict(map);\n });\n };\n }, [element, memoizedItemData, setItemMap]);\n return /* @__PURE__ */ jsx2(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useInitCollection() {\n return React2.useState(new OrderedDict());\n }\n function useCollection(scope) {\n const { itemMap } = useCollectionContext(name + \"CollectionConsumer\", scope);\n return itemMap;\n }\n const functions = {\n createCollectionScope,\n useCollection,\n useInitCollection\n };\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n functions\n ];\n}\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n if (typeof a !== \"object\" || typeof b !== \"object\") return false;\n if (a == null || b == null) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) return false;\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\nfunction isElementPreceding(a, b) {\n return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);\n}\nfunction sortByDocumentPosition(a, b) {\n return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;\n}\nfunction getChildListObserver(callback) {\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n callback();\n return;\n }\n }\n });\n return observer;\n}\nexport {\n createCollection,\n createCollection2 as unstable_createCollection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlotImpl","createSlot","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlotImpl","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b"],"mappings":";;;;;AAQA,SAASA,EAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAACI,GAAwBC,CAAoB,IAAIJ;AAAA,IACrDD;AAAA,IACA,EAAE,eAAe,EAAE,SAAS,KAAI,GAAI,SAAyB,oBAAI,IAAG,EAAE;AAAA,EAC1E,GACQM,IAAqB,CAACC,MAAU;AACpC,UAAM,EAAE,OAAAC,GAAO,UAAAC,EAAQ,IAAKF,GACtBG,IAAMC,EAAM,OAAO,IAAI,GACvBC,IAAUD,EAAM,OAAuB,oBAAI,IAAG,CAAE,EAAE;AACxD,WAAuBE,gBAAAA,EAAAA,IAAIT,GAAwB,EAAE,OAAAI,GAAO,SAAAI,GAAS,eAAeF,GAAK,UAAAD,GAAU;AAAA,EACrG;AACA,EAAAH,EAAmB,cAAcN;AACjC,QAAMc,IAAuBf,IAAO,kBAC9BgB,IAAqBC,EAAWF,CAAoB,GACpDG,IAAiBN,EAAM;AAAA,IAC3B,CAACJ,GAAOW,MAAiB;AACvB,YAAM,EAAE,OAAAV,GAAO,UAAAC,EAAQ,IAAKF,GACtBY,IAAUd,EAAqBS,GAAsBN,CAAK,GAC1DY,IAAeC,EAAgBH,GAAcC,EAAQ,aAAa;AACxE,aAAuBN,gBAAAA,EAAAA,IAAIE,G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AAoB,MAAMW,GAAgB,UAAUQ,EAAkB;AAAA,IAClFE;AAAA,IACAzB;AAAA,EACJ;AACA;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es465.js","sources":["../node_modules/usehooks-ts/dist/index.js"],"sourcesContent":["import { useState, useCallback, useLayoutEffect, useEffect, useRef, useMemo } from 'react';\nimport debounce from 'lodash.debounce';\n\n// src/useBoolean/useBoolean.ts\nfunction useBoolean(defaultValue = false) {\n if (typeof defaultValue !== \"boolean\") {\n throw new Error(\"defaultValue must be `true` or `false`\");\n }\n const [value, setValue] = useState(defaultValue);\n const setTrue = useCallback(() => {\n setValue(true);\n }, []);\n const setFalse = useCallback(() => {\n setValue(false);\n }, []);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return { value, setValue, setTrue, setFalse, toggle };\n}\nvar useIsomorphicLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\n\n// src/useEventListener/useEventListener.ts\nfunction useEventListener(eventName, handler, element, options) {\n const savedHandler = useRef(handler);\n useIsomorphicLayoutEffect(() => {\n savedHandler.current = handler;\n }, [handler]);\n useEffect(() => {\n const targetElement = (element == null ? void 0 : element.current) ?? window;\n if (!(targetElement && targetElement.addEventListener))\n return;\n const listener = (event) => {\n savedHandler.current(event);\n };\n targetElement.addEventListener(eventName, listener, options);\n return () => {\n targetElement.removeEventListener(eventName, listener, options);\n };\n }, [eventName, element, options]);\n}\n\n// src/useClickAnyWhere/useClickAnyWhere.ts\nfunction useClickAnyWhere(handler) {\n useEventListener(\"click\", (event) => {\n handler(event);\n });\n}\nfunction useCopyToClipboard() {\n const [copiedText, setCopiedText] = useState(null);\n const copy = useCallback(async (text) => {\n if (!(navigator == null ? void 0 : navigator.clipboard)) {\n console.warn(\"Clipboard not supported\");\n return false;\n }\n try {\n await navigator.clipboard.writeText(text);\n setCopiedText(text);\n return true;\n } catch (error) {\n console.warn(\"Copy failed\", error);\n setCopiedText(null);\n return false;\n }\n }, []);\n return [copiedText, copy];\n}\nfunction useCounter(initialValue) {\n const [count, setCount] = useState(initialValue ?? 0);\n const increment = useCallback(() => {\n setCount((x) => x + 1);\n }, []);\n const decrement = useCallback(() => {\n setCount((x) => x - 1);\n }, []);\n const reset = useCallback(() => {\n setCount(initialValue ?? 0);\n }, [initialValue]);\n return {\n count,\n increment,\n decrement,\n reset,\n setCount\n };\n}\nfunction useInterval(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (delay === null) {\n return;\n }\n const id = setInterval(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearInterval(id);\n };\n }, [delay]);\n}\n\n// src/useCountdown/useCountdown.ts\nfunction useCountdown({\n countStart,\n countStop = 0,\n intervalMs = 1e3,\n isIncrement = false\n}) {\n const {\n count,\n increment,\n decrement,\n reset: resetCounter\n } = useCounter(countStart);\n const {\n value: isCountdownRunning,\n setTrue: startCountdown,\n setFalse: stopCountdown\n } = useBoolean(false);\n const resetCountdown = useCallback(() => {\n stopCountdown();\n resetCounter();\n }, [stopCountdown, resetCounter]);\n const countdownCallback = useCallback(() => {\n if (count === countStop) {\n stopCountdown();\n return;\n }\n if (isIncrement) {\n increment();\n } else {\n decrement();\n }\n }, [count, countStop, decrement, increment, isIncrement, stopCountdown]);\n useInterval(countdownCallback, isCountdownRunning ? intervalMs : null);\n return [count, { startCountdown, stopCountdown, resetCountdown }];\n}\nfunction useEventCallback(fn) {\n const ref = useRef(() => {\n throw new Error(\"Cannot call an event handler while rendering.\");\n });\n useIsomorphicLayoutEffect(() => {\n ref.current = fn;\n }, [fn]);\n return useCallback((...args) => {\n var _a;\n return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);\n }, [ref]);\n}\n\n// src/useLocalStorage/useLocalStorage.ts\nvar IS_SERVER = typeof window === \"undefined\";\nfunction useLocalStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER) {\n return initialValueToUse;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER) {\n console.warn(\n `Tried setting localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.localStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting localStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER) {\n console.warn(\n `Tried removing localStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.localStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"local-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nvar IS_SERVER2 = typeof window === \"undefined\";\nfunction useMediaQuery(query, {\n defaultValue = false,\n initializeWithValue = true\n} = {}) {\n const getMatches = (query2) => {\n if (IS_SERVER2) {\n return defaultValue;\n }\n return window.matchMedia(query2).matches;\n };\n const [matches, setMatches] = useState(() => {\n if (initializeWithValue) {\n return getMatches(query);\n }\n return defaultValue;\n });\n function handleChange() {\n setMatches(getMatches(query));\n }\n useIsomorphicLayoutEffect(() => {\n const matchMedia = window.matchMedia(query);\n handleChange();\n if (matchMedia.addListener) {\n matchMedia.addListener(handleChange);\n } else {\n matchMedia.addEventListener(\"change\", handleChange);\n }\n return () => {\n if (matchMedia.removeListener) {\n matchMedia.removeListener(handleChange);\n } else {\n matchMedia.removeEventListener(\"change\", handleChange);\n }\n };\n }, [query]);\n return matches;\n}\n\n// src/useDarkMode/useDarkMode.ts\nvar COLOR_SCHEME_QUERY = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY = \"usehooks-ts-dark-mode\";\nfunction useDarkMode(options = {}) {\n const {\n defaultValue,\n localStorageKey = LOCAL_STORAGE_KEY,\n initializeWithValue = true\n } = options;\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY, {\n initializeWithValue,\n defaultValue\n });\n const [isDarkMode, setDarkMode] = useLocalStorage(\n localStorageKey,\n defaultValue ?? isDarkOS ?? false,\n { initializeWithValue }\n );\n useIsomorphicLayoutEffect(() => {\n if (isDarkOS !== isDarkMode) {\n setDarkMode(isDarkOS);\n }\n }, [isDarkOS]);\n return {\n isDarkMode,\n toggle: () => {\n setDarkMode((prev) => !prev);\n },\n enable: () => {\n setDarkMode(true);\n },\n disable: () => {\n setDarkMode(false);\n },\n set: (value) => {\n setDarkMode(value);\n }\n };\n}\nfunction useUnmount(func) {\n const funcRef = useRef(func);\n funcRef.current = func;\n useEffect(\n () => () => {\n funcRef.current();\n },\n []\n );\n}\n\n// src/useDebounceCallback/useDebounceCallback.ts\nfunction useDebounceCallback(func, delay = 500, options) {\n const debouncedFunc = useRef();\n useUnmount(() => {\n if (debouncedFunc.current) {\n debouncedFunc.current.cancel();\n }\n });\n const debounced = useMemo(() => {\n const debouncedFuncInstance = debounce(func, delay, options);\n const wrappedFunc = (...args) => {\n return debouncedFuncInstance(...args);\n };\n wrappedFunc.cancel = () => {\n debouncedFuncInstance.cancel();\n };\n wrappedFunc.isPending = () => {\n return !!debouncedFunc.current;\n };\n wrappedFunc.flush = () => {\n return debouncedFuncInstance.flush();\n };\n return wrappedFunc;\n }, [func, delay, options]);\n useEffect(() => {\n debouncedFunc.current = debounce(func, delay, options);\n }, [func, delay, options]);\n return debounced;\n}\nfunction useDebounceValue(initialValue, delay, options) {\n const eq = (options == null ? void 0 : options.equalityFn) ?? ((left, right) => left === right);\n const unwrappedInitialValue = initialValue instanceof Function ? initialValue() : initialValue;\n const [debouncedValue, setDebouncedValue] = useState(unwrappedInitialValue);\n const previousValueRef = useRef(unwrappedInitialValue);\n const updateDebouncedValue = useDebounceCallback(\n setDebouncedValue,\n delay,\n options\n );\n if (!eq(previousValueRef.current, unwrappedInitialValue)) {\n updateDebouncedValue(unwrappedInitialValue);\n previousValueRef.current = unwrappedInitialValue;\n }\n return [debouncedValue, updateDebouncedValue];\n}\nfunction useDocumentTitle(title, options = {}) {\n const { preserveTitleOnUnmount = true } = options;\n const defaultTitle = useRef(null);\n useIsomorphicLayoutEffect(() => {\n defaultTitle.current = window.document.title;\n }, []);\n useIsomorphicLayoutEffect(() => {\n window.document.title = title;\n }, [title]);\n useUnmount(() => {\n if (!preserveTitleOnUnmount && defaultTitle.current) {\n window.document.title = defaultTitle.current;\n }\n });\n}\nfunction useHover(elementRef) {\n const [value, setValue] = useState(false);\n const handleMouseEnter = () => {\n setValue(true);\n };\n const handleMouseLeave = () => {\n setValue(false);\n };\n useEventListener(\"mouseenter\", handleMouseEnter, elementRef);\n useEventListener(\"mouseleave\", handleMouseLeave, elementRef);\n return value;\n}\nfunction useIntersectionObserver({\n threshold = 0,\n root = null,\n rootMargin = \"0%\",\n freezeOnceVisible = false,\n initialIsIntersecting = false,\n onChange\n} = {}) {\n var _a;\n const [ref, setRef] = useState(null);\n const [state, setState] = useState(() => ({\n isIntersecting: initialIsIntersecting,\n entry: void 0\n }));\n const callbackRef = useRef();\n callbackRef.current = onChange;\n const frozen = ((_a = state.entry) == null ? void 0 : _a.isIntersecting) && freezeOnceVisible;\n useEffect(() => {\n if (!ref)\n return;\n if (!(\"IntersectionObserver\" in window))\n return;\n if (frozen)\n return;\n let unobserve;\n const observer = new IntersectionObserver(\n (entries) => {\n const thresholds = Array.isArray(observer.thresholds) ? observer.thresholds : [observer.thresholds];\n entries.forEach((entry) => {\n const isIntersecting = entry.isIntersecting && thresholds.some((threshold2) => entry.intersectionRatio >= threshold2);\n setState({ isIntersecting, entry });\n if (callbackRef.current) {\n callbackRef.current(isIntersecting, entry);\n }\n if (isIntersecting && freezeOnceVisible && unobserve) {\n unobserve();\n unobserve = void 0;\n }\n });\n },\n { threshold, root, rootMargin }\n );\n observer.observe(ref);\n return () => {\n observer.disconnect();\n };\n }, [\n ref,\n // eslint-disable-next-line react-hooks/exhaustive-deps\n JSON.stringify(threshold),\n root,\n rootMargin,\n frozen,\n freezeOnceVisible\n ]);\n const prevRef = useRef(null);\n useEffect(() => {\n var _a2;\n if (!ref && ((_a2 = state.entry) == null ? void 0 : _a2.target) && !freezeOnceVisible && !frozen && prevRef.current !== state.entry.target) {\n prevRef.current = state.entry.target;\n setState({ isIntersecting: initialIsIntersecting, entry: void 0 });\n }\n }, [ref, state.entry, freezeOnceVisible, frozen, initialIsIntersecting]);\n const result = [\n setRef,\n !!state.isIntersecting,\n state.entry\n ];\n result.ref = result[0];\n result.isIntersecting = result[1];\n result.entry = result[2];\n return result;\n}\nfunction useIsClient() {\n const [isClient, setClient] = useState(false);\n useEffect(() => {\n setClient(true);\n }, []);\n return isClient;\n}\nfunction useIsMounted() {\n const isMounted = useRef(false);\n useEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n return useCallback(() => isMounted.current, []);\n}\nfunction useMap(initialState = /* @__PURE__ */ new Map()) {\n const [map, setMap] = useState(new Map(initialState));\n const actions = {\n set: useCallback((key, value) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.set(key, value);\n return copy;\n });\n }, []),\n setAll: useCallback((entries) => {\n setMap(() => new Map(entries));\n }, []),\n remove: useCallback((key) => {\n setMap((prev) => {\n const copy = new Map(prev);\n copy.delete(key);\n return copy;\n });\n }, []),\n reset: useCallback(() => {\n setMap(() => /* @__PURE__ */ new Map());\n }, [])\n };\n return [map, actions];\n}\n\n// src/useOnClickOutside/useOnClickOutside.ts\nfunction useOnClickOutside(ref, handler, eventType = \"mousedown\", eventListenerOptions = {}) {\n useEventListener(\n eventType,\n (event) => {\n const target = event.target;\n if (!target || !target.isConnected) {\n return;\n }\n const isOutside = Array.isArray(ref) ? ref.filter((r) => Boolean(r.current)).every((r) => r.current && !r.current.contains(target)) : ref.current && !ref.current.contains(target);\n if (isOutside) {\n handler(event);\n }\n },\n void 0,\n eventListenerOptions\n );\n}\nvar IS_SERVER3 = typeof window === \"undefined\";\nfunction useReadLocalStorage(key, options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER3) {\n initializeWithValue = false;\n }\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return null;\n }\n return parsed;\n },\n [options]\n );\n const readValue = useCallback(() => {\n if (IS_SERVER3) {\n return null;\n }\n try {\n const raw = window.localStorage.getItem(key);\n return raw ? deserializer(raw) : null;\n } catch (error) {\n console.warn(`Error reading localStorage key \\u201C${key}\\u201D:`, error);\n return null;\n }\n }, [key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return void 0;\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"local-storage\", handleStorageChange);\n return storedValue;\n}\nvar initialSize = {\n width: void 0,\n height: void 0\n};\nfunction useResizeObserver(options) {\n const { ref, box = \"content-box\" } = options;\n const [{ width, height }, setSize] = useState(initialSize);\n const isMounted = useIsMounted();\n const previousSize = useRef({ ...initialSize });\n const onResize = useRef(void 0);\n onResize.current = options.onResize;\n useEffect(() => {\n if (!ref.current)\n return;\n if (typeof window === \"undefined\" || !(\"ResizeObserver\" in window))\n return;\n const observer = new ResizeObserver(([entry]) => {\n const boxProp = box === \"border-box\" ? \"borderBoxSize\" : box === \"device-pixel-content-box\" ? \"devicePixelContentBoxSize\" : \"contentBoxSize\";\n const newWidth = extractSize(entry, boxProp, \"inlineSize\");\n const newHeight = extractSize(entry, boxProp, \"blockSize\");\n const hasChanged = previousSize.current.width !== newWidth || previousSize.current.height !== newHeight;\n if (hasChanged) {\n const newSize = { width: newWidth, height: newHeight };\n previousSize.current.width = newWidth;\n previousSize.current.height = newHeight;\n if (onResize.current) {\n onResize.current(newSize);\n } else {\n if (isMounted()) {\n setSize(newSize);\n }\n }\n }\n });\n observer.observe(ref.current, { box });\n return () => {\n observer.disconnect();\n };\n }, [box, ref, isMounted]);\n return { width, height };\n}\nfunction extractSize(entry, box, sizeType) {\n if (!entry[box]) {\n if (box === \"contentBoxSize\") {\n return entry.contentRect[sizeType === \"inlineSize\" ? \"width\" : \"height\"];\n }\n return void 0;\n }\n return Array.isArray(entry[box]) ? entry[box][0][sizeType] : (\n // @ts-ignore Support Firefox's non-standard behavior\n entry[box][sizeType]\n );\n}\nvar IS_SERVER4 = typeof window === \"undefined\";\nfunction useScreen(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER4) {\n initializeWithValue = false;\n }\n const readScreen = () => {\n if (IS_SERVER4) {\n return void 0;\n }\n return window.screen;\n };\n const [screen, setScreen] = useState(() => {\n if (initializeWithValue) {\n return readScreen();\n }\n return void 0;\n });\n const debouncedSetScreen = useDebounceCallback(\n setScreen,\n options.debounceDelay\n );\n function handleSize() {\n const newScreen = readScreen();\n const setSize = options.debounceDelay ? debouncedSetScreen : setScreen;\n if (newScreen) {\n const {\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n } = newScreen;\n setSize({\n width,\n height,\n availHeight,\n availWidth,\n colorDepth,\n orientation,\n pixelDepth\n });\n }\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return screen;\n}\nvar cachedScriptStatuses = /* @__PURE__ */ new Map();\nfunction getScriptNode(src) {\n const node = document.querySelector(\n `script[src=\"${src}\"]`\n );\n const status = node == null ? void 0 : node.getAttribute(\"data-status\");\n return {\n node,\n status\n };\n}\nfunction useScript(src, options) {\n const [status, setStatus] = useState(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return \"idle\";\n }\n if (typeof window === \"undefined\") {\n return \"loading\";\n }\n return cachedScriptStatuses.get(src) ?? \"loading\";\n });\n useEffect(() => {\n if (!src || (options == null ? void 0 : options.shouldPreventLoad)) {\n return;\n }\n const cachedScriptStatus = cachedScriptStatuses.get(src);\n if (cachedScriptStatus === \"ready\" || cachedScriptStatus === \"error\") {\n setStatus(cachedScriptStatus);\n return;\n }\n const script = getScriptNode(src);\n let scriptNode = script.node;\n if (!scriptNode) {\n scriptNode = document.createElement(\"script\");\n scriptNode.src = src;\n scriptNode.async = true;\n if (options == null ? void 0 : options.id) {\n scriptNode.id = options.id;\n }\n scriptNode.setAttribute(\"data-status\", \"loading\");\n document.body.appendChild(scriptNode);\n const setAttributeFromEvent = (event) => {\n const scriptStatus = event.type === \"load\" ? \"ready\" : \"error\";\n scriptNode == null ? void 0 : scriptNode.setAttribute(\"data-status\", scriptStatus);\n };\n scriptNode.addEventListener(\"load\", setAttributeFromEvent);\n scriptNode.addEventListener(\"error\", setAttributeFromEvent);\n } else {\n setStatus(script.status ?? cachedScriptStatus ?? \"loading\");\n }\n const setStateFromEvent = (event) => {\n const newStatus = event.type === \"load\" ? \"ready\" : \"error\";\n setStatus(newStatus);\n cachedScriptStatuses.set(src, newStatus);\n };\n scriptNode.addEventListener(\"load\", setStateFromEvent);\n scriptNode.addEventListener(\"error\", setStateFromEvent);\n return () => {\n if (scriptNode) {\n scriptNode.removeEventListener(\"load\", setStateFromEvent);\n scriptNode.removeEventListener(\"error\", setStateFromEvent);\n }\n if (scriptNode && (options == null ? void 0 : options.removeOnUnmount)) {\n scriptNode.remove();\n cachedScriptStatuses.delete(src);\n }\n };\n }, [src, options == null ? void 0 : options.shouldPreventLoad, options == null ? void 0 : options.removeOnUnmount, options == null ? void 0 : options.id]);\n return status;\n}\nvar IS_SERVER5 = typeof window === \"undefined\";\nfunction useScrollLock(options = {}) {\n const { autoLock = true, lockTarget, widthReflow = true } = options;\n const [isLocked, setIsLocked] = useState(false);\n const target = useRef(null);\n const originalStyle = useRef(null);\n const lock = () => {\n if (target.current) {\n const { overflow, paddingRight } = target.current.style;\n originalStyle.current = { overflow, paddingRight };\n if (widthReflow) {\n const offsetWidth = target.current === document.body ? window.innerWidth : target.current.offsetWidth;\n const currentPaddingRight = parseInt(window.getComputedStyle(target.current).paddingRight, 10) || 0;\n const scrollbarWidth = offsetWidth - target.current.scrollWidth;\n target.current.style.paddingRight = `${scrollbarWidth + currentPaddingRight}px`;\n }\n target.current.style.overflow = \"hidden\";\n setIsLocked(true);\n }\n };\n const unlock = () => {\n if (target.current && originalStyle.current) {\n target.current.style.overflow = originalStyle.current.overflow;\n if (widthReflow) {\n target.current.style.paddingRight = originalStyle.current.paddingRight;\n }\n }\n setIsLocked(false);\n };\n useIsomorphicLayoutEffect(() => {\n if (IS_SERVER5)\n return;\n if (lockTarget) {\n target.current = typeof lockTarget === \"string\" ? document.querySelector(lockTarget) : lockTarget;\n }\n if (!target.current) {\n target.current = document.body;\n }\n if (autoLock) {\n lock();\n }\n return () => {\n unlock();\n };\n }, [autoLock, lockTarget, widthReflow]);\n return { isLocked, lock, unlock };\n}\nvar IS_SERVER6 = typeof window === \"undefined\";\nfunction useSessionStorage(key, initialValue, options = {}) {\n const { initializeWithValue = true } = options;\n const serializer = useCallback(\n (value) => {\n if (options.serializer) {\n return options.serializer(value);\n }\n return JSON.stringify(value);\n },\n [options]\n );\n const deserializer = useCallback(\n (value) => {\n if (options.deserializer) {\n return options.deserializer(value);\n }\n if (value === \"undefined\") {\n return void 0;\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n let parsed;\n try {\n parsed = JSON.parse(value);\n } catch (error) {\n console.error(\"Error parsing JSON:\", error);\n return defaultValue;\n }\n return parsed;\n },\n [options, initialValue]\n );\n const readValue = useCallback(() => {\n const initialValueToUse = initialValue instanceof Function ? initialValue() : initialValue;\n if (IS_SERVER6) {\n return initialValueToUse;\n }\n try {\n const raw = window.sessionStorage.getItem(key);\n return raw ? deserializer(raw) : initialValueToUse;\n } catch (error) {\n console.warn(`Error reading sessionStorage key \\u201C${key}\\u201D:`, error);\n return initialValueToUse;\n }\n }, [initialValue, key, deserializer]);\n const [storedValue, setStoredValue] = useState(() => {\n if (initializeWithValue) {\n return readValue();\n }\n return initialValue instanceof Function ? initialValue() : initialValue;\n });\n const setValue = useEventCallback((value) => {\n if (IS_SERVER6) {\n console.warn(\n `Tried setting sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n try {\n const newValue = value instanceof Function ? value(readValue()) : value;\n window.sessionStorage.setItem(key, serializer(newValue));\n setStoredValue(newValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n } catch (error) {\n console.warn(`Error setting sessionStorage key \\u201C${key}\\u201D:`, error);\n }\n });\n const removeValue = useEventCallback(() => {\n if (IS_SERVER6) {\n console.warn(\n `Tried removing sessionStorage key \\u201C${key}\\u201D even though environment is not a client`\n );\n }\n const defaultValue = initialValue instanceof Function ? initialValue() : initialValue;\n window.sessionStorage.removeItem(key);\n setStoredValue(defaultValue);\n window.dispatchEvent(new StorageEvent(\"session-storage\", { key }));\n });\n useEffect(() => {\n setStoredValue(readValue());\n }, [key]);\n const handleStorageChange = useCallback(\n (event) => {\n if (event.key && event.key !== key) {\n return;\n }\n setStoredValue(readValue());\n },\n [key, readValue]\n );\n useEventListener(\"storage\", handleStorageChange);\n useEventListener(\"session-storage\", handleStorageChange);\n return [storedValue, setValue, removeValue];\n}\nfunction useStep(maxStep) {\n const [currentStep, setCurrentStep] = useState(1);\n const canGoToNextStep = currentStep + 1 <= maxStep;\n const canGoToPrevStep = currentStep - 1 > 0;\n const setStep = useCallback(\n (step) => {\n const newStep = step instanceof Function ? step(currentStep) : step;\n if (newStep >= 1 && newStep <= maxStep) {\n setCurrentStep(newStep);\n return;\n }\n throw new Error(\"Step not valid\");\n },\n [maxStep, currentStep]\n );\n const goToNextStep = useCallback(() => {\n if (canGoToNextStep) {\n setCurrentStep((step) => step + 1);\n }\n }, [canGoToNextStep]);\n const goToPrevStep = useCallback(() => {\n if (canGoToPrevStep) {\n setCurrentStep((step) => step - 1);\n }\n }, [canGoToPrevStep]);\n const reset = useCallback(() => {\n setCurrentStep(1);\n }, []);\n return [\n currentStep,\n {\n goToNextStep,\n goToPrevStep,\n canGoToNextStep,\n canGoToPrevStep,\n setStep,\n reset\n }\n ];\n}\n\n// src/useTernaryDarkMode/useTernaryDarkMode.ts\nvar COLOR_SCHEME_QUERY2 = \"(prefers-color-scheme: dark)\";\nvar LOCAL_STORAGE_KEY2 = \"usehooks-ts-ternary-dark-mode\";\nfunction useTernaryDarkMode({\n defaultValue = \"system\",\n localStorageKey = LOCAL_STORAGE_KEY2,\n initializeWithValue = true\n} = {}) {\n const isDarkOS = useMediaQuery(COLOR_SCHEME_QUERY2, { initializeWithValue });\n const [mode, setMode] = useLocalStorage(localStorageKey, defaultValue, {\n initializeWithValue\n });\n const isDarkMode = mode === \"dark\" || mode === \"system\" && isDarkOS;\n const toggleTernaryDarkMode = () => {\n const modes = [\"light\", \"system\", \"dark\"];\n setMode((prevMode) => {\n const nextIndex = (modes.indexOf(prevMode) + 1) % modes.length;\n return modes[nextIndex];\n });\n };\n return {\n isDarkMode,\n ternaryDarkMode: mode,\n setTernaryDarkMode: setMode,\n toggleTernaryDarkMode\n };\n}\nfunction useTimeout(callback, delay) {\n const savedCallback = useRef(callback);\n useIsomorphicLayoutEffect(() => {\n savedCallback.current = callback;\n }, [callback]);\n useEffect(() => {\n if (!delay && delay !== 0) {\n return;\n }\n const id = setTimeout(() => {\n savedCallback.current();\n }, delay);\n return () => {\n clearTimeout(id);\n };\n }, [delay]);\n}\nfunction useToggle(defaultValue) {\n const [value, setValue] = useState(!!defaultValue);\n const toggle = useCallback(() => {\n setValue((x) => !x);\n }, []);\n return [value, toggle, setValue];\n}\nvar IS_SERVER7 = typeof window === \"undefined\";\nfunction useWindowSize(options = {}) {\n let { initializeWithValue = true } = options;\n if (IS_SERVER7) {\n initializeWithValue = false;\n }\n const [windowSize, setWindowSize] = useState(() => {\n if (initializeWithValue) {\n return {\n width: window.innerWidth,\n height: window.innerHeight\n };\n }\n return {\n width: void 0,\n height: void 0\n };\n });\n const debouncedSetWindowSize = useDebounceCallback(\n setWindowSize,\n options.debounceDelay\n );\n function handleSize() {\n const setSize = options.debounceDelay ? debouncedSetWindowSize : setWindowSize;\n setSize({\n width: window.innerWidth,\n height: window.innerHeight\n });\n }\n useEventListener(\"resize\", handleSize);\n useIsomorphicLayoutEffect(() => {\n handleSize();\n }, []);\n return windowSize;\n}\n\nexport { useBoolean, useClickAnyWhere, useCopyToClipboard, useCountdown, useCounter, useDarkMode, useDebounceCallback, useDebounceValue, useDocumentTitle, useEventCallback, useEventListener, useHover, useIntersectionObserver, useInterval, useIsClient, useIsMounted, useIsomorphicLayoutEffect, useLocalStorage, useMap, useMediaQuery, useOnClickOutside, useReadLocalStorage, useResizeObserver, useScreen, useScript, useScrollLock, useSessionStorage, useStep, useTernaryDarkMode, useTimeout, useToggle, useUnmount, useWindowSize };\n"],"names":["useCopyToClipboard","copiedText","setCopiedText","useState","copy","useCallback","text","error"],"mappings":";;AAgDA,SAASA,IAAqB;AAC5B,QAAM,CAACC,GAAYC,CAAa,IAAIC,EAAS,IAAI,GAC3CC,IAAOC,EAAY,OAAOC,MAAS;AACvC,QAAI,EAAE,aAAa,QAAgB,UAAU;AAC3C,qBAAQ,KAAK,yBAAyB,GAC/B;AAET,QAAI;AACF,mBAAM,UAAU,UAAU,UAAUA,CAAI,GACxCJ,EAAcI,CAAI,GACX;AAAA,IACT,SAASC,GAAO;AACd,qBAAQ,KAAK,eAAeA,CAAK,GACjCL,EAAc,IAAI,GACX;AAAA,IACT;AAAA,EACF,GAAG,CAAA,CAAE;AACL,SAAO,CAACD,GAAYG,CAAI;AAC1B;","x_google_ignoreList":[0]}
@@ -1,17 +1,49 @@
1
- import * as e from "react";
2
- import { j as n } from "./index.es225.js";
3
- var o = e.createContext(void 0), a = (r) => {
4
- const { dir: t, children: i } = r;
5
- return /* @__PURE__ */ n.jsx(o.Provider, { value: t, children: i });
6
- };
7
- function s(r) {
8
- const t = e.useContext(o);
9
- return r || t || "ltr";
1
+ import r from "react";
2
+ import { createContextScope as y } from "./index.es454.js";
3
+ import { useComposedRefs as S } from "./index.es453.js";
4
+ import { createSlot as M } from "./index.es464.js";
5
+ import { j as d } from "./index.es225.js";
6
+ function D(s) {
7
+ const m = s + "CollectionProvider", [A, E] = y(m), [N, f] = A(
8
+ m,
9
+ { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }
10
+ ), p = (c) => {
11
+ const { scope: e, children: l } = c, o = r.useRef(null), t = r.useRef(/* @__PURE__ */ new Map()).current;
12
+ return /* @__PURE__ */ d.jsx(N, { scope: e, itemMap: t, collectionRef: o, children: l });
13
+ };
14
+ p.displayName = m;
15
+ const a = s + "CollectionSlot", _ = M(a), C = r.forwardRef(
16
+ (c, e) => {
17
+ const { scope: l, children: o } = c, t = f(a, l), n = S(e, t.collectionRef);
18
+ return /* @__PURE__ */ d.jsx(_, { ref: n, children: o });
19
+ }
20
+ );
21
+ C.displayName = a;
22
+ const u = s + "CollectionItemSlot", R = "data-radix-collection-item", T = M(u), x = r.forwardRef(
23
+ (c, e) => {
24
+ const { scope: l, children: o, ...t } = c, n = r.useRef(null), I = S(e, n), i = f(u, l);
25
+ return r.useEffect(() => (i.itemMap.set(n, { ref: n, ...t }), () => void i.itemMap.delete(n))), /* @__PURE__ */ d.jsx(T, { [R]: "", ref: I, children: o });
26
+ }
27
+ );
28
+ x.displayName = u;
29
+ function O(c) {
30
+ const e = f(s + "CollectionConsumer", c);
31
+ return r.useCallback(() => {
32
+ const o = e.collectionRef.current;
33
+ if (!o) return [];
34
+ const t = Array.from(o.querySelectorAll(`[${R}]`));
35
+ return Array.from(e.itemMap.values()).sort(
36
+ (i, v) => t.indexOf(i.ref.current) - t.indexOf(v.ref.current)
37
+ );
38
+ }, [e.collectionRef, e.itemMap]);
39
+ }
40
+ return [
41
+ { Provider: p, Slot: C, ItemSlot: x },
42
+ O,
43
+ E
44
+ ];
10
45
  }
11
- var v = a;
12
46
  export {
13
- a as DirectionProvider,
14
- v as Provider,
15
- s as useDirection
47
+ D as createCollection
16
48
  };
17
49
  //# sourceMappingURL=index.es466.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.es466.js","sources":["../node_modules/@radix-ui/react-direction/dist/index.mjs"],"sourcesContent":["// packages/react/direction/src/direction.tsx\nimport * as React from \"react\";\nimport { jsx } from \"react/jsx-runtime\";\nvar DirectionContext = React.createContext(void 0);\nvar DirectionProvider = (props) => {\n const { dir, children } = props;\n return /* @__PURE__ */ jsx(DirectionContext.Provider, { value: dir, children });\n};\nfunction useDirection(localDir) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || \"ltr\";\n}\nvar Provider = DirectionProvider;\nexport {\n DirectionProvider,\n Provider,\n useDirection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["DirectionContext","React","DirectionProvider","props","dir","children","jsx","useDirection","localDir","globalDir","Provider"],"mappings":";;AAGA,IAAIA,IAAmBC,EAAM,cAAc,MAAM,GAC7CC,IAAoB,CAACC,MAAU;AACjC,QAAM,EAAE,KAAAC,GAAK,UAAAC,EAAQ,IAAKF;AAC1B,SAAuBG,gBAAAA,EAAAA,IAAIN,EAAiB,UAAU,EAAE,OAAOI,GAAK,UAAAC,GAAU;AAChF;AACA,SAASE,EAAaC,GAAU;AAC9B,QAAMC,IAAYR,EAAM,WAAWD,CAAgB;AACnD,SAAOQ,KAAYC,KAAa;AAClC;AACG,IAACC,IAAWR;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index.es466.js","sources":["../node_modules/@radix-ui/react-collection/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/collection-legacy.tsx\nimport React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { createSlot } from \"@radix-ui/react-slot\";\nimport { jsx } from \"react/jsx-runtime\";\nfunction createCollection(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: /* @__PURE__ */ new Map() }\n );\n const CollectionProvider = (props) => {\n const { scope, children } = props;\n const ref = React.useRef(null);\n const itemMap = React.useRef(/* @__PURE__ */ new Map()).current;\n return /* @__PURE__ */ jsx(CollectionProviderImpl, { scope, itemMap, collectionRef: ref, children });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...itemData });\n return () => void context.itemMap.delete(ref);\n });\n return /* @__PURE__ */ jsx(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useCollection(scope) {\n const context = useCollectionContext(name + \"CollectionConsumer\", scope);\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n return getItems;\n }\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope\n ];\n}\n\n// src/collection.tsx\nimport React2 from \"react\";\nimport { createContextScope as createContextScope2 } from \"@radix-ui/react-context\";\nimport { useComposedRefs as useComposedRefs2 } from \"@radix-ui/react-compose-refs\";\nimport { createSlot as createSlot2 } from \"@radix-ui/react-slot\";\n\n// src/ordered-dictionary.ts\nvar __instanciated = /* @__PURE__ */ new WeakMap();\nvar OrderedDict = class _OrderedDict extends Map {\n #keys;\n constructor(entries) {\n super(entries);\n this.#keys = [...super.keys()];\n __instanciated.set(this, true);\n }\n set(key, value) {\n if (__instanciated.get(this)) {\n if (this.has(key)) {\n this.#keys[this.#keys.indexOf(key)] = key;\n } else {\n this.#keys.push(key);\n }\n }\n super.set(key, value);\n return this;\n }\n insert(index, key, value) {\n const has = this.has(key);\n const length = this.#keys.length;\n const relativeIndex = toSafeInteger(index);\n let actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n const safeIndex = actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n if (safeIndex === this.size || has && safeIndex === this.size - 1 || safeIndex === -1) {\n this.set(key, value);\n return this;\n }\n const size = this.size + (has ? 0 : 1);\n if (relativeIndex < 0) {\n actualIndex++;\n }\n const keys = [...this.#keys];\n let nextValue;\n let shouldSkip = false;\n for (let i = actualIndex; i < size; i++) {\n if (actualIndex === i) {\n let nextKey = keys[i];\n if (keys[i] === key) {\n nextKey = keys[i + 1];\n }\n if (has) {\n this.delete(key);\n }\n nextValue = this.get(nextKey);\n this.set(key, value);\n } else {\n if (!shouldSkip && keys[i - 1] === key) {\n shouldSkip = true;\n }\n const currentKey = keys[shouldSkip ? i : i - 1];\n const currentValue = nextValue;\n nextValue = this.get(currentKey);\n this.delete(currentKey);\n this.set(currentKey, currentValue);\n }\n }\n return this;\n }\n with(index, key, value) {\n const copy = new _OrderedDict(this);\n copy.insert(index, key, value);\n return copy;\n }\n before(key) {\n const index = this.#keys.indexOf(key) - 1;\n if (index < 0) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position before the given key.\n */\n setBefore(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index, newKey, value);\n }\n after(key) {\n let index = this.#keys.indexOf(key);\n index = index === -1 || index === this.size - 1 ? -1 : index + 1;\n if (index === -1) {\n return void 0;\n }\n return this.entryAt(index);\n }\n /**\n * Sets a new key-value pair at the position after the given key.\n */\n setAfter(key, newKey, value) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index + 1, newKey, value);\n }\n first() {\n return this.entryAt(0);\n }\n last() {\n return this.entryAt(-1);\n }\n clear() {\n this.#keys = [];\n return super.clear();\n }\n delete(key) {\n const deleted = super.delete(key);\n if (deleted) {\n this.#keys.splice(this.#keys.indexOf(key), 1);\n }\n return deleted;\n }\n deleteAt(index) {\n const key = this.keyAt(index);\n if (key !== void 0) {\n return this.delete(key);\n }\n return false;\n }\n at(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return this.get(key);\n }\n }\n entryAt(index) {\n const key = at(this.#keys, index);\n if (key !== void 0) {\n return [key, this.get(key)];\n }\n }\n indexOf(key) {\n return this.#keys.indexOf(key);\n }\n keyAt(index) {\n return at(this.#keys, index);\n }\n from(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.at(dest);\n }\n keyFrom(key, offset) {\n const index = this.indexOf(key);\n if (index === -1) {\n return void 0;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.keyAt(dest);\n }\n find(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return entry;\n }\n index++;\n }\n return void 0;\n }\n findIndex(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return index;\n }\n index++;\n }\n return -1;\n }\n filter(predicate, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n entries.push(entry);\n }\n index++;\n }\n return new _OrderedDict(entries);\n }\n map(callbackfn, thisArg) {\n const entries = [];\n let index = 0;\n for (const entry of this) {\n entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index, this])]);\n index++;\n }\n return new _OrderedDict(entries);\n }\n reduce(...args) {\n const [callbackfn, initialValue] = args;\n let index = 0;\n let accumulator = initialValue ?? this.at(0);\n for (const entry of this) {\n if (index === 0 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n index++;\n }\n return accumulator;\n }\n reduceRight(...args) {\n const [callbackfn, initialValue] = args;\n let accumulator = initialValue ?? this.at(-1);\n for (let index = this.size - 1; index >= 0; index--) {\n const entry = this.at(index);\n if (index === this.size - 1 && args.length === 1) {\n accumulator = entry;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n }\n return accumulator;\n }\n toSorted(compareFn) {\n const entries = [...this.entries()].sort(compareFn);\n return new _OrderedDict(entries);\n }\n toReversed() {\n const reversed = new _OrderedDict();\n for (let index = this.size - 1; index >= 0; index--) {\n const key = this.keyAt(index);\n const element = this.get(key);\n reversed.set(key, element);\n }\n return reversed;\n }\n toSpliced(...args) {\n const entries = [...this.entries()];\n entries.splice(...args);\n return new _OrderedDict(entries);\n }\n slice(start, end) {\n const result = new _OrderedDict();\n let stop = this.size - 1;\n if (start === void 0) {\n return result;\n }\n if (start < 0) {\n start = start + this.size;\n }\n if (end !== void 0 && end > 0) {\n stop = end - 1;\n }\n for (let index = start; index <= stop; index++) {\n const key = this.keyAt(index);\n const element = this.get(key);\n result.set(key, element);\n }\n return result;\n }\n every(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (!Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return false;\n }\n index++;\n }\n return true;\n }\n some(predicate, thisArg) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return true;\n }\n index++;\n }\n return false;\n }\n};\nfunction at(array, index) {\n if (\"at\" in Array.prototype) {\n return Array.prototype.at.call(array, index);\n }\n const actualIndex = toSafeIndex(array, index);\n return actualIndex === -1 ? void 0 : array[actualIndex];\n}\nfunction toSafeIndex(array, index) {\n const length = array.length;\n const relativeIndex = toSafeInteger(index);\n const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n}\nfunction toSafeInteger(number) {\n return number !== number || number === 0 ? 0 : Math.trunc(number);\n}\n\n// src/collection.tsx\nimport { jsx as jsx2 } from \"react/jsx-runtime\";\nfunction createCollection2(name) {\n const PROVIDER_NAME = name + \"CollectionProvider\";\n const [createCollectionContext, createCollectionScope] = createContextScope2(PROVIDER_NAME);\n const [CollectionContextProvider, useCollectionContext] = createCollectionContext(\n PROVIDER_NAME,\n {\n collectionElement: null,\n collectionRef: { current: null },\n collectionRefObject: { current: null },\n itemMap: new OrderedDict(),\n setItemMap: () => void 0\n }\n );\n const CollectionProvider = ({ state, ...props }) => {\n return state ? /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state }) : /* @__PURE__ */ jsx2(CollectionInit, { ...props });\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n const CollectionInit = (props) => {\n const state = useInitCollection();\n return /* @__PURE__ */ jsx2(CollectionProviderImpl, { ...props, state });\n };\n CollectionInit.displayName = PROVIDER_NAME + \"Init\";\n const CollectionProviderImpl = (props) => {\n const { scope, children, state } = props;\n const ref = React2.useRef(null);\n const [collectionElement, setCollectionElement] = React2.useState(\n null\n );\n const composeRefs = useComposedRefs2(ref, setCollectionElement);\n const [itemMap, setItemMap] = state;\n React2.useEffect(() => {\n if (!collectionElement) return;\n const observer = getChildListObserver(() => {\n });\n observer.observe(collectionElement, {\n childList: true,\n subtree: true\n });\n return () => {\n observer.disconnect();\n };\n }, [collectionElement]);\n return /* @__PURE__ */ jsx2(\n CollectionContextProvider,\n {\n scope,\n itemMap,\n setItemMap,\n collectionRef: composeRefs,\n collectionRefObject: ref,\n collectionElement,\n children\n }\n );\n };\n CollectionProviderImpl.displayName = PROVIDER_NAME + \"Impl\";\n const COLLECTION_SLOT_NAME = name + \"CollectionSlot\";\n const CollectionSlotImpl = createSlot2(COLLECTION_SLOT_NAME);\n const CollectionSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs2(forwardedRef, context.collectionRef);\n return /* @__PURE__ */ jsx2(CollectionSlotImpl, { ref: composedRefs, children });\n }\n );\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n const ITEM_SLOT_NAME = name + \"CollectionItemSlot\";\n const ITEM_DATA_ATTR = \"data-radix-collection-item\";\n const CollectionItemSlotImpl = createSlot2(ITEM_SLOT_NAME);\n const CollectionItemSlot = React2.forwardRef(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React2.useRef(null);\n const [element, setElement] = React2.useState(null);\n const composedRefs = useComposedRefs2(forwardedRef, ref, setElement);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n const { setItemMap } = context;\n const itemDataRef = React2.useRef(itemData);\n if (!shallowEqual(itemDataRef.current, itemData)) {\n itemDataRef.current = itemData;\n }\n const memoizedItemData = itemDataRef.current;\n React2.useEffect(() => {\n const itemData2 = memoizedItemData;\n setItemMap((map) => {\n if (!element) {\n return map;\n }\n if (!map.has(element)) {\n map.set(element, { ...itemData2, element });\n return map.toSorted(sortByDocumentPosition);\n }\n return map.set(element, { ...itemData2, element }).toSorted(sortByDocumentPosition);\n });\n return () => {\n setItemMap((map) => {\n if (!element || !map.has(element)) {\n return map;\n }\n map.delete(element);\n return new OrderedDict(map);\n });\n };\n }, [element, memoizedItemData, setItemMap]);\n return /* @__PURE__ */ jsx2(CollectionItemSlotImpl, { ...{ [ITEM_DATA_ATTR]: \"\" }, ref: composedRefs, children });\n }\n );\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n function useInitCollection() {\n return React2.useState(new OrderedDict());\n }\n function useCollection(scope) {\n const { itemMap } = useCollectionContext(name + \"CollectionConsumer\", scope);\n return itemMap;\n }\n const functions = {\n createCollectionScope,\n useCollection,\n useInitCollection\n };\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n functions\n ];\n}\nfunction shallowEqual(a, b) {\n if (a === b) return true;\n if (typeof a !== \"object\" || typeof b !== \"object\") return false;\n if (a == null || b == null) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) return false;\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\nfunction isElementPreceding(a, b) {\n return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);\n}\nfunction sortByDocumentPosition(a, b) {\n return !a[1].element || !b[1].element ? 0 : isElementPreceding(a[1].element, b[1].element) ? -1 : 1;\n}\nfunction getChildListObserver(callback) {\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === \"childList\") {\n callback();\n return;\n }\n }\n });\n return observer;\n}\nexport {\n createCollection,\n createCollection2 as unstable_createCollection\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createCollection","name","PROVIDER_NAME","createCollectionContext","createCollectionScope","createContextScope","CollectionProviderImpl","useCollectionContext","CollectionProvider","props","scope","children","ref","React","itemMap","jsx","COLLECTION_SLOT_NAME","CollectionSlotImpl","createSlot","CollectionSlot","forwardedRef","context","composedRefs","useComposedRefs","ITEM_SLOT_NAME","ITEM_DATA_ATTR","CollectionItemSlotImpl","CollectionItemSlot","itemData","useCollection","collectionNode","orderedNodes","a","b"],"mappings":";;;;;AAQA,SAASA,EAAiBC,GAAM;AAC9B,QAAMC,IAAgBD,IAAO,sBACvB,CAACE,GAAyBC,CAAqB,IAAIC,EAAmBH,CAAa,GACnF,CAAC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