lizaui 12.0.19 → 12.0.21

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 (186) hide show
  1. package/dist/button-group/index.cjs.js +1 -1
  2. package/dist/button-group/index.es.js +2 -2
  3. package/dist/button-v2/index.cjs.js +3 -3
  4. package/dist/button-v2/index.es.js +3 -3
  5. package/dist/chunks/{Button-daStTTzk.js → Button-Bumy9bze.js} +7 -56
  6. package/dist/chunks/Button-Bumy9bze.js.map +1 -0
  7. package/dist/chunks/{Button-DK8vIKEw.js → Button-CFYOfByw.js} +9 -58
  8. package/dist/chunks/Button-CFYOfByw.js.map +1 -0
  9. package/dist/chunks/{FocusScope-D-jCzxHq.js → FocusScope-4TdD5fCA.js} +3 -3
  10. package/dist/chunks/{FocusScope-D-jCzxHq.js.map → FocusScope-4TdD5fCA.js.map} +1 -1
  11. package/dist/chunks/{FocusScope-BJBTKF3R.js → FocusScope-jSNMAXzg.js} +3 -3
  12. package/dist/chunks/{FocusScope-BJBTKF3R.js.map → FocusScope-jSNMAXzg.js.map} +1 -1
  13. package/dist/chunks/Hidden-BY45Dc0j.js +54 -0
  14. package/dist/chunks/Hidden-BY45Dc0j.js.map +1 -0
  15. package/dist/chunks/Hidden-C55DpjMP.js +55 -0
  16. package/dist/chunks/Hidden-C55DpjMP.js.map +1 -0
  17. package/dist/chunks/{I18nProvider-8HiWALvM.js → I18nProvider-BUfkOEhQ.js} +2 -2
  18. package/dist/chunks/{I18nProvider-8HiWALvM.js.map → I18nProvider-BUfkOEhQ.js.map} +1 -1
  19. package/dist/chunks/{I18nProvider-DSyuLrKX.js → I18nProvider-Coj9x7B8.js} +2 -2
  20. package/dist/chunks/{I18nProvider-DSyuLrKX.js.map → I18nProvider-Coj9x7B8.js.map} +1 -1
  21. package/dist/chunks/{ProgressBar-CYj13G9N.js → ProgressBar-542C1mif.js} +5 -5
  22. package/dist/chunks/{ProgressBar-CYj13G9N.js.map → ProgressBar-542C1mif.js.map} +1 -1
  23. package/dist/chunks/{ProgressBar-BiWM84v5.js → ProgressBar-BiKRsJ8m.js} +5 -5
  24. package/dist/chunks/{ProgressBar-BiWM84v5.js.map → ProgressBar-BiKRsJ8m.js.map} +1 -1
  25. package/dist/chunks/SharedElementTransition-BSCoaphV.js +106 -0
  26. package/dist/chunks/{SharedElementTransition-D87oSBzB.js.map → SharedElementTransition-BSCoaphV.js.map} +1 -1
  27. package/dist/chunks/SharedElementTransition-CJVe1D_I.js +107 -0
  28. package/dist/chunks/{SharedElementTransition-BxczX23g.js.map → SharedElementTransition-CJVe1D_I.js.map} +1 -1
  29. package/dist/chunks/VisuallyHidden-CTe1-RoI.js +49 -0
  30. package/dist/chunks/VisuallyHidden-CTe1-RoI.js.map +1 -0
  31. package/dist/chunks/VisuallyHidden-DPJuOMsW.js +50 -0
  32. package/dist/chunks/VisuallyHidden-DPJuOMsW.js.map +1 -0
  33. package/dist/chunks/{button-group-CXxfE0Nh.js → button-group-CJ72SS4c.js} +2 -2
  34. package/dist/chunks/{button-group-CXxfE0Nh.js.map → button-group-CJ72SS4c.js.map} +1 -1
  35. package/dist/chunks/{button-group-CAIXp_CY.js → button-group-DJ5IdBp6.js} +2 -2
  36. package/dist/chunks/{button-group-CAIXp_CY.js.map → button-group-DJ5IdBp6.js.map} +1 -1
  37. package/dist/chunks/{compose-zqddfADC.js → compose-Cfw0sImv.js} +2 -2
  38. package/dist/chunks/{compose-zqddfADC.js.map → compose-Cfw0sImv.js.map} +1 -1
  39. package/dist/chunks/{compose-DVjlikkg.js → compose-DOOi0Yan.js} +2 -2
  40. package/dist/chunks/{compose-DVjlikkg.js.map → compose-DOOi0Yan.js.map} +1 -1
  41. package/dist/chunks/{focusSafely-CoIRf3xM.js → focusSafely-CKxVSn6H.js} +40 -2
  42. package/dist/chunks/{focusSafely-CoIRf3xM.js.map → focusSafely-CKxVSn6H.js.map} +1 -1
  43. package/dist/chunks/{focusSafely-kwqdsDlJ.js → focusSafely-DfEgLKh6.js} +46 -8
  44. package/dist/chunks/{focusSafely-kwqdsDlJ.js.map → focusSafely-DfEgLKh6.js.map} +1 -1
  45. package/dist/chunks/mergeRefs-Y9oG13yB.js +24 -0
  46. package/dist/chunks/mergeRefs-Y9oG13yB.js.map +1 -0
  47. package/dist/chunks/mergeRefs-t6d4XvXq.js +25 -0
  48. package/dist/chunks/mergeRefs-t6d4XvXq.js.map +1 -0
  49. package/dist/chunks/{number-ClNYm70x.js → number-CYgYWykt.js} +2 -2
  50. package/dist/chunks/{number-ClNYm70x.js.map → number-CYgYWykt.js.map} +1 -1
  51. package/dist/chunks/{number-apyCzMO6.js → number-DDpsLN2d.js} +2 -2
  52. package/dist/chunks/{number-apyCzMO6.js.map → number-DDpsLN2d.js.map} +1 -1
  53. package/dist/chunks/{radio-group-dNkQoY2h.js → radio-group-BwXvYzSm.js} +15 -13
  54. package/dist/chunks/{radio-group-dNkQoY2h.js.map → radio-group-BwXvYzSm.js.map} +1 -1
  55. package/dist/chunks/{radio-group-V6X0yA63.js → radio-group-hO2beGF6.js} +17 -15
  56. package/dist/chunks/{radio-group-V6X0yA63.js.map → radio-group-hO2beGF6.js.map} +1 -1
  57. package/dist/chunks/useControlledState-DE_m1RML.js +39 -0
  58. package/dist/chunks/useControlledState-DE_m1RML.js.map +1 -0
  59. package/dist/chunks/useControlledState-DZA25XHU.js +40 -0
  60. package/dist/chunks/useControlledState-DZA25XHU.js.map +1 -0
  61. package/dist/chunks/{useFormReset-Cf2fzi86.js → useFormReset-BYRGk5vb.js} +2 -2
  62. package/dist/chunks/{useFormReset-Cf2fzi86.js.map → useFormReset-BYRGk5vb.js.map} +1 -1
  63. package/dist/chunks/{useFormReset-Bwwr8ivc.js → useFormReset-Bgv2ktIE.js} +2 -2
  64. package/dist/chunks/{useFormReset-Bwwr8ivc.js.map → useFormReset-Bgv2ktIE.js.map} +1 -1
  65. package/dist/chunks/useHasTabbableChild-CSJ0P5QT.js +2577 -0
  66. package/dist/chunks/useHasTabbableChild-CSJ0P5QT.js.map +1 -0
  67. package/dist/chunks/useHasTabbableChild-kl2T5gEX.js +2576 -0
  68. package/dist/chunks/useHasTabbableChild-kl2T5gEX.js.map +1 -0
  69. package/dist/chunks/{useHover-B3gEex-2.js → useHover-BHCSbkLb.js} +3 -3
  70. package/dist/chunks/{useHover-B3gEex-2.js.map → useHover-BHCSbkLb.js.map} +1 -1
  71. package/dist/chunks/{useHover-Dn1CIUT8.js → useHover-D9f9xyxz.js} +3 -3
  72. package/dist/chunks/{useHover-Dn1CIUT8.js.map → useHover-D9f9xyxz.js.map} +1 -1
  73. package/dist/chunks/{useLabel-ClsFWJD0.js → useLabel-CzhH-Tov.js} +4 -23
  74. package/dist/chunks/useLabel-CzhH-Tov.js.map +1 -0
  75. package/dist/chunks/{useLabel-todYehRc.js → useLabel-YLbDMN-c.js} +4 -23
  76. package/dist/chunks/useLabel-YLbDMN-c.js.map +1 -0
  77. package/dist/chunks/useLabels-BiXnWBSL.js +23 -0
  78. package/dist/chunks/useLabels-BiXnWBSL.js.map +1 -0
  79. package/dist/chunks/useLabels-Bl0mJafM.js +24 -0
  80. package/dist/chunks/useLabels-Bl0mJafM.js.map +1 -0
  81. package/dist/chunks/{useMove-BifTPO2Z.js → useMove-DeuS9PRx.js} +3 -3
  82. package/dist/chunks/{useMove-BifTPO2Z.js.map → useMove-DeuS9PRx.js.map} +1 -1
  83. package/dist/chunks/{useMove-C6JNYkjM.js → useMove-Xpbmb6OD.js} +3 -3
  84. package/dist/chunks/{useMove-C6JNYkjM.js.map → useMove-Xpbmb6OD.js.map} +1 -1
  85. package/dist/chunks/{usePress-D_rPVnKY.js → usePress-Arf10jW0.js} +4 -4
  86. package/dist/chunks/{usePress-D_rPVnKY.js.map → usePress-Arf10jW0.js.map} +1 -1
  87. package/dist/chunks/{usePress-BtBLddLY.js → usePress-B1yQk_p8.js} +4 -4
  88. package/dist/chunks/{usePress-BtBLddLY.js.map → usePress-B1yQk_p8.js.map} +1 -1
  89. package/dist/chunks/{useProgressBar-B1VDzYE6.js → useProgressBar-BsO-Q5JP.js} +4 -4
  90. package/dist/chunks/{useProgressBar-B1VDzYE6.js.map → useProgressBar-BsO-Q5JP.js.map} +1 -1
  91. package/dist/chunks/{useProgressBar--b8hyT4v.js → useProgressBar-d2k0k8r0.js} +4 -4
  92. package/dist/chunks/{useProgressBar--b8hyT4v.js.map → useProgressBar-d2k0k8r0.js.map} +1 -1
  93. package/dist/chunks/{useSlot-DnUNwd8f.js → useSlot-CFaaZeQE.js} +4 -4
  94. package/dist/chunks/{useSlot-DnUNwd8f.js.map → useSlot-CFaaZeQE.js.map} +1 -1
  95. package/dist/chunks/{useSlot-Dwd3MQYT.js → useSlot-TNtJf1z8.js} +4 -4
  96. package/dist/chunks/{useSlot-Dwd3MQYT.js.map → useSlot-TNtJf1z8.js.map} +1 -1
  97. package/dist/chunks/{utils-Ki_DdjNi.js → utils-BCEhcDlv.js} +12 -33
  98. package/dist/chunks/utils-BCEhcDlv.js.map +1 -0
  99. package/dist/chunks/{utils-GD-7Nve2.js → utils-DvHk9ofL.js} +5 -26
  100. package/dist/chunks/utils-DvHk9ofL.js.map +1 -0
  101. package/dist/components/icons/icons.d.ts +20 -0
  102. package/dist/components/icons/icons.d.ts.map +1 -0
  103. package/dist/components/scroll-shadow/index.d.ts +22 -0
  104. package/dist/components/scroll-shadow/index.d.ts.map +1 -0
  105. package/dist/components/scroll-shadow/scroll-shadow.d.ts +33 -0
  106. package/dist/components/scroll-shadow/scroll-shadow.d.ts.map +1 -0
  107. package/dist/components/scroll-shadow/scroll-shadow.styles.d.ts +70 -0
  108. package/dist/components/scroll-shadow/scroll-shadow.styles.d.ts.map +1 -0
  109. package/dist/components/scroll-shadow/use-safe-layout-effect.d.ts +3 -0
  110. package/dist/components/scroll-shadow/use-safe-layout-effect.d.ts.map +1 -0
  111. package/dist/components/scroll-shadow/use-scroll-shadow.d.ts +12 -0
  112. package/dist/components/scroll-shadow/use-scroll-shadow.d.ts.map +1 -0
  113. package/dist/components/tabs/index.d.ts +26 -0
  114. package/dist/components/tabs/index.d.ts.map +1 -0
  115. package/dist/components/tabs/tabs.d.ts +40 -0
  116. package/dist/components/tabs/tabs.d.ts.map +1 -0
  117. package/dist/components/tabs/tabs.styles.d.ts +87 -0
  118. package/dist/components/tabs/tabs.styles.d.ts.map +1 -0
  119. package/dist/data-table/index.cjs.js +297 -2813
  120. package/dist/data-table/index.cjs.js.map +1 -1
  121. package/dist/data-table/index.es.js +208 -2724
  122. package/dist/data-table/index.es.js.map +1 -1
  123. package/dist/index.cjs.js +3 -3
  124. package/dist/index.es.js +3 -3
  125. package/dist/lib/utils/assertion.d.ts +10 -0
  126. package/dist/lib/utils/assertion.d.ts.map +1 -0
  127. package/dist/lib/utils/class-name.d.ts +8 -0
  128. package/dist/lib/utils/class-name.d.ts.map +1 -0
  129. package/dist/lib/utils/cn.d.ts +23 -0
  130. package/dist/lib/utils/cn.d.ts.map +1 -0
  131. package/dist/lib/utils/collection-prop-injection.d.ts +32 -0
  132. package/dist/lib/utils/collection-prop-injection.d.ts.map +1 -0
  133. package/dist/lib/utils/compose.d.ts +8 -0
  134. package/dist/lib/utils/compose.d.ts.map +1 -0
  135. package/dist/lib/utils/dom.d.ts +22 -0
  136. package/dist/lib/utils/dom.d.ts.map +1 -0
  137. package/dist/lib/utils/field-slots-gate.d.ts +10 -0
  138. package/dist/lib/utils/field-slots-gate.d.ts.map +1 -0
  139. package/dist/lib/utils/logger.d.ts +24 -0
  140. package/dist/lib/utils/logger.d.ts.map +1 -0
  141. package/dist/lib/utils/normalize.d.ts +6 -0
  142. package/dist/lib/utils/normalize.d.ts.map +1 -0
  143. package/dist/lib/utils/use-has-text-slot.d.ts +14 -0
  144. package/dist/lib/utils/use-has-text-slot.d.ts.map +1 -0
  145. package/dist/lizaui.css +632 -0
  146. package/dist/meter/index.cjs.js +4 -4
  147. package/dist/meter/index.es.js +4 -4
  148. package/dist/progress-bar/index.cjs.js +2 -2
  149. package/dist/progress-bar/index.es.js +2 -2
  150. package/dist/radio/index.cjs.js +2 -2
  151. package/dist/radio/index.es.js +2 -2
  152. package/dist/radio-group/index.cjs.js +1 -1
  153. package/dist/radio-group/index.es.js +2 -2
  154. package/dist/scroll-shadow/index.cjs.js +394 -0
  155. package/dist/scroll-shadow/index.cjs.js.map +1 -0
  156. package/dist/scroll-shadow/index.es.js +394 -0
  157. package/dist/scroll-shadow/index.es.js.map +1 -0
  158. package/dist/scroll-shadow.d.ts +2 -0
  159. package/dist/slider/index.cjs.js +11 -10
  160. package/dist/slider/index.cjs.js.map +1 -1
  161. package/dist/slider/index.es.js +10 -9
  162. package/dist/slider/index.es.js.map +1 -1
  163. package/dist/tabs/index.cjs.js +1400 -0
  164. package/dist/tabs/index.cjs.js.map +1 -0
  165. package/dist/tabs/index.es.js +1400 -0
  166. package/dist/tabs/index.es.js.map +1 -0
  167. package/dist/tabs.d.ts +2 -0
  168. package/dist/toggle-switch/index.cjs.js +11 -9
  169. package/dist/toggle-switch/index.cjs.js.map +1 -1
  170. package/dist/toggle-switch/index.es.js +9 -7
  171. package/dist/toggle-switch/index.es.js.map +1 -1
  172. package/dist/toolbar/index.cjs.js +4 -4
  173. package/dist/toolbar/index.es.js +4 -4
  174. package/package.json +12 -1
  175. package/dist/chunks/Button-DK8vIKEw.js.map +0 -1
  176. package/dist/chunks/Button-daStTTzk.js.map +0 -1
  177. package/dist/chunks/SharedElementTransition-BxczX23g.js +0 -12
  178. package/dist/chunks/SharedElementTransition-D87oSBzB.js +0 -13
  179. package/dist/chunks/VisuallyHidden-BbvdASBh.js +0 -85
  180. package/dist/chunks/VisuallyHidden-BbvdASBh.js.map +0 -1
  181. package/dist/chunks/VisuallyHidden-C-WtISJo.js +0 -86
  182. package/dist/chunks/VisuallyHidden-C-WtISJo.js.map +0 -1
  183. package/dist/chunks/useLabel-ClsFWJD0.js.map +0 -1
  184. package/dist/chunks/useLabel-todYehRc.js.map +0 -1
  185. package/dist/chunks/utils-GD-7Nve2.js.map +0 -1
  186. package/dist/chunks/utils-Ki_DdjNi.js.map +0 -1
