@anoki/fse-ui 1.0.0-beta1.46.1 → 1.0.0-beta1.47.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 (358) hide show
  1. package/dist/index.cjs259.js +1 -1
  2. package/dist/index.cjs260.js +1 -1
  3. package/dist/index.cjs261.js +1 -1
  4. package/dist/index.cjs290.js +1 -1
  5. package/dist/index.cjs295.js +1 -1
  6. package/dist/index.cjs303.js +1 -1
  7. package/dist/index.cjs314.js +1 -1
  8. package/dist/index.cjs32.js +1 -1
  9. package/dist/index.cjs321.js +1 -1
  10. package/dist/index.cjs328.js +1 -1
  11. package/dist/index.cjs329.js +1 -1
  12. package/dist/index.cjs33.js +1 -1
  13. package/dist/index.cjs333.js +1 -1
  14. package/dist/index.cjs342.js +1 -1
  15. package/dist/index.cjs344.js +1 -1
  16. package/dist/index.cjs352.js +1 -1
  17. package/dist/index.cjs393.js +1 -1
  18. package/dist/index.cjs399.js +1 -1
  19. package/dist/index.cjs433.js +1 -1
  20. package/dist/index.cjs458.js +1 -1
  21. package/dist/index.cjs463.js +1 -1
  22. package/dist/index.cjs463.js.map +1 -1
  23. package/dist/index.cjs464.js +1 -1
  24. package/dist/index.cjs465.js +1 -1
  25. package/dist/index.cjs465.js.map +1 -1
  26. package/dist/index.cjs466.js +1 -1
  27. package/dist/index.cjs466.js.map +1 -1
  28. package/dist/index.cjs468.js +1 -1
  29. package/dist/index.cjs468.js.map +1 -1
  30. package/dist/index.cjs469.js +1 -1
  31. package/dist/index.cjs469.js.map +1 -1
  32. package/dist/index.cjs470.js +1 -1
  33. package/dist/index.cjs470.js.map +1 -1
  34. package/dist/index.cjs471.js +1 -1
  35. package/dist/index.cjs472.js +1 -1
  36. package/dist/index.cjs472.js.map +1 -1
  37. package/dist/index.cjs473.js +1 -1
  38. package/dist/index.cjs473.js.map +1 -1
  39. package/dist/index.cjs474.js +1 -1
  40. package/dist/index.cjs474.js.map +1 -1
  41. package/dist/index.cjs475.js +1 -1
  42. package/dist/index.cjs475.js.map +1 -1
  43. package/dist/index.cjs476.js +1 -1
  44. package/dist/index.cjs476.js.map +1 -1
  45. package/dist/index.cjs477.js +1 -1
  46. package/dist/index.cjs477.js.map +1 -1
  47. package/dist/index.cjs478.js +1 -1
  48. package/dist/index.cjs478.js.map +1 -1
  49. package/dist/index.cjs479.js +2 -0
  50. package/dist/index.cjs479.js.map +1 -0
  51. package/dist/index.cjs480.js +2 -0
  52. package/dist/index.cjs480.js.map +1 -0
  53. package/dist/index.cjs481.js +1 -1
  54. package/dist/index.cjs481.js.map +1 -1
  55. package/dist/index.cjs482.js +1 -1
  56. package/dist/index.cjs482.js.map +1 -1
  57. package/dist/index.cjs483.js +1 -1
  58. package/dist/index.cjs483.js.map +1 -1
  59. package/dist/index.cjs484.js +1 -1
  60. package/dist/index.cjs484.js.map +1 -1
  61. package/dist/index.cjs485.js +1 -1
  62. package/dist/index.cjs485.js.map +1 -1
  63. package/dist/index.cjs486.js +1 -1
  64. package/dist/index.cjs486.js.map +1 -1
  65. package/dist/index.cjs487.js +1 -1
  66. package/dist/index.cjs487.js.map +1 -1
  67. package/dist/index.cjs488.js +1 -1
  68. package/dist/index.cjs488.js.map +1 -1
  69. package/dist/index.cjs489.js +1 -1
  70. package/dist/index.cjs489.js.map +1 -1
  71. package/dist/index.cjs490.js +1 -1
  72. package/dist/index.cjs490.js.map +1 -1
  73. package/dist/index.cjs491.js +1 -1
  74. package/dist/index.cjs491.js.map +1 -1
  75. package/dist/index.cjs492.js +1 -1
  76. package/dist/index.cjs492.js.map +1 -1
  77. package/dist/index.cjs493.js +1 -1
  78. package/dist/index.cjs493.js.map +1 -1
  79. package/dist/index.cjs494.js +1 -1
  80. package/dist/index.cjs494.js.map +1 -1
  81. package/dist/index.cjs495.js +1 -1
  82. package/dist/index.cjs495.js.map +1 -1
  83. package/dist/index.cjs496.js +1 -1
  84. package/dist/index.cjs496.js.map +1 -1
  85. package/dist/index.cjs497.js +1 -1
  86. package/dist/index.cjs497.js.map +1 -1
  87. package/dist/index.cjs498.js +1 -1
  88. package/dist/index.cjs498.js.map +1 -1
  89. package/dist/index.cjs499.js +2 -0
  90. package/dist/{index.cjs521.js.map → index.cjs499.js.map} +1 -1
  91. package/dist/{index.cjs522.js → index.cjs500.js} +2 -2
  92. package/dist/{index.cjs522.js.map → index.cjs500.js.map} +1 -1
  93. package/dist/{index.cjs523.js → index.cjs501.js} +2 -2
  94. package/dist/{index.cjs523.js.map → index.cjs501.js.map} +1 -1
  95. package/dist/index.cjs502.js +2 -0
  96. package/dist/index.cjs502.js.map +1 -0
  97. package/dist/index.cjs503.js +2 -0
  98. package/dist/index.cjs503.js.map +1 -0
  99. package/dist/index.cjs504.js +2 -0
  100. package/dist/index.cjs504.js.map +1 -0
  101. package/dist/{index.cjs527.js → index.cjs505.js} +1 -1
  102. package/dist/{index.cjs527.js.map → index.cjs505.js.map} +1 -1
  103. package/dist/index.cjs506.js +2 -0
  104. package/dist/index.cjs506.js.map +1 -0
  105. package/dist/{index.cjs529.js → index.cjs507.js} +2 -2
  106. package/dist/{index.cjs529.js.map → index.cjs507.js.map} +1 -1
  107. package/dist/{index.cjs530.js → index.cjs508.js} +2 -2
  108. package/dist/{index.cjs530.js.map → index.cjs508.js.map} +1 -1
  109. package/dist/{index.cjs531.js → index.cjs509.js} +1 -1
  110. package/dist/{index.cjs531.js.map → index.cjs509.js.map} +1 -1
  111. package/dist/{index.cjs532.js → index.cjs510.js} +1 -1
  112. package/dist/{index.cjs532.js.map → index.cjs510.js.map} +1 -1
  113. package/dist/index.cjs511.js +2 -0
  114. package/dist/index.cjs511.js.map +1 -0
  115. package/dist/{index.cjs533.js → index.cjs514.js} +1 -1
  116. package/dist/{index.cjs533.js.map → index.cjs514.js.map} +1 -1
  117. package/dist/index.cjs515.js +1 -1
  118. package/dist/index.cjs515.js.map +1 -1
  119. package/dist/index.cjs516.js +1 -1
  120. package/dist/index.cjs516.js.map +1 -1
  121. package/dist/index.cjs524.js +1 -1
  122. package/dist/index.cjs524.js.map +1 -1
  123. package/dist/index.cjs525.js +1 -1
  124. package/dist/index.cjs525.js.map +1 -1
  125. package/dist/index.cjs526.js +1 -1
  126. package/dist/index.cjs526.js.map +1 -1
  127. package/dist/index.cjs528.js +1 -1
  128. package/dist/index.cjs528.js.map +1 -1
  129. package/dist/index.cjs540.js +1 -1
  130. package/dist/index.cjs545.js +1 -1
  131. package/dist/index.cjs546.js +1 -1
  132. package/dist/index.cjs548.js +1 -1
  133. package/dist/index.cjs549.js +1 -1
  134. package/dist/index.cjs550.js +1 -1
  135. package/dist/index.cjs551.js +1 -1
  136. package/dist/index.cjs554.js +1 -1
  137. package/dist/index.cjs557.js +1 -1
  138. package/dist/index.cjs562.js +1 -1
  139. package/dist/index.cjs564.js +1 -1
  140. package/dist/index.cjs567.js +1 -1
  141. package/dist/index.cjs571.js +1 -1
  142. package/dist/index.cjs571.js.map +1 -1
  143. package/dist/index.cjs572.js +1 -1
  144. package/dist/index.cjs572.js.map +1 -1
  145. package/dist/{index.cjs580.js → index.cjs573.js} +1 -1
  146. package/dist/{index.cjs580.js.map → index.cjs573.js.map} +1 -1
  147. package/dist/{index.cjs581.js → index.cjs574.js} +1 -1
  148. package/dist/{index.cjs581.js.map → index.cjs574.js.map} +1 -1
  149. package/dist/{index.cjs582.js → index.cjs575.js} +1 -1
  150. package/dist/{index.cjs582.js.map → index.cjs575.js.map} +1 -1
  151. package/dist/index.cjs576.js +2 -0
  152. package/dist/index.cjs576.js.map +1 -0
  153. package/dist/index.cjs577.js +1 -1
  154. package/dist/index.cjs577.js.map +1 -1
  155. package/dist/index.cjs583.js +1 -1
  156. package/dist/index.cjs583.js.map +1 -1
  157. package/dist/index.cjs584.js +1 -1
  158. package/dist/index.cjs584.js.map +1 -1
  159. package/dist/index.cjs67.js +1 -1
  160. package/dist/index.cjs67.js.map +1 -1
  161. package/dist/index.es259.js +1 -1
  162. package/dist/index.es260.js +2 -2
  163. package/dist/index.es261.js +2 -2
  164. package/dist/index.es290.js +6 -6
  165. package/dist/index.es295.js +1 -1
  166. package/dist/index.es303.js +7 -7
  167. package/dist/index.es314.js +1 -1
  168. package/dist/index.es32.js +1 -1
  169. package/dist/index.es321.js +13 -13
  170. package/dist/index.es328.js +1 -1
  171. package/dist/index.es329.js +1 -1
  172. package/dist/index.es33.js +1 -1
  173. package/dist/index.es333.js +1 -1
  174. package/dist/index.es342.js +1 -1
  175. package/dist/index.es344.js +1 -1
  176. package/dist/index.es352.js +6 -6
  177. package/dist/index.es393.js +4 -4
  178. package/dist/index.es399.js +1 -1
  179. package/dist/index.es433.js +1 -1
  180. package/dist/index.es458.js +1 -1
  181. package/dist/index.es463.js +8 -131
  182. package/dist/index.es463.js.map +1 -1
  183. package/dist/index.es464.js +1 -1
  184. package/dist/index.es465.js +3 -9
  185. package/dist/index.es465.js.map +1 -1
  186. package/dist/index.es466.js +131 -2
  187. package/dist/index.es466.js.map +1 -1
  188. package/dist/index.es468.js +5 -25
  189. package/dist/index.es468.js.map +1 -1
  190. package/dist/index.es469.js +23 -64
  191. package/dist/index.es469.js.map +1 -1
  192. package/dist/index.es470.js +66 -5
  193. package/dist/index.es470.js.map +1 -1
  194. package/dist/index.es471.js +1 -1
  195. package/dist/index.es472.js +33 -5
  196. package/dist/index.es472.js.map +1 -1
  197. package/dist/index.es473.js +621 -24
  198. package/dist/index.es473.js.map +1 -1
  199. package/dist/index.es474.js +10 -68
  200. package/dist/index.es474.js.map +1 -1
  201. package/dist/index.es475.js +5 -33
  202. package/dist/index.es475.js.map +1 -1
  203. package/dist/index.es476.js +25 -4
  204. package/dist/index.es476.js.map +1 -1
  205. package/dist/index.es477.js +63 -51
  206. package/dist/index.es477.js.map +1 -1
  207. package/dist/index.es478.js +3 -14
  208. package/dist/index.es478.js.map +1 -1
  209. package/dist/index.es479.js +60 -0
  210. package/dist/index.es479.js.map +1 -0
  211. package/dist/index.es480.js +49 -0
  212. package/dist/index.es480.js.map +1 -0
  213. package/dist/index.es481.js +12 -620
  214. package/dist/index.es481.js.map +1 -1
  215. package/dist/index.es482.js +124 -10
  216. package/dist/index.es482.js.map +1 -1
  217. package/dist/index.es483.js +14 -45
  218. package/dist/index.es483.js.map +1 -1
  219. package/dist/index.es484.js +134 -13
  220. package/dist/index.es484.js.map +1 -1
  221. package/dist/index.es485.js +206 -113
  222. package/dist/index.es485.js.map +1 -1
  223. package/dist/index.es486.js +13 -14
  224. package/dist/index.es486.js.map +1 -1
  225. package/dist/index.es487.js +173 -127
  226. package/dist/index.es487.js.map +1 -1
  227. package/dist/index.es488.js +10 -217
  228. package/dist/index.es488.js.map +1 -1
  229. package/dist/index.es489.js +50 -14
  230. package/dist/index.es489.js.map +1 -1
  231. package/dist/index.es490.js +9 -181
  232. package/dist/index.es490.js.map +1 -1
  233. package/dist/index.es491.js +10 -9
  234. package/dist/index.es491.js.map +1 -1
  235. package/dist/index.es492.js +203 -48
  236. package/dist/index.es492.js.map +1 -1
  237. package/dist/index.es493.js +21 -8
  238. package/dist/index.es493.js.map +1 -1
  239. package/dist/index.es494.js +394 -12
  240. package/dist/index.es494.js.map +1 -1
  241. package/dist/index.es495.js +24 -11
  242. package/dist/index.es495.js.map +1 -1
  243. package/dist/index.es496.js +28 -204
  244. package/dist/index.es496.js.map +1 -1
  245. package/dist/index.es497.js +5 -22
  246. package/dist/index.es497.js.map +1 -1
  247. package/dist/index.es498.js +5 -397
  248. package/dist/index.es498.js.map +1 -1
  249. package/dist/index.es499.js +6 -0
  250. package/dist/{index.es521.js.map → index.es499.js.map} +1 -1
  251. package/dist/{index.es522.js → index.es500.js} +3 -3
  252. package/dist/{index.es522.js.map → index.es500.js.map} +1 -1
  253. package/dist/{index.es523.js → index.es501.js} +6 -6
  254. package/dist/{index.es523.js.map → index.es501.js.map} +1 -1
  255. package/dist/index.es502.js +19 -0
  256. package/dist/index.es502.js.map +1 -0
  257. package/dist/index.es503.js +530 -0
  258. package/dist/index.es503.js.map +1 -0
  259. package/dist/index.es504.js +130 -0
  260. package/dist/index.es504.js.map +1 -0
  261. package/dist/{index.es527.js → index.es505.js} +1 -1
  262. package/dist/{index.es527.js.map → index.es505.js.map} +1 -1
  263. package/dist/index.es506.js +18 -0
  264. package/dist/index.es506.js.map +1 -0
  265. package/dist/{index.es529.js → index.es507.js} +4 -4
  266. package/dist/{index.es529.js.map → index.es507.js.map} +1 -1
  267. package/dist/{index.es530.js → index.es508.js} +2 -2
  268. package/dist/{index.es530.js.map → index.es508.js.map} +1 -1
  269. package/dist/{index.es531.js → index.es509.js} +1 -1
  270. package/dist/{index.es531.js.map → index.es509.js.map} +1 -1
  271. package/dist/{index.es532.js → index.es510.js} +1 -1
  272. package/dist/{index.es532.js.map → index.es510.js.map} +1 -1
  273. package/dist/index.es511.js +68 -0
  274. package/dist/index.es511.js.map +1 -0
  275. package/dist/{index.es533.js → index.es514.js} +1 -1
  276. package/dist/{index.es533.js.map → index.es514.js.map} +1 -1
  277. package/dist/index.es515.js +22 -24
  278. package/dist/index.es515.js.map +1 -1
  279. package/dist/index.es516.js +14 -28
  280. package/dist/index.es516.js.map +1 -1
  281. package/dist/index.es524.js +12 -15
  282. package/dist/index.es524.js.map +1 -1
  283. package/dist/index.es525.js +22 -521
  284. package/dist/index.es525.js.map +1 -1
  285. package/dist/index.es526.js +4 -126
  286. package/dist/index.es526.js.map +1 -1
  287. package/dist/index.es528.js +22 -64
  288. package/dist/index.es528.js.map +1 -1
  289. package/dist/index.es540.js +3 -3
  290. package/dist/index.es545.js +1 -1
  291. package/dist/index.es546.js +2 -2
  292. package/dist/index.es548.js +1 -1
  293. package/dist/index.es549.js +2 -2
  294. package/dist/index.es550.js +14 -14
  295. package/dist/index.es551.js +2 -2
  296. package/dist/index.es554.js +2 -2
  297. package/dist/index.es557.js +8 -8
  298. package/dist/index.es562.js +8 -8
  299. package/dist/index.es564.js +1 -1
  300. package/dist/index.es567.js +1 -1
  301. package/dist/index.es571.js +16 -6
  302. package/dist/index.es571.js.map +1 -1
  303. package/dist/index.es572.js +6 -16
  304. package/dist/index.es572.js.map +1 -1
  305. package/dist/{index.es580.js → index.es573.js} +1 -1
  306. package/dist/{index.es580.js.map → index.es573.js.map} +1 -1
  307. package/dist/{index.es581.js → index.es574.js} +1 -1
  308. package/dist/{index.es581.js.map → index.es574.js.map} +1 -1
  309. package/dist/{index.es582.js → index.es575.js} +1 -1
  310. package/dist/{index.es582.js.map → index.es575.js.map} +1 -1
  311. package/dist/index.es576.js +5 -0
  312. package/dist/index.es576.js.map +1 -0
  313. package/dist/index.es577.js +3 -73
  314. package/dist/index.es577.js.map +1 -1
  315. package/dist/index.es583.js +74 -2
  316. package/dist/index.es583.js.map +1 -1
  317. package/dist/index.es584.js +2 -4
  318. package/dist/index.es584.js.map +1 -1
  319. package/dist/index.es67.js +48 -39
  320. package/dist/index.es67.js.map +1 -1
  321. package/package.json +1 -1
  322. package/dist/index.cjs517.js +0 -2
  323. package/dist/index.cjs517.js.map +0 -1
  324. package/dist/index.cjs520.js +0 -2
  325. package/dist/index.cjs520.js.map +0 -1
  326. package/dist/index.cjs521.js +0 -2
  327. package/dist/index.cjs534.js +0 -2
  328. package/dist/index.cjs534.js.map +0 -1
  329. package/dist/index.cjs535.js +0 -2
  330. package/dist/index.cjs535.js.map +0 -1
  331. package/dist/index.cjs536.js +0 -2
  332. package/dist/index.cjs536.js.map +0 -1
  333. package/dist/index.cjs537.js +0 -2
  334. package/dist/index.cjs537.js.map +0 -1
  335. package/dist/index.cjs538.js +0 -2
  336. package/dist/index.cjs538.js.map +0 -1
  337. package/dist/index.cjs578.js +0 -2
  338. package/dist/index.cjs578.js.map +0 -1
  339. package/dist/index.es517.js +0 -8
  340. package/dist/index.es517.js.map +0 -1
  341. package/dist/index.es520.js +0 -8
  342. package/dist/index.es520.js.map +0 -1
  343. package/dist/index.es521.js +0 -6
  344. package/dist/index.es534.js +0 -26
  345. package/dist/index.es534.js.map +0 -1
  346. package/dist/index.es535.js +0 -16
  347. package/dist/index.es535.js.map +0 -1
  348. package/dist/index.es536.js +0 -31
  349. package/dist/index.es536.js.map +0 -1
  350. package/dist/index.es537.js +0 -8
  351. package/dist/index.es537.js.map +0 -1
  352. package/dist/index.es538.js +0 -26
  353. package/dist/index.es538.js.map +0 -1
  354. package/dist/index.es578.js +0 -5
  355. package/dist/index.es578.js.map +0 -1
  356. /package/dist/components/ui/{CardMapDoctorV2/CardMapDoctorV2.css → CardMapDoctor/CardMapDoctor.css} +0 -0
  357. /package/dist/components/ui/{ConsentModal/ConsentModalContent/ConsentModalContent.css → DoctorConfirmModal/DoctorConfirmModalContent/DoctorConfirmModalContent.css} +0 -0
  358. /package/dist/components/ui/{ConsentModal/ConsentModalFooter/ConsentModalFooter.css → DoctorModal/DoctorModalFooter/DoctorModalFooter.css} +0 -0
