@vlrc-fe/components 3.0.3 → 3.0.4

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 (682) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +10 -1
  3. package/bin/registry.mjs +1124 -0
  4. package/bin/vlrc.mjs +102 -7
  5. package/dist/ConfirmModal.cjs +276 -1
  6. package/dist/ConfirmModal.js +119 -103
  7. package/dist/DataTable/DataTable.cjs +203 -1
  8. package/dist/DataTable/DataTable.js +161 -120
  9. package/dist/DataTable/components/DataTableColumnHeader.cjs +214 -1
  10. package/dist/DataTable/components/DataTableColumnHeader.d.ts +3 -3
  11. package/dist/DataTable/components/DataTableColumnHeader.d.ts.map +1 -1
  12. package/dist/DataTable/components/DataTableColumnHeader.js +201 -103
  13. package/dist/DataTable/components/DataTableFacetedFilter.cjs +332 -1
  14. package/dist/DataTable/components/DataTableFacetedFilter.d.ts +3 -3
  15. package/dist/DataTable/components/DataTableFacetedFilter.d.ts.map +1 -1
  16. package/dist/DataTable/components/DataTableFacetedFilter.js +285 -181
  17. package/dist/DataTable/components/DataTablePagination.cjs +200 -1
  18. package/dist/DataTable/components/DataTablePagination.js +188 -91
  19. package/dist/DataTable/components/DataTableRowActions.cjs +172 -1
  20. package/dist/DataTable/components/DataTableRowActions.js +161 -62
  21. package/dist/DataTable/components/DataTableTable.cjs +100 -1
  22. package/dist/DataTable/components/DataTableTable.js +87 -35
  23. package/dist/DataTable/components/DataTableToolbar.cjs +112 -1
  24. package/dist/DataTable/components/DataTableToolbar.js +106 -44
  25. package/dist/DataTable/components/DataTableViewOptions.cjs +113 -1
  26. package/dist/DataTable/components/DataTableViewOptions.js +105 -44
  27. package/dist/DataTable/render/createColumns.cjs +84 -1
  28. package/dist/DataTable/render/createColumns.js +65 -44
  29. package/dist/DataTable/render/defaults.cjs +38 -1
  30. package/dist/DataTable/render/defaults.js +18 -13
  31. package/dist/Dropdown/Dropdown.cjs +255 -1
  32. package/dist/Dropdown/Dropdown.js +138 -108
  33. package/dist/Form/Form.cjs +439 -1
  34. package/dist/Form/Form.js +417 -206
  35. package/dist/Form/FormDatePicker/FormDatePicker.cjs +84 -1
  36. package/dist/Form/FormDatePicker/FormDatePicker.js +68 -65
  37. package/dist/Form/FormDatePicker/MonthPickerPanel.cjs +217 -1
  38. package/dist/Form/FormDatePicker/MonthPickerPanel.js +194 -101
  39. package/dist/Form/FormDatePicker/RangeDatePicker.cjs +144 -1
  40. package/dist/Form/FormDatePicker/RangeDatePicker.js +94 -77
  41. package/dist/Form/FormDatePicker/SingleDatePicker.cjs +191 -1
  42. package/dist/Form/FormDatePicker/SingleDatePicker.js +144 -114
  43. package/dist/Form/FormDatePicker/TimeInput.cjs +172 -1
  44. package/dist/Form/FormDatePicker/TimeInput.js +162 -79
  45. package/dist/Form/FormDatePicker/TimePicker.cjs +107 -1
  46. package/dist/Form/FormDatePicker/TimePicker.js +58 -43
  47. package/dist/Form/FormDatePicker/YearPickerPanel.cjs +184 -1
  48. package/dist/Form/FormDatePicker/YearPickerPanel.js +164 -84
  49. package/dist/Form/FormDatePicker/types.cjs +10 -1
  50. package/dist/Form/FormDatePicker/types.js +8 -3
  51. package/dist/Form/FormDatePicker/useFormDatePicker.cjs +70 -1
  52. package/dist/Form/FormDatePicker/useFormDatePicker.js +58 -31
  53. package/dist/Form/FormFileUpload/FileUpload.cjs +603 -1
  54. package/dist/Form/FormFileUpload/FileUpload.js +452 -306
  55. package/dist/Form/FormFileUpload/index.cjs +175 -1
  56. package/dist/Form/FormFileUpload/index.js +164 -50
  57. package/dist/Form/FormMultiSelect/FormMultiSelect.cjs +46 -1
  58. package/dist/Form/FormMultiSelect/FormMultiSelect.js +42 -22
  59. package/dist/Form/FormNumberInput/FormNumberInput.cjs +71 -1
  60. package/dist/Form/FormNumberInput/FormNumberInput.js +60 -58
  61. package/dist/Form/FormNumberInput/StepperControls.cjs +104 -1
  62. package/dist/Form/FormNumberInput/StepperControls.js +78 -43
  63. package/dist/Form/FormNumberInput/useFormNumberInput.cjs +72 -1
  64. package/dist/Form/FormNumberInput/useFormNumberInput.js +68 -39
  65. package/dist/Form/FormRadioGroup/FormRadio.cjs +65 -1
  66. package/dist/Form/FormRadioGroup/FormRadio.js +38 -38
  67. package/dist/Form/FormRadioGroup/useFormRadio.cjs +38 -1
  68. package/dist/Form/FormRadioGroup/useFormRadio.js +27 -16
  69. package/dist/Form/FormSelect/FormSelect.cjs +46 -1
  70. package/dist/Form/FormSelect/FormSelect.js +40 -26
  71. package/dist/Form/FormSelect/useFormSelect.cjs +58 -1
  72. package/dist/Form/FormSelect/useFormSelect.js +52 -43
  73. package/dist/Icons/Icons.cjs +155 -1
  74. package/dist/Icons/Icons.js +142 -142
  75. package/dist/Modal.cjs +135 -1
  76. package/dist/Modal.js +67 -54
  77. package/dist/MultiSelect/MultiSelect.cjs +211 -1
  78. package/dist/MultiSelect/MultiSelect.js +127 -117
  79. package/dist/MultiSelect/renderers.cjs +571 -1
  80. package/dist/MultiSelect/renderers.js +508 -309
  81. package/dist/MultiSelect/useMultiSelect.cjs +243 -1
  82. package/dist/MultiSelect/useMultiSelect.js +207 -127
  83. package/dist/MultiSelect/utils.cjs +123 -1
  84. package/dist/MultiSelect/utils.js +79 -51
  85. package/dist/Select/BaseSelect.cjs +265 -1
  86. package/dist/Select/BaseSelect.js +165 -126
  87. package/dist/Select/MultiSelectTags.cjs +129 -1
  88. package/dist/Select/MultiSelectTags.js +82 -56
  89. package/dist/Typography/Blockquote.cjs +79 -1
  90. package/dist/Typography/Blockquote.js +40 -38
  91. package/dist/Typography/Code.cjs +131 -1
  92. package/dist/Typography/Code.js +64 -58
  93. package/dist/Typography/Link.cjs +141 -1
  94. package/dist/Typography/Link.d.ts +1 -2
  95. package/dist/Typography/Link.d.ts.map +1 -1
  96. package/dist/Typography/Link.js +74 -63
  97. package/dist/Typography/Paragraph.cjs +226 -1
  98. package/dist/Typography/Paragraph.d.ts +1 -2
  99. package/dist/Typography/Paragraph.d.ts.map +1 -1
  100. package/dist/Typography/Paragraph.js +119 -107
  101. package/dist/Typography/Text.cjs +224 -1
  102. package/dist/Typography/Text.d.ts +1 -2
  103. package/dist/Typography/Text.d.ts.map +1 -1
  104. package/dist/Typography/Text.js +117 -100
  105. package/dist/Typography/Title.cjs +220 -1
  106. package/dist/Typography/Title.d.ts +1 -2
  107. package/dist/Typography/Title.d.ts.map +1 -1
  108. package/dist/Typography/Title.js +125 -103
  109. package/dist/Typography/Typography.cjs +17 -1
  110. package/dist/Typography/Typography.js +14 -14
  111. package/dist/Typography/index.d.ts +1 -1
  112. package/dist/Typography/index.d.ts.map +1 -1
  113. package/dist/Typography/index.js +13 -13
  114. package/dist/Typography/tooltip.cjs +42 -1
  115. package/dist/Typography/tooltip.js +34 -14
  116. package/dist/Typography/types.cjs +20 -1
  117. package/dist/Typography/types.js +5 -2
  118. package/dist/Typography/utils.cjs +52 -1
  119. package/dist/Typography/utils.js +48 -21
  120. package/dist/Typography/weightStyles.cjs +58 -1
  121. package/dist/Typography/weightStyles.js +26 -25
  122. package/dist/_virtual/_rolldown/runtime.cjs +32 -1
  123. package/dist/_virtual/_rolldown/runtime.js +9 -7
  124. package/dist/assets/stylex.css +135 -1
  125. package/dist/astryx.cjs +18 -1
  126. package/dist/astryx.d.ts.map +1 -1
  127. package/dist/astryx.js +2 -1
  128. package/dist/index.cjs +789 -1
  129. package/dist/index.js +122 -118
  130. package/dist/layout/Box.cjs +203 -1
  131. package/dist/layout/Box.d.ts +8 -8
  132. package/dist/layout/Box.d.ts.map +1 -1
  133. package/dist/layout/Box.js +138 -49
  134. package/dist/layout/Center.cjs +51 -1
  135. package/dist/layout/Center.d.ts +3 -3
  136. package/dist/layout/Center.d.ts.map +1 -1
  137. package/dist/layout/Center.js +49 -20
  138. package/dist/layout/Container.cjs +81 -1
  139. package/dist/layout/Container.d.ts +8 -8
  140. package/dist/layout/Container.d.ts.map +1 -1
  141. package/dist/layout/Container.js +34 -30
  142. package/dist/layout/Stack.cjs +237 -1
  143. package/dist/layout/Stack.d.ts +9 -9
  144. package/dist/layout/Stack.d.ts.map +1 -1
  145. package/dist/layout/Stack.js +220 -75
  146. package/dist/layout/index.js +9 -9
  147. package/dist/lazyLoad.cjs +13 -1
  148. package/dist/lazyLoad.js +9 -9
  149. package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.cjs +551 -1
  150. package/dist/node_modules/.pnpm/@floating-ui_core@1.8.0/node_modules/@floating-ui/core/dist/floating-ui.core.js +440 -234
  151. package/dist/node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.cjs +546 -1
  152. package/dist/node_modules/.pnpm/@floating-ui_dom@1.8.0/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +452 -236
  153. package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.cjs +330 -1
  154. package/dist/node_modules/.pnpm/@floating-ui_react-dom@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +272 -164
  155. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.cjs +150 -1
  156. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.cjs +132 -1
  157. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +90 -74
  158. package/dist/node_modules/.pnpm/@floating-ui_utils@0.2.12/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +92 -67
  159. package/dist/node_modules/.pnpm/@radix-ui_number@1.1.3/node_modules/@radix-ui/number/dist/index.cjs +11 -1
  160. package/dist/node_modules/.pnpm/@radix-ui_number@1.1.3/node_modules/@radix-ui/number/dist/index.js +8 -7
  161. package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.7/node_modules/@radix-ui/primitive/dist/index.cjs +48 -1
  162. package/dist/node_modules/.pnpm/@radix-ui_primitive@1.1.7/node_modules/@radix-ui/primitive/dist/index.js +34 -31
  163. package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_023ac3f94ac95798b92bc4b7f556cbda/node_modules/@radix-ui/react-alert-dialog/dist/index.cjs +145 -1
  164. package/dist/node_modules/.pnpm/@radix-ui_react-alert-dialog@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_023ac3f94ac95798b92bc4b7f556cbda/node_modules/@radix-ui/react-alert-dialog/dist/index.js +111 -73
  165. package/dist/node_modules/.pnpm/@radix-ui_react-aspect-ratio@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_3fe40fa8e2833eaf8803b46e02e4c30f/node_modules/@radix-ui/react-aspect-ratio/dist/index.cjs +38 -1
  166. package/dist/node_modules/.pnpm/@radix-ui_react-aspect-ratio@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_3fe40fa8e2833eaf8803b46e02e4c30f/node_modules/@radix-ui/react-aspect-ratio/dist/index.js +19 -16
  167. package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.2.6_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_c3568bdf5c60d38014d320037c857c95/node_modules/@radix-ui/react-avatar/dist/index.cjs +126 -1
  168. package/dist/node_modules/.pnpm/@radix-ui_react-avatar@1.2.6_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_c3568bdf5c60d38014d320037c857c95/node_modules/@radix-ui/react-avatar/dist/index.js +103 -72
  169. package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.20_@types_react-dom@19.3.0_@types_react@19.3.0__@types__75f9b408b6aa016f78c6c390e6f84227/node_modules/@radix-ui/react-collapsible/dist/index.cjs +134 -1
  170. package/dist/node_modules/.pnpm/@radix-ui_react-collapsible@1.1.20_@types_react-dom@19.3.0_@types_react@19.3.0__@types__75f9b408b6aa016f78c6c390e6f84227/node_modules/@radix-ui/react-collapsible/dist/index.js +113 -79
  171. package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_5961dc5beb3cb19a205dfdbd3304cbe5/node_modules/@radix-ui/react-collection/dist/index.cjs +541 -1
  172. package/dist/node_modules/.pnpm/@radix-ui_react-collection@1.1.15_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_5961dc5beb3cb19a205dfdbd3304cbe5/node_modules/@radix-ui/react-collection/dist/index.js +459 -331
  173. package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +39 -1
  174. package/dist/node_modules/.pnpm/@radix-ui_react-compose-refs@1.1.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-compose-refs/dist/index.js +26 -22
  175. package/dist/node_modules/.pnpm/@radix-ui_react-context-menu@2.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types__30d9c1a1570dd32a7a328fd93feebae9/node_modules/@radix-ui/react-context-menu/dist/index.cjs +304 -1
  176. package/dist/node_modules/.pnpm/@radix-ui_react-context-menu@2.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types__30d9c1a1570dd32a7a328fd93feebae9/node_modules/@radix-ui/react-context-menu/dist/index.js +234 -160
  177. package/dist/node_modules/.pnpm/@radix-ui_react-context@1.2.2_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-context/dist/index.cjs +108 -1
  178. package/dist/node_modules/.pnpm/@radix-ui_react-context@1.2.2_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-context/dist/index.js +82 -67
  179. package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-direction/dist/index.cjs +19 -1
  180. package/dist/node_modules/.pnpm/@radix-ui_react-direction@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-direction/dist/index.js +12 -10
  181. package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@_221317ca07dfdaa6590fc49e548d4242/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +275 -1
  182. package/dist/node_modules/.pnpm/@radix-ui_react-dismissable-layer@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@_221317ca07dfdaa6590fc49e548d4242/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +228 -127
  183. package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +53 -1
  184. package/dist/node_modules/.pnpm/@radix-ui_react-focus-guards@1.1.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-focus-guards/dist/index.js +40 -22
  185. package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.16_@types_react-dom@19.3.0_@types_react@19.3.0__@types__3593711fa410ee31279d746c57990974/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +215 -1
  186. package/dist/node_modules/.pnpm/@radix-ui_react-focus-scope@1.1.16_@types_react-dom@19.3.0_@types_react@19.3.0__@types__3593711fa410ee31279d746c57990974/node_modules/@radix-ui/react-focus-scope/dist/index.js +171 -117
  187. package/dist/node_modules/.pnpm/@radix-ui_react-hover-card@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_a8ac333b78a7741970303e37358b886d/node_modules/@radix-ui/react-hover-card/dist/index.cjs +219 -1
  188. package/dist/node_modules/.pnpm/@radix-ui_react-hover-card@1.1.23_@types_react-dom@19.3.0_@types_react@19.3.0__@types_r_a8ac333b78a7741970303e37358b886d/node_modules/@radix-ui/react-hover-card/dist/index.js +178 -118
  189. package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-id/dist/index.cjs +22 -1
  190. package/dist/node_modules/.pnpm/@radix-ui_react-id@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-id/dist/index.js +17 -13
  191. package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_bd1746795e703f342b2f4982589d4efb/node_modules/@radix-ui/react-menu/dist/index.cjs +802 -1
  192. package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_bd1746795e703f342b2f4982589d4efb/node_modules/@radix-ui/react-menu/dist/index.js +648 -422
  193. package/dist/node_modules/.pnpm/@radix-ui_react-menubar@1.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_reac_b8d55f7c7c6b477421e3cc1ba6fb334b/node_modules/@radix-ui/react-menubar/dist/index.cjs +410 -1
  194. package/dist/node_modules/.pnpm/@radix-ui_react-menubar@1.1.24_@types_react-dom@19.3.0_@types_react@19.3.0__@types_reac_b8d55f7c7c6b477421e3cc1ba6fb334b/node_modules/@radix-ui/react-menubar/dist/index.js +313 -212
  195. package/dist/node_modules/.pnpm/@radix-ui_react-navigation-menu@1.2.22_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_fde94e4aef42debd49119dde2ad3b250/node_modules/@radix-ui/react-navigation-menu/dist/index.cjs +741 -1
  196. package/dist/node_modules/.pnpm/@radix-ui_react-navigation-menu@1.2.22_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_fde94e4aef42debd49119dde2ad3b250/node_modules/@radix-ui/react-navigation-menu/dist/index.js +602 -417
  197. package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_ca4fb1e7b10e21399fbf7b38c61d930c/node_modules/@radix-ui/react-popper/dist/index.cjs +246 -1
  198. package/dist/node_modules/.pnpm/@radix-ui_react-popper@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_ca4fb1e7b10e21399fbf7b38c61d930c/node_modules/@radix-ui/react-popper/dist/index.js +195 -121
  199. package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.17_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_dcf9598b366f9d4cb930092169158fb6/node_modules/@radix-ui/react-portal/dist/index.cjs +27 -1
  200. package/dist/node_modules/.pnpm/@radix-ui_react-portal@1.1.17_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_dcf9598b366f9d4cb930092169158fb6/node_modules/@radix-ui/react-portal/dist/index.js +20 -17
  201. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_rea_d7b4951725c0f0b9fd732151cb937913/node_modules/@radix-ui/react-presence/dist/index.cjs +148 -1
  202. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_rea_d7b4951725c0f0b9fd732151cb937913/node_modules/@radix-ui/react-presence/dist/index.js +115 -67
  203. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_re_b879c40dbdb8ea08e1db9842f10f20a8/node_modules/@radix-ui/react-primitive/dist/index.cjs +55 -1
  204. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.10_@types_react-dom@19.3.0_@types_react@19.3.0__@types_re_b879c40dbdb8ea08e1db9842f10f20a8/node_modules/@radix-ui/react-primitive/dist/index.js +27 -21
  205. package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_43a41e6ed06e4781ce7b1fb0f0076623/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +223 -1
  206. package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_43a41e6ed06e4781ce7b1fb0f0076623/node_modules/@radix-ui/react-roving-focus/dist/index.js +179 -131
  207. package/dist/node_modules/.pnpm/@radix-ui_react-slider@1.4.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_0a49b18268a9d1d70ad7e785633a1513/node_modules/@radix-ui/react-slider/dist/index.cjs +576 -1
  208. package/dist/node_modules/.pnpm/@radix-ui_react-slider@1.4.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_0a49b18268a9d1d70ad7e785633a1513/node_modules/@radix-ui/react-slider/dist/index.js +437 -308
  209. package/dist/node_modules/.pnpm/@radix-ui_react-switch@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_f8723a7bd506c0f648804ec2dc0f18e3/node_modules/@radix-ui/react-switch/dist/index.cjs +202 -1
  210. package/dist/node_modules/.pnpm/@radix-ui_react-switch@1.3.7_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@_f8723a7bd506c0f648804ec2dc0f18e3/node_modules/@radix-ui/react-switch/dist/index.js +160 -125
  211. package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.21_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_2c04ca1fb5fd914a25ee24a303bd8469/node_modules/@radix-ui/react-tabs/dist/index.cjs +159 -1
  212. package/dist/node_modules/.pnpm/@radix-ui_react-tabs@1.1.21_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@1_2c04ca1fb5fd914a25ee24a303bd8469/node_modules/@radix-ui/react-tabs/dist/index.js +125 -93
  213. package/dist/node_modules/.pnpm/@radix-ui_react-toggle-group@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_e645c0ca626436d86b14232bd158d09b/node_modules/@radix-ui/react-toggle-group/dist/index.cjs +158 -1
  214. package/dist/node_modules/.pnpm/@radix-ui_react-toggle-group@1.1.19_@types_react-dom@19.3.0_@types_react@19.3.0__@types_e645c0ca626436d86b14232bd158d09b/node_modules/@radix-ui/react-toggle-group/dist/index.js +128 -98
  215. package/dist/node_modules/.pnpm/@radix-ui_react-toggle@1.1.18_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_f121473145ec675e8ab50657e8e97e06/node_modules/@radix-ui/react-toggle/dist/index.cjs +39 -1
  216. package/dist/node_modules/.pnpm/@radix-ui_react-toggle@1.1.18_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react_f121473145ec675e8ab50657e8e97e06/node_modules/@radix-ui/react-toggle/dist/index.js +29 -24
  217. package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +19 -1
  218. package/dist/node_modules/.pnpm/@radix-ui_react-use-callback-ref@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +13 -11
  219. package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +109 -1
  220. package/dist/node_modules/.pnpm/@radix-ui_react-use-controllable-state@1.2.6_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +91 -68
  221. package/dist/node_modules/.pnpm/@radix-ui_react-use-effect-event@0.0.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-effect-event/dist/index.cjs +28 -1
  222. package/dist/node_modules/.pnpm/@radix-ui_react-use-effect-event@0.0.5_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-effect-event/dist/index.js +22 -17
  223. package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.3_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-is-hydrated/dist/index.cjs +33 -1
  224. package/dist/node_modules/.pnpm/@radix-ui_react-use-is-hydrated@0.1.3_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +25 -19
  225. package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +7 -1
  226. package/dist/node_modules/.pnpm/@radix-ui_react-use-layout-effect@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +3 -3
  227. package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-previous/dist/index.cjs +25 -1
  228. package/dist/node_modules/.pnpm/@radix-ui_react-use-previous@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-previous/dist/index.js +18 -11
  229. package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-size/dist/index.cjs +47 -1
  230. package/dist/node_modules/.pnpm/@radix-ui_react-use-size@1.1.4_@types_react@19.3.0_react@19.3.1/node_modules/@radix-ui/react-use-size/dist/index.js +38 -28
  231. package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.11_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_ef452cff5863a129db7ebc4b37ab07c3/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +38 -1
  232. package/dist/node_modules/.pnpm/@radix-ui_react-visually-hidden@1.2.11_@types_react-dom@19.3.0_@types_react@19.3.0__@ty_ef452cff5863a129db7ebc4b37ab07c3/node_modules/@radix-ui/react-visually-hidden/dist/index.js +19 -15
  233. package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.cjs +106 -1
  234. package/dist/node_modules/.pnpm/aria-hidden@1.2.6/node_modules/aria-hidden/dist/es2015/index.js +95 -34
  235. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/addLeadingZeros.cjs +5 -1
  236. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/addLeadingZeros.js +3 -3
  237. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/defaultOptions.cjs +6 -1
  238. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/defaultOptions.js +4 -4
  239. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/formatters.cjs +423 -1
  240. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/formatters.js +237 -202
  241. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/lightFormatters.cjs +45 -1
  242. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/lightFormatters.js +35 -32
  243. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/longFormatters.cjs +42 -1
  244. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/format/longFormatters.js +37 -32
  245. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.cjs +20 -1
  246. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -5
  247. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeDates.cjs +7 -1
  248. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/normalizeDates.js +5 -5
  249. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/protectedTokens.cjs +27 -1
  250. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/_lib/protectedTokens.js +15 -12
  251. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.cjs +45 -1
  252. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constants.js +41 -4
  253. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.cjs +45 -1
  254. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/constructFrom.js +42 -4
  255. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarDays.cjs +49 -1
  256. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/differenceInCalendarDays.js +46 -8
  257. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/format.cjs +358 -1
  258. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/format.js +341 -45
  259. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDayOfYear.cjs +31 -1
  260. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getDayOfYear.js +28 -7
  261. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeek.cjs +35 -1
  262. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeek.js +32 -8
  263. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeekYear.cjs +44 -1
  264. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getISOWeekYear.js +41 -11
  265. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeek.cjs +49 -1
  266. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeek.js +46 -8
  267. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeekYear.cjs +61 -1
  268. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/getWeekYear.js +58 -12
  269. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isDate.cjs +38 -1
  270. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isDate.js +35 -3
  271. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isValid.cjs +39 -1
  272. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/isValid.js +36 -5
  273. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.cjs +8 -1
  274. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +5 -5
  275. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.cjs +50 -1
  276. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +45 -11
  277. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchFn.cjs +27 -1
  278. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchFn.js +20 -14
  279. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.cjs +18 -1
  280. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +13 -12
  281. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.cjs +77 -1
  282. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +14 -5
  283. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatLong.cjs +31 -1
  284. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js +6 -6
  285. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.cjs +11 -1
  286. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +4 -3
  287. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/localize.cjs +210 -1
  288. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/localize.js +197 -188
  289. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/match.cjs +122 -1
  290. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US/_lib/match.js +12 -12
  291. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.cjs +28 -1
  292. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/locale/en-US.js +20 -12
  293. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfDay.cjs +34 -1
  294. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfDay.js +31 -5
  295. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeek.cjs +37 -1
  296. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeek.js +32 -5
  297. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeekYear.cjs +41 -1
  298. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfISOWeekYear.js +38 -7
  299. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeek.cjs +45 -1
  300. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeek.js +42 -6
  301. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeekYear.cjs +56 -1
  302. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfWeekYear.js +53 -8
  303. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfYear.cjs +35 -1
  304. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/startOfYear.js +32 -5
  305. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.cjs +45 -1
  306. package/dist/node_modules/.pnpm/date-fns@4.4.0/node_modules/date-fns/toDate.js +42 -4
  307. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.3.1/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.cjs +34 -1
  308. package/dist/node_modules/.pnpm/embla-carousel-react@8.6.0_react@19.3.1/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +32 -21
  309. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.cjs +39 -1
  310. package/dist/node_modules/.pnpm/embla-carousel-reactive-utils@8.6.0_embla-carousel@8.6.0/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +27 -20
  311. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.cjs +1391 -1
  312. package/dist/node_modules/.pnpm/embla-carousel@8.6.0/node_modules/embla-carousel/esm/embla-carousel.esm.js +1178 -803
  313. package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.cjs +7 -1
  314. package/dist/node_modules/.pnpm/get-nonce@1.0.1/node_modules/get-nonce/dist/es2015/index.js +3 -4
  315. package/dist/node_modules/.pnpm/input-otp@1.4.2_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/input-otp/dist/index.cjs +369 -2
  316. package/dist/node_modules/.pnpm/input-otp@1.4.2_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/input-otp/dist/index.js +282 -238
  317. package/dist/node_modules/.pnpm/react-hook-form@7.83.0_react@19.3.1/node_modules/react-hook-form/dist/index.esm.cjs +625 -1
  318. package/dist/node_modules/.pnpm/react-hook-form@7.83.0_react@19.3.1/node_modules/react-hook-form/dist/index.esm.js +545 -276
  319. package/dist/node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-number-format/dist/react-number-format.es.cjs +1033 -9
  320. package/dist/node_modules/.pnpm/react-number-format@5.4.5_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-number-format/dist/react-number-format.es.js +898 -460
  321. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +47 -38
  322. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/component.js +38 -64
  323. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +13 -1
  324. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +9 -2
  325. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/index.cjs +4 -1
  326. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +36 -1
  327. package/dist/node_modules/.pnpm/react-remove-scroll-bar@2.3.8_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +25 -16
  328. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +15 -1
  329. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/Combination.js +10 -10
  330. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +167 -4
  331. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +144 -93
  332. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/UI.cjs +63 -1
  333. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/UI.js +45 -35
  334. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +14 -1
  335. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +11 -9
  336. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +84 -1
  337. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +75 -43
  338. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/medium.cjs +3 -1
  339. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/medium.js +3 -3
  340. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +6 -1
  341. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.2_@types_react@19.3.0_react@19.3.1/node_modules/react-remove-scroll/dist/es2015/sidecar.js +5 -5
  342. package/dist/node_modules/.pnpm/react-resizable-panels@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.cjs +1617 -1
  343. package/dist/node_modules/.pnpm/react-resizable-panels@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js +1332 -874
  344. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/component.cjs +18 -1
  345. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/component.js +15 -7
  346. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/hook.cjs +26 -1
  347. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/hook.js +20 -10
  348. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/index.cjs +4 -1
  349. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/singleton.cjs +40 -1
  350. package/dist/node_modules/.pnpm/react-style-singleton@2.2.3_@types_react@19.3.0_react@19.3.1/node_modules/react-style-singleton/dist/es2015/singleton.js +29 -16
  351. package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.cjs +36 -1
  352. package/dist/node_modules/.pnpm/tslib@2.8.1/node_modules/tslib/tslib.es6.js +25 -14
  353. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +20 -1
  354. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/assignRef.js +18 -3
  355. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +46 -1
  356. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +38 -19
  357. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useRef.cjs +39 -1
  358. package/dist/node_modules/.pnpm/use-callback-ref@1.3.3_@types_react@19.3.0_react@19.3.1/node_modules/use-callback-ref/dist/es2015/useRef.js +29 -11
  359. package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/exports.cjs +18 -1
  360. package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/exports.js +13 -12
  361. package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/medium.cjs +81 -1
  362. package/dist/node_modules/.pnpm/use-sidecar@1.1.3_@types_react@19.3.0_react@19.3.1/node_modules/use-sidecar/dist/es2015/medium.js +58 -45
  363. package/dist/node_modules/.pnpm/vaul@1.1.2_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/vaul/dist/index.cjs +1252 -3
  364. package/dist/node_modules/.pnpm/vaul@1.1.2_@types_react-dom@19.3.0_@types_react@19.3.0__@types_react@19.3.0_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/vaul/dist/index.js +1003 -648
  365. package/dist/theme/index.cjs +63 -1
  366. package/dist/theme/index.js +31 -31
  367. package/dist/theme/spacing.cjs +93 -1
  368. package/dist/theme/spacing.js +52 -26
  369. package/dist/theme/tokens.stylex.cjs +210 -1
  370. package/dist/theme/tokens.stylex.js +58 -26
  371. package/dist/theme/types.cjs +13 -1
  372. package/dist/theme/types.js +4 -3
  373. package/dist/theme/width.cjs +39 -1
  374. package/dist/theme/width.js +16 -4
  375. package/dist/theme/zIndex.cjs +64 -1
  376. package/dist/theme/zIndex.js +44 -15
  377. package/dist/theme.css +135 -1
  378. package/dist/ui/accordion.cjs +431 -1
  379. package/dist/ui/accordion.d.ts +10 -10
  380. package/dist/ui/accordion.d.ts.map +1 -1
  381. package/dist/ui/accordion.js +276 -136
  382. package/dist/ui/action-bar.cjs +274 -1
  383. package/dist/ui/action-bar.d.ts +11 -11
  384. package/dist/ui/action-bar.d.ts.map +1 -1
  385. package/dist/ui/action-bar.js +204 -98
  386. package/dist/ui/alert-dialog.cjs +538 -1
  387. package/dist/ui/alert-dialog.d.ts +19 -19
  388. package/dist/ui/alert-dialog.d.ts.map +1 -1
  389. package/dist/ui/alert-dialog.js +459 -167
  390. package/dist/ui/alert.cjs +163 -1
  391. package/dist/ui/alert.d.ts +7 -7
  392. package/dist/ui/alert.d.ts.map +1 -1
  393. package/dist/ui/alert.js +111 -50
  394. package/dist/ui/aspect-ratio.cjs +25 -1
  395. package/dist/ui/aspect-ratio.d.ts +2 -2
  396. package/dist/ui/aspect-ratio.d.ts.map +1 -1
  397. package/dist/ui/aspect-ratio.js +22 -12
  398. package/dist/ui/avatar.cjs +341 -1
  399. package/dist/ui/avatar.d.ts +10 -10
  400. package/dist/ui/avatar.d.ts.map +1 -1
  401. package/dist/ui/avatar.js +226 -114
  402. package/dist/ui/badge-overflow.cjs +66 -1
  403. package/dist/ui/badge-overflow.d.ts +5 -5
  404. package/dist/ui/badge-overflow.d.ts.map +1 -1
  405. package/dist/ui/badge-overflow.js +34 -27
  406. package/dist/ui/badge.cjs +167 -1
  407. package/dist/ui/badge.d.ts +3 -3
  408. package/dist/ui/badge.d.ts.map +1 -1
  409. package/dist/ui/badge.js +48 -42
  410. package/dist/ui/breadcrumb.cjs +508 -1
  411. package/dist/ui/breadcrumb.d.ts +15 -15
  412. package/dist/ui/breadcrumb.d.ts.map +1 -1
  413. package/dist/ui/breadcrumb.js +386 -159
  414. package/dist/ui/button.cjs +425 -1
  415. package/dist/ui/button.d.ts +3 -3
  416. package/dist/ui/button.d.ts.map +1 -1
  417. package/dist/ui/button.js +137 -117
  418. package/dist/ui/calendar.cjs +626 -1
  419. package/dist/ui/calendar.d.ts +5 -5
  420. package/dist/ui/calendar.d.ts.map +1 -1
  421. package/dist/ui/calendar.js +309 -192
  422. package/dist/ui/card.cjs +401 -1
  423. package/dist/ui/card.d.ts +15 -15
  424. package/dist/ui/card.d.ts.map +1 -1
  425. package/dist/ui/card.js +300 -119
  426. package/dist/ui/carousel.cjs +333 -1
  427. package/dist/ui/carousel.d.ts +10 -10
  428. package/dist/ui/carousel.d.ts.map +1 -1
  429. package/dist/ui/carousel.js +245 -126
  430. package/dist/ui/checkbox.cjs +167 -1
  431. package/dist/ui/checkbox.d.ts +4 -4
  432. package/dist/ui/checkbox.d.ts.map +1 -1
  433. package/dist/ui/checkbox.js +66 -58
  434. package/dist/ui/circular-progress.cjs +139 -1
  435. package/dist/ui/circular-progress.d.ts +4 -4
  436. package/dist/ui/circular-progress.d.ts.map +1 -1
  437. package/dist/ui/circular-progress.js +65 -52
  438. package/dist/ui/code-block.cjs +819 -0
  439. package/dist/ui/code-block.d.ts +81 -0
  440. package/dist/ui/code-block.d.ts.map +1 -0
  441. package/dist/ui/code-block.js +809 -0
  442. package/dist/ui/collapsible.cjs +65 -1
  443. package/dist/ui/collapsible.d.ts +4 -4
  444. package/dist/ui/collapsible.d.ts.map +1 -1
  445. package/dist/ui/collapsible.js +58 -28
  446. package/dist/ui/command.cjs +556 -1
  447. package/dist/ui/command.d.ts +19 -19
  448. package/dist/ui/command.d.ts.map +1 -1
  449. package/dist/ui/command.js +432 -163
  450. package/dist/ui/compare-slider.cjs +170 -1
  451. package/dist/ui/compare-slider.d.ts +7 -7
  452. package/dist/ui/compare-slider.d.ts.map +1 -1
  453. package/dist/ui/compare-slider.js +106 -72
  454. package/dist/ui/context-menu.cjs +811 -1
  455. package/dist/ui/context-menu.d.ts +26 -26
  456. package/dist/ui/context-menu.d.ts.map +1 -1
  457. package/dist/ui/context-menu.js +693 -228
  458. package/dist/ui/copy-button.cjs +94 -1
  459. package/dist/ui/copy-button.d.ts +1 -2
  460. package/dist/ui/copy-button.d.ts.map +1 -1
  461. package/dist/ui/copy-button.js +56 -44
  462. package/dist/ui/dialog.cjs +409 -1
  463. package/dist/ui/dialog.d.ts +18 -18
  464. package/dist/ui/dialog.d.ts.map +1 -1
  465. package/dist/ui/dialog.js +317 -131
  466. package/dist/ui/drawer.cjs +476 -1
  467. package/dist/ui/drawer.d.ts +17 -17
  468. package/dist/ui/drawer.d.ts.map +1 -1
  469. package/dist/ui/drawer.js +394 -151
  470. package/dist/ui/dropdown-menu.cjs +638 -1
  471. package/dist/ui/dropdown-menu.d.ts +26 -26
  472. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  473. package/dist/ui/dropdown-menu.js +511 -208
  474. package/dist/ui/editable.cjs +608 -1
  475. package/dist/ui/editable.d.ts +14 -14
  476. package/dist/ui/editable.d.ts.map +1 -1
  477. package/dist/ui/editable.js +478 -218
  478. package/dist/ui/empty.cjs +310 -1
  479. package/dist/ui/empty.d.ts +15 -15
  480. package/dist/ui/empty.d.ts.map +1 -1
  481. package/dist/ui/empty.js +277 -107
  482. package/dist/ui/field.cjs +621 -1
  483. package/dist/ui/field.d.ts +21 -21
  484. package/dist/ui/field.d.ts.map +1 -1
  485. package/dist/ui/field.js +468 -198
  486. package/dist/ui/file-upload-adapters.cjs +289 -1
  487. package/dist/ui/file-upload-adapters.d.ts +1 -2
  488. package/dist/ui/file-upload-adapters.d.ts.map +1 -1
  489. package/dist/ui/file-upload-adapters.js +244 -170
  490. package/dist/ui/file-upload.cjs +1481 -1
  491. package/dist/ui/file-upload.d.ts +22 -22
  492. package/dist/ui/file-upload.d.ts.map +1 -1
  493. package/dist/ui/file-upload.js +1064 -598
  494. package/dist/ui/flex.cjs +203 -1
  495. package/dist/ui/flex.d.ts +6 -6
  496. package/dist/ui/flex.d.ts.map +1 -1
  497. package/dist/ui/flex.js +111 -92
  498. package/dist/ui/form.cjs +454 -1
  499. package/dist/ui/form.d.ts +11 -11
  500. package/dist/ui/form.d.ts.map +1 -1
  501. package/dist/ui/form.js +421 -135
  502. package/dist/ui/gauge.cjs +127 -1
  503. package/dist/ui/gauge.d.ts +6 -6
  504. package/dist/ui/gauge.d.ts.map +1 -1
  505. package/dist/ui/gauge.js +61 -52
  506. package/dist/ui/grid.cjs +224 -1
  507. package/dist/ui/grid.d.ts +7 -7
  508. package/dist/ui/grid.d.ts.map +1 -1
  509. package/dist/ui/grid.js +125 -94
  510. package/dist/ui/hover-card.cjs +86 -1
  511. package/dist/ui/hover-card.d.ts +6 -6
  512. package/dist/ui/hover-card.d.ts.map +1 -1
  513. package/dist/ui/hover-card.js +57 -36
  514. package/dist/ui/index.d.ts +4 -0
  515. package/dist/ui/index.d.ts.map +1 -1
  516. package/dist/ui/input-group.cjs +328 -1
  517. package/dist/ui/input-group.d.ts +12 -12
  518. package/dist/ui/input-group.d.ts.map +1 -1
  519. package/dist/ui/input-group.js +207 -105
  520. package/dist/ui/input-otp.cjs +312 -1
  521. package/dist/ui/input-otp.d.ts +10 -10
  522. package/dist/ui/input-otp.d.ts.map +1 -1
  523. package/dist/ui/input-otp.js +217 -94
  524. package/dist/ui/input.cjs +388 -1
  525. package/dist/ui/input.d.ts +3 -3
  526. package/dist/ui/input.d.ts.map +1 -1
  527. package/dist/ui/input.js +137 -119
  528. package/dist/ui/item.cjs +585 -1
  529. package/dist/ui/item.d.ts +20 -20
  530. package/dist/ui/item.d.ts.map +1 -1
  531. package/dist/ui/item.js +460 -162
  532. package/dist/ui/kbd.cjs +115 -1
  533. package/dist/ui/kbd.d.ts +5 -5
  534. package/dist/ui/kbd.d.ts.map +1 -1
  535. package/dist/ui/kbd.js +42 -37
  536. package/dist/ui/label.cjs +67 -1
  537. package/dist/ui/label.d.ts +4 -4
  538. package/dist/ui/label.d.ts.map +1 -1
  539. package/dist/ui/label.js +51 -21
  540. package/dist/ui/marker.cjs +294 -0
  541. package/dist/ui/marker.d.ts +22 -0
  542. package/dist/ui/marker.d.ts.map +1 -0
  543. package/dist/ui/marker.js +290 -0
  544. package/dist/ui/masonry.cjs +58 -1
  545. package/dist/ui/masonry.d.ts +4 -4
  546. package/dist/ui/masonry.d.ts.map +1 -1
  547. package/dist/ui/masonry.js +41 -36
  548. package/dist/ui/menubar.cjs +908 -1
  549. package/dist/ui/menubar.d.ts +29 -29
  550. package/dist/ui/menubar.d.ts.map +1 -1
  551. package/dist/ui/menubar.js +737 -251
  552. package/dist/ui/navigation-menu.cjs +560 -1
  553. package/dist/ui/navigation-menu.d.ts +18 -18
  554. package/dist/ui/navigation-menu.d.ts.map +1 -1
  555. package/dist/ui/navigation-menu.js +442 -148
  556. package/dist/ui/pagination.cjs +575 -1
  557. package/dist/ui/pagination.d.ts +13 -13
  558. package/dist/ui/pagination.d.ts.map +1 -1
  559. package/dist/ui/pagination.js +422 -172
  560. package/dist/ui/popover.cjs +93 -1
  561. package/dist/ui/popover.d.ts +7 -7
  562. package/dist/ui/popover.d.ts.map +1 -1
  563. package/dist/ui/popover.js +61 -42
  564. package/dist/ui/progress.cjs +33 -1
  565. package/dist/ui/progress.d.ts +3 -3
  566. package/dist/ui/progress.d.ts.map +1 -1
  567. package/dist/ui/progress.js +19 -17
  568. package/dist/ui/questionnaire.cjs +679 -0
  569. package/dist/ui/questionnaire.d.ts +101 -0
  570. package/dist/ui/questionnaire.d.ts.map +1 -0
  571. package/dist/ui/questionnaire.js +667 -0
  572. package/dist/ui/radio-group.cjs +221 -1
  573. package/dist/ui/radio-group.d.ts +6 -6
  574. package/dist/ui/radio-group.d.ts.map +1 -1
  575. package/dist/ui/radio-group.js +125 -74
  576. package/dist/ui/rating.cjs +191 -1
  577. package/dist/ui/rating.d.ts +3 -3
  578. package/dist/ui/rating.d.ts.map +1 -1
  579. package/dist/ui/rating.js +96 -78
  580. package/dist/ui/resizable.cjs +175 -1
  581. package/dist/ui/resizable.d.ts +7 -7
  582. package/dist/ui/resizable.d.ts.map +1 -1
  583. package/dist/ui/resizable.js +150 -54
  584. package/dist/ui/responsive-dialog.cjs +400 -1
  585. package/dist/ui/responsive-dialog.d.ts +17 -17
  586. package/dist/ui/responsive-dialog.d.ts.map +1 -1
  587. package/dist/ui/responsive-dialog.js +372 -155
  588. package/dist/ui/row-col.cjs +510 -1
  589. package/dist/ui/row-col.d.ts +11 -11
  590. package/dist/ui/row-col.d.ts.map +1 -1
  591. package/dist/ui/row-col.js +238 -205
  592. package/dist/ui/scroll-area.cjs +142 -1
  593. package/dist/ui/scroll-area.d.ts +6 -6
  594. package/dist/ui/scroll-area.d.ts.map +1 -1
  595. package/dist/ui/scroll-area.js +103 -47
  596. package/dist/ui/segmented.cjs +170 -1
  597. package/dist/ui/segmented.d.ts +5 -5
  598. package/dist/ui/segmented.d.ts.map +1 -1
  599. package/dist/ui/segmented.js +75 -62
  600. package/dist/ui/select.cjs +484 -1
  601. package/dist/ui/select.d.ts +17 -17
  602. package/dist/ui/select.d.ts.map +1 -1
  603. package/dist/ui/select.js +353 -160
  604. package/dist/ui/separator.cjs +44 -1
  605. package/dist/ui/separator.d.ts +4 -4
  606. package/dist/ui/separator.d.ts.map +1 -1
  607. package/dist/ui/separator.js +17 -17
  608. package/dist/ui/sheet.cjs +460 -1
  609. package/dist/ui/sheet.d.ts +16 -16
  610. package/dist/ui/sheet.d.ts.map +1 -1
  611. package/dist/ui/sheet.js +329 -141
  612. package/dist/ui/sidebar.cjs +1453 -1
  613. package/dist/ui/sidebar.d.ts +48 -48
  614. package/dist/ui/sidebar.d.ts.map +1 -1
  615. package/dist/ui/sidebar.js +1057 -438
  616. package/dist/ui/signature-pad.cjs +740 -0
  617. package/dist/ui/signature-pad.d.ts +107 -0
  618. package/dist/ui/signature-pad.d.ts.map +1 -0
  619. package/dist/ui/signature-pad.js +730 -0
  620. package/dist/ui/skeleton.cjs +62 -1
  621. package/dist/ui/skeleton.d.ts +3 -3
  622. package/dist/ui/skeleton.d.ts.map +1 -1
  623. package/dist/ui/skeleton.js +50 -20
  624. package/dist/ui/slider.cjs +47 -1
  625. package/dist/ui/slider.d.ts +4 -4
  626. package/dist/ui/slider.d.ts.map +1 -1
  627. package/dist/ui/slider.js +27 -26
  628. package/dist/ui/sonner.cjs +28 -1
  629. package/dist/ui/sonner.js +24 -22
  630. package/dist/ui/spinner.cjs +73 -1
  631. package/dist/ui/spinner.d.ts +3 -3
  632. package/dist/ui/spinner.d.ts.map +1 -1
  633. package/dist/ui/spinner.js +29 -28
  634. package/dist/ui/stat.cjs +334 -1
  635. package/dist/ui/stat.d.ts +15 -15
  636. package/dist/ui/stat.d.ts.map +1 -1
  637. package/dist/ui/stat.js +271 -130
  638. package/dist/ui/stepper.cjs +785 -1
  639. package/dist/ui/stepper.d.ts +24 -24
  640. package/dist/ui/stepper.d.ts.map +1 -1
  641. package/dist/ui/stepper.js +594 -281
  642. package/dist/ui/switch.cjs +203 -1
  643. package/dist/ui/switch.d.ts +4 -4
  644. package/dist/ui/switch.d.ts.map +1 -1
  645. package/dist/ui/switch.js +83 -72
  646. package/dist/ui/table.cjs +435 -1
  647. package/dist/ui/table.d.ts +17 -17
  648. package/dist/ui/table.d.ts.map +1 -1
  649. package/dist/ui/table.js +369 -129
  650. package/dist/ui/tabs.cjs +340 -1
  651. package/dist/ui/tabs.d.ts +10 -10
  652. package/dist/ui/tabs.d.ts.map +1 -1
  653. package/dist/ui/tabs.js +204 -95
  654. package/dist/ui/tags-input.cjs +585 -1
  655. package/dist/ui/tags-input.d.ts +13 -13
  656. package/dist/ui/tags-input.d.ts.map +1 -1
  657. package/dist/ui/tags-input.js +446 -221
  658. package/dist/ui/textarea.cjs +119 -1
  659. package/dist/ui/textarea.d.ts +3 -3
  660. package/dist/ui/textarea.d.ts.map +1 -1
  661. package/dist/ui/textarea.js +37 -33
  662. package/dist/ui/timeline.cjs +583 -1
  663. package/dist/ui/timeline.d.ts +22 -22
  664. package/dist/ui/timeline.d.ts.map +1 -1
  665. package/dist/ui/timeline.js +409 -198
  666. package/dist/ui/toggle-group.cjs +128 -1
  667. package/dist/ui/toggle-group.d.ts +7 -7
  668. package/dist/ui/toggle-group.d.ts.map +1 -1
  669. package/dist/ui/toggle-group.js +92 -41
  670. package/dist/ui/toggle.cjs +145 -1
  671. package/dist/ui/toggle.d.ts +4 -4
  672. package/dist/ui/toggle.d.ts.map +1 -1
  673. package/dist/ui/toggle.js +38 -34
  674. package/dist/ui/tooltip.cjs +81 -1
  675. package/dist/ui/tooltip.d.ts +7 -7
  676. package/dist/ui/tooltip.d.ts.map +1 -1
  677. package/dist/ui/tooltip.js +50 -37
  678. package/dist/ui/useBreakpoint.cjs +91 -1
  679. package/dist/ui/useBreakpoint.js +66 -43
  680. package/dist/utils.cjs +9 -1
  681. package/dist/utils.js +4 -4
  682. package/package.json +10 -2
