@eightshift/ui-components 7.2.0 → 7.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/dist/Autocomplete-pLMPWMFq.js +451 -0
  2. package/dist/Button-Biwg7zwt.js +223 -0
  3. package/dist/Dialog-C1sh8jbh.js +2474 -0
  4. package/dist/{Disclosure-NYWFw9RJ.js → Disclosure-B_SHgiUz.js} +50 -51
  5. package/dist/FocusScope-lGkM8AO8.js +734 -0
  6. package/dist/Form-BxIJCHYd.js +5 -0
  7. package/dist/Heading-B2EsUuu6.js +16 -0
  8. package/dist/{Hidden-8TB37dpK.js → Hidden-DYY00jLm.js} +10 -10
  9. package/dist/I18nProvider-Cm6dj5jY.js +93 -0
  10. package/dist/Label-B1TkoVOG.js +17 -0
  11. package/dist/ListBox-BquE0m8z.js +584 -0
  12. package/dist/{NumberFormatter-m5VW6MTK.js → NumberFormatter-JHF0Tadk.js} +24 -26
  13. package/dist/PortalProvider-BYcv24il.js +13 -0
  14. package/dist/RadioGroup-BxjLooWU.js +324 -0
  15. package/dist/SearchField-BkAU0HLm.js +322 -0
  16. package/dist/SelectionIndicator-Bx_EYBXD.js +13 -0
  17. package/dist/{Slider-DW1RuMVp.js → Slider-DSv6fyZ6.js} +321 -363
  18. package/dist/Text-C8pfwn0W.js +16 -0
  19. package/dist/{VisuallyHidden-CfsnJHZb.js → VisuallyHidden-KcXlGa5p.js} +12 -12
  20. package/dist/{animation-Bd2peown.js → animation-BJ-2VKdB.js} +12 -12
  21. package/dist/assets/fonts/google-sans-flex-latin-ext-full-normal.woff2 +0 -0
  22. package/dist/assets/fonts/google-sans-flex-latin-full-normal.woff2 +0 -0
  23. package/dist/assets/fonts/google-sans-flex-symbols-full-normal.woff2 +0 -0
  24. package/dist/assets/style-admin.css +1 -1
  25. package/dist/assets/style-editor.css +1 -1
  26. package/dist/assets/style.css +1 -1
  27. package/dist/{button-D9cbyHeZ.js → button-CawAzlko.js} +21 -73
  28. package/dist/{checkbox-BO5RZmO8.js → checkbox-t7VrqXv2.js} +59 -62
  29. package/dist/{color-swatch-D2ZBkuTt.js → color-swatch-gU09x9Ga.js} +417 -414
  30. package/dist/components/base-control/base-control.js +2 -2
  31. package/dist/components/base-control/container.js +1 -1
  32. package/dist/components/breakpoint-preview/breakpoint-preview.js +1 -1
  33. package/dist/components/button/button.js +1 -1
  34. package/dist/components/checkbox/checkbox.js +1 -1
  35. package/dist/components/color-pickers/color-picker.js +2 -2
  36. package/dist/components/color-pickers/color-swatch.js +1 -1
  37. package/dist/components/color-pickers/gradient-editor.js +1 -1
  38. package/dist/components/color-pickers/solid-color-picker.js +1 -1
  39. package/dist/components/component-toggle/component-toggle.js +4 -4
  40. package/dist/components/container-panel/container-panel.js +5 -5
  41. package/dist/components/draggable/draggable-handle.js +1 -1
  42. package/dist/components/draggable/draggable.js +1 -1
  43. package/dist/components/draggable-list/draggable-list-item.js +1 -1
  44. package/dist/components/draggable-list/draggable-list.js +2 -2
  45. package/dist/components/expandable/expandable.js +7 -7
  46. package/dist/components/index.js +15 -15
  47. package/dist/components/input-field/input-field.js +1 -1
  48. package/dist/components/item-collection/item-collection.js +1 -1
  49. package/dist/components/link-input/link-input.js +1 -1
  50. package/dist/components/matrix-align/matrix-align.js +5 -5
  51. package/dist/components/menu/menu.js +11 -11
  52. package/dist/components/modal/modal.js +1 -1
  53. package/dist/components/number-picker/number-picker.js +1 -1
  54. package/dist/components/option-select/option-select.js +3 -3
  55. package/dist/components/options-panel/options-panel.js +3 -3
  56. package/dist/components/placeholders/file-picker-shell.js +1 -1
  57. package/dist/components/placeholders/file-placeholder.js +1 -1
  58. package/dist/components/popover/popover.js +6 -6
  59. package/dist/components/portal-provider/portal-provider.js +2 -2
  60. package/dist/components/radio/radio.js +9 -9
  61. package/dist/components/repeater/repeater-item.js +2 -2
  62. package/dist/components/repeater/repeater.js +3 -3
  63. package/dist/components/responsive/mini-responsive.js +6 -6
  64. package/dist/components/responsive/responsive-legacy.js +5 -5
  65. package/dist/components/responsive/responsive.js +5 -5
  66. package/dist/components/responsive-preview/responsive-preview.js +2 -2
  67. package/dist/components/select/async-multi-select.js +27 -26
  68. package/dist/components/select/async-select.js +27 -26
  69. package/dist/components/select/multi-select.js +33 -32
  70. package/dist/components/select/shared.js +1 -1
  71. package/dist/components/select/single-select.js +33 -32
  72. package/dist/components/select/styles.js +1 -1
  73. package/dist/components/slider/column-config-slider.js +8 -8
  74. package/dist/components/slider/slider.js +8 -8
  75. package/dist/components/slider/utils.js +1 -1
  76. package/dist/components/smart-image/smart-image.js +1 -1
  77. package/dist/components/tabs/tabs.js +1 -1
  78. package/dist/components/toggle/switch.js +1 -1
  79. package/dist/components/toggle/toggle.js +3 -3
  80. package/dist/components/toggle-button/toggle-button.js +1 -1
  81. package/dist/components/tooltip/tooltip.js +1 -1
  82. package/dist/{draggable-CTDVJ4zd.js → draggable-Cxv-OueQ.js} +1 -1
  83. package/dist/filterDOMProps-BfW758QC.js +69 -0
  84. package/dist/{gradient-editor-xfxA_s9a.js → gradient-editor-CInqVF8v.js} +6 -11
  85. package/dist/icons/index.js +1 -1
  86. package/dist/icons/jsx-svg.js +1 -1
  87. package/dist/index.js +15 -15
  88. package/dist/{input-field-_OCWbftf.js → input-field-BdFrxQ-R.js} +46 -47
  89. package/dist/{jsx-svg-BRJ4n3pD.js → jsx-svg-DT1SBWuP.js} +6 -12
  90. package/dist/keyboard-CT41mQzR.js +55 -0
  91. package/dist/{link-input-Bh8G7Urm.js → link-input-BDFhSSvH.js} +324 -356
  92. package/dist/{modal-snrElwty.js → modal-CJDaBdPh.js} +100 -92
  93. package/dist/{number-ZZIxJukn.js → number-MWRvGfyE.js} +10 -10
  94. package/dist/{number-picker-Dhtx4409.js → number-picker-BrxrB-xq.js} +43 -42
  95. package/dist/{shared-BiWZjrGF.js → shared-CI4kcnm8.js} +482 -502
  96. package/dist/{smart-image-CBNbxJ57.js → smart-image-eGdMu9s9.js} +2 -2
  97. package/dist/{solid-color-picker-DukArNH-.js → solid-color-picker-DXgX-OAm.js} +926 -935
  98. package/dist/{switch-DmsvyQPa.js → switch-DNHFoCCx.js} +28 -28
  99. package/dist/{tabs-DaIUEc0g.js → tabs-C2tPOEYr.js} +150 -153
  100. package/dist/textSelection-BhX_2zV9.js +45 -0
  101. package/dist/{toggle-button-BlzUGfGy.js → toggle-button-DYDp11rq.js} +35 -35
  102. package/dist/{tooltip-BzJzYlcc.js → tooltip-C-hT6tN9.js} +162 -162
  103. package/dist/{useAsyncList-BNzwKoX4.js → useAsyncList-DsOh1xIx.js} +54 -74
  104. package/dist/{useButton-ra1ZSZ4z.js → useButton-BMZc4fTX.js} +11 -11
  105. package/dist/{SelectionManager-B8lLv6Ue.js → useCollection-CBVYSuGz.js} +1689 -1777
  106. package/dist/{useEvent-DkZVfgsS.js → useEvent-ypAU33vv.js} +5 -5
  107. package/dist/useField-BXf__jxy.js +32 -0
  108. package/dist/{useFilter-OiMnf6sb.js → useFilter-CfKEbIwL.js} +5 -5
  109. package/dist/{useFocusRing-DuYL4cdO.js → useFocusRing-BgYY-7ko.js} +23 -23
  110. package/dist/useFormReset-BuMc_O4y.js +17 -0
  111. package/dist/{FieldError-BWDbP5Db.js → useFormValidation-BcME9D0E.js} +63 -66
  112. package/dist/useHover-lyApu3ba.js +975 -0
  113. package/dist/{useLabel-2EohW5l6.js → useLabel-Rv8cIIKk.js} +8 -8
  114. package/dist/{useLabels-B2p7RXi5.js → useLabels-xOYtkA8o.js} +5 -5
  115. package/dist/useListState-u6DfeXHi.js +135 -0
  116. package/dist/{useLocalizedStringFormatter-Dv2diN3k.js → useLocalizedStringFormatter-CR-bmorj.js} +45 -45
  117. package/dist/{useNumberField-2xbi3jRV.js → useNumberFieldState-xL-ecwNz.js} +665 -619
  118. package/dist/useNumberFormatter-CR1PAFPG.js +10 -0
  119. package/dist/useOverlayTriggerState-AeCx45Gv.js +551 -0
  120. package/dist/usePress-Dnx5rBoD.js +593 -0
  121. package/dist/useTextField-BW3ZwGyz.js +159 -0
  122. package/dist/{useToggle-ecIirvIM.js → useToggle-BF5wptMP.js} +19 -20
  123. package/dist/useToggleState-D5P01lch.js +22 -0
  124. package/dist/useToolbar-BT25-MJg.js +55 -0
  125. package/dist/utilities/debounce-throttle.js +1 -1
  126. package/dist/utilities/es-dash.js +1 -1
  127. package/dist/utilities/index.js +3 -3
  128. package/dist/{utils-B_uiqNa4.js → utils-JFcCNFzy.js} +121 -122
  129. package/package.json +18 -18
  130. package/dist/Button-h6xF_WrP.js +0 -225
  131. package/dist/Dialog-i5VLQw1o.js +0 -2488
  132. package/dist/FocusScope-CgwbGOBB.js +0 -746
  133. package/dist/Form-DTMkbrQY.js +0 -5
  134. package/dist/Heading-Hol-wS_B.js +0 -16
  135. package/dist/Input-BURqyJXW.js +0 -161
  136. package/dist/Label-DFXXxMKY.js +0 -17
  137. package/dist/ListBox-B21SgugS.js +0 -601
  138. package/dist/OverlayArrow-BoloUPQM.js +0 -573
  139. package/dist/PortalProvider-DinZZCKX.js +0 -14
  140. package/dist/RSPContexts-C_z0bI8W.js +0 -12
  141. package/dist/RadioGroup-BwlGtCja.js +0 -329
  142. package/dist/SearchField-DR_I4_yn.js +0 -765
  143. package/dist/SelectionIndicator-31L6EI9F.js +0 -13
  144. package/dist/Text-O6VBBDlP.js +0 -16
  145. package/dist/context-C-XNeJ_l.js +0 -93
  146. package/dist/filterDOMProps-_2_3GD-K.js +0 -69
  147. package/dist/textSelection-Dv6WPj0Z.js +0 -45
  148. package/dist/useField-D0WrzR2F.js +0 -32
  149. package/dist/useFormReset-DdkykzAn.js +0 -18
  150. package/dist/useHover-qaMm3XFO.js +0 -982
  151. package/dist/useListState-CD_5vfyy.js +0 -147
  152. package/dist/useNumberFormatter-C2Cm2mNj.js +0 -10
  153. package/dist/usePress-ZP1TjkFf.js +0 -678
  154. package/dist/useToggleState-IIDbiKPl.js +0 -23
  155. /package/dist/{List-DWlgW2Ex.js → List---tsVJlI.js} +0 -0
  156. /package/dist/{build-module-Bsx62nlm.js → build-module-K6vi4xE0.js} +0 -0
  157. /package/dist/{debounce-throttle-DXxSAKpq.js → debounce-throttle-LSPAPFtq.js} +0 -0
  158. /package/dist/{dist-2gkv7_1U.js → dist-jw8wvxoG.js} +0 -0
  159. /package/dist/{es-dash-HqXWZZ3_.js → es-dash-BuShf_ht.js} +0 -0
  160. /package/dist/{utilities-lwX686oD.js → utilities-DV0KKJNR.js} +0 -0