@@ -0,0 +1,60 @@
1
+ import * as l from "react";
2
+ import { useComposedRefs as y } from "./index.es469.js";
3
+ import { j as p } from "./index.es241.js";
4
+ // @__NO_SIDE_EFFECTS__
5
+ function S(e) {
6
+ const t = /* @__PURE__ */ E(e), n = l.forwardRef((o, r) => {
7
+ const { children: i, ...c } = o, a = l.Children.toArray(i), s = a.find(g);
8
+ if (s) {
9
+ const f = s.props.children, m = a.map((u) => u === s ? l.Children.count(f) > 1 ? l.Children.only(null) : l.isValidElement(f) ? f.props.children : null : u);
10
+ return /* @__PURE__ */ p.jsx(t, { ...c, ref: r, children: l.isValidElement(f) ? l.cloneElement(f, void 0, m) : null });
11
+ }
12
+ return /* @__PURE__ */ p.jsx(t, { ...c, ref: r, children: i });
13
+ });
14
+ return n.displayName = `${e}.Slot`, n;
15
+ }
16
+ var h = /* @__PURE__ */ S("Slot");
17
+ // @__NO_SIDE_EFFECTS__
18
+ function E(e) {
19
+ const t = l.forwardRef((n, o) => {
20
+ const { children: r, ...i } = n, c = l.isValidElement(r) ? C(r) : void 0, a = y(c, o);
21
+ if (l.isValidElement(r)) {
22
+ const s = R(i, r.props);
23
+ return r.type !== l.Fragment && (s.ref = a), l.cloneElement(r, s);
24
+ }
25
+ return l.Children.count(r) > 1 ? l.Children.only(null) : null;
26
+ });
27
+ return t.displayName = `${e}.SlotClone`, t;
28
+ }
29
+ var d = Symbol("radix.slottable");
30
+ // @__NO_SIDE_EFFECTS__
31
+ function j(e) {
32
+ const t = ({ children: n }) => /* @__PURE__ */ p.jsx(p.Fragment, { children: n });
33
+ return t.displayName = `${e}.Slottable`, t.__radixId = d, t;
34
+ }
35
+ function g(e) {
36
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === d;
37
+ }
38
+ function R(e, t) {
39
+ const n = { ...t };
40
+ for (const o in t) {
41
+ const r = e[o], i = t[o];
42
+ /^on[A-Z]/.test(o) ? r && i ? n[o] = (...a) => {
43
+ const s = i(...a);
44
+ return r(...a), s;
45
+ } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...i } : o === "className" && (n[o] = [r, i].filter(Boolean).join(" "));
46
+ }
47
+ return { ...e, ...n };
48
+ }
49
+ function C(e) {
50
+ var o, r;
51
+ let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, n = t && "isReactWarning" in t && t.isReactWarning;
52
+ return n ? e.ref : (t = (r = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : r.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
53
+ }
54
+ export {
55
+ h as Root,
56
+ h as Slot,
57
+ S as createSlot,
58
+ j as createSlottable
59
+ };
60
+ //# sourceMappingURL=index.es479.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es479.js","sources":["../node_modules/@radix-ui/react-slot/dist/index.mjs"],"sourcesContent":["\"use client\";\n\n// src/slot.tsx\nimport * as React from \"react\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport { Fragment as Fragment2, jsx } from \"react/jsx-runtime\";\n// @__NO_SIDE_EFFECTS__\nfunction createSlot(ownerName) {\n const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);\n const Slot2 = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenArray = React.Children.toArray(children);\n const slottable = childrenArray.find(isSlottable);\n if (slottable) {\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child) => {\n if (child === slottable) {\n if (React.Children.count(newElement) > 1) return React.Children.only(null);\n return React.isValidElement(newElement) ? newElement.props.children : null;\n } else {\n return child;\n }\n });\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });\n }\n return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });\n });\n Slot2.displayName = `${ownerName}.Slot`;\n return Slot2;\n}\nvar Slot = /* @__PURE__ */ createSlot(\"Slot\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlotClone(ownerName) {\n const SlotClone = React.forwardRef((props, forwardedRef) => {\n const { children, ...slotProps } = props;\n const childrenRef = React.isValidElement(children) ? getElementRef(children) : void 0;\n const ref = useComposedRefs(childrenRef, forwardedRef);\n if (React.isValidElement(children)) {\n const props2 = mergeProps(slotProps, children.props);\n if (children.type !== React.Fragment) {\n props2.ref = ref;\n }\n return React.cloneElement(children, props2);\n }\n return React.Children.count(children) > 1 ? React.Children.only(null) : null;\n });\n SlotClone.displayName = `${ownerName}.SlotClone`;\n return SlotClone;\n}\nvar SLOTTABLE_IDENTIFIER = Symbol(\"radix.slottable\");\n// @__NO_SIDE_EFFECTS__\nfunction createSlottable(ownerName) {\n const Slottable2 = ({ children }) => {\n return /* @__PURE__ */ jsx(Fragment2, { children });\n };\n Slottable2.displayName = `${ownerName}.Slottable`;\n Slottable2.__radixId = SLOTTABLE_IDENTIFIER;\n return Slottable2;\n}\nvar Slottable = /* @__PURE__ */ createSlottable(\"Slottable\");\nfunction isSlottable(child) {\n return React.isValidElement(child) && typeof child.type === \"function\" && \"__radixId\" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;\n}\nfunction mergeProps(slotProps, childProps) {\n const overrideProps = { ...childProps };\n for (const propName in childProps) {\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n if (slotPropValue && childPropValue) {\n overrideProps[propName] = (...args) => {\n const result = childPropValue(...args);\n slotPropValue(...args);\n return result;\n };\n } else if (slotPropValue) {\n overrideProps[propName] = slotPropValue;\n }\n } else if (propName === \"style\") {\n overrideProps[propName] = { ...slotPropValue, ...childPropValue };\n } else if (propName === \"className\") {\n overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(\" \");\n }\n }\n return { ...slotProps, ...overrideProps };\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}\nexport {\n Slot as Root,\n Slot,\n Slottable,\n createSlot,\n createSlottable\n};\n//# sourceMappingURL=index.mjs.map\n"],"names":["createSlot","ownerName","SlotClone","createSlotClone","Slot2","React","props","forwardedRef","children","slotProps","childrenArray","slottable","isSlottable","newElement","newChildren","child","jsx","Slot","childrenRef","getElementRef","ref","useComposedRefs","props2","mergeProps","SLOTTABLE_IDENTIFIER","createSlottable","Slottable2","Fragment2","childProps","overrideProps","propName","slotPropValue","childPropValue","args","result","element","getter","_a","mayWarn","_b"],"mappings":";;;;AAOA,SAASA,EAAWC,GAAW;AAC7B,QAAMC,IAA4B,gBAAAC,EAAgBF,CAAS,GACrDG,IAAQC,EAAM,WAAW,CAACC,GAAOC,MAAiB;AACtD,UAAM,EAAE,UAAAC,GAAU,GAAGC,EAAS,IAAKH,GAC7BI,IAAgBL,EAAM,SAAS,QAAQ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AiD,KAC1DD,IAAUF,KAAU,oBAAoBA,KAAUA,EAAO,gBACrDE,IACKH,EAAQ,MAAM,MAEhBA,EAAQ,MAAM,OAAOA,EAAQ;AACtC;","x_google_ignoreList":[0]}
@@ -0,0 +1,49 @@
1
+ import r from "react";
2
+ import { createContextScope as y } from "./index.es470.js";
3
+ import { useComposedRefs as S } from "./index.es469.js";
4
+ import { createSlot as M } from "./index.es479.js";
5
+ import { j as d } from "./index.es241.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
+ ];
45
+ }
46
+ export {
47
+ D as createCollection
48
+ };
49
+ //# sourceMappingURL=index.es480.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.es480.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,IAAK,EAAA;AAAA,EACvE,GACKM,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,EAAG,IAACT,GAAwB,EAAE,OAAAI,GAAO,SAAA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