@@ -1,9 +1,9 @@
1
- import * as e from "react";
2
- import { createContext as t, createElement as n, forwardRef as r, useCallback as i, useContext as a, useEffect as o, useImperativeHandle as s, useLayoutEffect as c, useMemo as l, useRef as u, useState as d } from "react";
1
+ import * as React$1 from "react";
2
+ import { createContext, createElement, forwardRef, useCallback, useContext, useEffect, useImperativeHandle, useLayoutEffect, useMemo, useRef, useState } from "react";
3
3
  // ../../node_modules/.pnpm/react-resizable-panels@2.1.9_react-dom@19.3.1_react@19.3.1__react@19.3.1/node_modules/react-resizable-panels/dist/react-resizable-panels.browser.esm.js
4
- var f = t(null);
5
- f.displayName = "PanelGroupContext";
6
- var p = {
4
+ var PanelGroupContext = createContext(null);
5
+ PanelGroupContext.displayName = "PanelGroupContext";
6
+ var DATA_ATTRIBUTES = {
7
7
  group: "data-panel-group",
8
8
  groupDirection: "data-panel-group-direction",
9
9
  groupId: "data-panel-group-id",
@@ -16,1127 +16,1585 @@ var p = {
16
16
  resizeHandleEnabled: "data-panel-resize-handle-enabled",
17
17
  resizeHandleId: "data-panel-resize-handle-id",
18
18
  resizeHandleState: "data-resize-handle-state"
19
- }, m = 10, h = c, g = e.useId, _ = typeof g == "function" ? g : () => null, v = 0;
20
- function ee(e = null) {
21
- let t = _(), n = u(e || t || null);
22
- return n.current === null && (n.current = "" + v++), e ?? n.current;
23
- }
24
- function y({ children: e, className: t = "", collapsedSize: r, collapsible: i, defaultSize: o, forwardedRef: c, id: l, maxSize: d, minSize: m, onCollapse: g, onExpand: _, onResize: v, order: y, style: te, tagName: b = "div", ...x }) {
25
- let S = a(f);
26
- if (S === null) throw Error("Panel components must be rendered within a PanelGroup container");
27
- let { collapsePanel: C, expandPanel: w, getPanelSize: T, getPanelStyle: E, groupId: D, isPanelCollapsed: O, reevaluatePanelConstraints: ne, registerPanel: k, resizePanel: A, unregisterPanel: j } = S, M = ee(l), N = u({
19
+ };
20
+ var PRECISION = 10;
21
+ var useIsomorphicLayoutEffect = useLayoutEffect;
22
+ var useId$1 = React$1["useId".toString()];
23
+ var wrappedUseId = typeof useId$1 === "function" ? useId$1 : () => null;
24
+ var counter = 0;
25
+ function useUniqueId(idFromParams = null) {
26
+ const idFromUseId = wrappedUseId();
27
+ const idRef = useRef(idFromParams || idFromUseId || null);
28
+ if (idRef.current === null) idRef.current = "" + counter++;
29
+ return idFromParams !== null && idFromParams !== void 0 ? idFromParams : idRef.current;
30
+ }
31
+ function PanelWithForwardedRef({ children, className: classNameFromProps = "", collapsedSize, collapsible, defaultSize, forwardedRef, id: idFromProps, maxSize, minSize, onCollapse, onExpand, onResize, order, style: styleFromProps, tagName: Type = "div", ...rest }) {
32
+ const context = useContext(PanelGroupContext);
33
+ if (context === null) throw Error(`Panel components must be rendered within a PanelGroup container`);
34
+ const { collapsePanel, expandPanel, getPanelSize, getPanelStyle, groupId, isPanelCollapsed, reevaluatePanelConstraints, registerPanel, resizePanel, unregisterPanel } = context;
35
+ const panelId = useUniqueId(idFromProps);
36
+ const panelDataRef = useRef({
28
37
  callbacks: {
29
- onCollapse: g,
30
- onExpand: _,
31
- onResize: v
38
+ onCollapse,
39
+ onExpand,
40
+ onResize
32
41
  },
33
42
  constraints: {
34
- collapsedSize: r,
35
- collapsible: i,
36
- defaultSize: o,
37
- maxSize: d,
38
- minSize: m
43
+ collapsedSize,
44
+ collapsible,
45
+ defaultSize,
46
+ maxSize,
47
+ minSize
39
48
  },
40
- id: M,
41
- idIsFromProps: l !== void 0,
42
- order: y
49
+ id: panelId,
50
+ idIsFromProps: idFromProps !== void 0,
51
+ order
43
52
  });
44
- u({ didLogMissingDefaultSizeWarning: !1 }), h(() => {
45
- let { callbacks: e, constraints: t } = N.current, n = { ...t };
46
- N.current.id = M, N.current.idIsFromProps = l !== void 0, N.current.order = y, e.onCollapse = g, e.onExpand = _, e.onResize = v, t.collapsedSize = r, t.collapsible = i, t.defaultSize = o, t.maxSize = d, t.minSize = m, (n.collapsedSize !== t.collapsedSize || n.collapsible !== t.collapsible || n.maxSize !== t.maxSize || n.minSize !== t.minSize) && ne(N.current, n);
47
- }), h(() => {
48
- let e = N.current;
49
- return k(e), () => {
50
- j(e);
53
+ useRef({ didLogMissingDefaultSizeWarning: false });
54
+ useIsomorphicLayoutEffect(() => {
55
+ const { callbacks, constraints } = panelDataRef.current;
56
+ const prevConstraints = { ...constraints };
57
+ panelDataRef.current.id = panelId;
58
+ panelDataRef.current.idIsFromProps = idFromProps !== void 0;
59
+ panelDataRef.current.order = order;
60
+ callbacks.onCollapse = onCollapse;
61
+ callbacks.onExpand = onExpand;
62
+ callbacks.onResize = onResize;
63
+ constraints.collapsedSize = collapsedSize;
64
+ constraints.collapsible = collapsible;
65
+ constraints.defaultSize = defaultSize;
66
+ constraints.maxSize = maxSize;
67
+ constraints.minSize = minSize;
68
+ if (prevConstraints.collapsedSize !== constraints.collapsedSize || prevConstraints.collapsible !== constraints.collapsible || prevConstraints.maxSize !== constraints.maxSize || prevConstraints.minSize !== constraints.minSize) reevaluatePanelConstraints(panelDataRef.current, prevConstraints);
69
+ });
70
+ useIsomorphicLayoutEffect(() => {
71
+ const panelData = panelDataRef.current;
72
+ registerPanel(panelData);
73
+ return () => {
74
+ unregisterPanel(panelData);
51
75
  };
52
76
  }, [
53
- y,
54
- M,
55
- k,
56
- j
57
- ]), s(c, () => ({
77
+ order,
78
+ panelId,
79
+ registerPanel,
80
+ unregisterPanel
81
+ ]);
82
+ useImperativeHandle(forwardedRef, () => ({
58
83
  collapse: () => {
59
- C(N.current);
84
+ collapsePanel(panelDataRef.current);
60
85
  },
61
- expand: (e) => {
62
- w(N.current, e);
86
+ expand: (minSize) => {
87
+ expandPanel(panelDataRef.current, minSize);
63
88
  },
64
89
  getId() {
65
- return M;
90
+ return panelId;
66
91
  },
67
92
  getSize() {
68
- return T(N.current);
93
+ return getPanelSize(panelDataRef.current);
69
94
  },
70
95
  isCollapsed() {
71
- return O(N.current);
96
+ return isPanelCollapsed(panelDataRef.current);
72
97
  },
73
98
  isExpanded() {
74
- return !O(N.current);
99
+ return !isPanelCollapsed(panelDataRef.current);
75
100
  },
76
- resize: (e) => {
77
- A(N.current, e);
101
+ resize: (size) => {
102
+ resizePanel(panelDataRef.current, size);
78
103
  }
79
104
  }), [
80
- C,
81
- w,
82
- T,
83
- O,
84
- M,
85
- A
105
+ collapsePanel,
106
+ expandPanel,
107
+ getPanelSize,
108
+ isPanelCollapsed,
109
+ panelId,
110
+ resizePanel
86
111
  ]);
87
- let P = E(N.current, o);
88
- return n(b, {
89
- ...x,
90
- children: e,
91
- className: t,
92
- id: M,
112
+ const style = getPanelStyle(panelDataRef.current, defaultSize);
113
+ return createElement(Type, {
114
+ ...rest,
115
+ children,
116
+ className: classNameFromProps,
117
+ id: panelId,
93
118
  style: {
94
- ...P,
95
- ...te
119
+ ...style,
120
+ ...styleFromProps
96
121
  },
97
- [p.groupId]: D,
98
- [p.panel]: "",
99
- [p.panelCollapsible]: i || void 0,
100
- [p.panelId]: M,
101
- [p.panelSize]: parseFloat("" + P.flexGrow).toFixed(1)
122
+ [DATA_ATTRIBUTES.groupId]: groupId,
123
+ [DATA_ATTRIBUTES.panel]: "",
124
+ [DATA_ATTRIBUTES.panelCollapsible]: collapsible || void 0,
125
+ [DATA_ATTRIBUTES.panelId]: panelId,
126
+ [DATA_ATTRIBUTES.panelSize]: parseFloat("" + style.flexGrow).toFixed(1)
102
127
  });
103
128
  }
104
- var te = r((e, t) => n(y, {
105
- ...e,
106
- forwardedRef: t
129
+ var Panel = forwardRef((props, ref) => createElement(PanelWithForwardedRef, {
130
+ ...props,
131
+ forwardedRef: ref
107
132
  }));
108
- y.displayName = "Panel", te.displayName = "forwardRef(Panel)";
109
- var b = null, x = !0, S = -1, C = null;
110
- function w(e, t) {
111
- if (t) {
112
- let e = (t & re) !== 0, n = (t & ie) !== 0, r = (t & ae) !== 0, i = (t & oe) !== 0;
113
- if (e) return r ? "se-resize" : i ? "ne-resize" : "e-resize";
114
- if (n) return r ? "sw-resize" : i ? "nw-resize" : "w-resize";
115
- if (r) return "s-resize";
116
- if (i) return "n-resize";
133
+ PanelWithForwardedRef.displayName = "Panel";
134
+ Panel.displayName = "forwardRef(Panel)";
135
+ var currentCursorStyle = null;
136
+ var enabled = true;
137
+ var prevRuleIndex = -1;
138
+ var styleElement = null;
139
+ function getCursorStyle(state, constraintFlags) {
140
+ if (constraintFlags) {
141
+ const horizontalMin = (constraintFlags & EXCEEDED_HORIZONTAL_MIN) !== 0;
142
+ const horizontalMax = (constraintFlags & EXCEEDED_HORIZONTAL_MAX) !== 0;
143
+ const verticalMin = (constraintFlags & EXCEEDED_VERTICAL_MIN) !== 0;
144
+ const verticalMax = (constraintFlags & EXCEEDED_VERTICAL_MAX) !== 0;
145
+ if (horizontalMin) {
146
+ if (verticalMin) return "se-resize";
147
+ else if (verticalMax) return "ne-resize";
148
+ else return "e-resize";
149
+ } else if (horizontalMax) {
150
+ if (verticalMin) return "sw-resize";
151
+ else if (verticalMax) return "nw-resize";
152
+ else return "w-resize";
153
+ } else if (verticalMin) return "s-resize";
154
+ else if (verticalMax) return "n-resize";
117
155
  }
118
- switch (e) {
156
+ switch (state) {
119
157
  case "horizontal": return "ew-resize";
120
158
  case "intersection": return "move";
121
159
  case "vertical": return "ns-resize";
122
160
  }
123
161
  }
124
- function T() {
125
- C !== null && (document.head.removeChild(C), b = null, C = null, S = -1);
162
+ function resetGlobalCursorStyle() {
163
+ if (styleElement !== null) {
164
+ document.head.removeChild(styleElement);
165
+ currentCursorStyle = null;
166
+ styleElement = null;
167
+ prevRuleIndex = -1;
168
+ }
126
169
  }
127
- function E(e, t) {
128
- if (!x) return;
129
- let n = w(e, t);
130
- if (b !== n) {
131
- if (b = n, C === null && (C = document.createElement("style"), document.head.appendChild(C)), S >= 0) {
132
- var r;
133
- (r = C.sheet) == null || r.removeRule(S);
134
- }
135
- S = C.sheet?.insertRule(`*{cursor: ${n} !important;}`) ?? -1;
170
+ function setGlobalCursorStyle(state, constraintFlags) {
171
+ var _styleElement$sheet$i, _styleElement$sheet2;
172
+ if (!enabled) return;
173
+ const style = getCursorStyle(state, constraintFlags);
174
+ if (currentCursorStyle === style) return;
175
+ currentCursorStyle = style;
176
+ if (styleElement === null) {
177
+ styleElement = document.createElement("style");
178
+ document.head.appendChild(styleElement);
179
+ }
180
+ if (prevRuleIndex >= 0) {
181
+ var _styleElement$sheet;
182
+ (_styleElement$sheet = styleElement.sheet) === null || _styleElement$sheet === void 0 || _styleElement$sheet.removeRule(prevRuleIndex);
136
183
  }
184
+ prevRuleIndex = (_styleElement$sheet$i = (_styleElement$sheet2 = styleElement.sheet) === null || _styleElement$sheet2 === void 0 ? void 0 : _styleElement$sheet2.insertRule(`*{cursor: ${style} !important;}`)) !== null && _styleElement$sheet$i !== void 0 ? _styleElement$sheet$i : -1;
137
185
  }
138
- function D(e) {
139
- return e.type === "keydown";
186
+ function isKeyDown(event) {
187
+ return event.type === "keydown";
140
188
  }
141
- function O(e) {
142
- return e.type.startsWith("pointer");
189
+ function isPointerEvent(event) {
190
+ return event.type.startsWith("pointer");
143
191
  }
144
- function ne(e) {
145
- return e.type.startsWith("mouse");
192
+ function isMouseEvent(event) {
193
+ return event.type.startsWith("mouse");
146
194
  }
147
- function k(e) {
148
- if (O(e)) {
149
- if (e.isPrimary) return {
150
- x: e.clientX,
151
- y: e.clientY
195
+ function getResizeEventCoordinates(event) {
196
+ if (isPointerEvent(event)) {
197
+ if (event.isPrimary) return {
198
+ x: event.clientX,
199
+ y: event.clientY
152
200
  };
153
- } else if (ne(e)) return {
154
- x: e.clientX,
155
- y: e.clientY
201
+ } else if (isMouseEvent(event)) return {
202
+ x: event.clientX,
203
+ y: event.clientY
156
204
  };
157
205
  return {
158
206
  x: Infinity,
159
207
  y: Infinity
160
208
  };
161
209
  }
162
- function A() {
163
- if (typeof matchMedia == "function") return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
164
- }
165
- function j(e, t, n) {
166
- return n ? e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y : e.x <= t.x + t.width && e.x + e.width >= t.x && e.y <= t.y + t.height && e.y + e.height >= t.y;
167
- }
168
- function M(e, t) {
169
- if (e === t) throw Error("Cannot compare node with itself");
170
- let n = {
171
- a: R(e),
172
- b: R(t)
173
- }, r;
174
- for (; n.a.at(-1) === n.b.at(-1);) e = n.a.pop(), t = n.b.pop(), r = e;
175
- G(r, "Stacking order can only be calculated for elements with a common ancestor");
176
- let i = {
177
- a: L(I(n.a)),
178
- b: L(I(n.b))
210
+ function getInputType() {
211
+ if (typeof matchMedia === "function") return matchMedia("(pointer:coarse)").matches ? "coarse" : "fine";
212
+ }
213
+ function intersects(rectOne, rectTwo, strict) {
214
+ if (strict) return rectOne.x < rectTwo.x + rectTwo.width && rectOne.x + rectOne.width > rectTwo.x && rectOne.y < rectTwo.y + rectTwo.height && rectOne.y + rectOne.height > rectTwo.y;
215
+ else return rectOne.x <= rectTwo.x + rectTwo.width && rectOne.x + rectOne.width >= rectTwo.x && rectOne.y <= rectTwo.y + rectTwo.height && rectOne.y + rectOne.height >= rectTwo.y;
216
+ }
217
+ /**
218
+ * Determine which of two nodes appears in front of the other —
219
+ * if `a` is in front, returns 1, otherwise returns -1
220
+ * @param {HTMLElement | SVGElement} a
221
+ * @param {HTMLElement | SVGElement} b
222
+ */
223
+ function compare(a, b) {
224
+ if (a === b) throw new Error("Cannot compare node with itself");
225
+ const ancestors = {
226
+ a: get_ancestors(a),
227
+ b: get_ancestors(b)
179
228
  };
180
- if (i.a === i.b) {
181
- let e = r.childNodes, t = {
182
- a: n.a.at(-1),
183
- b: n.b.at(-1)
184
- }, i = e.length;
185
- for (; i--;) {
186
- let n = e[i];
187
- if (n === t.a) return 1;
188
- if (n === t.b) return -1;
229
+ let common_ancestor;
230
+ while (ancestors.a.at(-1) === ancestors.b.at(-1)) {
231
+ a = ancestors.a.pop();
232
+ b = ancestors.b.pop();
233
+ common_ancestor = a;
234
+ }
235
+ assert(common_ancestor, "Stacking order can only be calculated for elements with a common ancestor");
236
+ const z_indexes = {
237
+ a: get_z_index(find_stacking_context(ancestors.a)),
238
+ b: get_z_index(find_stacking_context(ancestors.b))
239
+ };
240
+ if (z_indexes.a === z_indexes.b) {
241
+ const children = common_ancestor.childNodes;
242
+ const furthest_ancestors = {
243
+ a: ancestors.a.at(-1),
244
+ b: ancestors.b.at(-1)
245
+ };
246
+ let i = children.length;
247
+ while (i--) {
248
+ const child = children[i];
249
+ if (child === furthest_ancestors.a) return 1;
250
+ if (child === furthest_ancestors.b) return -1;
189
251
  }
190
252
  }
191
- return Math.sign(i.a - i.b);
192
- }
193
- var N = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
194
- function P(e) {
195
- let t = getComputedStyle(z(e) ?? e).display;
196
- return t === "flex" || t === "inline-flex";
197
- }
198
- function F(e) {
199
- let t = getComputedStyle(e);
200
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || P(e)) || +t.opacity < 1 || "transform" in t && t.transform !== "none" || "webkitTransform" in t && t.webkitTransform !== "none" || "mixBlendMode" in t && t.mixBlendMode !== "normal" || "filter" in t && t.filter !== "none" || "webkitFilter" in t && t.webkitFilter !== "none" || "isolation" in t && t.isolation === "isolate" || N.test(t.willChange) || t.webkitOverflowScrolling === "touch");
201
- }
202
- function I(e) {
203
- let t = e.length;
204
- for (; t--;) {
205
- let n = e[t];
206
- if (G(n, "Missing node"), F(n)) return n;
253
+ return Math.sign(z_indexes.a - z_indexes.b);
254
+ }
255
+ var props = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
256
+ /** @param {HTMLElement | SVGElement} node */
257
+ function is_flex_item(node) {
258
+ var _get_parent;
259
+ const display = getComputedStyle((_get_parent = get_parent(node)) !== null && _get_parent !== void 0 ? _get_parent : node).display;
260
+ return display === "flex" || display === "inline-flex";
261
+ }
262
+ /** @param {HTMLElement | SVGElement} node */
263
+ function creates_stacking_context(node) {
264
+ const style = getComputedStyle(node);
265
+ if (style.position === "fixed") return true;
266
+ if (style.zIndex !== "auto" && (style.position !== "static" || is_flex_item(node))) return true;
267
+ if (+style.opacity < 1) return true;
268
+ if ("transform" in style && style.transform !== "none") return true;
269
+ if ("webkitTransform" in style && style.webkitTransform !== "none") return true;
270
+ if ("mixBlendMode" in style && style.mixBlendMode !== "normal") return true;
271
+ if ("filter" in style && style.filter !== "none") return true;
272
+ if ("webkitFilter" in style && style.webkitFilter !== "none") return true;
273
+ if ("isolation" in style && style.isolation === "isolate") return true;
274
+ if (props.test(style.willChange)) return true;
275
+ if (style.webkitOverflowScrolling === "touch") return true;
276
+ return false;
277
+ }
278
+ /** @param {(HTMLElement| SVGElement)[]} nodes */
279
+ function find_stacking_context(nodes) {
280
+ let i = nodes.length;
281
+ while (i--) {
282
+ const node = nodes[i];
283
+ assert(node, "Missing node");
284
+ if (creates_stacking_context(node)) return node;
207
285
  }
208
286
  return null;
209
287
  }
210
- function L(e) {
211
- return e && Number(getComputedStyle(e).zIndex) || 0;
212
- }
213
- function R(e) {
214
- let t = [];
215
- for (; e;) t.push(e), e = z(e);
216
- return t;
217
- }
218
- function z(e) {
219
- let { parentNode: t } = e;
220
- return t && t instanceof ShadowRoot ? t.host : t;
221
- }
222
- var re = 1, ie = 2, ae = 4, oe = 8, se = A() === "coarse", B = [], V = !1, H = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map(), W = /* @__PURE__ */ new Set();
223
- function ce(e, t, n, r, i) {
224
- let { ownerDocument: a } = t, o = {
225
- direction: n,
226
- element: t,
227
- hitAreaMargins: r,
228
- setResizeHandlerState: i
229
- }, s = H.get(a) ?? 0;
230
- return H.set(a, s + 1), W.add(o), _e(), function() {
231
- U.delete(e), W.delete(o);
232
- let t = H.get(a) ?? 1;
233
- if (H.set(a, t - 1), _e(), t === 1 && H.delete(a), B.includes(o)) {
234
- let e = B.indexOf(o);
235
- e >= 0 && B.splice(e, 1), he(), i("up", !0, null);
288
+ /** @param {HTMLElement | SVGElement} node */
289
+ function get_z_index(node) {
290
+ return node && Number(getComputedStyle(node).zIndex) || 0;
291
+ }
292
+ /** @param {HTMLElement} node */
293
+ function get_ancestors(node) {
294
+ const ancestors = [];
295
+ while (node) {
296
+ ancestors.push(node);
297
+ node = get_parent(node);
298
+ }
299
+ return ancestors;
300
+ }
301
+ /** @param {HTMLElement} node */
302
+ function get_parent(node) {
303
+ const { parentNode } = node;
304
+ if (parentNode && parentNode instanceof ShadowRoot) return parentNode.host;
305
+ return parentNode;
306
+ }
307
+ var EXCEEDED_HORIZONTAL_MIN = 1;
308
+ var EXCEEDED_HORIZONTAL_MAX = 2;
309
+ var EXCEEDED_VERTICAL_MIN = 4;
310
+ var EXCEEDED_VERTICAL_MAX = 8;
311
+ var isCoarsePointer = getInputType() === "coarse";
312
+ var intersectingHandles = [];
313
+ var isPointerDown = false;
314
+ var ownerDocumentCounts = /* @__PURE__ */ new Map();
315
+ var panelConstraintFlags = /* @__PURE__ */ new Map();
316
+ var registeredResizeHandlers = /* @__PURE__ */ new Set();
317
+ function registerResizeHandle(resizeHandleId, element, direction, hitAreaMargins, setResizeHandlerState) {
318
+ var _ownerDocumentCounts$;
319
+ const { ownerDocument } = element;
320
+ const data = {
321
+ direction,
322
+ element,
323
+ hitAreaMargins,
324
+ setResizeHandlerState
325
+ };
326
+ const count = (_ownerDocumentCounts$ = ownerDocumentCounts.get(ownerDocument)) !== null && _ownerDocumentCounts$ !== void 0 ? _ownerDocumentCounts$ : 0;
327
+ ownerDocumentCounts.set(ownerDocument, count + 1);
328
+ registeredResizeHandlers.add(data);
329
+ updateListeners();
330
+ return function unregisterResizeHandle() {
331
+ var _ownerDocumentCounts$2;
332
+ panelConstraintFlags.delete(resizeHandleId);
333
+ registeredResizeHandlers.delete(data);
334
+ const count = (_ownerDocumentCounts$2 = ownerDocumentCounts.get(ownerDocument)) !== null && _ownerDocumentCounts$2 !== void 0 ? _ownerDocumentCounts$2 : 1;
335
+ ownerDocumentCounts.set(ownerDocument, count - 1);
336
+ updateListeners();
337
+ if (count === 1) ownerDocumentCounts.delete(ownerDocument);
338
+ if (intersectingHandles.includes(data)) {
339
+ const index = intersectingHandles.indexOf(data);
340
+ if (index >= 0) intersectingHandles.splice(index, 1);
341
+ updateCursor();
342
+ setResizeHandlerState("up", true, null);
236
343
  }
237
344
  };
238
345
  }
239
- function le(e) {
240
- let { target: t } = e, { x: n, y: r } = k(e);
241
- V = !0, pe({
242
- target: t,
243
- x: n,
244
- y: r
245
- }), _e(), B.length > 0 && (ve("down", e), e.preventDefault(), fe(t) || e.stopImmediatePropagation());
246
- }
247
- function ue(e) {
248
- let { x: t, y: n } = k(e);
249
- if (V && e.buttons === 0 && (V = !1, ve("up", e)), !V) {
250
- let { target: r } = e;
251
- pe({
252
- target: r,
253
- x: t,
254
- y: n
346
+ function handlePointerDown(event) {
347
+ const { target } = event;
348
+ const { x, y } = getResizeEventCoordinates(event);
349
+ isPointerDown = true;
350
+ recalculateIntersectingHandles({
351
+ target,
352
+ x,
353
+ y
354
+ });
355
+ updateListeners();
356
+ if (intersectingHandles.length > 0) {
357
+ updateResizeHandlerStates("down", event);
358
+ event.preventDefault();
359
+ if (!isWithinResizeHandle(target)) event.stopImmediatePropagation();
360
+ }
361
+ }
362
+ function handlePointerMove(event) {
363
+ const { x, y } = getResizeEventCoordinates(event);
364
+ if (isPointerDown && event.buttons === 0) {
365
+ isPointerDown = false;
366
+ updateResizeHandlerStates("up", event);
367
+ }
368
+ if (!isPointerDown) {
369
+ const { target } = event;
370
+ recalculateIntersectingHandles({
371
+ target,
372
+ x,
373
+ y
255
374
  });
256
375
  }
257
- ve("move", e), he(), B.length > 0 && e.preventDefault();
258
- }
259
- function de(e) {
260
- let { target: t } = e, { x: n, y: r } = k(e);
261
- U.clear(), V = !1, B.length > 0 && (e.preventDefault(), fe(t) || e.stopImmediatePropagation()), ve("up", e), pe({
262
- target: t,
263
- x: n,
264
- y: r
265
- }), he(), _e();
266
- }
267
- function fe(e) {
268
- let t = e;
269
- for (; t;) {
270
- if (t.hasAttribute(p.resizeHandle)) return !0;
271
- t = t.parentElement;
376
+ updateResizeHandlerStates("move", event);
377
+ updateCursor();
378
+ if (intersectingHandles.length > 0) event.preventDefault();
379
+ }
380
+ function handlePointerUp(event) {
381
+ const { target } = event;
382
+ const { x, y } = getResizeEventCoordinates(event);
383
+ panelConstraintFlags.clear();
384
+ isPointerDown = false;
385
+ if (intersectingHandles.length > 0) {
386
+ event.preventDefault();
387
+ if (!isWithinResizeHandle(target)) event.stopImmediatePropagation();
272
388
  }
273
- return !1;
274
- }
275
- function pe({ target: e, x: t, y: n }) {
276
- B.splice(0);
277
- let r = null;
278
- (e instanceof HTMLElement || e instanceof SVGElement) && (r = e), W.forEach((e) => {
279
- let { element: i, hitAreaMargins: a } = e, o = i.getBoundingClientRect(), { bottom: s, left: c, right: l, top: u } = o, d = se ? a.coarse : a.fine;
280
- if (t >= c - d && t <= l + d && n >= u - d && n <= s + d) {
281
- if (r !== null && document.contains(r) && i !== r && !i.contains(r) && !r.contains(i) && M(r, i) > 0) {
282
- let e = r, t = !1;
283
- for (; e && !e.contains(i);) {
284
- if (j(e.getBoundingClientRect(), o, !0)) {
285
- t = !0;
389
+ updateResizeHandlerStates("up", event);
390
+ recalculateIntersectingHandles({
391
+ target,
392
+ x,
393
+ y
394
+ });
395
+ updateCursor();
396
+ updateListeners();
397
+ }
398
+ function isWithinResizeHandle(element) {
399
+ let currentElement = element;
400
+ while (currentElement) {
401
+ if (currentElement.hasAttribute(DATA_ATTRIBUTES.resizeHandle)) return true;
402
+ currentElement = currentElement.parentElement;
403
+ }
404
+ return false;
405
+ }
406
+ function recalculateIntersectingHandles({ target, x, y }) {
407
+ intersectingHandles.splice(0);
408
+ let targetElement = null;
409
+ if (target instanceof HTMLElement || target instanceof SVGElement) targetElement = target;
410
+ registeredResizeHandlers.forEach((data) => {
411
+ const { element: dragHandleElement, hitAreaMargins } = data;
412
+ const dragHandleRect = dragHandleElement.getBoundingClientRect();
413
+ const { bottom, left, right, top } = dragHandleRect;
414
+ const margin = isCoarsePointer ? hitAreaMargins.coarse : hitAreaMargins.fine;
415
+ if (x >= left - margin && x <= right + margin && y >= top - margin && y <= bottom + margin) {
416
+ if (targetElement !== null && document.contains(targetElement) && dragHandleElement !== targetElement && !dragHandleElement.contains(targetElement) && !targetElement.contains(dragHandleElement) && compare(targetElement, dragHandleElement) > 0) {
417
+ let currentElement = targetElement;
418
+ let didIntersect = false;
419
+ while (currentElement) {
420
+ if (currentElement.contains(dragHandleElement)) break;
421
+ else if (intersects(currentElement.getBoundingClientRect(), dragHandleRect, true)) {
422
+ didIntersect = true;
286
423
  break;
287
424
  }
288
- e = e.parentElement;
425
+ currentElement = currentElement.parentElement;
289
426
  }
290
- if (t) return;
427
+ if (didIntersect) return;
291
428
  }
292
- B.push(e);
429
+ intersectingHandles.push(data);
293
430
  }
294
431
  });
295
432
  }
296
- function me(e, t) {
297
- U.set(e, t);
433
+ function reportConstraintsViolation(resizeHandleId, flag) {
434
+ panelConstraintFlags.set(resizeHandleId, flag);
298
435
  }
299
- function he() {
300
- let e = !1, t = !1;
301
- B.forEach((n) => {
302
- let { direction: r } = n;
303
- r === "horizontal" ? e = !0 : t = !0;
436
+ function updateCursor() {
437
+ let intersectsHorizontal = false;
438
+ let intersectsVertical = false;
439
+ intersectingHandles.forEach((data) => {
440
+ const { direction } = data;
441
+ if (direction === "horizontal") intersectsHorizontal = true;
442
+ else intersectsVertical = true;
443
+ });
444
+ let constraintFlags = 0;
445
+ panelConstraintFlags.forEach((flag) => {
446
+ constraintFlags |= flag;
304
447
  });
305
- let n = 0;
306
- U.forEach((e) => {
307
- n |= e;
308
- }), e && t ? E("intersection", n) : e ? E("horizontal", n) : t ? E("vertical", n) : T();
309
- }
310
- var ge = new AbortController();
311
- function _e() {
312
- ge.abort(), ge = new AbortController();
313
- let e = {
314
- capture: !0,
315
- signal: ge.signal
448
+ if (intersectsHorizontal && intersectsVertical) setGlobalCursorStyle("intersection", constraintFlags);
449
+ else if (intersectsHorizontal) setGlobalCursorStyle("horizontal", constraintFlags);
450
+ else if (intersectsVertical) setGlobalCursorStyle("vertical", constraintFlags);
451
+ else resetGlobalCursorStyle();
452
+ }
453
+ var listenersAbortController = new AbortController();
454
+ function updateListeners() {
455
+ listenersAbortController.abort();
456
+ listenersAbortController = new AbortController();
457
+ const options = {
458
+ capture: true,
459
+ signal: listenersAbortController.signal
316
460
  };
317
- W.size && (V ? (B.length > 0 && H.forEach((t, n) => {
318
- let { body: r } = n;
319
- t > 0 && (r.addEventListener("contextmenu", de, e), r.addEventListener("pointerleave", ue, e), r.addEventListener("pointermove", ue, e));
320
- }), window.addEventListener("pointerup", de, e), window.addEventListener("pointercancel", de, e)) : H.forEach((t, n) => {
321
- let { body: r } = n;
322
- t > 0 && (r.addEventListener("pointerdown", le, e), r.addEventListener("pointermove", ue, e));
323
- }));
461
+ if (!registeredResizeHandlers.size) return;
462
+ if (isPointerDown) {
463
+ if (intersectingHandles.length > 0) ownerDocumentCounts.forEach((count, ownerDocument) => {
464
+ const { body } = ownerDocument;
465
+ if (count > 0) {
466
+ body.addEventListener("contextmenu", handlePointerUp, options);
467
+ body.addEventListener("pointerleave", handlePointerMove, options);
468
+ body.addEventListener("pointermove", handlePointerMove, options);
469
+ }
470
+ });
471
+ window.addEventListener("pointerup", handlePointerUp, options);
472
+ window.addEventListener("pointercancel", handlePointerUp, options);
473
+ } else ownerDocumentCounts.forEach((count, ownerDocument) => {
474
+ const { body } = ownerDocument;
475
+ if (count > 0) {
476
+ body.addEventListener("pointerdown", handlePointerDown, options);
477
+ body.addEventListener("pointermove", handlePointerMove, options);
478
+ }
479
+ });
324
480
  }
325
- function ve(e, t) {
326
- W.forEach((n) => {
327
- let { setResizeHandlerState: r } = n;
328
- r(e, B.includes(n), t);
481
+ function updateResizeHandlerStates(action, event) {
482
+ registeredResizeHandlers.forEach((data) => {
483
+ const { setResizeHandlerState } = data;
484
+ setResizeHandlerState(action, intersectingHandles.includes(data), event);
329
485
  });
330
486
  }
331
- function ye() {
332
- let [e, t] = d(0);
333
- return i(() => t((e) => e + 1), []);
487
+ function useForceUpdate() {
488
+ const [_, setCount] = useState(0);
489
+ return useCallback(() => setCount((prevCount) => prevCount + 1), []);
334
490
  }
335
- function G(e, t) {
336
- if (!e) throw console.error(t), Error(t);
491
+ function assert(expectedCondition, message) {
492
+ if (!expectedCondition) {
493
+ console.error(message);
494
+ throw Error(message);
495
+ }
337
496
  }
338
- function K(e, t, n = m) {
339
- return e.toFixed(n) === t.toFixed(n) ? 0 : e > t ? 1 : -1;
497
+ function fuzzyCompareNumbers(actual, expected, fractionDigits = PRECISION) {
498
+ if (actual.toFixed(fractionDigits) === expected.toFixed(fractionDigits)) return 0;
499
+ else return actual > expected ? 1 : -1;
340
500
  }
341
- function q(e, t, n = m) {
342
- return K(e, t, n) === 0;
501
+ function fuzzyNumbersEqual$1(actual, expected, fractionDigits = PRECISION) {
502
+ return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
343
503
  }
344
- function J(e, t, n) {
345
- return K(e, t, n) === 0;
504
+ function fuzzyNumbersEqual(actual, expected, fractionDigits) {
505
+ return fuzzyCompareNumbers(actual, expected, fractionDigits) === 0;
346
506
  }
347
- function be(e, t, n) {
348
- if (e.length !== t.length) return !1;
349
- for (let r = 0; r < e.length; r++) {
350
- let i = e[r], a = t[r];
351
- if (!J(i, a, n)) return !1;
507
+ function fuzzyLayoutsEqual(actual, expected, fractionDigits) {
508
+ if (actual.length !== expected.length) return false;
509
+ for (let index = 0; index < actual.length; index++) {
510
+ const actualSize = actual[index];
511
+ const expectedSize = expected[index];
512
+ if (!fuzzyNumbersEqual(actualSize, expectedSize, fractionDigits)) return false;
352
513
  }
353
- return !0;
354
- }
355
- function Y({ panelConstraints: e, panelIndex: t, size: n }) {
356
- let r = e[t];
357
- G(r != null, `Panel constraints not found for index ${t}`);
358
- let { collapsedSize: i = 0, collapsible: a, maxSize: o = 100, minSize: s = 0 } = r;
359
- if (K(n, s) < 0) {
360
- if (a) {
361
- let e = (i + s) / 2;
362
- n = K(n, e) < 0 ? i : s;
363
- } else n = s;
514
+ return true;
515
+ }
516
+ function resizePanel({ panelConstraints: panelConstraintsArray, panelIndex, size }) {
517
+ const panelConstraints = panelConstraintsArray[panelIndex];
518
+ assert(panelConstraints != null, `Panel constraints not found for index ${panelIndex}`);
519
+ let { collapsedSize = 0, collapsible, maxSize = 100, minSize = 0 } = panelConstraints;
520
+ if (fuzzyCompareNumbers(size, minSize) < 0) {
521
+ if (collapsible) {
522
+ const halfwayPoint = (collapsedSize + minSize) / 2;
523
+ if (fuzzyCompareNumbers(size, halfwayPoint) < 0) size = collapsedSize;
524
+ else size = minSize;
525
+ } else size = minSize;
364
526
  }
365
- return n = Math.min(o, n), n = parseFloat(n.toFixed(m)), n;
366
- }
367
- function xe({ delta: e, initialLayout: t, panelConstraints: n, pivotIndices: r, prevLayout: i, trigger: a }) {
368
- if (J(e, 0)) return t;
369
- let o = [...t], [s, c] = r;
370
- G(s != null, "Invalid first pivot index"), G(c != null, "Invalid second pivot index");
371
- let l = 0;
372
- if (a === "keyboard") {
527
+ size = Math.min(maxSize, size);
528
+ size = parseFloat(size.toFixed(PRECISION));
529
+ return size;
530
+ }
531
+ function adjustLayoutByDelta({ delta, initialLayout, panelConstraints: panelConstraintsArray, pivotIndices, prevLayout, trigger }) {
532
+ if (fuzzyNumbersEqual(delta, 0)) return initialLayout;
533
+ const nextLayout = [...initialLayout];
534
+ const [firstPivotIndex, secondPivotIndex] = pivotIndices;
535
+ assert(firstPivotIndex != null, "Invalid first pivot index");
536
+ assert(secondPivotIndex != null, "Invalid second pivot index");
537
+ let deltaApplied = 0;
538
+ if (trigger === "keyboard") {
373
539
  {
374
- let r = e < 0 ? c : s, i = n[r];
375
- G(i, `Panel constraints not found for index ${r}`);
376
- let { collapsedSize: a = 0, collapsible: o, minSize: l = 0 } = i;
377
- if (o) {
378
- let n = t[r];
379
- if (G(n != null, `Previous layout not found for panel index ${r}`), J(n, a)) {
380
- let t = l - n;
381
- K(t, Math.abs(e)) > 0 && (e = e < 0 ? 0 - t : t);
540
+ const index = delta < 0 ? secondPivotIndex : firstPivotIndex;
541
+ const panelConstraints = panelConstraintsArray[index];
542
+ assert(panelConstraints, `Panel constraints not found for index ${index}`);
543
+ const { collapsedSize = 0, collapsible, minSize = 0 } = panelConstraints;
544
+ if (collapsible) {
545
+ const prevSize = initialLayout[index];
546
+ assert(prevSize != null, `Previous layout not found for panel index ${index}`);
547
+ if (fuzzyNumbersEqual(prevSize, collapsedSize)) {
548
+ const localDelta = minSize - prevSize;
549
+ if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) delta = delta < 0 ? 0 - localDelta : localDelta;
382
550
  }
383
551
  }
384
552
  }
385
553
  {
386
- let r = e < 0 ? s : c, i = n[r];
387
- G(i, `No panel constraints found for index ${r}`);
388
- let { collapsedSize: a = 0, collapsible: o, minSize: l = 0 } = i;
389
- if (o) {
390
- let n = t[r];
391
- if (G(n != null, `Previous layout not found for panel index ${r}`), J(n, l)) {
392
- let t = n - a;
393
- K(t, Math.abs(e)) > 0 && (e = e < 0 ? 0 - t : t);
554
+ const index = delta < 0 ? firstPivotIndex : secondPivotIndex;
555
+ const panelConstraints = panelConstraintsArray[index];
556
+ assert(panelConstraints, `No panel constraints found for index ${index}`);
557
+ const { collapsedSize = 0, collapsible, minSize = 0 } = panelConstraints;
558
+ if (collapsible) {
559
+ const prevSize = initialLayout[index];
560
+ assert(prevSize != null, `Previous layout not found for panel index ${index}`);
561
+ if (fuzzyNumbersEqual(prevSize, minSize)) {
562
+ const localDelta = prevSize - collapsedSize;
563
+ if (fuzzyCompareNumbers(localDelta, Math.abs(delta)) > 0) delta = delta < 0 ? 0 - localDelta : localDelta;
394
564
  }
395
565
  }
396
566
  }
397
567
  }
398
568
  {
399
- let r = e < 0 ? 1 : -1, i = e < 0 ? c : s, a = 0;
400
- for (;;) {
401
- let e = t[i];
402
- G(e != null, `Previous layout not found for panel index ${i}`);
403
- let o = Y({
404
- panelConstraints: n,
405
- panelIndex: i,
569
+ const increment = delta < 0 ? 1 : -1;
570
+ let index = delta < 0 ? secondPivotIndex : firstPivotIndex;
571
+ let maxAvailableDelta = 0;
572
+ while (true) {
573
+ const prevSize = initialLayout[index];
574
+ assert(prevSize != null, `Previous layout not found for panel index ${index}`);
575
+ const delta = resizePanel({
576
+ panelConstraints: panelConstraintsArray,
577
+ panelIndex: index,
406
578
  size: 100
407
- }) - e;
408
- if (a += o, i += r, i < 0 || i >= n.length) break;
579
+ }) - prevSize;
580
+ maxAvailableDelta += delta;
581
+ index += increment;
582
+ if (index < 0 || index >= panelConstraintsArray.length) break;
409
583
  }
410
- let o = Math.min(Math.abs(e), Math.abs(a));
411
- e = e < 0 ? 0 - o : o;
584
+ const minAbsDelta = Math.min(Math.abs(delta), Math.abs(maxAvailableDelta));
585
+ delta = delta < 0 ? 0 - minAbsDelta : minAbsDelta;
412
586
  }
413
587
  {
414
- let r = e < 0 ? s : c;
415
- for (; r >= 0 && r < n.length;) {
416
- let i = Math.abs(e) - Math.abs(l), a = t[r];
417
- G(a != null, `Previous layout not found for panel index ${r}`);
418
- let s = a - i, c = Y({
419
- panelConstraints: n,
420
- panelIndex: r,
421
- size: s
588
+ let index = delta < 0 ? firstPivotIndex : secondPivotIndex;
589
+ while (index >= 0 && index < panelConstraintsArray.length) {
590
+ const deltaRemaining = Math.abs(delta) - Math.abs(deltaApplied);
591
+ const prevSize = initialLayout[index];
592
+ assert(prevSize != null, `Previous layout not found for panel index ${index}`);
593
+ const unsafeSize = prevSize - deltaRemaining;
594
+ const safeSize = resizePanel({
595
+ panelConstraints: panelConstraintsArray,
596
+ panelIndex: index,
597
+ size: unsafeSize
422
598
  });
423
- if (!J(a, c) && (l += a - c, o[r] = c, l.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3), void 0, { numeric: !0 }) >= 0)) break;
424
- e < 0 ? r-- : r++;
599
+ if (!fuzzyNumbersEqual(prevSize, safeSize)) {
600
+ deltaApplied += prevSize - safeSize;
601
+ nextLayout[index] = safeSize;
602
+ if (deltaApplied.toPrecision(3).localeCompare(Math.abs(delta).toPrecision(3), void 0, { numeric: true }) >= 0) break;
603
+ }
604
+ if (delta < 0) index--;
605
+ else index++;
425
606
  }
426
607
  }
427
- if (be(i, o)) return i;
608
+ if (fuzzyLayoutsEqual(prevLayout, nextLayout)) return prevLayout;
428
609
  {
429
- let r = e < 0 ? c : s, i = t[r];
430
- G(i != null, `Previous layout not found for panel index ${r}`);
431
- let a = i + l, u = Y({
432
- panelConstraints: n,
433
- panelIndex: r,
434
- size: a
610
+ const pivotIndex = delta < 0 ? secondPivotIndex : firstPivotIndex;
611
+ const prevSize = initialLayout[pivotIndex];
612
+ assert(prevSize != null, `Previous layout not found for panel index ${pivotIndex}`);
613
+ const unsafeSize = prevSize + deltaApplied;
614
+ const safeSize = resizePanel({
615
+ panelConstraints: panelConstraintsArray,
616
+ panelIndex: pivotIndex,
617
+ size: unsafeSize
435
618
  });
436
- if (o[r] = u, !J(u, a)) {
437
- let t = a - u, r = e < 0 ? c : s;
438
- for (; r >= 0 && r < n.length;) {
439
- let i = o[r];
440
- G(i != null, `Previous layout not found for panel index ${r}`);
441
- let a = i + t, s = Y({
442
- panelConstraints: n,
443
- panelIndex: r,
444
- size: a
619
+ nextLayout[pivotIndex] = safeSize;
620
+ if (!fuzzyNumbersEqual(safeSize, unsafeSize)) {
621
+ let deltaRemaining = unsafeSize - safeSize;
622
+ let index = delta < 0 ? secondPivotIndex : firstPivotIndex;
623
+ while (index >= 0 && index < panelConstraintsArray.length) {
624
+ const prevSize = nextLayout[index];
625
+ assert(prevSize != null, `Previous layout not found for panel index ${index}`);
626
+ const unsafeSize = prevSize + deltaRemaining;
627
+ const safeSize = resizePanel({
628
+ panelConstraints: panelConstraintsArray,
629
+ panelIndex: index,
630
+ size: unsafeSize
445
631
  });
446
- if (J(i, s) || (t -= s - i, o[r] = s), J(t, 0)) break;
447
- e > 0 ? r-- : r++;
632
+ if (!fuzzyNumbersEqual(prevSize, safeSize)) {
633
+ deltaRemaining -= safeSize - prevSize;
634
+ nextLayout[index] = safeSize;
635
+ }
636
+ if (fuzzyNumbersEqual(deltaRemaining, 0)) break;
637
+ if (delta > 0) index--;
638
+ else index++;
448
639
  }
449
640
  }
450
641
  }
451
- return J(o.reduce((e, t) => t + e, 0), 100) ? o : i;
452
- }
453
- function Se({ layout: e, panelsArray: t, pivotIndices: n }) {
454
- let r = 0, i = 100, a = 0, o = 0, s = n[0];
455
- return G(s != null, "No pivot index found"), t.forEach((e, t) => {
456
- let { constraints: n } = e, { maxSize: c = 100, minSize: l = 0 } = n;
457
- t === s ? (r = l, i = c) : (a += l, o += c);
458
- }), {
459
- valueMax: Math.min(i, 100 - a),
460
- valueMin: Math.max(r, 100 - o),
461
- valueNow: e[s]
642
+ if (!fuzzyNumbersEqual(nextLayout.reduce((total, size) => size + total, 0), 100)) return prevLayout;
643
+ return nextLayout;
644
+ }
645
+ function calculateAriaValues({ layout, panelsArray, pivotIndices }) {
646
+ let currentMinSize = 0;
647
+ let currentMaxSize = 100;
648
+ let totalMinSize = 0;
649
+ let totalMaxSize = 0;
650
+ const firstIndex = pivotIndices[0];
651
+ assert(firstIndex != null, "No pivot index found");
652
+ panelsArray.forEach((panelData, index) => {
653
+ const { constraints } = panelData;
654
+ const { maxSize = 100, minSize = 0 } = constraints;
655
+ if (index === firstIndex) {
656
+ currentMinSize = minSize;
657
+ currentMaxSize = maxSize;
658
+ } else {
659
+ totalMinSize += minSize;
660
+ totalMaxSize += maxSize;
661
+ }
662
+ });
663
+ return {
664
+ valueMax: Math.min(currentMaxSize, 100 - totalMinSize),
665
+ valueMin: Math.max(currentMinSize, 100 - totalMaxSize),
666
+ valueNow: layout[firstIndex]
462
667
  };
463
668
  }
464
- function X(e, t = document) {
465
- return Array.from(t.querySelectorAll(`[${p.resizeHandleId}][data-panel-group-id="${e}"]`));
466
- }
467
- function Ce(e, t, n = document) {
468
- return X(e, n).findIndex((e) => e.getAttribute(p.resizeHandleId) === t) ?? null;
469
- }
470
- function we(e, t, n) {
471
- let r = Ce(e, t, n);
472
- return r == null ? [-1, -1] : [r, r + 1];
473
- }
474
- function Te(e, t = document) {
475
- return t instanceof HTMLElement && t?.dataset?.panelGroupId == e ? t : t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`) || null;
476
- }
477
- function Ee(e, t = document) {
478
- return t.querySelector(`[${p.resizeHandleId}="${e}"]`) || null;
479
- }
480
- function De(e, t, n, r = document) {
481
- let i = Ee(t, r), a = X(e, r), o = i ? a.indexOf(i) : -1;
482
- return [n[o]?.id ?? null, n[o + 1]?.id ?? null];
483
- }
484
- function Oe({ committedValuesRef: e, eagerValuesRef: t, groupId: n, layout: r, panelDataArray: i, panelGroupElement: a, setLayout: s }) {
485
- u({ didWarnAboutMissingResizeHandle: !1 }), h(() => {
486
- if (!a) return;
487
- let e = X(n, a);
488
- for (let t = 0; t < i.length - 1; t++) {
489
- let { valueMax: n, valueMin: a, valueNow: o } = Se({
490
- layout: r,
491
- panelsArray: i,
492
- pivotIndices: [t, t + 1]
493
- }), s = e[t];
494
- if (s != null) {
495
- let e = i[t];
496
- G(e, `No panel data found for index "${t}"`), s.setAttribute("aria-controls", e.id), s.setAttribute("aria-valuemax", "" + Math.round(n)), s.setAttribute("aria-valuemin", "" + Math.round(a)), s.setAttribute("aria-valuenow", o == null ? "" : "" + Math.round(o));
669
+ function getResizeHandleElementsForGroup(groupId, scope = document) {
670
+ return Array.from(scope.querySelectorAll(`[${DATA_ATTRIBUTES.resizeHandleId}][data-panel-group-id="${groupId}"]`));
671
+ }
672
+ function getResizeHandleElementIndex(groupId, id, scope = document) {
673
+ const index = getResizeHandleElementsForGroup(groupId, scope).findIndex((handle) => handle.getAttribute(DATA_ATTRIBUTES.resizeHandleId) === id);
674
+ return index !== null && index !== void 0 ? index : null;
675
+ }
676
+ function determinePivotIndices(groupId, dragHandleId, panelGroupElement) {
677
+ const index = getResizeHandleElementIndex(groupId, dragHandleId, panelGroupElement);
678
+ return index != null ? [index, index + 1] : [-1, -1];
679
+ }
680
+ function getPanelGroupElement(id, rootElement = document) {
681
+ var _dataset;
682
+ if (rootElement instanceof HTMLElement && (rootElement === null || rootElement === void 0 ? void 0 : (_dataset = rootElement.dataset) === null || _dataset === void 0 ? void 0 : _dataset.panelGroupId) == id) return rootElement;
683
+ const element = rootElement.querySelector(`[data-panel-group][data-panel-group-id="${id}"]`);
684
+ if (element) return element;
685
+ return null;
686
+ }
687
+ function getResizeHandleElement(id, scope = document) {
688
+ const element = scope.querySelector(`[${DATA_ATTRIBUTES.resizeHandleId}="${id}"]`);
689
+ if (element) return element;
690
+ return null;
691
+ }
692
+ function getResizeHandlePanelIds(groupId, handleId, panelsArray, scope = document) {
693
+ var _panelsArray$index$id, _panelsArray$index, _panelsArray$id, _panelsArray;
694
+ const handle = getResizeHandleElement(handleId, scope);
695
+ const handles = getResizeHandleElementsForGroup(groupId, scope);
696
+ const index = handle ? handles.indexOf(handle) : -1;
697
+ return [(_panelsArray$index$id = (_panelsArray$index = panelsArray[index]) === null || _panelsArray$index === void 0 ? void 0 : _panelsArray$index.id) !== null && _panelsArray$index$id !== void 0 ? _panelsArray$index$id : null, (_panelsArray$id = (_panelsArray = panelsArray[index + 1]) === null || _panelsArray === void 0 ? void 0 : _panelsArray.id) !== null && _panelsArray$id !== void 0 ? _panelsArray$id : null];
698
+ }
699
+ function useWindowSplitterPanelGroupBehavior({ committedValuesRef, eagerValuesRef, groupId, layout, panelDataArray, panelGroupElement, setLayout }) {
700
+ useRef({ didWarnAboutMissingResizeHandle: false });
701
+ useIsomorphicLayoutEffect(() => {
702
+ if (!panelGroupElement) return;
703
+ const resizeHandleElements = getResizeHandleElementsForGroup(groupId, panelGroupElement);
704
+ for (let index = 0; index < panelDataArray.length - 1; index++) {
705
+ const { valueMax, valueMin, valueNow } = calculateAriaValues({
706
+ layout,
707
+ panelsArray: panelDataArray,
708
+ pivotIndices: [index, index + 1]
709
+ });
710
+ const resizeHandleElement = resizeHandleElements[index];
711
+ if (resizeHandleElement == null);
712
+ else {
713
+ const panelData = panelDataArray[index];
714
+ assert(panelData, `No panel data found for index "${index}"`);
715
+ resizeHandleElement.setAttribute("aria-controls", panelData.id);
716
+ resizeHandleElement.setAttribute("aria-valuemax", "" + Math.round(valueMax));
717
+ resizeHandleElement.setAttribute("aria-valuemin", "" + Math.round(valueMin));
718
+ resizeHandleElement.setAttribute("aria-valuenow", valueNow != null ? "" + Math.round(valueNow) : "");
497
719
  }
498
720
  }
499
721
  return () => {
500
- e.forEach((e, t) => {
501
- e.removeAttribute("aria-controls"), e.removeAttribute("aria-valuemax"), e.removeAttribute("aria-valuemin"), e.removeAttribute("aria-valuenow");
722
+ resizeHandleElements.forEach((resizeHandleElement, index) => {
723
+ resizeHandleElement.removeAttribute("aria-controls");
724
+ resizeHandleElement.removeAttribute("aria-valuemax");
725
+ resizeHandleElement.removeAttribute("aria-valuemin");
726
+ resizeHandleElement.removeAttribute("aria-valuenow");
502
727
  });
503
728
  };
504
729
  }, [
505
- n,
506
- r,
507
- i,
508
- a
509
- ]), o(() => {
510
- if (!a) return;
511
- let e = t.current;
512
- G(e, "Eager values not found");
513
- let { panelDataArray: i } = e;
514
- G(Te(n, a) != null, `No group found for id "${n}"`);
515
- let o = X(n, a);
516
- G(o, `No resize handles found for group id "${n}"`);
517
- let c = o.map((e) => {
518
- let t = e.getAttribute(p.resizeHandleId);
519
- G(t, "Resize handle element has no handle id attribute");
520
- let [o, c] = De(n, t, i, a);
521
- if (o == null || c == null) return () => {};
522
- let l = (e) => {
523
- if (!e.defaultPrevented) switch (e.key) {
730
+ groupId,
731
+ layout,
732
+ panelDataArray,
733
+ panelGroupElement
734
+ ]);
735
+ useEffect(() => {
736
+ if (!panelGroupElement) return;
737
+ const eagerValues = eagerValuesRef.current;
738
+ assert(eagerValues, `Eager values not found`);
739
+ const { panelDataArray } = eagerValues;
740
+ assert(getPanelGroupElement(groupId, panelGroupElement) != null, `No group found for id "${groupId}"`);
741
+ const handles = getResizeHandleElementsForGroup(groupId, panelGroupElement);
742
+ assert(handles, `No resize handles found for group id "${groupId}"`);
743
+ const cleanupFunctions = handles.map((handle) => {
744
+ const handleId = handle.getAttribute(DATA_ATTRIBUTES.resizeHandleId);
745
+ assert(handleId, `Resize handle element has no handle id attribute`);
746
+ const [idBefore, idAfter] = getResizeHandlePanelIds(groupId, handleId, panelDataArray, panelGroupElement);
747
+ if (idBefore == null || idAfter == null) return () => {};
748
+ const onKeyDown = (event) => {
749
+ if (event.defaultPrevented) return;
750
+ switch (event.key) {
524
751
  case "Enter": {
525
- e.preventDefault();
526
- let c = i.findIndex((e) => e.id === o);
527
- if (c >= 0) {
528
- let e = i[c];
529
- G(e, `No panel data found for index ${c}`);
530
- let o = r[c], { collapsedSize: l = 0, collapsible: u, minSize: d = 0 } = e.constraints;
531
- if (o != null && u) {
532
- let e = xe({
533
- delta: J(o, l) ? d - l : l - o,
534
- initialLayout: r,
535
- panelConstraints: i.map((e) => e.constraints),
536
- pivotIndices: we(n, t, a),
537
- prevLayout: r,
752
+ event.preventDefault();
753
+ const index = panelDataArray.findIndex((panelData) => panelData.id === idBefore);
754
+ if (index >= 0) {
755
+ const panelData = panelDataArray[index];
756
+ assert(panelData, `No panel data found for index ${index}`);
757
+ const size = layout[index];
758
+ const { collapsedSize = 0, collapsible, minSize = 0 } = panelData.constraints;
759
+ if (size != null && collapsible) {
760
+ const nextLayout = adjustLayoutByDelta({
761
+ delta: fuzzyNumbersEqual(size, collapsedSize) ? minSize - collapsedSize : collapsedSize - size,
762
+ initialLayout: layout,
763
+ panelConstraints: panelDataArray.map((panelData) => panelData.constraints),
764
+ pivotIndices: determinePivotIndices(groupId, handleId, panelGroupElement),
765
+ prevLayout: layout,
538
766
  trigger: "keyboard"
539
767
  });
540
- r !== e && s(e);
768
+ if (layout !== nextLayout) setLayout(nextLayout);
541
769
  }
542
770
  }
543
771
  break;
544
772
  }
545
773
  }
546
774
  };
547
- return e.addEventListener("keydown", l), () => {
548
- e.removeEventListener("keydown", l);
775
+ handle.addEventListener("keydown", onKeyDown);
776
+ return () => {
777
+ handle.removeEventListener("keydown", onKeyDown);
549
778
  };
550
779
  });
551
780
  return () => {
552
- c.forEach((e) => e());
781
+ cleanupFunctions.forEach((cleanupFunction) => cleanupFunction());
553
782
  };
554
783
  }, [
555
- a,
556
- e,
557
- t,
558
- n,
559
- r,
560
- i,
561
- s
784
+ panelGroupElement,
785
+ committedValuesRef,
786
+ eagerValuesRef,
787
+ groupId,
788
+ layout,
789
+ panelDataArray,
790
+ setLayout
562
791
  ]);
563
792
  }
564
- function ke(e, t) {
565
- if (e.length !== t.length) return !1;
566
- for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
567
- return !0;
568
- }
569
- function Ae(e, t) {
570
- let n = e === "horizontal", { x: r, y: i } = k(t);
571
- return n ? r : i;
572
- }
573
- function je(e, t, n, r, i) {
574
- let a = n === "horizontal", o = Ee(t, i);
575
- G(o, `No resize handle element found for id "${t}"`);
576
- let s = o.getAttribute(p.groupId);
577
- G(s, "Resize handle element has no group id attribute");
578
- let { initialCursorPosition: c } = r, l = Ae(n, e), u = Te(s, i);
579
- G(u, `No group element found for id "${s}"`);
580
- let d = u.getBoundingClientRect(), f = a ? d.width : d.height;
581
- return (l - c) / f * 100;
582
- }
583
- function Me(e, t, n, r, i, a) {
584
- if (D(e)) {
585
- let t = n === "horizontal", r = 0;
586
- r = e.shiftKey ? 100 : i ?? 10;
587
- let a = 0;
588
- switch (e.key) {
793
+ function areEqual(arrayA, arrayB) {
794
+ if (arrayA.length !== arrayB.length) return false;
795
+ for (let index = 0; index < arrayA.length; index++) if (arrayA[index] !== arrayB[index]) return false;
796
+ return true;
797
+ }
798
+ function getResizeEventCursorPosition(direction, event) {
799
+ const isHorizontal = direction === "horizontal";
800
+ const { x, y } = getResizeEventCoordinates(event);
801
+ return isHorizontal ? x : y;
802
+ }
803
+ function calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement) {
804
+ const isHorizontal = direction === "horizontal";
805
+ const handleElement = getResizeHandleElement(dragHandleId, panelGroupElement);
806
+ assert(handleElement, `No resize handle element found for id "${dragHandleId}"`);
807
+ const groupId = handleElement.getAttribute(DATA_ATTRIBUTES.groupId);
808
+ assert(groupId, `Resize handle element has no group id attribute`);
809
+ let { initialCursorPosition } = initialDragState;
810
+ const cursorPosition = getResizeEventCursorPosition(direction, event);
811
+ const groupElement = getPanelGroupElement(groupId, panelGroupElement);
812
+ assert(groupElement, `No group element found for id "${groupId}"`);
813
+ const groupRect = groupElement.getBoundingClientRect();
814
+ const groupSizeInPixels = isHorizontal ? groupRect.width : groupRect.height;
815
+ return (cursorPosition - initialCursorPosition) / groupSizeInPixels * 100;
816
+ }
817
+ function calculateDeltaPercentage(event, dragHandleId, direction, initialDragState, keyboardResizeBy, panelGroupElement) {
818
+ if (isKeyDown(event)) {
819
+ const isHorizontal = direction === "horizontal";
820
+ let delta = 0;
821
+ if (event.shiftKey) delta = 100;
822
+ else if (keyboardResizeBy != null) delta = keyboardResizeBy;
823
+ else delta = 10;
824
+ let movement = 0;
825
+ switch (event.key) {
589
826
  case "ArrowDown":
590
- a = t ? 0 : r;
827
+ movement = isHorizontal ? 0 : delta;
591
828
  break;
592
829
  case "ArrowLeft":
593
- a = t ? -r : 0;
830
+ movement = isHorizontal ? -delta : 0;
594
831
  break;
595
832
  case "ArrowRight":
596
- a = t ? r : 0;
833
+ movement = isHorizontal ? delta : 0;
597
834
  break;
598
835
  case "ArrowUp":
599
- a = t ? 0 : -r;
836
+ movement = isHorizontal ? 0 : -delta;
600
837
  break;
601
838
  case "End":
602
- a = 100;
839
+ movement = 100;
603
840
  break;
604
- case "Home": a = -100;
841
+ case "Home": movement = -100;
605
842
  }
606
- return a;
843
+ return movement;
844
+ } else {
845
+ if (initialDragState == null) return 0;
846
+ return calculateDragOffsetPercentage(event, dragHandleId, direction, initialDragState, panelGroupElement);
607
847
  }
608
- return r == null ? 0 : je(e, t, n, r, a);
609
- }
610
- function Ne({ panelDataArray: e }) {
611
- let t = Array(e.length), n = e.map((e) => e.constraints), r = 0, i = 100;
612
- for (let a = 0; a < e.length; a++) {
613
- let e = n[a];
614
- G(e, `Panel constraints not found for index ${a}`);
615
- let { defaultSize: o } = e;
616
- o != null && (r++, t[a] = o, i -= o);
848
+ }
849
+ function calculateUnsafeDefaultLayout({ panelDataArray }) {
850
+ const layout = Array(panelDataArray.length);
851
+ const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
852
+ let numPanelsWithSizes = 0;
853
+ let remainingSize = 100;
854
+ for (let index = 0; index < panelDataArray.length; index++) {
855
+ const panelConstraints = panelConstraintsArray[index];
856
+ assert(panelConstraints, `Panel constraints not found for index ${index}`);
857
+ const { defaultSize } = panelConstraints;
858
+ if (defaultSize != null) {
859
+ numPanelsWithSizes++;
860
+ layout[index] = defaultSize;
861
+ remainingSize -= defaultSize;
862
+ }
617
863
  }
618
- for (let a = 0; a < e.length; a++) {
619
- let o = n[a];
620
- G(o, `Panel constraints not found for index ${a}`);
621
- let { defaultSize: s } = o;
622
- if (s != null) continue;
623
- let c = e.length - r, l = i / c;
624
- r++, t[a] = l, i -= l;
864
+ for (let index = 0; index < panelDataArray.length; index++) {
865
+ const panelConstraints = panelConstraintsArray[index];
866
+ assert(panelConstraints, `Panel constraints not found for index ${index}`);
867
+ const { defaultSize } = panelConstraints;
868
+ if (defaultSize != null) continue;
869
+ const numRemainingPanels = panelDataArray.length - numPanelsWithSizes;
870
+ const size = remainingSize / numRemainingPanels;
871
+ numPanelsWithSizes++;
872
+ layout[index] = size;
873
+ remainingSize -= size;
625
874
  }
626
- return t;
627
- }
628
- function Z(e, t, n) {
629
- t.forEach((t, r) => {
630
- let i = e[r];
631
- G(i, `Panel data not found for index ${r}`);
632
- let { callbacks: a, constraints: o, id: s } = i, { collapsedSize: c = 0, collapsible: l } = o, u = n[s];
633
- if (u == null || t !== u) {
634
- n[s] = t;
635
- let { onCollapse: e, onExpand: r, onResize: i } = a;
636
- i && i(t, u), l && (e || r) && (r && (u == null || q(u, c)) && !q(t, c) && r(), e && (u == null || !q(u, c)) && q(t, c) && e());
875
+ return layout;
876
+ }
877
+ function callPanelCallbacks(panelsArray, layout, panelIdToLastNotifiedSizeMap) {
878
+ layout.forEach((size, index) => {
879
+ const panelData = panelsArray[index];
880
+ assert(panelData, `Panel data not found for index ${index}`);
881
+ const { callbacks, constraints, id: panelId } = panelData;
882
+ const { collapsedSize = 0, collapsible } = constraints;
883
+ const lastNotifiedSize = panelIdToLastNotifiedSizeMap[panelId];
884
+ if (lastNotifiedSize == null || size !== lastNotifiedSize) {
885
+ panelIdToLastNotifiedSizeMap[panelId] = size;
886
+ const { onCollapse, onExpand, onResize } = callbacks;
887
+ if (onResize) onResize(size, lastNotifiedSize);
888
+ if (collapsible && (onCollapse || onExpand)) {
889
+ if (onExpand && (lastNotifiedSize == null || fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && !fuzzyNumbersEqual$1(size, collapsedSize)) onExpand();
890
+ if (onCollapse && (lastNotifiedSize == null || !fuzzyNumbersEqual$1(lastNotifiedSize, collapsedSize)) && fuzzyNumbersEqual$1(size, collapsedSize)) onCollapse();
891
+ }
637
892
  }
638
893
  });
639
894
  }
640
- function Pe(e, t) {
641
- if (e.length !== t.length) return !1;
642
- for (let n = 0; n < e.length; n++) if (e[n] != t[n]) return !1;
643
- return !0;
644
- }
645
- function Fe({ defaultSize: e, dragState: t, layout: n, panelData: r, panelIndex: i, precision: a = 3 }) {
646
- let o = n[i], s;
647
- return s = o == null ? e == null ? "1" : e.toPrecision(a) : r.length === 1 ? "1" : o.toPrecision(a), {
895
+ function compareLayouts(a, b) {
896
+ if (a.length !== b.length) return false;
897
+ else for (let index = 0; index < a.length; index++) if (a[index] != b[index]) return false;
898
+ return true;
899
+ }
900
+ function computePanelFlexBoxStyle({ defaultSize, dragState, layout, panelData, panelIndex, precision = 3 }) {
901
+ const size = layout[panelIndex];
902
+ let flexGrow;
903
+ if (size == null) flexGrow = defaultSize != void 0 ? defaultSize.toPrecision(precision) : "1";
904
+ else if (panelData.length === 1) flexGrow = "1";
905
+ else flexGrow = size.toPrecision(precision);
906
+ return {
648
907
  flexBasis: 0,
649
- flexGrow: s,
908
+ flexGrow,
650
909
  flexShrink: 1,
651
910
  overflow: "hidden",
652
- pointerEvents: t === null ? void 0 : "none"
911
+ pointerEvents: dragState !== null ? "none" : void 0
653
912
  };
654
913
  }
655
- function Ie(e, t = 10) {
656
- let n = null;
657
- return (...r) => {
658
- n !== null && clearTimeout(n), n = setTimeout(() => {
659
- e(...r);
660
- }, t);
914
+ function debounce(callback, durationMs = 10) {
915
+ let timeoutId = null;
916
+ let callable = (...args) => {
917
+ if (timeoutId !== null) clearTimeout(timeoutId);
918
+ timeoutId = setTimeout(() => {
919
+ callback(...args);
920
+ }, durationMs);
661
921
  };
922
+ return callable;
662
923
  }
663
- function Le(e) {
924
+ function initializeDefaultStorage(storageObject) {
664
925
  try {
665
- if (typeof localStorage < "u") e.getItem = (e) => localStorage.getItem(e), e.setItem = (e, t) => {
666
- localStorage.setItem(e, t);
667
- };
668
- else throw Error("localStorage not supported in this environment");
669
- } catch (t) {
670
- console.error(t), e.getItem = () => null, e.setItem = () => {};
926
+ if (typeof localStorage !== "undefined") {
927
+ storageObject.getItem = (name) => {
928
+ return localStorage.getItem(name);
929
+ };
930
+ storageObject.setItem = (name, value) => {
931
+ localStorage.setItem(name, value);
932
+ };
933
+ } else throw new Error("localStorage not supported in this environment");
934
+ } catch (error) {
935
+ console.error(error);
936
+ storageObject.getItem = () => null;
937
+ storageObject.setItem = () => {};
671
938
  }
672
939
  }
673
- function Re(e) {
674
- return `react-resizable-panels:${e}`;
940
+ function getPanelGroupKey(autoSaveId) {
941
+ return `react-resizable-panels:${autoSaveId}`;
675
942
  }
676
- function ze(e) {
677
- return e.map((e) => {
678
- let { constraints: t, id: n, idIsFromProps: r, order: i } = e;
679
- return r ? n : i ? `${i}:${JSON.stringify(t)}` : JSON.stringify(t);
680
- }).sort((e, t) => e.localeCompare(t)).join(",");
943
+ function getPanelKey(panels) {
944
+ return panels.map((panel) => {
945
+ const { constraints, id, idIsFromProps, order } = panel;
946
+ if (idIsFromProps) return id;
947
+ else return order ? `${order}:${JSON.stringify(constraints)}` : JSON.stringify(constraints);
948
+ }).sort((a, b) => a.localeCompare(b)).join(",");
681
949
  }
682
- function Be(e, t) {
950
+ function loadSerializedPanelGroupState(autoSaveId, storage) {
683
951
  try {
684
- let n = Re(e), r = t.getItem(n);
685
- if (r) {
686
- let e = JSON.parse(r);
687
- if (typeof e == "object" && e) return e;
952
+ const panelGroupKey = getPanelGroupKey(autoSaveId);
953
+ const serialized = storage.getItem(panelGroupKey);
954
+ if (serialized) {
955
+ const parsed = JSON.parse(serialized);
956
+ if (typeof parsed === "object" && parsed != null) return parsed;
688
957
  }
689
- } catch {}
958
+ } catch (error) {}
690
959
  return null;
691
960
  }
692
- function Ve(e, t, n) {
693
- return (Be(e, n) ?? {})[ze(t)] ?? null;
694
- }
695
- function He(e, t, n, r, i) {
696
- let a = Re(e), o = ze(t), s = Be(e, i) ?? {};
697
- s[o] = {
698
- expandToSizes: Object.fromEntries(n.entries()),
699
- layout: r
961
+ function loadPanelGroupState(autoSaveId, panels, storage) {
962
+ var _loadSerializedPanelG, _state$panelKey;
963
+ return (_state$panelKey = ((_loadSerializedPanelG = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG !== void 0 ? _loadSerializedPanelG : {})[getPanelKey(panels)]) !== null && _state$panelKey !== void 0 ? _state$panelKey : null;
964
+ }
965
+ function savePanelGroupState(autoSaveId, panels, panelSizesBeforeCollapse, sizes, storage) {
966
+ var _loadSerializedPanelG2;
967
+ const panelGroupKey = getPanelGroupKey(autoSaveId);
968
+ const panelKey = getPanelKey(panels);
969
+ const state = (_loadSerializedPanelG2 = loadSerializedPanelGroupState(autoSaveId, storage)) !== null && _loadSerializedPanelG2 !== void 0 ? _loadSerializedPanelG2 : {};
970
+ state[panelKey] = {
971
+ expandToSizes: Object.fromEntries(panelSizesBeforeCollapse.entries()),
972
+ layout: sizes
700
973
  };
701
974
  try {
702
- i.setItem(a, JSON.stringify(s));
703
- } catch (e) {
704
- console.error(e);
975
+ storage.setItem(panelGroupKey, JSON.stringify(state));
976
+ } catch (error) {
977
+ console.error(error);
705
978
  }
706
979
  }
707
- function Ue({ layout: e, panelConstraints: t }) {
708
- let n = [...e], r = n.reduce((e, t) => e + t, 0);
709
- if (n.length !== t.length) throw Error(`Invalid ${t.length} panel layout: ${n.map((e) => `${e}%`).join(", ")}`);
710
- if (!J(r, 100) && n.length > 0) for (let e = 0; e < t.length; e++) {
711
- let t = n[e];
712
- G(t != null, `No layout data found for index ${e}`);
713
- let i = 100 / r * t;
714
- n[e] = i;
980
+ function validatePanelGroupLayout({ layout: prevLayout, panelConstraints }) {
981
+ const nextLayout = [...prevLayout];
982
+ const nextLayoutTotalSize = nextLayout.reduce((accumulated, current) => accumulated + current, 0);
983
+ if (nextLayout.length !== panelConstraints.length) throw Error(`Invalid ${panelConstraints.length} panel layout: ${nextLayout.map((size) => `${size}%`).join(", ")}`);
984
+ else if (!fuzzyNumbersEqual(nextLayoutTotalSize, 100) && nextLayout.length > 0) for (let index = 0; index < panelConstraints.length; index++) {
985
+ const unsafeSize = nextLayout[index];
986
+ assert(unsafeSize != null, `No layout data found for index ${index}`);
987
+ const safeSize = 100 / nextLayoutTotalSize * unsafeSize;
988
+ nextLayout[index] = safeSize;
715
989
  }
716
- let i = 0;
717
- for (let e = 0; e < t.length; e++) {
718
- let r = n[e];
719
- G(r != null, `No layout data found for index ${e}`);
720
- let a = Y({
721
- panelConstraints: t,
722
- panelIndex: e,
723
- size: r
990
+ let remainingSize = 0;
991
+ for (let index = 0; index < panelConstraints.length; index++) {
992
+ const unsafeSize = nextLayout[index];
993
+ assert(unsafeSize != null, `No layout data found for index ${index}`);
994
+ const safeSize = resizePanel({
995
+ panelConstraints,
996
+ panelIndex: index,
997
+ size: unsafeSize
724
998
  });
725
- r != a && (i += r - a, n[e] = a);
999
+ if (unsafeSize != safeSize) {
1000
+ remainingSize += unsafeSize - safeSize;
1001
+ nextLayout[index] = safeSize;
1002
+ }
726
1003
  }
727
- if (!J(i, 0)) for (let e = 0; e < t.length; e++) {
728
- let r = n[e];
729
- G(r != null, `No layout data found for index ${e}`);
730
- let a = r + i, o = Y({
731
- panelConstraints: t,
732
- panelIndex: e,
733
- size: a
1004
+ if (!fuzzyNumbersEqual(remainingSize, 0)) for (let index = 0; index < panelConstraints.length; index++) {
1005
+ const prevSize = nextLayout[index];
1006
+ assert(prevSize != null, `No layout data found for index ${index}`);
1007
+ const unsafeSize = prevSize + remainingSize;
1008
+ const safeSize = resizePanel({
1009
+ panelConstraints,
1010
+ panelIndex: index,
1011
+ size: unsafeSize
734
1012
  });
735
- if (r !== o && (i -= o - r, n[e] = o, J(i, 0))) break;
1013
+ if (prevSize !== safeSize) {
1014
+ remainingSize -= safeSize - prevSize;
1015
+ nextLayout[index] = safeSize;
1016
+ if (fuzzyNumbersEqual(remainingSize, 0)) break;
1017
+ }
736
1018
  }
737
- return n;
738
- }
739
- var We = 100, Ge = {
740
- getItem: (e) => (Le(Ge), Ge.getItem(e)),
741
- setItem: (e, t) => {
742
- Le(Ge), Ge.setItem(e, t);
1019
+ return nextLayout;
1020
+ }
1021
+ var LOCAL_STORAGE_DEBOUNCE_INTERVAL = 100;
1022
+ var defaultStorage = {
1023
+ getItem: (name) => {
1024
+ initializeDefaultStorage(defaultStorage);
1025
+ return defaultStorage.getItem(name);
1026
+ },
1027
+ setItem: (name, value) => {
1028
+ initializeDefaultStorage(defaultStorage);
1029
+ defaultStorage.setItem(name, value);
743
1030
  }
744
- }, Ke = {};
745
- function qe({ autoSaveId: e = null, children: t, className: r = "", direction: a, forwardedRef: c, id: m = null, onLayout: g = null, keyboardResizeBy: _ = null, storage: v = Ge, style: y, tagName: te = "div", ...b }) {
746
- let x = ee(m), S = u(null), [C, w] = d(null), [T, E] = d([]), k = ye(), A = u({}), j = u(/* @__PURE__ */ new Map()), M = u(0), N = u({
747
- autoSaveId: e,
748
- direction: a,
749
- dragState: C,
750
- id: x,
751
- keyboardResizeBy: _,
752
- onLayout: g,
753
- storage: v
754
- }), P = u({
755
- layout: T,
1031
+ };
1032
+ var debounceMap = {};
1033
+ function PanelGroupWithForwardedRef({ autoSaveId = null, children, className: classNameFromProps = "", direction, forwardedRef, id: idFromProps = null, onLayout = null, keyboardResizeBy = null, storage = defaultStorage, style: styleFromProps, tagName: Type = "div", ...rest }) {
1034
+ const groupId = useUniqueId(idFromProps);
1035
+ const panelGroupElementRef = useRef(null);
1036
+ const [dragState, setDragState] = useState(null);
1037
+ const [layout, setLayout] = useState([]);
1038
+ const forceUpdate = useForceUpdate();
1039
+ const panelIdToLastNotifiedSizeMapRef = useRef({});
1040
+ const panelSizeBeforeCollapseRef = useRef(/* @__PURE__ */ new Map());
1041
+ const prevDeltaRef = useRef(0);
1042
+ const committedValuesRef = useRef({
1043
+ autoSaveId,
1044
+ direction,
1045
+ dragState,
1046
+ id: groupId,
1047
+ keyboardResizeBy,
1048
+ onLayout,
1049
+ storage
1050
+ });
1051
+ const eagerValuesRef = useRef({
1052
+ layout,
756
1053
  panelDataArray: [],
757
- panelDataArrayChanged: !1
1054
+ panelDataArrayChanged: false
758
1055
  });
759
- u({
760
- didLogIdAndOrderWarning: !1,
761
- didLogPanelConstraintsWarning: !1,
1056
+ useRef({
1057
+ didLogIdAndOrderWarning: false,
1058
+ didLogPanelConstraintsWarning: false,
762
1059
  prevPanelIds: []
763
- }), s(c, () => ({
764
- getId: () => N.current.id,
1060
+ });
1061
+ useImperativeHandle(forwardedRef, () => ({
1062
+ getId: () => committedValuesRef.current.id,
765
1063
  getLayout: () => {
766
- let { layout: e } = P.current;
767
- return e;
1064
+ const { layout } = eagerValuesRef.current;
1065
+ return layout;
768
1066
  },
769
- setLayout: (e) => {
770
- let { onLayout: t } = N.current, { layout: n, panelDataArray: r } = P.current, i = Ue({
771
- layout: e,
772
- panelConstraints: r.map((e) => e.constraints)
1067
+ setLayout: (unsafeLayout) => {
1068
+ const { onLayout } = committedValuesRef.current;
1069
+ const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
1070
+ const safeLayout = validatePanelGroupLayout({
1071
+ layout: unsafeLayout,
1072
+ panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
773
1073
  });
774
- ke(n, i) || (E(i), P.current.layout = i, t && t(i), Z(r, i, A.current));
1074
+ if (!areEqual(prevLayout, safeLayout)) {
1075
+ setLayout(safeLayout);
1076
+ eagerValuesRef.current.layout = safeLayout;
1077
+ if (onLayout) onLayout(safeLayout);
1078
+ callPanelCallbacks(panelDataArray, safeLayout, panelIdToLastNotifiedSizeMapRef.current);
1079
+ }
775
1080
  }
776
- }), []), h(() => {
777
- N.current.autoSaveId = e, N.current.direction = a, N.current.dragState = C, N.current.id = x, N.current.onLayout = g, N.current.storage = v;
778
- }), Oe({
779
- committedValuesRef: N,
780
- eagerValuesRef: P,
781
- groupId: x,
782
- layout: T,
783
- panelDataArray: P.current.panelDataArray,
784
- setLayout: E,
785
- panelGroupElement: S.current
786
- }), o(() => {
787
- let { panelDataArray: t } = P.current;
788
- if (e) {
789
- if (T.length === 0 || T.length !== t.length) return;
790
- let n = Ke[e];
791
- n ?? (n = Ie(He, We), Ke[e] = n);
792
- let r = [...t], i = new Map(j.current);
793
- n(e, r, i, T, v);
1081
+ }), []);
1082
+ useIsomorphicLayoutEffect(() => {
1083
+ committedValuesRef.current.autoSaveId = autoSaveId;
1084
+ committedValuesRef.current.direction = direction;
1085
+ committedValuesRef.current.dragState = dragState;
1086
+ committedValuesRef.current.id = groupId;
1087
+ committedValuesRef.current.onLayout = onLayout;
1088
+ committedValuesRef.current.storage = storage;
1089
+ });
1090
+ useWindowSplitterPanelGroupBehavior({
1091
+ committedValuesRef,
1092
+ eagerValuesRef,
1093
+ groupId,
1094
+ layout,
1095
+ panelDataArray: eagerValuesRef.current.panelDataArray,
1096
+ setLayout,
1097
+ panelGroupElement: panelGroupElementRef.current
1098
+ });
1099
+ useEffect(() => {
1100
+ const { panelDataArray } = eagerValuesRef.current;
1101
+ if (autoSaveId) {
1102
+ if (layout.length === 0 || layout.length !== panelDataArray.length) return;
1103
+ let debouncedSave = debounceMap[autoSaveId];
1104
+ if (debouncedSave == null) {
1105
+ debouncedSave = debounce(savePanelGroupState, LOCAL_STORAGE_DEBOUNCE_INTERVAL);
1106
+ debounceMap[autoSaveId] = debouncedSave;
1107
+ }
1108
+ const clonedPanelDataArray = [...panelDataArray];
1109
+ const clonedPanelSizesBeforeCollapse = new Map(panelSizeBeforeCollapseRef.current);
1110
+ debouncedSave(autoSaveId, clonedPanelDataArray, clonedPanelSizesBeforeCollapse, layout, storage);
794
1111
  }
795
1112
  }, [
796
- e,
797
- T,
798
- v
799
- ]), o(() => {});
800
- let F = i((e) => {
801
- let { onLayout: t } = N.current, { layout: n, panelDataArray: r } = P.current;
802
- if (e.constraints.collapsible) {
803
- let i = r.map((e) => e.constraints), { collapsedSize: a = 0, panelSize: o, pivotIndices: s } = $(r, e, n);
804
- if (G(o != null, `Panel size not found for panel "${e.id}"`), !q(o, a)) {
805
- j.current.set(e.id, o);
806
- let c = xe({
807
- delta: Q(r, e) === r.length - 1 ? o - a : a - o,
808
- initialLayout: n,
809
- panelConstraints: i,
810
- pivotIndices: s,
811
- prevLayout: n,
1113
+ autoSaveId,
1114
+ layout,
1115
+ storage
1116
+ ]);
1117
+ useEffect(() => {});
1118
+ const collapsePanel = useCallback((panelData) => {
1119
+ const { onLayout } = committedValuesRef.current;
1120
+ const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
1121
+ if (panelData.constraints.collapsible) {
1122
+ const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
1123
+ const { collapsedSize = 0, panelSize, pivotIndices } = panelDataHelper(panelDataArray, panelData, prevLayout);
1124
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
1125
+ if (!fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
1126
+ panelSizeBeforeCollapseRef.current.set(panelData.id, panelSize);
1127
+ const nextLayout = adjustLayoutByDelta({
1128
+ delta: findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1 ? panelSize - collapsedSize : collapsedSize - panelSize,
1129
+ initialLayout: prevLayout,
1130
+ panelConstraints: panelConstraintsArray,
1131
+ pivotIndices,
1132
+ prevLayout,
812
1133
  trigger: "imperative-api"
813
1134
  });
814
- Pe(n, c) || (E(c), P.current.layout = c, t && t(c), Z(r, c, A.current));
1135
+ if (!compareLayouts(prevLayout, nextLayout)) {
1136
+ setLayout(nextLayout);
1137
+ eagerValuesRef.current.layout = nextLayout;
1138
+ if (onLayout) onLayout(nextLayout);
1139
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
1140
+ }
815
1141
  }
816
1142
  }
817
- }, []), I = i((e, t) => {
818
- let { onLayout: n } = N.current, { layout: r, panelDataArray: i } = P.current;
819
- if (e.constraints.collapsible) {
820
- let a = i.map((e) => e.constraints), { collapsedSize: o = 0, panelSize: s = 0, minSize: c = 0, pivotIndices: l } = $(i, e, r), u = t ?? c;
821
- if (q(s, o)) {
822
- let t = j.current.get(e.id), o = t != null && t >= u ? t : u, c = xe({
823
- delta: Q(i, e) === i.length - 1 ? s - o : o - s,
824
- initialLayout: r,
825
- panelConstraints: a,
826
- pivotIndices: l,
827
- prevLayout: r,
1143
+ }, []);
1144
+ const expandPanel = useCallback((panelData, minSizeOverride) => {
1145
+ const { onLayout } = committedValuesRef.current;
1146
+ const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
1147
+ if (panelData.constraints.collapsible) {
1148
+ const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
1149
+ const { collapsedSize = 0, panelSize = 0, minSize: minSizeFromProps = 0, pivotIndices } = panelDataHelper(panelDataArray, panelData, prevLayout);
1150
+ const minSize = minSizeOverride !== null && minSizeOverride !== void 0 ? minSizeOverride : minSizeFromProps;
1151
+ if (fuzzyNumbersEqual$1(panelSize, collapsedSize)) {
1152
+ const prevPanelSize = panelSizeBeforeCollapseRef.current.get(panelData.id);
1153
+ const baseSize = prevPanelSize != null && prevPanelSize >= minSize ? prevPanelSize : minSize;
1154
+ const nextLayout = adjustLayoutByDelta({
1155
+ delta: findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1 ? panelSize - baseSize : baseSize - panelSize,
1156
+ initialLayout: prevLayout,
1157
+ panelConstraints: panelConstraintsArray,
1158
+ pivotIndices,
1159
+ prevLayout,
828
1160
  trigger: "imperative-api"
829
1161
  });
830
- Pe(r, c) || (E(c), P.current.layout = c, n && n(c), Z(i, c, A.current));
1162
+ if (!compareLayouts(prevLayout, nextLayout)) {
1163
+ setLayout(nextLayout);
1164
+ eagerValuesRef.current.layout = nextLayout;
1165
+ if (onLayout) onLayout(nextLayout);
1166
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
1167
+ }
831
1168
  }
832
1169
  }
833
- }, []), L = i((e) => {
834
- let { layout: t, panelDataArray: n } = P.current, { panelSize: r } = $(n, e, t);
835
- return G(r != null, `Panel size not found for panel "${e.id}"`), r;
836
- }, []), R = i((e, t) => {
837
- let { panelDataArray: n } = P.current, r = Q(n, e);
838
- return Fe({
839
- defaultSize: t,
840
- dragState: C,
841
- layout: T,
842
- panelData: n,
843
- panelIndex: r
1170
+ }, []);
1171
+ const getPanelSize = useCallback((panelData) => {
1172
+ const { layout, panelDataArray } = eagerValuesRef.current;
1173
+ const { panelSize } = panelDataHelper(panelDataArray, panelData, layout);
1174
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
1175
+ return panelSize;
1176
+ }, []);
1177
+ const getPanelStyle = useCallback((panelData, defaultSize) => {
1178
+ const { panelDataArray } = eagerValuesRef.current;
1179
+ const panelIndex = findPanelDataIndex(panelDataArray, panelData);
1180
+ return computePanelFlexBoxStyle({
1181
+ defaultSize,
1182
+ dragState,
1183
+ layout,
1184
+ panelData: panelDataArray,
1185
+ panelIndex
844
1186
  });
845
- }, [C, T]), z = i((e) => {
846
- let { layout: t, panelDataArray: n } = P.current, { collapsedSize: r = 0, collapsible: i, panelSize: a } = $(n, e, t);
847
- return G(a != null, `Panel size not found for panel "${e.id}"`), i === !0 && q(a, r);
848
- }, []), se = i((e) => {
849
- let { layout: t, panelDataArray: n } = P.current, { collapsedSize: r = 0, collapsible: i, panelSize: a } = $(n, e, t);
850
- return G(a != null, `Panel size not found for panel "${e.id}"`), !i || K(a, r) > 0;
851
- }, []), B = i((e) => {
852
- let { panelDataArray: t } = P.current;
853
- t.push(e), t.sort((e, t) => {
854
- let n = e.order, r = t.order;
855
- return n == null && r == null ? 0 : n == null ? -1 : r == null ? 1 : n - r;
856
- }), P.current.panelDataArrayChanged = !0, k();
857
- }, [k]);
858
- h(() => {
859
- if (P.current.panelDataArrayChanged) {
860
- P.current.panelDataArrayChanged = !1;
861
- let { autoSaveId: e, onLayout: t, storage: n } = N.current, { layout: r, panelDataArray: i } = P.current, a = null;
862
- if (e) {
863
- let t = Ve(e, i, n);
864
- t && (j.current = new Map(Object.entries(t.expandToSizes)), a = t.layout);
1187
+ }, [dragState, layout]);
1188
+ const isPanelCollapsed = useCallback((panelData) => {
1189
+ const { layout, panelDataArray } = eagerValuesRef.current;
1190
+ const { collapsedSize = 0, collapsible, panelSize } = panelDataHelper(panelDataArray, panelData, layout);
1191
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
1192
+ return collapsible === true && fuzzyNumbersEqual$1(panelSize, collapsedSize);
1193
+ }, []);
1194
+ const isPanelExpanded = useCallback((panelData) => {
1195
+ const { layout, panelDataArray } = eagerValuesRef.current;
1196
+ const { collapsedSize = 0, collapsible, panelSize } = panelDataHelper(panelDataArray, panelData, layout);
1197
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
1198
+ return !collapsible || fuzzyCompareNumbers(panelSize, collapsedSize) > 0;
1199
+ }, []);
1200
+ const registerPanel = useCallback((panelData) => {
1201
+ const { panelDataArray } = eagerValuesRef.current;
1202
+ panelDataArray.push(panelData);
1203
+ panelDataArray.sort((panelA, panelB) => {
1204
+ const orderA = panelA.order;
1205
+ const orderB = panelB.order;
1206
+ if (orderA == null && orderB == null) return 0;
1207
+ else if (orderA == null) return -1;
1208
+ else if (orderB == null) return 1;
1209
+ else return orderA - orderB;
1210
+ });
1211
+ eagerValuesRef.current.panelDataArrayChanged = true;
1212
+ forceUpdate();
1213
+ }, [forceUpdate]);
1214
+ useIsomorphicLayoutEffect(() => {
1215
+ if (eagerValuesRef.current.panelDataArrayChanged) {
1216
+ eagerValuesRef.current.panelDataArrayChanged = false;
1217
+ const { autoSaveId, onLayout, storage } = committedValuesRef.current;
1218
+ const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
1219
+ let unsafeLayout = null;
1220
+ if (autoSaveId) {
1221
+ const state = loadPanelGroupState(autoSaveId, panelDataArray, storage);
1222
+ if (state) {
1223
+ panelSizeBeforeCollapseRef.current = new Map(Object.entries(state.expandToSizes));
1224
+ unsafeLayout = state.layout;
1225
+ }
865
1226
  }
866
- a ??= Ne({ panelDataArray: i });
867
- let o = Ue({
868
- layout: a,
869
- panelConstraints: i.map((e) => e.constraints)
1227
+ if (unsafeLayout == null) unsafeLayout = calculateUnsafeDefaultLayout({ panelDataArray });
1228
+ const nextLayout = validatePanelGroupLayout({
1229
+ layout: unsafeLayout,
1230
+ panelConstraints: panelDataArray.map((panelData) => panelData.constraints)
870
1231
  });
871
- ke(r, o) || (E(o), P.current.layout = o, t && t(o), Z(i, o, A.current));
1232
+ if (!areEqual(prevLayout, nextLayout)) {
1233
+ setLayout(nextLayout);
1234
+ eagerValuesRef.current.layout = nextLayout;
1235
+ if (onLayout) onLayout(nextLayout);
1236
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
1237
+ }
872
1238
  }
873
- }), h(() => {
874
- let e = P.current;
1239
+ });
1240
+ useIsomorphicLayoutEffect(() => {
1241
+ const eagerValues = eagerValuesRef.current;
875
1242
  return () => {
876
- e.layout = [];
1243
+ eagerValues.layout = [];
877
1244
  };
878
1245
  }, []);
879
- let V = i((e) => {
880
- let t = !1, n = S.current;
881
- return n && window.getComputedStyle(n, null).getPropertyValue("direction") === "rtl" && (t = !0), function(n) {
882
- n.preventDefault();
883
- let r = S.current;
884
- if (!r) return () => null;
885
- let { direction: i, dragState: a, id: o, keyboardResizeBy: s, onLayout: c } = N.current, { layout: l, panelDataArray: u } = P.current, { initialLayout: d } = a ?? {}, f = we(o, e, r), p = Me(n, e, i, a, s, r), m = i === "horizontal";
886
- m && t && (p = -p);
887
- let h = u.map((e) => e.constraints), g = xe({
888
- delta: p,
889
- initialLayout: d ?? l,
890
- panelConstraints: h,
891
- pivotIndices: f,
892
- prevLayout: l,
893
- trigger: D(n) ? "keyboard" : "mouse-or-touch"
894
- }), _ = !Pe(l, g);
895
- (O(n) || ne(n)) && M.current != p && (M.current = p, !_ && p !== 0 ? m ? me(e, p < 0 ? re : ie) : me(e, p < 0 ? ae : oe) : me(e, 0)), _ && (E(g), P.current.layout = g, c && c(g), Z(u, g, A.current));
1246
+ const registerResizeHandle = useCallback((dragHandleId) => {
1247
+ let isRTL = false;
1248
+ const panelGroupElement = panelGroupElementRef.current;
1249
+ if (panelGroupElement) {
1250
+ if (window.getComputedStyle(panelGroupElement, null).getPropertyValue("direction") === "rtl") isRTL = true;
1251
+ }
1252
+ return function resizeHandler(event) {
1253
+ event.preventDefault();
1254
+ const panelGroupElement = panelGroupElementRef.current;
1255
+ if (!panelGroupElement) return () => null;
1256
+ const { direction, dragState, id: groupId, keyboardResizeBy, onLayout } = committedValuesRef.current;
1257
+ const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
1258
+ const { initialLayout } = dragState !== null && dragState !== void 0 ? dragState : {};
1259
+ const pivotIndices = determinePivotIndices(groupId, dragHandleId, panelGroupElement);
1260
+ let delta = calculateDeltaPercentage(event, dragHandleId, direction, dragState, keyboardResizeBy, panelGroupElement);
1261
+ const isHorizontal = direction === "horizontal";
1262
+ if (isHorizontal && isRTL) delta = -delta;
1263
+ const panelConstraints = panelDataArray.map((panelData) => panelData.constraints);
1264
+ const nextLayout = adjustLayoutByDelta({
1265
+ delta,
1266
+ initialLayout: initialLayout !== null && initialLayout !== void 0 ? initialLayout : prevLayout,
1267
+ panelConstraints,
1268
+ pivotIndices,
1269
+ prevLayout,
1270
+ trigger: isKeyDown(event) ? "keyboard" : "mouse-or-touch"
1271
+ });
1272
+ const layoutChanged = !compareLayouts(prevLayout, nextLayout);
1273
+ if (isPointerEvent(event) || isMouseEvent(event)) {
1274
+ if (prevDeltaRef.current != delta) {
1275
+ prevDeltaRef.current = delta;
1276
+ if (!layoutChanged && delta !== 0) {
1277
+ if (isHorizontal) reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_HORIZONTAL_MIN : EXCEEDED_HORIZONTAL_MAX);
1278
+ else reportConstraintsViolation(dragHandleId, delta < 0 ? EXCEEDED_VERTICAL_MIN : EXCEEDED_VERTICAL_MAX);
1279
+ } else reportConstraintsViolation(dragHandleId, 0);
1280
+ }
1281
+ }
1282
+ if (layoutChanged) {
1283
+ setLayout(nextLayout);
1284
+ eagerValuesRef.current.layout = nextLayout;
1285
+ if (onLayout) onLayout(nextLayout);
1286
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
1287
+ }
896
1288
  };
897
- }, []), H = i((e, t) => {
898
- let { onLayout: n } = N.current, { layout: r, panelDataArray: i } = P.current, a = i.map((e) => e.constraints), { panelSize: o, pivotIndices: s } = $(i, e, r);
899
- G(o != null, `Panel size not found for panel "${e.id}"`);
900
- let c = xe({
901
- delta: Q(i, e) === i.length - 1 ? o - t : t - o,
902
- initialLayout: r,
903
- panelConstraints: a,
904
- pivotIndices: s,
905
- prevLayout: r,
1289
+ }, []);
1290
+ const resizePanel = useCallback((panelData, unsafePanelSize) => {
1291
+ const { onLayout } = committedValuesRef.current;
1292
+ const { layout: prevLayout, panelDataArray } = eagerValuesRef.current;
1293
+ const panelConstraintsArray = panelDataArray.map((panelData) => panelData.constraints);
1294
+ const { panelSize, pivotIndices } = panelDataHelper(panelDataArray, panelData, prevLayout);
1295
+ assert(panelSize != null, `Panel size not found for panel "${panelData.id}"`);
1296
+ const nextLayout = adjustLayoutByDelta({
1297
+ delta: findPanelDataIndex(panelDataArray, panelData) === panelDataArray.length - 1 ? panelSize - unsafePanelSize : unsafePanelSize - panelSize,
1298
+ initialLayout: prevLayout,
1299
+ panelConstraints: panelConstraintsArray,
1300
+ pivotIndices,
1301
+ prevLayout,
906
1302
  trigger: "imperative-api"
907
1303
  });
908
- Pe(r, c) || (E(c), P.current.layout = c, n && n(c), Z(i, c, A.current));
909
- }, []), U = i((e, t) => {
910
- let { layout: n, panelDataArray: r } = P.current, { collapsedSize: i = 0, collapsible: a } = t, { collapsedSize: o = 0, collapsible: s, maxSize: c = 100, minSize: l = 0 } = e.constraints, { panelSize: u } = $(r, e, n);
911
- u != null && (a && s && q(u, i) ? q(i, o) || H(e, o) : u < l ? H(e, l) : u > c && H(e, c));
912
- }, [H]), W = i((e, t) => {
913
- let { direction: n } = N.current, { layout: r } = P.current;
914
- if (!S.current) return;
915
- let i = Ee(e, S.current);
916
- G(i, `Drag handle element not found for id "${e}"`);
917
- let a = Ae(n, t);
918
- w({
919
- dragHandleId: e,
920
- dragHandleRect: i.getBoundingClientRect(),
921
- initialCursorPosition: a,
922
- initialLayout: r
1304
+ if (!compareLayouts(prevLayout, nextLayout)) {
1305
+ setLayout(nextLayout);
1306
+ eagerValuesRef.current.layout = nextLayout;
1307
+ if (onLayout) onLayout(nextLayout);
1308
+ callPanelCallbacks(panelDataArray, nextLayout, panelIdToLastNotifiedSizeMapRef.current);
1309
+ }
1310
+ }, []);
1311
+ const reevaluatePanelConstraints = useCallback((panelData, prevConstraints) => {
1312
+ const { layout, panelDataArray } = eagerValuesRef.current;
1313
+ const { collapsedSize: prevCollapsedSize = 0, collapsible: prevCollapsible } = prevConstraints;
1314
+ const { collapsedSize: nextCollapsedSize = 0, collapsible: nextCollapsible, maxSize: nextMaxSize = 100, minSize: nextMinSize = 0 } = panelData.constraints;
1315
+ const { panelSize: prevPanelSize } = panelDataHelper(panelDataArray, panelData, layout);
1316
+ if (prevPanelSize == null) return;
1317
+ if (prevCollapsible && nextCollapsible && fuzzyNumbersEqual$1(prevPanelSize, prevCollapsedSize)) {
1318
+ if (!fuzzyNumbersEqual$1(prevCollapsedSize, nextCollapsedSize)) resizePanel(panelData, nextCollapsedSize);
1319
+ } else if (prevPanelSize < nextMinSize) resizePanel(panelData, nextMinSize);
1320
+ else if (prevPanelSize > nextMaxSize) resizePanel(panelData, nextMaxSize);
1321
+ }, [resizePanel]);
1322
+ const startDragging = useCallback((dragHandleId, event) => {
1323
+ const { direction } = committedValuesRef.current;
1324
+ const { layout } = eagerValuesRef.current;
1325
+ if (!panelGroupElementRef.current) return;
1326
+ const handleElement = getResizeHandleElement(dragHandleId, panelGroupElementRef.current);
1327
+ assert(handleElement, `Drag handle element not found for id "${dragHandleId}"`);
1328
+ const initialCursorPosition = getResizeEventCursorPosition(direction, event);
1329
+ setDragState({
1330
+ dragHandleId,
1331
+ dragHandleRect: handleElement.getBoundingClientRect(),
1332
+ initialCursorPosition,
1333
+ initialLayout: layout
923
1334
  });
924
- }, []), ce = i(() => {
925
- w(null);
926
- }, []), le = i((e) => {
927
- let { panelDataArray: t } = P.current, n = Q(t, e);
928
- n >= 0 && (t.splice(n, 1), delete A.current[e.id], P.current.panelDataArrayChanged = !0, k());
929
- }, [k]), ue = l(() => ({
930
- collapsePanel: F,
931
- direction: a,
932
- dragState: C,
933
- expandPanel: I,
934
- getPanelSize: L,
935
- getPanelStyle: R,
936
- groupId: x,
937
- isPanelCollapsed: z,
938
- isPanelExpanded: se,
939
- reevaluatePanelConstraints: U,
940
- registerPanel: B,
941
- registerResizeHandle: V,
942
- resizePanel: H,
943
- startDragging: W,
944
- stopDragging: ce,
945
- unregisterPanel: le,
946
- panelGroupElement: S.current
1335
+ }, []);
1336
+ const stopDragging = useCallback(() => {
1337
+ setDragState(null);
1338
+ }, []);
1339
+ const unregisterPanel = useCallback((panelData) => {
1340
+ const { panelDataArray } = eagerValuesRef.current;
1341
+ const index = findPanelDataIndex(panelDataArray, panelData);
1342
+ if (index >= 0) {
1343
+ panelDataArray.splice(index, 1);
1344
+ delete panelIdToLastNotifiedSizeMapRef.current[panelData.id];
1345
+ eagerValuesRef.current.panelDataArrayChanged = true;
1346
+ forceUpdate();
1347
+ }
1348
+ }, [forceUpdate]);
1349
+ const context = useMemo(() => ({
1350
+ collapsePanel,
1351
+ direction,
1352
+ dragState,
1353
+ expandPanel,
1354
+ getPanelSize,
1355
+ getPanelStyle,
1356
+ groupId,
1357
+ isPanelCollapsed,
1358
+ isPanelExpanded,
1359
+ reevaluatePanelConstraints,
1360
+ registerPanel,
1361
+ registerResizeHandle,
1362
+ resizePanel,
1363
+ startDragging,
1364
+ stopDragging,
1365
+ unregisterPanel,
1366
+ panelGroupElement: panelGroupElementRef.current
947
1367
  }), [
948
- F,
949
- C,
950
- a,
951
- I,
952
- L,
953
- R,
954
- x,
955
- z,
956
- se,
957
- U,
958
- B,
959
- V,
960
- H,
961
- W,
962
- ce,
963
- le
964
- ]), de = {
1368
+ collapsePanel,
1369
+ dragState,
1370
+ direction,
1371
+ expandPanel,
1372
+ getPanelSize,
1373
+ getPanelStyle,
1374
+ groupId,
1375
+ isPanelCollapsed,
1376
+ isPanelExpanded,
1377
+ reevaluatePanelConstraints,
1378
+ registerPanel,
1379
+ registerResizeHandle,
1380
+ resizePanel,
1381
+ startDragging,
1382
+ stopDragging,
1383
+ unregisterPanel
1384
+ ]);
1385
+ const style = {
965
1386
  display: "flex",
966
- flexDirection: a === "horizontal" ? "row" : "column",
1387
+ flexDirection: direction === "horizontal" ? "row" : "column",
967
1388
  height: "100%",
968
1389
  overflow: "hidden",
969
1390
  width: "100%"
970
1391
  };
971
- return n(f.Provider, { value: ue }, n(te, {
972
- ...b,
973
- children: t,
974
- className: r,
975
- id: m,
976
- ref: S,
1392
+ return createElement(PanelGroupContext.Provider, { value: context }, createElement(Type, {
1393
+ ...rest,
1394
+ children,
1395
+ className: classNameFromProps,
1396
+ id: idFromProps,
1397
+ ref: panelGroupElementRef,
977
1398
  style: {
978
- ...de,
979
- ...y
1399
+ ...style,
1400
+ ...styleFromProps
980
1401
  },
981
- [p.group]: "",
982
- [p.groupDirection]: a,
983
- [p.groupId]: x
1402
+ [DATA_ATTRIBUTES.group]: "",
1403
+ [DATA_ATTRIBUTES.groupDirection]: direction,
1404
+ [DATA_ATTRIBUTES.groupId]: groupId
984
1405
  }));
985
1406
  }
986
- var Je = r((e, t) => n(qe, {
987
- ...e,
988
- forwardedRef: t
1407
+ var PanelGroup = forwardRef((props, ref) => createElement(PanelGroupWithForwardedRef, {
1408
+ ...props,
1409
+ forwardedRef: ref
989
1410
  }));
990
- qe.displayName = "PanelGroup", Je.displayName = "forwardRef(PanelGroup)";
991
- function Q(e, t) {
992
- return e.findIndex((e) => e === t || e.id === t.id);
993
- }
994
- function $(e, t, n) {
995
- let r = Q(e, t), i = r === e.length - 1 ? [r - 1, r] : [r, r + 1], a = n[r];
1411
+ PanelGroupWithForwardedRef.displayName = "PanelGroup";
1412
+ PanelGroup.displayName = "forwardRef(PanelGroup)";
1413
+ function findPanelDataIndex(panelDataArray, panelData) {
1414
+ return panelDataArray.findIndex((prevPanelData) => prevPanelData === panelData || prevPanelData.id === panelData.id);
1415
+ }
1416
+ function panelDataHelper(panelDataArray, panelData, layout) {
1417
+ const panelIndex = findPanelDataIndex(panelDataArray, panelData);
1418
+ const pivotIndices = panelIndex === panelDataArray.length - 1 ? [panelIndex - 1, panelIndex] : [panelIndex, panelIndex + 1];
1419
+ const panelSize = layout[panelIndex];
996
1420
  return {
997
- ...t.constraints,
998
- panelSize: a,
999
- pivotIndices: i
1421
+ ...panelData.constraints,
1422
+ panelSize,
1423
+ pivotIndices
1000
1424
  };
1001
1425
  }
1002
- function Ye({ disabled: e, handleId: t, resizeHandler: n, panelGroupElement: r }) {
1003
- o(() => {
1004
- if (e || n == null || r == null) return;
1005
- let i = Ee(t, r);
1006
- if (i == null) return;
1007
- let a = (e) => {
1008
- if (!e.defaultPrevented) switch (e.key) {
1426
+ function useWindowSplitterResizeHandlerBehavior({ disabled, handleId, resizeHandler, panelGroupElement }) {
1427
+ useEffect(() => {
1428
+ if (disabled || resizeHandler == null || panelGroupElement == null) return;
1429
+ const handleElement = getResizeHandleElement(handleId, panelGroupElement);
1430
+ if (handleElement == null) return;
1431
+ const onKeyDown = (event) => {
1432
+ if (event.defaultPrevented) return;
1433
+ switch (event.key) {
1009
1434
  case "ArrowDown":
1010
1435
  case "ArrowLeft":
1011
1436
  case "ArrowRight":
1012
1437
  case "ArrowUp":
1013
1438
  case "End":
1014
1439
  case "Home":
1015
- e.preventDefault(), n(e);
1440
+ event.preventDefault();
1441
+ resizeHandler(event);
1016
1442
  break;
1017
1443
  case "F6": {
1018
- e.preventDefault();
1019
- let n = i.getAttribute(p.groupId);
1020
- G(n, `No group element found for id "${n}"`);
1021
- let a = X(n, r), o = Ce(n, t, r);
1022
- G(o !== null, `No resize element found for id "${t}"`), a[e.shiftKey ? o > 0 ? o - 1 : a.length - 1 : o + 1 < a.length ? o + 1 : 0].focus();
1444
+ event.preventDefault();
1445
+ const groupId = handleElement.getAttribute(DATA_ATTRIBUTES.groupId);
1446
+ assert(groupId, `No group element found for id "${groupId}"`);
1447
+ const handles = getResizeHandleElementsForGroup(groupId, panelGroupElement);
1448
+ const index = getResizeHandleElementIndex(groupId, handleId, panelGroupElement);
1449
+ assert(index !== null, `No resize element found for id "${handleId}"`);
1450
+ handles[event.shiftKey ? index > 0 ? index - 1 : handles.length - 1 : index + 1 < handles.length ? index + 1 : 0].focus();
1023
1451
  break;
1024
1452
  }
1025
1453
  }
1026
1454
  };
1027
- return i.addEventListener("keydown", a), () => {
1028
- i.removeEventListener("keydown", a);
1455
+ handleElement.addEventListener("keydown", onKeyDown);
1456
+ return () => {
1457
+ handleElement.removeEventListener("keydown", onKeyDown);
1029
1458
  };
1030
1459
  }, [
1031
- r,
1032
- e,
1033
- t,
1034
- n
1460
+ panelGroupElement,
1461
+ disabled,
1462
+ handleId,
1463
+ resizeHandler
1035
1464
  ]);
1036
1465
  }
1037
- function Xe({ children: e = null, className: t = "", disabled: r = !1, hitAreaMargins: i, id: s, onBlur: c, onClick: l, onDragging: m, onFocus: g, onPointerDown: _, onPointerUp: v, style: y = {}, tabIndex: te = 0, tagName: b = "div", ...x }) {
1038
- let S = u(null), C = u({
1039
- onClick: l,
1040
- onDragging: m,
1041
- onPointerDown: _,
1042
- onPointerUp: v
1466
+ function PanelResizeHandle({ children = null, className: classNameFromProps = "", disabled = false, hitAreaMargins, id: idFromProps, onBlur, onClick, onDragging, onFocus, onPointerDown, onPointerUp, style: styleFromProps = {}, tabIndex = 0, tagName: Type = "div", ...rest }) {
1467
+ var _hitAreaMargins$coars, _hitAreaMargins$fine;
1468
+ const elementRef = useRef(null);
1469
+ const callbacksRef = useRef({
1470
+ onClick,
1471
+ onDragging,
1472
+ onPointerDown,
1473
+ onPointerUp
1043
1474
  });
1044
- o(() => {
1045
- C.current.onClick = l, C.current.onDragging = m, C.current.onPointerDown = _, C.current.onPointerUp = v;
1475
+ useEffect(() => {
1476
+ callbacksRef.current.onClick = onClick;
1477
+ callbacksRef.current.onDragging = onDragging;
1478
+ callbacksRef.current.onPointerDown = onPointerDown;
1479
+ callbacksRef.current.onPointerUp = onPointerUp;
1046
1480
  });
1047
- let w = a(f);
1048
- if (w === null) throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");
1049
- let { direction: T, groupId: E, registerResizeHandle: D, startDragging: O, stopDragging: ne, panelGroupElement: k } = w, A = ee(s), [j, M] = d("inactive"), [N, P] = d(!1), [F, I] = d(null), L = u({ state: j });
1050
- h(() => {
1051
- L.current.state = j;
1052
- }), o(() => {
1053
- if (r) I(null);
1481
+ const panelGroupContext = useContext(PanelGroupContext);
1482
+ if (panelGroupContext === null) throw Error(`PanelResizeHandle components must be rendered within a PanelGroup container`);
1483
+ const { direction, groupId, registerResizeHandle: registerResizeHandleWithParentGroup, startDragging, stopDragging, panelGroupElement } = panelGroupContext;
1484
+ const resizeHandleId = useUniqueId(idFromProps);
1485
+ const [state, setState] = useState("inactive");
1486
+ const [isFocused, setIsFocused] = useState(false);
1487
+ const [resizeHandler, setResizeHandler] = useState(null);
1488
+ const committedValuesRef = useRef({ state });
1489
+ useIsomorphicLayoutEffect(() => {
1490
+ committedValuesRef.current.state = state;
1491
+ });
1492
+ useEffect(() => {
1493
+ if (disabled) setResizeHandler(null);
1054
1494
  else {
1055
- let e = D(A);
1056
- I(() => e);
1495
+ const resizeHandler = registerResizeHandleWithParentGroup(resizeHandleId);
1496
+ setResizeHandler(() => resizeHandler);
1057
1497
  }
1058
1498
  }, [
1059
- r,
1060
- A,
1061
- D
1499
+ disabled,
1500
+ resizeHandleId,
1501
+ registerResizeHandleWithParentGroup
1062
1502
  ]);
1063
- let R = i?.coarse ?? 15, z = i?.fine ?? 5;
1064
- o(() => {
1065
- if (r || F == null) return;
1066
- let e = S.current;
1067
- G(e, "Element ref not attached");
1068
- let t = !1;
1069
- return ce(A, e, T, {
1070
- coarse: R,
1071
- fine: z
1072
- }, (e, n, r) => {
1073
- if (!n) M("inactive");
1074
- else switch (e) {
1503
+ const coarseHitAreaMargins = (_hitAreaMargins$coars = hitAreaMargins === null || hitAreaMargins === void 0 ? void 0 : hitAreaMargins.coarse) !== null && _hitAreaMargins$coars !== void 0 ? _hitAreaMargins$coars : 15;
1504
+ const fineHitAreaMargins = (_hitAreaMargins$fine = hitAreaMargins === null || hitAreaMargins === void 0 ? void 0 : hitAreaMargins.fine) !== null && _hitAreaMargins$fine !== void 0 ? _hitAreaMargins$fine : 5;
1505
+ useEffect(() => {
1506
+ if (disabled || resizeHandler == null) return;
1507
+ const element = elementRef.current;
1508
+ assert(element, "Element ref not attached");
1509
+ let didMove = false;
1510
+ const setResizeHandlerState = (action, isActive, event) => {
1511
+ if (!isActive) {
1512
+ setState("inactive");
1513
+ return;
1514
+ }
1515
+ switch (action) {
1075
1516
  case "down": {
1076
- M("drag"), t = !1, G(r, "Expected event to be defined for \"down\" action"), O(A, r);
1077
- let { onDragging: e, onPointerDown: n } = C.current;
1078
- e?.(!0), n?.();
1517
+ setState("drag");
1518
+ didMove = false;
1519
+ assert(event, "Expected event to be defined for \"down\" action");
1520
+ startDragging(resizeHandleId, event);
1521
+ const { onDragging, onPointerDown } = callbacksRef.current;
1522
+ onDragging === null || onDragging === void 0 || onDragging(true);
1523
+ onPointerDown === null || onPointerDown === void 0 || onPointerDown();
1079
1524
  break;
1080
1525
  }
1081
1526
  case "move": {
1082
- let { state: e } = L.current;
1083
- t = !0, e !== "drag" && M("hover"), G(r, "Expected event to be defined for \"move\" action"), F(r);
1527
+ const { state } = committedValuesRef.current;
1528
+ didMove = true;
1529
+ if (state !== "drag") setState("hover");
1530
+ assert(event, "Expected event to be defined for \"move\" action");
1531
+ resizeHandler(event);
1084
1532
  break;
1085
1533
  }
1086
1534
  case "up": {
1087
- M("hover"), ne();
1088
- let { onClick: e, onDragging: n, onPointerUp: r } = C.current;
1089
- n?.(!1), r?.(), t || e?.();
1535
+ setState("hover");
1536
+ stopDragging();
1537
+ const { onClick, onDragging, onPointerUp } = callbacksRef.current;
1538
+ onDragging === null || onDragging === void 0 || onDragging(false);
1539
+ onPointerUp === null || onPointerUp === void 0 || onPointerUp();
1540
+ if (!didMove) onClick === null || onClick === void 0 || onClick();
1090
1541
  break;
1091
1542
  }
1092
1543
  }
1093
- });
1544
+ };
1545
+ return registerResizeHandle(resizeHandleId, element, direction, {
1546
+ coarse: coarseHitAreaMargins,
1547
+ fine: fineHitAreaMargins
1548
+ }, setResizeHandlerState);
1094
1549
  }, [
1095
- R,
1096
- T,
1097
- r,
1098
- z,
1099
- D,
1100
- A,
1101
- F,
1102
- O,
1103
- ne
1104
- ]), Ye({
1105
- disabled: r,
1106
- handleId: A,
1107
- resizeHandler: F,
1108
- panelGroupElement: k
1550
+ coarseHitAreaMargins,
1551
+ direction,
1552
+ disabled,
1553
+ fineHitAreaMargins,
1554
+ registerResizeHandleWithParentGroup,
1555
+ resizeHandleId,
1556
+ resizeHandler,
1557
+ startDragging,
1558
+ stopDragging
1559
+ ]);
1560
+ useWindowSplitterResizeHandlerBehavior({
1561
+ disabled,
1562
+ handleId: resizeHandleId,
1563
+ resizeHandler,
1564
+ panelGroupElement
1109
1565
  });
1110
- let re = {
1566
+ const style = {
1111
1567
  touchAction: "none",
1112
1568
  userSelect: "none"
1113
1569
  };
1114
- return n(b, {
1115
- ...x,
1116
- children: e,
1117
- className: t,
1118
- id: s,
1570
+ return createElement(Type, {
1571
+ ...rest,
1572
+ children,
1573
+ className: classNameFromProps,
1574
+ id: idFromProps,
1119
1575
  onBlur: () => {
1120
- P(!1), c?.();
1576
+ setIsFocused(false);
1577
+ onBlur === null || onBlur === void 0 || onBlur();
1121
1578
  },
1122
1579
  onFocus: () => {
1123
- P(!0), g?.();
1580
+ setIsFocused(true);
1581
+ onFocus === null || onFocus === void 0 || onFocus();
1124
1582
  },
1125
- ref: S,
1583
+ ref: elementRef,
1126
1584
  role: "separator",
1127
1585
  style: {
1128
- ...re,
1129
- ...y
1586
+ ...style,
1587
+ ...styleFromProps
1130
1588
  },
1131
- tabIndex: te,
1132
- [p.groupDirection]: T,
1133
- [p.groupId]: E,
1134
- [p.resizeHandle]: "",
1135
- [p.resizeHandleActive]: j === "drag" ? "pointer" : N ? "keyboard" : void 0,
1136
- [p.resizeHandleEnabled]: !r,
1137
- [p.resizeHandleId]: A,
1138
- [p.resizeHandleState]: j
1589
+ tabIndex,
1590
+ [DATA_ATTRIBUTES.groupDirection]: direction,
1591
+ [DATA_ATTRIBUTES.groupId]: groupId,
1592
+ [DATA_ATTRIBUTES.resizeHandle]: "",
1593
+ [DATA_ATTRIBUTES.resizeHandleActive]: state === "drag" ? "pointer" : isFocused ? "keyboard" : void 0,
1594
+ [DATA_ATTRIBUTES.resizeHandleEnabled]: !disabled,
1595
+ [DATA_ATTRIBUTES.resizeHandleId]: resizeHandleId,
1596
+ [DATA_ATTRIBUTES.resizeHandleState]: state
1139
1597
  });
1140
1598
  }
1141
- Xe.displayName = "PanelResizeHandle";
1142
- export { p as DATA_ATTRIBUTES, te as Panel, Je as PanelGroup, Xe as PanelResizeHandle, G as assert, Te as getPanelGroupElement, Ee as getResizeHandleElement, Ce as getResizeHandleElementIndex, X as getResizeHandleElementsForGroup, De as getResizeHandlePanelIds, j as intersects };
1599
+ PanelResizeHandle.displayName = "PanelResizeHandle";
1600
+ export { DATA_ATTRIBUTES, Panel, PanelGroup, PanelResizeHandle, assert, getPanelGroupElement, getResizeHandleElement, getResizeHandleElementIndex, getResizeHandleElementsForGroup, getResizeHandlePanelIds, intersects };