@@ -1,1847 +1,1577 @@
1
- import { f as $ff5963eb1fccf552$export$e08e3b67e392101e, g as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c, h as $b5e257d569688ac6$export$535bd6ca7f90a273, m as $bdb11010cef70236$export$f680877a34711e37, u as $3ef42575df84b30b$export$9d1611c77c2fe928 } from "./utils-B_uiqNa4.js";
2
- import { A as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, B as $d4ee10de306f2510$export$b4f377a2b6254582, H as $d4ee10de306f2510$export$e58f029f0fbfdb29, I as $c87311424ea30a05$export$e1865c3bedcd822b, L as $c87311424ea30a05$export$fedb369cb70207f1, M as $c87311424ea30a05$export$6446a186d09e379e, P as $c87311424ea30a05$export$9ac100e40613ea10, R as $7215afc6de606d6b$export$de79e2c695e052f3, T as $03deb23ff14920c4$export$4eaf04e54aa8eed6, V as $d4ee10de306f2510$export$cd4e5573fbe2b576, W as $431fbd86ca7dc216$export$b204af158042fbac, b as $b4b717babfbb907b$export$bebd5a1431fec25d, c as $507fabe10e71c6fb$export$630ff653c5ada6a9, i as $f645667febf57a63$export$f9762fab77588ecb, k as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, s as $3ad3f6e1647bc98d$export$80f3e147d781571c, v as $458b0a5536c1a7cf$export$40bfa8c7b0832715, z as $d4ee10de306f2510$export$4282f70798064fe0 } from "./useHover-qaMm3XFO.js";
3
- import { r as $9bf71ea28793e738$export$2d6ec8fc375ceafa } from "./FocusScope-CgwbGOBB.js";
4
- import { t as $e9faafb641e167db$export$90fc3a17d93f704c } from "./useEvent-DkZVfgsS.js";
5
- import { t as $18f2051aff69b9bf$export$43bb16f9c6d9e3f7 } from "./context-C-XNeJ_l.js";
6
- import { t as $f6c31cce2adf654f$export$45712eceda6fad21 } from "./usePress-ZP1TjkFf.js";
7
- import { n as $f39a9eba43920ace$export$8dc98ba7eadeaa56 } from "./Hidden-8TB37dpK.js";
1
+ import { g as $a4e76a5424781910$export$e08e3b67e392101e, h as $c4867b2f328c2698$export$e5c5a5f917a5871c, m as $c7eafbbe1ea5834e$export$535bd6ca7f90a273, p as $390e54f620492c70$export$f680877a34711e37, u as $bbaa08b3cd72f041$export$9d1611c77c2fe928 } from "./utils-JFcCNFzy.js";
2
+ import { c as $8b2399d051d06d4c$export$831c820ad60f9d12, o as $b72f3f7b3b5f42c6$export$76e4e37e5339496d, r as $b72f3f7b3b5f42c6$export$2b35b76d2e30e129, s as $8b2399d051d06d4c$export$447a38995de2c711, t as $bb39c0fc1c19b34c$export$16792effe837dba3 } from "./keyboard-CT41mQzR.js";
3
+ import { A as $2add3ce32c6007eb$export$e1865c3bedcd822b, B as $23f2114a1b82827e$export$b4f377a2b6254582, G as $d447af545b77c9f1$export$f21a1ffae260145a, H as $23f2114a1b82827e$export$e58f029f0fbfdb29, L as $3b8b240c1bf84ab9$export$bebd5a1431fec25d, R as $1969ac565cfec8d0$export$de79e2c695e052f3, S as $caaf0dd3060ed57c$export$9a302a45f65d0572, V as $23f2114a1b82827e$export$cd4e5573fbe2b576, W as $d447af545b77c9f1$export$b204af158042fbac, a as $d1116acdf220c2da$export$f9762fab77588ecb, d as $3e6197669829fe11$export$40bfa8c7b0832715, j as $2add3ce32c6007eb$export$fedb369cb70207f1, l as $f192c2f16961cbe0$export$80f3e147d781571c, n as $48a7d519b337145d$export$4eaf04e54aa8eed6, p as $8f5a2122b0992be3$export$630ff653c5ada6a9, x as $caaf0dd3060ed57c$export$95185d699e05d4d7, z as $23f2114a1b82827e$export$4282f70798064fe0 } from "./useHover-lyApu3ba.js";
4
+ import { t as $600b3cf69ae46262$export$90fc3a17d93f704c } from "./useEvent-ypAU33vv.js";
5
+ import { t as $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7 } from "./I18nProvider-Cm6dj5jY.js";
6
+ import { n as $d7f64c32b702fe2c$export$8dc98ba7eadeaa56 } from "./Hidden-DYY00jLm.js";
7
+ import { t as $d27d541f9569d26d$export$45712eceda6fad21 } from "./usePress-Dnx5rBoD.js";
8
+ import { r as $535772f9d2c1f38d$export$2d6ec8fc375ceafa } from "./FocusScope-lGkM8AO8.js";
8
9
  import React, { cloneElement, createContext, forwardRef, isValidElement, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
9
10
  import { createPortal, flushSync } from "react-dom";
10
11
  import { useSyncExternalStore } from "use-sync-external-store/shim/index.js";
11
- //#region node_modules/@react-aria/utils/dist/useUpdateLayoutEffect.mjs
12
- function $ca9b37712f007381$export$72ef708ab07251f1(effect, dependencies) {
13
- const isInitialMount = useRef(true);
14
- const lastDeps = useRef(null);
15
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
16
- isInitialMount.current = true;
17
- return () => {
18
- isInitialMount.current = false;
19
- };
20
- }, []);
21
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
22
- if (isInitialMount.current) isInitialMount.current = false;
23
- else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) effect();
24
- lastDeps.current = dependencies;
25
- }, dependencies);
26
- }
27
- //#endregion
28
- //#region node_modules/@react-aria/utils/dist/isScrollable.mjs
29
- function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) {
30
- if (!node) return false;
31
- let style = window.getComputedStyle(node);
32
- let root = document.scrollingElement || document.documentElement;
33
- let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
34
- if (node === root && style.overflow !== "hidden") isScrollable = true;
35
- if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
36
- return isScrollable;
37
- }
38
- //#endregion
39
- //#region node_modules/@react-aria/utils/dist/getScrollParents.mjs
40
- function $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(node, checkForOverflow) {
41
- let parentElements = [];
42
- let root = document.scrollingElement || document.documentElement;
43
- do {
44
- if ($cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow)) parentElements.push(node);
45
- node = node.parentElement;
46
- } while (node && node !== root);
47
- return parentElements;
48
- }
49
- //#endregion
50
- //#region node_modules/@react-aria/utils/dist/keyboard.mjs
51
- function $21f1aa98acb08317$export$16792effe837dba3(e) {
52
- if ($c87311424ea30a05$export$9ac100e40613ea10()) return e.metaKey;
53
- return e.ctrlKey;
54
- }
55
- var $21f1aa98acb08317$var$nonTextInputTypes = new Set([
56
- "checkbox",
57
- "radio",
58
- "range",
59
- "color",
60
- "file",
61
- "image",
62
- "button",
63
- "submit",
64
- "reset"
65
- ]);
66
- function $21f1aa98acb08317$export$c57958e35f31ed73(target) {
67
- return target instanceof HTMLInputElement && !$21f1aa98acb08317$var$nonTextInputTypes.has(target.type) || target instanceof HTMLTextAreaElement || target instanceof HTMLElement && target.isContentEditable;
68
- }
69
- //#endregion
70
- //#region node_modules/@react-aria/utils/dist/useDescription.mjs
71
- var $ef06256079686ba0$var$descriptionId = 0;
72
- var $ef06256079686ba0$var$descriptionNodes = new Map();
73
- function $ef06256079686ba0$export$f8aeda7b10753fa1(description) {
74
- let [id, setId] = useState();
75
- $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c(() => {
76
- if (!description) return;
77
- let desc = $ef06256079686ba0$var$descriptionNodes.get(description);
78
- if (!desc) {
79
- let id = `react-aria-description-${$ef06256079686ba0$var$descriptionId++}`;
80
- setId(id);
81
- let node = document.createElement("div");
82
- node.id = id;
83
- node.style.display = "none";
84
- node.textContent = description;
85
- document.body.appendChild(node);
86
- desc = {
87
- refCount: 0,
88
- element: node
89
- };
90
- $ef06256079686ba0$var$descriptionNodes.set(description, desc);
91
- } else setId(desc.element.id);
92
- desc.refCount++;
93
- return () => {
94
- if (desc && --desc.refCount === 0) {
95
- desc.element.remove();
96
- $ef06256079686ba0$var$descriptionNodes.delete(description);
97
- }
98
- };
99
- }, [description]);
100
- return { "aria-describedby": description ? id : void 0 };
101
- }
102
- //#endregion
103
- //#region node_modules/@react-aria/utils/dist/scrollIntoView.mjs
104
- function $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollView, element, opts = {}) {
105
- let { block = "nearest", inline = "nearest" } = opts;
106
- if (scrollView === element) return;
107
- let y = scrollView.scrollTop;
108
- let x = scrollView.scrollLeft;
109
- let target = element.getBoundingClientRect();
110
- let view = scrollView.getBoundingClientRect();
111
- let itemStyle = window.getComputedStyle(element);
112
- let viewStyle = window.getComputedStyle(scrollView);
113
- let root = document.scrollingElement || document.documentElement;
114
- let viewTop = scrollView === root ? 0 : view.top;
115
- let viewBottom = scrollView === root ? scrollView.clientHeight : view.bottom;
116
- let viewLeft = scrollView === root ? 0 : view.left;
117
- let viewRight = scrollView === root ? scrollView.clientWidth : view.right;
118
- let scrollMarginTop = parseInt(itemStyle.scrollMarginTop, 10) || 0;
119
- let scrollMarginBottom = parseInt(itemStyle.scrollMarginBottom, 10) || 0;
120
- let scrollMarginLeft = parseInt(itemStyle.scrollMarginLeft, 10) || 0;
121
- let scrollMarginRight = parseInt(itemStyle.scrollMarginRight, 10) || 0;
122
- let scrollPaddingTop = parseInt(viewStyle.scrollPaddingTop, 10) || 0;
123
- let scrollPaddingBottom = parseInt(viewStyle.scrollPaddingBottom, 10) || 0;
124
- let scrollPaddingLeft = parseInt(viewStyle.scrollPaddingLeft, 10) || 0;
125
- let scrollPaddingRight = parseInt(viewStyle.scrollPaddingRight, 10) || 0;
126
- let borderTopWidth = parseInt(viewStyle.borderTopWidth, 10) || 0;
127
- let borderBottomWidth = parseInt(viewStyle.borderBottomWidth, 10) || 0;
128
- let borderLeftWidth = parseInt(viewStyle.borderLeftWidth, 10) || 0;
129
- let borderRightWidth = parseInt(viewStyle.borderRightWidth, 10) || 0;
130
- let scrollAreaTop = target.top - scrollMarginTop;
131
- let scrollAreaBottom = target.bottom + scrollMarginBottom;
132
- let scrollAreaLeft = target.left - scrollMarginLeft;
133
- let scrollAreaRight = target.right + scrollMarginRight;
134
- let scrollBarOffsetX = scrollView === root ? 0 : borderLeftWidth + borderRightWidth;
135
- let scrollBarOffsetY = scrollView === root ? 0 : borderTopWidth + borderBottomWidth;
136
- let scrollBarWidth = scrollView.offsetWidth - scrollView.clientWidth - scrollBarOffsetX;
137
- let scrollBarHeight = scrollView.offsetHeight - scrollView.clientHeight - scrollBarOffsetY;
138
- let scrollPortTop = viewTop + borderTopWidth + scrollPaddingTop;
139
- let scrollPortBottom = viewBottom - borderBottomWidth - scrollPaddingBottom - scrollBarHeight;
140
- let scrollPortLeft = viewLeft + borderLeftWidth + scrollPaddingLeft;
141
- let scrollPortRight = viewRight - borderRightWidth - scrollPaddingRight;
142
- if (viewStyle.direction === "rtl" && !$c87311424ea30a05$export$fedb369cb70207f1()) scrollPortLeft += scrollBarWidth;
143
- else scrollPortRight -= scrollBarWidth;
144
- let shouldScrollBlock = scrollAreaTop < scrollPortTop || scrollAreaBottom > scrollPortBottom;
145
- let shouldScrollInline = scrollAreaLeft < scrollPortLeft || scrollAreaRight > scrollPortRight;
146
- if (shouldScrollBlock && block === "start") y += scrollAreaTop - scrollPortTop;
147
- else if (shouldScrollBlock && block === "center") y += (scrollAreaTop + scrollAreaBottom) / 2 - (scrollPortTop + scrollPortBottom) / 2;
148
- else if (shouldScrollBlock && block === "end") y += scrollAreaBottom - scrollPortBottom;
149
- else if (shouldScrollBlock && block === "nearest") {
150
- let start = scrollAreaTop - scrollPortTop;
151
- let end = scrollAreaBottom - scrollPortBottom;
152
- y += Math.abs(start) <= Math.abs(end) ? start : end;
12
+ //#region node_modules/react-aria/dist/private/collections/BaseCollection.mjs
13
+ var $6f0c29017aeec335$export$d68d59712b04d9d1 = class {
14
+ constructor(key) {
15
+ this.value = null;
16
+ this.level = 0;
17
+ this.hasChildNodes = false;
18
+ this.rendered = null;
19
+ this.textValue = "";
20
+ this["aria-label"] = void 0;
21
+ this.index = 0;
22
+ this.parentKey = null;
23
+ this.prevKey = null;
24
+ this.nextKey = null;
25
+ this.firstChildKey = null;
26
+ this.lastChildKey = null;
27
+ this.props = {};
28
+ this.colSpan = null;
29
+ this.colIndex = null;
30
+ this.type = this.constructor.type;
31
+ this.key = key;
153
32
  }
154
- if (shouldScrollInline && inline === "start") x += scrollAreaLeft - scrollPortLeft;
155
- else if (shouldScrollInline && inline === "center") x += (scrollAreaLeft + scrollAreaRight) / 2 - (scrollPortLeft + scrollPortRight) / 2;
156
- else if (shouldScrollInline && inline === "end") x += scrollAreaRight - scrollPortRight;
157
- else if (shouldScrollInline && inline === "nearest") {
158
- let start = scrollAreaLeft - scrollPortLeft;
159
- let end = scrollAreaRight - scrollPortRight;
160
- x += Math.abs(start) <= Math.abs(end) ? start : end;
33
+ get childNodes() {
34
+ throw new Error("childNodes is not supported");
161
35
  }
162
- if (process.env.NODE_ENV === "test") {
163
- scrollView.scrollLeft = x;
164
- scrollView.scrollTop = y;
165
- return;
36
+ clone() {
37
+ let node = new this.constructor(this.key);
38
+ node.value = this.value;
39
+ node.level = this.level;
40
+ node.hasChildNodes = this.hasChildNodes;
41
+ node.rendered = this.rendered;
42
+ node.textValue = this.textValue;
43
+ node["aria-label"] = this["aria-label"];
44
+ node.index = this.index;
45
+ node.parentKey = this.parentKey;
46
+ node.prevKey = this.prevKey;
47
+ node.nextKey = this.nextKey;
48
+ node.firstChildKey = this.firstChildKey;
49
+ node.lastChildKey = this.lastChildKey;
50
+ node.props = this.props;
51
+ node.render = this.render;
52
+ node.colSpan = this.colSpan;
53
+ node.colIndex = this.colIndex;
54
+ return node;
166
55
  }
167
- scrollView.scrollTo({
168
- left: x,
169
- top: y
170
- });
171
- }
172
- function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts = {}) {
173
- let { containingElement } = opts;
174
- if (targetElement && targetElement.isConnected) {
175
- let root = document.scrollingElement || document.documentElement;
176
- if (!(window.getComputedStyle(root).overflow === "hidden") && !$c87311424ea30a05$export$6446a186d09e379e()) {
177
- var _targetElement_scrollIntoView;
178
- let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
179
- targetElement === null || targetElement === void 0 || (_targetElement_scrollIntoView = targetElement.scrollIntoView) == null || _targetElement_scrollIntoView.call(targetElement, { block: "nearest" });
180
- let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
181
- if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
182
- var _containingElement_scrollIntoView, _targetElement_scrollIntoView1;
183
- containingElement === null || containingElement === void 0 || (_containingElement_scrollIntoView = containingElement.scrollIntoView) == null || _containingElement_scrollIntoView.call(containingElement, {
184
- block: "center",
185
- inline: "center"
186
- });
187
- (_targetElement_scrollIntoView1 = targetElement.scrollIntoView) === null || _targetElement_scrollIntoView1 === void 0 || _targetElement_scrollIntoView1.call(targetElement, { block: "nearest" });
188
- }
189
- } else {
190
- let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
191
- let scrollParents = $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(targetElement, true);
192
- for (let scrollParent of scrollParents) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, targetElement);
193
- let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
194
- if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
195
- scrollParents = containingElement ? $a40c673dc9f6d9c7$export$94ed1c92c7beeb22(containingElement, true) : [];
196
- for (let scrollParent of scrollParents) $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollParent, containingElement, {
197
- block: "center",
198
- inline: "center"
199
- });
200
- }
56
+ filter(collection, newCollection, filterFn) {
57
+ let clone = this.clone();
58
+ newCollection.addDescendants(clone, collection);
59
+ return clone;
60
+ }
61
+ };
62
+ var $6f0c29017aeec335$export$b1918e978f1ee46f = class extends $6f0c29017aeec335$export$d68d59712b04d9d1 {
63
+ filter(collection, newCollection, filterFn) {
64
+ let [firstKey, lastKey] = $6f0c29017aeec335$var$filterChildren(collection, newCollection, this.firstChildKey, filterFn);
65
+ let newNode = this.clone();
66
+ newNode.firstChildKey = firstKey;
67
+ newNode.lastChildKey = lastKey;
68
+ return newNode;
69
+ }
70
+ };
71
+ var $6f0c29017aeec335$export$5ae2504e948afce5 = class extends $6f0c29017aeec335$export$d68d59712b04d9d1 {
72
+ static {
73
+ this.type = "header";
74
+ }
75
+ };
76
+ var $6f0c29017aeec335$export$8258a0665a675899 = class extends $6f0c29017aeec335$export$d68d59712b04d9d1 {
77
+ static {
78
+ this.type = "loader";
79
+ }
80
+ };
81
+ var $6f0c29017aeec335$export$fd11f34e1d07f134 = class extends $6f0c29017aeec335$export$b1918e978f1ee46f {
82
+ static {
83
+ this.type = "item";
84
+ }
85
+ filter(collection, newCollection, filterFn) {
86
+ if (filterFn(this.textValue, this)) {
87
+ let clone = this.clone();
88
+ newCollection.addDescendants(clone, collection);
89
+ return clone;
201
90
  }
91
+ return null;
202
92
  }
203
- }
204
- //#endregion
205
- //#region node_modules/@react-aria/utils/dist/constants.mjs
206
- var $5671b20cf9b562b2$export$447a38995de2c711 = "react-aria-clear-focus";
207
- var $5671b20cf9b562b2$export$831c820ad60f9d12 = "react-aria-focus";
208
- //#endregion
209
- //#region node_modules/@react-aria/interactions/dist/useLongPress.mjs
210
- var $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
211
- function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
212
- let { isDisabled, onLongPressStart, onLongPressEnd, onLongPress, threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
213
- const timeRef = useRef(void 0);
214
- let { addGlobalListener, removeGlobalListener } = $03deb23ff14920c4$export$4eaf04e54aa8eed6();
215
- let { pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({
216
- isDisabled,
217
- onPressStart(e) {
218
- e.continuePropagation();
219
- if (e.pointerType === "mouse" || e.pointerType === "touch") {
220
- if (onLongPressStart) onLongPressStart({
221
- ...e,
222
- type: "longpressstart"
223
- });
224
- timeRef.current = setTimeout(() => {
225
- e.target.dispatchEvent(new PointerEvent("pointercancel", { bubbles: true }));
226
- if ($431fbd86ca7dc216$export$b204af158042fbac(e.target).activeElement !== e.target) $7215afc6de606d6b$export$de79e2c695e052f3(e.target);
227
- if (onLongPress) onLongPress({
228
- ...e,
229
- type: "longpress"
230
- });
231
- timeRef.current = void 0;
232
- }, threshold);
233
- if (e.pointerType === "touch") {
234
- let onContextMenu = (e) => {
235
- e.preventDefault();
236
- };
237
- addGlobalListener(e.target, "contextmenu", onContextMenu, { once: true });
238
- addGlobalListener(window, "pointerup", () => {
239
- setTimeout(() => {
240
- removeGlobalListener(e.target, "contextmenu", onContextMenu);
241
- }, 30);
242
- }, { once: true });
243
- }
93
+ };
94
+ var $6f0c29017aeec335$export$437f11dc9b403b78 = class extends $6f0c29017aeec335$export$b1918e978f1ee46f {
95
+ static {
96
+ this.type = "section";
97
+ }
98
+ filter(collection, newCollection, filterFn) {
99
+ let filteredSection = super.filter(collection, newCollection, filterFn);
100
+ if (filteredSection) {
101
+ if (filteredSection.lastChildKey !== null) {
102
+ let lastChild = collection.getItem(filteredSection.lastChildKey);
103
+ if (lastChild && lastChild.type !== "header") return filteredSection;
244
104
  }
245
- },
246
- onPressEnd(e) {
247
- if (timeRef.current) clearTimeout(timeRef.current);
248
- if (onLongPressEnd && (e.pointerType === "mouse" || e.pointerType === "touch")) onLongPressEnd({
249
- ...e,
250
- type: "longpressend"
251
- });
252
105
  }
253
- });
254
- return { longPressProps: $3ef42575df84b30b$export$9d1611c77c2fe928(pressProps, $ef06256079686ba0$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : void 0)) };
255
- }
256
- //#endregion
257
- //#region node_modules/@react-aria/focus/dist/virtualFocus.mjs
258
- function $55f9b1ae81f22853$export$76e4e37e5339496d(to) {
259
- let from = $55f9b1ae81f22853$export$759df0d867455a91($431fbd86ca7dc216$export$b204af158042fbac(to));
260
- if (from !== to) {
261
- if (from) $55f9b1ae81f22853$export$6c5dc7e81d2cc29a(from, to);
262
- if (to) $55f9b1ae81f22853$export$2b35b76d2e30e129(to, from);
106
+ return null;
263
107
  }
264
- }
265
- function $55f9b1ae81f22853$export$6c5dc7e81d2cc29a(from, to) {
266
- from.dispatchEvent(new FocusEvent("blur", { relatedTarget: to }));
267
- from.dispatchEvent(new FocusEvent("focusout", {
268
- bubbles: true,
269
- relatedTarget: to
270
- }));
271
- }
272
- function $55f9b1ae81f22853$export$2b35b76d2e30e129(to, from) {
273
- to.dispatchEvent(new FocusEvent("focus", { relatedTarget: from }));
274
- to.dispatchEvent(new FocusEvent("focusin", {
275
- bubbles: true,
276
- relatedTarget: from
277
- }));
278
- }
279
- function $55f9b1ae81f22853$export$759df0d867455a91(document) {
280
- let activeElement = $d4ee10de306f2510$export$cd4e5573fbe2b576(document);
281
- let activeDescendant = activeElement === null || activeElement === void 0 ? void 0 : activeElement.getAttribute("aria-activedescendant");
282
- if (activeDescendant) return document.getElementById(activeDescendant) || activeElement;
283
- return activeElement;
284
- }
285
- //#endregion
286
- //#region node_modules/@react-aria/selection/dist/utils.mjs
287
- function $feb5ffebff200149$export$d3e3bd3e26688c04(e) {
288
- return $c87311424ea30a05$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
289
- }
290
- function $feb5ffebff200149$export$c3d8340acf92597f(collectionRef, key) {
291
- var _collectionRef_current, _collectionRef_current1;
292
- let selector = `[data-key="${CSS.escape(String(key))}"]`;
293
- let collection = (_collectionRef_current = collectionRef.current) === null || _collectionRef_current === void 0 ? void 0 : _collectionRef_current.dataset.collection;
294
- if (collection) selector = `[data-collection="${CSS.escape(collection)}"]${selector}`;
295
- return (_collectionRef_current1 = collectionRef.current) === null || _collectionRef_current1 === void 0 ? void 0 : _collectionRef_current1.querySelector(selector);
296
- }
297
- var $feb5ffebff200149$var$collectionMap = new WeakMap();
298
- function $feb5ffebff200149$export$881eb0d9f3605d9d(collection) {
299
- let id = $bdb11010cef70236$export$f680877a34711e37();
300
- $feb5ffebff200149$var$collectionMap.set(collection, id);
301
- return id;
302
- }
303
- function $feb5ffebff200149$export$6aeb1680a0ae8741(collection) {
304
- return $feb5ffebff200149$var$collectionMap.get(collection);
305
- }
306
- //#endregion
307
- //#region node_modules/@react-aria/selection/dist/useTypeSelect.mjs
308
- /**
309
- * Controls how long to wait before clearing the typeahead buffer.
310
- */ var $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
311
- function $fb3050f43d946246$export$e32c88dfddc6e1d8(options) {
312
- let { keyboardDelegate, selectionManager, onTypeSelect } = options;
313
- let state = useRef({
314
- search: "",
315
- timeout: void 0
316
- }).current;
317
- let onKeyDown = (e) => {
318
- let character = $fb3050f43d946246$var$getStringForKey(e.key);
319
- if (!character || e.ctrlKey || e.metaKey || !$d4ee10de306f2510$export$4282f70798064fe0(e.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e)) || state.search.length === 0 && character === " ") return;
320
- if (character === " " && state.search.trim().length > 0) {
321
- e.preventDefault();
322
- if (!("continuePropagation" in e)) e.stopPropagation();
108
+ };
109
+ var $6f0c29017aeec335$export$408d25a4e12db025 = class {
110
+ get size() {
111
+ return this.itemCount;
112
+ }
113
+ getKeys() {
114
+ return this.keyMap.keys();
115
+ }
116
+ *[Symbol.iterator]() {
117
+ let node = this.firstKey != null ? this.keyMap.get(this.firstKey) : void 0;
118
+ while (node) {
119
+ yield node;
120
+ node = node.nextKey != null ? this.keyMap.get(node.nextKey) : void 0;
323
121
  }
324
- state.search += character;
325
- if (keyboardDelegate.getKeyForSearch != null) {
326
- let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
327
- if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
328
- if (key != null) {
329
- selectionManager.setFocusedKey(key);
330
- if (onTypeSelect) onTypeSelect(key);
122
+ }
123
+ getChildren(key) {
124
+ let keyMap = this.keyMap;
125
+ return { *[Symbol.iterator]() {
126
+ let parent = keyMap.get(key);
127
+ let node = parent?.firstChildKey != null ? keyMap.get(parent.firstChildKey) : null;
128
+ while (node) {
129
+ yield node;
130
+ node = node.nextKey != null ? keyMap.get(node.nextKey) : void 0;
331
131
  }
132
+ } };
133
+ }
134
+ getKeyBefore(key) {
135
+ let node = this.keyMap.get(key);
136
+ if (!node) return null;
137
+ if (node.prevKey != null) {
138
+ node = this.keyMap.get(node.prevKey);
139
+ while (node && node.type !== "item" && node.lastChildKey != null) node = this.keyMap.get(node.lastChildKey);
140
+ return node?.key ?? null;
332
141
  }
333
- clearTimeout(state.timeout);
334
- state.timeout = setTimeout(() => {
335
- state.search = "";
336
- }, $fb3050f43d946246$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
337
- };
338
- return { typeSelectProps: { onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : void 0 } };
339
- }
340
- function $fb3050f43d946246$var$getStringForKey(key) {
341
- if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
342
- return "";
142
+ return node.parentKey;
143
+ }
144
+ getKeyAfter(key) {
145
+ let node = this.keyMap.get(key);
146
+ if (!node) return null;
147
+ if (node.type !== "item" && node.firstChildKey != null) return node.firstChildKey;
148
+ while (node) {
149
+ if (node.nextKey != null) return node.nextKey;
150
+ if (node.parentKey != null) node = this.keyMap.get(node.parentKey);
151
+ else return null;
152
+ }
153
+ return null;
154
+ }
155
+ getFirstKey() {
156
+ return this.firstKey;
157
+ }
158
+ getLastKey() {
159
+ let node = this.lastKey != null ? this.keyMap.get(this.lastKey) : null;
160
+ while (node?.lastChildKey != null) node = this.keyMap.get(node.lastChildKey);
161
+ return node?.key ?? null;
162
+ }
163
+ getItem(key) {
164
+ return this.keyMap.get(key) ?? null;
165
+ }
166
+ at() {
167
+ throw new Error("Not implemented");
168
+ }
169
+ clone() {
170
+ let Constructor = this.constructor;
171
+ let collection = new Constructor();
172
+ collection.keyMap = new Map(this.keyMap);
173
+ collection.firstKey = this.firstKey;
174
+ collection.lastKey = this.lastKey;
175
+ collection.itemCount = this.itemCount;
176
+ return collection;
177
+ }
178
+ addNode(node) {
179
+ if (this.frozen) throw new Error("Cannot add a node to a frozen collection");
180
+ if (node.type === "item" && this.keyMap.get(node.key) == null) this.itemCount++;
181
+ this.keyMap.set(node.key, node);
182
+ }
183
+ addDescendants(node, oldCollection) {
184
+ this.addNode(node);
185
+ let children = oldCollection.getChildren(node.key);
186
+ for (let child of children) this.addDescendants(child, oldCollection);
187
+ }
188
+ removeNode(key) {
189
+ if (this.frozen) throw new Error("Cannot remove a node to a frozen collection");
190
+ let node = this.keyMap.get(key);
191
+ if (node != null && node.type === "item") this.itemCount--;
192
+ this.keyMap.delete(key);
193
+ }
194
+ commit(firstKey, lastKey, isSSR = false) {
195
+ if (this.frozen) throw new Error("Cannot commit a frozen collection");
196
+ this.firstKey = firstKey;
197
+ this.lastKey = lastKey;
198
+ this.frozen = !isSSR;
199
+ }
200
+ filter(filterFn) {
201
+ let newCollection = new this.constructor();
202
+ let [firstKey, lastKey] = $6f0c29017aeec335$var$filterChildren(this, newCollection, this.firstKey, filterFn);
203
+ newCollection?.commit(firstKey, lastKey);
204
+ return newCollection;
205
+ }
206
+ constructor() {
207
+ this.keyMap = new Map();
208
+ this.firstKey = null;
209
+ this.lastKey = null;
210
+ this.frozen = false;
211
+ this.itemCount = 0;
212
+ }
213
+ };
214
+ function $6f0c29017aeec335$var$filterChildren(collection, newCollection, firstChildKey, filterFn) {
215
+ if (firstChildKey == null) return [null, null];
216
+ let firstNode = null;
217
+ let lastNode = null;
218
+ let currentNode = collection.getItem(firstChildKey);
219
+ while (currentNode != null) {
220
+ let newNode = currentNode.filter(collection, newCollection, filterFn);
221
+ if (newNode != null) {
222
+ newNode.nextKey = null;
223
+ if (lastNode) {
224
+ newNode.prevKey = lastNode.key;
225
+ lastNode.nextKey = newNode.key;
226
+ }
227
+ if (firstNode == null) firstNode = newNode;
228
+ newCollection.addNode(newNode);
229
+ lastNode = newNode;
230
+ }
231
+ currentNode = currentNode.nextKey ? collection.getItem(currentNode.nextKey) : null;
232
+ }
233
+ if (lastNode && lastNode.type === "separator") {
234
+ let prevKey = lastNode.prevKey;
235
+ newCollection.removeNode(lastNode.key);
236
+ if (prevKey) {
237
+ lastNode = newCollection.getItem(prevKey);
238
+ lastNode.nextKey = null;
239
+ } else lastNode = null;
240
+ }
241
+ return [firstNode?.key ?? null, lastNode?.key ?? null];
343
242
  }
344
243
  //#endregion
345
- //#region node_modules/@react-aria/selection/dist/useSelectableCollection.mjs
346
- function $ae20dd8cbca75726$export$d6daf82dcd84e87c(options) {
347
- 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" } = options;
348
- let { direction } = $18f2051aff69b9bf$export$43bb16f9c6d9e3f7();
349
- let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
350
- let onKeyDown = (e) => {
351
- if (e.altKey && e.key === "Tab") e.preventDefault();
352
- if (!ref.current || !$d4ee10de306f2510$export$4282f70798064fe0(ref.current, $d4ee10de306f2510$export$e58f029f0fbfdb29(e))) return;
353
- const navigateToKey = (key, childFocus) => {
354
- if (key != null) {
355
- if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) {
356
- flushSync(() => {
357
- manager.setFocusedKey(key, childFocus);
358
- });
359
- let item = $feb5ffebff200149$export$c3d8340acf92597f(ref, key);
360
- let itemProps = manager.getItemProps(key);
361
- if (item) router.open(item, e, itemProps.href, itemProps.routerOptions);
362
- return;
363
- }
364
- manager.setFocusedKey(key, childFocus);
365
- if (manager.isLink(key) && linkBehavior === "override") return;
366
- if (e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(key);
367
- else if (selectOnFocus && !$feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.replaceSelection(key);
368
- }
369
- };
370
- switch (e.key) {
371
- case "ArrowDown":
372
- if (delegate.getKeyBelow) {
373
- var _delegate_getKeyBelow, _delegate_getFirstKey, _delegate_getFirstKey1;
374
- let nextKey = manager.focusedKey != null ? (_delegate_getKeyBelow = delegate.getKeyBelow) === null || _delegate_getKeyBelow === void 0 ? void 0 : _delegate_getKeyBelow.call(delegate, manager.focusedKey) : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate);
375
- if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getFirstKey1 = delegate.getFirstKey) === null || _delegate_getFirstKey1 === void 0 ? void 0 : _delegate_getFirstKey1.call(delegate, manager.focusedKey);
376
- if (nextKey != null) {
377
- e.preventDefault();
378
- navigateToKey(nextKey);
379
- }
380
- }
381
- break;
382
- case "ArrowUp":
383
- if (delegate.getKeyAbove) {
384
- var _delegate_getKeyAbove, _delegate_getLastKey, _delegate_getLastKey1;
385
- let nextKey = manager.focusedKey != null ? (_delegate_getKeyAbove = delegate.getKeyAbove) === null || _delegate_getKeyAbove === void 0 ? void 0 : _delegate_getKeyAbove.call(delegate, manager.focusedKey) : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate);
386
- if (nextKey == null && shouldFocusWrap) nextKey = (_delegate_getLastKey1 = delegate.getLastKey) === null || _delegate_getLastKey1 === void 0 ? void 0 : _delegate_getLastKey1.call(delegate, manager.focusedKey);
387
- if (nextKey != null) {
388
- e.preventDefault();
389
- navigateToKey(nextKey);
390
- }
391
- }
392
- break;
393
- case "ArrowLeft":
394
- if (delegate.getKeyLeftOf) {
395
- var _delegate_getKeyLeftOf, _delegate_getFirstKey2, _delegate_getLastKey2;
396
- let nextKey = manager.focusedKey != null ? (_delegate_getKeyLeftOf = delegate.getKeyLeftOf) === null || _delegate_getKeyLeftOf === void 0 ? void 0 : _delegate_getKeyLeftOf.call(delegate, manager.focusedKey) : null;
397
- if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? (_delegate_getFirstKey2 = delegate.getFirstKey) === null || _delegate_getFirstKey2 === void 0 ? void 0 : _delegate_getFirstKey2.call(delegate, manager.focusedKey) : (_delegate_getLastKey2 = delegate.getLastKey) === null || _delegate_getLastKey2 === void 0 ? void 0 : _delegate_getLastKey2.call(delegate, manager.focusedKey);
398
- if (nextKey != null) {
399
- e.preventDefault();
400
- navigateToKey(nextKey, direction === "rtl" ? "first" : "last");
401
- }
402
- }
403
- break;
404
- case "ArrowRight":
405
- if (delegate.getKeyRightOf) {
406
- var _delegate_getKeyRightOf, _delegate_getLastKey3, _delegate_getFirstKey3;
407
- let nextKey = manager.focusedKey != null ? (_delegate_getKeyRightOf = delegate.getKeyRightOf) === null || _delegate_getKeyRightOf === void 0 ? void 0 : _delegate_getKeyRightOf.call(delegate, manager.focusedKey) : null;
408
- if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? (_delegate_getLastKey3 = delegate.getLastKey) === null || _delegate_getLastKey3 === void 0 ? void 0 : _delegate_getLastKey3.call(delegate, manager.focusedKey) : (_delegate_getFirstKey3 = delegate.getFirstKey) === null || _delegate_getFirstKey3 === void 0 ? void 0 : _delegate_getFirstKey3.call(delegate, manager.focusedKey);
409
- if (nextKey != null) {
410
- e.preventDefault();
411
- navigateToKey(nextKey, direction === "rtl" ? "last" : "first");
412
- }
413
- }
414
- break;
415
- case "Home":
416
- if (delegate.getFirstKey) {
417
- if (manager.focusedKey === null && e.shiftKey) return;
418
- e.preventDefault();
419
- let firstKey = delegate.getFirstKey(manager.focusedKey, $21f1aa98acb08317$export$16792effe837dba3(e));
420
- manager.setFocusedKey(firstKey);
421
- if (firstKey != null) {
422
- if ($21f1aa98acb08317$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
423
- else if (selectOnFocus) manager.replaceSelection(firstKey);
424
- }
425
- }
426
- break;
427
- case "End":
428
- if (delegate.getLastKey) {
429
- if (manager.focusedKey === null && e.shiftKey) return;
430
- e.preventDefault();
431
- let lastKey = delegate.getLastKey(manager.focusedKey, $21f1aa98acb08317$export$16792effe837dba3(e));
432
- manager.setFocusedKey(lastKey);
433
- if (lastKey != null) {
434
- if ($21f1aa98acb08317$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
435
- else if (selectOnFocus) manager.replaceSelection(lastKey);
436
- }
437
- }
438
- break;
439
- case "PageDown":
440
- if (delegate.getKeyPageBelow && manager.focusedKey != null) {
441
- let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
442
- if (nextKey != null) {
443
- e.preventDefault();
444
- navigateToKey(nextKey);
445
- }
446
- }
447
- break;
448
- case "PageUp":
449
- if (delegate.getKeyPageAbove && manager.focusedKey != null) {
450
- let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
451
- if (nextKey != null) {
452
- e.preventDefault();
453
- navigateToKey(nextKey);
454
- }
455
- }
456
- break;
457
- case "a":
458
- if ($21f1aa98acb08317$export$16792effe837dba3(e) && manager.selectionMode === "multiple" && disallowSelectAll !== true) {
459
- e.preventDefault();
460
- manager.selectAll();
461
- }
462
- break;
463
- case "Escape":
464
- if (escapeKeyBehavior === "clearSelection" && !disallowEmptySelection && manager.selectedKeys.size !== 0) {
465
- e.stopPropagation();
466
- e.preventDefault();
467
- manager.clearSelection();
468
- }
469
- break;
470
- case "Tab": if (!allowsTabNavigation) {
471
- if (e.shiftKey) ref.current.focus();
472
- else {
473
- let walker = $9bf71ea28793e738$export$2d6ec8fc375ceafa(ref.current, { tabbable: true });
474
- let next = void 0;
475
- let last;
476
- do {
477
- last = walker.lastChild();
478
- if (last) next = last;
479
- } while (last);
480
- let activeElement = $d4ee10de306f2510$export$cd4e5573fbe2b576();
481
- if (next && (!$d4ee10de306f2510$export$b4f377a2b6254582(next) || activeElement && !$b4b717babfbb907b$export$bebd5a1431fec25d(activeElement))) $7215afc6de606d6b$export$de79e2c695e052f3(next);
482
- }
483
- break;
484
- }
244
+ //#region node_modules/react-aria/dist/private/collections/Document.mjs
245
+ var $96ead35620b8fd36$export$410b0c854570d131 = class {
246
+ constructor(ownerDocument) {
247
+ this._firstChild = null;
248
+ this._lastChild = null;
249
+ this._previousSibling = null;
250
+ this._nextSibling = null;
251
+ this._parentNode = null;
252
+ this._minInvalidChildIndex = null;
253
+ this.ownerDocument = ownerDocument;
254
+ }
255
+ *[Symbol.iterator]() {
256
+ let node = this.firstChild;
257
+ while (node) {
258
+ yield node;
259
+ node = node.nextSibling;
485
260
  }
486
- };
487
- let scrollPos = useRef({
488
- top: 0,
489
- left: 0
490
- });
491
- $e9faafb641e167db$export$90fc3a17d93f704c(scrollRef, "scroll", () => {
492
- var _scrollRef_current, _scrollRef_current1;
493
- var _scrollRef_current_scrollTop, _scrollRef_current_scrollLeft;
494
- scrollPos.current = {
495
- top: (_scrollRef_current_scrollTop = (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 ? void 0 : _scrollRef_current.scrollTop) !== null && _scrollRef_current_scrollTop !== void 0 ? _scrollRef_current_scrollTop : 0,
496
- left: (_scrollRef_current_scrollLeft = (_scrollRef_current1 = scrollRef.current) === null || _scrollRef_current1 === void 0 ? void 0 : _scrollRef_current1.scrollLeft) !== null && _scrollRef_current_scrollLeft !== void 0 ? _scrollRef_current_scrollLeft : 0
497
- };
498
- });
499
- let onFocus = (e) => {
500
- if (manager.isFocused) {
501
- if (!$d4ee10de306f2510$export$4282f70798064fe0(e.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e))) manager.setFocused(false);
502
- return;
261
+ }
262
+ get firstChild() {
263
+ return this._firstChild;
264
+ }
265
+ set firstChild(firstChild) {
266
+ this._firstChild = firstChild;
267
+ this.ownerDocument.markDirty(this);
268
+ }
269
+ get lastChild() {
270
+ return this._lastChild;
271
+ }
272
+ set lastChild(lastChild) {
273
+ this._lastChild = lastChild;
274
+ this.ownerDocument.markDirty(this);
275
+ }
276
+ get previousSibling() {
277
+ return this._previousSibling;
278
+ }
279
+ set previousSibling(previousSibling) {
280
+ this._previousSibling = previousSibling;
281
+ this.ownerDocument.markDirty(this);
282
+ }
283
+ get nextSibling() {
284
+ return this._nextSibling;
285
+ }
286
+ set nextSibling(nextSibling) {
287
+ this._nextSibling = nextSibling;
288
+ this.ownerDocument.markDirty(this);
289
+ }
290
+ get parentNode() {
291
+ return this._parentNode;
292
+ }
293
+ set parentNode(parentNode) {
294
+ this._parentNode = parentNode;
295
+ this.ownerDocument.markDirty(this);
296
+ }
297
+ get isConnected() {
298
+ return this.parentNode?.isConnected || false;
299
+ }
300
+ invalidateChildIndices(child) {
301
+ if (this._minInvalidChildIndex == null || !this._minInvalidChildIndex.isConnected || child.index < this._minInvalidChildIndex.index) {
302
+ this._minInvalidChildIndex = child;
303
+ this.ownerDocument.markDirty(this);
503
304
  }
504
- if (!$d4ee10de306f2510$export$4282f70798064fe0(e.currentTarget, $d4ee10de306f2510$export$e58f029f0fbfdb29(e))) return;
505
- manager.setFocused(true);
506
- if (manager.focusedKey == null) {
507
- var _delegate_getLastKey, _delegate_getFirstKey;
508
- let navigateToKey = (key) => {
509
- if (key != null) {
510
- manager.setFocusedKey(key);
511
- if (selectOnFocus && !manager.isSelected(key)) manager.replaceSelection(key);
512
- }
513
- };
514
- let relatedTarget = e.relatedTarget;
515
- var _manager_lastSelectedKey, _manager_firstSelectedKey;
516
- if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToKey((_manager_lastSelectedKey = manager.lastSelectedKey) !== null && _manager_lastSelectedKey !== void 0 ? _manager_lastSelectedKey : (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate));
517
- else navigateToKey((_manager_firstSelectedKey = manager.firstSelectedKey) !== null && _manager_firstSelectedKey !== void 0 ? _manager_firstSelectedKey : (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate));
518
- } else if (scrollRef.current) {
519
- scrollRef.current.scrollTop = scrollPos.current.top;
520
- scrollRef.current.scrollLeft = scrollPos.current.left;
305
+ }
306
+ updateChildIndices() {
307
+ let node = this._minInvalidChildIndex;
308
+ while (node) {
309
+ node.index = node.previousSibling ? node.previousSibling.index + 1 : 0;
310
+ node = node.nextSibling;
521
311
  }
522
- if (manager.focusedKey != null && scrollRef.current) {
523
- let element = $feb5ffebff200149$export$c3d8340acf92597f(ref, manager.focusedKey);
524
- if (element instanceof HTMLElement) {
525
- if (!$d4ee10de306f2510$export$b4f377a2b6254582(element) && !shouldUseVirtualFocus) $7215afc6de606d6b$export$de79e2c695e052f3(element);
526
- if ($507fabe10e71c6fb$export$630ff653c5ada6a9() === "keyboard") $2f04cbc44ee30ce0$export$c826860796309d1b(element, { containingElement: ref.current });
527
- }
312
+ this._minInvalidChildIndex = null;
313
+ }
314
+ appendChild(child) {
315
+ if (child.parentNode) child.parentNode.removeChild(child);
316
+ if (this.firstChild == null) this.firstChild = child;
317
+ if (this.lastChild) {
318
+ this.lastChild.nextSibling = child;
319
+ child.index = this.lastChild.index + 1;
320
+ child.previousSibling = this.lastChild;
321
+ } else {
322
+ child.previousSibling = null;
323
+ child.index = 0;
528
324
  }
529
- };
530
- let onBlur = (e) => {
531
- if (!$d4ee10de306f2510$export$4282f70798064fe0(e.currentTarget, e.relatedTarget)) manager.setFocused(false);
532
- };
533
- let shouldVirtualFocusFirst = useRef(false);
534
- $e9faafb641e167db$export$90fc3a17d93f704c(ref, $5671b20cf9b562b2$export$831c820ad60f9d12, !shouldUseVirtualFocus ? void 0 : (e) => {
535
- let { detail } = e;
536
- e.stopPropagation();
537
- manager.setFocused(true);
538
- if ((detail === null || detail === void 0 ? void 0 : detail.focusStrategy) === "first") shouldVirtualFocusFirst.current = true;
539
- });
540
- $ca9b37712f007381$export$72ef708ab07251f1(() => {
541
- if (shouldVirtualFocusFirst.current) {
542
- var _delegate_getFirstKey;
543
- var _delegate_getFirstKey1;
544
- let keyToFocus = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
545
- if (keyToFocus == null) {
546
- let previousActiveElement = $d4ee10de306f2510$export$cd4e5573fbe2b576();
547
- $55f9b1ae81f22853$export$76e4e37e5339496d(ref.current);
548
- $55f9b1ae81f22853$export$2b35b76d2e30e129(previousActiveElement, null);
549
- if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
550
- } else {
551
- manager.setFocusedKey(keyToFocus);
552
- shouldVirtualFocusFirst.current = false;
553
- }
325
+ child.parentNode = this;
326
+ child.nextSibling = null;
327
+ this.lastChild = child;
328
+ this.ownerDocument.markDirty(this);
329
+ if (this.isConnected) this.ownerDocument.queueUpdate();
330
+ }
331
+ insertBefore(newNode, referenceNode) {
332
+ if (referenceNode == null) return this.appendChild(newNode);
333
+ if (newNode.parentNode) newNode.parentNode.removeChild(newNode);
334
+ newNode.nextSibling = referenceNode;
335
+ newNode.previousSibling = referenceNode.previousSibling;
336
+ newNode.index = referenceNode.index - 1;
337
+ if (this.firstChild === referenceNode) this.firstChild = newNode;
338
+ else if (referenceNode.previousSibling) referenceNode.previousSibling.nextSibling = newNode;
339
+ referenceNode.previousSibling = newNode;
340
+ newNode.parentNode = referenceNode.parentNode;
341
+ this.invalidateChildIndices(newNode);
342
+ if (this.isConnected) this.ownerDocument.queueUpdate();
343
+ }
344
+ removeChild(child) {
345
+ if (child.parentNode !== this) return;
346
+ if (this._minInvalidChildIndex === child) this._minInvalidChildIndex = null;
347
+ if (child.nextSibling) {
348
+ this.invalidateChildIndices(child.nextSibling);
349
+ child.nextSibling.previousSibling = child.previousSibling;
554
350
  }
555
- }, [manager.collection]);
556
- $ca9b37712f007381$export$72ef708ab07251f1(() => {
557
- if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
558
- }, [manager.focusedKey]);
559
- $e9faafb641e167db$export$90fc3a17d93f704c(ref, $5671b20cf9b562b2$export$447a38995de2c711, !shouldUseVirtualFocus ? void 0 : (e) => {
560
- var _e_detail;
561
- e.stopPropagation();
562
- manager.setFocused(false);
563
- if ((_e_detail = e.detail) === null || _e_detail === void 0 ? void 0 : _e_detail.clearFocusKey) manager.setFocusedKey(null);
564
- });
565
- const autoFocusRef = useRef(autoFocus);
566
- const didAutoFocusRef = useRef(false);
567
- useEffect(() => {
568
- if (autoFocusRef.current) {
569
- var _delegate_getFirstKey, _delegate_getLastKey;
570
- let focusedKey = null;
571
- var _delegate_getFirstKey1;
572
- if (autoFocus === "first") focusedKey = (_delegate_getFirstKey1 = (_delegate_getFirstKey = delegate.getFirstKey) === null || _delegate_getFirstKey === void 0 ? void 0 : _delegate_getFirstKey.call(delegate)) !== null && _delegate_getFirstKey1 !== void 0 ? _delegate_getFirstKey1 : null;
573
- var _delegate_getLastKey1;
574
- if (autoFocus === "last") focusedKey = (_delegate_getLastKey1 = (_delegate_getLastKey = delegate.getLastKey) === null || _delegate_getLastKey === void 0 ? void 0 : _delegate_getLastKey.call(delegate)) !== null && _delegate_getLastKey1 !== void 0 ? _delegate_getLastKey1 : null;
575
- let selectedKeys = manager.selectedKeys;
576
- if (selectedKeys.size) {
577
- for (let key of selectedKeys) if (manager.canSelectItem(key)) {
578
- focusedKey = key;
579
- break;
580
- }
581
- }
582
- manager.setFocused(true);
583
- manager.setFocusedKey(focusedKey);
584
- if (focusedKey == null && !shouldUseVirtualFocus && ref.current) $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
585
- if (manager.collection.size > 0) {
586
- autoFocusRef.current = false;
587
- didAutoFocusRef.current = true;
351
+ if (child.previousSibling) child.previousSibling.nextSibling = child.nextSibling;
352
+ if (this.firstChild === child) this.firstChild = child.nextSibling;
353
+ if (this.lastChild === child) this.lastChild = child.previousSibling;
354
+ child.parentNode = null;
355
+ child.nextSibling = null;
356
+ child.previousSibling = null;
357
+ child.index = 0;
358
+ this.ownerDocument.markDirty(child);
359
+ if (this.isConnected) this.ownerDocument.queueUpdate();
360
+ }
361
+ addEventListener() {}
362
+ removeEventListener() {}
363
+ get previousVisibleSibling() {
364
+ let node = this.previousSibling;
365
+ while (node && node.isHidden) node = node.previousSibling;
366
+ return node;
367
+ }
368
+ get nextVisibleSibling() {
369
+ let node = this.nextSibling;
370
+ while (node && node.isHidden) node = node.nextSibling;
371
+ return node;
372
+ }
373
+ get firstVisibleChild() {
374
+ let node = this.firstChild;
375
+ while (node && node.isHidden) node = node.nextSibling;
376
+ return node;
377
+ }
378
+ get lastVisibleChild() {
379
+ let node = this.lastChild;
380
+ while (node && node.isHidden) node = node.previousSibling;
381
+ return node;
382
+ }
383
+ };
384
+ var $96ead35620b8fd36$export$dc064fe9e59310fd = class $96ead35620b8fd36$export$dc064fe9e59310fd extends $96ead35620b8fd36$export$410b0c854570d131 {
385
+ constructor(type, ownerDocument) {
386
+ super(ownerDocument), this.nodeType = 8, this.isMutated = true, this._index = 0, this.isHidden = false;
387
+ this.node = null;
388
+ }
389
+ get index() {
390
+ return this._index;
391
+ }
392
+ set index(index) {
393
+ this._index = index;
394
+ this.ownerDocument.markDirty(this);
395
+ }
396
+ get level() {
397
+ if (this.parentNode instanceof $96ead35620b8fd36$export$dc064fe9e59310fd) return this.parentNode.level + (this.parentNode.node?.type === "item" ? 1 : 0);
398
+ return 0;
399
+ }
400
+ /**
401
+ * Lazily gets a mutable instance of a Node. If the node has already
402
+ * been cloned during this update cycle, it just returns the existing one.
403
+ */ getMutableNode() {
404
+ if (this.node == null) return null;
405
+ if (!this.isMutated) {
406
+ this.node = this.node.clone();
407
+ this.isMutated = true;
408
+ }
409
+ this.ownerDocument.markDirty(this);
410
+ return this.node;
411
+ }
412
+ updateNode() {
413
+ let nextSibling = this.nextVisibleSibling;
414
+ let node = this.getMutableNode();
415
+ if (node == null) return;
416
+ node.index = this.index;
417
+ node.level = this.level;
418
+ node.parentKey = this.parentNode instanceof $96ead35620b8fd36$export$dc064fe9e59310fd ? this.parentNode.node?.key ?? null : null;
419
+ node.prevKey = this.previousVisibleSibling?.node?.key ?? null;
420
+ node.nextKey = nextSibling?.node?.key ?? null;
421
+ node.hasChildNodes = !!this.firstChild;
422
+ node.firstChildKey = this.firstVisibleChild?.node?.key ?? null;
423
+ node.lastChildKey = this.lastVisibleChild?.node?.key ?? null;
424
+ if ((node.colSpan != null || node.colIndex != null) && nextSibling) {
425
+ let nextColIndex = (node.colIndex ?? node.index) + (node.colSpan ?? 1);
426
+ if (nextSibling.node != null && nextColIndex !== nextSibling.node.colIndex) {
427
+ let siblingNode = nextSibling.getMutableNode();
428
+ siblingNode.colIndex = nextColIndex;
588
429
  }
589
430
  }
590
- });
591
- let lastFocusedKey = useRef(manager.focusedKey);
592
- let raf = useRef(null);
593
- useEffect(() => {
594
- if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || didAutoFocusRef.current) && scrollRef.current && ref.current) {
595
- let modality = $507fabe10e71c6fb$export$630ff653c5ada6a9();
596
- let element = $feb5ffebff200149$export$c3d8340acf92597f(ref, manager.focusedKey);
597
- if (!(element instanceof HTMLElement)) return;
598
- if (modality === "keyboard" || didAutoFocusRef.current) {
599
- if (raf.current) cancelAnimationFrame(raf.current);
600
- raf.current = requestAnimationFrame(() => {
601
- if (scrollRef.current) {
602
- $2f04cbc44ee30ce0$export$53a0910f038337bd(scrollRef.current, element);
603
- if (modality !== "virtual") $2f04cbc44ee30ce0$export$c826860796309d1b(element, { containingElement: ref.current });
604
- }
605
- });
431
+ }
432
+ setProps(obj, ref, CollectionNodeClass, rendered, render) {
433
+ let node;
434
+ let { value: value1, textValue, id, ...props } = obj;
435
+ if (this.node == null) {
436
+ node = new CollectionNodeClass(id ?? `react-aria-${++this.ownerDocument.nodeId}`);
437
+ this.node = node;
438
+ } else node = this.getMutableNode();
439
+ props.ref = ref;
440
+ node.props = props;
441
+ node.rendered = rendered;
442
+ node.render = render;
443
+ node.value = value1;
444
+ if (obj["aria-label"]) node["aria-label"] = obj["aria-label"];
445
+ node.textValue = textValue || (typeof props.children === "string" ? props.children : "") || obj["aria-label"] || "";
446
+ if (id != null && id !== node.key) throw new Error("Cannot change the id of an item");
447
+ if (props.colSpan != null) node.colSpan = props.colSpan;
448
+ if (this.isConnected) this.ownerDocument.queueUpdate();
449
+ }
450
+ get style() {
451
+ let element = this;
452
+ return {
453
+ get display() {
454
+ return element.isHidden ? "none" : "";
455
+ },
456
+ set display(value) {
457
+ let isHidden = value === "none";
458
+ if (element.isHidden !== isHidden) {
459
+ if (element.parentNode?.firstVisibleChild === element || element.parentNode?.lastVisibleChild === element) element.ownerDocument.markDirty(element.parentNode);
460
+ let prev = element.previousVisibleSibling;
461
+ let next = element.nextVisibleSibling;
462
+ if (prev) element.ownerDocument.markDirty(prev);
463
+ if (next) element.ownerDocument.markDirty(next);
464
+ element.isHidden = isHidden;
465
+ element.ownerDocument.markDirty(element);
466
+ }
606
467
  }
607
- }
608
- if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
609
- lastFocusedKey.current = manager.focusedKey;
610
- didAutoFocusRef.current = false;
611
- });
612
- useEffect(() => {
613
- return () => {
614
- if (raf.current) cancelAnimationFrame(raf.current);
615
468
  };
616
- }, []);
617
- $e9faafb641e167db$export$90fc3a17d93f704c(ref, "react-aria-focus-scope-restore", (e) => {
618
- e.preventDefault();
619
- manager.setFocused(true);
620
- });
621
- let handlers = {
622
- onKeyDown,
623
- onFocus,
624
- onBlur,
625
- onMouseDown(e) {
626
- if (scrollRef.current === $d4ee10de306f2510$export$e58f029f0fbfdb29(e)) e.preventDefault();
469
+ }
470
+ hasAttribute() {}
471
+ setAttribute() {}
472
+ setAttributeNS() {}
473
+ removeAttribute() {}
474
+ };
475
+ var $96ead35620b8fd36$export$b34a105447964f9f = class extends $96ead35620b8fd36$export$410b0c854570d131 {
476
+ constructor(collection) {
477
+ super(null), this.nodeType = 11, this.ownerDocument = this, this.dirtyNodes = new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = new WeakMap(), this.nextCollection = null, this.subscriptions = new Set(), this.queuedRender = false, this.inSubscription = false;
478
+ this.collection = collection;
479
+ this.nextCollection = collection;
480
+ }
481
+ get isConnected() {
482
+ return true;
483
+ }
484
+ createElement(type) {
485
+ return new $96ead35620b8fd36$export$dc064fe9e59310fd(type, this);
486
+ }
487
+ getMutableCollection() {
488
+ if (!this.nextCollection) this.nextCollection = this.collection.clone();
489
+ return this.nextCollection;
490
+ }
491
+ markDirty(node) {
492
+ this.dirtyNodes.add(node);
493
+ }
494
+ addNode(element) {
495
+ if (element.isHidden || element.node == null) return;
496
+ let collection = this.getMutableCollection();
497
+ if (!collection.getItem(element.node.key)) for (let child of element) this.addNode(child);
498
+ collection.addNode(element.node);
499
+ }
500
+ removeNode(node) {
501
+ for (let child of node) this.removeNode(child);
502
+ if (node.node) this.getMutableCollection().removeNode(node.node.key);
503
+ }
504
+ /** Finalizes the collection update, updating all nodes and freezing the collection. */ getCollection() {
505
+ if (this.inSubscription) return this.collection;
506
+ this.queuedRender = false;
507
+ this.updateCollection();
508
+ return this.collection;
509
+ }
510
+ updateCollection() {
511
+ for (let element of this.dirtyNodes) if (element instanceof $96ead35620b8fd36$export$dc064fe9e59310fd && (!element.isConnected || element.isHidden)) this.removeNode(element);
512
+ else element.updateChildIndices();
513
+ for (let element of this.dirtyNodes) if (element instanceof $96ead35620b8fd36$export$dc064fe9e59310fd) {
514
+ if (element.isConnected && !element.isHidden) {
515
+ element.updateNode();
516
+ this.addNode(element);
517
+ }
518
+ if (element.node) this.dirtyNodes.delete(element);
519
+ element.isMutated = false;
520
+ } else this.dirtyNodes.delete(element);
521
+ if (this.nextCollection) {
522
+ this.nextCollection.commit(this.firstVisibleChild?.node?.key ?? null, this.lastVisibleChild?.node?.key ?? null, this.isSSR);
523
+ if (!this.isSSR) {
524
+ this.collection = this.nextCollection;
525
+ this.nextCollection = null;
526
+ }
627
527
  }
628
- };
629
- let { typeSelectProps } = $fb3050f43d946246$export$e32c88dfddc6e1d8({
630
- keyboardDelegate: delegate,
631
- selectionManager: manager
632
- });
633
- if (!disallowTypeAhead) handlers = $3ef42575df84b30b$export$9d1611c77c2fe928(typeSelectProps, handlers);
634
- let tabIndex = void 0;
635
- if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
636
- let collectionId = $feb5ffebff200149$export$881eb0d9f3605d9d(manager.collection);
637
- return { collectionProps: $3ef42575df84b30b$export$9d1611c77c2fe928(handlers, {
638
- tabIndex,
639
- "data-collection": collectionId
640
- }) };
641
- }
528
+ }
529
+ queueUpdate() {
530
+ if (this.dirtyNodes.size === 0 || this.queuedRender) return;
531
+ this.queuedRender = true;
532
+ this.inSubscription = true;
533
+ if (!this.isSSR) this.collection = this.collection.clone();
534
+ for (let fn of this.subscriptions) fn();
535
+ this.inSubscription = false;
536
+ }
537
+ subscribe(fn) {
538
+ this.subscriptions.add(fn);
539
+ return () => this.subscriptions.delete(fn);
540
+ }
541
+ resetAfterSSR() {
542
+ if (this.isSSR) {
543
+ this.isSSR = false;
544
+ this.firstChild = null;
545
+ this.lastChild = null;
546
+ this.nodeId = 0;
547
+ }
548
+ }
549
+ };
642
550
  //#endregion
643
- //#region node_modules/@react-aria/selection/dist/useSelectableItem.mjs
644
- function $880e95eb8b93ba9a$export$ecf600387e221c37(options) {
645
- let { id, selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
646
- let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
647
- id = $bdb11010cef70236$export$f680877a34711e37(id);
648
- let onSelect = (e) => {
649
- if (e.pointerType === "keyboard" && $feb5ffebff200149$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
650
- else {
651
- if (manager.selectionMode === "none") return;
652
- if (manager.isLink(key)) {
653
- if (linkBehavior === "selection" && ref.current) {
654
- let itemProps = manager.getItemProps(key);
655
- router.open(ref.current, e, itemProps.href, itemProps.routerOptions);
656
- manager.setSelectedKeys(manager.selectedKeys);
657
- return;
658
- } else if (linkBehavior === "override" || linkBehavior === "none") return;
551
+ //#region node_modules/react-aria/dist/private/collections/useCachedChildren.mjs
552
+ function $a80bd3e9349588e7$export$727c8fc270210f13(props) {
553
+ let { children, items, idScope, addIdAndValue, dependencies = [] } = props;
554
+ let cache = useMemo(() => new WeakMap(), dependencies);
555
+ return useMemo(() => {
556
+ if (items && typeof children === "function") {
557
+ let res = [];
558
+ for (let item of items) {
559
+ let rendered = cache.get(item);
560
+ if (!rendered) {
561
+ rendered = children(item);
562
+ let key = rendered.props.id ?? item.key ?? item.id;
563
+ if (key == null) throw new Error("Could not determine key for item");
564
+ if (idScope != null && rendered.props.id == null) key = idScope + ":" + key;
565
+ rendered = cloneElement(rendered, addIdAndValue ? {
566
+ key,
567
+ id: key,
568
+ value: item
569
+ } : { key });
570
+ cache.set(item, rendered);
571
+ }
572
+ res.push(rendered);
659
573
  }
660
- if (manager.selectionMode === "single") if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
661
- else manager.replaceSelection(key);
662
- else if (e && e.shiftKey) manager.extendSelection(key);
663
- else if (manager.selectionBehavior === "toggle" || e && ($21f1aa98acb08317$export$16792effe837dba3(e) || e.pointerType === "touch" || e.pointerType === "virtual")) manager.toggleSelection(key);
664
- else manager.replaceSelection(key);
665
- }
666
- };
667
- useEffect(() => {
668
- if (key === manager.focusedKey && manager.isFocused) if (!shouldUseVirtualFocus) {
669
- if (focus) focus();
670
- else if ($d4ee10de306f2510$export$cd4e5573fbe2b576() !== ref.current && ref.current) $3ad3f6e1647bc98d$export$80f3e147d781571c(ref.current);
671
- } else $55f9b1ae81f22853$export$76e4e37e5339496d(ref.current);
574
+ return res;
575
+ } else if (typeof children !== "function") return children;
672
576
  }, [
673
- ref,
674
- key,
675
- manager.focusedKey,
676
- manager.childFocusStrategy,
677
- manager.isFocused,
678
- shouldUseVirtualFocus
577
+ children,
578
+ items,
579
+ cache,
580
+ idScope,
581
+ addIdAndValue
679
582
  ]);
680
- isDisabled = isDisabled || manager.isDisabled(key);
681
- let itemProps = {};
682
- if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
683
- tabIndex: key === manager.focusedKey ? 0 : -1,
684
- onFocus(e) {
685
- if ($d4ee10de306f2510$export$e58f029f0fbfdb29(e) === ref.current) manager.setFocusedKey(key);
686
- }
583
+ }
584
+ //#endregion
585
+ //#region node_modules/react-aria/dist/private/collections/CollectionBuilder.mjs
586
+ var $42ceafc619f9c3ba$var$ShallowRenderContext = createContext(false);
587
+ var $42ceafc619f9c3ba$var$CollectionDocumentContext = createContext(null);
588
+ function $42ceafc619f9c3ba$export$bf788dd355e3a401(props) {
589
+ if (useContext($42ceafc619f9c3ba$var$CollectionDocumentContext)) return props.content;
590
+ let { collection, document } = $42ceafc619f9c3ba$var$useCollectionDocument(props.createCollection);
591
+ return React.createElement(React.Fragment, null, React.createElement($d7f64c32b702fe2c$export$8dc98ba7eadeaa56, null, React.createElement($42ceafc619f9c3ba$var$CollectionDocumentContext.Provider, { value: document }, props.content)), React.createElement($42ceafc619f9c3ba$var$CollectionInner, {
592
+ render: props.children,
593
+ collection
594
+ }));
595
+ }
596
+ function $42ceafc619f9c3ba$var$CollectionInner({ collection, render }) {
597
+ return render(collection);
598
+ }
599
+ function $42ceafc619f9c3ba$var$useSyncExternalStoreFallback(subscribe, getSnapshot, getServerSnapshot) {
600
+ let isSSR = $c7eafbbe1ea5834e$export$535bd6ca7f90a273();
601
+ let isSSRRef = useRef(isSSR);
602
+ isSSRRef.current = isSSR;
603
+ return useSyncExternalStore(subscribe, useCallback(() => {
604
+ return isSSRRef.current ? getServerSnapshot() : getSnapshot();
605
+ }, [getSnapshot, getServerSnapshot]));
606
+ }
607
+ var $42ceafc619f9c3ba$var$useSyncExternalStore = typeof React["useSyncExternalStore"] === "function" ? React["useSyncExternalStore"] : $42ceafc619f9c3ba$var$useSyncExternalStoreFallback;
608
+ function $42ceafc619f9c3ba$var$useCollectionDocument(createCollection) {
609
+ let [document] = useState(() => new $96ead35620b8fd36$export$b34a105447964f9f(createCollection?.() || new $6f0c29017aeec335$export$408d25a4e12db025()));
610
+ return {
611
+ collection: $42ceafc619f9c3ba$var$useSyncExternalStore(useCallback((fn) => document.subscribe(fn), [document]), useCallback(() => {
612
+ let collection = document.getCollection();
613
+ if (document.isSSR) document.resetAfterSSR();
614
+ return collection;
615
+ }, [document]), useCallback(() => {
616
+ document.isSSR = true;
617
+ return document.getCollection();
618
+ }, [document])),
619
+ document
687
620
  };
688
- else if (isDisabled) itemProps.onMouseDown = (e) => {
689
- e.preventDefault();
621
+ }
622
+ var $42ceafc619f9c3ba$var$SSRContext = createContext(null);
623
+ function $42ceafc619f9c3ba$var$createCollectionNodeClass(type) {
624
+ let NodeClass = class extends $6f0c29017aeec335$export$d68d59712b04d9d1 {
625
+ static {
626
+ this.type = type;
627
+ }
690
628
  };
691
- useEffect(() => {
692
- if (isDisabled && manager.focusedKey === key) manager.setFocusedKey(null);
629
+ return NodeClass;
630
+ }
631
+ function $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, rendered, children, render) {
632
+ if (typeof CollectionNodeClass === "string") CollectionNodeClass = $42ceafc619f9c3ba$var$createCollectionNodeClass(CollectionNodeClass);
633
+ let itemRef = useCallback((element) => {
634
+ element?.setProps(props, ref, CollectionNodeClass, rendered, render);
693
635
  }, [
694
- manager,
695
- isDisabled,
696
- key
636
+ props,
637
+ ref,
638
+ rendered,
639
+ render,
640
+ CollectionNodeClass
697
641
  ]);
698
- let isLinkOverride = manager.isLink(key) && linkBehavior === "override";
699
- let isActionOverride = onAction && options["UNSTABLE_itemBehavior"] === "action";
700
- let hasLinkAction = manager.isLink(key) && linkBehavior !== "selection" && linkBehavior !== "none";
701
- let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride && !isActionOverride;
702
- let allowsActions = (onAction || hasLinkAction) && !isDisabled;
703
- let hasPrimaryAction = allowsActions && (manager.selectionBehavior === "replace" ? !allowsSelection : !allowsSelection || manager.isEmpty);
704
- let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === "replace";
705
- let hasAction = hasPrimaryAction || hasSecondaryAction;
706
- let modality = useRef(null);
707
- let longPressEnabled = hasAction && allowsSelection;
708
- let longPressEnabledOnPressStart = useRef(false);
709
- let hadPrimaryActionOnPressStart = useRef(false);
710
- let collectionItemProps = manager.getItemProps(key);
711
- let performAction = (e) => {
712
- if (onAction) {
713
- var _ref_current;
714
- onAction();
715
- (_ref_current = ref.current) === null || _ref_current === void 0 || _ref_current.dispatchEvent(new CustomEvent("react-aria-item-action", { bubbles: true }));
642
+ let parentNode = useContext($42ceafc619f9c3ba$var$SSRContext);
643
+ if (parentNode) {
644
+ let element = parentNode.ownerDocument.nodesByProps.get(props);
645
+ if (!element) {
646
+ element = parentNode.ownerDocument.createElement(CollectionNodeClass.type);
647
+ element.setProps(props, ref, CollectionNodeClass, rendered, render);
648
+ parentNode.appendChild(element);
649
+ parentNode.ownerDocument.updateCollection();
650
+ parentNode.ownerDocument.nodesByProps.set(props, element);
716
651
  }
717
- if (hasLinkAction && ref.current) router.open(ref.current, e, collectionItemProps.href, collectionItemProps.routerOptions);
718
- };
719
- let itemPressProps = { ref };
720
- if (shouldSelectOnPressUp) {
721
- itemPressProps.onPressStart = (e) => {
722
- modality.current = e.pointerType;
723
- longPressEnabledOnPressStart.current = longPressEnabled;
724
- if (e.pointerType === "keyboard" && (!hasAction || $880e95eb8b93ba9a$var$isSelectionKey(e.key))) onSelect(e);
725
- };
726
- if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e) => {
727
- if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== "mouse") {
728
- if (e.pointerType === "keyboard" && !$880e95eb8b93ba9a$var$isActionKey(e.key)) return;
729
- performAction(e);
730
- } else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
731
- };
732
- else {
733
- itemPressProps.onPressUp = hasPrimaryAction ? void 0 : (e) => {
734
- if (e.pointerType === "mouse" && allowsSelection) onSelect(e);
735
- };
736
- itemPressProps.onPress = hasPrimaryAction ? performAction : (e) => {
737
- if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection) onSelect(e);
738
- };
739
- }
740
- } else {
741
- itemPressProps.onPressStart = (e) => {
742
- modality.current = e.pointerType;
743
- longPressEnabledOnPressStart.current = longPressEnabled;
744
- hadPrimaryActionOnPressStart.current = hasPrimaryAction;
745
- if (allowsSelection && (e.pointerType === "mouse" && !hasPrimaryAction || e.pointerType === "keyboard" && (!allowsActions || $880e95eb8b93ba9a$var$isSelectionKey(e.key)))) onSelect(e);
746
- };
747
- itemPressProps.onPress = (e) => {
748
- if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction && $880e95eb8b93ba9a$var$isActionKey(e.key) || e.pointerType === "mouse" && hadPrimaryActionOnPressStart.current) {
749
- if (hasAction) performAction(e);
750
- else if (allowsSelection) onSelect(e);
751
- }
752
- };
652
+ return children ? React.createElement($42ceafc619f9c3ba$var$SSRContext.Provider, { value: element }, children) : null;
753
653
  }
754
- itemProps["data-collection"] = $feb5ffebff200149$export$6aeb1680a0ae8741(manager.collection);
755
- itemProps["data-key"] = key;
756
- itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
757
- if (shouldUseVirtualFocus) itemPressProps = $3ef42575df84b30b$export$9d1611c77c2fe928(itemPressProps, {
758
- onPressStart(e) {
759
- if (e.pointerType !== "touch") {
760
- manager.setFocused(true);
761
- manager.setFocusedKey(key);
762
- }
763
- },
764
- onPress(e) {
765
- if (e.pointerType === "touch") {
766
- manager.setFocused(true);
767
- manager.setFocusedKey(key);
768
- }
654
+ return React.createElement(CollectionNodeClass.type, { ref: itemRef }, children);
655
+ }
656
+ function $42ceafc619f9c3ba$export$18af5c7a9e9b3664(CollectionNodeClass, render) {
657
+ let Component = ({ node }) => render(node.props, node.props.ref, node);
658
+ let Result = forwardRef((props, ref) => {
659
+ let focusableProps = useContext($d1116acdf220c2da$export$f9762fab77588ecb);
660
+ if (!useContext($42ceafc619f9c3ba$var$ShallowRenderContext)) {
661
+ if (render.length >= 3) throw new Error(render.name + " cannot be rendered outside a collection.");
662
+ return render(props, ref);
769
663
  }
664
+ return $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, "children" in props ? props.children : null, null, (node) => React.createElement($d1116acdf220c2da$export$f9762fab77588ecb.Provider, { value: focusableProps }, React.createElement(Component, { node })));
770
665
  });
771
- if (collectionItemProps) {
772
- for (let key of [
773
- "onPressStart",
774
- "onPressEnd",
775
- "onPressChange",
776
- "onPress",
777
- "onPressUp",
778
- "onClick"
779
- ]) if (collectionItemProps[key]) itemPressProps[key] = $ff5963eb1fccf552$export$e08e3b67e392101e(itemPressProps[key], collectionItemProps[key]);
780
- }
781
- let { pressProps, isPressed } = $f6c31cce2adf654f$export$45712eceda6fad21(itemPressProps);
782
- let onDoubleClick = hasSecondaryAction ? (e) => {
783
- if (modality.current === "mouse") {
784
- e.stopPropagation();
785
- e.preventDefault();
786
- performAction(e);
787
- }
788
- } : void 0;
789
- let { longPressProps } = $8a26561d2877236e$export$c24ed0104d07eab9({
790
- isDisabled: !longPressEnabled,
791
- onLongPress(e) {
792
- if (e.pointerType === "touch") {
793
- onSelect(e);
794
- manager.setSelectionBehavior("toggle");
795
- }
796
- }
666
+ Result.displayName = render.name;
667
+ return Result;
668
+ }
669
+ function $42ceafc619f9c3ba$export$e953bb1cd0f19726(CollectionNodeClass, render, useChildren = $42ceafc619f9c3ba$var$useCollectionChildren) {
670
+ let Component = ({ node }) => render(node.props, node.props.ref, node);
671
+ let Result = forwardRef((props, ref) => {
672
+ return $42ceafc619f9c3ba$var$useSSRCollectionNode(CollectionNodeClass, props, ref, null, useChildren(props), (node) => React.createElement(Component, { node })) ?? React.createElement(React.Fragment, null);
797
673
  });
798
- let onDragStartCapture = (e) => {
799
- if (modality.current === "touch" && longPressEnabledOnPressStart.current) e.preventDefault();
800
- };
801
- let onClick = linkBehavior !== "none" && manager.isLink(key) ? (e) => {
802
- if (!$ea8dcbcb9ea1b556$export$95185d699e05d4d7.isOpening) e.preventDefault();
803
- } : void 0;
804
- return {
805
- itemProps: $3ef42575df84b30b$export$9d1611c77c2fe928(itemProps, allowsSelection || hasPrimaryAction || shouldUseVirtualFocus && !isDisabled ? pressProps : {}, longPressEnabled ? longPressProps : {}, {
806
- onDoubleClick,
807
- onDragStartCapture,
808
- onClick,
809
- id
810
- }, shouldUseVirtualFocus ? { onMouseDown: (e) => e.preventDefault() } : void 0),
811
- isPressed,
812
- isSelected: manager.isSelected(key),
813
- isFocused: manager.isFocused && manager.focusedKey === key,
814
- isDisabled,
815
- allowsSelection,
816
- hasAction
817
- };
674
+ Result.displayName = render.name;
675
+ return Result;
818
676
  }
819
- function $880e95eb8b93ba9a$var$isActionKey(key) {
820
- return key === "Enter";
677
+ function $42ceafc619f9c3ba$var$useCollectionChildren(options) {
678
+ return $a80bd3e9349588e7$export$727c8fc270210f13({
679
+ ...options,
680
+ addIdAndValue: true
681
+ });
821
682
  }
822
- function $880e95eb8b93ba9a$var$isSelectionKey(key) {
823
- return key === " ";
683
+ var $42ceafc619f9c3ba$var$CollectionContext = createContext(null);
684
+ function $42ceafc619f9c3ba$export$fb8073518f34e6ec(props) {
685
+ let ctx = useContext($42ceafc619f9c3ba$var$CollectionContext);
686
+ let dependencies = (ctx?.dependencies || []).concat(props.dependencies);
687
+ let idScope = props.idScope ?? ctx?.idScope;
688
+ let children = $42ceafc619f9c3ba$var$useCollectionChildren({
689
+ ...props,
690
+ idScope,
691
+ dependencies
692
+ });
693
+ if (useContext($42ceafc619f9c3ba$var$CollectionDocumentContext)) children = React.createElement($42ceafc619f9c3ba$var$CollectionRoot, null, children);
694
+ ctx = useMemo(() => ({
695
+ dependencies,
696
+ idScope
697
+ }), [idScope, ...dependencies]);
698
+ return React.createElement($42ceafc619f9c3ba$var$CollectionContext.Provider, { value: ctx }, children);
699
+ }
700
+ function $42ceafc619f9c3ba$var$CollectionRoot({ children }) {
701
+ let doc = useContext($42ceafc619f9c3ba$var$CollectionDocumentContext);
702
+ let wrappedChildren = useMemo(() => React.createElement($42ceafc619f9c3ba$var$CollectionDocumentContext.Provider, { value: null }, React.createElement($42ceafc619f9c3ba$var$ShallowRenderContext.Provider, { value: true }, children)), [children]);
703
+ return $c7eafbbe1ea5834e$export$535bd6ca7f90a273() ? React.createElement($42ceafc619f9c3ba$var$SSRContext.Provider, { value: doc }, wrappedChildren) : createPortal(wrappedChildren, doc);
824
704
  }
825
705
  //#endregion
826
- //#region node_modules/@react-stately/collections/dist/CollectionBuilder.mjs
827
- var $eb2240fc39a57fa5$export$bf788dd355e3a401 = class {
828
- build(props, context) {
829
- this.context = context;
830
- return $eb2240fc39a57fa5$var$iterable(() => this.iterateCollection(props));
831
- }
832
- *iterateCollection(props) {
833
- let { children, items } = props;
834
- if (React.isValidElement(children) && children.type === React.Fragment) yield* this.iterateCollection({
835
- children: children.props.children,
836
- items
837
- });
838
- else if (typeof children === "function") {
839
- if (!items) throw new Error("props.children was a function but props.items is missing");
840
- let index = 0;
841
- for (let item of items) {
842
- yield* this.getFullNode({
843
- value: item,
844
- index
845
- }, { renderer: children });
846
- index++;
847
- }
848
- } else {
849
- let items = [];
850
- React.Children.forEach(children, (child) => {
851
- if (child) items.push(child);
852
- });
853
- let index = 0;
854
- for (let item of items) {
855
- let nodes = this.getFullNode({
856
- element: item,
857
- index
858
- }, {});
859
- for (let node of nodes) {
860
- index++;
861
- yield node;
862
- }
863
- }
864
- }
706
+ //#region node_modules/react-aria-components/dist/private/Collection.mjs
707
+ var $263ab7fc0f95ccdb$export$d40e14dec8b060a8 = createContext(null);
708
+ var $263ab7fc0f95ccdb$export$a164736487e3f0ae = {
709
+ CollectionRoot({ collection, renderDropIndicator }) {
710
+ return $263ab7fc0f95ccdb$var$useCollectionRender(collection, null, renderDropIndicator);
711
+ },
712
+ CollectionBranch({ collection, parent, renderDropIndicator }) {
713
+ return $263ab7fc0f95ccdb$var$useCollectionRender(collection, parent, renderDropIndicator);
865
714
  }
866
- getKey(item, partialNode, state, parentKey) {
867
- if (item.key != null) return item.key;
868
- if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
869
- let v = partialNode.value;
870
- if (v != null) {
871
- var _v_key;
872
- let key = (_v_key = v.key) !== null && _v_key !== void 0 ? _v_key : v.id;
873
- if (key == null) throw new Error("No key found for item");
874
- return key;
715
+ };
716
+ function $263ab7fc0f95ccdb$var$useCollectionRender(collection, parent, renderDropIndicator) {
717
+ return $a80bd3e9349588e7$export$727c8fc270210f13({
718
+ items: parent ? collection.getChildren(parent.key) : collection,
719
+ dependencies: [renderDropIndicator],
720
+ children(node) {
721
+ if (node.type === "content") return React.createElement(React.Fragment, null);
722
+ let rendered = node.render(node);
723
+ if (!renderDropIndicator || node.type !== "item") return rendered;
724
+ return React.createElement(React.Fragment, null, renderDropIndicator({
725
+ type: "item",
726
+ key: node.key,
727
+ dropPosition: "before"
728
+ }), rendered, $263ab7fc0f95ccdb$export$2dbbd341daed716d(collection, node, renderDropIndicator));
875
729
  }
876
- return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
877
- }
878
- getChildState(state, partialNode) {
879
- return { renderer: partialNode.renderer || state.renderer };
730
+ });
731
+ }
732
+ function $263ab7fc0f95ccdb$export$2dbbd341daed716d(collection, node, renderDropIndicator) {
733
+ let key = node.key;
734
+ let keyAfter = collection.getKeyAfter(key);
735
+ let nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
736
+ while (nextItemInFlattenedCollection != null && nextItemInFlattenedCollection.type !== "item") {
737
+ keyAfter = collection.getKeyAfter(nextItemInFlattenedCollection.key);
738
+ nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
880
739
  }
881
- *getFullNode(partialNode, state, parentKey, parentNode) {
882
- if (React.isValidElement(partialNode.element) && partialNode.element.type === React.Fragment) {
883
- let children = [];
884
- React.Children.forEach(partialNode.element.props.children, (child) => {
885
- children.push(child);
740
+ let nextItemInSameLevel = node.nextKey != null ? collection.getItem(node.nextKey) : null;
741
+ while (nextItemInSameLevel != null && nextItemInSameLevel.type !== "item") nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
742
+ let afterIndicators = [];
743
+ if (nextItemInSameLevel == null) {
744
+ let current = node;
745
+ while (current?.type === "item" && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)) {
746
+ let indicator = renderDropIndicator({
747
+ type: "item",
748
+ key: current.key,
749
+ dropPosition: "after"
886
750
  });
887
- var _partialNode_index;
888
- let index = (_partialNode_index = partialNode.index) !== null && _partialNode_index !== void 0 ? _partialNode_index : 0;
889
- for (const child of children) yield* this.getFullNode({
890
- element: child,
891
- index: index++
892
- }, state, parentKey, parentNode);
893
- return;
894
- }
895
- let element = partialNode.element;
896
- if (!element && partialNode.value && state && state.renderer) {
897
- let cached = this.cache.get(partialNode.value);
898
- if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
899
- cached.index = partialNode.index;
900
- cached.parentKey = parentNode ? parentNode.key : null;
901
- yield cached;
902
- return;
903
- }
904
- element = state.renderer(partialNode.value);
905
- }
906
- if (React.isValidElement(element)) {
907
- let type = element.type;
908
- if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
909
- let name = element.type;
910
- throw new Error(`Unknown element <${name}> in collection.`);
911
- }
912
- let childNodes = type.getCollectionNode(element.props, this.context);
913
- var _partialNode_index1;
914
- let index = (_partialNode_index1 = partialNode.index) !== null && _partialNode_index1 !== void 0 ? _partialNode_index1 : 0;
915
- let result = childNodes.next();
916
- while (!result.done && result.value) {
917
- let childNode = result.value;
918
- partialNode.index = index;
919
- var _childNode_key;
920
- let nodeKey = (_childNode_key = childNode.key) !== null && _childNode_key !== void 0 ? _childNode_key : null;
921
- if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
922
- let children = [...this.getFullNode({
923
- ...childNode,
924
- key: nodeKey,
925
- index,
926
- wrapper: $eb2240fc39a57fa5$var$compose(partialNode.wrapper, childNode.wrapper)
927
- }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode)];
928
- for (let node of children) {
929
- var _childNode_value, _ref;
930
- node.value = (_ref = (_childNode_value = childNode.value) !== null && _childNode_value !== void 0 ? _childNode_value : partialNode.value) !== null && _ref !== void 0 ? _ref : null;
931
- if (node.value) this.cache.set(node.value, node);
932
- var _parentNode_type;
933
- if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$eb2240fc39a57fa5$var$capitalize(node.type)}> in <${$eb2240fc39a57fa5$var$capitalize((_parentNode_type = parentNode === null || parentNode === void 0 ? void 0 : parentNode.type) !== null && _parentNode_type !== void 0 ? _parentNode_type : "unknown parent type")}>. Only <${$eb2240fc39a57fa5$var$capitalize(partialNode.type)}> is supported.`);
934
- index++;
935
- yield node;
936
- }
937
- result = childNodes.next(children);
938
- }
939
- return;
751
+ if (isValidElement(indicator)) afterIndicators.push(cloneElement(indicator, { key: `${current.key}-after` }));
752
+ current = current.parentKey != null ? collection.getItem(current.parentKey) : null;
940
753
  }
941
- if (partialNode.key == null || partialNode.type == null) return;
942
- let builder = this;
943
- var _partialNode_value, _partialNode_textValue;
944
- let node = {
945
- type: partialNode.type,
946
- props: partialNode.props,
947
- key: partialNode.key,
948
- parentKey: parentNode ? parentNode.key : null,
949
- value: (_partialNode_value = partialNode.value) !== null && _partialNode_value !== void 0 ? _partialNode_value : null,
950
- level: parentNode ? parentNode.level + 1 : 0,
951
- index: partialNode.index,
952
- rendered: partialNode.rendered,
953
- textValue: (_partialNode_textValue = partialNode.textValue) !== null && _partialNode_textValue !== void 0 ? _partialNode_textValue : "",
954
- "aria-label": partialNode["aria-label"],
955
- wrapper: partialNode.wrapper,
956
- shouldInvalidate: partialNode.shouldInvalidate,
957
- hasChildNodes: partialNode.hasChildNodes || false,
958
- childNodes: $eb2240fc39a57fa5$var$iterable(function* () {
959
- if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
960
- let index = 0;
961
- for (let child of partialNode.childNodes()) {
962
- if (child.key != null) child.key = `${node.key}${child.key}`;
963
- let nodes = builder.getFullNode({
964
- ...child,
965
- index
966
- }, builder.getChildState(state, child), node.key, node);
967
- for (let node of nodes) {
968
- index++;
969
- yield node;
970
- }
971
- }
972
- })
973
- };
974
- yield node;
975
- }
976
- constructor() {
977
- this.cache = new WeakMap();
978
754
  }
979
- };
980
- function $eb2240fc39a57fa5$var$iterable(iterator) {
981
- let cache = [];
982
- let iterable = null;
983
- return { *[Symbol.iterator]() {
984
- for (let item of cache) yield item;
985
- if (!iterable) iterable = iterator();
986
- for (let item of iterable) {
987
- cache.push(item);
988
- yield item;
989
- }
990
- } };
991
- }
992
- function $eb2240fc39a57fa5$var$compose(outer, inner) {
993
- if (outer && inner) return (element) => outer(inner(element));
994
- if (outer) return outer;
995
- if (inner) return inner;
755
+ return afterIndicators;
996
756
  }
997
- function $eb2240fc39a57fa5$var$capitalize(str) {
998
- return str[0].toUpperCase() + str.slice(1);
757
+ var $263ab7fc0f95ccdb$export$4feb769f8ddf26c5 = createContext($263ab7fc0f95ccdb$export$a164736487e3f0ae);
758
+ function $263ab7fc0f95ccdb$export$90e00781bc59d8f9(focusedKey) {
759
+ return useMemo(() => focusedKey != null ? new Set([focusedKey]) : null, [focusedKey]);
999
760
  }
1000
761
  //#endregion
1001
- //#region node_modules/@react-stately/collections/dist/useCollection.mjs
1002
- function $7613b1592d41b092$export$6cd28814d92fa9c9(props, factory, context) {
1003
- let builder = useMemo(() => new $eb2240fc39a57fa5$export$bf788dd355e3a401(), []);
1004
- let { children, items, collection } = props;
1005
- return useMemo(() => {
1006
- if (collection) return collection;
1007
- return factory(builder.build({
1008
- children,
1009
- items
1010
- }, context));
1011
- }, [
1012
- builder,
1013
- children,
1014
- items,
1015
- collection,
1016
- context,
1017
- factory
1018
- ]);
762
+ //#region node_modules/react-aria/dist/private/utils/isScrollable.mjs
763
+ function $901761b40e390936$export$2bb74740c4e19def(node, checkForOverflow) {
764
+ if (!node) return false;
765
+ let style = window.getComputedStyle(node);
766
+ let root = document.scrollingElement || document.documentElement;
767
+ let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
768
+ if (node === root && style.overflow !== "hidden") isScrollable = true;
769
+ if (isScrollable && checkForOverflow) isScrollable = node.scrollHeight !== node.clientHeight || node.scrollWidth !== node.clientWidth;
770
+ return isScrollable;
1019
771
  }
1020
772
  //#endregion
1021
- //#region node_modules/@react-stately/collections/dist/getChildNodes.mjs
1022
- function $c5a24bc478652b5f$export$1005530eda016c13(node, collection) {
1023
- if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
1024
- return node.childNodes;
1025
- }
1026
- function $c5a24bc478652b5f$export$fbdeaa6a76694f71(iterable) {
1027
- return $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable, 0);
1028
- }
1029
- function $c5a24bc478652b5f$export$5f3398f8733f90e2(iterable, index) {
1030
- if (index < 0) return void 0;
1031
- let i = 0;
1032
- for (let item of iterable) {
1033
- if (i === index) return item;
1034
- i++;
1035
- }
1036
- }
1037
- function $c5a24bc478652b5f$export$8c434b3a7a4dad6(collection, a, b) {
1038
- if (a.parentKey === b.parentKey) return a.index - b.index;
1039
- let aAncestors = [...$c5a24bc478652b5f$var$getAncestors(collection, a), a];
1040
- let bAncestors = [...$c5a24bc478652b5f$var$getAncestors(collection, b), b];
1041
- let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a, i) => a !== bAncestors[i]);
1042
- if (firstNonMatchingAncestor !== -1) {
1043
- a = aAncestors[firstNonMatchingAncestor];
1044
- b = bAncestors[firstNonMatchingAncestor];
1045
- return a.index - b.index;
1046
- }
1047
- if (aAncestors.findIndex((node) => node === b) >= 0) return 1;
1048
- else if (bAncestors.findIndex((node) => node === a) >= 0) return -1;
1049
- return -1;
1050
- }
1051
- function $c5a24bc478652b5f$var$getAncestors(collection, node) {
1052
- let parents = [];
1053
- let currNode = node;
1054
- while ((currNode === null || currNode === void 0 ? void 0 : currNode.parentKey) != null) {
1055
- currNode = collection.getItem(currNode.parentKey);
1056
- if (currNode) parents.unshift(currNode);
1057
- }
1058
- return parents;
773
+ //#region node_modules/react-aria/dist/private/utils/getScrollParents.mjs
774
+ function $76d97191f0f90600$export$94ed1c92c7beeb22(node, checkForOverflow) {
775
+ let parentElements = [];
776
+ let root = document.scrollingElement || document.documentElement;
777
+ do {
778
+ if ($901761b40e390936$export$2bb74740c4e19def(node, checkForOverflow)) parentElements.push(node);
779
+ node = node.parentElement;
780
+ } while (node && node !== root);
781
+ return parentElements;
1059
782
  }
1060
783
  //#endregion
1061
- //#region node_modules/@react-aria/collections/dist/BaseCollection.mjs
1062
- var $23b9f4fcf0fe224b$export$d68d59712b04d9d1 = class {
1063
- get childNodes() {
1064
- throw new Error("childNodes is not supported");
1065
- }
1066
- clone() {
1067
- let node = new this.constructor(this.key);
1068
- node.value = this.value;
1069
- node.level = this.level;
1070
- node.hasChildNodes = this.hasChildNodes;
1071
- node.rendered = this.rendered;
1072
- node.textValue = this.textValue;
1073
- node["aria-label"] = this["aria-label"];
1074
- node.index = this.index;
1075
- node.parentKey = this.parentKey;
1076
- node.prevKey = this.prevKey;
1077
- node.nextKey = this.nextKey;
1078
- node.firstChildKey = this.firstChildKey;
1079
- node.lastChildKey = this.lastChildKey;
1080
- node.props = this.props;
1081
- node.render = this.render;
1082
- node.colSpan = this.colSpan;
1083
- node.colIndex = this.colIndex;
1084
- return node;
1085
- }
1086
- filter(collection, newCollection, filterFn) {
1087
- let clone = this.clone();
1088
- newCollection.addDescendants(clone, collection);
1089
- return clone;
1090
- }
1091
- constructor(key) {
1092
- this.value = null;
1093
- this.level = 0;
1094
- this.hasChildNodes = false;
1095
- this.rendered = null;
1096
- this.textValue = "";
1097
- this["aria-label"] = void 0;
1098
- this.index = 0;
1099
- this.parentKey = null;
1100
- this.prevKey = null;
1101
- this.nextKey = null;
1102
- this.firstChildKey = null;
1103
- this.lastChildKey = null;
1104
- this.props = {};
1105
- this.colSpan = null;
1106
- this.colIndex = null;
1107
- this.type = this.constructor.type;
1108
- this.key = key;
784
+ //#region node_modules/react-aria/dist/private/utils/scrollIntoView.mjs
785
+ function $51a3e22a5186a962$export$53a0910f038337bd(scrollView, element, opts = {}) {
786
+ let { block = "nearest", inline = "nearest" } = opts;
787
+ if (scrollView === element) return;
788
+ let y = scrollView.scrollTop;
789
+ let x = scrollView.scrollLeft;
790
+ let target = element.getBoundingClientRect();
791
+ let view = scrollView.getBoundingClientRect();
792
+ let itemStyle = window.getComputedStyle(element);
793
+ let viewStyle = window.getComputedStyle(scrollView);
794
+ let root = document.scrollingElement || document.documentElement;
795
+ let viewTop = scrollView === root ? 0 : view.top;
796
+ let viewBottom = scrollView === root ? scrollView.clientHeight : view.bottom;
797
+ let viewLeft = scrollView === root ? 0 : view.left;
798
+ let viewRight = scrollView === root ? scrollView.clientWidth : view.right;
799
+ let scrollMarginTop = parseInt(itemStyle.scrollMarginTop, 10) || 0;
800
+ let scrollMarginBottom = parseInt(itemStyle.scrollMarginBottom, 10) || 0;
801
+ let scrollMarginLeft = parseInt(itemStyle.scrollMarginLeft, 10) || 0;
802
+ let scrollMarginRight = parseInt(itemStyle.scrollMarginRight, 10) || 0;
803
+ let scrollPaddingTop = parseInt(viewStyle.scrollPaddingTop, 10) || 0;
804
+ let scrollPaddingBottom = parseInt(viewStyle.scrollPaddingBottom, 10) || 0;
805
+ let scrollPaddingLeft = parseInt(viewStyle.scrollPaddingLeft, 10) || 0;
806
+ let scrollPaddingRight = parseInt(viewStyle.scrollPaddingRight, 10) || 0;
807
+ let borderTopWidth = parseInt(viewStyle.borderTopWidth, 10) || 0;
808
+ let borderBottomWidth = parseInt(viewStyle.borderBottomWidth, 10) || 0;
809
+ let borderLeftWidth = parseInt(viewStyle.borderLeftWidth, 10) || 0;
810
+ let borderRightWidth = parseInt(viewStyle.borderRightWidth, 10) || 0;
811
+ let scrollAreaTop = target.top - scrollMarginTop;
812
+ let scrollAreaBottom = target.bottom + scrollMarginBottom;
813
+ let scrollAreaLeft = target.left - scrollMarginLeft;
814
+ let scrollAreaRight = target.right + scrollMarginRight;
815
+ let scrollBarOffsetX = scrollView === root ? 0 : borderLeftWidth + borderRightWidth;
816
+ let scrollBarOffsetY = scrollView === root ? 0 : borderTopWidth + borderBottomWidth;
817
+ let scrollBarWidth = scrollView.offsetWidth - scrollView.clientWidth - scrollBarOffsetX;
818
+ let scrollBarHeight = scrollView.offsetHeight - scrollView.clientHeight - scrollBarOffsetY;
819
+ let scrollPortTop = viewTop + borderTopWidth + scrollPaddingTop;
820
+ let scrollPortBottom = viewBottom - borderBottomWidth - scrollPaddingBottom - scrollBarHeight;
821
+ let scrollPortLeft = viewLeft + borderLeftWidth + scrollPaddingLeft;
822
+ let scrollPortRight = viewRight - borderRightWidth - scrollPaddingRight;
823
+ if (viewStyle.direction === "rtl" && !$2add3ce32c6007eb$export$fedb369cb70207f1()) scrollPortLeft += scrollBarWidth;
824
+ else scrollPortRight -= scrollBarWidth;
825
+ let shouldScrollBlock = scrollAreaTop < scrollPortTop || scrollAreaBottom > scrollPortBottom;
826
+ let shouldScrollInline = scrollAreaLeft < scrollPortLeft || scrollAreaRight > scrollPortRight;
827
+ if (shouldScrollBlock && block === "start") y += scrollAreaTop - scrollPortTop;
828
+ else if (shouldScrollBlock && block === "center") y += (scrollAreaTop + scrollAreaBottom) / 2 - (scrollPortTop + scrollPortBottom) / 2;
829
+ else if (shouldScrollBlock && block === "end") y += scrollAreaBottom - scrollPortBottom;
830
+ else if (shouldScrollBlock && block === "nearest") {
831
+ let start = scrollAreaTop - scrollPortTop;
832
+ let end = scrollAreaBottom - scrollPortBottom;
833
+ y += Math.abs(start) <= Math.abs(end) ? start : end;
1109
834
  }
1110
- };
1111
- var $23b9f4fcf0fe224b$export$b1918e978f1ee46f = class extends $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {
1112
- filter(collection, newCollection, filterFn) {
1113
- let [firstKey, lastKey] = $23b9f4fcf0fe224b$var$filterChildren(collection, newCollection, this.firstChildKey, filterFn);
1114
- let newNode = this.clone();
1115
- newNode.firstChildKey = firstKey;
1116
- newNode.lastChildKey = lastKey;
1117
- return newNode;
835
+ if (shouldScrollInline && inline === "start") x += scrollAreaLeft - scrollPortLeft;
836
+ else if (shouldScrollInline && inline === "center") x += (scrollAreaLeft + scrollAreaRight) / 2 - (scrollPortLeft + scrollPortRight) / 2;
837
+ else if (shouldScrollInline && inline === "end") x += scrollAreaRight - scrollPortRight;
838
+ else if (shouldScrollInline && inline === "nearest") {
839
+ let start = scrollAreaLeft - scrollPortLeft;
840
+ let end = scrollAreaRight - scrollPortRight;
841
+ x += Math.abs(start) <= Math.abs(end) ? start : end;
1118
842
  }
1119
- };
1120
- var $23b9f4fcf0fe224b$export$5ae2504e948afce5 = class extends $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {};
1121
- $23b9f4fcf0fe224b$export$5ae2504e948afce5.type = "header";
1122
- var $23b9f4fcf0fe224b$export$8258a0665a675899 = class extends $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {};
1123
- $23b9f4fcf0fe224b$export$8258a0665a675899.type = "loader";
1124
- var $23b9f4fcf0fe224b$export$fd11f34e1d07f134 = class extends $23b9f4fcf0fe224b$export$b1918e978f1ee46f {
1125
- filter(collection, newCollection, filterFn) {
1126
- if (filterFn(this.textValue, this)) {
1127
- let clone = this.clone();
1128
- newCollection.addDescendants(clone, collection);
1129
- return clone;
1130
- }
1131
- return null;
843
+ if (process.env.NODE_ENV === "test") {
844
+ scrollView.scrollLeft = x;
845
+ scrollView.scrollTop = y;
846
+ return;
1132
847
  }
1133
- };
1134
- $23b9f4fcf0fe224b$export$fd11f34e1d07f134.type = "item";
1135
- var $23b9f4fcf0fe224b$export$437f11dc9b403b78 = class extends $23b9f4fcf0fe224b$export$b1918e978f1ee46f {
1136
- filter(collection, newCollection, filterFn) {
1137
- let filteredSection = super.filter(collection, newCollection, filterFn);
1138
- if (filteredSection) {
1139
- if (filteredSection.lastChildKey !== null) {
1140
- let lastChild = collection.getItem(filteredSection.lastChildKey);
1141
- if (lastChild && lastChild.type !== "header") return filteredSection;
848
+ scrollView.scrollTo({
849
+ left: x,
850
+ top: y
851
+ });
852
+ }
853
+ function $51a3e22a5186a962$export$c826860796309d1b(targetElement, opts = {}) {
854
+ let { containingElement } = opts;
855
+ if (targetElement && targetElement.isConnected) {
856
+ let root = document.scrollingElement || document.documentElement;
857
+ if (!(window.getComputedStyle(root).overflow === "hidden")) {
858
+ let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
859
+ targetElement?.scrollIntoView?.({ block: "nearest" });
860
+ let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
861
+ if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
862
+ containingElement?.scrollIntoView?.({
863
+ block: "center",
864
+ inline: "center"
865
+ });
866
+ targetElement.scrollIntoView?.({ block: "nearest" });
867
+ }
868
+ } else {
869
+ let { left: originalLeft, top: originalTop } = targetElement.getBoundingClientRect();
870
+ let scrollParents = $76d97191f0f90600$export$94ed1c92c7beeb22(targetElement, true);
871
+ for (let scrollParent of scrollParents) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, targetElement);
872
+ let { left: newLeft, top: newTop } = targetElement.getBoundingClientRect();
873
+ if (Math.abs(originalLeft - newLeft) > 1 || Math.abs(originalTop - newTop) > 1) {
874
+ scrollParents = containingElement ? $76d97191f0f90600$export$94ed1c92c7beeb22(containingElement, true) : [];
875
+ for (let scrollParent of scrollParents) $51a3e22a5186a962$export$53a0910f038337bd(scrollParent, containingElement, {
876
+ block: "center",
877
+ inline: "center"
878
+ });
1142
879
  }
1143
- }
1144
- return null;
1145
- }
1146
- };
1147
- $23b9f4fcf0fe224b$export$437f11dc9b403b78.type = "section";
1148
- var $23b9f4fcf0fe224b$export$408d25a4e12db025 = class {
1149
- get size() {
1150
- return this.itemCount;
1151
- }
1152
- getKeys() {
1153
- return this.keyMap.keys();
1154
- }
1155
- *[Symbol.iterator]() {
1156
- let node = this.firstKey != null ? this.keyMap.get(this.firstKey) : void 0;
1157
- while (node) {
1158
- yield node;
1159
- node = node.nextKey != null ? this.keyMap.get(node.nextKey) : void 0;
1160
880
  }
1161
881
  }
1162
- getChildren(key) {
1163
- let keyMap = this.keyMap;
1164
- return { *[Symbol.iterator]() {
1165
- let parent = keyMap.get(key);
1166
- let node = (parent === null || parent === void 0 ? void 0 : parent.firstChildKey) != null ? keyMap.get(parent.firstChildKey) : null;
1167
- while (node) {
1168
- yield node;
1169
- node = node.nextKey != null ? keyMap.get(node.nextKey) : void 0;
882
+ }
883
+ //#endregion
884
+ //#region node_modules/react-aria/dist/private/utils/useDescription.mjs
885
+ var $121970af65029459$var$descriptionId = 0;
886
+ var $121970af65029459$var$descriptionNodes = new Map();
887
+ function $121970af65029459$export$f8aeda7b10753fa1(description) {
888
+ let [id, setId] = useState();
889
+ $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
890
+ if (!description) return;
891
+ let desc = $121970af65029459$var$descriptionNodes.get(description);
892
+ if (!desc) {
893
+ let id = `react-aria-description-${$121970af65029459$var$descriptionId++}`;
894
+ setId(id);
895
+ let node = document.createElement("div");
896
+ node.id = id;
897
+ node.style.display = "none";
898
+ node.textContent = description;
899
+ document.body.appendChild(node);
900
+ desc = {
901
+ refCount: 0,
902
+ element: node
903
+ };
904
+ $121970af65029459$var$descriptionNodes.set(description, desc);
905
+ } else setId(desc.element.id);
906
+ desc.refCount++;
907
+ return () => {
908
+ if (desc && --desc.refCount === 0) {
909
+ desc.element.remove();
910
+ $121970af65029459$var$descriptionNodes.delete(description);
1170
911
  }
1171
- } };
1172
- }
1173
- getKeyBefore(key) {
1174
- let node = this.keyMap.get(key);
1175
- if (!node) return null;
1176
- if (node.prevKey != null) {
1177
- node = this.keyMap.get(node.prevKey);
1178
- while (node && node.type !== "item" && node.lastChildKey != null) node = this.keyMap.get(node.lastChildKey);
1179
- var _node_key;
1180
- return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
1181
- }
1182
- return node.parentKey;
1183
- }
1184
- getKeyAfter(key) {
1185
- let node = this.keyMap.get(key);
1186
- if (!node) return null;
1187
- if (node.type !== "item" && node.firstChildKey != null) return node.firstChildKey;
1188
- while (node) {
1189
- if (node.nextKey != null) return node.nextKey;
1190
- if (node.parentKey != null) node = this.keyMap.get(node.parentKey);
1191
- else return null;
912
+ };
913
+ }, [description]);
914
+ return { "aria-describedby": description ? id : void 0 };
915
+ }
916
+ //#endregion
917
+ //#region node_modules/react-aria/dist/private/selection/utils.mjs
918
+ function $22bbea12c2567021$export$d3e3bd3e26688c04(e) {
919
+ return $2add3ce32c6007eb$export$e1865c3bedcd822b() ? e.altKey : e.ctrlKey;
920
+ }
921
+ function $22bbea12c2567021$export$c3d8340acf92597f(collectionRef, key) {
922
+ let selector = `[data-key="${CSS.escape(String(key))}"]`;
923
+ let collection = collectionRef.current?.dataset.collection;
924
+ if (collection) selector = `[data-collection="${CSS.escape(collection)}"]${selector}`;
925
+ return collectionRef.current?.querySelector(selector);
926
+ }
927
+ var $22bbea12c2567021$var$collectionMap = new WeakMap();
928
+ function $22bbea12c2567021$export$881eb0d9f3605d9d(collection) {
929
+ let id = $390e54f620492c70$export$f680877a34711e37();
930
+ $22bbea12c2567021$var$collectionMap.set(collection, id);
931
+ return id;
932
+ }
933
+ function $22bbea12c2567021$export$6aeb1680a0ae8741(collection) {
934
+ return $22bbea12c2567021$var$collectionMap.get(collection);
935
+ }
936
+ //#endregion
937
+ //#region node_modules/react-aria/dist/private/selection/useTypeSelect.mjs
938
+ /**
939
+ * Controls how long to wait before clearing the typeahead buffer.
940
+ */ var $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS = 1e3;
941
+ function $f5a4a9a3486154da$export$e32c88dfddc6e1d8(options) {
942
+ let { keyboardDelegate, selectionManager, onTypeSelect } = options;
943
+ let state = useRef({
944
+ search: "",
945
+ timeout: void 0
946
+ }).current;
947
+ let onKeyDown = (e) => {
948
+ let character = $f5a4a9a3486154da$var$getStringForKey(e.key);
949
+ if (!character || e.ctrlKey || e.metaKey || !$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e)) || state.search.length === 0 && character === " ") return;
950
+ if (character === " " && state.search.trim().length > 0) {
951
+ e.preventDefault();
952
+ if (!("continuePropagation" in e)) e.stopPropagation();
1192
953
  }
1193
- return null;
1194
- }
1195
- getFirstKey() {
1196
- return this.firstKey;
1197
- }
1198
- getLastKey() {
1199
- let node = this.lastKey != null ? this.keyMap.get(this.lastKey) : null;
1200
- while ((node === null || node === void 0 ? void 0 : node.lastChildKey) != null) node = this.keyMap.get(node.lastChildKey);
1201
- var _node_key;
1202
- return (_node_key = node === null || node === void 0 ? void 0 : node.key) !== null && _node_key !== void 0 ? _node_key : null;
1203
- }
1204
- getItem(key) {
1205
- var _this_keyMap_get;
1206
- return (_this_keyMap_get = this.keyMap.get(key)) !== null && _this_keyMap_get !== void 0 ? _this_keyMap_get : null;
1207
- }
1208
- at() {
1209
- throw new Error("Not implemented");
1210
- }
1211
- clone() {
1212
- let Constructor = this.constructor;
1213
- let collection = new Constructor();
1214
- collection.keyMap = new Map(this.keyMap);
1215
- collection.firstKey = this.firstKey;
1216
- collection.lastKey = this.lastKey;
1217
- collection.itemCount = this.itemCount;
1218
- return collection;
1219
- }
1220
- addNode(node) {
1221
- if (this.frozen) throw new Error("Cannot add a node to a frozen collection");
1222
- if (node.type === "item" && this.keyMap.get(node.key) == null) this.itemCount++;
1223
- this.keyMap.set(node.key, node);
1224
- }
1225
- addDescendants(node, oldCollection) {
1226
- this.addNode(node);
1227
- let children = oldCollection.getChildren(node.key);
1228
- for (let child of children) this.addDescendants(child, oldCollection);
1229
- }
1230
- removeNode(key) {
1231
- if (this.frozen) throw new Error("Cannot remove a node to a frozen collection");
1232
- let node = this.keyMap.get(key);
1233
- if (node != null && node.type === "item") this.itemCount--;
1234
- this.keyMap.delete(key);
1235
- }
1236
- commit(firstKey, lastKey, isSSR = false) {
1237
- if (this.frozen) throw new Error("Cannot commit a frozen collection");
1238
- this.firstKey = firstKey;
1239
- this.lastKey = lastKey;
1240
- this.frozen = !isSSR;
1241
- }
1242
- filter(filterFn) {
1243
- let newCollection = new this.constructor();
1244
- let [firstKey, lastKey] = $23b9f4fcf0fe224b$var$filterChildren(this, newCollection, this.firstKey, filterFn);
1245
- newCollection === null || newCollection === void 0 || newCollection.commit(firstKey, lastKey);
1246
- return newCollection;
1247
- }
1248
- constructor() {
1249
- this.keyMap = new Map();
1250
- this.firstKey = null;
1251
- this.lastKey = null;
1252
- this.frozen = false;
1253
- this.itemCount = 0;
1254
- }
1255
- };
1256
- function $23b9f4fcf0fe224b$var$filterChildren(collection, newCollection, firstChildKey, filterFn) {
1257
- if (firstChildKey == null) return [null, null];
1258
- let firstNode = null;
1259
- let lastNode = null;
1260
- let currentNode = collection.getItem(firstChildKey);
1261
- while (currentNode != null) {
1262
- let newNode = currentNode.filter(collection, newCollection, filterFn);
1263
- if (newNode != null) {
1264
- newNode.nextKey = null;
1265
- if (lastNode) {
1266
- newNode.prevKey = lastNode.key;
1267
- lastNode.nextKey = newNode.key;
954
+ state.search += character;
955
+ if (keyboardDelegate.getKeyForSearch != null) {
956
+ let key = keyboardDelegate.getKeyForSearch(state.search, selectionManager.focusedKey);
957
+ if (key == null) key = keyboardDelegate.getKeyForSearch(state.search);
958
+ if (key != null) {
959
+ selectionManager.setFocusedKey(key);
960
+ if (onTypeSelect) onTypeSelect(key);
1268
961
  }
1269
- if (firstNode == null) firstNode = newNode;
1270
- newCollection.addNode(newNode);
1271
- lastNode = newNode;
1272
962
  }
1273
- currentNode = currentNode.nextKey ? collection.getItem(currentNode.nextKey) : null;
1274
- }
1275
- if (lastNode && lastNode.type === "separator") {
1276
- let prevKey = lastNode.prevKey;
1277
- newCollection.removeNode(lastNode.key);
1278
- if (prevKey) {
1279
- lastNode = newCollection.getItem(prevKey);
1280
- lastNode.nextKey = null;
1281
- } else lastNode = null;
1282
- }
1283
- var _firstNode_key, _lastNode_key;
1284
- return [(_firstNode_key = firstNode === null || firstNode === void 0 ? void 0 : firstNode.key) !== null && _firstNode_key !== void 0 ? _firstNode_key : null, (_lastNode_key = lastNode === null || lastNode === void 0 ? void 0 : lastNode.key) !== null && _lastNode_key !== void 0 ? _lastNode_key : null];
963
+ clearTimeout(state.timeout);
964
+ state.timeout = setTimeout(() => {
965
+ state.search = "";
966
+ }, $f5a4a9a3486154da$var$TYPEAHEAD_DEBOUNCE_WAIT_MS);
967
+ };
968
+ return { typeSelectProps: { onKeyDownCapture: keyboardDelegate.getKeyForSearch ? onKeyDown : void 0 } };
969
+ }
970
+ function $f5a4a9a3486154da$var$getStringForKey(key) {
971
+ if (key.length === 1 || !/^[A-Z]/i.test(key)) return key;
972
+ return "";
1285
973
  }
1286
974
  //#endregion
1287
- //#region node_modules/@react-aria/collections/dist/Document.mjs
1288
- var $681cc3c98f569e39$export$410b0c854570d131 = class {
1289
- *[Symbol.iterator]() {
1290
- let node = this.firstChild;
1291
- while (node) {
1292
- yield node;
1293
- node = node.nextSibling;
1294
- }
1295
- }
1296
- get firstChild() {
1297
- return this._firstChild;
1298
- }
1299
- set firstChild(firstChild) {
1300
- this._firstChild = firstChild;
1301
- this.ownerDocument.markDirty(this);
1302
- }
1303
- get lastChild() {
1304
- return this._lastChild;
1305
- }
1306
- set lastChild(lastChild) {
1307
- this._lastChild = lastChild;
1308
- this.ownerDocument.markDirty(this);
1309
- }
1310
- get previousSibling() {
1311
- return this._previousSibling;
1312
- }
1313
- set previousSibling(previousSibling) {
1314
- this._previousSibling = previousSibling;
1315
- this.ownerDocument.markDirty(this);
1316
- }
1317
- get nextSibling() {
1318
- return this._nextSibling;
1319
- }
1320
- set nextSibling(nextSibling) {
1321
- this._nextSibling = nextSibling;
1322
- this.ownerDocument.markDirty(this);
1323
- }
1324
- get parentNode() {
1325
- return this._parentNode;
1326
- }
1327
- set parentNode(parentNode) {
1328
- this._parentNode = parentNode;
1329
- this.ownerDocument.markDirty(this);
1330
- }
1331
- get isConnected() {
1332
- var _this_parentNode;
1333
- return ((_this_parentNode = this.parentNode) === null || _this_parentNode === void 0 ? void 0 : _this_parentNode.isConnected) || false;
1334
- }
1335
- invalidateChildIndices(child) {
1336
- if (this._minInvalidChildIndex == null || !this._minInvalidChildIndex.isConnected || child.index < this._minInvalidChildIndex.index) {
1337
- this._minInvalidChildIndex = child;
1338
- this.ownerDocument.markDirty(this);
1339
- }
1340
- }
1341
- updateChildIndices() {
1342
- let node = this._minInvalidChildIndex;
1343
- while (node) {
1344
- node.index = node.previousSibling ? node.previousSibling.index + 1 : 0;
1345
- node = node.nextSibling;
1346
- }
1347
- this._minInvalidChildIndex = null;
1348
- }
1349
- appendChild(child) {
1350
- if (child.parentNode) child.parentNode.removeChild(child);
1351
- if (this.firstChild == null) this.firstChild = child;
1352
- if (this.lastChild) {
1353
- this.lastChild.nextSibling = child;
1354
- child.index = this.lastChild.index + 1;
1355
- child.previousSibling = this.lastChild;
1356
- } else {
1357
- child.previousSibling = null;
1358
- child.index = 0;
1359
- }
1360
- child.parentNode = this;
1361
- child.nextSibling = null;
1362
- this.lastChild = child;
1363
- this.ownerDocument.markDirty(this);
1364
- if (this.isConnected) this.ownerDocument.queueUpdate();
1365
- }
1366
- insertBefore(newNode, referenceNode) {
1367
- if (referenceNode == null) return this.appendChild(newNode);
1368
- if (newNode.parentNode) newNode.parentNode.removeChild(newNode);
1369
- newNode.nextSibling = referenceNode;
1370
- newNode.previousSibling = referenceNode.previousSibling;
1371
- newNode.index = referenceNode.index - 1;
1372
- if (this.firstChild === referenceNode) this.firstChild = newNode;
1373
- else if (referenceNode.previousSibling) referenceNode.previousSibling.nextSibling = newNode;
1374
- referenceNode.previousSibling = newNode;
1375
- newNode.parentNode = referenceNode.parentNode;
1376
- this.invalidateChildIndices(newNode);
1377
- if (this.isConnected) this.ownerDocument.queueUpdate();
1378
- }
1379
- removeChild(child) {
1380
- if (child.parentNode !== this) return;
1381
- if (this._minInvalidChildIndex === child) this._minInvalidChildIndex = null;
1382
- if (child.nextSibling) {
1383
- this.invalidateChildIndices(child.nextSibling);
1384
- child.nextSibling.previousSibling = child.previousSibling;
1385
- }
1386
- if (child.previousSibling) child.previousSibling.nextSibling = child.nextSibling;
1387
- if (this.firstChild === child) this.firstChild = child.nextSibling;
1388
- if (this.lastChild === child) this.lastChild = child.previousSibling;
1389
- child.parentNode = null;
1390
- child.nextSibling = null;
1391
- child.previousSibling = null;
1392
- child.index = 0;
1393
- this.ownerDocument.markDirty(child);
1394
- if (this.isConnected) this.ownerDocument.queueUpdate();
1395
- }
1396
- addEventListener() {}
1397
- removeEventListener() {}
1398
- get previousVisibleSibling() {
1399
- let node = this.previousSibling;
1400
- while (node && node.isHidden) node = node.previousSibling;
1401
- return node;
1402
- }
1403
- get nextVisibleSibling() {
1404
- let node = this.nextSibling;
1405
- while (node && node.isHidden) node = node.nextSibling;
1406
- return node;
1407
- }
1408
- get firstVisibleChild() {
1409
- let node = this.firstChild;
1410
- while (node && node.isHidden) node = node.nextSibling;
1411
- return node;
1412
- }
1413
- get lastVisibleChild() {
1414
- let node = this.lastChild;
1415
- while (node && node.isHidden) node = node.previousSibling;
1416
- return node;
1417
- }
1418
- constructor(ownerDocument) {
1419
- this._firstChild = null;
1420
- this._lastChild = null;
1421
- this._previousSibling = null;
1422
- this._nextSibling = null;
1423
- this._parentNode = null;
1424
- this._minInvalidChildIndex = null;
1425
- this.ownerDocument = ownerDocument;
1426
- }
1427
- };
1428
- var $681cc3c98f569e39$export$dc064fe9e59310fd = class $681cc3c98f569e39$export$dc064fe9e59310fd extends $681cc3c98f569e39$export$410b0c854570d131 {
1429
- get index() {
1430
- return this._index;
1431
- }
1432
- set index(index) {
1433
- this._index = index;
1434
- this.ownerDocument.markDirty(this);
1435
- }
1436
- get level() {
1437
- var _this_parentNode_node;
1438
- if (this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) return this.parentNode.level + (((_this_parentNode_node = this.parentNode.node) === null || _this_parentNode_node === void 0 ? void 0 : _this_parentNode_node.type) === "item" ? 1 : 0);
1439
- return 0;
1440
- }
1441
- /**
1442
- * Lazily gets a mutable instance of a Node. If the node has already
1443
- * been cloned during this update cycle, it just returns the existing one.
1444
- */ getMutableNode() {
1445
- if (this.node == null) return null;
1446
- if (!this.isMutated) {
1447
- this.node = this.node.clone();
1448
- this.isMutated = true;
975
+ //#region node_modules/react-aria/dist/private/utils/useUpdateLayoutEffect.mjs
976
+ function $a475cdc2445827b5$export$72ef708ab07251f1(effect, dependencies) {
977
+ const isInitialMount = useRef(true);
978
+ const lastDeps = useRef(null);
979
+ $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
980
+ isInitialMount.current = true;
981
+ return () => {
982
+ isInitialMount.current = false;
983
+ };
984
+ }, []);
985
+ $c4867b2f328c2698$export$e5c5a5f917a5871c(() => {
986
+ if (isInitialMount.current) isInitialMount.current = false;
987
+ else if (!lastDeps.current || dependencies.some((dep, i) => !Object.is(dep, lastDeps[i]))) effect();
988
+ lastDeps.current = dependencies;
989
+ }, dependencies);
990
+ }
991
+ //#endregion
992
+ //#region node_modules/react-aria/dist/private/selection/useSelectableCollection.mjs
993
+ function $d667c2af82d35a98$export$d6daf82dcd84e87c(options) {
994
+ 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" } = options;
995
+ let { direction } = $2eb8e6d23f3d0cb0$export$43bb16f9c6d9e3f7();
996
+ let router = $caaf0dd3060ed57c$export$9a302a45f65d0572();
997
+ let onKeyDown = (e) => {
998
+ if (e.altKey && e.key === "Tab") e.preventDefault();
999
+ if (!ref.current || !$23f2114a1b82827e$export$4282f70798064fe0(ref.current, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
1000
+ const navigateToKey = (key, childFocus) => {
1001
+ if (key != null) {
1002
+ if (manager.isLink(key) && linkBehavior === "selection" && selectOnFocus && !$22bbea12c2567021$export$d3e3bd3e26688c04(e)) {
1003
+ flushSync(() => {
1004
+ manager.setFocusedKey(key, childFocus);
1005
+ });
1006
+ let item = $22bbea12c2567021$export$c3d8340acf92597f(ref, key);
1007
+ let itemProps = manager.getItemProps(key);
1008
+ if (item) router.open(item, e, itemProps.href, itemProps.routerOptions);
1009
+ return;
1010
+ }
1011
+ manager.setFocusedKey(key, childFocus);
1012
+ if (manager.isLink(key) && linkBehavior === "override") return;
1013
+ if (e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(key);
1014
+ else if (selectOnFocus && !$22bbea12c2567021$export$d3e3bd3e26688c04(e)) manager.replaceSelection(key);
1015
+ }
1016
+ };
1017
+ switch (e.key) {
1018
+ case "ArrowDown":
1019
+ if (delegate.getKeyBelow) {
1020
+ let nextKey = manager.focusedKey != null ? delegate.getKeyBelow?.(manager.focusedKey) : delegate.getFirstKey?.();
1021
+ if (nextKey == null && shouldFocusWrap) nextKey = delegate.getFirstKey?.(manager.focusedKey);
1022
+ if (nextKey != null) {
1023
+ e.preventDefault();
1024
+ navigateToKey(nextKey);
1025
+ }
1026
+ }
1027
+ break;
1028
+ case "ArrowUp":
1029
+ if (delegate.getKeyAbove) {
1030
+ let nextKey = manager.focusedKey != null ? delegate.getKeyAbove?.(manager.focusedKey) : delegate.getLastKey?.();
1031
+ if (nextKey == null && shouldFocusWrap) nextKey = delegate.getLastKey?.(manager.focusedKey);
1032
+ if (nextKey != null) {
1033
+ e.preventDefault();
1034
+ navigateToKey(nextKey);
1035
+ }
1036
+ }
1037
+ break;
1038
+ case "ArrowLeft":
1039
+ if (delegate.getKeyLeftOf) {
1040
+ let nextKey = manager.focusedKey != null ? delegate.getKeyLeftOf?.(manager.focusedKey) : delegate.getFirstKey?.();
1041
+ if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? delegate.getFirstKey?.(manager.focusedKey) : delegate.getLastKey?.(manager.focusedKey);
1042
+ if (nextKey != null) {
1043
+ e.preventDefault();
1044
+ navigateToKey(nextKey, direction === "rtl" ? "first" : "last");
1045
+ }
1046
+ }
1047
+ break;
1048
+ case "ArrowRight":
1049
+ if (delegate.getKeyRightOf) {
1050
+ let nextKey = manager.focusedKey != null ? delegate.getKeyRightOf?.(manager.focusedKey) : delegate.getFirstKey?.();
1051
+ if (nextKey == null && shouldFocusWrap) nextKey = direction === "rtl" ? delegate.getLastKey?.(manager.focusedKey) : delegate.getFirstKey?.(manager.focusedKey);
1052
+ if (nextKey != null) {
1053
+ e.preventDefault();
1054
+ navigateToKey(nextKey, direction === "rtl" ? "last" : "first");
1055
+ }
1056
+ }
1057
+ break;
1058
+ case "Home":
1059
+ if (delegate.getFirstKey) {
1060
+ if (manager.focusedKey === null && e.shiftKey) return;
1061
+ e.preventDefault();
1062
+ let firstKey = delegate.getFirstKey(manager.focusedKey, $bb39c0fc1c19b34c$export$16792effe837dba3(e));
1063
+ manager.setFocusedKey(firstKey);
1064
+ if (firstKey != null) {
1065
+ if ($bb39c0fc1c19b34c$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(firstKey);
1066
+ else if (selectOnFocus) manager.replaceSelection(firstKey);
1067
+ }
1068
+ }
1069
+ break;
1070
+ case "End":
1071
+ if (delegate.getLastKey) {
1072
+ if (manager.focusedKey === null && e.shiftKey) return;
1073
+ e.preventDefault();
1074
+ let lastKey = delegate.getLastKey(manager.focusedKey, $bb39c0fc1c19b34c$export$16792effe837dba3(e));
1075
+ manager.setFocusedKey(lastKey);
1076
+ if (lastKey != null) {
1077
+ if ($bb39c0fc1c19b34c$export$16792effe837dba3(e) && e.shiftKey && manager.selectionMode === "multiple") manager.extendSelection(lastKey);
1078
+ else if (selectOnFocus) manager.replaceSelection(lastKey);
1079
+ }
1080
+ }
1081
+ break;
1082
+ case "PageDown":
1083
+ if (delegate.getKeyPageBelow && manager.focusedKey != null) {
1084
+ let nextKey = delegate.getKeyPageBelow(manager.focusedKey);
1085
+ if (nextKey != null) {
1086
+ e.preventDefault();
1087
+ navigateToKey(nextKey);
1088
+ }
1089
+ }
1090
+ break;
1091
+ case "PageUp":
1092
+ if (delegate.getKeyPageAbove && manager.focusedKey != null) {
1093
+ let nextKey = delegate.getKeyPageAbove(manager.focusedKey);
1094
+ if (nextKey != null) {
1095
+ e.preventDefault();
1096
+ navigateToKey(nextKey);
1097
+ }
1098
+ }
1099
+ break;
1100
+ case "a":
1101
+ if ($bb39c0fc1c19b34c$export$16792effe837dba3(e) && manager.selectionMode === "multiple" && disallowSelectAll !== true) {
1102
+ e.preventDefault();
1103
+ manager.selectAll();
1104
+ }
1105
+ break;
1106
+ case "Escape":
1107
+ if (escapeKeyBehavior === "clearSelection" && !disallowEmptySelection && manager.selectedKeys.size !== 0) {
1108
+ e.stopPropagation();
1109
+ e.preventDefault();
1110
+ manager.clearSelection();
1111
+ }
1112
+ break;
1113
+ case "Tab": if (!allowsTabNavigation) {
1114
+ if (e.shiftKey) ref.current.focus();
1115
+ else {
1116
+ let walker = $535772f9d2c1f38d$export$2d6ec8fc375ceafa(ref.current, { tabbable: true });
1117
+ let next = void 0;
1118
+ let last;
1119
+ do {
1120
+ last = walker.lastChild();
1121
+ if (last) next = last;
1122
+ } while (last);
1123
+ let activeElement = $23f2114a1b82827e$export$cd4e5573fbe2b576();
1124
+ if (next && (!$23f2114a1b82827e$export$b4f377a2b6254582(next) || activeElement && !$3b8b240c1bf84ab9$export$bebd5a1431fec25d(activeElement))) $1969ac565cfec8d0$export$de79e2c695e052f3(next);
1125
+ }
1126
+ break;
1127
+ }
1449
1128
  }
1450
- this.ownerDocument.markDirty(this);
1451
- return this.node;
1452
- }
1453
- updateNode() {
1454
- var _this_parentNode_node, _this_previousVisibleSibling_node, _this_previousVisibleSibling, _nextSibling_node, _this_firstVisibleChild_node, _this_firstVisibleChild, _this_lastVisibleChild_node, _this_lastVisibleChild;
1455
- let nextSibling = this.nextVisibleSibling;
1456
- let node = this.getMutableNode();
1457
- if (node == null) return;
1458
- node.index = this.index;
1459
- node.level = this.level;
1460
- var _this_parentNode_node_key;
1461
- node.parentKey = this.parentNode instanceof $681cc3c98f569e39$export$dc064fe9e59310fd ? (_this_parentNode_node_key = (_this_parentNode_node = this.parentNode.node) === null || _this_parentNode_node === void 0 ? void 0 : _this_parentNode_node.key) !== null && _this_parentNode_node_key !== void 0 ? _this_parentNode_node_key : null : null;
1462
- var _this_previousVisibleSibling_node_key;
1463
- node.prevKey = (_this_previousVisibleSibling_node_key = (_this_previousVisibleSibling = this.previousVisibleSibling) === null || _this_previousVisibleSibling === void 0 ? void 0 : (_this_previousVisibleSibling_node = _this_previousVisibleSibling.node) === null || _this_previousVisibleSibling_node === void 0 ? void 0 : _this_previousVisibleSibling_node.key) !== null && _this_previousVisibleSibling_node_key !== void 0 ? _this_previousVisibleSibling_node_key : null;
1464
- var _nextSibling_node_key;
1465
- node.nextKey = (_nextSibling_node_key = nextSibling === null || nextSibling === void 0 ? void 0 : (_nextSibling_node = nextSibling.node) === null || _nextSibling_node === void 0 ? void 0 : _nextSibling_node.key) !== null && _nextSibling_node_key !== void 0 ? _nextSibling_node_key : null;
1466
- node.hasChildNodes = !!this.firstChild;
1467
- var _this_firstVisibleChild_node_key;
1468
- node.firstChildKey = (_this_firstVisibleChild_node_key = (_this_firstVisibleChild = this.firstVisibleChild) === null || _this_firstVisibleChild === void 0 ? void 0 : (_this_firstVisibleChild_node = _this_firstVisibleChild.node) === null || _this_firstVisibleChild_node === void 0 ? void 0 : _this_firstVisibleChild_node.key) !== null && _this_firstVisibleChild_node_key !== void 0 ? _this_firstVisibleChild_node_key : null;
1469
- var _this_lastVisibleChild_node_key;
1470
- node.lastChildKey = (_this_lastVisibleChild_node_key = (_this_lastVisibleChild = this.lastVisibleChild) === null || _this_lastVisibleChild === void 0 ? void 0 : (_this_lastVisibleChild_node = _this_lastVisibleChild.node) === null || _this_lastVisibleChild_node === void 0 ? void 0 : _this_lastVisibleChild_node.key) !== null && _this_lastVisibleChild_node_key !== void 0 ? _this_lastVisibleChild_node_key : null;
1471
- if ((node.colSpan != null || node.colIndex != null) && nextSibling) {
1472
- var _node_colIndex, _node_colSpan;
1473
- let nextColIndex = ((_node_colIndex = node.colIndex) !== null && _node_colIndex !== void 0 ? _node_colIndex : node.index) + ((_node_colSpan = node.colSpan) !== null && _node_colSpan !== void 0 ? _node_colSpan : 1);
1474
- if (nextSibling.node != null && nextColIndex !== nextSibling.node.colIndex) {
1475
- let siblingNode = nextSibling.getMutableNode();
1476
- siblingNode.colIndex = nextColIndex;
1129
+ };
1130
+ let scrollPos = useRef({
1131
+ top: 0,
1132
+ left: 0
1133
+ });
1134
+ $600b3cf69ae46262$export$90fc3a17d93f704c(scrollRef, "scroll", () => {
1135
+ scrollPos.current = {
1136
+ top: scrollRef.current?.scrollTop ?? 0,
1137
+ left: scrollRef.current?.scrollLeft ?? 0
1138
+ };
1139
+ });
1140
+ let onFocus = (e) => {
1141
+ if (manager.isFocused) {
1142
+ if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) manager.setFocused(false);
1143
+ return;
1144
+ }
1145
+ if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, $23f2114a1b82827e$export$e58f029f0fbfdb29(e))) return;
1146
+ manager.setFocused(true);
1147
+ if (manager.focusedKey == null) {
1148
+ let navigateToKey = (key) => {
1149
+ if (key != null) {
1150
+ manager.setFocusedKey(key);
1151
+ if (selectOnFocus && !manager.isSelected(key)) manager.replaceSelection(key);
1152
+ }
1153
+ };
1154
+ let relatedTarget = e.relatedTarget;
1155
+ if (relatedTarget && e.currentTarget.compareDocumentPosition(relatedTarget) & Node.DOCUMENT_POSITION_FOLLOWING) navigateToKey(manager.lastSelectedKey ?? delegate.getLastKey?.());
1156
+ else navigateToKey(manager.firstSelectedKey ?? delegate.getFirstKey?.());
1157
+ } else if (scrollRef.current) {
1158
+ scrollRef.current.scrollTop = scrollPos.current.top;
1159
+ scrollRef.current.scrollLeft = scrollPos.current.left;
1160
+ }
1161
+ if (manager.focusedKey != null && scrollRef.current) {
1162
+ let element = $22bbea12c2567021$export$c3d8340acf92597f(ref, manager.focusedKey);
1163
+ if (element instanceof HTMLElement) {
1164
+ if (!$23f2114a1b82827e$export$b4f377a2b6254582(element) && !shouldUseVirtualFocus) $1969ac565cfec8d0$export$de79e2c695e052f3(element);
1165
+ if ($8f5a2122b0992be3$export$630ff653c5ada6a9() === "keyboard") $51a3e22a5186a962$export$c826860796309d1b(element, { containingElement: ref.current });
1477
1166
  }
1478
1167
  }
1479
- }
1480
- setProps(obj, ref, CollectionNodeClass, rendered, render) {
1481
- let node;
1482
- let { value: value1, textValue, id, ...props } = obj;
1483
- if (this.node == null) {
1484
- node = new CollectionNodeClass(id !== null && id !== void 0 ? id : `react-aria-${++this.ownerDocument.nodeId}`);
1485
- this.node = node;
1486
- } else node = this.getMutableNode();
1487
- props.ref = ref;
1488
- node.props = props;
1489
- node.rendered = rendered;
1490
- node.render = render;
1491
- node.value = value1;
1492
- if (obj["aria-label"]) node["aria-label"] = obj["aria-label"];
1493
- node.textValue = textValue || (typeof props.children === "string" ? props.children : "") || obj["aria-label"] || "";
1494
- if (id != null && id !== node.key) throw new Error("Cannot change the id of an item");
1495
- if (props.colSpan != null) node.colSpan = props.colSpan;
1496
- if (this.isConnected) this.ownerDocument.queueUpdate();
1497
- }
1498
- get style() {
1499
- let element = this;
1500
- return {
1501
- get display() {
1502
- return element.isHidden ? "none" : "";
1503
- },
1504
- set display(value) {
1505
- let isHidden = value === "none";
1506
- if (element.isHidden !== isHidden) {
1507
- var _element_parentNode, _element_parentNode1;
1508
- if (((_element_parentNode = element.parentNode) === null || _element_parentNode === void 0 ? void 0 : _element_parentNode.firstVisibleChild) === element || ((_element_parentNode1 = element.parentNode) === null || _element_parentNode1 === void 0 ? void 0 : _element_parentNode1.lastVisibleChild) === element) element.ownerDocument.markDirty(element.parentNode);
1509
- let prev = element.previousVisibleSibling;
1510
- let next = element.nextVisibleSibling;
1511
- if (prev) element.ownerDocument.markDirty(prev);
1512
- if (next) element.ownerDocument.markDirty(next);
1513
- element.isHidden = isHidden;
1514
- element.ownerDocument.markDirty(element);
1168
+ };
1169
+ let onBlur = (e) => {
1170
+ if (!$23f2114a1b82827e$export$4282f70798064fe0(e.currentTarget, e.relatedTarget)) manager.setFocused(false);
1171
+ };
1172
+ let shouldVirtualFocusFirst = useRef(false);
1173
+ $600b3cf69ae46262$export$90fc3a17d93f704c(ref, $8b2399d051d06d4c$export$831c820ad60f9d12, !shouldUseVirtualFocus ? void 0 : (e) => {
1174
+ let { detail } = e;
1175
+ e.stopPropagation();
1176
+ manager.setFocused(true);
1177
+ if (detail?.focusStrategy === "first") shouldVirtualFocusFirst.current = true;
1178
+ });
1179
+ $a475cdc2445827b5$export$72ef708ab07251f1(() => {
1180
+ if (shouldVirtualFocusFirst.current) {
1181
+ let keyToFocus = delegate.getFirstKey?.() ?? null;
1182
+ if (keyToFocus == null) {
1183
+ let previousActiveElement = $23f2114a1b82827e$export$cd4e5573fbe2b576();
1184
+ $b72f3f7b3b5f42c6$export$76e4e37e5339496d(ref.current);
1185
+ $b72f3f7b3b5f42c6$export$2b35b76d2e30e129(previousActiveElement, null);
1186
+ if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
1187
+ } else {
1188
+ manager.setFocusedKey(keyToFocus);
1189
+ shouldVirtualFocusFirst.current = false;
1190
+ }
1191
+ }
1192
+ }, [manager.collection]);
1193
+ $a475cdc2445827b5$export$72ef708ab07251f1(() => {
1194
+ if (manager.collection.size > 0) shouldVirtualFocusFirst.current = false;
1195
+ }, [manager.focusedKey]);
1196
+ $600b3cf69ae46262$export$90fc3a17d93f704c(ref, $8b2399d051d06d4c$export$447a38995de2c711, !shouldUseVirtualFocus ? void 0 : (e) => {
1197
+ e.stopPropagation();
1198
+ manager.setFocused(false);
1199
+ if (e.detail?.clearFocusKey) manager.setFocusedKey(null);
1200
+ });
1201
+ const autoFocusRef = useRef(autoFocus);
1202
+ const didAutoFocusRef = useRef(false);
1203
+ useEffect(() => {
1204
+ if (autoFocusRef.current) {
1205
+ let focusedKey = null;
1206
+ if (autoFocus === "first") focusedKey = delegate.getFirstKey?.() ?? null;
1207
+ if (autoFocus === "last") focusedKey = delegate.getLastKey?.() ?? null;
1208
+ let selectedKeys = manager.selectedKeys;
1209
+ if (selectedKeys.size) {
1210
+ for (let key of selectedKeys) if (manager.canSelectItem(key)) {
1211
+ focusedKey = key;
1212
+ break;
1515
1213
  }
1516
1214
  }
1517
- };
1518
- }
1519
- hasAttribute() {}
1520
- setAttribute() {}
1521
- setAttributeNS() {}
1522
- removeAttribute() {}
1523
- constructor(type, ownerDocument) {
1524
- super(ownerDocument), this.nodeType = 8, this.isMutated = true, this._index = 0, this.isHidden = false;
1525
- this.node = null;
1526
- }
1527
- };
1528
- var $681cc3c98f569e39$export$b34a105447964f9f = class extends $681cc3c98f569e39$export$410b0c854570d131 {
1529
- get isConnected() {
1530
- return true;
1531
- }
1532
- createElement(type) {
1533
- return new $681cc3c98f569e39$export$dc064fe9e59310fd(type, this);
1534
- }
1535
- getMutableCollection() {
1536
- if (!this.nextCollection) this.nextCollection = this.collection.clone();
1537
- return this.nextCollection;
1538
- }
1539
- markDirty(node) {
1540
- this.dirtyNodes.add(node);
1541
- }
1542
- addNode(element) {
1543
- if (element.isHidden || element.node == null) return;
1544
- let collection = this.getMutableCollection();
1545
- if (!collection.getItem(element.node.key)) for (let child of element) this.addNode(child);
1546
- collection.addNode(element.node);
1547
- }
1548
- removeNode(node) {
1549
- for (let child of node) this.removeNode(child);
1550
- if (node.node) this.getMutableCollection().removeNode(node.node.key);
1551
- }
1552
- /** Finalizes the collection update, updating all nodes and freezing the collection. */ getCollection() {
1553
- if (this.inSubscription) return this.collection;
1554
- this.queuedRender = false;
1555
- this.updateCollection();
1556
- return this.collection;
1557
- }
1558
- updateCollection() {
1559
- for (let element of this.dirtyNodes) if (element instanceof $681cc3c98f569e39$export$dc064fe9e59310fd && (!element.isConnected || element.isHidden)) this.removeNode(element);
1560
- else element.updateChildIndices();
1561
- for (let element of this.dirtyNodes) if (element instanceof $681cc3c98f569e39$export$dc064fe9e59310fd) {
1562
- if (element.isConnected && !element.isHidden) {
1563
- element.updateNode();
1564
- this.addNode(element);
1215
+ manager.setFocused(true);
1216
+ manager.setFocusedKey(focusedKey);
1217
+ if (focusedKey == null && !shouldUseVirtualFocus && ref.current) $f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
1218
+ if (manager.collection.size > 0) {
1219
+ autoFocusRef.current = false;
1220
+ didAutoFocusRef.current = true;
1565
1221
  }
1566
- if (element.node) this.dirtyNodes.delete(element);
1567
- element.isMutated = false;
1568
- } else this.dirtyNodes.delete(element);
1569
- if (this.nextCollection) {
1570
- var _this_firstVisibleChild_node, _this_firstVisibleChild, _this_lastVisibleChild_node, _this_lastVisibleChild;
1571
- var _this_firstVisibleChild_node_key, _this_lastVisibleChild_node_key;
1572
- this.nextCollection.commit((_this_firstVisibleChild_node_key = (_this_firstVisibleChild = this.firstVisibleChild) === null || _this_firstVisibleChild === void 0 ? void 0 : (_this_firstVisibleChild_node = _this_firstVisibleChild.node) === null || _this_firstVisibleChild_node === void 0 ? void 0 : _this_firstVisibleChild_node.key) !== null && _this_firstVisibleChild_node_key !== void 0 ? _this_firstVisibleChild_node_key : null, (_this_lastVisibleChild_node_key = (_this_lastVisibleChild = this.lastVisibleChild) === null || _this_lastVisibleChild === void 0 ? void 0 : (_this_lastVisibleChild_node = _this_lastVisibleChild.node) === null || _this_lastVisibleChild_node === void 0 ? void 0 : _this_lastVisibleChild_node.key) !== null && _this_lastVisibleChild_node_key !== void 0 ? _this_lastVisibleChild_node_key : null, this.isSSR);
1573
- if (!this.isSSR) {
1574
- this.collection = this.nextCollection;
1575
- this.nextCollection = null;
1222
+ }
1223
+ });
1224
+ let lastFocusedKey = useRef(manager.focusedKey);
1225
+ let raf = useRef(null);
1226
+ useEffect(() => {
1227
+ if (manager.isFocused && manager.focusedKey != null && (manager.focusedKey !== lastFocusedKey.current || didAutoFocusRef.current) && scrollRef.current && ref.current) {
1228
+ let modality = $8f5a2122b0992be3$export$630ff653c5ada6a9();
1229
+ let element = $22bbea12c2567021$export$c3d8340acf92597f(ref, manager.focusedKey);
1230
+ if (!(element instanceof HTMLElement)) return;
1231
+ if (modality === "keyboard" || didAutoFocusRef.current) {
1232
+ if (raf.current) cancelAnimationFrame(raf.current);
1233
+ raf.current = requestAnimationFrame(() => {
1234
+ if (scrollRef.current) {
1235
+ $51a3e22a5186a962$export$53a0910f038337bd(scrollRef.current, element);
1236
+ if (modality !== "virtual") $51a3e22a5186a962$export$c826860796309d1b(element, { containingElement: ref.current });
1237
+ }
1238
+ });
1576
1239
  }
1577
1240
  }
1578
- }
1579
- queueUpdate() {
1580
- if (this.dirtyNodes.size === 0 || this.queuedRender) return;
1581
- this.queuedRender = true;
1582
- this.inSubscription = true;
1583
- if (!this.isSSR) this.collection = this.collection.clone();
1584
- for (let fn of this.subscriptions) fn();
1585
- this.inSubscription = false;
1586
- }
1587
- subscribe(fn) {
1588
- this.subscriptions.add(fn);
1589
- return () => this.subscriptions.delete(fn);
1590
- }
1591
- resetAfterSSR() {
1592
- if (this.isSSR) {
1593
- this.isSSR = false;
1594
- this.firstChild = null;
1595
- this.lastChild = null;
1596
- this.nodeId = 0;
1241
+ if (!shouldUseVirtualFocus && manager.isFocused && manager.focusedKey == null && lastFocusedKey.current != null && ref.current) $f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
1242
+ lastFocusedKey.current = manager.focusedKey;
1243
+ didAutoFocusRef.current = false;
1244
+ });
1245
+ useEffect(() => {
1246
+ return () => {
1247
+ if (raf.current) cancelAnimationFrame(raf.current);
1248
+ };
1249
+ }, []);
1250
+ $600b3cf69ae46262$export$90fc3a17d93f704c(ref, "react-aria-focus-scope-restore", (e) => {
1251
+ e.preventDefault();
1252
+ manager.setFocused(true);
1253
+ });
1254
+ let handlers = {
1255
+ onKeyDown,
1256
+ onFocus,
1257
+ onBlur,
1258
+ onMouseDown(e) {
1259
+ if (scrollRef.current === $23f2114a1b82827e$export$e58f029f0fbfdb29(e)) e.preventDefault();
1597
1260
  }
1598
- }
1599
- constructor(collection) {
1600
- super(null), this.nodeType = 11, this.ownerDocument = this, this.dirtyNodes = new Set(), this.isSSR = false, this.nodeId = 0, this.nodesByProps = new WeakMap(), this.nextCollection = null, this.subscriptions = new Set(), this.queuedRender = false, this.inSubscription = false;
1601
- this.collection = collection;
1602
- this.nextCollection = collection;
1603
- }
1604
- };
1261
+ };
1262
+ let { typeSelectProps } = $f5a4a9a3486154da$export$e32c88dfddc6e1d8({
1263
+ keyboardDelegate: delegate,
1264
+ selectionManager: manager
1265
+ });
1266
+ if (!disallowTypeAhead) handlers = $bbaa08b3cd72f041$export$9d1611c77c2fe928(typeSelectProps, handlers);
1267
+ let tabIndex = void 0;
1268
+ if (!shouldUseVirtualFocus) tabIndex = manager.focusedKey == null ? 0 : -1;
1269
+ let collectionId = $22bbea12c2567021$export$881eb0d9f3605d9d(manager.collection);
1270
+ return { collectionProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(handlers, {
1271
+ tabIndex,
1272
+ "data-collection": collectionId
1273
+ }) };
1274
+ }
1605
1275
  //#endregion
1606
- //#region node_modules/@react-aria/collections/dist/useCachedChildren.mjs
1607
- function $e948873055cbafe4$export$727c8fc270210f13(props) {
1608
- let { children, items, idScope, addIdAndValue, dependencies = [] } = props;
1609
- let cache = useMemo(() => new WeakMap(), dependencies);
1610
- return useMemo(() => {
1611
- if (items && typeof children === "function") {
1612
- let res = [];
1613
- for (let item of items) {
1614
- let rendered = cache.get(item);
1615
- if (!rendered) {
1616
- rendered = children(item);
1617
- var _rendered_props_id, _ref;
1618
- let key = (_ref = (_rendered_props_id = rendered.props.id) !== null && _rendered_props_id !== void 0 ? _rendered_props_id : item.key) !== null && _ref !== void 0 ? _ref : item.id;
1619
- if (key == null) throw new Error("Could not determine key for item");
1620
- if (idScope != null) key = idScope + ":" + key;
1621
- rendered = cloneElement(rendered, addIdAndValue ? {
1622
- key,
1623
- id: key,
1624
- value: item
1625
- } : { key });
1626
- cache.set(item, rendered);
1276
+ //#region node_modules/react-aria/dist/private/interactions/useLongPress.mjs
1277
+ var $7b01448eaad0fe7c$var$DEFAULT_THRESHOLD = 500;
1278
+ function $7b01448eaad0fe7c$export$c24ed0104d07eab9(props) {
1279
+ let { isDisabled, onLongPressStart, onLongPressEnd, onLongPress, threshold = $7b01448eaad0fe7c$var$DEFAULT_THRESHOLD, accessibilityDescription } = props;
1280
+ const timeRef = useRef(void 0);
1281
+ let { addGlobalListener, removeGlobalListener } = $48a7d519b337145d$export$4eaf04e54aa8eed6();
1282
+ let { pressProps } = $d27d541f9569d26d$export$45712eceda6fad21({
1283
+ isDisabled,
1284
+ onPressStart(e) {
1285
+ e.continuePropagation();
1286
+ if (e.pointerType === "mouse" || e.pointerType === "touch") {
1287
+ if (onLongPressStart) onLongPressStart({
1288
+ ...e,
1289
+ type: "longpressstart"
1290
+ });
1291
+ timeRef.current = setTimeout(() => {
1292
+ e.target.dispatchEvent(new PointerEvent("pointercancel", { bubbles: true }));
1293
+ if ($d447af545b77c9f1$export$b204af158042fbac(e.target).activeElement !== e.target) $1969ac565cfec8d0$export$de79e2c695e052f3(e.target);
1294
+ if (onLongPress) onLongPress({
1295
+ ...e,
1296
+ type: "longpress"
1297
+ });
1298
+ timeRef.current = void 0;
1299
+ }, threshold);
1300
+ if (e.pointerType === "touch") {
1301
+ let onContextMenu = (e) => {
1302
+ e.preventDefault();
1303
+ };
1304
+ let ownerWindow = $d447af545b77c9f1$export$f21a1ffae260145a(e.target);
1305
+ addGlobalListener(e.target, "contextmenu", onContextMenu, { once: true });
1306
+ addGlobalListener(ownerWindow, "pointerup", () => {
1307
+ setTimeout(() => {
1308
+ removeGlobalListener(e.target, "contextmenu", onContextMenu);
1309
+ }, 30);
1310
+ }, { once: true });
1627
1311
  }
1628
- res.push(rendered);
1629
1312
  }
1630
- return res;
1631
- } else if (typeof children !== "function") return children;
1632
- }, [
1633
- children,
1634
- items,
1635
- cache,
1636
- idScope,
1637
- addIdAndValue
1638
- ]);
1313
+ },
1314
+ onPressEnd(e) {
1315
+ if (timeRef.current) clearTimeout(timeRef.current);
1316
+ if (onLongPressEnd && (e.pointerType === "mouse" || e.pointerType === "touch")) onLongPressEnd({
1317
+ ...e,
1318
+ type: "longpressend"
1319
+ });
1320
+ }
1321
+ });
1322
+ return { longPressProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(pressProps, $121970af65029459$export$f8aeda7b10753fa1(onLongPress && !isDisabled ? accessibilityDescription : void 0)) };
1639
1323
  }
1640
1324
  //#endregion
1641
- //#region node_modules/@react-aria/collections/dist/CollectionBuilder.mjs
1642
- var $e1995378a142960e$var$ShallowRenderContext = createContext(false);
1643
- var $e1995378a142960e$var$CollectionDocumentContext = createContext(null);
1644
- function $e1995378a142960e$export$bf788dd355e3a401(props) {
1645
- if (useContext($e1995378a142960e$var$CollectionDocumentContext)) return props.content;
1646
- let { collection, document } = $e1995378a142960e$var$useCollectionDocument(props.createCollection);
1647
- return React.createElement(React.Fragment, null, React.createElement($f39a9eba43920ace$export$8dc98ba7eadeaa56, null, React.createElement($e1995378a142960e$var$CollectionDocumentContext.Provider, { value: document }, props.content)), React.createElement($e1995378a142960e$var$CollectionInner, {
1648
- render: props.children,
1649
- collection
1650
- }));
1651
- }
1652
- function $e1995378a142960e$var$CollectionInner({ collection, render }) {
1653
- return render(collection);
1654
- }
1655
- function $e1995378a142960e$var$useSyncExternalStoreFallback(subscribe, getSnapshot, getServerSnapshot) {
1656
- let isSSR = $b5e257d569688ac6$export$535bd6ca7f90a273();
1657
- let isSSRRef = useRef(isSSR);
1658
- isSSRRef.current = isSSR;
1659
- return useSyncExternalStore(subscribe, useCallback(() => {
1660
- return isSSRRef.current ? getServerSnapshot() : getSnapshot();
1661
- }, [getSnapshot, getServerSnapshot]));
1662
- }
1663
- var $e1995378a142960e$var$useSyncExternalStore = typeof React["useSyncExternalStore"] === "function" ? React["useSyncExternalStore"] : $e1995378a142960e$var$useSyncExternalStoreFallback;
1664
- function $e1995378a142960e$var$useCollectionDocument(createCollection) {
1665
- let [document] = useState(() => new $681cc3c98f569e39$export$b34a105447964f9f((createCollection === null || createCollection === void 0 ? void 0 : createCollection()) || new $23b9f4fcf0fe224b$export$408d25a4e12db025()));
1666
- return {
1667
- collection: $e1995378a142960e$var$useSyncExternalStore(useCallback((fn) => document.subscribe(fn), [document]), useCallback(() => {
1668
- let collection = document.getCollection();
1669
- if (document.isSSR) document.resetAfterSSR();
1670
- return collection;
1671
- }, [document]), useCallback(() => {
1672
- document.isSSR = true;
1673
- return document.getCollection();
1674
- }, [document])),
1675
- document
1325
+ //#region node_modules/react-aria/dist/private/selection/useSelectableItem.mjs
1326
+ function $f6ba6936bfd098a0$export$ecf600387e221c37(options) {
1327
+ let { id, selectionManager: manager, key, ref, shouldSelectOnPressUp, shouldUseVirtualFocus, focus, isDisabled, onAction, allowsDifferentPressOrigin, linkBehavior = "action" } = options;
1328
+ let router = $caaf0dd3060ed57c$export$9a302a45f65d0572();
1329
+ id = $390e54f620492c70$export$f680877a34711e37(id);
1330
+ let onSelect = (e) => {
1331
+ if (e.pointerType === "keyboard" && $22bbea12c2567021$export$d3e3bd3e26688c04(e)) manager.toggleSelection(key);
1332
+ else {
1333
+ if (manager.selectionMode === "none") return;
1334
+ if (manager.isLink(key)) {
1335
+ if (linkBehavior === "selection" && ref.current) {
1336
+ let itemProps = manager.getItemProps(key);
1337
+ router.open(ref.current, e, itemProps.href, itemProps.routerOptions);
1338
+ manager.setSelectedKeys(manager.selectedKeys);
1339
+ return;
1340
+ } else if (linkBehavior === "override" || linkBehavior === "none") return;
1341
+ }
1342
+ if (manager.selectionMode === "single") if (manager.isSelected(key) && !manager.disallowEmptySelection) manager.toggleSelection(key);
1343
+ else manager.replaceSelection(key);
1344
+ else if (e && e.shiftKey) manager.extendSelection(key);
1345
+ else if (manager.selectionBehavior === "toggle" || e && ($bb39c0fc1c19b34c$export$16792effe837dba3(e) || e.pointerType === "touch" || e.pointerType === "virtual")) manager.toggleSelection(key);
1346
+ else manager.replaceSelection(key);
1347
+ }
1676
1348
  };
1677
- }
1678
- var $e1995378a142960e$var$SSRContext = createContext(null);
1679
- function $e1995378a142960e$var$createCollectionNodeClass(type) {
1680
- var _class;
1681
- return _class = class extends $23b9f4fcf0fe224b$export$d68d59712b04d9d1 {}, _class.type = type, _class;
1682
- }
1683
- function $e1995378a142960e$var$useSSRCollectionNode(CollectionNodeClass, props, ref, rendered, children, render) {
1684
- if (typeof CollectionNodeClass === "string") CollectionNodeClass = $e1995378a142960e$var$createCollectionNodeClass(CollectionNodeClass);
1685
- let itemRef = useCallback((element) => {
1686
- element === null || element === void 0 || element.setProps(props, ref, CollectionNodeClass, rendered, render);
1349
+ useEffect(() => {
1350
+ if (key === manager.focusedKey && manager.isFocused) if (!shouldUseVirtualFocus) {
1351
+ if (focus) focus();
1352
+ else if ($23f2114a1b82827e$export$cd4e5573fbe2b576() !== ref.current && ref.current) $f192c2f16961cbe0$export$80f3e147d781571c(ref.current);
1353
+ } else $b72f3f7b3b5f42c6$export$76e4e37e5339496d(ref.current);
1687
1354
  }, [
1688
- props,
1689
1355
  ref,
1690
- rendered,
1691
- render,
1692
- CollectionNodeClass
1356
+ key,
1357
+ manager.focusedKey,
1358
+ manager.childFocusStrategy,
1359
+ manager.isFocused,
1360
+ shouldUseVirtualFocus
1693
1361
  ]);
1694
- let parentNode = useContext($e1995378a142960e$var$SSRContext);
1695
- if (parentNode) {
1696
- let element = parentNode.ownerDocument.nodesByProps.get(props);
1697
- if (!element) {
1698
- element = parentNode.ownerDocument.createElement(CollectionNodeClass.type);
1699
- element.setProps(props, ref, CollectionNodeClass, rendered, render);
1700
- parentNode.appendChild(element);
1701
- parentNode.ownerDocument.updateCollection();
1702
- parentNode.ownerDocument.nodesByProps.set(props, element);
1362
+ isDisabled = isDisabled || manager.isDisabled(key);
1363
+ let itemProps = {};
1364
+ if (!shouldUseVirtualFocus && !isDisabled) itemProps = {
1365
+ tabIndex: key === manager.focusedKey ? 0 : -1,
1366
+ onFocus(e) {
1367
+ if ($23f2114a1b82827e$export$e58f029f0fbfdb29(e) === ref.current) manager.setFocusedKey(key);
1368
+ }
1369
+ };
1370
+ else if (isDisabled) itemProps.onMouseDown = (e) => {
1371
+ e.preventDefault();
1372
+ };
1373
+ useEffect(() => {
1374
+ if (isDisabled && manager.focusedKey === key) manager.setFocusedKey(null);
1375
+ }, [
1376
+ manager,
1377
+ isDisabled,
1378
+ key
1379
+ ]);
1380
+ let isLinkOverride = manager.isLink(key) && linkBehavior === "override";
1381
+ let isActionOverride = onAction && options["UNSTABLE_itemBehavior"] === "action";
1382
+ let hasLinkAction = manager.isLink(key) && linkBehavior !== "selection" && linkBehavior !== "none";
1383
+ let allowsSelection = !isDisabled && manager.canSelectItem(key) && !isLinkOverride && !isActionOverride;
1384
+ let allowsActions = (onAction || hasLinkAction) && !isDisabled;
1385
+ let hasPrimaryAction = allowsActions && (manager.selectionBehavior === "replace" ? !allowsSelection : !allowsSelection || manager.isEmpty);
1386
+ let hasSecondaryAction = allowsActions && allowsSelection && manager.selectionBehavior === "replace";
1387
+ let hasAction = hasPrimaryAction || hasSecondaryAction;
1388
+ let modality = useRef(null);
1389
+ let longPressEnabled = hasAction && allowsSelection;
1390
+ let longPressEnabledOnPressStart = useRef(false);
1391
+ let hadPrimaryActionOnPressStart = useRef(false);
1392
+ let collectionItemProps = manager.getItemProps(key);
1393
+ let performAction = (e) => {
1394
+ if (onAction) {
1395
+ onAction();
1396
+ ref.current?.dispatchEvent(new CustomEvent("react-aria-item-action", { bubbles: true }));
1397
+ }
1398
+ if (hasLinkAction && ref.current) router.open(ref.current, e, collectionItemProps.href, collectionItemProps.routerOptions);
1399
+ };
1400
+ let itemPressProps = { ref };
1401
+ if (shouldSelectOnPressUp) {
1402
+ itemPressProps.onPressStart = (e) => {
1403
+ modality.current = e.pointerType;
1404
+ longPressEnabledOnPressStart.current = longPressEnabled;
1405
+ if (e.pointerType === "keyboard" && (!hasAction || $f6ba6936bfd098a0$var$isSelectionKey(e.key))) onSelect(e);
1406
+ };
1407
+ if (!allowsDifferentPressOrigin) itemPressProps.onPress = (e) => {
1408
+ if (hasPrimaryAction || hasSecondaryAction && e.pointerType !== "mouse") {
1409
+ if (e.pointerType === "keyboard" && !$f6ba6936bfd098a0$var$isActionKey(e.key)) return;
1410
+ performAction(e);
1411
+ } else if (e.pointerType !== "keyboard" && allowsSelection) onSelect(e);
1412
+ };
1413
+ else {
1414
+ itemPressProps.onPressUp = hasPrimaryAction ? void 0 : (e) => {
1415
+ if (e.pointerType === "mouse" && allowsSelection) onSelect(e);
1416
+ };
1417
+ itemPressProps.onPress = hasPrimaryAction ? performAction : (e) => {
1418
+ if (e.pointerType !== "keyboard" && e.pointerType !== "mouse" && allowsSelection) onSelect(e);
1419
+ };
1703
1420
  }
1704
- return children ? React.createElement($e1995378a142960e$var$SSRContext.Provider, { value: element }, children) : null;
1421
+ } else {
1422
+ itemPressProps.onPressStart = (e) => {
1423
+ modality.current = e.pointerType;
1424
+ longPressEnabledOnPressStart.current = longPressEnabled;
1425
+ hadPrimaryActionOnPressStart.current = hasPrimaryAction;
1426
+ if (allowsSelection && (e.pointerType === "mouse" && !hasPrimaryAction || e.pointerType === "keyboard" && (!allowsActions || $f6ba6936bfd098a0$var$isSelectionKey(e.key)))) onSelect(e);
1427
+ };
1428
+ itemPressProps.onPress = (e) => {
1429
+ if (e.pointerType === "touch" || e.pointerType === "pen" || e.pointerType === "virtual" || e.pointerType === "keyboard" && hasAction && $f6ba6936bfd098a0$var$isActionKey(e.key) || e.pointerType === "mouse" && hadPrimaryActionOnPressStart.current) {
1430
+ if (hasAction) performAction(e);
1431
+ else if (allowsSelection) onSelect(e);
1432
+ }
1433
+ };
1705
1434
  }
1706
- return React.createElement(CollectionNodeClass.type, { ref: itemRef }, children);
1707
- }
1708
- function $e1995378a142960e$export$18af5c7a9e9b3664(CollectionNodeClass, render) {
1709
- let Component = ({ node }) => render(node.props, node.props.ref, node);
1710
- let Result = forwardRef((props, ref) => {
1711
- let focusableProps = useContext($f645667febf57a63$export$f9762fab77588ecb);
1712
- if (!useContext($e1995378a142960e$var$ShallowRenderContext)) {
1713
- if (render.length >= 3) throw new Error(render.name + " cannot be rendered outside a collection.");
1714
- return render(props, ref);
1435
+ itemProps["data-collection"] = $22bbea12c2567021$export$6aeb1680a0ae8741(manager.collection);
1436
+ itemProps["data-key"] = key;
1437
+ itemPressProps.preventFocusOnPress = shouldUseVirtualFocus;
1438
+ if (shouldUseVirtualFocus) itemPressProps = $bbaa08b3cd72f041$export$9d1611c77c2fe928(itemPressProps, {
1439
+ onPressStart(e) {
1440
+ if (e.pointerType !== "touch") {
1441
+ manager.setFocused(true);
1442
+ manager.setFocusedKey(key);
1443
+ }
1444
+ },
1445
+ onPress(e) {
1446
+ if (e.pointerType === "touch") {
1447
+ manager.setFocused(true);
1448
+ manager.setFocusedKey(key);
1449
+ }
1715
1450
  }
1716
- return $e1995378a142960e$var$useSSRCollectionNode(CollectionNodeClass, props, ref, "children" in props ? props.children : null, null, (node) => React.createElement($f645667febf57a63$export$f9762fab77588ecb.Provider, { value: focusableProps }, React.createElement(Component, { node })));
1717
- });
1718
- Result.displayName = render.name;
1719
- return Result;
1720
- }
1721
- function $e1995378a142960e$export$e953bb1cd0f19726(CollectionNodeClass, render, useChildren = $e1995378a142960e$var$useCollectionChildren) {
1722
- let Component = ({ node }) => render(node.props, node.props.ref, node);
1723
- let Result = forwardRef((props, ref) => {
1724
- let children = useChildren(props);
1725
- var _useSSRCollectionNode;
1726
- return (_useSSRCollectionNode = $e1995378a142960e$var$useSSRCollectionNode(CollectionNodeClass, props, ref, null, children, (node) => React.createElement(Component, { node }))) !== null && _useSSRCollectionNode !== void 0 ? _useSSRCollectionNode : React.createElement(React.Fragment, null);
1727
1451
  });
1728
- Result.displayName = render.name;
1729
- return Result;
1730
- }
1731
- function $e1995378a142960e$var$useCollectionChildren(options) {
1732
- return $e948873055cbafe4$export$727c8fc270210f13({
1733
- ...options,
1734
- addIdAndValue: true
1452
+ if (collectionItemProps) {
1453
+ for (let key of [
1454
+ "onPressStart",
1455
+ "onPressEnd",
1456
+ "onPressChange",
1457
+ "onPress",
1458
+ "onPressUp",
1459
+ "onClick"
1460
+ ]) if (collectionItemProps[key]) itemPressProps[key] = $a4e76a5424781910$export$e08e3b67e392101e(itemPressProps[key], collectionItemProps[key]);
1461
+ }
1462
+ let { pressProps, isPressed } = $d27d541f9569d26d$export$45712eceda6fad21(itemPressProps);
1463
+ let onDoubleClick = hasSecondaryAction ? (e) => {
1464
+ if (modality.current === "mouse") {
1465
+ e.stopPropagation();
1466
+ e.preventDefault();
1467
+ performAction(e);
1468
+ }
1469
+ } : void 0;
1470
+ let { longPressProps } = $7b01448eaad0fe7c$export$c24ed0104d07eab9({
1471
+ isDisabled: !longPressEnabled,
1472
+ onLongPress(e) {
1473
+ if (e.pointerType === "touch") {
1474
+ onSelect(e);
1475
+ manager.setSelectionBehavior("toggle");
1476
+ }
1477
+ }
1735
1478
  });
1479
+ let onDragStartCapture = (e) => {
1480
+ if (modality.current === "touch" && longPressEnabledOnPressStart.current) e.preventDefault();
1481
+ };
1482
+ let onClick = linkBehavior !== "none" && manager.isLink(key) ? (e) => {
1483
+ if (!$caaf0dd3060ed57c$export$95185d699e05d4d7.isOpening) e.preventDefault();
1484
+ } : void 0;
1485
+ return {
1486
+ itemProps: $bbaa08b3cd72f041$export$9d1611c77c2fe928(itemProps, allowsSelection || hasPrimaryAction || shouldUseVirtualFocus && !isDisabled ? pressProps : {}, longPressEnabled ? longPressProps : {}, {
1487
+ onDoubleClick,
1488
+ onDragStartCapture,
1489
+ onClick,
1490
+ id
1491
+ }, shouldUseVirtualFocus ? { onMouseDown: (e) => e.preventDefault() } : void 0),
1492
+ isPressed,
1493
+ isSelected: manager.isSelected(key),
1494
+ isFocused: manager.isFocused && manager.focusedKey === key,
1495
+ isDisabled,
1496
+ allowsSelection,
1497
+ hasAction
1498
+ };
1736
1499
  }
1737
- var $e1995378a142960e$var$CollectionContext = createContext(null);
1738
- function $e1995378a142960e$export$fb8073518f34e6ec(props) {
1739
- let ctx = useContext($e1995378a142960e$var$CollectionContext);
1740
- let dependencies = ((ctx === null || ctx === void 0 ? void 0 : ctx.dependencies) || []).concat(props.dependencies);
1741
- var _props_idScope;
1742
- let idScope = (_props_idScope = props.idScope) !== null && _props_idScope !== void 0 ? _props_idScope : ctx === null || ctx === void 0 ? void 0 : ctx.idScope;
1743
- let children = $e1995378a142960e$var$useCollectionChildren({
1744
- ...props,
1745
- idScope,
1746
- dependencies
1747
- });
1748
- if (useContext($e1995378a142960e$var$CollectionDocumentContext)) children = React.createElement($e1995378a142960e$var$CollectionRoot, null, children);
1749
- ctx = useMemo(() => ({
1750
- dependencies,
1751
- idScope
1752
- }), [idScope, ...dependencies]);
1753
- return React.createElement($e1995378a142960e$var$CollectionContext.Provider, { value: ctx }, children);
1500
+ function $f6ba6936bfd098a0$var$isActionKey(key) {
1501
+ return key === "Enter";
1754
1502
  }
1755
- function $e1995378a142960e$var$CollectionRoot({ children }) {
1756
- let doc = useContext($e1995378a142960e$var$CollectionDocumentContext);
1757
- let wrappedChildren = useMemo(() => React.createElement($e1995378a142960e$var$CollectionDocumentContext.Provider, { value: null }, React.createElement($e1995378a142960e$var$ShallowRenderContext.Provider, { value: true }, children)), [children]);
1758
- return $b5e257d569688ac6$export$535bd6ca7f90a273() ? React.createElement($e1995378a142960e$var$SSRContext.Provider, { value: doc }, wrappedChildren) : createPortal(wrappedChildren, doc);
1503
+ function $f6ba6936bfd098a0$var$isSelectionKey(key) {
1504
+ return key === " ";
1759
1505
  }
1760
1506
  //#endregion
1761
- //#region node_modules/react-aria-components/dist/Collection.mjs
1762
- var $7135fc7d473fd974$export$d40e14dec8b060a8 = createContext(null);
1763
- var $7135fc7d473fd974$export$a164736487e3f0ae = {
1764
- CollectionRoot({ collection, renderDropIndicator }) {
1765
- return $7135fc7d473fd974$var$useCollectionRender(collection, null, renderDropIndicator);
1766
- },
1767
- CollectionBranch({ collection, parent, renderDropIndicator }) {
1768
- return $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator);
1769
- }
1770
- };
1771
- function $7135fc7d473fd974$var$useCollectionRender(collection, parent, renderDropIndicator) {
1772
- return $e948873055cbafe4$export$727c8fc270210f13({
1773
- items: parent ? collection.getChildren(parent.key) : collection,
1774
- dependencies: [renderDropIndicator],
1775
- children(node) {
1776
- if (node.type === "content") return React.createElement(React.Fragment, null);
1777
- let rendered = node.render(node);
1778
- if (!renderDropIndicator || node.type !== "item") return rendered;
1779
- return React.createElement(React.Fragment, null, renderDropIndicator({
1780
- type: "item",
1781
- key: node.key,
1782
- dropPosition: "before"
1783
- }), rendered, $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropIndicator));
1784
- }
1785
- });
1507
+ //#region node_modules/react-stately/dist/private/collections/getChildNodes.mjs
1508
+ function $cd5ea4b915021f1d$export$1005530eda016c13(node, collection) {
1509
+ if (typeof collection.getChildren === "function") return collection.getChildren(node.key);
1510
+ return node.childNodes;
1786
1511
  }
1787
- function $7135fc7d473fd974$export$2dbbd341daed716d(collection, node, renderDropIndicator) {
1788
- let key = node.key;
1789
- let keyAfter = collection.getKeyAfter(key);
1790
- let nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
1791
- while (nextItemInFlattenedCollection != null && nextItemInFlattenedCollection.type !== "item") {
1792
- keyAfter = collection.getKeyAfter(nextItemInFlattenedCollection.key);
1793
- nextItemInFlattenedCollection = keyAfter != null ? collection.getItem(keyAfter) : null;
1512
+ function $cd5ea4b915021f1d$export$fbdeaa6a76694f71(iterable) {
1513
+ return $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, 0);
1514
+ }
1515
+ function $cd5ea4b915021f1d$export$5f3398f8733f90e2(iterable, index) {
1516
+ if (index < 0) return void 0;
1517
+ let i = 0;
1518
+ for (let item of iterable) {
1519
+ if (i === index) return item;
1520
+ i++;
1794
1521
  }
1795
- let nextItemInSameLevel = node.nextKey != null ? collection.getItem(node.nextKey) : null;
1796
- while (nextItemInSameLevel != null && nextItemInSameLevel.type !== "item") nextItemInSameLevel = nextItemInSameLevel.nextKey != null ? collection.getItem(nextItemInSameLevel.nextKey) : null;
1797
- let afterIndicators = [];
1798
- if (nextItemInSameLevel == null) {
1799
- let current = node;
1800
- while ((current === null || current === void 0 ? void 0 : current.type) === "item" && (!nextItemInFlattenedCollection || current.parentKey !== nextItemInFlattenedCollection.parentKey && nextItemInFlattenedCollection.level < current.level)) {
1801
- let indicator = renderDropIndicator({
1802
- type: "item",
1803
- key: current.key,
1804
- dropPosition: "after"
1805
- });
1806
- if (isValidElement(indicator)) afterIndicators.push(cloneElement(indicator, { key: `${current.key}-after` }));
1807
- current = current.parentKey != null ? collection.getItem(current.parentKey) : null;
1808
- }
1522
+ }
1523
+ function $cd5ea4b915021f1d$export$8c434b3a7a4dad6(collection, a, b) {
1524
+ if (a.parentKey === b.parentKey) return a.index - b.index;
1525
+ let aAncestors = [...$cd5ea4b915021f1d$var$getAncestors(collection, a), a];
1526
+ let bAncestors = [...$cd5ea4b915021f1d$var$getAncestors(collection, b), b];
1527
+ let firstNonMatchingAncestor = aAncestors.slice(0, bAncestors.length).findIndex((a, i) => a !== bAncestors[i]);
1528
+ if (firstNonMatchingAncestor !== -1) {
1529
+ a = aAncestors[firstNonMatchingAncestor];
1530
+ b = bAncestors[firstNonMatchingAncestor];
1531
+ return a.index - b.index;
1809
1532
  }
1810
- return afterIndicators;
1533
+ if (aAncestors.findIndex((node) => node === b) >= 0) return 1;
1534
+ else if (bAncestors.findIndex((node) => node === a) >= 0) return -1;
1535
+ return -1;
1811
1536
  }
1812
- var $7135fc7d473fd974$export$4feb769f8ddf26c5 = createContext($7135fc7d473fd974$export$a164736487e3f0ae);
1813
- function $7135fc7d473fd974$export$90e00781bc59d8f9(focusedKey) {
1814
- return useMemo(() => focusedKey != null ? new Set([focusedKey]) : null, [focusedKey]);
1537
+ function $cd5ea4b915021f1d$var$getAncestors(collection, node) {
1538
+ let parents = [];
1539
+ let currNode = node;
1540
+ while (currNode?.parentKey != null) {
1541
+ currNode = collection.getItem(currNode.parentKey);
1542
+ if (currNode) parents.unshift(currNode);
1543
+ }
1544
+ return parents;
1815
1545
  }
1816
1546
  //#endregion
1817
- //#region node_modules/@react-stately/selection/dist/Selection.mjs
1818
- var $e40ea825a81a3709$export$52baac22726c72bf = class $e40ea825a81a3709$export$52baac22726c72bf extends Set {
1547
+ //#region node_modules/react-stately/dist/private/selection/Selection.mjs
1548
+ var $8b2540e09867b15e$export$52baac22726c72bf = class $8b2540e09867b15e$export$52baac22726c72bf extends Set {
1819
1549
  constructor(keys, anchorKey, currentKey) {
1820
1550
  super(keys);
1821
- if (keys instanceof $e40ea825a81a3709$export$52baac22726c72bf) {
1822
- this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : keys.anchorKey;
1823
- this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : keys.currentKey;
1551
+ if (keys instanceof $8b2540e09867b15e$export$52baac22726c72bf) {
1552
+ this.anchorKey = anchorKey ?? keys.anchorKey;
1553
+ this.currentKey = currentKey ?? keys.currentKey;
1824
1554
  } else {
1825
- this.anchorKey = anchorKey !== null && anchorKey !== void 0 ? anchorKey : null;
1826
- this.currentKey = currentKey !== null && currentKey !== void 0 ? currentKey : null;
1555
+ this.anchorKey = anchorKey ?? null;
1556
+ this.currentKey = currentKey ?? null;
1827
1557
  }
1828
1558
  }
1829
1559
  };
1830
1560
  //#endregion
1831
- //#region node_modules/@react-stately/selection/dist/useMultipleSelectionState.mjs
1832
- function $7af3f5b51489e0b5$var$equalSets(setA, setB) {
1561
+ //#region node_modules/react-stately/dist/private/selection/useMultipleSelectionState.mjs
1562
+ function $60f19cefd567a3e4$var$equalSets(setA, setB) {
1833
1563
  if (setA.size !== setB.size) return false;
1834
1564
  for (let item of setA) if (!setB.has(item)) return false;
1835
1565
  return true;
1836
1566
  }
1837
- function $7af3f5b51489e0b5$export$253fe78d46329472(props) {
1567
+ function $60f19cefd567a3e4$export$253fe78d46329472(props) {
1838
1568
  let { selectionMode = "none", disallowEmptySelection = false, allowDuplicateSelectionEvents, selectionBehavior: selectionBehaviorProp = "toggle", disabledBehavior = "all" } = props;
1839
1569
  let isFocusedRef = useRef(false);
1840
1570
  let [, setFocused] = useState(false);
1841
1571
  let focusedKeyRef = useRef(null);
1842
1572
  let childFocusStrategyRef = useRef(null);
1843
1573
  let [, setFocusedKey] = useState(null);
1844
- let [selectedKeys, setSelectedKeys] = $458b0a5536c1a7cf$export$40bfa8c7b0832715(useMemo(() => $7af3f5b51489e0b5$var$convertSelection(props.selectedKeys), [props.selectedKeys]), useMemo(() => $7af3f5b51489e0b5$var$convertSelection(props.defaultSelectedKeys, new $e40ea825a81a3709$export$52baac22726c72bf()), [props.defaultSelectedKeys]), props.onSelectionChange);
1574
+ let [selectedKeys, setSelectedKeys] = $3e6197669829fe11$export$40bfa8c7b0832715(useMemo(() => $60f19cefd567a3e4$var$convertSelection(props.selectedKeys), [props.selectedKeys]), useMemo(() => $60f19cefd567a3e4$var$convertSelection(props.defaultSelectedKeys, new $8b2540e09867b15e$export$52baac22726c72bf()), [props.defaultSelectedKeys]), props.onSelectionChange);
1845
1575
  let disabledKeysProp = useMemo(() => props.disabledKeys ? new Set(props.disabledKeys) : new Set(), [props.disabledKeys]);
1846
1576
  let [selectionBehavior, setSelectionBehavior] = useState(selectionBehaviorProp);
1847
1577
  if (selectionBehaviorProp === "replace" && selectionBehavior === "toggle" && typeof selectedKeys === "object" && selectedKeys.size === 0) setSelectionBehavior("replace");
@@ -1877,19 +1607,27 @@ function $7af3f5b51489e0b5$export$253fe78d46329472(props) {
1877
1607
  },
1878
1608
  selectedKeys,
1879
1609
  setSelectedKeys(keys) {
1880
- if (allowDuplicateSelectionEvents || !$7af3f5b51489e0b5$var$equalSets(keys, selectedKeys)) setSelectedKeys(keys);
1610
+ if (allowDuplicateSelectionEvents || !$60f19cefd567a3e4$var$equalSets(keys, selectedKeys)) setSelectedKeys(keys);
1881
1611
  },
1882
1612
  disabledKeys: disabledKeysProp,
1883
1613
  disabledBehavior
1884
1614
  };
1885
1615
  }
1886
- function $7af3f5b51489e0b5$var$convertSelection(selection, defaultValue) {
1616
+ function $60f19cefd567a3e4$var$convertSelection(selection, defaultValue) {
1887
1617
  if (!selection) return defaultValue;
1888
- return selection === "all" ? "all" : new $e40ea825a81a3709$export$52baac22726c72bf(selection);
1618
+ return selection === "all" ? "all" : new $8b2540e09867b15e$export$52baac22726c72bf(selection);
1889
1619
  }
1890
1620
  //#endregion
1891
- //#region node_modules/@react-stately/selection/dist/SelectionManager.mjs
1892
- var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class $d496c0a20b6e58ec$export$6c8a5aaad13c9852 {
1621
+ //#region node_modules/react-stately/dist/private/selection/SelectionManager.mjs
1622
+ var $4a07ac835f260f78$export$6c8a5aaad13c9852 = class $4a07ac835f260f78$export$6c8a5aaad13c9852 {
1623
+ constructor(collection, state, options) {
1624
+ this.collection = collection;
1625
+ this.state = state;
1626
+ this.allowsCellSelection = options?.allowsCellSelection ?? false;
1627
+ this._isSelectAll = null;
1628
+ this.layoutDelegate = options?.layoutDelegate || null;
1629
+ this.fullCollection = options?.fullCollection || null;
1630
+ }
1893
1631
  /**
1894
1632
  * The type of selection that is allowed in the collection.
1895
1633
  */ get selectionMode() {
@@ -1972,19 +1710,17 @@ var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class $d496c0a20b6e58ec$export$6
1972
1710
  let first = null;
1973
1711
  for (let key of this.state.selectedKeys) {
1974
1712
  let item = this.collection.getItem(key);
1975
- if (!first || item && $c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, item, first) < 0) first = item;
1713
+ if (!first || item && $cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, item, first) < 0) first = item;
1976
1714
  }
1977
- var _first_key;
1978
- return (_first_key = first === null || first === void 0 ? void 0 : first.key) !== null && _first_key !== void 0 ? _first_key : null;
1715
+ return first?.key ?? null;
1979
1716
  }
1980
1717
  get lastSelectedKey() {
1981
1718
  let last = null;
1982
1719
  for (let key of this.state.selectedKeys) {
1983
1720
  let item = this.collection.getItem(key);
1984
- if (!last || item && $c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, item, last) > 0) last = item;
1721
+ if (!last || item && $cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, item, last) > 0) last = item;
1985
1722
  }
1986
- var _last_key;
1987
- return (_last_key = last === null || last === void 0 ? void 0 : last.key) !== null && _last_key !== void 0 ? _last_key : null;
1723
+ return last?.key ?? null;
1988
1724
  }
1989
1725
  get disabledKeys() {
1990
1726
  return this.state.disabledKeys;
@@ -2003,14 +1739,12 @@ var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class $d496c0a20b6e58ec$export$6
2003
1739
  let mappedToKey = this.getKey(toKey);
2004
1740
  if (mappedToKey == null) return;
2005
1741
  let selection;
2006
- if (this.state.selectedKeys === "all") selection = new $e40ea825a81a3709$export$52baac22726c72bf([mappedToKey], mappedToKey, mappedToKey);
1742
+ if (this.state.selectedKeys === "all") selection = new $8b2540e09867b15e$export$52baac22726c72bf([mappedToKey], mappedToKey, mappedToKey);
2007
1743
  else {
2008
1744
  let selectedKeys = this.state.selectedKeys;
2009
- var _selectedKeys_anchorKey;
2010
- let anchorKey = (_selectedKeys_anchorKey = selectedKeys.anchorKey) !== null && _selectedKeys_anchorKey !== void 0 ? _selectedKeys_anchorKey : mappedToKey;
2011
- selection = new $e40ea825a81a3709$export$52baac22726c72bf(selectedKeys, anchorKey, mappedToKey);
2012
- var _selectedKeys_currentKey;
2013
- for (let key of this.getKeyRange(anchorKey, (_selectedKeys_currentKey = selectedKeys.currentKey) !== null && _selectedKeys_currentKey !== void 0 ? _selectedKeys_currentKey : mappedToKey)) selection.delete(key);
1745
+ let anchorKey = selectedKeys.anchorKey ?? mappedToKey;
1746
+ selection = new $8b2540e09867b15e$export$52baac22726c72bf(selectedKeys, anchorKey, mappedToKey);
1747
+ for (let key of this.getKeyRange(anchorKey, selectedKeys.currentKey ?? mappedToKey)) selection.delete(key);
2014
1748
  for (let key of this.getKeyRange(mappedToKey, anchorKey)) if (this.canSelectItem(key)) selection.add(key);
2015
1749
  }
2016
1750
  this.state.setSelectedKeys(selection);
@@ -2019,14 +1753,13 @@ var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class $d496c0a20b6e58ec$export$6
2019
1753
  let fromItem = this.collection.getItem(from);
2020
1754
  let toItem = this.collection.getItem(to);
2021
1755
  if (fromItem && toItem) {
2022
- if ($c5a24bc478652b5f$export$8c434b3a7a4dad6(this.collection, fromItem, toItem) <= 0) return this.getKeyRangeInternal(from, to);
1756
+ if ($cd5ea4b915021f1d$export$8c434b3a7a4dad6(this.collection, fromItem, toItem) <= 0) return this.getKeyRangeInternal(from, to);
2023
1757
  return this.getKeyRangeInternal(to, from);
2024
1758
  }
2025
1759
  return [];
2026
1760
  }
2027
1761
  getKeyRangeInternal(from, to) {
2028
- var _this_layoutDelegate;
2029
- if ((_this_layoutDelegate = this.layoutDelegate) === null || _this_layoutDelegate === void 0 ? void 0 : _this_layoutDelegate.getKeyRange) return this.layoutDelegate.getKeyRange(from, to);
1762
+ if (this.layoutDelegate?.getKeyRange) return this.layoutDelegate.getKeyRange(from, to);
2030
1763
  let keys = [];
2031
1764
  let key = from;
2032
1765
  while (key != null) {
@@ -2055,7 +1788,7 @@ var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class $d496c0a20b6e58ec$export$6
2055
1788
  }
2056
1789
  let mappedKey = this.getKey(key);
2057
1790
  if (mappedKey == null) return;
2058
- let keys = new $e40ea825a81a3709$export$52baac22726c72bf(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
1791
+ let keys = new $8b2540e09867b15e$export$52baac22726c72bf(this.state.selectedKeys === "all" ? this.getSelectAllKeys() : this.state.selectedKeys);
2059
1792
  if (keys.has(mappedKey)) keys.delete(mappedKey);
2060
1793
  else if (this.canSelectItem(mappedKey)) {
2061
1794
  keys.add(mappedKey);
@@ -2071,14 +1804,14 @@ var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class $d496c0a20b6e58ec$export$6
2071
1804
  if (this.selectionMode === "none") return;
2072
1805
  let mappedKey = this.getKey(key);
2073
1806
  if (mappedKey == null) return;
2074
- let selection = this.canSelectItem(mappedKey) ? new $e40ea825a81a3709$export$52baac22726c72bf([mappedKey], mappedKey, mappedKey) : new $e40ea825a81a3709$export$52baac22726c72bf();
1807
+ let selection = this.canSelectItem(mappedKey) ? new $8b2540e09867b15e$export$52baac22726c72bf([mappedKey], mappedKey, mappedKey) : new $8b2540e09867b15e$export$52baac22726c72bf();
2075
1808
  this.state.setSelectedKeys(selection);
2076
1809
  }
2077
1810
  /**
2078
1811
  * Replaces the selection with the given keys.
2079
1812
  */ setSelectedKeys(keys) {
2080
1813
  if (this.selectionMode === "none") return;
2081
- let selection = new $e40ea825a81a3709$export$52baac22726c72bf();
1814
+ let selection = new $8b2540e09867b15e$export$52baac22726c72bf();
2082
1815
  for (let key of keys) {
2083
1816
  let mappedKey = this.getKey(key);
2084
1817
  if (mappedKey != null) {
@@ -2089,20 +1822,19 @@ var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class $d496c0a20b6e58ec$export$6
2089
1822
  this.state.setSelectedKeys(selection);
2090
1823
  }
2091
1824
  getSelectAllKeys() {
1825
+ let collection = this.fullCollection ?? this.collection;
2092
1826
  let keys = [];
2093
1827
  let addKeys = (key) => {
2094
1828
  while (key != null) {
2095
- if (this.canSelectItem(key)) {
2096
- var _getFirstItem;
2097
- let item = this.collection.getItem(key);
2098
- if ((item === null || item === void 0 ? void 0 : item.type) === "item") keys.push(key);
2099
- var _getFirstItem_key;
2100
- if ((item === null || item === void 0 ? void 0 : item.hasChildNodes) && (this.allowsCellSelection || item.type !== "item")) addKeys((_getFirstItem_key = (_getFirstItem = $c5a24bc478652b5f$export$fbdeaa6a76694f71($c5a24bc478652b5f$export$1005530eda016c13(item, this.collection))) === null || _getFirstItem === void 0 ? void 0 : _getFirstItem.key) !== null && _getFirstItem_key !== void 0 ? _getFirstItem_key : null);
1829
+ if (this.canSelectItemIn(key, collection)) {
1830
+ let item = collection.getItem(key);
1831
+ if (item?.type === "item") keys.push(key);
1832
+ if (item?.hasChildNodes && (this.allowsCellSelection || item.type !== "item")) addKeys($cd5ea4b915021f1d$export$fbdeaa6a76694f71($cd5ea4b915021f1d$export$1005530eda016c13(item, collection))?.key ?? null);
2101
1833
  }
2102
- key = this.collection.getKeyAfter(key);
1834
+ key = collection.getKeyAfter(key);
2103
1835
  }
2104
1836
  };
2105
- addKeys(this.collection.getFirstKey());
1837
+ addKeys(collection.getFirstKey());
2106
1838
  return keys;
2107
1839
  }
2108
1840
  /**
@@ -2113,7 +1845,7 @@ var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class $d496c0a20b6e58ec$export$6
2113
1845
  /**
2114
1846
  * Removes all keys from the selection.
2115
1847
  */ clearSelection() {
2116
- if (!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0)) this.state.setSelectedKeys(new $e40ea825a81a3709$export$52baac22726c72bf());
1848
+ if (!this.disallowEmptySelection && (this.state.selectedKeys === "all" || this.state.selectedKeys.size > 0)) this.state.setSelectedKeys(new $8b2540e09867b15e$export$52baac22726c72bf());
2117
1849
  }
2118
1850
  /**
2119
1851
  * Toggles between select all and an empty selection.
@@ -2139,38 +1871,218 @@ var $d496c0a20b6e58ec$export$6c8a5aaad13c9852 = class $d496c0a20b6e58ec$export$6
2139
1871
  return true;
2140
1872
  }
2141
1873
  canSelectItem(key) {
2142
- var _item_props;
1874
+ return this.canSelectItemIn(key, this.collection);
1875
+ }
1876
+ canSelectItemIn(key, collection) {
2143
1877
  if (this.state.selectionMode === "none" || this.state.disabledKeys.has(key)) return false;
2144
- let item = this.collection.getItem(key);
2145
- if (!item || (item === null || item === void 0 ? void 0 : (_item_props = item.props) === null || _item_props === void 0 ? void 0 : _item_props.isDisabled) || item.type === "cell" && !this.allowsCellSelection) return false;
1878
+ let item = collection.getItem(key);
1879
+ if (!item || item?.props?.isDisabled || item.type === "cell" && !this.allowsCellSelection) return false;
2146
1880
  return true;
2147
1881
  }
2148
1882
  isDisabled(key) {
2149
- var _this_collection_getItem_props, _this_collection_getItem;
2150
- return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(key) || !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.isDisabled));
1883
+ return this.state.disabledBehavior === "all" && (this.state.disabledKeys.has(key) || !!this.collection.getItem(key)?.props?.isDisabled);
2151
1884
  }
2152
1885
  isLink(key) {
2153
- var _this_collection_getItem_props, _this_collection_getItem;
2154
- return !!((_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : (_this_collection_getItem_props = _this_collection_getItem.props) === null || _this_collection_getItem_props === void 0 ? void 0 : _this_collection_getItem_props.href);
1886
+ return !!this.collection.getItem(key)?.props?.href;
2155
1887
  }
2156
1888
  getItemProps(key) {
2157
- var _this_collection_getItem;
2158
- return (_this_collection_getItem = this.collection.getItem(key)) === null || _this_collection_getItem === void 0 ? void 0 : _this_collection_getItem.props;
1889
+ return this.collection.getItem(key)?.props;
2159
1890
  }
2160
1891
  withCollection(collection) {
2161
- return new $d496c0a20b6e58ec$export$6c8a5aaad13c9852(collection, this.state, {
1892
+ return new $4a07ac835f260f78$export$6c8a5aaad13c9852(collection, this.state, {
2162
1893
  allowsCellSelection: this.allowsCellSelection,
2163
- layoutDelegate: this.layoutDelegate || void 0
1894
+ layoutDelegate: this.layoutDelegate || void 0,
1895
+ fullCollection: this.fullCollection ?? this.collection
2164
1896
  });
2165
1897
  }
2166
- constructor(collection, state, options) {
2167
- this.collection = collection;
2168
- this.state = state;
2169
- var _options_allowsCellSelection;
2170
- this.allowsCellSelection = (_options_allowsCellSelection = options === null || options === void 0 ? void 0 : options.allowsCellSelection) !== null && _options_allowsCellSelection !== void 0 ? _options_allowsCellSelection : false;
2171
- this._isSelectAll = null;
2172
- this.layoutDelegate = (options === null || options === void 0 ? void 0 : options.layoutDelegate) || null;
1898
+ };
1899
+ //#endregion
1900
+ //#region node_modules/react-stately/dist/private/collections/CollectionBuilder.mjs
1901
+ var $bda7a7e55e1ff206$export$bf788dd355e3a401 = class {
1902
+ build(props, context) {
1903
+ this.context = context;
1904
+ return $bda7a7e55e1ff206$var$iterable(() => this.iterateCollection(props));
1905
+ }
1906
+ *iterateCollection(props) {
1907
+ let { children, items } = props;
1908
+ if (React.isValidElement(children) && children.type === React.Fragment) yield* this.iterateCollection({
1909
+ children: children.props.children,
1910
+ items
1911
+ });
1912
+ else if (typeof children === "function") {
1913
+ if (!items) throw new Error("props.children was a function but props.items is missing");
1914
+ let index = 0;
1915
+ for (let item of items) {
1916
+ yield* this.getFullNode({
1917
+ value: item,
1918
+ index
1919
+ }, { renderer: children });
1920
+ index++;
1921
+ }
1922
+ } else {
1923
+ let items = [];
1924
+ React.Children.forEach(children, (child) => {
1925
+ if (child) items.push(child);
1926
+ });
1927
+ let index = 0;
1928
+ for (let item of items) {
1929
+ let nodes = this.getFullNode({
1930
+ element: item,
1931
+ index
1932
+ }, {});
1933
+ for (let node of nodes) {
1934
+ index++;
1935
+ yield node;
1936
+ }
1937
+ }
1938
+ }
1939
+ }
1940
+ getKey(item, partialNode, state, parentKey) {
1941
+ if (item.key != null) return item.key;
1942
+ if (partialNode.type === "cell" && partialNode.key != null) return `${parentKey}${partialNode.key}`;
1943
+ let v = partialNode.value;
1944
+ if (v != null) {
1945
+ let key = v.key ?? v.id;
1946
+ if (key == null) throw new Error("No key found for item");
1947
+ return key;
1948
+ }
1949
+ return parentKey ? `${parentKey}.${partialNode.index}` : `$.${partialNode.index}`;
1950
+ }
1951
+ getChildState(state, partialNode) {
1952
+ return { renderer: partialNode.renderer || state.renderer };
1953
+ }
1954
+ *getFullNode(partialNode, state, parentKey, parentNode) {
1955
+ if (React.isValidElement(partialNode.element) && partialNode.element.type === React.Fragment) {
1956
+ let children = [];
1957
+ React.Children.forEach(partialNode.element.props.children, (child) => {
1958
+ children.push(child);
1959
+ });
1960
+ let index = partialNode.index ?? 0;
1961
+ for (const child of children) yield* this.getFullNode({
1962
+ element: child,
1963
+ index: index++
1964
+ }, state, parentKey, parentNode);
1965
+ return;
1966
+ }
1967
+ let element = partialNode.element;
1968
+ if (!element && partialNode.value && state && state.renderer) {
1969
+ let cached = this.cache.get(partialNode.value);
1970
+ if (cached && (!cached.shouldInvalidate || !cached.shouldInvalidate(this.context))) {
1971
+ cached.index = partialNode.index;
1972
+ cached.parentKey = parentNode ? parentNode.key : null;
1973
+ yield cached;
1974
+ return;
1975
+ }
1976
+ element = state.renderer(partialNode.value);
1977
+ }
1978
+ if (React.isValidElement(element)) {
1979
+ let type = element.type;
1980
+ if (typeof type !== "function" && typeof type.getCollectionNode !== "function") {
1981
+ let name = element.type;
1982
+ throw new Error(`Unknown element <${name}> in collection.`);
1983
+ }
1984
+ let childNodes = type.getCollectionNode(element.props, this.context);
1985
+ let index = partialNode.index ?? 0;
1986
+ let result = childNodes.next();
1987
+ while (!result.done && result.value) {
1988
+ let childNode = result.value;
1989
+ partialNode.index = index;
1990
+ let nodeKey = childNode.key ?? null;
1991
+ if (nodeKey == null) nodeKey = childNode.element ? null : this.getKey(element, partialNode, state, parentKey);
1992
+ let children = [...this.getFullNode({
1993
+ ...childNode,
1994
+ key: nodeKey,
1995
+ index,
1996
+ wrapper: $bda7a7e55e1ff206$var$compose(partialNode.wrapper, childNode.wrapper)
1997
+ }, this.getChildState(state, childNode), parentKey ? `${parentKey}${element.key}` : element.key, parentNode)];
1998
+ for (let node of children) {
1999
+ node.value = childNode.value ?? partialNode.value ?? null;
2000
+ if (node.value) this.cache.set(node.value, node);
2001
+ if (partialNode.type && node.type !== partialNode.type) throw new Error(`Unsupported type <${$bda7a7e55e1ff206$var$capitalize(node.type)}> in <${$bda7a7e55e1ff206$var$capitalize(parentNode?.type ?? "unknown parent type")}>. Only <${$bda7a7e55e1ff206$var$capitalize(partialNode.type)}> is supported.`);
2002
+ index++;
2003
+ yield node;
2004
+ }
2005
+ result = childNodes.next(children);
2006
+ }
2007
+ return;
2008
+ }
2009
+ if (partialNode.key == null || partialNode.type == null) return;
2010
+ let builder = this;
2011
+ let node = {
2012
+ type: partialNode.type,
2013
+ props: partialNode.props,
2014
+ key: partialNode.key,
2015
+ parentKey: parentNode ? parentNode.key : null,
2016
+ value: partialNode.value ?? null,
2017
+ level: (parentNode?.level ?? 0) + (parentNode?.type === "item" ? 1 : 0),
2018
+ index: partialNode.index,
2019
+ rendered: partialNode.rendered,
2020
+ textValue: partialNode.textValue ?? "",
2021
+ "aria-label": partialNode["aria-label"],
2022
+ wrapper: partialNode.wrapper,
2023
+ shouldInvalidate: partialNode.shouldInvalidate,
2024
+ hasChildNodes: partialNode.hasChildNodes || false,
2025
+ childNodes: $bda7a7e55e1ff206$var$iterable(function* () {
2026
+ if (!partialNode.hasChildNodes || !partialNode.childNodes) return;
2027
+ let index = 0;
2028
+ for (let child of partialNode.childNodes()) {
2029
+ if (child.key != null) child.key = `${node.key}${child.key}`;
2030
+ let nodes = builder.getFullNode({
2031
+ ...child,
2032
+ index
2033
+ }, builder.getChildState(state, child), node.key, node);
2034
+ for (let node of nodes) {
2035
+ index++;
2036
+ yield node;
2037
+ }
2038
+ }
2039
+ })
2040
+ };
2041
+ yield node;
2042
+ }
2043
+ constructor() {
2044
+ this.cache = new WeakMap();
2173
2045
  }
2174
2046
  };
2047
+ function $bda7a7e55e1ff206$var$iterable(iterator) {
2048
+ let cache = [];
2049
+ let iterable = null;
2050
+ return { *[Symbol.iterator]() {
2051
+ for (let item of cache) yield item;
2052
+ if (!iterable) iterable = iterator();
2053
+ for (let item of iterable) {
2054
+ cache.push(item);
2055
+ yield item;
2056
+ }
2057
+ } };
2058
+ }
2059
+ function $bda7a7e55e1ff206$var$compose(outer, inner) {
2060
+ if (outer && inner) return (element) => outer(inner(element));
2061
+ if (outer) return outer;
2062
+ if (inner) return inner;
2063
+ }
2064
+ function $bda7a7e55e1ff206$var$capitalize(str) {
2065
+ return str[0].toUpperCase() + str.slice(1);
2066
+ }
2067
+ //#endregion
2068
+ //#region node_modules/react-stately/dist/private/collections/useCollection.mjs
2069
+ function $d03379b88399b8c5$export$6cd28814d92fa9c9(props, factory, context) {
2070
+ let builder = useMemo(() => new $bda7a7e55e1ff206$export$bf788dd355e3a401(), []);
2071
+ let { children, items, collection } = props;
2072
+ return useMemo(() => {
2073
+ if (collection) return collection;
2074
+ return factory(builder.build({
2075
+ children,
2076
+ items
2077
+ }, context));
2078
+ }, [
2079
+ builder,
2080
+ children,
2081
+ items,
2082
+ collection,
2083
+ context,
2084
+ factory
2085
+ ]);
2086
+ }
2175
2087
  //#endregion
2176
- export { $21f1aa98acb08317$export$c57958e35f31ed73 as A, $55f9b1ae81f22853$export$6c5dc7e81d2cc29a as C, $5671b20cf9b562b2$export$447a38995de2c711 as D, $8a26561d2877236e$export$c24ed0104d07eab9 as E, $5671b20cf9b562b2$export$831c820ad60f9d12 as O, $55f9b1ae81f22853$export$2b35b76d2e30e129 as S, $55f9b1ae81f22853$export$76e4e37e5339496d as T, $7613b1592d41b092$export$6cd28814d92fa9c9 as _, $7135fc7d473fd974$export$a164736487e3f0ae as a, $fb3050f43d946246$export$e32c88dfddc6e1d8 as b, $e1995378a142960e$export$bf788dd355e3a401 as c, $23b9f4fcf0fe224b$export$437f11dc9b403b78 as d, $23b9f4fcf0fe224b$export$5ae2504e948afce5 as f, $c5a24bc478652b5f$export$1005530eda016c13 as g, $23b9f4fcf0fe224b$export$fd11f34e1d07f134 as h, $7135fc7d473fd974$export$90e00781bc59d8f9 as i, $cc38e7bd3fc7b213$export$2bb74740c4e19def as j, $21f1aa98acb08317$export$16792effe837dba3 as k, $e1995378a142960e$export$e953bb1cd0f19726 as l, $23b9f4fcf0fe224b$export$d68d59712b04d9d1 as m, $7af3f5b51489e0b5$export$253fe78d46329472 as n, $7135fc7d473fd974$export$d40e14dec8b060a8 as o, $23b9f4fcf0fe224b$export$8258a0665a675899 as p, $7135fc7d473fd974$export$4feb769f8ddf26c5 as r, $e1995378a142960e$export$18af5c7a9e9b3664 as s, $d496c0a20b6e58ec$export$6c8a5aaad13c9852 as t, $e1995378a142960e$export$fb8073518f34e6ec as u, $880e95eb8b93ba9a$export$ecf600387e221c37 as v, $55f9b1ae81f22853$export$759df0d867455a91 as w, $feb5ffebff200149$export$c3d8340acf92597f as x, $ae20dd8cbca75726$export$d6daf82dcd84e87c as y };
2088
+ export { $6f0c29017aeec335$export$fd11f34e1d07f134 as C, $6f0c29017aeec335$export$d68d59712b04d9d1 as S, $42ceafc619f9c3ba$export$e953bb1cd0f19726 as _, $f6ba6936bfd098a0$export$ecf600387e221c37 as a, $6f0c29017aeec335$export$5ae2504e948afce5 as b, $f5a4a9a3486154da$export$e32c88dfddc6e1d8 as c, $263ab7fc0f95ccdb$export$4feb769f8ddf26c5 as d, $263ab7fc0f95ccdb$export$90e00781bc59d8f9 as f, $42ceafc619f9c3ba$export$bf788dd355e3a401 as g, $42ceafc619f9c3ba$export$18af5c7a9e9b3664 as h, $cd5ea4b915021f1d$export$1005530eda016c13 as i, $22bbea12c2567021$export$c3d8340acf92597f as l, $263ab7fc0f95ccdb$export$d40e14dec8b060a8 as m, $4a07ac835f260f78$export$6c8a5aaad13c9852 as n, $7b01448eaad0fe7c$export$c24ed0104d07eab9 as o, $263ab7fc0f95ccdb$export$a164736487e3f0ae as p, $60f19cefd567a3e4$export$253fe78d46329472 as r, $d667c2af82d35a98$export$d6daf82dcd84e87c as s, $d03379b88399b8c5$export$6cd28814d92fa9c9 as t, $901761b40e390936$export$2bb74740c4e19def as u, $42ceafc619f9c3ba$export$fb8073518f34e6ec as v, $6f0c29017aeec335$export$8258a0665a675899 as x, $6f0c29017aeec335$export$437f11dc9b403b78 as y };