@@ -0,0 +1,2576 @@
1
+ "use strict";
2
+ const BaseCollection = require("./BaseCollection-DxI8p0cP.js");
3
+ const useHover = require("./useHover-D9f9xyxz.js");
4
+ const Hidden = require("./Hidden-BY45Dc0j.js");
5
+ const utils = require("./utils-DvHk9ofL.js");
6
+ const ReactDOM = require("react-dom");
7
+ const React = require("react");
8
+ const SharedElementTransition = require("./SharedElementTransition-BSCoaphV.js");
9
+ const focusSafely = require("./focusSafely-CKxVSn6H.js");
10
+ const FocusScope = require("./FocusScope-4TdD5fCA.js");
11
+ const I18nProvider = require("./I18nProvider-BUfkOEhQ.js");
12
+ const usePress = require("./usePress-B1yQk_p8.js");
13
+ const useControlledState = require("./useControlledState-DE_m1RML.js");
14
+ const $8b2399d051d06d4c$export$447a38995de2c711 = "react-aria-clear-focus";
15
+ const $8b2399d051d06d4c$export$831c820ad60f9d12 = "react-aria-focus";
16
+ function $b72f3f7b3b5f42c6$export$76e4e37e5339496d(to) {
17
+ let from = $b72f3f7b3b5f42c6$export$759df0d867455a91(focusSafely.$d447af545b77c9f1$export$b204af158042fbac(to));
18
+ if (from !== to) {
19
+ if (from) $b72f3f7b3b5f42c6$export$6c5dc7e81d2cc29a(from, to);
20
+ if (to) $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(to, from);
21
+ }
22
+ }
23
+ function $b72f3f7b3b5f42c6$export$6c5dc7e81d2cc29a(from, to) {
24
+ from.dispatchEvent(new FocusEvent("blur", {
25
+ relatedTarget: to
26
+ }));
27
+ from.dispatchEvent(new FocusEvent("focusout", {
28
+ bubbles: true,
29
+ relatedTarget: to
30
+ }));
31
+ }
32
+ function $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(to, from) {
33
+ to.dispatchEvent(new FocusEvent("focus", {
34
+ relatedTarget: from
35
+ }));
36
+ to.dispatchEvent(new FocusEvent("focusin", {
37
+ bubbles: true,
38
+ relatedTarget: from
39
+ }));
40
+ }
41
+ function $b72f3f7b3b5f42c6$export$759df0d867455a91(document2) {
42
+ let activeElement = focusSafely.$23f2114a1b82827e$export$cd4e5573fbe2b576(document2);
43
+ let activeDescendant = activeElement?.getAttribute("aria-activedescendant");
44
+ if (activeDescendant) return document2.getElementById(activeDescendant) || activeElement;
45
+ return activeElement;
46
+ }
47
+ const $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT = 100;
48
+ const $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT = 600;
49
+ const $bb39c0fc1c19b34c$var$state = {
50
+ isOpen: false,
51
+ screenWidth: 0,
52
+ screenHeight: 0,
53
+ screenAngle: 0,
54
+ screenTimeout: 0,
55
+ startTimeStamp: 0,
56
+ endTimeStamp: 0,
57
+ resizeTimeStamp: 0,
58
+ resizeTimeout: 0
59
+ };
60
+ const $bb39c0fc1c19b34c$var$nonTextInputTypes = /* @__PURE__ */ new Set([
61
+ "checkbox",
62
+ "radio",
63
+ "range",
64
+ "color",
65
+ "file",
66
+ "image",
67
+ "button",
68
+ "submit",
69
+ "reset"
70
+ ]);
71
+ if (process.env.NODE_ENV === "test" && typeof window !== "undefined" && !Reflect.has(window, "visualViewport")) {
72
+ const visualViewport = Object.assign(new EventTarget(), {
73
+ offsetTop: 0,
74
+ offsetLeft: 0,
75
+ pageTop: 0,
76
+ pageLeft: 0,
77
+ scale: 1
78
+ });
79
+ Reflect.defineProperty(visualViewport, "width", {
80
+ get: () => window.innerWidth,
81
+ configurable: true
82
+ });
83
+ Reflect.defineProperty(visualViewport, "height", {
84
+ get: () => window.innerHeight,
85
+ configurable: true
86
+ });
87
+ Reflect.defineProperty(window, "visualViewport", {
88
+ value: visualViewport,
89
+ configurable: true,
90
+ writable: true
91
+ });
92
+ }
93
+ if (process.env.NODE_ENV === "test" && typeof window !== "undefined" && !Reflect.has(window.screen, "orientation")) {
94
+ const orientation = Object.assign(new EventTarget(), {
95
+ type: "landscape-primary"
96
+ });
97
+ Reflect.defineProperty(window.screen, "orientation", {
98
+ value: orientation,
99
+ configurable: true,
100
+ writable: true
101
+ });
102
+ Reflect.defineProperty(window.screen.orientation, "angle", {
103
+ get: () => window.orientation ?? 0,
104
+ configurable: true
105
+ });
106
+ }
107
+ function $bb39c0fc1c19b34c$var$getTouchScreen() {
108
+ let screenWidth = Number(window.visualViewport?.width ?? window.innerWidth);
109
+ let screenHeight = Number(window.visualViewport?.height ?? window.innerHeight);
110
+ let visualScale = Number(window.visualViewport?.scale ?? 1);
111
+ return {
112
+ width: screenWidth * visualScale,
113
+ height: screenHeight * visualScale,
114
+ angle: window.screen.orientation.angle
115
+ };
116
+ }
117
+ function $bb39c0fc1c19b34c$var$onResizeStart(e) {
118
+ if ($bb39c0fc1c19b34c$var$state.resizeTimeStamp <= e.timeStamp + 50) {
119
+ $bb39c0fc1c19b34c$var$state.resizeTimeStamp = e.timeStamp + 150;
120
+ window.clearTimeout($bb39c0fc1c19b34c$var$state.resizeTimeout);
121
+ $bb39c0fc1c19b34c$var$state.resizeTimeout = window.setTimeout($bb39c0fc1c19b34c$var$onResizeEnd, 150);
122
+ }
123
+ }
124
+ function $bb39c0fc1c19b34c$var$onResizeEnd() {
125
+ let viewportMeta = usePress.$7096878c21af5e66$export$a929f3f93e2cc67e("viewport");
126
+ if (focusSafely.$2add3ce32c6007eb$export$a11b0059900ceec8() && viewportMeta?.includes("overlays-content")) return;
127
+ let time = performance.now();
128
+ let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
129
+ let elapsed = time - $bb39c0fc1c19b34c$var$state.startTimeStamp;
130
+ let delta = $bb39c0fc1c19b34c$var$state.screenHeight - screen.height;
131
+ let rotation = $bb39c0fc1c19b34c$var$state.screenAngle - screen.angle;
132
+ if (Math.abs(rotation) % 180 && $bb39c0fc1c19b34c$var$state.screenWidth - screen.height < $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT) {
133
+ $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
134
+ $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
135
+ $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
136
+ delta = 0;
137
+ }
138
+ if (elapsed > $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT) {
139
+ window.clearTimeout($bb39c0fc1c19b34c$var$state.screenTimeout);
140
+ $bb39c0fc1c19b34c$var$state.screenTimeout = window.setTimeout(() => {
141
+ let activeElement = document.hasFocus() ? focusSafely.$23f2114a1b82827e$export$cd4e5573fbe2b576() : null;
142
+ let willKeyboardOpen = $bb39c0fc1c19b34c$export$c57958e35f31ed73(activeElement);
143
+ let screen2 = $bb39c0fc1c19b34c$var$getTouchScreen();
144
+ if (Math.abs($bb39c0fc1c19b34c$var$state.screenAngle - screen2.angle) % 180) return;
145
+ if ($bb39c0fc1c19b34c$var$state.isOpen && willKeyboardOpen) return;
146
+ $bb39c0fc1c19b34c$var$state.screenWidth = screen2.width;
147
+ $bb39c0fc1c19b34c$var$state.screenHeight = screen2.height;
148
+ $bb39c0fc1c19b34c$var$state.screenAngle = screen2.angle;
149
+ $bb39c0fc1c19b34c$var$state.isOpen = false;
150
+ }, $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT);
151
+ }
152
+ if (elapsed <= $bb39c0fc1c19b34c$var$KEYBOARD_TIMEOUT && delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT) $bb39c0fc1c19b34c$var$state.endTimeStamp = time;
153
+ $bb39c0fc1c19b34c$var$state.isOpen = delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT;
154
+ }
155
+ function $bb39c0fc1c19b34c$var$onOrientationChange() {
156
+ let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
157
+ let rotation = $bb39c0fc1c19b34c$var$state.screenAngle - screen.angle;
158
+ if (Math.abs(rotation) % 180 && !$bb39c0fc1c19b34c$var$state.isOpen) {
159
+ let width = $bb39c0fc1c19b34c$var$state.screenWidth;
160
+ let height = $bb39c0fc1c19b34c$var$state.screenHeight;
161
+ $bb39c0fc1c19b34c$var$state.screenWidth = height;
162
+ $bb39c0fc1c19b34c$var$state.screenHeight = width;
163
+ }
164
+ if (!$bb39c0fc1c19b34c$var$state.isOpen) $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
165
+ }
166
+ function $bb39c0fc1c19b34c$var$onFocus(e) {
167
+ let target = focusSafely.$23f2114a1b82827e$export$e58f029f0fbfdb29(e);
168
+ let willKeyboardOpen = $bb39c0fc1c19b34c$export$c57958e35f31ed73(target);
169
+ let time = performance.now();
170
+ let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
171
+ let delta = $bb39c0fc1c19b34c$var$state.screenHeight - screen.height;
172
+ if (delta < $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT && willKeyboardOpen) {
173
+ $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
174
+ $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
175
+ $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
176
+ $bb39c0fc1c19b34c$var$state.startTimeStamp = time;
177
+ }
178
+ if (willKeyboardOpen) window.clearTimeout($bb39c0fc1c19b34c$var$state.screenTimeout);
179
+ if (delta >= $bb39c0fc1c19b34c$var$KEYBOARD_HEIGHT && willKeyboardOpen) $bb39c0fc1c19b34c$var$state.endTimeStamp = time;
180
+ }
181
+ function $bb39c0fc1c19b34c$var$setupGlobalEvents() {
182
+ let screen = $bb39c0fc1c19b34c$var$getTouchScreen();
183
+ focusSafely.$d447af545b77c9f1$export$f531f92e2a15358f(window.visualViewport, "resize", focusSafely.$2add3ce32c6007eb$export$78551043582a6a98() ? $bb39c0fc1c19b34c$var$onResizeEnd : $bb39c0fc1c19b34c$var$onResizeStart);
184
+ focusSafely.$d447af545b77c9f1$export$f531f92e2a15358f(window.screen.orientation, "change", $bb39c0fc1c19b34c$var$onOrientationChange);
185
+ focusSafely.$d447af545b77c9f1$export$f531f92e2a15358f(window, "focus", $bb39c0fc1c19b34c$var$onFocus, {
186
+ capture: true,
187
+ passive: true
188
+ });
189
+ $bb39c0fc1c19b34c$var$state.screenWidth = screen.width;
190
+ $bb39c0fc1c19b34c$var$state.screenHeight = screen.height;
191
+ $bb39c0fc1c19b34c$var$state.screenAngle = screen.angle;
192
+ }
193
+ if (typeof document !== "undefined") {
194
+ if (document.readyState !== "loading") $bb39c0fc1c19b34c$var$setupGlobalEvents();
195
+ else focusSafely.$d447af545b77c9f1$export$f531f92e2a15358f(document, "DOMContentLoaded", $bb39c0fc1c19b34c$var$setupGlobalEvents);
196
+ }
197
+ function $bb39c0fc1c19b34c$export$c57958e35f31ed73(target) {
198
+ if (!(target instanceof Element) || !focusSafely.$3b8b240c1bf84ab9$export$4c063cf1350e6fed(target)) return false;
199
+ let isTextArea = target instanceof HTMLTextAreaElement;
200
+ let isEditable = target instanceof HTMLElement && target.isContentEditable;
201
+ let isTextInput = target instanceof HTMLInputElement && !$bb39c0fc1c19b34c$var$nonTextInputTypes.has(target.type);
202
+ return isTextArea || isEditable || isTextInput;
203
+ }
204
+ function $bb39c0fc1c19b34c$export$16792effe837dba3(event) {
205
+ return focusSafely.$2add3ce32c6007eb$export$9ac100e40613ea10() ? event.metaKey : event.ctrlKey;
206
+ }
207
+ function $600b3cf69ae46262$export$90fc3a17d93f704c(ref, event, listener, options) {
208
+ let handleEvent = useHover.$fe16bffc7a557bf0$export$7f54fc3180508a52(listener);
209
+ let isDisabled = listener == null;
210
+ React.useEffect(() => {
211
+ if (isDisabled || ref.current == null) return;
212
+ return focusSafely.$d447af545b77c9f1$export$f531f92e2a15358f(ref.current, event, handleEvent, options);
213
+ }, [
214
+ ref,
215
+ event,
216
+ options,
217
+ isDisabled
218
+ ]);
219
+ }
220
+ class $96ead35620b8fd36$export$410b0c854570d131 {
221
+ constructor(ownerDocument) {
222
+ this._firstChild = null;
223
+ this._lastChild = null;
224
+ this._previousSibling = null;
225
+ this._nextSibling = null;
226
+ this._parentNode = null;
227
+ this._minInvalidChildIndex = null;
228
+ this.ownerDocument = ownerDocument;
229
+ }
230
+ *[Symbol.iterator]() {
231
+ let node = this.firstChild;
232
+ while (node) {
233
+ yield node;
234
+ node = node.nextSibling;
235
+ }
236
+ }
237
+ get firstChild() {
238
+ return this._firstChild;
239
+ }
240
+ set firstChild(firstChild) {
241
+ this._firstChild = firstChild;
242
+ this.ownerDocument.markDirty(this);
243
+ }
244
+ get lastChild() {
245
+ return this._lastChild;
246
+ }
247
+ set lastChild(lastChild) {
248
+ this._lastChild = lastChild;
249
+ this.ownerDocument.markDirty(this);
250
+ }
251
+ get previousSibling() {
252
+ return this._previousSibling;
253
+ }
254
+ set previousSibling(previousSibling) {
255
+ this._previousSibling = previousSibling;
256
+ this.ownerDocument.markDirty(this);
257
+ }
258
+ get nextSibling() {
259
+ return this._nextSibling;
260
+ }
261
+ set nextSibling(nextSibling) {
262
+ this._nextSibling = nextSibling;
263
+ this.ownerDocument.markDirty(this);
264
+ }
265
+ get parentNode() {
266
+ return this._parentNode;
267
+ }
268
+ set parentNode(parentNode) {
269
+ this._parentNode = parentNode;
270
+ this.ownerDocument.markDirty(this);
271
+ }
272
+ get isConnected() {
273
+ return this.parentNode?.isConnected || false;
274
+ }
275
+ invalidateChildIndices(child) {
276
+ if (this._minInvalidChildIndex == null || !this._minInvalidChildIndex.isConnected || child.index < this._minInvalidChildIndex.index) {
277
+ this._minInvalidChildIndex = child;
278
+ this.ownerDocument.markDirty(this);
279
+ }
280
+ }
281
+ updateChildIndices() {
282
+ let node = this._minInvalidChildIndex;
283
+ while (node) {
284
+ node.index = node.previousSibling ? node.previousSibling.index + 1 : 0;
285
+ node = node.nextSibling;
286
+ }
287
+ this._minInvalidChildIndex = null;
288
+ }
289
+ appendChild(child) {
290
+ if (child.parentNode) child.parentNode.removeChild(child);
291
+ if (this.firstChild == null) this.firstChild = child;
292
+ if (this.lastChild) {
293
+ this.lastChild.nextSibling = child;
294
+ child.index = this.lastChild.index + 1;
295
+ child.previousSibling = this.lastChild;
296
+ } else {
297
+ child.previousSibling = null;
298
+ child.index = 0;
299
+ }
300
+ child.parentNode = this;
301
+ child.nextSibling = null;
302
+ this.lastChild = child;
303
+ this.ownerDocument.markDirty(this);
304
+ if (this.isConnected) this.ownerDocument.queueUpdate();
305
+ }
306
+ insertBefore(newNode, referenceNode) {
307
+ if (referenceNode == null) return this.appendChild(newNode);
308
+ if (newNode.parentNode) newNode.parentNode.removeChild(newNode);
309
+ newNode.nextSibling = referenceNode;
310
+ newNode.previousSibling = referenceNode.previousSibling;
311
+ newNode.index = referenceNode.index - 1;
312
+ if (this.firstChild === referenceNode) this.firstChild = newNode;
313
+ else if (referenceNode.previousSibling) referenceNode.previousSibling.nextSibling = newNode;
314
+ referenceNode.previousSibling = newNode;
315
+ newNode.parentNode = referenceNode.parentNode;
316
+ this.invalidateChildIndices(newNode);
317
+ if (this.isConnected) this.ownerDocument.queueUpdate();
318
+ }
319
+ removeChild(child) {
320
+ if (child.parentNode !== this) return;
321
+ if (this._minInvalidChildIndex === child) this._minInvalidChildIndex = null;
322
+ if (child.nextSibling) {
323
+ this.invalidateChildIndices(child.nextSibling);
324
+ child.nextSibling.previousSibling = child.previousSibling;
325
+ }
326
+ if (child.previousSibling) child.previousSibling.nextSibling = child.nextSibling;
327
+ if (this.firstChild === child) this.firstChild = child.nextSibling;
328
+ if (this.lastChild === child) this.lastChild = child.previousSibling;
329
+ child.parentNode = null;
330
+ child.nextSibling = null;
331
+ child.previousSibling = null;
332
+ child.index = 0;
333
+ this.ownerDocument.markDirty(child);
334
+ if (this.isConnected) this.ownerDocument.queueUpdate();
335
+ }
336
+ addEventListener() {
337
+ }
338
+ removeEventListener() {
339
+ }
340
+ get previousVisibleSibling() {
341
+ let node = this.previousSibling;
342
+ while (node && node.isHidden) node = node.previousSibling;
343
+ return node;
344
+ }
345
+ get nextVisibleSibling() {
346
+ let node = this.nextSibling;
347
+ while (node && node.isHidden) node = node.nextSibling;
348
+ return node;
349
+ }
350
+ get firstVisibleChild() {
351
+ let node = this.firstChild;
352
+ while (node && node.isHidden) node = node.nextSibling;
353
+ return node;
354
+ }
355
+ get lastVisibleChild() {
356
+ let node = this.lastChild;
357
+ while (node && node.isHidden) node = node.previousSibling;
358
+ return node;
359
+ }
360
+ }
361
+ class $96ead35620b8fd36$export$dc064fe9e59310fd extends $96ead35620b8fd36$export$410b0c854570d131 {
362
+ constructor(type, ownerDocument) {
363
+ super(ownerDocument), this.nodeType = 8, this.isMutated = true, this._index = 0, this.isHidden = false;
364
+ this.node = null;
365
+ }
366
+ get index() {
367
+ return this._index;
368
+ }
369
+ set index(index) {
370
+ this._index = index;
371
+ this.ownerDocument.markDirty(this);
372
+ }
373
+ get level() {
374
+ if (this.parentNode instanceof $96ead35620b8fd36$export$dc064fe9e59310fd) return this.parentNode.level + (this.parentNode.node?.type === "item" ? 1 : 0);
375
+ return 0;
376
+ }
377
+ /**
378
+ * Lazily gets a mutable instance of a Node. If the node has already
379
+ * been cloned during this update cycle, it just returns the existing one.
380
+ */
381
+ getMutableNode() {
382
+ if (this.node == null) return null;
383
+ if (!this.isMutated) {
384
+ this.node = this.node.clone();
385
+ this.isMutated = true;
386
+ }
387
+ this.ownerDocument.markDirty(this);
388
+ return this.node;
389
+ }
390
+ updateNode() {
391
+ let nextSibling = this.nextVisibleSibling;
392
+ let node = this.getMutableNode();
393
+ if (node == null) return;
394
+ node.index = this.index;
395
+ node.level = this.level;
396
+ node.parentKey = this.parentNode instanceof $96ead35620b8fd36$export$dc064fe9e59310fd ? this.parentNode.node?.key ?? null : null;
397
+ node.prevKey = this.previousVisibleSibling?.node?.key ?? null;
398
+ node.nextKey = nextSibling?.node?.key ?? null;
399
+ node.hasChildNodes = !!this.firstChild;
400
+ node.firstChildKey = this.firstVisibleChild?.node?.key ?? null;
401
+ node.lastChildKey = this.lastVisibleChild?.node?.key ?? null;
402
+ if ((node.colSpan != null || node.colIndex != null) && nextSibling) {
403
+ let nextColIndex = (node.colIndex ?? node.index) + (node.colSpan ?? 1);
404
+ if (nextSibling.node != null && nextColIndex !== nextSibling.node.colIndex) {
405
+ let siblingNode = nextSibling.getMutableNode();
406
+ siblingNode.colIndex = nextColIndex;
407
+ }
408
+ }
409
+ }
410
+ setProps(obj, ref, CollectionNodeClass, rendered, render) {
411
+ let node;
412
+ let { value: value1, textValue, id, ...props } = obj;
413
+ if (this.node == null) {
414
+ node = new CollectionNodeClass(id ?? `react-aria-${++this.ownerDocument.nodeId}`);
415
+ this.node = node;
416
+ } else node = this.getMutableNode();
417
+ props.ref = ref;
418
+ node.props = props;
419
+ node.rendered = rendered;
420
+ node.render = render;
421
+ node.value = value1;
422
+ if (obj["aria-label"]) node["aria-label"] = obj["aria-label"];
423
+ node.textValue = textValue || (typeof props.children === "string" ? props.children : "") || obj["aria-label"] || "";
424
+ if (id != null && id !== node.key) throw new Error("Cannot change the id of an item");
425
+ if (props.colSpan != null) node.colSpan = props.colSpan;
426
+ if (this.isConnected) this.ownerDocument.queueUpdate();
427
+ }
428
+ get style() {
429
+ let element = this;
430
+ return {
431
+ get display() {
432
+ return element.isHidden ? "none" : "";
433
+ },
434
+ set display(value) {
435
+ let isHidden = value === "none";
436
+ if (element.isHidden !== isHidden) {
437
+ if (element.parentNode?.firstVisibleChild === element || element.parentNode?.lastVisibleChild === element) element.ownerDocument.markDirty(element.parentNode);
438
+ let prev = element.previousVisibleSibling;
439
+ let next = element.nextVisibleSibling;
440
+ if (prev) element.ownerDocument.markDirty(prev);
441
+ if (next) element.ownerDocument.markDirty(next);
442
+ element.isHidden = isHidden;
443
+ element.ownerDocument.markDirty(element);
444
+ }
445
+ }
446
+ };
447
+ }
448
+ hasAttribute() {
449
+ }
450
+ setAttribute() {
451
+ }
452
+ setAttributeNS() {
453
+ }
454
+ removeAttribute() {
455
+ }
456
+ }
457
+ class $96ead35620b8fd36$export$b34a105447964f9f extends $96ead35620b8fd36$export$410b0c854570d131 {
458
+ constructor(collection) {
459
+ super(null), this.nodeType = 11, this.ownerDocument = this, this.dirtyNodes = /* @__PURE__ */ new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = /* @__PURE__ */ new WeakMap(), this.keyOwners = /* @__PURE__ */ new Map(), this.nextCollection = null, this.subscriptions = /* @__PURE__ */ new Set(), this.queuedRender = false, this.inSubscription = false;
460
+ this.collection = collection;
461
+ this.nextCollection = collection;
462
+ }
463
+ get isConnected() {
464
+ return true;
465
+ }
466
+ createElement(type) {
467
+ return new $96ead35620b8fd36$export$dc064fe9e59310fd(type, this);
468
+ }
469
+ getMutableCollection() {
470
+ if (!this.nextCollection) this.nextCollection = this.collection.clone();
471
+ return this.nextCollection;
472
+ }
473
+ markDirty(node) {
474
+ this.dirtyNodes.add(node);
475
+ }
476
+ addNode(element) {
477
+ if (element.isHidden || element.node == null) return;
478
+ if (process.env.NODE_ENV !== "production") {
479
+ let key = element.node.key;
480
+ let owner = this.keyOwners.get(key);
481
+ if (owner && owner !== element) throw new Error(`Duplicate key "${String(key)}" found in collection. Every item in a collection must have a unique key.`);
482
+ this.keyOwners.set(key, element);
483
+ }
484
+ let collection = this.getMutableCollection();
485
+ if (!collection.getItem(element.node.key)) for (let child of element) this.addNode(child);
486
+ collection.addNode(element.node);
487
+ }
488
+ removeNode(node) {
489
+ for (let child of node) this.removeNode(child);
490
+ if (node.node) {
491
+ let collection = this.getMutableCollection();
492
+ collection.removeNode(node.node.key);
493
+ if (process.env.NODE_ENV !== "production" && this.keyOwners.get(node.node.key) === node) this.keyOwners.delete(node.node.key);
494
+ }
495
+ }
496
+ /** Finalizes the collection update, updating all nodes and freezing the collection. */
497
+ getCollection() {
498
+ if (this.inSubscription) return this.collection;
499
+ this.queuedRender = false;
500
+ this.updateCollection();
501
+ return this.collection;
502
+ }
503
+ updateCollection() {
504
+ for (let element of this.dirtyNodes) if (element instanceof $96ead35620b8fd36$export$dc064fe9e59310fd && (!element.isConnected || element.isHidden)) this.removeNode(element);
505
+ else element.updateChildIndices();
506
+ for (let element of this.dirtyNodes) if (element instanceof $96ead35620b8fd36$export$dc064fe9e59310fd) {
507
+ if (element.isConnected && !element.isHidden) {
508
+ element.updateNode();
509
+ this.addNode(element);
510
+ }
511
+ if (element.node) this.dirtyNodes.delete(element);
512
+ element.isMutated = false;
513
+ } else this.dirtyNodes.delete(element);
514
+ if (this.nextCollection) {
515
+ this.nextCollection.commit(this.firstVisibleChild?.node?.key ?? null, this.lastVisibleChild?.node?.key ?? null, this.isSSR);
516
+ if (!this.isSSR) {
517
+ this.collection = this.nextCollection;
518
+ this.nextCollection = null;
519
+ }
520
+ }
521
+ }
522
+ queueUpdate() {
523
+ if (this.dirtyNodes.size === 0 || this.queuedRender) return;
524
+ this.queuedRender = true;
525
+ this.inSubscription = true;
526
+ if (!this.isSSR) this.collection = this.collection.clone();
527
+ for (let fn of this.subscriptions) fn();
528
+ this.inSubscription = false;
529
+ }
530
+ subscribe(fn) {
531
+ this.subscriptions.add(fn);
532
+ if (this.queuedRender) fn();
533
+ return () => this.subscriptions.delete(fn);
534
+ }
535
+ resetAfterSSR() {
536
+ if (this.isSSR) {
537
+ this.isSSR = false;
538
+ this.firstChild = null;
539
+ this.lastChild = null;
540
+ this.nodeId = 0;
541
+ this.keyOwners.clear();
542
+ }
543
+ }
544
+ }
545
+ function $a80bd3e9349588e7$export$727c8fc270210f13(props) {
546
+ let { children, items, idScope, addIdAndValue, dependencies = [] } = props;
547
+ let childrenString = React.useMemo(() => process.env.NODE_ENV !== "production" && typeof children === "function" ? children.toString() : void 0, [
548
+ children
549
+ ]);
550
+ let cache = React.useMemo(() => /* @__PURE__ */ new WeakMap(), [
551
+ ...dependencies,
552
+ childrenString
553
+ ]);
554
+ return React.useMemo(() => {
555
+ if (items && typeof children === "function") {
556
+ let res = [];
557
+ for (let item of items) {
558
+ let cacheKey = $a80bd3e9349588e7$var$isWeakKey(item) ? item : null;
559
+ let rendered = cacheKey ? cache.get(cacheKey) : null;
560
+ if (!rendered) {
561
+ rendered = children(item);
562
+ let id = rendered.props.id ?? item?.key ?? item?.id;
563
+ if (idScope != null && rendered.props.id == null && id != null) id = idScope + ":" + id;
564
+ let key = id ?? res.length;
565
+ rendered = React.cloneElement(rendered, addIdAndValue ? {
566
+ key,
567
+ id,
568
+ value: item
569
+ } : {
570
+ key
571
+ });
572
+ if (cacheKey) cache.set(cacheKey, rendered);
573
+ }
574
+ res.push(rendered);
575
+ }
576
+ return res;
577
+ } else if (typeof children !== "function") return children;
578
+ }, [
579
+ children,
580
+ items,
581
+ cache,
582
+ idScope,
583
+ addIdAndValue
584
+ ]);
585
+ }
586
+ function $a80bd3e9349588e7$var$isWeakKey(value) {
587
+ switch (typeof value) {
588
+ case "object":
589
+ return value != null;
590
+ case "function":
591
+ case "symbol":
592
+ return true;
593
+ default:
594
+ return false;
595
+ }
596
+ }
597
+ var shim = { exports: {} };
598
+ var useSyncExternalStoreShim_production = {};
599
+ var hasRequiredUseSyncExternalStoreShim_production;
600
+ function requireUseSyncExternalStoreShim_production() {
601
+ if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
602
+ hasRequiredUseSyncExternalStoreShim_production = 1;
603
+ var React$1 = React;
604
+ function is(x, y) {
605
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
606
+ }
607
+ var objectIs = "function" === typeof Object.is ? Object.is : is, useState = React$1.useState, useEffect = React$1.useEffect, useLayoutEffect = React$1.useLayoutEffect, useDebugValue = React$1.useDebugValue;
608
+ function useSyncExternalStore$2(subscribe, getSnapshot) {
609
+ var value = getSnapshot(), _useState = useState({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
610
+ useLayoutEffect(
611
+ function() {
612
+ inst.value = value;
613
+ inst.getSnapshot = getSnapshot;
614
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
615
+ },
616
+ [subscribe, value, getSnapshot]
617
+ );
618
+ useEffect(
619
+ function() {
620
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
621
+ return subscribe(function() {
622
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
623
+ });
624
+ },
625
+ [subscribe]
626
+ );
627
+ useDebugValue(value);
628
+ return value;
629
+ }
630
+ function checkIfSnapshotChanged(inst) {
631
+ var latestGetSnapshot = inst.getSnapshot;
632
+ inst = inst.value;
633
+ try {
634
+ var nextValue = latestGetSnapshot();
635
+ return !objectIs(inst, nextValue);
636
+ } catch (error) {
637
+ return true;
638
+ }
639
+ }
640
+ function useSyncExternalStore$1(subscribe, getSnapshot) {
641
+ return getSnapshot();
642
+ }
643
+ var shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
644
+ useSyncExternalStoreShim_production.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim2;
645
+ return useSyncExternalStoreShim_production;
646
+ }
647
+ var useSyncExternalStoreShim_development = {};
648
+ var hasRequiredUseSyncExternalStoreShim_development;
649
+ function requireUseSyncExternalStoreShim_development() {
650
+ if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
651
+ hasRequiredUseSyncExternalStoreShim_development = 1;
652
+ "production" !== process.env.NODE_ENV && (function() {
653
+ function is(x, y) {
654
+ return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
655
+ }
656
+ function useSyncExternalStore$2(subscribe, getSnapshot) {
657
+ didWarnOld18Alpha || void 0 === React$1.startTransition || (didWarnOld18Alpha = true, void 0);
658
+ var value = getSnapshot();
659
+ if (!didWarnUncachedGetSnapshot) {
660
+ var cachedValue = getSnapshot();
661
+ objectIs(value, cachedValue) || (void 0, didWarnUncachedGetSnapshot = true);
662
+ }
663
+ cachedValue = useState({
664
+ inst: { value, getSnapshot }
665
+ });
666
+ var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
667
+ useLayoutEffect(
668
+ function() {
669
+ inst.value = value;
670
+ inst.getSnapshot = getSnapshot;
671
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
672
+ },
673
+ [subscribe, value, getSnapshot]
674
+ );
675
+ useEffect(
676
+ function() {
677
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
678
+ return subscribe(function() {
679
+ checkIfSnapshotChanged(inst) && forceUpdate({ inst });
680
+ });
681
+ },
682
+ [subscribe]
683
+ );
684
+ useDebugValue(value);
685
+ return value;
686
+ }
687
+ function checkIfSnapshotChanged(inst) {
688
+ var latestGetSnapshot = inst.getSnapshot;
689
+ inst = inst.value;
690
+ try {
691
+ var nextValue = latestGetSnapshot();
692
+ return !objectIs(inst, nextValue);
693
+ } catch (error) {
694
+ return true;
695
+ }
696
+ }
697
+ function useSyncExternalStore$1(subscribe, getSnapshot) {
698
+ return getSnapshot();
699
+ }
700
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
701
+ var React$1 = React, objectIs = "function" === typeof Object.is ? Object.is : is, useState = React$1.useState, useEffect = React$1.useEffect, useLayoutEffect = React$1.useLayoutEffect, useDebugValue = React$1.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim2 = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
702
+ useSyncExternalStoreShim_development.useSyncExternalStore = void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim2;
703
+ "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
704
+ })();
705
+ return useSyncExternalStoreShim_development;
706
+ }
707
+ var hasRequiredShim;
708
+ function requireShim() {
709
+ if (hasRequiredShim) return shim.exports;
710
+ hasRequiredShim = 1;
711
+ if (process.env.NODE_ENV === "production") {
712
+ shim.exports = requireUseSyncExternalStoreShim_production();
713
+ } else {
714
+ shim.exports = requireUseSyncExternalStoreShim_development();
715
+ }
716
+ return shim.exports;
717
+ }
718
+ var shimExports = requireShim();
719
+ const $42ceafc619f9c3ba$var$ShallowRenderContext = /* @__PURE__ */ React.createContext(false);
720
+ const $42ceafc619f9c3ba$var$CollectionDocumentContext = /* @__PURE__ */ React.createContext(null);
721
+ function $42ceafc619f9c3ba$export$bf788dd355e3a401(props) {
722
+ let doc = React.useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
723
+ if (doc)
724
+ return props.content;
725
+ let { collection, document: document2 } = $42ceafc619f9c3ba$var$useCollectionDocument(props.createCollection);
726
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Hidden.$d7f64c32b702fe2c$export$8dc98ba7eadeaa56, null, /* @__PURE__ */ React.createElement($42ceafc619f9c3ba$var$CollectionDocumentContext.Provider, {
727
+ value: document2
728
+ }, props.content)), /* @__PURE__ */ React.createElement($42ceafc619f9c3ba$var$CollectionInner, {
729
+ render: props.children,
730
+ collection
731
+ }));
732
+ }
733
+ function $42ceafc619f9c3ba$var$CollectionInner({ collection, render }) {
734
+ return render(collection);
735
+ }
736
+ function $42ceafc619f9c3ba$var$useSyncExternalStoreFallback(subscribe, getSnapshot, getServerSnapshot) {
737
+ let isSSR = utils.$c7eafbbe1ea5834e$export$535bd6ca7f90a273();
738
+ let isSSRRef = React.useRef(isSSR);
739
+ isSSRRef.current = isSSR;
740
+ let getSnapshotWrapper = React.useCallback(() => {
741
+ return isSSRRef.current ? getServerSnapshot() : getSnapshot();
742
+ }, [
743
+ getSnapshot,
744
+ getServerSnapshot
745
+ ]);
746
+ return shimExports.useSyncExternalStore(subscribe, getSnapshotWrapper);
747
+ }
748
+ const $42ceafc619f9c3ba$var$useSyncExternalStore = typeof React["useSyncExternalStore"] === "function" ? React["useSyncExternalStore"] : $42ceafc619f9c3ba$var$useSyncExternalStoreFallback;
749
+ function $42ceafc619f9c3ba$var$useCollectionDocument(createCollection) {
750
+ let [document2] = React.useState(() => new $96ead35620b8fd36$export$b34a105447964f9f(createCollection?.() || new BaseCollection.$6f0c29017aeec335$export$408d25a4e12db025()));
751
+ let subscribe = React.useCallback((fn) => document2.subscribe(fn), [
752
+ document2
753
+ ]);
754
+ let getSnapshot = React.useCallback(() => {
755
+ let collection2 = document2.getCollection();
756
+ if (document2.isSSR)
757
+ document2.resetAfterSSR();
758
+ return collection2;
759
+ }, [
760
+ document2
761
+ ]);
762
+ let getServerSnapshot = React.useCallback(() => {
763
+ document2.isSSR = true;
764
+ return document2.getCollection();
765
+ }, [
766
+ document2
767
+ ]);
768
+ let collection = $42ceafc619f9c3ba$var$useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
769
+ return {
770
+ collection,
771
+ document: document2
772
+ };
773
+ }
774
+ const $42ceafc619f9c3ba$var$SSRContext = /* @__PURE__ */ React.createContext(null);
775
+ function $42ceafc619f9c3ba$var$createCollectionNodeClass(type) {
776
+ var _a;
777
+ let NodeClass = (_a = class extends BaseCollection.$6f0c29017aeec335$export$d68d59712b04d9d1 {
778
+ }, _a.type = type, _a);
779
+ return NodeClass;
780
+ }
781
+ function $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, rendered, children, render) {
782
+ if (typeof CollectionNodeClass === "string")
783
+ CollectionNodeClass = $42ceafc619f9c3ba$var$createCollectionNodeClass(CollectionNodeClass);
784
+ let itemRef = React.useCallback((element) => {
785
+ element?.setProps(props, ref, CollectionNodeClass, rendered, render);
786
+ }, [
787
+ props,
788
+ ref,
789
+ rendered,
790
+ render,
791
+ CollectionNodeClass
792
+ ]);
793
+ let parentNode = React.useContext($42ceafc619f9c3ba$var$SSRContext);
794
+ if (parentNode) {
795
+ let element = parentNode.ownerDocument.nodesByProps.get(props);
796
+ if (!element) {
797
+ element = parentNode.ownerDocument.createElement(CollectionNodeClass.type);
798
+ element.setProps(props, ref, CollectionNodeClass, rendered, render);
799
+ parentNode.appendChild(element);
800
+ parentNode.ownerDocument.updateCollection();
801
+ parentNode.ownerDocument.nodesByProps.set(props, element);
802
+ }
803
+ return children ? /* @__PURE__ */ React.createElement($42ceafc619f9c3ba$var$SSRContext.Provider, {
804
+ value: element
805
+ }, children) : null;
806
+ }
807
+ return /* @__PURE__ */ React.createElement(CollectionNodeClass.type, {
808
+ ref: itemRef
809
+ }, children);
810
+ }
811
+ function $42ceafc619f9c3ba$export$18af5c7a9e9b3664(CollectionNodeClass, render) {
812
+ let Component = ({ node }) => render(node.props, node.props.ref, node);
813
+ let Result = React.forwardRef((props, ref) => {
814
+ let focusableProps = React.useContext(useHover.$d1116acdf220c2da$export$f9762fab77588ecb);
815
+ let isShallow = React.useContext($42ceafc619f9c3ba$var$ShallowRenderContext);
816
+ if (!isShallow) {
817
+ if (render.length >= 3) throw new Error(render.name + " cannot be rendered outside a collection.");
818
+ return render(props, ref);
819
+ }
820
+ return $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, "children" in props ? props.children : null, null, (node) => (
821
+ // Forward FocusableContext to real DOM tree so tooltips work.
822
+ /* @__PURE__ */ React.createElement(useHover.$d1116acdf220c2da$export$f9762fab77588ecb.Provider, {
823
+ value: focusableProps
824
+ }, /* @__PURE__ */ React.createElement(Component, {
825
+ node
826
+ }))
827
+ ));
828
+ });
829
+ Result.displayName = render.name;
830
+ return Result;
831
+ }
832
+ function $42ceafc619f9c3ba$export$e953bb1cd0f19726(CollectionNodeClass, render, useChildren = $42ceafc619f9c3ba$var$useCollectionChildren) {
833
+ let Component = ({ node }) => render(node.props, node.props.ref, node);
834
+ let Result = React.forwardRef((props, ref) => {
835
+ let children = useChildren(props);
836
+ return $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, null, children, (node) => /* @__PURE__ */ React.createElement(Component, {
837
+ node
838
+ })) ?? /* @__PURE__ */ React.createElement(React.Fragment, null);
839
+ });
840
+ Result.displayName = render.name;
841
+ return Result;
842
+ }
843
+ function $42ceafc619f9c3ba$var$useCollectionChildren(options) {
844
+ return $a80bd3e9349588e7$export$727c8fc270210f13({
845
+ ...options,
846
+ addIdAndValue: true
847
+ });
848
+ }
849
+ const $42ceafc619f9c3ba$var$CollectionContext = /* @__PURE__ */ React.createContext(null);
850
+ function $42ceafc619f9c3ba$export$fb8073518f34e6ec(props) {
851
+ let ctx = React.useContext($42ceafc619f9c3ba$var$CollectionContext);
852
+ let dependencies = (ctx?.dependencies || []).concat(props.dependencies);
853
+ let idScope = props.idScope ?? ctx?.idScope;
854
+ let children = $42ceafc619f9c3ba$var$useCollectionChildren({
855
+ ...props,
856
+ idScope,
857
+ dependencies
858
+ });
859
+ let doc = React.useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
860
+ if (doc) children = /* @__PURE__ */ React.createElement($42ceafc619f9c3ba$var$CollectionRoot, null, children);
861
+ ctx = React.useMemo(
862
+ () => ({
863
+ dependencies: (
864
+ // oxlint-disable-next-line react-hooks/exhaustive-deps
865
+ dependencies
866
+ ),
867
+ idScope
868
+ }),
869
+ // eslint-disable-next-line react-hooks/exhaustive-deps
870
+ // oxlint-disable-next-line react/react-compiler, react-hooks/exhaustive-deps
871
+ [
872
+ idScope,
873
+ ...dependencies
874
+ ]
875
+ );
876
+ return /* @__PURE__ */ React.createElement($42ceafc619f9c3ba$var$CollectionContext.Provider, {
877
+ value: ctx
878
+ }, children);
879
+ }
880
+ function $42ceafc619f9c3ba$var$CollectionRoot({ children }) {
881
+ let doc = React.useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
882
+ let wrappedChildren = React.useMemo(() => /* @__PURE__ */ React.createElement($42ceafc619f9c3ba$var$CollectionDocumentContext.Provider, {
883
+ value: null
884
+ }, /* @__PURE__ */ React.createElement($42ceafc619f9c3ba$var$ShallowRenderContext.Provider, {
885
+ value: true
886
+ }, children)), [
887
+ children
888
+ ]);
889
+ return utils.$c7eafbbe1ea5834e$export$535bd6ca7f90a273() ? /* @__PURE__ */ React.createElement($42ceafc619f9c3ba$var$SSRContext.Provider, {
890
+ value: doc
891
+ }, wrappedChildren) : /* @__PURE__ */ ReactDOM.createPortal(wrappedChildren, doc);
892
+ }
893
+ const $263ab7fc0f95ccdb$export$a164736487e3f0ae = {
894
+ CollectionRoot({ collection, renderDropIndicator }) {
895
+ return $263ab7fc0f95ccdb$var$useCollectionRender(collection, null, renderDropIndicator);
896
+ },
897
+ CollectionBranch({ collection, parent, renderDropIndicator }) {
898
+ return $263ab7fc0f95ccdb$var$useCollectionRender(collection, parent, renderDropIndicator);
899
+ }
900
+ };
901
+ function $263ab7fc0f95ccdb$var$useCollectionRender(collection, parent, renderDropIndicator) {
902
+ return $a80bd3e9349588e7$export$727c8fc270210f13({
903
+ items: parent ? collection.getChildren(parent.key) : collection,
904
+ dependencies: [
905
+ renderDropIndicator
906
+ ],
907
+ children(node) {
908
+ if (node.type === "content") return /* @__PURE__ */ React.createElement(React.Fragment, null);
909
+ let rendered = node.render(node);
910
+ if (!renderDropIndicator || node.type !== "item") return rendered;
911
+ return /* @__PURE__ */ React.createElement(React.Fragment, null, renderDropIndicator({
912
+ type: "item",
913
+ key: node.key,
914
+ dropPosition: "before"
915
+ }), rendered, $263ab7fc0f95ccdb$export$2dbbd341daed716d(collection, node, renderDropIndicator));
916
+ }
917
+ });
918
+ }
919
+ function $263ab7fc0f95ccdb$export$2dbbd341daed716d(collection, node, renderDropIndicator) {
920
+ let key = node.key;
921
+ let keyAfter = collection.getKeyAfter(key);
922
+ let nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
923
+ while (nextItemInFlattenedCollection != null && nextItemInFlattenedCollection.type !== "item") {
924
+ keyAfter = collection.getKeyAfter(nextItemInFlattenedCollection.key);
925
+ nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
926
+ }
927
+ let nextItemInSameLevel = node.nextKey != null ? collection.getItem(node.nextKey) : null;
928
+ while (nextItemInSameLevel != null && nextItemInSameLevel.type !== "item") nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
929
+ let afterIndicators = [];
930
+ if (nextItemInSameLevel == null) {
931
+ let current = node;
932
+ while (current?.type === "item" && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)) {
933
+ let indicator = renderDropIndicator({
934
+ type: "item",
935
+ key: current.key,
936
+ dropPosition: "after"
937
+ });
938
+ if (/* @__PURE__ */ React.isValidElement(indicator)) afterIndicators.push(/* @__PURE__ */ React.cloneElement(indicator, {
939
+ key: `${current.key}-after`
940
+ }));
941
+ current = current.parentKey != null ? collection.getItem(current.parentKey) : null;
942
+ }
943
+ }
944
+ return afterIndicators;
945
+ }
946
+ const $263ab7fc0f95ccdb$export$4feb769f8ddf26c5 = /* @__PURE__ */ React.createContext($263ab7fc0f95ccdb$export$a164736487e3f0ae);
947
+ function $263ab7fc0f95ccdb$export$90e00781bc59d8f9(focusedKey) {
948
+ return React.useMemo(() => focusedKey != null ? /* @__PURE__ */ new Set([
949
+ focusedKey
950
+ ]) : null, [
951
+ focusedKey
952
+ ]);
953
+ }
954
+ function $901761b40e390936$export$2bb74740c4e19def(node, checkForOverflow) {
955
+ if (!node) return false;
956
+ let style = window.getComputedStyle(node);
957
+ let root = document.scrollingElement || document.documentElement;
958
+ let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
959
+ if (node === root && style.overflow !== "hidden") isScrollable = true;
960
+ if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
961
+ return isScrollable;
962
+ }
963
+ function $76d97191f0f90600$export$94ed1c92c7beeb22(node, checkForOverflow) {
964
+ let parentElements = [];
965
+ let root = document.scrollingElement || document.documentElement;
966
+ while (node) {
967
+ if ($901761b40e390936$export$2bb74740c4e19def(node, checkForOverflow)) parentElements.push(node);
968
+ if (node === root) break;
969
+ node = node.parentElement;
970
+ }
971
+ return parentElements;
972
+ }
973
+ function $51a3e22a5186a962$export$53a0910f038337bd(scrollView, element, opts = {}) {
974
+ if (scrollView === element) return;
975
+ let target = element.getBoundingClientRect();
976
+ $51a3e22a5186a962$export$f064fd83a2c6e9ca(scrollView, element, target, opts);
977
+ }
978
+ function $51a3e22a5186a962$export$f064fd83a2c6e9ca(scrollView, element, target, opts = {}) {
979
+ let { block = "nearest", inline = "nearest" } = opts;
980
+ let y = scrollView.scrollTop;
981
+ let x = scrollView.scrollLeft;
982
+ let view = scrollView.getBoundingClientRect();
983
+ let itemStyle = window.getComputedStyle(element);
984
+ let viewStyle = window.getComputedStyle(scrollView);
985
+ let root = document.scrollingElement || document.documentElement;
986
+ let isRoot = scrollView === root;
987
+ let viewTop = scrollView === root ? 0 : view.top;
988
+ let viewBottom = scrollView === root ? scrollView.clientHeight : view.bottom;
989
+ let viewLeft = scrollView === root ? 0 : view.left;
990
+ let viewRight = scrollView === root ? scrollView.clientWidth : view.right;
991
+ let scrollMarginTop = parseFloat(itemStyle.scrollMarginTop) || 0;
992
+ let scrollMarginBottom = parseFloat(itemStyle.scrollMarginBottom) || 0;
993
+ let scrollMarginLeft = parseFloat(itemStyle.scrollMarginLeft) || 0;
994
+ let scrollMarginRight = parseFloat(itemStyle.scrollMarginRight) || 0;
995
+ let scrollPaddingTop = parseFloat(viewStyle.scrollPaddingTop) || 0;
996
+ let scrollPaddingBottom = parseFloat(viewStyle.scrollPaddingBottom) || 0;
997
+ let scrollPaddingLeft = parseFloat(viewStyle.scrollPaddingLeft) || 0;
998
+ let scrollPaddingRight = parseFloat(viewStyle.scrollPaddingRight) || 0;
999
+ let borderTopWidth = parseFloat(viewStyle.borderTopWidth) || 0;
1000
+ let borderBottomWidth = parseFloat(viewStyle.borderBottomWidth) || 0;
1001
+ let borderLeftWidth = parseFloat(viewStyle.borderLeftWidth) || 0;
1002
+ let borderRightWidth = parseFloat(viewStyle.borderRightWidth) || 0;
1003
+ let scrollAreaTop = target.top - scrollMarginTop;
1004
+ let scrollAreaBottom = target.bottom + scrollMarginBottom;
1005
+ let scrollAreaLeft = target.left - scrollMarginLeft;
1006
+ let scrollAreaRight = target.right + scrollMarginRight;
1007
+ let scrollBarOffsetX = scrollView === root ? 0 : borderLeftWidth + borderRightWidth;
1008
+ let scrollBarOffsetY = scrollView === root ? 0 : borderTopWidth + borderBottomWidth;
1009
+ let scrollBarWidth = scrollView === root ? 0 : scrollView.offsetWidth - scrollView.clientWidth - scrollBarOffsetX;
1010
+ let scrollBarHeight = scrollView === root ? 0 : scrollView.offsetHeight - scrollView.clientHeight - scrollBarOffsetY;
1011
+ let scrollPortTop = viewTop + (isRoot ? 0 : borderTopWidth) + scrollPaddingTop;
1012
+ let scrollPortBottom = viewBottom - (isRoot ? 0 : borderBottomWidth) - scrollPaddingBottom - scrollBarHeight;
1013
+ let scrollPortLeft = viewLeft + (isRoot ? 0 : borderLeftWidth) + scrollPaddingLeft;
1014
+ let scrollPortRight = viewRight - (isRoot ? 0 : borderRightWidth) - scrollPaddingRight;
1015
+ if (focusSafely.$2add3ce32c6007eb$export$fedb369cb70207f1() && focusSafely.$2add3ce32c6007eb$export$78551043582a6a98() || viewStyle.direction === "ltr") scrollPortRight -= scrollBarWidth;
1016
+ else if (viewStyle.direction === "rtl") scrollPortLeft += scrollBarWidth;
1017
+ let shouldScrollBlock = scrollAreaTop < scrollPortTop || scrollAreaBottom > scrollPortBottom;
1018
+ let shouldScrollInline = scrollAreaLeft < scrollPortLeft || scrollAreaRight > scrollPortRight;
1019
+ if (shouldScrollBlock && block === "start") y += scrollAreaTop - scrollPortTop;
1020
+ else if (shouldScrollBlock && block === "center") y += (scrollAreaTop + scrollAreaBottom) / 2 - (scrollPortTop + scrollPortBottom) / 2;
1021
+ else if (shouldScrollBlock && block === "end") y += scrollAreaBottom - scrollPortBottom;
1022
+ else if (shouldScrollBlock && block === "nearest") {
1023
+ let start = scrollAreaTop - scrollPortTop;
1024
+ let end = scrollAreaBottom - scrollPortBottom;
1025
+ y += Math.abs(start) <= Math.abs(end) ? start : end;
1026
+ }
1027
+ if (shouldScrollInline && inline === "start") x += scrollAreaLeft - scrollPortLeft;
1028
+ else if (shouldScrollInline && inline === "center") x += (scrollAreaLeft + scrollAreaRight) / 2 - (scrollPortLeft + scrollPortRight) / 2;
1029
+ else if (shouldScrollInline && inline === "end") x += scrollAreaRight - scrollPortRight;
1030
+ else if (shouldScrollInline && inline === "nearest") {
1031
+ let start = scrollAreaLeft - scrollPortLeft;
1032
+ let end = scrollAreaRight - scrollPortRight;
1033
+ x += Math.abs(start) <= Math.abs(end) ? start : end;
1034
+ }
1035
+ if (process.env.NODE_ENV === "test") {
1036
+ scrollView.scrollLeft = x;
1037
+ scrollView.scrollTop = y;
1038
+ return;
1039
+ }
1040
+ scrollView.scrollTo({
1041
+ left: x,
1042
+ top: y
1043
+ });
1044
+ }
1045
+ function $51a3e22a5186a962$export$c826860796309d1b(targetElement, opts = {}) {
1046
+ let { containingElement } = opts;
1047
+ if (targetElement && targetElement.isConnected) {
1048
+ let root = document.scrollingElement || document.documentElement;
1049
+ let isScrollPrevented = window.getComputedStyle(root).overflow === "hidden";
1050
+ if (!isScrollPrevented) {
1051
+ let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
1052
+ targetElement?.scrollIntoView?.({
1053
+ block: "nearest"
1054
+ });
1055
+ let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
1056
+ if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
1057
+ containingElement?.scrollIntoView?.({
1058
+ block: "center",
1059
+ inline: "center"
1060
+ });
1061
+ targetElement.scrollIntoView?.({
1062
+ block: "nearest"
1063
+ });
1064
+ }
1065
+ } else {
1066
+ let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
1067
+ let scrollParents = $76d97191f0f90600$export$94ed1c92c7beeb22(targetElement, true);
1068
+ for (let scrollParent of scrollParents) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, targetElement);
1069
+ let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
1070
+ if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
1071
+ scrollParents = containingElement ? $76d97191f0f90600$export$94ed1c92c7beeb22(containingElement, true) : [];
1072
+ for (let scrollParent of scrollParents) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, containingElement, {
1073
+ block: "center",
1074
+ inline: "center"
1075
+ });
1076
+ for (let scrollParent of $76d97191f0f90600$export$94ed1c92c7beeb22(targetElement, true)) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, targetElement);
1077
+ }
1078
+ }
1079
+ }
1080
+ }
1081
+ let $121970af65029459$var$descriptionId = 0;
1082
+ const $121970af65029459$var$descriptionNodes = /* @__PURE__ */ new Map();
1083
+ function $121970af65029459$export$f8aeda7b10753fa1(description) {
1084
+ let [id, setId] = React.useState();
1085
+ utils.$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
1086
+ if (!description) return;
1087
+ let desc = $121970af65029459$var$descriptionNodes.get(description);
1088
+ if (!desc) {
1089
+ let id2 = `react-aria-description-${$121970af65029459$var$descriptionId++}`;
1090
+ setId(id2);
1091
+ let node = document.createElement("div");
1092
+ node.id = id2;
1093
+ node.style.display = "none";
1094
+ node.textContent = description;
1095
+ document.body.appendChild(node);
1096
+ desc = {
1097
+ refCount: 0,
1098
+ element: node
1099
+ };
1100
+ $121970af65029459$var$descriptionNodes.set(description, desc);
1101
+ } else setId(desc.element.id);
1102
+ desc.refCount++;
1103
+ return () => {
1104
+ if (desc && --desc.refCount === 0) {
1105
+ desc.element.remove();
1106
+ $121970af65029459$var$descriptionNodes.delete(description);
1107
+ }
1108
+ };
1109
+ }, [
1110
+ description
1111
+ ]);
1112
+ return {
1113
+ "aria-describedby": description ? id : void 0
1114
+ };
1115
+ }
1116
+ const $91fe5e721c7f36c1$export$c9549807523555e0 = /* @__PURE__ */ React.createContext({
1117
+ isSelected: false
1118
+ });
1119
+ const $91fe5e721c7f36c1$export$17f80983afe4e444 = /* @__PURE__ */ React.forwardRef(function SelectionIndicator(props, ref) {
1120
+ [props, ref] = utils.$7230ffa83bc0c2cf$export$29f1550f4b0d4415(props, ref, $91fe5e721c7f36c1$export$c9549807523555e0);
1121
+ let { isSelected, ...otherProps } = props;
1122
+ return /* @__PURE__ */ React.createElement(SharedElementTransition.$792f28e438b9ad5f$export$c34620ff8881d89f, {
1123
+ ...otherProps,
1124
+ ref,
1125
+ className: props.className || "react-aria-SelectionIndicator",
1126
+ name: "SelectionIndicator",
1127
+ isVisible: isSelected
1128
+ });
1129
+ });
1130
+ function $22bbea12c2567021$export$d3e3bd3e26688c04(e) {
1131
+ return focusSafely.$2add3ce32c6007eb$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
1132
+ }
1133
+ function $22bbea12c2567021$export$c3d8340acf92597f(collectionRef, key) {
1134
+ let selector = `[data-key="${CSS.escape(String(key))}"]`;
1135
+ let collection = collectionRef.current?.dataset.collection;
1136
+ if (collection) selector = `[data-collection="${CSS.escape(collection)}"]${selector}`;
1137
+ return collectionRef.current?.querySelector(selector);
1138
+ }
1139
+ const $22bbea12c2567021$var$collectionMap = /* @__PURE__ */ new WeakMap();
1140
+ function $22bbea12c2567021$export$881eb0d9f3605d9d(collection) {
1141
+ let id = utils.$390e54f620492c70$export$f680877a34711e37();
1142
+ $22bbea12c2567021$var$collectionMap.set(collection, id);
1143
+ return id;
1144
+ }
1145
+ function $22bbea12c2567021$export$6aeb1680a0ae8741(collection) {
1146
+ return $22bbea12c2567021$var$collectionMap.get(collection);
1147
+ }
1148
+ const $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
1149
+ function $f5a4a9a3486154da$export$e32c88dfddc6e1d8(options) {
1150
+ let { keyboardDelegate, selectionManager, onTypeSelect } = options;
1151
+ let state = React.useRef({
1152
+ search: "",
1153
+ timeout: void 0
1154
+ });
1155
+ let onKeyDownCapture = (e) => {
1156
+ if (state.current.search.length > 0 && e.key === " ") {
1157
+ e.preventDefault();
1158
+ if (!("continuePropagation" in e) || "continuePropagation" in e && !e.isPropagationStopped()) e.stopPropagation();
1159
+ state.current.search += " ";
1160
+ if (keyboardDelegate.getKeyForSearch != null) {
1161
+ let key = keyboardDelegate.getKeyForSearch(state.current.search, selectionManager.focusedKey);
1162
+ if (key == null) key = keyboardDelegate.getKeyForSearch(state.current.search);
1163
+ if (key != null) {
1164
+ selectionManager.setFocusedKey(key);
1165
+ if (onTypeSelect) onTypeSelect(key);
1166
+ }
1167
+ }
1168
+ clearTimeout(state.current.timeout);
1169
+ state.current.timeout = setTimeout(() => {
1170
+ state.current.search = "";
1171
+ }, $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
1172
+ }
1173
+ };
1174
+ let onKeyDown = (e) => {
1175
+ let character = $f5a4a9a3486154da$var$getStringForKey(e.key);
1176
+ if (!character || e.ctrlKey || e.metaKey || e.altKey || !focusSafely.$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, focusSafely.$23f2114a1b82827e$export$e58f029f0fbfdb29(e)) || state.current.search.length === 0 && character === " ") return;
1177
+ state.current.search += character;
1178
+ if (keyboardDelegate.getKeyForSearch != null) {
1179
+ let key = keyboardDelegate.getKeyForSearch(state.current.search, selectionManager.focusedKey);
1180
+ if (key == null) key = keyboardDelegate.getKeyForSearch(state.current.search);
1181
+ if (key != null) {
1182
+ selectionManager.setFocusedKey(key);
1183
+ if (onTypeSelect) onTypeSelect(key);
1184
+ e.preventDefault();
1185
+ if (!("continuePropagation" in e)) e.stopPropagation();
1186
+ } else {
1187
+ state.current.search = "";
1188
+ clearTimeout(state.current.timeout);
1189
+ state.current.timeout = void 0;
1190
+ return;
1191
+ }
1192
+ }
1193
+ clearTimeout(state.current.timeout);
1194
+ state.current.timeout = setTimeout(() => {
1195
+ state.current.search = "";
1196
+ }, $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
1197
+ };
1198
+ React.useEffect(() => {
1199
+ let timeout = state.current.timeout;
1200
+ return () => {
1201
+ clearTimeout(timeout);
1202
+ };
1203
+ }, [
1204
+ state
1205
+ ]);
1206
+ return {
1207
+ typeSelectProps: {
1208
+ // Using a capturing listener to catch the keydown event before
1209
+ // other hooks in order to handle the Spacebar event.
1210
+ onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDownCapture : void 0,
1211
+ onKeyDown: keyboardDelegate.getKeyForSearch ? onKeyDown : void 0
1212
+ }
1213
+ };
1214
+ }
1215
+ function $f5a4a9a3486154da$var$getStringForKey(key) {
1216
+ if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
1217
+ return "";
1218
+ }
1219
+ function $a475cdc2445827b5$export$72ef708ab07251f1(effect, dependencies) {
1220
+ const isInitialMount = React.useRef(true);
1221
+ const lastDeps = React.useRef(null);
1222
+ utils.$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
1223
+ isInitialMount.current = true;
1224
+ return () => {
1225
+ isInitialMount.current = false;
1226
+ };
1227
+ }, []);
1228
+ utils.$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
1229
+ if (isInitialMount.current) isInitialMount.current = false;
1230
+ else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) effect();
1231
+ lastDeps.current = dependencies;
1232
+ }, dependencies);
1233
+ }
1234
+ function $d667c2af82d35a98$export$d6daf82dcd84e87c(options) {
1235
+ let { selectionManager: manager, keyboardDelegate: delegate, ref, autoFocus = false, shouldFocusWrap = false, disallowEmptySelection = false, disallowSelectAll = false, escapeKeyBehavior = "clearSelection", selectOnFocus = manager.selectionBehavior === "replace", disallowTypeAhead = false, shouldUseVirtualFocus, allowsTabNavigation = false, scrollRef = ref, linkBehavior = "action", UNSTABLE_focusOnEntry } = options;
1236
+ let { direction } = I18nProvider.$2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
1237
+ let router = focusSafely.$caaf0dd3060ed57c$export$9a302a45f65d0572();
1238
+ const navigateToKey = (e, key, childFocus) => {
1239
+ if (key != null) {
1240
+ if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$22bbea12c2567021$export$d3e3bd3e26688c04(e)) {
1241
+ ReactDOM.flushSync(() => {
1242
+ manager.setFocusedKey(key, childFocus);
1243
+ });
1244
+ let item = $22bbea12c2567021$export$c3d8340acf92597f(ref, key);
1245
+ let itemProps = manager.getItemProps(key);
1246
+ if (item) {
1247
+ router.open(item, e, itemProps.href, itemProps.routerOptions);
1248
+ return;
1249
+ }
1250
+ return false;
1251
+ }
1252
+ manager.setFocusedKey(key, childFocus);
1253
+ if (manager.isLink(key) && linkBehavior === "override") return false;
1254
+ if (e.shiftKey && manager.selectionMode === "multiple") {
1255
+ manager.extendSelection(key);
1256
+ return;
1257
+ } else if (selectOnFocus && !$22bbea12c2567021$export$d3e3bd3e26688c04(e)) {
1258
+ manager.replaceSelection(key);
1259
+ return;
1260
+ }
1261
+ }
1262
+ return false;
1263
+ };
1264
+ let arrowDown = (e) => {
1265
+ if (delegate.getKeyBelow) {
1266
+ let nextKey = manager.focusedKey != null ? delegate.getKeyBelow?.(manager.focusedKey) : delegate.getFirstKey?.();
1267
+ if (nextKey == null && shouldFocusWrap) nextKey = delegate.getFirstKey?.(manager.focusedKey);
1268
+ if (nextKey != null) {
1269
+ navigateToKey(e, nextKey);
1270
+ return;
1271
+ }
1272
+ }
1273
+ return false;
1274
+ };
1275
+ let arrowUp = (e) => {
1276
+ if (delegate.getKeyAbove) {
1277
+ let nextKey = manager.focusedKey != null ? delegate.getKeyAbove?.(manager.focusedKey) : delegate.getLastKey?.();
1278
+ if (nextKey == null && shouldFocusWrap) nextKey = delegate.getLastKey?.(manager.focusedKey);
1279
+ if (nextKey != null) {
1280
+ navigateToKey(e, nextKey);
1281
+ return;
1282
+ }
1283
+ }
1284
+ return false;
1285
+ };
1286
+ let home = (e) => {
1287
+ if (delegate.getFirstKey) {
1288
+ if (manager.focusedKey === null && e.shiftKey) return false;
1289
+ let firstKey2 = delegate.getFirstKey(manager.focusedKey, $bb39c0fc1c19b34c$export$16792effe837dba3(e));
1290
+ manager.setFocusedKey(firstKey2);
1291
+ if (firstKey2 != null) {
1292
+ if ($bb39c0fc1c19b34c$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") {
1293
+ manager.extendSelection(firstKey2);
1294
+ return;
1295
+ } else if (selectOnFocus) {
1296
+ manager.replaceSelection(firstKey2);
1297
+ return;
1298
+ }
1299
+ }
1300
+ }
1301
+ return false;
1302
+ };
1303
+ let arrowLeft = (e) => {
1304
+ if (delegate.getKeyLeftOf) {
1305
+ let nextKey = manager.focusedKey != null ? delegate.getKeyLeftOf?.(manager.focusedKey) : delegate.getFirstKey?.();
1306
+ if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? delegate.getFirstKey?.(manager.focusedKey) : delegate.getLastKey?.(manager.focusedKey);
1307
+ if (nextKey != null) {
1308
+ navigateToKey(e, nextKey, direction === "rtl" ? "first" : "last");
1309
+ return;
1310
+ }
1311
+ }
1312
+ return false;
1313
+ };
1314
+ let arrowRight = (e) => {
1315
+ if (delegate.getKeyRightOf) {
1316
+ let nextKey = manager.focusedKey != null ? delegate.getKeyRightOf?.(manager.focusedKey) : delegate.getFirstKey?.();
1317
+ if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? delegate.getLastKey?.(manager.focusedKey) : delegate.getFirstKey?.(manager.focusedKey);
1318
+ if (nextKey != null) {
1319
+ navigateToKey(e, nextKey, direction === "rtl" ? "last" : "first");
1320
+ return;
1321
+ }
1322
+ }
1323
+ return false;
1324
+ };
1325
+ let end = (e) => {
1326
+ if (delegate.getLastKey) {
1327
+ if (manager.focusedKey === null && e.shiftKey) return false;
1328
+ let lastKey = delegate.getLastKey(manager.focusedKey, $bb39c0fc1c19b34c$export$16792effe837dba3(e));
1329
+ manager.setFocusedKey(lastKey);
1330
+ if (lastKey != null) {
1331
+ if ($bb39c0fc1c19b34c$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") {
1332
+ manager.extendSelection(lastKey);
1333
+ return;
1334
+ } else if (selectOnFocus) {
1335
+ manager.replaceSelection(lastKey);
1336
+ return;
1337
+ }
1338
+ }
1339
+ }
1340
+ return false;
1341
+ };
1342
+ let pageDown = (e) => {
1343
+ if (delegate.getKeyPageBelow && manager.focusedKey != null) {
1344
+ let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
1345
+ if (nextKey != null) return navigateToKey(e, nextKey);
1346
+ }
1347
+ return false;
1348
+ };
1349
+ let pageUp = (e) => {
1350
+ if (delegate.getKeyPageAbove && manager.focusedKey != null) {
1351
+ let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
1352
+ if (nextKey != null) return navigateToKey(e, nextKey);
1353
+ }
1354
+ return false;
1355
+ };
1356
+ let aHandler = () => {
1357
+ if (manager.selectionMode === "multiple" && disallowSelectAll !== true) {
1358
+ manager.selectAll();
1359
+ return;
1360
+ }
1361
+ return false;
1362
+ };
1363
+ let escape = () => {
1364
+ if (escapeKeyBehavior === "clearSelection" && !disallowEmptySelection && manager.selectedKeys.size !== 0) {
1365
+ manager.clearSelection();
1366
+ return;
1367
+ }
1368
+ return false;
1369
+ };
1370
+ let tab = () => {
1371
+ if (!allowsTabNavigation && ref.current) {
1372
+ let walker = FocusScope.$535772f9d2c1f38d$export$2d6ec8fc375ceafa(ref.current, {
1373
+ tabbable: true
1374
+ });
1375
+ let next = void 0;
1376
+ let last;
1377
+ do {
1378
+ last = walker.lastChild();
1379
+ if (last) next = last;
1380
+ } while (last);
1381
+ let activeElement = focusSafely.$23f2114a1b82827e$export$cd4e5573fbe2b576();
1382
+ if (next && (!focusSafely.$23f2114a1b82827e$export$b4f377a2b6254582(next) || activeElement && !focusSafely.$3b8b240c1bf84ab9$export$bebd5a1431fec25d(activeElement))) focusSafely.$1969ac565cfec8d0$export$de79e2c695e052f3(next);
1383
+ }
1384
+ return {
1385
+ shouldContinuePropagation: true,
1386
+ shouldPreventDefault: false
1387
+ };
1388
+ };
1389
+ let shiftTab = () => {
1390
+ if (!allowsTabNavigation && ref.current) ref.current.focus();
1391
+ return {
1392
+ shouldContinuePropagation: true,
1393
+ shouldPreventDefault: false
1394
+ };
1395
+ };
1396
+ let withShiftSel = (key, callback) => {
1397
+ return {
1398
+ [focusSafely.$2add3ce32c6007eb$export$9ac100e40613ea10() ? key + "+Shift+Alt" : key + "+Shift+Control"]: callback,
1399
+ [key + "+Shift"]: callback,
1400
+ [focusSafely.$2add3ce32c6007eb$export$9ac100e40613ea10() ? key + "+Alt" : key + "+Control"]: callback,
1401
+ [key]: callback
1402
+ };
1403
+ };
1404
+ let { keyboardProps: repeatKeyboardProps } = useHover.$8296dad1a4c5e0dc$export$8f71654801c2f7cd({
1405
+ shortcuts: {
1406
+ ...withShiftSel("ArrowDown", arrowDown),
1407
+ ...withShiftSel("ArrowUp", arrowUp),
1408
+ ...withShiftSel("ArrowLeft", arrowLeft),
1409
+ ...withShiftSel("ArrowRight", arrowRight),
1410
+ ...withShiftSel("PageDown", pageDown),
1411
+ ...withShiftSel("PageUp", pageUp)
1412
+ },
1413
+ allowRepeats: true
1414
+ });
1415
+ let { keyboardProps } = useHover.$8296dad1a4c5e0dc$export$8f71654801c2f7cd({
1416
+ shortcuts: {
1417
+ ...withShiftSel("Home", home),
1418
+ ...withShiftSel("End", end),
1419
+ "Mod+A": aHandler,
1420
+ Escape: escape,
1421
+ Tab: tab,
1422
+ "Tab+Shift": shiftTab
1423
+ }
1424
+ });
1425
+ let scrollPos = React.useRef({
1426
+ top: 0,
1427
+ left: 0
1428
+ });
1429
+ $600b3cf69ae46262$export$90fc3a17d93f704c(scrollRef, "scroll", () => {
1430
+ scrollPos.current = {
1431
+ top: scrollRef.current?.scrollTop ?? 0,
1432
+ left: scrollRef.current?.scrollLeft ?? 0
1433
+ };
1434
+ });
1435
+ let onFocus = (e) => {
1436
+ if (manager.isFocused) {
1437
+ if (!focusSafely.$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, focusSafely.$23f2114a1b82827e$export$e58f029f0fbfdb29(e))) manager.setFocused(false);
1438
+ return;
1439
+ }
1440
+ if (!focusSafely.$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, focusSafely.$23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
1441
+ let modality = focusSafely.$8f5a2122b0992be3$export$630ff653c5ada6a9();
1442
+ manager.setFocused(true);
1443
+ let navigateToKey2 = (key) => {
1444
+ if (key != null) {
1445
+ manager.setFocusedKey(key);
1446
+ if (selectOnFocus && !manager.isSelected(key)) manager.replaceSelection(key);
1447
+ }
1448
+ };
1449
+ if (UNSTABLE_focusOnEntry && (modality === "keyboard" || modality === "virtual"))
1450
+ navigateToKey2(UNSTABLE_focusOnEntry === "first" ? delegate.getFirstKey?.() : delegate.getLastKey?.());
1451
+ else if (manager.focusedKey == null) {
1452
+ let relatedTarget = e.relatedTarget;
1453
+ if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToKey2(manager.lastSelectedKey ?? delegate.getLastKey?.());
1454
+ else navigateToKey2(manager.firstSelectedKey ?? delegate.getFirstKey?.());
1455
+ } else if (scrollRef.current) {
1456
+ scrollRef.current.scrollTop = scrollPos.current.top;
1457
+ scrollRef.current.scrollLeft = scrollPos.current.left;
1458
+ }
1459
+ if (manager.focusedKey != null && scrollRef.current) {
1460
+ let element = $22bbea12c2567021$export$c3d8340acf92597f(ref, manager.focusedKey);
1461
+ if (element instanceof HTMLElement) {
1462
+ if (!focusSafely.$23f2114a1b82827e$export$b4f377a2b6254582(element) && !shouldUseVirtualFocus) focusSafely.$1969ac565cfec8d0$export$de79e2c695e052f3(element);
1463
+ if (modality === "keyboard" || UNSTABLE_focusOnEntry && modality === "virtual") $51a3e22a5186a962$export$c826860796309d1b(element, {
1464
+ containingElement: ref.current
1465
+ });
1466
+ }
1467
+ }
1468
+ };
1469
+ let onBlur = (e) => {
1470
+ if (!focusSafely.$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, e.relatedTarget)) manager.setFocused(false);
1471
+ };
1472
+ let shouldVirtualFocusFirst = React.useRef(false);
1473
+ $600b3cf69ae46262$export$90fc3a17d93f704c(ref, $8b2399d051d06d4c$export$831c820ad60f9d12, !shouldUseVirtualFocus ? void 0 : (e) => {
1474
+ let { detail } = e;
1475
+ e.stopPropagation();
1476
+ manager.setFocused(true);
1477
+ if (detail?.focusStrategy === "first") shouldVirtualFocusFirst.current = true;
1478
+ });
1479
+ let firstKey = delegate.getFirstKey?.() ?? null;
1480
+ $a475cdc2445827b5$export$72ef708ab07251f1(() => {
1481
+ if (shouldVirtualFocusFirst.current) {
1482
+ if (firstKey == null) {
1483
+ let previousActiveElement = focusSafely.$23f2114a1b82827e$export$cd4e5573fbe2b576();
1484
+ $b72f3f7b3b5f42c6$export$76e4e37e5339496d(ref.current);
1485
+ $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(previousActiveElement, null);
1486
+ if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
1487
+ } else {
1488
+ manager.setFocusedKey(firstKey);
1489
+ shouldVirtualFocusFirst.current = false;
1490
+ }
1491
+ }
1492
+ }, [
1493
+ firstKey,
1494
+ manager.collection.size
1495
+ ]);
1496
+ $a475cdc2445827b5$export$72ef708ab07251f1(() => {
1497
+ if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
1498
+ }, [
1499
+ manager.focusedKey
1500
+ ]);
1501
+ $600b3cf69ae46262$export$90fc3a17d93f704c(ref, $8b2399d051d06d4c$export$447a38995de2c711, !shouldUseVirtualFocus ? void 0 : (e) => {
1502
+ e.stopPropagation();
1503
+ manager.setFocused(false);
1504
+ if (e.detail?.clearFocusKey) manager.setFocusedKey(null);
1505
+ });
1506
+ const autoFocusRef = React.useRef(autoFocus);
1507
+ const didAutoFocusRef = React.useRef(false);
1508
+ React.useEffect(() => {
1509
+ if (autoFocusRef.current) {
1510
+ let focusedKey = null;
1511
+ if (autoFocus === "first") focusedKey = delegate.getFirstKey?.() ?? null;
1512
+ if (autoFocus === "last") focusedKey = delegate.getLastKey?.() ?? null;
1513
+ let selectedKeys = manager.selectedKeys;
1514
+ if (selectedKeys.size) {
1515
+ for (let key of selectedKeys) if (manager.canSelectItem(key)) {
1516
+ focusedKey = key;
1517
+ break;
1518
+ }
1519
+ }
1520
+ manager.setFocused(true);
1521
+ manager.setFocusedKey(focusedKey);
1522
+ if (focusedKey != null && selectOnFocus && !selectedKeys.size && manager.canSelectItem(focusedKey)) manager.replaceSelection(focusedKey);
1523
+ if (focusedKey == null && !shouldUseVirtualFocus && ref.current) focusSafely.$f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
1524
+ if (manager.collection.size > 0) {
1525
+ autoFocusRef.current = false;
1526
+ didAutoFocusRef.current = true;
1527
+ }
1528
+ }
1529
+ });
1530
+ let lastFocusedKey = React.useRef(manager.focusedKey);
1531
+ let raf = React.useRef(null);
1532
+ React.useEffect(() => {
1533
+ if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || didAutoFocusRef.current) && scrollRef.current && ref.current) {
1534
+ let modality = focusSafely.$8f5a2122b0992be3$export$630ff653c5ada6a9();
1535
+ let element = $22bbea12c2567021$export$c3d8340acf92597f(ref, manager.focusedKey);
1536
+ if (!(element instanceof HTMLElement))
1537
+ return;
1538
+ if (modality === "keyboard" || didAutoFocusRef.current) {
1539
+ if (raf.current) cancelAnimationFrame(raf.current);
1540
+ raf.current = requestAnimationFrame(() => {
1541
+ if (scrollRef.current) {
1542
+ $51a3e22a5186a962$export$53a0910f038337bd(scrollRef.current, element);
1543
+ if (modality !== "virtual") $51a3e22a5186a962$export$c826860796309d1b(element, {
1544
+ containingElement: ref.current
1545
+ });
1546
+ }
1547
+ });
1548
+ }
1549
+ }
1550
+ if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) focusSafely.$f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
1551
+ lastFocusedKey.current = manager.focusedKey;
1552
+ didAutoFocusRef.current = false;
1553
+ });
1554
+ React.useEffect(() => {
1555
+ return () => {
1556
+ if (raf.current) cancelAnimationFrame(raf.current);
1557
+ };
1558
+ }, []);
1559
+ $600b3cf69ae46262$export$90fc3a17d93f704c(ref, "react-aria-focus-scope-restore", (e) => {
1560
+ e.preventDefault();
1561
+ manager.setFocused(true);
1562
+ });
1563
+ let handlers = {
1564
+ ...utils.$bbaa08b3cd72f041$export$9d1611c77c2fe928(keyboardProps, repeatKeyboardProps),
1565
+ onFocus,
1566
+ onBlur,
1567
+ onMouseDown(e) {
1568
+ if (scrollRef.current === focusSafely.$23f2114a1b82827e$export$e58f029f0fbfdb29(e))
1569
+ e.preventDefault();
1570
+ }
1571
+ };
1572
+ let { typeSelectProps } = $f5a4a9a3486154da$export$e32c88dfddc6e1d8({
1573
+ keyboardDelegate: delegate,
1574
+ selectionManager: manager
1575
+ });
1576
+ if (!disallowTypeAhead)
1577
+ handlers = utils.$bbaa08b3cd72f041$export$9d1611c77c2fe928(typeSelectProps, handlers);
1578
+ let tabIndex = void 0;
1579
+ if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
1580
+ let collectionId = $22bbea12c2567021$export$881eb0d9f3605d9d(manager.collection);
1581
+ return {
1582
+ // oxlint-disable-next-line react/react-compiler
1583
+ collectionProps: utils.$bbaa08b3cd72f041$export$9d1611c77c2fe928(handlers, {
1584
+ tabIndex,
1585
+ "data-collection": collectionId
1586
+ })
1587
+ };
1588
+ }
1589
+ const $7b01448eaad0fe7c$var$DEFAULT_THRESHOLD = 500;
1590
+ function $7b01448eaad0fe7c$export$c24ed0104d07eab9(props) {
1591
+ let { isDisabled, pointerType, onLongPressStart, onLongPressEnd, onLongPress, threshold = $7b01448eaad0fe7c$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
1592
+ const timeRef = React.useRef(void 0);
1593
+ let { addGlobalListener, removeAllGlobalListeners } = useHover.$48a7d519b337145d$export$4eaf04e54aa8eed6();
1594
+ let isAcceptedPointerType = (e) => pointerType ? e.pointerType === pointerType : e.pointerType === "mouse" || e.pointerType === "touch";
1595
+ let { pressProps } = usePress.$d27d541f9569d26d$export$45712eceda6fad21({
1596
+ isDisabled,
1597
+ onPressStart(e) {
1598
+ e.continuePropagation();
1599
+ if (isAcceptedPointerType(e)) {
1600
+ if (onLongPressStart) onLongPressStart({
1601
+ ...e,
1602
+ type: "longpressstart"
1603
+ });
1604
+ timeRef.current = setTimeout(() => {
1605
+ e.target.dispatchEvent(new PointerEvent("pointercancel", {
1606
+ bubbles: true
1607
+ }));
1608
+ addGlobalListener(e.target, "click", (e2) => e2.preventDefault(), {
1609
+ once: true
1610
+ });
1611
+ if (focusSafely.$d447af545b77c9f1$export$b204af158042fbac(e.target).activeElement !== e.target) focusSafely.$1969ac565cfec8d0$export$de79e2c695e052f3(e.target);
1612
+ if (onLongPress) onLongPress({
1613
+ ...e,
1614
+ type: "longpress"
1615
+ });
1616
+ timeRef.current = void 0;
1617
+ }, threshold);
1618
+ if (e.pointerType === "touch") addGlobalListener(e.target, "contextmenu", (e2) => e2.preventDefault(), {
1619
+ once: true
1620
+ });
1621
+ let ownerWindow = focusSafely.$d447af545b77c9f1$export$f21a1ffae260145a(e.target);
1622
+ addGlobalListener(ownerWindow, "pointerup", () => {
1623
+ setTimeout(() => {
1624
+ removeAllGlobalListeners();
1625
+ }, 100);
1626
+ }, {
1627
+ once: true
1628
+ });
1629
+ }
1630
+ },
1631
+ onPressEnd(e) {
1632
+ if (timeRef.current) clearTimeout(timeRef.current);
1633
+ if (onLongPressEnd && isAcceptedPointerType(e)) onLongPressEnd({
1634
+ ...e,
1635
+ type: "longpressend"
1636
+ });
1637
+ }
1638
+ });
1639
+ let descriptionProps = $121970af65029459$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : void 0);
1640
+ return {
1641
+ longPressProps: utils.$bbaa08b3cd72f041$export$9d1611c77c2fe928(pressProps, descriptionProps)
1642
+ };
1643
+ }
1644
+ function $f6ba6936bfd098a0$export$ecf600387e221c37(options) {
1645
+ let { id, selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
1646
+ let router = focusSafely.$caaf0dd3060ed57c$export$9a302a45f65d0572();
1647
+ id = utils.$390e54f620492c70$export$f680877a34711e37(id);
1648
+ let onSelect = (e) => {
1649
+ if (e.pointerType === "keyboard" && $22bbea12c2567021$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
1650
+ else {
1651
+ if (manager.selectionMode === "none") return;
1652
+ if (manager.isLink(key)) {
1653
+ if (linkBehavior === "selection" && ref.current) {
1654
+ let itemProps2 = manager.getItemProps(key);
1655
+ router.open(ref.current, e, itemProps2.href, itemProps2.routerOptions);
1656
+ manager.setSelectedKeys(manager.selectedKeys);
1657
+ return;
1658
+ } else if (linkBehavior === "override" || linkBehavior === "none") return;
1659
+ }
1660
+ if (manager.selectionMode === "single") {
1661
+ if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
1662
+ else manager.replaceSelection(key);
1663
+ } else if (e && e.shiftKey) manager.extendSelection(key);
1664
+ else if (manager.selectionBehavior === "toggle" || e && ($bb39c0fc1c19b34c$export$16792effe837dba3(e) || e.pointerType === "touch" || e.pointerType === "virtual"))
1665
+ manager.toggleSelection(key);
1666
+ else manager.replaceSelection(key);
1667
+ }
1668
+ };
1669
+ React.useEffect(() => {
1670
+ let isFocused = key === manager.focusedKey;
1671
+ if (isFocused && manager.isFocused) {
1672
+ if (!shouldUseVirtualFocus) {
1673
+ if (focus) focus();
1674
+ else if (focusSafely.$23f2114a1b82827e$export$cd4e5573fbe2b576() !== ref.current && ref.current) focusSafely.$f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
1675
+ } else $b72f3f7b3b5f42c6$export$76e4e37e5339496d(ref.current);
1676
+ }
1677
+ }, [
1678
+ ref,
1679
+ key,
1680
+ manager.focusedKey,
1681
+ manager.childFocusStrategy,
1682
+ manager.isFocused,
1683
+ shouldUseVirtualFocus
1684
+ ]);
1685
+ isDisabled = isDisabled || manager.isDisabled(key);
1686
+ let itemProps = {};
1687
+ if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
1688
+ tabIndex: key === manager.focusedKey ? 0 : -1,
1689
+ onFocus(e) {
1690
+ if (focusSafely.$23f2114a1b82827e$export$e58f029f0fbfdb29(e) === ref.current) manager.setFocusedKey(key);
1691
+ }
1692
+ };
1693
+ else if (isDisabled) itemProps.onMouseDown = (e) => {
1694
+ e.preventDefault();
1695
+ };
1696
+ React.useEffect(() => {
1697
+ if (isDisabled && manager.focusedKey === key) manager.setFocusedKey(null);
1698
+ }, [
1699
+ manager,
1700
+ isDisabled,
1701
+ key
1702
+ ]);
1703
+ let isLinkOverride = manager.isLink(key) && linkBehavior === "override";
1704
+ let isActionOverride = onAction && options["UNSTABLE_itemBehavior"] === "action";
1705
+ let hasLinkAction = manager.isLink(key) && linkBehavior !== "selection" && linkBehavior !== "none";
1706
+ let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride && !isActionOverride;
1707
+ let allowsActions = (onAction || hasLinkAction) && !isDisabled;
1708
+ let hasPrimaryAction = allowsActions && (manager.selectionBehavior === "replace" ? !allowsSelection : !allowsSelection || manager.isEmpty);
1709
+ let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === "replace";
1710
+ let hasAction = hasPrimaryAction || hasSecondaryAction;
1711
+ let modality = React.useRef(null);
1712
+ let longPressEnabled = hasAction && allowsSelection;
1713
+ let longPressEnabledOnPressStart = React.useRef(false);
1714
+ let hadPrimaryActionOnPressStart = React.useRef(false);
1715
+ let collectionItemProps = manager.getItemProps(key);
1716
+ let performAction = (e) => {
1717
+ if (onAction) {
1718
+ onAction();
1719
+ ref.current?.dispatchEvent(new CustomEvent("react-aria-item-action", {
1720
+ bubbles: true
1721
+ }));
1722
+ }
1723
+ if (hasLinkAction && ref.current) router.open(ref.current, e, collectionItemProps.href, collectionItemProps.routerOptions);
1724
+ };
1725
+ let itemPressProps = {
1726
+ ref
1727
+ };
1728
+ if (shouldSelectOnPressUp) {
1729
+ itemPressProps.onPressStart = (e) => {
1730
+ modality.current = e.pointerType;
1731
+ longPressEnabledOnPressStart.current = longPressEnabled;
1732
+ if (e.pointerType === "keyboard" && (!hasAction || $f6ba6936bfd098a0$var$isSelectionKey(e.key))) onSelect(e);
1733
+ };
1734
+ if (!allowsDifferentPressOrigin)
1735
+ itemPressProps.onPress = (e) => {
1736
+ if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== "mouse") {
1737
+ if (e.pointerType === "keyboard" && !$f6ba6936bfd098a0$var$isActionKey(e.key)) return;
1738
+ performAction(e);
1739
+ } else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
1740
+ };
1741
+ else {
1742
+ itemPressProps.onPressUp = hasPrimaryAction ? void 0 : (e) => {
1743
+ if (e.pointerType === "mouse" && allowsSelection) onSelect(e);
1744
+ };
1745
+ itemPressProps.onPress = hasPrimaryAction ? performAction : (e) => {
1746
+ if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection) onSelect(e);
1747
+ };
1748
+ }
1749
+ } else {
1750
+ itemPressProps.onPressStart = (e) => {
1751
+ modality.current = e.pointerType;
1752
+ longPressEnabledOnPressStart.current = longPressEnabled;
1753
+ hadPrimaryActionOnPressStart.current = hasPrimaryAction;
1754
+ if (allowsSelection && (e.pointerType === "mouse" && !hasPrimaryAction || e.pointerType === "keyboard" && (!allowsActions || $f6ba6936bfd098a0$var$isSelectionKey(e.key)))) onSelect(e);
1755
+ };
1756
+ itemPressProps.onPress = (e) => {
1757
+ if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction && $f6ba6936bfd098a0$var$isActionKey(e.key) || e.pointerType === "mouse" && hadPrimaryActionOnPressStart.current) {
1758
+ if (hasAction) performAction(e);
1759
+ else if (allowsSelection) onSelect(e);
1760
+ }
1761
+ };
1762
+ }
1763
+ let collectionId = $22bbea12c2567021$export$6aeb1680a0ae8741(manager.collection);
1764
+ itemProps["data-collection"] = collectionId;
1765
+ itemProps["data-key"] = key;
1766
+ itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
1767
+ if (shouldUseVirtualFocus)
1768
+ itemPressProps = utils.$bbaa08b3cd72f041$export$9d1611c77c2fe928(itemPressProps, {
1769
+ onPressStart(e) {
1770
+ if (e.pointerType !== "touch") {
1771
+ manager.setFocused(true);
1772
+ manager.setFocusedKey(key);
1773
+ }
1774
+ },
1775
+ onPress(e) {
1776
+ if (e.pointerType === "touch") {
1777
+ manager.setFocused(true);
1778
+ manager.setFocusedKey(key);
1779
+ }
1780
+ }
1781
+ });
1782
+ if (collectionItemProps) {
1783
+ for (let key2 of [
1784
+ "onPressStart",
1785
+ "onPressEnd",
1786
+ "onPressChange",
1787
+ "onPress",
1788
+ "onPressUp",
1789
+ "onClick"
1790
+ ]) if (collectionItemProps[key2])
1791
+ itemPressProps[key2] = utils.$a4e76a5424781910$export$e08e3b67e392101e(itemPressProps[key2], collectionItemProps[key2]);
1792
+ }
1793
+ let { pressProps, isPressed } = usePress.$d27d541f9569d26d$export$45712eceda6fad21(itemPressProps);
1794
+ let onDoubleClick = hasSecondaryAction ? (e) => {
1795
+ if (modality.current === "mouse") {
1796
+ e.stopPropagation();
1797
+ e.preventDefault();
1798
+ performAction(e);
1799
+ }
1800
+ } : void 0;
1801
+ let { longPressProps } = $7b01448eaad0fe7c$export$c24ed0104d07eab9({
1802
+ isDisabled: !longPressEnabled,
1803
+ onLongPress(e) {
1804
+ if (e.pointerType === "touch") {
1805
+ onSelect(e);
1806
+ manager.setSelectionBehavior("toggle");
1807
+ }
1808
+ }
1809
+ });
1810
+ let onDragStartCapture = (e) => {
1811
+ if (modality.current === "touch" && longPressEnabledOnPressStart.current) e.preventDefault();
1812
+ };
1813
+ let onClick = linkBehavior !== "none" && manager.isLink(key) ? (e) => {
1814
+ if (!focusSafely.$caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening) e.preventDefault();
1815
+ } : void 0;
1816
+ let mergedItemProps = utils.$bbaa08b3cd72f041$export$9d1611c77c2fe928(
1817
+ // oxlint-disable-next-line react/react-compiler
1818
+ itemProps,
1819
+ allowsSelection || hasPrimaryAction || shouldUseVirtualFocus && !isDisabled ? pressProps : {},
1820
+ longPressEnabled ? longPressProps : {},
1821
+ // oxlint-disable-next-line react/react-compiler
1822
+ {
1823
+ onDoubleClick,
1824
+ onDragStartCapture,
1825
+ onClick,
1826
+ id
1827
+ },
1828
+ // Prevent DOM focus from moving on mouse down when using virtual focus
1829
+ shouldUseVirtualFocus ? {
1830
+ onMouseDown: (e) => e.preventDefault()
1831
+ } : void 0
1832
+ );
1833
+ let isChildInteraction = (target) => {
1834
+ let el = target;
1835
+ while (el && el !== ref.current) {
1836
+ let elCollection = el.getAttribute("data-collection");
1837
+ if (elCollection != null) return elCollection !== collectionId;
1838
+ el = el.parentElement;
1839
+ }
1840
+ return focusSafely.$3b8b240c1bf84ab9$export$bebd5a1431fec25d(target);
1841
+ };
1842
+ let baseOnPointerDown = mergedItemProps.onPointerDown;
1843
+ mergedItemProps.onPointerDown = (e) => {
1844
+ let target = focusSafely.$23f2114a1b82827e$export$e58f029f0fbfdb29(e);
1845
+ if (target && target !== ref.current && isChildInteraction(target)) {
1846
+ e.stopPropagation();
1847
+ return;
1848
+ }
1849
+ baseOnPointerDown?.(e);
1850
+ };
1851
+ let baseOnMouseDown = mergedItemProps.onMouseDown;
1852
+ mergedItemProps.onMouseDown = (e) => {
1853
+ let target = focusSafely.$23f2114a1b82827e$export$e58f029f0fbfdb29(e);
1854
+ if (target && target !== ref.current && isChildInteraction(target)) {
1855
+ e.stopPropagation();
1856
+ return;
1857
+ }
1858
+ baseOnMouseDown?.(e);
1859
+ };
1860
+ return {
1861
+ itemProps: mergedItemProps,
1862
+ isPressed,
1863
+ isSelected: manager.isSelected(key),
1864
+ isFocused: manager.isFocused && manager.focusedKey === key,
1865
+ isDisabled,
1866
+ allowsSelection,
1867
+ hasAction
1868
+ };
1869
+ }
1870
+ function $f6ba6936bfd098a0$var$isActionKey(key) {
1871
+ return key === "Enter";
1872
+ }
1873
+ function $f6ba6936bfd098a0$var$isSelectionKey(key) {
1874
+ return key === " ";
1875
+ }
1876
+ function $cd5ea4b915021f1d$export$1005530eda016c13(node, collection) {
1877
+ if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
1878
+ return node.childNodes;
1879
+ }
1880
+ function $cd5ea4b915021f1d$export$fbdeaa6a76694f71(iterable) {
1881
+ return $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, 0);
1882
+ }
1883
+ function $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, index) {
1884
+ if (index < 0) return void 0;
1885
+ let i = 0;
1886
+ for (let item of iterable) {
1887
+ if (i === index) return item;
1888
+ i++;
1889
+ }
1890
+ }
1891
+ function $cd5ea4b915021f1d$export$7475b2c64539e4cf(iterable) {
1892
+ let lastItem = void 0;
1893
+ for (let value of iterable) lastItem = value;
1894
+ return lastItem;
1895
+ }
1896
+ function $cd5ea4b915021f1d$export$8c434b3a7a4dad6(collection, a, b) {
1897
+ if (a.parentKey === b.parentKey) return a.index - b.index;
1898
+ let aAncestors = [
1899
+ ...$cd5ea4b915021f1d$var$getAncestors(collection, a),
1900
+ a
1901
+ ];
1902
+ let bAncestors = [
1903
+ ...$cd5ea4b915021f1d$var$getAncestors(collection, b),
1904
+ b
1905
+ ];
1906
+ let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a2, i) => a2 !== bAncestors[i]);
1907
+ if (firstNonMatchingAncestor !== -1) {
1908
+ a = aAncestors[firstNonMatchingAncestor];
1909
+ b = bAncestors[firstNonMatchingAncestor];
1910
+ return a.index - b.index;
1911
+ }
1912
+ if (aAncestors.findIndex((node) => node === b) >= 0) return 1;
1913
+ else if (bAncestors.findIndex((node) => node === a) >= 0) return -1;
1914
+ return -1;
1915
+ }
1916
+ function $cd5ea4b915021f1d$var$getAncestors(collection, node) {
1917
+ let parents = [];
1918
+ let currNode = node;
1919
+ while (currNode?.parentKey != null) {
1920
+ currNode = collection.getItem(currNode.parentKey);
1921
+ if (currNode) parents.unshift(currNode);
1922
+ }
1923
+ return parents;
1924
+ }
1925
+ function $b24d1bc31a0f941d$export$a9d04c5684123369(value) {
1926
+ const pieces = React.version.split(".");
1927
+ const major = parseInt(pieces[0], 10);
1928
+ if (major >= 19) return value;
1929
+ return value ? "true" : void 0;
1930
+ }
1931
+ class $8b2540e09867b15e$export$52baac22726c72bf extends Set {
1932
+ constructor(keys, anchorKey, currentKey) {
1933
+ super(keys);
1934
+ if (keys instanceof $8b2540e09867b15e$export$52baac22726c72bf) {
1935
+ this.anchorKey = anchorKey ?? keys.anchorKey;
1936
+ this.currentKey = currentKey ?? keys.currentKey;
1937
+ } else {
1938
+ this.anchorKey = anchorKey ?? null;
1939
+ this.currentKey = currentKey ?? null;
1940
+ }
1941
+ }
1942
+ }
1943
+ function $60f19cefd567a3e4$var$equalSets(setA, setB) {
1944
+ if (setA.size !== setB.size) return false;
1945
+ for (let item of setA) {
1946
+ if (!setB.has(item)) return false;
1947
+ }
1948
+ return true;
1949
+ }
1950
+ function $60f19cefd567a3e4$export$253fe78d46329472(props) {
1951
+ let { selectionMode = "none", disallowEmptySelection = false, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
1952
+ let isFocusedRef = React.useRef(false);
1953
+ let [, setFocused] = React.useState(false);
1954
+ let focusedKeyRef = React.useRef(null);
1955
+ let childFocusStrategyRef = React.useRef(null);
1956
+ let [, setFocusedKey] = React.useState(null);
1957
+ let selectedKeysProp = React.useMemo(() => $60f19cefd567a3e4$var$convertSelection(props.selectedKeys), [
1958
+ props.selectedKeys
1959
+ ]);
1960
+ let defaultSelectedKeys = React.useMemo(() => $60f19cefd567a3e4$var$convertSelection(props.defaultSelectedKeys, new $8b2540e09867b15e$export$52baac22726c72bf()), [
1961
+ props.defaultSelectedKeys
1962
+ ]);
1963
+ let [selectedKeys, setSelectedKeys] = useControlledState.$3e6197669829fe11$export$40bfa8c7b0832715(selectedKeysProp, defaultSelectedKeys, props.onSelectionChange);
1964
+ let disabledKeysProp = React.useMemo(() => props.disabledKeys ? new Set(props.disabledKeys) : /* @__PURE__ */ new Set(), [
1965
+ props.disabledKeys
1966
+ ]);
1967
+ let [selectionBehavior, setSelectionBehavior] = React.useState(selectionBehaviorProp);
1968
+ if (selectionBehaviorProp === "replace" && selectionBehavior === "toggle" && typeof selectedKeys === "object" && selectedKeys.size === 0) setSelectionBehavior("replace");
1969
+ let lastSelectionBehavior = React.useRef(selectionBehaviorProp);
1970
+ React.useEffect(() => {
1971
+ if (selectionBehaviorProp !== lastSelectionBehavior.current) {
1972
+ setSelectionBehavior(selectionBehaviorProp);
1973
+ lastSelectionBehavior.current = selectionBehaviorProp;
1974
+ }
1975
+ }, [
1976
+ selectionBehaviorProp
1977
+ ]);
1978
+ return {
1979
+ selectionMode,
1980
+ disallowEmptySelection,
1981
+ selectionBehavior,
1982
+ setSelectionBehavior,
1983
+ get isFocused() {
1984
+ return isFocusedRef.current;
1985
+ },
1986
+ setFocused(f) {
1987
+ isFocusedRef.current = f;
1988
+ setFocused(f);
1989
+ },
1990
+ get focusedKey() {
1991
+ return focusedKeyRef.current;
1992
+ },
1993
+ get childFocusStrategy() {
1994
+ return childFocusStrategyRef.current;
1995
+ },
1996
+ setFocusedKey(k, childFocusStrategy = "first") {
1997
+ focusedKeyRef.current = k;
1998
+ childFocusStrategyRef.current = childFocusStrategy;
1999
+ setFocusedKey(k);
2000
+ },
2001
+ selectedKeys,
2002
+ setSelectedKeys(keys) {
2003
+ if (allowDuplicateSelectionEvents || !$60f19cefd567a3e4$var$equalSets(keys, selectedKeys)) setSelectedKeys(keys);
2004
+ },
2005
+ disabledKeys: disabledKeysProp,
2006
+ disabledBehavior
2007
+ };
2008
+ }
2009
+ function $60f19cefd567a3e4$var$convertSelection(selection, defaultValue) {
2010
+ if (!selection) return defaultValue;
2011
+ return selection === "all" ? "all" : new $8b2540e09867b15e$export$52baac22726c72bf(selection);
2012
+ }
2013
+ class $4a07ac835f260f78$export$6c8a5aaad13c9852 {
2014
+ constructor(collection, state, options) {
2015
+ this.collection = collection;
2016
+ this.state = state;
2017
+ this.allowsCellSelection = options?.allowsCellSelection ?? false;
2018
+ this._isSelectAll = null;
2019
+ this.layoutDelegate = options?.layoutDelegate || null;
2020
+ this.fullCollection = options?.fullCollection || null;
2021
+ }
2022
+ /**
2023
+ * The type of selection that is allowed in the collection.
2024
+ */
2025
+ get selectionMode() {
2026
+ return this.state.selectionMode;
2027
+ }
2028
+ /**
2029
+ * Whether the collection allows empty selection.
2030
+ */
2031
+ get disallowEmptySelection() {
2032
+ return this.state.disallowEmptySelection;
2033
+ }
2034
+ /**
2035
+ * The selection behavior for the collection.
2036
+ */
2037
+ get selectionBehavior() {
2038
+ return this.state.selectionBehavior;
2039
+ }
2040
+ /**
2041
+ * Sets the selection behavior for the collection.
2042
+ */
2043
+ setSelectionBehavior(selectionBehavior) {
2044
+ this.state.setSelectionBehavior(selectionBehavior);
2045
+ }
2046
+ /**
2047
+ * Whether the collection is currently focused.
2048
+ */
2049
+ get isFocused() {
2050
+ return this.state.isFocused;
2051
+ }
2052
+ /**
2053
+ * Sets whether the collection is focused.
2054
+ */
2055
+ setFocused(isFocused) {
2056
+ this.state.setFocused(isFocused);
2057
+ }
2058
+ /**
2059
+ * The current focused key in the collection.
2060
+ */
2061
+ get focusedKey() {
2062
+ return this.state.focusedKey;
2063
+ }
2064
+ /** Whether the first or last child of the focused key should receive focus. */
2065
+ get childFocusStrategy() {
2066
+ return this.state.childFocusStrategy;
2067
+ }
2068
+ /**
2069
+ * Sets the focused key.
2070
+ */
2071
+ setFocusedKey(key, childFocusStrategy) {
2072
+ if (key == null || this.collection.getItem(key)) this.state.setFocusedKey(key, childFocusStrategy);
2073
+ }
2074
+ /**
2075
+ * The currently selected keys in the collection.
2076
+ */
2077
+ get selectedKeys() {
2078
+ return this.state.selectedKeys === "all" ? new Set(this.getSelectAllKeys()) : this.state.selectedKeys;
2079
+ }
2080
+ /**
2081
+ * The raw selection value for the collection.
2082
+ * Either 'all' for select all, or a set of keys.
2083
+ */
2084
+ get rawSelection() {
2085
+ return this.state.selectedKeys;
2086
+ }
2087
+ /**
2088
+ * Returns whether a key is selected.
2089
+ */
2090
+ isSelected(key) {
2091
+ if (this.state.selectionMode === "none") return false;
2092
+ let mappedKey = this.getKey(key);
2093
+ if (mappedKey == null) return false;
2094
+ return this.state.selectedKeys === "all" ? this.canSelectItem(mappedKey) : this.state.selectedKeys.has(mappedKey);
2095
+ }
2096
+ /**
2097
+ * Whether the selection is empty.
2098
+ */
2099
+ get isEmpty() {
2100
+ return this.state.selectedKeys !== "all" && this.state.selectedKeys.size === 0;
2101
+ }
2102
+ /**
2103
+ * Whether all items in the collection are selected.
2104
+ */
2105
+ get isSelectAll() {
2106
+ if (this.isEmpty) return false;
2107
+ if (this.state.selectedKeys === "all") return true;
2108
+ if (this._isSelectAll != null) return this._isSelectAll;
2109
+ let allKeys = this.getSelectAllKeys();
2110
+ let selectedKeys = this.state.selectedKeys;
2111
+ this._isSelectAll = allKeys.every((k) => selectedKeys.has(k));
2112
+ return this._isSelectAll;
2113
+ }
2114
+ get firstSelectedKey() {
2115
+ let first = null;
2116
+ for (let key of this.state.selectedKeys) {
2117
+ let item = this.collection.getItem(key);
2118
+ if (!first || item && $cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, item, first) < 0) first = item;
2119
+ }
2120
+ return first?.key ?? null;
2121
+ }
2122
+ get lastSelectedKey() {
2123
+ let last = null;
2124
+ for (let key of this.state.selectedKeys) {
2125
+ let item = this.collection.getItem(key);
2126
+ if (!last || item && $cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, item, last) > 0) last = item;
2127
+ }
2128
+ return last?.key ?? null;
2129
+ }
2130
+ get disabledKeys() {
2131
+ return this.state.disabledKeys;
2132
+ }
2133
+ get disabledBehavior() {
2134
+ return this.state.disabledBehavior;
2135
+ }
2136
+ /**
2137
+ * Extends the selection to the given key.
2138
+ */
2139
+ extendSelection(toKey) {
2140
+ if (this.selectionMode === "none") return;
2141
+ if (this.selectionMode === "single") {
2142
+ this.replaceSelection(toKey);
2143
+ return;
2144
+ }
2145
+ let mappedToKey = this.getKey(toKey);
2146
+ if (mappedToKey == null) return;
2147
+ let selection;
2148
+ if (this.state.selectedKeys === "all") selection = new $8b2540e09867b15e$export$52baac22726c72bf([
2149
+ mappedToKey
2150
+ ], mappedToKey, mappedToKey);
2151
+ else {
2152
+ let selectedKeys = this.state.selectedKeys;
2153
+ let anchorKey = selectedKeys.anchorKey ?? mappedToKey;
2154
+ selection = new $8b2540e09867b15e$export$52baac22726c72bf(selectedKeys, anchorKey, mappedToKey);
2155
+ for (let key of this.getKeyRange(anchorKey, selectedKeys.currentKey ?? mappedToKey)) selection.delete(key);
2156
+ for (let key of this.getKeyRange(mappedToKey, anchorKey)) if (this.canSelectItem(key)) selection.add(key);
2157
+ }
2158
+ this.state.setSelectedKeys(selection);
2159
+ }
2160
+ getKeyRange(from, to) {
2161
+ let fromItem = this.collection.getItem(from);
2162
+ let toItem = this.collection.getItem(to);
2163
+ if (fromItem && toItem) {
2164
+ if ($cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, fromItem, toItem) <= 0) return this.getKeyRangeInternal(from, to);
2165
+ return this.getKeyRangeInternal(to, from);
2166
+ }
2167
+ return [];
2168
+ }
2169
+ getKeyRangeInternal(from, to) {
2170
+ if (this.layoutDelegate?.getKeyRange) return this.layoutDelegate.getKeyRange(from, to);
2171
+ let keys = [];
2172
+ let key = from;
2173
+ while (key != null) {
2174
+ let item = this.collection.getItem(key);
2175
+ if (item && (item.type === "item" || item.type === "cell" && this.allowsCellSelection)) keys.push(key);
2176
+ if (key === to) return keys;
2177
+ key = this.collection.getKeyAfter(key);
2178
+ }
2179
+ return [];
2180
+ }
2181
+ getKey(key) {
2182
+ let item = this.collection.getItem(key);
2183
+ if (!item)
2184
+ return key;
2185
+ if (item.type === "cell" && this.allowsCellSelection) return key;
2186
+ while (item && item.type !== "item" && item.parentKey != null) item = this.collection.getItem(item.parentKey);
2187
+ if (!item || item.type !== "item") return null;
2188
+ return item.key;
2189
+ }
2190
+ /**
2191
+ * Toggles whether the given key is selected.
2192
+ */
2193
+ toggleSelection(key) {
2194
+ if (this.selectionMode === "none") return;
2195
+ if (this.selectionMode === "single" && !this.isSelected(key)) {
2196
+ this.replaceSelection(key);
2197
+ return;
2198
+ }
2199
+ let mappedKey = this.getKey(key);
2200
+ if (mappedKey == null) return;
2201
+ let keys = new $8b2540e09867b15e$export$52baac22726c72bf(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
2202
+ if (keys.has(mappedKey)) keys.delete(mappedKey);
2203
+ else if (this.canSelectItem(mappedKey)) {
2204
+ keys.add(mappedKey);
2205
+ keys.anchorKey = mappedKey;
2206
+ keys.currentKey = mappedKey;
2207
+ }
2208
+ if (this.disallowEmptySelection && keys.size === 0) return;
2209
+ this.state.setSelectedKeys(keys);
2210
+ }
2211
+ /**
2212
+ * Replaces the selection with only the given key.
2213
+ */
2214
+ replaceSelection(key) {
2215
+ if (this.selectionMode === "none") return;
2216
+ let mappedKey = this.getKey(key);
2217
+ if (mappedKey == null) return;
2218
+ let selection = this.canSelectItem(mappedKey) ? new $8b2540e09867b15e$export$52baac22726c72bf([
2219
+ mappedKey
2220
+ ], mappedKey, mappedKey) : new $8b2540e09867b15e$export$52baac22726c72bf();
2221
+ this.state.setSelectedKeys(selection);
2222
+ }
2223
+ /**
2224
+ * Replaces the selection with the given keys.
2225
+ */
2226
+ setSelectedKeys(keys) {
2227
+ if (this.selectionMode === "none") return;
2228
+ let selection = new $8b2540e09867b15e$export$52baac22726c72bf();
2229
+ for (let key of keys) {
2230
+ let mappedKey = this.getKey(key);
2231
+ if (mappedKey != null) {
2232
+ selection.add(mappedKey);
2233
+ if (this.selectionMode === "single") break;
2234
+ }
2235
+ }
2236
+ this.state.setSelectedKeys(selection);
2237
+ }
2238
+ getSelectAllKeys() {
2239
+ let collection = this.fullCollection ?? this.collection;
2240
+ let keys = [];
2241
+ let addKeys = (key) => {
2242
+ while (key != null) {
2243
+ if (this.canSelectItemIn(key, collection)) {
2244
+ let item = collection.getItem(key);
2245
+ if (item?.type === "item") keys.push(key);
2246
+ if (item?.hasChildNodes && (this.allowsCellSelection || item.type !== "item")) addKeys($cd5ea4b915021f1d$export$fbdeaa6a76694f71($cd5ea4b915021f1d$export$1005530eda016c13(item, collection))?.key ?? null);
2247
+ }
2248
+ key = collection.getKeyAfter(key);
2249
+ }
2250
+ };
2251
+ addKeys(collection.getFirstKey());
2252
+ return keys;
2253
+ }
2254
+ /**
2255
+ * Selects all items in the collection.
2256
+ */
2257
+ selectAll() {
2258
+ if (!this.isSelectAll && this.selectionMode === "multiple") this.state.setSelectedKeys("all");
2259
+ }
2260
+ /**
2261
+ * Removes all keys from the selection.
2262
+ */
2263
+ clearSelection() {
2264
+ if (!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0)) this.state.setSelectedKeys(new $8b2540e09867b15e$export$52baac22726c72bf());
2265
+ }
2266
+ /**
2267
+ * Toggles between select all and an empty selection.
2268
+ */
2269
+ toggleSelectAll() {
2270
+ if (this.isSelectAll) this.clearSelection();
2271
+ else this.selectAll();
2272
+ }
2273
+ select(key, e) {
2274
+ if (this.selectionMode === "none") return;
2275
+ if (this.selectionMode === "single") {
2276
+ if (this.isSelected(key) && !this.disallowEmptySelection) this.toggleSelection(key);
2277
+ else this.replaceSelection(key);
2278
+ } else if (this.selectionBehavior === "toggle" || e && (e.pointerType === "touch" || e.pointerType === "virtual"))
2279
+ this.toggleSelection(key);
2280
+ else this.replaceSelection(key);
2281
+ }
2282
+ /**
2283
+ * Returns whether the current selection is equal to the given selection.
2284
+ */
2285
+ isSelectionEqual(selection) {
2286
+ if (selection === this.state.selectedKeys) return true;
2287
+ let selectedKeys = this.selectedKeys;
2288
+ if (selection.size !== selectedKeys.size) return false;
2289
+ for (let key of selection) {
2290
+ if (!selectedKeys.has(key)) return false;
2291
+ }
2292
+ for (let key of selectedKeys) {
2293
+ if (!selection.has(key)) return false;
2294
+ }
2295
+ return true;
2296
+ }
2297
+ canSelectItem(key) {
2298
+ return this.canSelectItemIn(key, this.collection);
2299
+ }
2300
+ canSelectItemIn(key, collection) {
2301
+ if (this.state.selectionMode === "none" || this.state.disabledKeys.has(key)) return false;
2302
+ let item = collection.getItem(key);
2303
+ if (!item || item?.props?.isDisabled || item.type === "cell" && !this.allowsCellSelection) return false;
2304
+ return true;
2305
+ }
2306
+ isDisabled(key) {
2307
+ let item = this.collection.getItem(key);
2308
+ return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(key) || !!item?.props?.isDisabled) && item?.props?.disabledBehavior !== "selection";
2309
+ }
2310
+ isLink(key) {
2311
+ return !!this.collection.getItem(key)?.props?.href;
2312
+ }
2313
+ getItemProps(key) {
2314
+ return this.collection.getItem(key)?.props;
2315
+ }
2316
+ withCollection(collection) {
2317
+ return new $4a07ac835f260f78$export$6c8a5aaad13c9852(collection, this.state, {
2318
+ allowsCellSelection: this.allowsCellSelection,
2319
+ layoutDelegate: this.layoutDelegate || void 0,
2320
+ fullCollection: this.fullCollection ?? this.collection
2321
+ });
2322
+ }
2323
+ }
2324
+ class $bda7a7e55e1ff206$export$bf788dd355e3a401 {
2325
+ build(props, context) {
2326
+ this.context = context;
2327
+ return $bda7a7e55e1ff206$var$iterable(() => this.iterateCollection(props));
2328
+ }
2329
+ *iterateCollection(props) {
2330
+ let { children, items } = props;
2331
+ if (React.isValidElement(children) && children.type === React.Fragment) yield* this.iterateCollection({
2332
+ children: children.props.children,
2333
+ items
2334
+ });
2335
+ else if (typeof children === "function") {
2336
+ if (!items) throw new Error("props.children was a function but props.items is missing");
2337
+ let index = 0;
2338
+ for (let item of items) {
2339
+ yield* this.getFullNode({
2340
+ value: item,
2341
+ index
2342
+ }, {
2343
+ renderer: children
2344
+ });
2345
+ index++;
2346
+ }
2347
+ } else {
2348
+ let items2 = [];
2349
+ React.Children.forEach(children, (child) => {
2350
+ if (child) items2.push(child);
2351
+ });
2352
+ let index = 0;
2353
+ for (let item of items2) {
2354
+ let nodes = this.getFullNode({
2355
+ element: item,
2356
+ index
2357
+ }, {});
2358
+ for (let node of nodes) {
2359
+ index++;
2360
+ yield node;
2361
+ }
2362
+ }
2363
+ }
2364
+ }
2365
+ getKey(item, partialNode, state, parentKey) {
2366
+ if (item.key != null) return item.key;
2367
+ if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
2368
+ let v = partialNode.value;
2369
+ if (v != null) {
2370
+ let key = v.key ?? v.id;
2371
+ if (key == null) throw new Error("No key found for item");
2372
+ return key;
2373
+ }
2374
+ return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
2375
+ }
2376
+ getChildState(state, partialNode) {
2377
+ return {
2378
+ renderer: partialNode.renderer || state.renderer
2379
+ };
2380
+ }
2381
+ *getFullNode(partialNode, state, parentKey, parentNode) {
2382
+ if (React.isValidElement(partialNode.element) && partialNode.element.type === React.Fragment) {
2383
+ let children = [];
2384
+ React.Children.forEach(partialNode.element.props.children, (child) => {
2385
+ children.push(child);
2386
+ });
2387
+ let index = partialNode.index ?? 0;
2388
+ for (const child of children) yield* this.getFullNode({
2389
+ element: child,
2390
+ index: index++
2391
+ }, state, parentKey, parentNode);
2392
+ return;
2393
+ }
2394
+ let element = partialNode.element;
2395
+ if (!element && partialNode.value && state && state.renderer) {
2396
+ let cached = this.cache.get(partialNode.value);
2397
+ if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
2398
+ cached.index = partialNode.index;
2399
+ cached.parentKey = parentNode ? parentNode.key : null;
2400
+ yield cached;
2401
+ return;
2402
+ }
2403
+ element = state.renderer(partialNode.value);
2404
+ }
2405
+ if (React.isValidElement(element)) {
2406
+ let type = element.type;
2407
+ if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
2408
+ let name = element.type;
2409
+ throw new Error(`Unknown element <${name}> in collection.`);
2410
+ }
2411
+ let childNodes = type.getCollectionNode(element.props, this.context);
2412
+ let index = partialNode.index ?? 0;
2413
+ let result = childNodes.next();
2414
+ while (!result.done && result.value) {
2415
+ let childNode = result.value;
2416
+ partialNode.index = index;
2417
+ let nodeKey = childNode.key ?? null;
2418
+ if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
2419
+ let nodes = this.getFullNode({
2420
+ ...childNode,
2421
+ key: nodeKey,
2422
+ index,
2423
+ wrapper: $bda7a7e55e1ff206$var$compose(partialNode.wrapper, childNode.wrapper)
2424
+ }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode);
2425
+ let children = [
2426
+ ...nodes
2427
+ ];
2428
+ for (let node2 of children) {
2429
+ node2.value = childNode.value ?? partialNode.value ?? null;
2430
+ if (node2.value) this.cache.set(node2.value, node2);
2431
+ if (partialNode.type && node2.type !== partialNode.type) throw new Error(`Unsupported type <${$bda7a7e55e1ff206$var$capitalize(node2.type)}> in <${$bda7a7e55e1ff206$var$capitalize(parentNode?.type ?? "unknown parent type")}>. Only <${$bda7a7e55e1ff206$var$capitalize(partialNode.type)}> is supported.`);
2432
+ index++;
2433
+ yield node2;
2434
+ }
2435
+ result = childNodes.next(children);
2436
+ }
2437
+ return;
2438
+ }
2439
+ if (partialNode.key == null || partialNode.type == null) return;
2440
+ let builder = this;
2441
+ let node = {
2442
+ type: partialNode.type,
2443
+ props: partialNode.props,
2444
+ key: partialNode.key,
2445
+ parentKey: parentNode ? parentNode.key : null,
2446
+ value: partialNode.value ?? null,
2447
+ level: (parentNode?.level ?? 0) + (parentNode?.type === "item" ? 1 : 0),
2448
+ index: partialNode.index,
2449
+ rendered: partialNode.rendered,
2450
+ textValue: partialNode.textValue ?? "",
2451
+ "aria-label": partialNode["aria-label"],
2452
+ wrapper: partialNode.wrapper,
2453
+ shouldInvalidate: partialNode.shouldInvalidate,
2454
+ hasChildNodes: partialNode.hasChildNodes || false,
2455
+ childNodes: $bda7a7e55e1ff206$var$iterable(function* () {
2456
+ if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
2457
+ let index = 0;
2458
+ for (let child of partialNode.childNodes()) {
2459
+ if (child.key != null)
2460
+ child.key = `${node.key}${child.key}`;
2461
+ let nodes = builder.getFullNode({
2462
+ ...child,
2463
+ index
2464
+ }, builder.getChildState(state, child), node.key, node);
2465
+ for (let node2 of nodes) {
2466
+ index++;
2467
+ yield node2;
2468
+ }
2469
+ }
2470
+ })
2471
+ };
2472
+ yield node;
2473
+ }
2474
+ constructor() {
2475
+ this.cache = /* @__PURE__ */ new WeakMap();
2476
+ }
2477
+ }
2478
+ function $bda7a7e55e1ff206$var$iterable(iterator) {
2479
+ let cache = [];
2480
+ let iterable = null;
2481
+ return {
2482
+ *[Symbol.iterator]() {
2483
+ for (let item of cache) yield item;
2484
+ if (!iterable) iterable = iterator();
2485
+ for (let item of iterable) {
2486
+ cache.push(item);
2487
+ yield item;
2488
+ }
2489
+ }
2490
+ };
2491
+ }
2492
+ function $bda7a7e55e1ff206$var$compose(outer, inner) {
2493
+ if (outer && inner) return (element) => outer(inner(element));
2494
+ if (outer) return outer;
2495
+ if (inner) return inner;
2496
+ }
2497
+ function $bda7a7e55e1ff206$var$capitalize(str) {
2498
+ return str[0].toUpperCase() + str.slice(1);
2499
+ }
2500
+ function $d03379b88399b8c5$export$6cd28814d92fa9c9(props, factory, context) {
2501
+ let builder = React.useMemo(() => new $bda7a7e55e1ff206$export$bf788dd355e3a401(), []);
2502
+ let { children, items, collection } = props;
2503
+ let result = React.useMemo(() => {
2504
+ if (collection) return collection;
2505
+ let nodes = builder.build({
2506
+ children,
2507
+ items
2508
+ }, context);
2509
+ return factory(nodes);
2510
+ }, [
2511
+ builder,
2512
+ children,
2513
+ items,
2514
+ collection,
2515
+ context,
2516
+ factory
2517
+ ]);
2518
+ return result;
2519
+ }
2520
+ function $bf14c9739fda2eb3$export$eac1895992b9f3d6(ref, options) {
2521
+ let isDisabled = options?.isDisabled;
2522
+ let [hasTabbableChild, setHasTabbableChild] = React.useState(false);
2523
+ utils.$c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
2524
+ if (ref?.current && !isDisabled) {
2525
+ let update = () => {
2526
+ if (ref.current) {
2527
+ let walker = FocusScope.$535772f9d2c1f38d$export$2d6ec8fc375ceafa(ref.current, {
2528
+ tabbable: true
2529
+ });
2530
+ setHasTabbableChild(!!walker.nextNode());
2531
+ }
2532
+ };
2533
+ update();
2534
+ let observer = new MutationObserver(update);
2535
+ observer.observe(ref.current, {
2536
+ subtree: true,
2537
+ childList: true,
2538
+ attributes: true,
2539
+ attributeFilter: [
2540
+ "tabIndex",
2541
+ "disabled"
2542
+ ]
2543
+ });
2544
+ return () => {
2545
+ observer.disconnect();
2546
+ };
2547
+ }
2548
+ });
2549
+ return isDisabled ? false : hasTabbableChild;
2550
+ }
2551
+ exports.$121970af65029459$export$f8aeda7b10753fa1 = $121970af65029459$export$f8aeda7b10753fa1;
2552
+ exports.$22bbea12c2567021$export$c3d8340acf92597f = $22bbea12c2567021$export$c3d8340acf92597f;
2553
+ exports.$263ab7fc0f95ccdb$export$4feb769f8ddf26c5 = $263ab7fc0f95ccdb$export$4feb769f8ddf26c5;
2554
+ exports.$263ab7fc0f95ccdb$export$90e00781bc59d8f9 = $263ab7fc0f95ccdb$export$90e00781bc59d8f9;
2555
+ exports.$263ab7fc0f95ccdb$export$a164736487e3f0ae = $263ab7fc0f95ccdb$export$a164736487e3f0ae;
2556
+ exports.$42ceafc619f9c3ba$export$18af5c7a9e9b3664 = $42ceafc619f9c3ba$export$18af5c7a9e9b3664;
2557
+ exports.$42ceafc619f9c3ba$export$bf788dd355e3a401 = $42ceafc619f9c3ba$export$bf788dd355e3a401;
2558
+ exports.$42ceafc619f9c3ba$export$e953bb1cd0f19726 = $42ceafc619f9c3ba$export$e953bb1cd0f19726;
2559
+ exports.$42ceafc619f9c3ba$export$fb8073518f34e6ec = $42ceafc619f9c3ba$export$fb8073518f34e6ec;
2560
+ exports.$4a07ac835f260f78$export$6c8a5aaad13c9852 = $4a07ac835f260f78$export$6c8a5aaad13c9852;
2561
+ exports.$51a3e22a5186a962$export$c826860796309d1b = $51a3e22a5186a962$export$c826860796309d1b;
2562
+ exports.$60f19cefd567a3e4$export$253fe78d46329472 = $60f19cefd567a3e4$export$253fe78d46329472;
2563
+ exports.$901761b40e390936$export$2bb74740c4e19def = $901761b40e390936$export$2bb74740c4e19def;
2564
+ exports.$91fe5e721c7f36c1$export$17f80983afe4e444 = $91fe5e721c7f36c1$export$17f80983afe4e444;
2565
+ exports.$91fe5e721c7f36c1$export$c9549807523555e0 = $91fe5e721c7f36c1$export$c9549807523555e0;
2566
+ exports.$a80bd3e9349588e7$export$727c8fc270210f13 = $a80bd3e9349588e7$export$727c8fc270210f13;
2567
+ exports.$b24d1bc31a0f941d$export$a9d04c5684123369 = $b24d1bc31a0f941d$export$a9d04c5684123369;
2568
+ exports.$bf14c9739fda2eb3$export$eac1895992b9f3d6 = $bf14c9739fda2eb3$export$eac1895992b9f3d6;
2569
+ exports.$cd5ea4b915021f1d$export$1005530eda016c13 = $cd5ea4b915021f1d$export$1005530eda016c13;
2570
+ exports.$cd5ea4b915021f1d$export$5f3398f8733f90e2 = $cd5ea4b915021f1d$export$5f3398f8733f90e2;
2571
+ exports.$cd5ea4b915021f1d$export$7475b2c64539e4cf = $cd5ea4b915021f1d$export$7475b2c64539e4cf;
2572
+ exports.$cd5ea4b915021f1d$export$fbdeaa6a76694f71 = $cd5ea4b915021f1d$export$fbdeaa6a76694f71;
2573
+ exports.$d03379b88399b8c5$export$6cd28814d92fa9c9 = $d03379b88399b8c5$export$6cd28814d92fa9c9;
2574
+ exports.$d667c2af82d35a98$export$d6daf82dcd84e87c = $d667c2af82d35a98$export$d6daf82dcd84e87c;
2575
+ exports.$f6ba6936bfd098a0$export$ecf600387e221c37 = $f6ba6936bfd098a0$export$ecf600387e221c37;
2576
+ //# sourceMappingURL=useHasTabbableChild-kl2T5gEX.js.map