@gv-tech/ui-web 2.9.1 → 2.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/dist/accordion.cjs.js +1 -0
  2. package/dist/accordion.d.ts +18 -0
  3. package/dist/accordion.es.js +259 -0
  4. package/dist/alert-dialog.cjs.js +7 -0
  5. package/dist/alert-dialog.d.ts +43 -0
  6. package/dist/alert-dialog.es.js +171 -0
  7. package/dist/alert.cjs.js +1 -0
  8. package/dist/alert.d.ts +18 -0
  9. package/dist/alert.es.js +32 -0
  10. package/dist/aspect-ratio.cjs.js +1 -0
  11. package/dist/aspect-ratio.d.ts +10 -0
  12. package/dist/aspect-ratio.es.js +43 -0
  13. package/dist/avatar.cjs.js +1 -0
  14. package/dist/avatar.d.ts +15 -0
  15. package/dist/avatar.es.js +205 -0
  16. package/dist/badge.cjs.js +1 -0
  17. package/dist/badge.d.ts +16 -0
  18. package/dist/badge.es.js +26 -0
  19. package/dist/breadcrumb.cjs.js +1 -0
  20. package/dist/breadcrumb.d.ts +35 -0
  21. package/dist/breadcrumb.es.js +69 -0
  22. package/dist/button.cjs.js +1 -0
  23. package/dist/button.d.ts +17 -0
  24. package/dist/button.es.js +40 -0
  25. package/dist/calendar.cjs.js +1 -0
  26. package/dist/calendar.d.ts +29 -0
  27. package/dist/calendar.es.js +2976 -0
  28. package/dist/card.cjs.js +1 -0
  29. package/dist/card.d.ts +19 -0
  30. package/dist/card.es.js +33 -0
  31. package/dist/carousel.cjs.js +1 -0
  32. package/dist/carousel.d.ts +50 -0
  33. package/dist/carousel.es.js +1403 -0
  34. package/dist/chart.cjs.js +16 -0
  35. package/dist/chart.d.ts +60 -0
  36. package/dist/chart.es.js +4402 -0
  37. package/dist/checkbox.cjs.js +1 -0
  38. package/dist/checkbox.d.ts +10 -0
  39. package/dist/checkbox.es.js +258 -0
  40. package/dist/collapsible.cjs.js +1 -0
  41. package/dist/collapsible.d.ts +20 -0
  42. package/dist/collapsible.es.js +7 -0
  43. package/dist/command.cjs.js +1 -0
  44. package/dist/command.d.ts +115 -0
  45. package/dist/command.es.js +396 -0
  46. package/dist/context-menu.cjs.js +1 -0
  47. package/dist/context-menu.d.ts +80 -0
  48. package/dist/context-menu.es.js +328 -0
  49. package/dist/dialog.cjs.js +1 -0
  50. package/dist/dialog.d.ts +31 -0
  51. package/dist/dialog.es.js +66 -0
  52. package/dist/drawer.cjs.js +3 -0
  53. package/dist/drawer.d.ts +65 -0
  54. package/dist/drawer.es.js +1085 -0
  55. package/dist/dropdown-menu.cjs.js +1 -0
  56. package/dist/dropdown-menu.d.ts +80 -0
  57. package/dist/dropdown-menu.es.js +316 -0
  58. package/dist/form.cjs.js +1 -0
  59. package/dist/form.d.ts +53 -0
  60. package/dist/form.es.js +355 -0
  61. package/dist/hover-card.cjs.js +1 -0
  62. package/dist/hover-card.d.ts +19 -0
  63. package/dist/hover-card.es.js +188 -0
  64. package/dist/index-0ioNhtNM.mjs +10 -0
  65. package/dist/index-3j-XAIXT.mjs +55 -0
  66. package/dist/index-B2XtpfGY.js +1 -0
  67. package/dist/index-B39Lzq0v.js +1 -0
  68. package/dist/index-B7n6fy75.js +1 -0
  69. package/dist/index-B8dxbSWX.js +41 -0
  70. package/dist/index-BGIK9FQF.js +1 -0
  71. package/dist/index-BZPx6jYI.mjs +8 -0
  72. package/dist/index-BoNjHhm4.js +1 -0
  73. package/dist/index-BtZvtDmp.js +1 -0
  74. package/dist/index-Bv7qrYW6.mjs +180 -0
  75. package/dist/index-ByiPJW53.js +5 -0
  76. package/dist/index-C0dlIQIi.js +1 -0
  77. package/dist/index-C1qb0595.mjs +27 -0
  78. package/dist/index-C7HEunrh.mjs +15 -0
  79. package/dist/index-C8ni3LLa.js +1 -0
  80. package/dist/index-CCKe-Mpx.mjs +6 -0
  81. package/dist/index-CD6_IrA-.mjs +10 -0
  82. package/dist/index-CRyCZJLa.mjs +677 -0
  83. package/dist/index-CVx1AgNG.mjs +615 -0
  84. package/dist/index-Ce5TOFAK.js +1 -0
  85. package/dist/index-CeSLNJ60.mjs +32 -0
  86. package/dist/index-CefEQe_4.js +1 -0
  87. package/dist/index-Cj5hzyBi.js +1 -0
  88. package/dist/index-Cjj_rUPu.js +1 -0
  89. package/dist/index-Cl3G0jzM.js +1 -0
  90. package/dist/index-CsjrqSSN.js +1 -0
  91. package/dist/index-CwfE56Ep.mjs +1545 -0
  92. package/dist/index-CwyAfCwY.js +1 -0
  93. package/dist/index-CzY-WZXL.js +1 -0
  94. package/dist/index-D2HnlO3y.js +1 -0
  95. package/dist/index-DAWHN3cH.mjs +85 -0
  96. package/dist/index-DFdF7K7v.mjs +50 -0
  97. package/dist/index-DIsg7zU7.js +1 -0
  98. package/dist/index-DKN_vhyX.mjs +32 -0
  99. package/dist/index-DLcqcWxM.mjs +29 -0
  100. package/dist/index-DSxf1gN6.mjs +118 -0
  101. package/dist/index-DYxWvftI.js +1 -0
  102. package/dist/index-DaILh3TV.mjs +32 -0
  103. package/dist/index-Dfzl8TxY.mjs +136 -0
  104. package/dist/index-Dko2XdTk.js +1 -0
  105. package/dist/index-DlY82G31.mjs +245 -0
  106. package/dist/index-DnFcfnA9.mjs +13 -0
  107. package/dist/index-IZ2gq03c.mjs +68 -0
  108. package/dist/index-K9FzbxYw.mjs +93 -0
  109. package/dist/index-Le8p9oP4.mjs +60 -0
  110. package/dist/index-MQ0c3ZX_.js +1 -0
  111. package/dist/index-_XxjJPRD.js +1 -0
  112. package/dist/index-_wdrnYim.js +1 -0
  113. package/dist/index-jv3B4mTd.js +1 -0
  114. package/dist/index-kaM0u2Q1.js +1 -0
  115. package/dist/index-p6xVFRb4.mjs +52 -0
  116. package/dist/index-rKs9bXHr.mjs +6 -0
  117. package/dist/index-vuPgkS0V.mjs +70 -0
  118. package/dist/index.cjs.js +1 -0
  119. package/dist/index.d.ts +1288 -0
  120. package/dist/index.es.js +289 -0
  121. package/dist/input.cjs.js +1 -0
  122. package/dist/input.d.ts +9 -0
  123. package/dist/input.es.js +19 -0
  124. package/dist/jsx-runtime-nZSsnGb7.js +6 -0
  125. package/dist/jsx-runtime-tc70JA_2.mjs +264 -0
  126. package/dist/label.cjs.js +1 -0
  127. package/dist/label.d.ts +11 -0
  128. package/dist/label.es.js +22 -0
  129. package/dist/menubar.cjs.js +1 -0
  130. package/dist/menubar.d.ts +79 -0
  131. package/dist/menubar.es.js +473 -0
  132. package/dist/navigation-menu.cjs.js +1 -0
  133. package/dist/navigation-menu.d.ts +47 -0
  134. package/dist/navigation-menu.es.js +673 -0
  135. package/dist/pagination.cjs.js +1 -0
  136. package/dist/pagination.d.ts +68 -0
  137. package/dist/pagination.es.js +68 -0
  138. package/dist/popover.cjs.js +1 -0
  139. package/dist/popover.d.ts +24 -0
  140. package/dist/popover.es.js +242 -0
  141. package/dist/progress.cjs.js +6 -0
  142. package/dist/progress.d.ts +9 -0
  143. package/dist/progress.es.js +99 -0
  144. package/dist/radio-group.cjs.js +1 -0
  145. package/dist/radio-group.d.ts +16 -0
  146. package/dist/radio-group.es.js +253 -0
  147. package/dist/resizable.cjs.js +1 -0
  148. package/dist/resizable.d.ts +22 -0
  149. package/dist/resizable.es.js +1990 -0
  150. package/dist/scroll-area.cjs.js +1 -0
  151. package/dist/scroll-area.d.ts +14 -0
  152. package/dist/scroll-area.es.js +546 -0
  153. package/dist/search.cjs.js +1 -0
  154. package/dist/search.d.ts +15 -0
  155. package/dist/search.es.js +51 -0
  156. package/dist/select.cjs.js +1 -0
  157. package/dist/select.d.ts +54 -0
  158. package/dist/select.es.js +908 -0
  159. package/dist/separator.cjs.js +1 -0
  160. package/dist/separator.d.ts +9 -0
  161. package/dist/separator.es.js +35 -0
  162. package/dist/sheet.cjs.js +1 -0
  163. package/dist/sheet.d.ts +68 -0
  164. package/dist/sheet.es.js +66 -0
  165. package/dist/skeleton.cjs.js +1 -0
  166. package/dist/skeleton.d.ts +9 -0
  167. package/dist/skeleton.es.js +8 -0
  168. package/dist/slider.cjs.js +1 -0
  169. package/dist/slider.d.ts +9 -0
  170. package/dist/slider.es.js +442 -0
  171. package/dist/sonner.cjs.js +1 -0
  172. package/dist/sonner.d.ts +10 -0
  173. package/dist/sonner.es.js +764 -0
  174. package/dist/switch.cjs.js +1 -0
  175. package/dist/switch.d.ts +9 -0
  176. package/dist/switch.es.js +149 -0
  177. package/dist/table.cjs.js +1 -0
  178. package/dist/table.d.ts +43 -0
  179. package/dist/table.es.js +57 -0
  180. package/dist/tabs.cjs.js +1 -0
  181. package/dist/tabs.d.ts +24 -0
  182. package/dist/tabs.es.js +195 -0
  183. package/dist/text.cjs.js +1 -0
  184. package/dist/text.d.ts +17 -0
  185. package/dist/text.es.js +42 -0
  186. package/dist/textarea.cjs.js +1 -0
  187. package/dist/textarea.d.ts +9 -0
  188. package/dist/textarea.es.js +18 -0
  189. package/dist/theme-provider.cjs.js +1 -0
  190. package/dist/theme-provider.d.ts +9 -0
  191. package/dist/theme-provider.es.js +8 -0
  192. package/dist/theme-toggle.cjs.js +1 -0
  193. package/dist/theme-toggle.d.ts +8 -0
  194. package/dist/theme-toggle.es.js +78 -0
  195. package/dist/toast.cjs.js +1 -0
  196. package/dist/toast.d.ts +26 -0
  197. package/dist/toast.es.js +494 -0
  198. package/dist/toaster-CIpfms4W.js +1 -0
  199. package/dist/toaster-jBYXAPRk.mjs +118 -0
  200. package/dist/toaster.cjs.js +1 -0
  201. package/dist/toaster.d.ts +6 -0
  202. package/dist/toaster.es.js +6 -0
  203. package/dist/toggle-group.cjs.js +1 -0
  204. package/dist/toggle-group.d.ts +18 -0
  205. package/dist/toggle-group.es.js +170 -0
  206. package/dist/toggle.cjs.js +1 -0
  207. package/dist/toggle.d.ts +14 -0
  208. package/dist/toggle.es.js +14 -0
  209. package/dist/tooltip.cjs.js +1 -0
  210. package/dist/tooltip.d.ts +25 -0
  211. package/dist/tooltip.es.js +342 -0
  212. package/dist/utils-B6yFEsav.mjs +8 -0
  213. package/dist/utils-IjLH3w2e.js +1 -0
  214. package/package.json +1 -1
@@ -0,0 +1,1990 @@
1
+ import { j as $ } from "./jsx-runtime-tc70JA_2.mjs";
2
+ import { GripVertical as nt } from "lucide-react";
3
+ import { createContext as ot, useRef as F, useEffect as se, useSyncExternalStore as rt, useState as ue, useId as at, useContext as it, useCallback as Ie, useLayoutEffect as st, useImperativeHandle as Ne, useMemo as lt } from "react";
4
+ import { c as je } from "./utils-B6yFEsav.mjs";
5
+ function ut(e, t) {
6
+ const n = getComputedStyle(e), o = parseFloat(n.fontSize);
7
+ return t * o;
8
+ }
9
+ function ct(e, t) {
10
+ const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
11
+ return t * o;
12
+ }
13
+ function dt(e) {
14
+ return e / 100 * window.innerHeight;
15
+ }
16
+ function ft(e) {
17
+ return e / 100 * window.innerWidth;
18
+ }
19
+ function pt(e) {
20
+ switch (typeof e) {
21
+ case "number":
22
+ return [e, "px"];
23
+ case "string": {
24
+ const t = parseFloat(e);
25
+ return e.endsWith("%") ? [t, "%"] : e.endsWith("px") ? [t, "px"] : e.endsWith("rem") ? [t, "rem"] : e.endsWith("em") ? [t, "em"] : e.endsWith("vh") ? [t, "vh"] : e.endsWith("vw") ? [t, "vw"] : [t, "%"];
26
+ }
27
+ }
28
+ }
29
+ function oe({
30
+ groupSize: e,
31
+ panelElement: t,
32
+ styleProp: n
33
+ }) {
34
+ let o;
35
+ const [a, i] = pt(n);
36
+ switch (i) {
37
+ case "%": {
38
+ o = a / 100 * e;
39
+ break;
40
+ }
41
+ case "px": {
42
+ o = a;
43
+ break;
44
+ }
45
+ case "rem": {
46
+ o = ct(t, a);
47
+ break;
48
+ }
49
+ case "em": {
50
+ o = ut(t, a);
51
+ break;
52
+ }
53
+ case "vh": {
54
+ o = dt(a);
55
+ break;
56
+ }
57
+ case "vw": {
58
+ o = ft(a);
59
+ break;
60
+ }
61
+ }
62
+ return o;
63
+ }
64
+ function j(e) {
65
+ return parseFloat(e.toFixed(3));
66
+ }
67
+ function Z({
68
+ group: e
69
+ }) {
70
+ const { orientation: t, panels: n } = e;
71
+ return n.reduce((o, a) => (o += t === "horizontal" ? a.element.offsetWidth : a.element.offsetHeight, o), 0);
72
+ }
73
+ function ce(e) {
74
+ const { panels: t } = e, n = Z({ group: e });
75
+ return n === 0 ? t.map((o) => ({
76
+ collapsedSize: 0,
77
+ collapsible: o.panelConstraints.collapsible === !0,
78
+ defaultSize: void 0,
79
+ disabled: o.panelConstraints.disabled,
80
+ minSize: 0,
81
+ maxSize: 100,
82
+ panelId: o.id
83
+ })) : t.map((o) => {
84
+ const { element: a, panelConstraints: i } = o;
85
+ let l = 0;
86
+ if (i.collapsedSize !== void 0) {
87
+ const u = oe({
88
+ groupSize: n,
89
+ panelElement: a,
90
+ styleProp: i.collapsedSize
91
+ });
92
+ l = j(u / n * 100);
93
+ }
94
+ let r;
95
+ if (i.defaultSize !== void 0) {
96
+ const u = oe({
97
+ groupSize: n,
98
+ panelElement: a,
99
+ styleProp: i.defaultSize
100
+ });
101
+ r = j(u / n * 100);
102
+ }
103
+ let s = 0;
104
+ if (i.minSize !== void 0) {
105
+ const u = oe({
106
+ groupSize: n,
107
+ panelElement: a,
108
+ styleProp: i.minSize
109
+ });
110
+ s = j(u / n * 100);
111
+ }
112
+ let c = 100;
113
+ if (i.maxSize !== void 0) {
114
+ const u = oe({
115
+ groupSize: n,
116
+ panelElement: a,
117
+ styleProp: i.maxSize
118
+ });
119
+ c = j(u / n * 100);
120
+ }
121
+ return {
122
+ collapsedSize: l,
123
+ collapsible: i.collapsible === !0,
124
+ defaultSize: r,
125
+ disabled: i.disabled,
126
+ minSize: s,
127
+ maxSize: c,
128
+ panelId: o.id
129
+ };
130
+ });
131
+ }
132
+ function C(e, t = "Assertion error") {
133
+ if (!e)
134
+ throw Error(t);
135
+ }
136
+ function de(e, t) {
137
+ return Array.from(t).sort(
138
+ e === "horizontal" ? mt : ht
139
+ );
140
+ }
141
+ function mt(e, t) {
142
+ const n = e.element.offsetLeft - t.element.offsetLeft;
143
+ return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
144
+ }
145
+ function ht(e, t) {
146
+ const n = e.element.offsetTop - t.element.offsetTop;
147
+ return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
148
+ }
149
+ function Oe(e) {
150
+ return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.ELEMENT_NODE;
151
+ }
152
+ function Fe(e, t) {
153
+ return {
154
+ x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
155
+ Math.abs(e.x - t.left),
156
+ Math.abs(e.x - t.right)
157
+ ),
158
+ y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(
159
+ Math.abs(e.y - t.top),
160
+ Math.abs(e.y - t.bottom)
161
+ )
162
+ };
163
+ }
164
+ function gt({
165
+ orientation: e,
166
+ rects: t,
167
+ targetRect: n
168
+ }) {
169
+ const o = {
170
+ x: n.x + n.width / 2,
171
+ y: n.y + n.height / 2
172
+ };
173
+ let a, i = Number.MAX_VALUE;
174
+ for (const l of t) {
175
+ const { x: r, y: s } = Fe(o, l), c = e === "horizontal" ? r : s;
176
+ c < i && (i = c, a = l);
177
+ }
178
+ return C(a, "No rect found"), a;
179
+ }
180
+ let re;
181
+ function vt() {
182
+ return re === void 0 && (typeof matchMedia == "function" ? re = !!matchMedia("(pointer:coarse)").matches : re = !1), re;
183
+ }
184
+ function $e(e) {
185
+ const { element: t, orientation: n, panels: o, separators: a } = e, i = de(
186
+ n,
187
+ Array.from(t.children).filter(Oe).map((h) => ({ element: h }))
188
+ ).map(({ element: h }) => h), l = [];
189
+ let r = !1, s = !1, c = -1, u = -1, S = 0, z, b = [];
190
+ {
191
+ let h = -1;
192
+ for (const d of i)
193
+ d.hasAttribute("data-panel") && (h++, d.ariaDisabled === null && (S++, c === -1 && (c = h), u = h));
194
+ }
195
+ if (S > 1) {
196
+ let h = -1;
197
+ for (const d of i)
198
+ if (d.hasAttribute("data-panel")) {
199
+ h++;
200
+ const p = o.find(
201
+ (f) => f.element === d
202
+ );
203
+ if (p) {
204
+ if (z) {
205
+ const f = z.element.getBoundingClientRect(), v = d.getBoundingClientRect();
206
+ let y;
207
+ if (s) {
208
+ const g = n === "horizontal" ? new DOMRect(
209
+ f.right,
210
+ f.top,
211
+ 0,
212
+ f.height
213
+ ) : new DOMRect(
214
+ f.left,
215
+ f.bottom,
216
+ f.width,
217
+ 0
218
+ ), m = n === "horizontal" ? new DOMRect(v.left, v.top, 0, v.height) : new DOMRect(v.left, v.top, v.width, 0);
219
+ switch (b.length) {
220
+ case 0: {
221
+ y = [
222
+ g,
223
+ m
224
+ ];
225
+ break;
226
+ }
227
+ case 1: {
228
+ const L = b[0], P = gt({
229
+ orientation: n,
230
+ rects: [f, v],
231
+ targetRect: L.element.getBoundingClientRect()
232
+ });
233
+ y = [
234
+ L,
235
+ P === f ? m : g
236
+ ];
237
+ break;
238
+ }
239
+ default: {
240
+ y = b;
241
+ break;
242
+ }
243
+ }
244
+ } else
245
+ b.length ? y = b : y = [
246
+ n === "horizontal" ? new DOMRect(
247
+ f.right,
248
+ v.top,
249
+ v.left - f.right,
250
+ v.height
251
+ ) : new DOMRect(
252
+ v.left,
253
+ f.bottom,
254
+ v.width,
255
+ v.top - f.bottom
256
+ )
257
+ ];
258
+ for (const g of y) {
259
+ let m = "width" in g ? g : g.element.getBoundingClientRect();
260
+ const L = vt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
261
+ if (m.width < L) {
262
+ const M = L - m.width;
263
+ m = new DOMRect(
264
+ m.x - M / 2,
265
+ m.y,
266
+ m.width + M,
267
+ m.height
268
+ );
269
+ }
270
+ if (m.height < L) {
271
+ const M = L - m.height;
272
+ m = new DOMRect(
273
+ m.x,
274
+ m.y - M / 2,
275
+ m.width,
276
+ m.height + M
277
+ );
278
+ }
279
+ const P = h <= c || h > u;
280
+ !r && !P && l.push({
281
+ group: e,
282
+ groupSize: Z({ group: e }),
283
+ panels: [z, p],
284
+ separator: "width" in g ? void 0 : g,
285
+ rect: m
286
+ }), r = !1;
287
+ }
288
+ }
289
+ s = !1, z = p, b = [];
290
+ }
291
+ } else if (d.hasAttribute("data-separator")) {
292
+ d.ariaDisabled !== null && (r = !0);
293
+ const p = a.find(
294
+ (f) => f.element === d
295
+ );
296
+ p ? b.push(p) : (z = void 0, b = []);
297
+ } else
298
+ s = !0;
299
+ }
300
+ return l;
301
+ }
302
+ class yt {
303
+ #e = {};
304
+ addListener(t, n) {
305
+ const o = this.#e[t];
306
+ return o === void 0 ? this.#e[t] = [n] : o.includes(n) || o.push(n), () => {
307
+ this.removeListener(t, n);
308
+ };
309
+ }
310
+ emit(t, n) {
311
+ const o = this.#e[t];
312
+ if (o !== void 0)
313
+ if (o.length === 1)
314
+ o[0].call(null, n);
315
+ else {
316
+ let a = !1, i = null;
317
+ const l = Array.from(o);
318
+ for (let r = 0; r < l.length; r++) {
319
+ const s = l[r];
320
+ try {
321
+ s.call(null, n);
322
+ } catch (c) {
323
+ i === null && (a = !0, i = c);
324
+ }
325
+ }
326
+ if (a)
327
+ throw i;
328
+ }
329
+ }
330
+ removeAllListeners() {
331
+ this.#e = {};
332
+ }
333
+ removeListener(t, n) {
334
+ const o = this.#e[t];
335
+ if (o !== void 0) {
336
+ const a = o.indexOf(n);
337
+ a >= 0 && o.splice(a, 1);
338
+ }
339
+ }
340
+ }
341
+ function k(e, t, n = 0) {
342
+ return Math.abs(j(e) - j(t)) <= n;
343
+ }
344
+ let I = {
345
+ cursorFlags: 0,
346
+ interactionState: {
347
+ state: "inactive"
348
+ },
349
+ mountedGroups: /* @__PURE__ */ new Map()
350
+ };
351
+ const A = new yt();
352
+ function D() {
353
+ return I;
354
+ }
355
+ function R(e) {
356
+ const t = typeof e == "function" ? e(I) : e;
357
+ if (I === t)
358
+ return I;
359
+ const n = I;
360
+ return I = {
361
+ ...I,
362
+ ...t
363
+ }, t.cursorFlags !== void 0 && A.emit("cursorFlagsChange", I.cursorFlags), t.interactionState !== void 0 && A.emit("interactionStateChange", I.interactionState), t.mountedGroups !== void 0 && (I.mountedGroups.forEach((o, a) => {
364
+ o.derivedPanelConstraints.forEach((i) => {
365
+ if (i.collapsible) {
366
+ const { layout: l } = n.mountedGroups.get(a) ?? {};
367
+ if (l) {
368
+ const r = k(
369
+ i.collapsedSize,
370
+ o.layout[i.panelId]
371
+ ), s = k(
372
+ i.collapsedSize,
373
+ l[i.panelId]
374
+ );
375
+ r && !s && (a.inMemoryLastExpandedPanelSizes[i.panelId] = l[i.panelId]);
376
+ }
377
+ }
378
+ });
379
+ }), A.emit("mountedGroupsChange", I.mountedGroups)), I;
380
+ }
381
+ function bt(e, t, n) {
382
+ let o, a = {
383
+ x: 1 / 0,
384
+ y: 1 / 0
385
+ };
386
+ for (const i of t) {
387
+ const l = Fe(n, i.rect);
388
+ switch (e) {
389
+ case "horizontal": {
390
+ l.x <= a.x && (o = i, a = l);
391
+ break;
392
+ }
393
+ case "vertical": {
394
+ l.y <= a.y && (o = i, a = l);
395
+ break;
396
+ }
397
+ }
398
+ }
399
+ return o ? {
400
+ distance: a,
401
+ hitRegion: o
402
+ } : void 0;
403
+ }
404
+ function wt(e) {
405
+ return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
406
+ }
407
+ function St(e, t) {
408
+ if (e === t) throw new Error("Cannot compare node with itself");
409
+ const n = {
410
+ a: Se(e),
411
+ b: Se(t)
412
+ };
413
+ let o;
414
+ for (; n.a.at(-1) === n.b.at(-1); )
415
+ o = n.a.pop(), n.b.pop();
416
+ C(
417
+ o,
418
+ "Stacking order can only be calculated for elements with a common ancestor"
419
+ );
420
+ const a = {
421
+ a: we(be(n.a)),
422
+ b: we(be(n.b))
423
+ };
424
+ if (a.a === a.b) {
425
+ const i = o.childNodes, l = {
426
+ a: n.a.at(-1),
427
+ b: n.b.at(-1)
428
+ };
429
+ let r = i.length;
430
+ for (; r--; ) {
431
+ const s = i[r];
432
+ if (s === l.a) return 1;
433
+ if (s === l.b) return -1;
434
+ }
435
+ }
436
+ return Math.sign(a.a - a.b);
437
+ }
438
+ const zt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
439
+ function xt(e) {
440
+ const t = getComputedStyle(Ae(e) ?? e).display;
441
+ return t === "flex" || t === "inline-flex";
442
+ }
443
+ function Ct(e) {
444
+ const t = getComputedStyle(e);
445
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || xt(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" || zt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
446
+ }
447
+ function be(e) {
448
+ let t = e.length;
449
+ for (; t--; ) {
450
+ const n = e[t];
451
+ if (C(n, "Missing node"), Ct(n)) return n;
452
+ }
453
+ return null;
454
+ }
455
+ function we(e) {
456
+ return e && Number(getComputedStyle(e).zIndex) || 0;
457
+ }
458
+ function Se(e) {
459
+ const t = [];
460
+ for (; e; )
461
+ t.push(e), e = Ae(e);
462
+ return t;
463
+ }
464
+ function Ae(e) {
465
+ const { parentNode: t } = e;
466
+ return wt(t) ? t.host : t;
467
+ }
468
+ function Lt(e, t) {
469
+ return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
470
+ }
471
+ function Pt({
472
+ groupElement: e,
473
+ hitRegion: t,
474
+ pointerEventTarget: n
475
+ }) {
476
+ if (!Oe(n) || n.contains(e) || e.contains(n))
477
+ return !0;
478
+ if (St(n, e) > 0) {
479
+ let o = n;
480
+ for (; o; ) {
481
+ if (o.contains(e))
482
+ return !0;
483
+ if (Lt(o.getBoundingClientRect(), t))
484
+ return !1;
485
+ o = o.parentElement;
486
+ }
487
+ }
488
+ return !0;
489
+ }
490
+ function fe(e, t) {
491
+ const n = [];
492
+ return t.forEach((o, a) => {
493
+ if (a.disabled)
494
+ return;
495
+ const i = $e(a), l = bt(a.orientation, i, {
496
+ x: e.clientX,
497
+ y: e.clientY
498
+ });
499
+ l && l.distance.x <= 0 && l.distance.y <= 0 && Pt({
500
+ groupElement: a.element,
501
+ hitRegion: l.hitRegion.rect,
502
+ pointerEventTarget: e.target
503
+ }) && n.push(l.hitRegion);
504
+ }), n;
505
+ }
506
+ function Mt(e, t) {
507
+ if (e.length !== t.length)
508
+ return !1;
509
+ for (let n = 0; n < e.length; n++)
510
+ if (e[n] != t[n])
511
+ return !1;
512
+ return !0;
513
+ }
514
+ function O(e, t) {
515
+ return k(e, t) ? 0 : e > t ? 1 : -1;
516
+ }
517
+ function K({
518
+ overrideDisabledPanels: e,
519
+ panelConstraints: t,
520
+ prevSize: n,
521
+ size: o
522
+ }) {
523
+ const {
524
+ collapsedSize: a = 0,
525
+ collapsible: i,
526
+ disabled: l,
527
+ maxSize: r = 100,
528
+ minSize: s = 0
529
+ } = t;
530
+ if (l && !e)
531
+ return n;
532
+ if (O(o, s) < 0)
533
+ if (i) {
534
+ const c = (a + s) / 2;
535
+ O(o, c) < 0 ? o = a : o = s;
536
+ } else
537
+ o = s;
538
+ return o = Math.min(r, o), o = j(o), o;
539
+ }
540
+ function te({
541
+ delta: e,
542
+ initialLayout: t,
543
+ panelConstraints: n,
544
+ pivotIndices: o,
545
+ prevLayout: a,
546
+ trigger: i
547
+ }) {
548
+ if (k(e, 0))
549
+ return t;
550
+ const l = i === "imperative-api", r = Object.values(t), s = Object.values(a), c = [...r], [u, S] = o;
551
+ C(u != null, "Invalid first pivot index"), C(S != null, "Invalid second pivot index");
552
+ let z = 0;
553
+ switch (i) {
554
+ case "keyboard": {
555
+ {
556
+ const d = e < 0 ? S : u, p = n[d];
557
+ C(
558
+ p,
559
+ `Panel constraints not found for index ${d}`
560
+ );
561
+ const {
562
+ collapsedSize: f = 0,
563
+ collapsible: v,
564
+ minSize: y = 0
565
+ } = p;
566
+ if (v) {
567
+ const g = r[d];
568
+ if (C(
569
+ g != null,
570
+ `Previous layout not found for panel index ${d}`
571
+ ), k(g, f)) {
572
+ const m = y - g;
573
+ O(m, Math.abs(e)) > 0 && (e = e < 0 ? 0 - m : m);
574
+ }
575
+ }
576
+ }
577
+ {
578
+ const d = e < 0 ? u : S, p = n[d];
579
+ C(
580
+ p,
581
+ `No panel constraints found for index ${d}`
582
+ );
583
+ const {
584
+ collapsedSize: f = 0,
585
+ collapsible: v,
586
+ minSize: y = 0
587
+ } = p;
588
+ if (v) {
589
+ const g = r[d];
590
+ if (C(
591
+ g != null,
592
+ `Previous layout not found for panel index ${d}`
593
+ ), k(g, y)) {
594
+ const m = g - f;
595
+ O(m, Math.abs(e)) > 0 && (e = e < 0 ? 0 - m : m);
596
+ }
597
+ }
598
+ }
599
+ break;
600
+ }
601
+ default: {
602
+ const d = e < 0 ? S : u, p = n[d];
603
+ C(
604
+ p,
605
+ `Panel constraints not found for index ${d}`
606
+ );
607
+ const f = r[d], { collapsible: v, collapsedSize: y, minSize: g } = p;
608
+ if (v && O(f, g) < 0)
609
+ if (e > 0) {
610
+ const m = g - y, L = m / 2, P = f + e;
611
+ O(P, g) < 0 && (e = O(e, L) <= 0 ? 0 : m);
612
+ } else {
613
+ const m = g - y, L = 100 - m / 2, P = f - e;
614
+ O(P, g) < 0 && (e = O(100 + e, L) > 0 ? 0 : -m);
615
+ }
616
+ break;
617
+ }
618
+ }
619
+ {
620
+ const d = e < 0 ? 1 : -1;
621
+ let p = e < 0 ? S : u, f = 0;
622
+ for (; ; ) {
623
+ const y = r[p];
624
+ C(
625
+ y != null,
626
+ `Previous layout not found for panel index ${p}`
627
+ );
628
+ const g = K({
629
+ overrideDisabledPanels: l,
630
+ panelConstraints: n[p],
631
+ prevSize: y,
632
+ size: 100
633
+ }) - y;
634
+ if (f += g, p += d, p < 0 || p >= n.length)
635
+ break;
636
+ }
637
+ const v = Math.min(Math.abs(e), Math.abs(f));
638
+ e = e < 0 ? 0 - v : v;
639
+ }
640
+ {
641
+ let d = e < 0 ? u : S;
642
+ for (; d >= 0 && d < n.length; ) {
643
+ const p = Math.abs(e) - Math.abs(z), f = r[d];
644
+ C(
645
+ f != null,
646
+ `Previous layout not found for panel index ${d}`
647
+ );
648
+ const v = f - p, y = K({
649
+ overrideDisabledPanels: l,
650
+ panelConstraints: n[d],
651
+ prevSize: f,
652
+ size: v
653
+ });
654
+ if (!k(f, y) && (z += f - y, c[d] = y, z.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
655
+ numeric: !0
656
+ }) >= 0))
657
+ break;
658
+ e < 0 ? d-- : d++;
659
+ }
660
+ }
661
+ if (Mt(s, c))
662
+ return a;
663
+ {
664
+ const d = e < 0 ? S : u, p = r[d];
665
+ C(
666
+ p != null,
667
+ `Previous layout not found for panel index ${d}`
668
+ );
669
+ const f = p + z, v = K({
670
+ overrideDisabledPanels: l,
671
+ panelConstraints: n[d],
672
+ prevSize: p,
673
+ size: f
674
+ });
675
+ if (c[d] = v, !k(v, f)) {
676
+ let y = f - v, g = e < 0 ? S : u;
677
+ for (; g >= 0 && g < n.length; ) {
678
+ const m = c[g];
679
+ C(
680
+ m != null,
681
+ `Previous layout not found for panel index ${g}`
682
+ );
683
+ const L = m + y, P = K({
684
+ overrideDisabledPanels: l,
685
+ panelConstraints: n[g],
686
+ prevSize: m,
687
+ size: L
688
+ });
689
+ if (k(m, P) || (y -= P - m, c[g] = P), k(y, 0))
690
+ break;
691
+ e > 0 ? g-- : g++;
692
+ }
693
+ }
694
+ }
695
+ const b = Object.values(c).reduce(
696
+ (d, p) => p + d,
697
+ 0
698
+ );
699
+ if (!k(b, 100, 0.1))
700
+ return a;
701
+ const h = Object.keys(a);
702
+ return c.reduce((d, p, f) => (d[h[f]] = p, d), {});
703
+ }
704
+ function Y(e, t) {
705
+ if (Object.keys(e).length !== Object.keys(t).length)
706
+ return !1;
707
+ for (const n in e)
708
+ if (t[n] === void 0 || O(e[n], t[n]) !== 0)
709
+ return !1;
710
+ return !0;
711
+ }
712
+ function _({
713
+ layout: e,
714
+ panelConstraints: t
715
+ }) {
716
+ const n = Object.values(e), o = [...n], a = o.reduce(
717
+ (r, s) => r + s,
718
+ 0
719
+ );
720
+ if (o.length !== t.length)
721
+ throw Error(
722
+ `Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
723
+ );
724
+ if (!k(a, 100) && o.length > 0)
725
+ for (let r = 0; r < t.length; r++) {
726
+ const s = o[r];
727
+ C(s != null, `No layout data found for index ${r}`);
728
+ const c = 100 / a * s;
729
+ o[r] = c;
730
+ }
731
+ let i = 0;
732
+ for (let r = 0; r < t.length; r++) {
733
+ const s = n[r];
734
+ C(s != null, `No layout data found for index ${r}`);
735
+ const c = o[r];
736
+ C(c != null, `No layout data found for index ${r}`);
737
+ const u = K({
738
+ overrideDisabledPanels: !0,
739
+ panelConstraints: t[r],
740
+ prevSize: s,
741
+ size: c
742
+ });
743
+ c != u && (i += c - u, o[r] = u);
744
+ }
745
+ if (!k(i, 0))
746
+ for (let r = 0; r < t.length; r++) {
747
+ const s = o[r];
748
+ C(s != null, `No layout data found for index ${r}`);
749
+ const c = s + i, u = K({
750
+ overrideDisabledPanels: !0,
751
+ panelConstraints: t[r],
752
+ prevSize: s,
753
+ size: c
754
+ });
755
+ if (s !== u && (i -= u - s, o[r] = u, k(i, 0)))
756
+ break;
757
+ }
758
+ const l = Object.keys(e);
759
+ return o.reduce((r, s, c) => (r[l[c]] = s, r), {});
760
+ }
761
+ function We({
762
+ groupId: e,
763
+ panelId: t
764
+ }) {
765
+ const n = () => {
766
+ const { mountedGroups: r } = D();
767
+ for (const [
768
+ s,
769
+ {
770
+ defaultLayoutDeferred: c,
771
+ derivedPanelConstraints: u,
772
+ layout: S,
773
+ separatorToPanels: z
774
+ }
775
+ ] of r)
776
+ if (s.id === e)
777
+ return {
778
+ defaultLayoutDeferred: c,
779
+ derivedPanelConstraints: u,
780
+ group: s,
781
+ layout: S,
782
+ separatorToPanels: z
783
+ };
784
+ throw Error(`Group ${e} not found`);
785
+ }, o = () => {
786
+ const r = n().derivedPanelConstraints.find(
787
+ (s) => s.panelId === t
788
+ );
789
+ if (r !== void 0)
790
+ return r;
791
+ throw Error(`Panel constraints not found for Panel ${t}`);
792
+ }, a = () => {
793
+ const r = n().group.panels.find((s) => s.id === t);
794
+ if (r !== void 0)
795
+ return r;
796
+ throw Error(`Layout not found for Panel ${t}`);
797
+ }, i = () => {
798
+ const r = n().layout[t];
799
+ if (r !== void 0)
800
+ return r;
801
+ throw Error(`Layout not found for Panel ${t}`);
802
+ }, l = (r) => {
803
+ const s = i();
804
+ if (r === s)
805
+ return;
806
+ const {
807
+ defaultLayoutDeferred: c,
808
+ derivedPanelConstraints: u,
809
+ group: S,
810
+ layout: z,
811
+ separatorToPanels: b
812
+ } = n(), h = S.panels.findIndex((v) => v.id === t), d = h === S.panels.length - 1, p = te({
813
+ delta: d ? s - r : r - s,
814
+ initialLayout: z,
815
+ panelConstraints: u,
816
+ pivotIndices: d ? [h - 1, h] : [h, h + 1],
817
+ prevLayout: z,
818
+ trigger: "imperative-api"
819
+ }), f = _({
820
+ layout: p,
821
+ panelConstraints: u
822
+ });
823
+ Y(z, f) || R((v) => ({
824
+ mountedGroups: new Map(v.mountedGroups).set(S, {
825
+ defaultLayoutDeferred: c,
826
+ derivedPanelConstraints: u,
827
+ layout: f,
828
+ separatorToPanels: b
829
+ })
830
+ }));
831
+ };
832
+ return {
833
+ collapse: () => {
834
+ const { collapsible: r, collapsedSize: s } = o(), { mutableValues: c } = a(), u = i();
835
+ r && u !== s && (c.expandToSize = u, l(s));
836
+ },
837
+ expand: () => {
838
+ const { collapsible: r, collapsedSize: s, minSize: c } = o(), { mutableValues: u } = a(), S = i();
839
+ if (r && S === s) {
840
+ let z = u.expandToSize ?? c;
841
+ z === 0 && (z = 1), l(z);
842
+ }
843
+ },
844
+ getSize: () => {
845
+ const { group: r } = n(), s = i(), { element: c } = a(), u = r.orientation === "horizontal" ? c.offsetWidth : c.offsetHeight;
846
+ return {
847
+ asPercentage: s,
848
+ inPixels: u
849
+ };
850
+ },
851
+ isCollapsed: () => {
852
+ const { collapsible: r, collapsedSize: s } = o(), c = i();
853
+ return r && k(s, c);
854
+ },
855
+ resize: (r) => {
856
+ if (i() !== r) {
857
+ let s;
858
+ switch (typeof r) {
859
+ case "number": {
860
+ const { group: c } = n(), u = Z({ group: c });
861
+ s = j(r / u * 100);
862
+ break;
863
+ }
864
+ case "string": {
865
+ s = parseFloat(r);
866
+ break;
867
+ }
868
+ }
869
+ l(s);
870
+ }
871
+ }
872
+ };
873
+ }
874
+ function ze(e) {
875
+ if (e.defaultPrevented)
876
+ return;
877
+ const { mountedGroups: t } = D();
878
+ fe(e, t).forEach((n) => {
879
+ if (n.separator) {
880
+ const o = n.panels.find(
881
+ (a) => a.panelConstraints.defaultSize !== void 0
882
+ );
883
+ if (o) {
884
+ const a = o.panelConstraints.defaultSize, i = We({
885
+ groupId: n.group.id,
886
+ panelId: o.id
887
+ });
888
+ i && a !== void 0 && (i.resize(a), e.preventDefault());
889
+ }
890
+ }
891
+ });
892
+ }
893
+ function ie(e) {
894
+ const { mountedGroups: t } = D();
895
+ for (const [n] of t)
896
+ if (n.separators.some(
897
+ (o) => o.element === e
898
+ ))
899
+ return n;
900
+ throw Error("Could not find parent Group for separator element");
901
+ }
902
+ function He({
903
+ groupId: e
904
+ }) {
905
+ const t = () => {
906
+ const { mountedGroups: n } = D();
907
+ for (const [o, a] of n)
908
+ if (o.id === e)
909
+ return { group: o, ...a };
910
+ throw Error(`Could not find Group with id "${e}"`);
911
+ };
912
+ return {
913
+ getLayout() {
914
+ const { defaultLayoutDeferred: n, layout: o } = t();
915
+ return n ? {} : o;
916
+ },
917
+ setLayout(n) {
918
+ const {
919
+ defaultLayoutDeferred: o,
920
+ derivedPanelConstraints: a,
921
+ group: i,
922
+ layout: l,
923
+ separatorToPanels: r
924
+ } = t(), s = _({
925
+ layout: n,
926
+ panelConstraints: a
927
+ });
928
+ if (o)
929
+ return l;
930
+ if (!Y(l, s)) {
931
+ R((u) => ({
932
+ mountedGroups: new Map(u.mountedGroups).set(i, {
933
+ defaultLayoutDeferred: o,
934
+ derivedPanelConstraints: a,
935
+ layout: s,
936
+ separatorToPanels: r
937
+ })
938
+ }));
939
+ const c = i.panels.map(({ id: u }) => u).join(",");
940
+ i.inMemoryLayouts[c] = s;
941
+ }
942
+ return s;
943
+ }
944
+ };
945
+ }
946
+ function Ve(e) {
947
+ const { mountedGroups: t } = D(), n = t.get(e);
948
+ return C(n, `Mounted Group ${e.id} not found`), n;
949
+ }
950
+ function X(e, t) {
951
+ const n = ie(e), o = Ve(n), a = n.separators.find(
952
+ (u) => u.element === e
953
+ );
954
+ C(a, "Matching separator not found");
955
+ const i = o.separatorToPanels.get(a);
956
+ C(i, "Matching panels not found");
957
+ const l = i.map((u) => n.panels.indexOf(u)), r = He({ groupId: n.id }).getLayout(), s = te({
958
+ delta: t,
959
+ initialLayout: r,
960
+ panelConstraints: o.derivedPanelConstraints,
961
+ pivotIndices: l,
962
+ prevLayout: r,
963
+ trigger: "keyboard"
964
+ }), c = _({
965
+ layout: s,
966
+ panelConstraints: o.derivedPanelConstraints
967
+ });
968
+ Y(r, c) || R((u) => ({
969
+ mountedGroups: new Map(u.mountedGroups).set(n, {
970
+ defaultLayoutDeferred: o.defaultLayoutDeferred,
971
+ derivedPanelConstraints: o.derivedPanelConstraints,
972
+ layout: c,
973
+ separatorToPanels: o.separatorToPanels
974
+ })
975
+ }));
976
+ }
977
+ function xe(e) {
978
+ if (e.defaultPrevented)
979
+ return;
980
+ const t = e.currentTarget, n = ie(t);
981
+ if (!n.disabled)
982
+ switch (e.key) {
983
+ case "ArrowDown": {
984
+ e.preventDefault(), n.orientation === "vertical" && X(t, 5);
985
+ break;
986
+ }
987
+ case "ArrowLeft": {
988
+ e.preventDefault(), n.orientation === "horizontal" && X(t, -5);
989
+ break;
990
+ }
991
+ case "ArrowRight": {
992
+ e.preventDefault(), n.orientation === "horizontal" && X(t, 5);
993
+ break;
994
+ }
995
+ case "ArrowUp": {
996
+ e.preventDefault(), n.orientation === "vertical" && X(t, -5);
997
+ break;
998
+ }
999
+ case "End": {
1000
+ e.preventDefault(), X(t, 100);
1001
+ break;
1002
+ }
1003
+ case "Enter": {
1004
+ e.preventDefault();
1005
+ const o = ie(t), { derivedPanelConstraints: a, layout: i, separatorToPanels: l } = Ve(o), r = o.separators.find(
1006
+ (S) => S.element === t
1007
+ );
1008
+ C(r, "Matching separator not found");
1009
+ const s = l.get(r);
1010
+ C(s, "Matching panels not found");
1011
+ const c = s[0], u = a.find(
1012
+ (S) => S.panelId === c.id
1013
+ );
1014
+ if (C(u, "Panel metadata not found"), u.collapsible) {
1015
+ const S = i[c.id], z = u.collapsedSize === S ? o.inMemoryLastExpandedPanelSizes[c.id] ?? u.minSize : u.collapsedSize;
1016
+ X(t, z - S);
1017
+ }
1018
+ break;
1019
+ }
1020
+ case "F6": {
1021
+ e.preventDefault();
1022
+ const o = ie(t).separators.map(
1023
+ (l) => l.element
1024
+ ), a = Array.from(o).findIndex(
1025
+ (l) => l === e.currentTarget
1026
+ );
1027
+ C(a !== null, "Index not found");
1028
+ const i = e.shiftKey ? a > 0 ? a - 1 : o.length - 1 : a + 1 < o.length ? a + 1 : 0;
1029
+ o[i].focus();
1030
+ break;
1031
+ }
1032
+ case "Home": {
1033
+ e.preventDefault(), X(t, -100);
1034
+ break;
1035
+ }
1036
+ }
1037
+ }
1038
+ function Ce(e) {
1039
+ if (e.defaultPrevented || e.pointerType === "mouse" && e.button > 0)
1040
+ return;
1041
+ const { mountedGroups: t } = D(), n = fe(e, t), o = /* @__PURE__ */ new Map();
1042
+ let a = !1;
1043
+ n.forEach((i) => {
1044
+ i.separator && (a || (a = !0, i.separator.element.focus()));
1045
+ const l = t.get(i.group);
1046
+ l && o.set(i.group, l.layout);
1047
+ }), R({
1048
+ interactionState: {
1049
+ hitRegions: n,
1050
+ initialLayoutMap: o,
1051
+ pointerDownAtPoint: { x: e.clientX, y: e.clientY },
1052
+ state: "active"
1053
+ }
1054
+ }), n.length && e.preventDefault();
1055
+ }
1056
+ const Et = (e) => e, le = () => {
1057
+ }, Be = 1, Xe = 2, Ye = 4, _e = 8, Le = 3, Pe = 12;
1058
+ let ae;
1059
+ function Me() {
1060
+ return ae === void 0 && (ae = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ae = !0)), ae;
1061
+ }
1062
+ function kt({
1063
+ cursorFlags: e,
1064
+ groups: t,
1065
+ state: n
1066
+ }) {
1067
+ let o = 0, a = 0;
1068
+ switch (n) {
1069
+ case "active":
1070
+ case "hover":
1071
+ t.forEach((i) => {
1072
+ if (!i.disableCursor)
1073
+ switch (i.orientation) {
1074
+ case "horizontal": {
1075
+ o++;
1076
+ break;
1077
+ }
1078
+ case "vertical": {
1079
+ a++;
1080
+ break;
1081
+ }
1082
+ }
1083
+ });
1084
+ }
1085
+ if (!(o === 0 && a === 0)) {
1086
+ switch (n) {
1087
+ case "active": {
1088
+ if (e && Me()) {
1089
+ const i = (e & Be) !== 0, l = (e & Xe) !== 0, r = (e & Ye) !== 0, s = (e & _e) !== 0;
1090
+ if (i)
1091
+ return r ? "se-resize" : s ? "ne-resize" : "e-resize";
1092
+ if (l)
1093
+ return r ? "sw-resize" : s ? "nw-resize" : "w-resize";
1094
+ if (r)
1095
+ return "s-resize";
1096
+ if (s)
1097
+ return "n-resize";
1098
+ }
1099
+ break;
1100
+ }
1101
+ }
1102
+ return Me() ? o > 0 && a > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && a > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
1103
+ }
1104
+ }
1105
+ const Ee = /* @__PURE__ */ new WeakMap();
1106
+ function pe(e) {
1107
+ if (e.defaultView === null || e.defaultView === void 0)
1108
+ return;
1109
+ let { prevStyle: t, styleSheet: n } = Ee.get(e) ?? {};
1110
+ n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
1111
+ const { cursorFlags: o, interactionState: a } = D();
1112
+ switch (a.state) {
1113
+ case "active":
1114
+ case "hover": {
1115
+ const i = kt({
1116
+ cursorFlags: o,
1117
+ groups: a.hitRegions.map((r) => r.group),
1118
+ state: a.state
1119
+ }), l = `*, *:hover {cursor: ${i} !important; }`;
1120
+ if (t === l)
1121
+ return;
1122
+ t = l, i ? n.cssRules.length === 0 ? n.insertRule(l) : n.replaceSync(l) : n.cssRules.length === 1 && n.deleteRule(0);
1123
+ break;
1124
+ }
1125
+ case "inactive": {
1126
+ t = void 0, n.cssRules.length === 1 && n.deleteRule(0);
1127
+ break;
1128
+ }
1129
+ }
1130
+ Ee.set(e, {
1131
+ prevStyle: t,
1132
+ styleSheet: n
1133
+ });
1134
+ }
1135
+ function Je({
1136
+ document: e,
1137
+ event: t,
1138
+ hitRegions: n,
1139
+ initialLayoutMap: o,
1140
+ mountedGroups: a,
1141
+ pointerDownAtPoint: i,
1142
+ prevCursorFlags: l
1143
+ }) {
1144
+ let r = 0;
1145
+ const s = new Map(a);
1146
+ n.forEach((u) => {
1147
+ const { group: S, groupSize: z } = u, { disableCursor: b, orientation: h, panels: d } = S;
1148
+ let p = 0;
1149
+ i ? h === "horizontal" ? p = (t.clientX - i.x) / z * 100 : p = (t.clientY - i.y) / z * 100 : h === "horizontal" ? p = t.clientX < 0 ? -100 : 100 : p = t.clientY < 0 ? -100 : 100;
1150
+ const f = o.get(S), {
1151
+ defaultLayoutDeferred: v,
1152
+ derivedPanelConstraints: y,
1153
+ layout: g,
1154
+ separatorToPanels: m
1155
+ } = a.get(S) ?? { defaultLayoutDeferred: !1 };
1156
+ if (y && f && g && m) {
1157
+ const L = te({
1158
+ delta: p,
1159
+ initialLayout: f,
1160
+ panelConstraints: y,
1161
+ pivotIndices: u.panels.map((P) => d.indexOf(P)),
1162
+ prevLayout: g,
1163
+ trigger: "mouse-or-touch"
1164
+ });
1165
+ if (Y(L, g)) {
1166
+ if (p !== 0 && !b)
1167
+ switch (h) {
1168
+ case "horizontal": {
1169
+ r |= p < 0 ? Be : Xe;
1170
+ break;
1171
+ }
1172
+ case "vertical": {
1173
+ r |= p < 0 ? Ye : _e;
1174
+ break;
1175
+ }
1176
+ }
1177
+ } else {
1178
+ s.set(u.group, {
1179
+ defaultLayoutDeferred: v,
1180
+ derivedPanelConstraints: y,
1181
+ layout: L,
1182
+ separatorToPanels: m
1183
+ });
1184
+ const P = u.group.panels.map(({ id: M }) => M).join(",");
1185
+ u.group.inMemoryLayouts[P] = L;
1186
+ }
1187
+ }
1188
+ });
1189
+ let c = 0;
1190
+ t.movementX === 0 ? c |= l & Le : c |= r & Le, t.movementY === 0 ? c |= l & Pe : c |= r & Pe, R({
1191
+ cursorFlags: c,
1192
+ mountedGroups: s
1193
+ }), pe(e);
1194
+ }
1195
+ function ke(e) {
1196
+ const { cursorFlags: t, interactionState: n, mountedGroups: o } = D();
1197
+ n.state === "active" && Je({
1198
+ document: e.currentTarget,
1199
+ event: e,
1200
+ hitRegions: n.hitRegions,
1201
+ initialLayoutMap: n.initialLayoutMap,
1202
+ mountedGroups: o,
1203
+ prevCursorFlags: t
1204
+ });
1205
+ }
1206
+ function De(e) {
1207
+ if (e.defaultPrevented)
1208
+ return;
1209
+ const { cursorFlags: t, interactionState: n, mountedGroups: o } = D();
1210
+ switch (n.state) {
1211
+ case "active": {
1212
+ if (
1213
+ // Skip this check for "pointerleave" events, else Firefox triggers a false positive (see #514)
1214
+ e.buttons === 0
1215
+ ) {
1216
+ R(
1217
+ (a) => a.interactionState.state === "inactive" ? a : {
1218
+ cursorFlags: 0,
1219
+ interactionState: { state: "inactive" }
1220
+ }
1221
+ ), R((a) => ({
1222
+ mountedGroups: new Map(a.mountedGroups)
1223
+ }));
1224
+ return;
1225
+ }
1226
+ Je({
1227
+ document: e.currentTarget,
1228
+ event: e,
1229
+ hitRegions: n.hitRegions,
1230
+ initialLayoutMap: n.initialLayoutMap,
1231
+ mountedGroups: o,
1232
+ pointerDownAtPoint: n.pointerDownAtPoint,
1233
+ prevCursorFlags: t
1234
+ });
1235
+ break;
1236
+ }
1237
+ default: {
1238
+ const a = fe(e, o);
1239
+ a.length === 0 ? n.state !== "inactive" && R({
1240
+ interactionState: {
1241
+ state: "inactive"
1242
+ }
1243
+ }) : R({
1244
+ interactionState: {
1245
+ hitRegions: a,
1246
+ state: "hover"
1247
+ }
1248
+ }), pe(e.currentTarget);
1249
+ break;
1250
+ }
1251
+ }
1252
+ }
1253
+ function Re(e) {
1254
+ if (e.relatedTarget instanceof HTMLIFrameElement) {
1255
+ const { interactionState: t } = D();
1256
+ t.state === "hover" && R({
1257
+ interactionState: {
1258
+ state: "inactive"
1259
+ }
1260
+ });
1261
+ }
1262
+ }
1263
+ function Ge(e) {
1264
+ if (e.defaultPrevented || e.pointerType === "mouse" && e.button > 0)
1265
+ return;
1266
+ const { interactionState: t } = D();
1267
+ t.state === "active" && (R({
1268
+ cursorFlags: 0,
1269
+ interactionState: {
1270
+ state: "inactive"
1271
+ }
1272
+ }), t.hitRegions.length > 0 && (pe(e.currentTarget), R((n) => ({
1273
+ mountedGroups: new Map(n.mountedGroups)
1274
+ })), e.preventDefault()));
1275
+ }
1276
+ function Te(e) {
1277
+ let t = 0, n = 0;
1278
+ const o = {};
1279
+ for (const i of e)
1280
+ if (i.defaultSize !== void 0) {
1281
+ t++;
1282
+ const l = j(i.defaultSize);
1283
+ n += l, o[i.panelId] = l;
1284
+ } else
1285
+ o[i.panelId] = void 0;
1286
+ const a = e.length - t;
1287
+ if (a !== 0) {
1288
+ const i = j((100 - n) / a);
1289
+ for (const l of e)
1290
+ l.defaultSize === void 0 && (o[l.panelId] = i);
1291
+ }
1292
+ return o;
1293
+ }
1294
+ function Dt(e, t, n) {
1295
+ if (!n[0])
1296
+ return;
1297
+ const o = e.panels.find((s) => s.element === t);
1298
+ if (!o || !o.onResize)
1299
+ return;
1300
+ const a = Z({ group: e }), i = e.orientation === "horizontal" ? o.element.offsetWidth : o.element.offsetHeight, l = o.mutableValues.prevSize, r = {
1301
+ asPercentage: j(i / a * 100),
1302
+ inPixels: i
1303
+ };
1304
+ o.mutableValues.prevSize = r, o.onResize(r, o.id, l);
1305
+ }
1306
+ function Rt(e, t) {
1307
+ if (Object.keys(e).length !== Object.keys(t).length)
1308
+ return !1;
1309
+ for (const n in e)
1310
+ if (e[n] !== t[n])
1311
+ return !1;
1312
+ return !0;
1313
+ }
1314
+ function Gt(e, t) {
1315
+ const n = e.map((a) => a.id), o = Object.keys(t);
1316
+ if (n.length !== o.length)
1317
+ return !1;
1318
+ for (const a of n)
1319
+ if (!o.includes(a))
1320
+ return !1;
1321
+ return !0;
1322
+ }
1323
+ const q = /* @__PURE__ */ new Map();
1324
+ function Tt(e) {
1325
+ let t = !0;
1326
+ C(
1327
+ e.element.ownerDocument.defaultView,
1328
+ "Cannot register an unmounted Group"
1329
+ );
1330
+ const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), i = new n((h) => {
1331
+ for (const d of h) {
1332
+ const { borderBoxSize: p, target: f } = d;
1333
+ if (f === e.element) {
1334
+ if (t) {
1335
+ if (Z({ group: e }) === 0)
1336
+ return;
1337
+ R((v) => {
1338
+ const y = v.mountedGroups.get(e);
1339
+ if (y) {
1340
+ const g = ce(e), m = y.defaultLayoutDeferred ? Te(g) : y.layout, L = _({
1341
+ layout: m,
1342
+ panelConstraints: g
1343
+ });
1344
+ return !y.defaultLayoutDeferred && Y(m, L) && Rt(
1345
+ y.derivedPanelConstraints,
1346
+ g
1347
+ ) ? v : {
1348
+ mountedGroups: new Map(v.mountedGroups).set(e, {
1349
+ defaultLayoutDeferred: !1,
1350
+ derivedPanelConstraints: g,
1351
+ layout: L,
1352
+ separatorToPanels: y.separatorToPanels
1353
+ })
1354
+ };
1355
+ }
1356
+ return v;
1357
+ });
1358
+ }
1359
+ } else
1360
+ Dt(e, f, p);
1361
+ }
1362
+ });
1363
+ i.observe(e.element), e.panels.forEach((h) => {
1364
+ C(
1365
+ !o.has(h.id),
1366
+ `Panel ids must be unique; id "${h.id}" was used more than once`
1367
+ ), o.add(h.id), h.onResize && i.observe(h.element);
1368
+ });
1369
+ const l = Z({ group: e }), r = ce(e), s = e.panels.map(({ id: h }) => h).join(",");
1370
+ let c = e.defaultLayout;
1371
+ c && (Gt(e.panels, c) || (c = void 0));
1372
+ const u = e.inMemoryLayouts[s] ?? c ?? Te(r), S = _({
1373
+ layout: u,
1374
+ panelConstraints: r
1375
+ }), z = $e(e), b = e.element.ownerDocument;
1376
+ return R((h) => {
1377
+ const d = /* @__PURE__ */ new Map();
1378
+ return q.set(
1379
+ b,
1380
+ (q.get(b) ?? 0) + 1
1381
+ ), z.forEach((p) => {
1382
+ p.separator && d.set(p.separator, p.panels);
1383
+ }), {
1384
+ mountedGroups: new Map(h.mountedGroups).set(e, {
1385
+ defaultLayoutDeferred: l === 0,
1386
+ derivedPanelConstraints: r,
1387
+ layout: S,
1388
+ separatorToPanels: d
1389
+ })
1390
+ };
1391
+ }), e.separators.forEach((h) => {
1392
+ C(
1393
+ !a.has(h.id),
1394
+ `Separator ids must be unique; id "${h.id}" was used more than once`
1395
+ ), a.add(h.id), h.element.addEventListener("keydown", xe);
1396
+ }), q.get(b) === 1 && (b.addEventListener("dblclick", ze, !0), b.addEventListener("pointerdown", Ce, !0), b.addEventListener("pointerleave", ke), b.addEventListener("pointermove", De), b.addEventListener("pointerout", Re), b.addEventListener("pointerup", Ge, !0)), function() {
1397
+ t = !1, q.set(
1398
+ b,
1399
+ Math.max(0, (q.get(b) ?? 0) - 1)
1400
+ ), R((h) => {
1401
+ const d = new Map(h.mountedGroups);
1402
+ return d.delete(e), { mountedGroups: d };
1403
+ }), e.separators.forEach((h) => {
1404
+ h.element.removeEventListener("keydown", xe);
1405
+ }), q.get(b) || (b.removeEventListener(
1406
+ "dblclick",
1407
+ ze,
1408
+ !0
1409
+ ), b.removeEventListener(
1410
+ "pointerdown",
1411
+ Ce,
1412
+ !0
1413
+ ), b.removeEventListener("pointerleave", ke), b.removeEventListener("pointermove", De), b.removeEventListener("pointerout", Re), b.removeEventListener("pointerup", Ge, !0)), i.disconnect();
1414
+ };
1415
+ }
1416
+ function It() {
1417
+ const [e, t] = ue({}), n = Ie(() => t({}), []);
1418
+ return [e, n];
1419
+ }
1420
+ function me(e) {
1421
+ const t = at();
1422
+ return `${e ?? t}`;
1423
+ }
1424
+ const J = typeof window < "u" ? st : se;
1425
+ function ee(e) {
1426
+ const t = F(e);
1427
+ return J(() => {
1428
+ t.current = e;
1429
+ }, [e]), Ie(
1430
+ (...n) => t.current?.(...n),
1431
+ [t]
1432
+ );
1433
+ }
1434
+ function he(...e) {
1435
+ return ee((t) => {
1436
+ e.forEach((n) => {
1437
+ if (n)
1438
+ switch (typeof n) {
1439
+ case "function": {
1440
+ n(t);
1441
+ break;
1442
+ }
1443
+ case "object": {
1444
+ n.current = t;
1445
+ break;
1446
+ }
1447
+ }
1448
+ });
1449
+ });
1450
+ }
1451
+ function ge(e) {
1452
+ const t = F({ ...e });
1453
+ return J(() => {
1454
+ for (const n in e)
1455
+ t.current[n] = e[n];
1456
+ }, [e]), t.current;
1457
+ }
1458
+ const Ue = ot(null);
1459
+ function Nt(e, t) {
1460
+ const n = F({
1461
+ getLayout: () => ({}),
1462
+ setLayout: Et
1463
+ });
1464
+ Ne(t, () => n.current, []), J(() => {
1465
+ Object.assign(
1466
+ n.current,
1467
+ He({ groupId: e })
1468
+ );
1469
+ });
1470
+ }
1471
+ function qe({
1472
+ children: e,
1473
+ className: t,
1474
+ defaultLayout: n,
1475
+ disableCursor: o,
1476
+ disabled: a,
1477
+ elementRef: i,
1478
+ groupRef: l,
1479
+ id: r,
1480
+ onLayoutChange: s,
1481
+ onLayoutChanged: c,
1482
+ orientation: u = "horizontal",
1483
+ resizeTargetMinimumSize: S = {
1484
+ coarse: 20,
1485
+ fine: 10
1486
+ },
1487
+ style: z,
1488
+ ...b
1489
+ }) {
1490
+ const h = F({
1491
+ onLayoutChange: {},
1492
+ onLayoutChanged: {}
1493
+ }), d = ee((w) => {
1494
+ Y(h.current.onLayoutChange, w) || (h.current.onLayoutChange = w, s?.(w));
1495
+ }), p = ee((w) => {
1496
+ Y(h.current.onLayoutChanged, w) || (h.current.onLayoutChanged = w, c?.(w));
1497
+ }), f = me(r), v = F(null), [y, g] = It(), m = F({
1498
+ lastExpandedPanelSizes: {},
1499
+ layouts: {},
1500
+ panels: [],
1501
+ resizeTargetMinimumSize: S,
1502
+ separators: []
1503
+ }), L = he(v, i);
1504
+ Nt(f, l);
1505
+ const P = ee(
1506
+ (w, x) => {
1507
+ const { interactionState: E, mountedGroups: G } = D();
1508
+ for (const T of G.keys())
1509
+ if (T.id === w) {
1510
+ const N = G.get(T);
1511
+ if (N) {
1512
+ let V = !1;
1513
+ return E.state === "active" && (V = E.hitRegions.some(
1514
+ (Q) => Q.group === T
1515
+ )), {
1516
+ flexGrow: N.layout[x] ?? 1,
1517
+ pointerEvents: V ? "none" : void 0
1518
+ };
1519
+ }
1520
+ }
1521
+ return {
1522
+ flexGrow: n?.[x] ?? 1
1523
+ };
1524
+ }
1525
+ ), M = ge({
1526
+ defaultLayout: n,
1527
+ disableCursor: o
1528
+ }), U = lt(
1529
+ () => ({
1530
+ get disableCursor() {
1531
+ return !!M.disableCursor;
1532
+ },
1533
+ getPanelStyles: P,
1534
+ id: f,
1535
+ orientation: u,
1536
+ registerPanel: (w) => {
1537
+ const x = m.current;
1538
+ return x.panels = de(u, [
1539
+ ...x.panels,
1540
+ w
1541
+ ]), g(), () => {
1542
+ x.panels = x.panels.filter(
1543
+ (E) => E !== w
1544
+ ), g();
1545
+ };
1546
+ },
1547
+ registerSeparator: (w) => {
1548
+ const x = m.current;
1549
+ return x.separators = de(u, [
1550
+ ...x.separators,
1551
+ w
1552
+ ]), g(), () => {
1553
+ x.separators = x.separators.filter(
1554
+ (E) => E !== w
1555
+ ), g();
1556
+ };
1557
+ },
1558
+ togglePanelDisabled: (w, x) => {
1559
+ const E = m.current.panels.find(
1560
+ (T) => T.id === w
1561
+ );
1562
+ E && (E.panelConstraints.disabled = x);
1563
+ const { mountedGroups: G } = D();
1564
+ for (const T of G.keys())
1565
+ if (T.id === f) {
1566
+ const N = G.get(T);
1567
+ N && (N.derivedPanelConstraints = ce(T));
1568
+ }
1569
+ },
1570
+ toggleSeparatorDisabled: (w, x) => {
1571
+ const E = m.current.separators.find(
1572
+ (G) => G.id === w
1573
+ );
1574
+ E && (E.disabled = x);
1575
+ }
1576
+ }),
1577
+ [P, f, g, u, M]
1578
+ ), H = F(null);
1579
+ return J(() => {
1580
+ const w = v.current;
1581
+ if (w === null)
1582
+ return;
1583
+ const x = m.current;
1584
+ let E;
1585
+ if (M.defaultLayout !== void 0 && Object.keys(M.defaultLayout).length === x.panels.length) {
1586
+ E = {};
1587
+ for (const W of x.panels) {
1588
+ const B = M.defaultLayout[W.id];
1589
+ B !== void 0 && (E[W.id] = B);
1590
+ }
1591
+ }
1592
+ const G = {
1593
+ defaultLayout: E,
1594
+ disableCursor: !!M.disableCursor,
1595
+ disabled: !!a,
1596
+ element: w,
1597
+ id: f,
1598
+ inMemoryLastExpandedPanelSizes: m.current.lastExpandedPanelSizes,
1599
+ inMemoryLayouts: m.current.layouts,
1600
+ orientation: u,
1601
+ panels: x.panels,
1602
+ resizeTargetMinimumSize: x.resizeTargetMinimumSize,
1603
+ separators: x.separators
1604
+ };
1605
+ H.current = G;
1606
+ const T = Tt(G), N = D().mountedGroups.get(G);
1607
+ if (N) {
1608
+ const { defaultLayoutDeferred: W, derivedPanelConstraints: B, layout: ne } = N;
1609
+ !W && B.length > 0 && (d(ne), p(ne));
1610
+ }
1611
+ const V = A.addListener(
1612
+ "interactionStateChange",
1613
+ (W) => {
1614
+ W.state;
1615
+ }
1616
+ ), Q = A.addListener(
1617
+ "mountedGroupsChange",
1618
+ (W) => {
1619
+ const B = W.get(G);
1620
+ if (B) {
1621
+ const { defaultLayoutDeferred: ne, derivedPanelConstraints: Qe, layout: ye } = B;
1622
+ if (ne || Qe.length === 0)
1623
+ return;
1624
+ const { interactionState: et } = D(), tt = et.state !== "active";
1625
+ d(ye), tt && p(ye);
1626
+ }
1627
+ }
1628
+ );
1629
+ return () => {
1630
+ H.current = null, T(), V(), Q();
1631
+ };
1632
+ }, [
1633
+ a,
1634
+ f,
1635
+ p,
1636
+ d,
1637
+ u,
1638
+ y,
1639
+ M
1640
+ ]), se(() => {
1641
+ const w = H.current;
1642
+ w && (w.defaultLayout = n, w.disableCursor = !!o);
1643
+ }), /* @__PURE__ */ $.jsx(Ue.Provider, { value: U, children: /* @__PURE__ */ $.jsx(
1644
+ "div",
1645
+ {
1646
+ ...b,
1647
+ className: t,
1648
+ "data-group": !0,
1649
+ "data-testid": f,
1650
+ id: f,
1651
+ ref: L,
1652
+ style: {
1653
+ height: "100%",
1654
+ width: "100%",
1655
+ overflow: "hidden",
1656
+ ...z,
1657
+ display: "flex",
1658
+ flexDirection: u === "horizontal" ? "row" : "column",
1659
+ flexWrap: "nowrap",
1660
+ // Inform the browser that the library is handling touch events for this element
1661
+ // but still allow users to scroll content within panels in the non-resizing direction
1662
+ // NOTE This is not an inherited style
1663
+ // See github.com/bvaughn/react-resizable-panels/issues/662
1664
+ touchAction: u === "horizontal" ? "pan-y" : "pan-x"
1665
+ },
1666
+ children: e
1667
+ }
1668
+ ) });
1669
+ }
1670
+ qe.displayName = "Group";
1671
+ function ve() {
1672
+ const e = it(Ue);
1673
+ return C(
1674
+ e,
1675
+ "Group Context not found; did you render a Panel or Separator outside of a Group?"
1676
+ ), e;
1677
+ }
1678
+ function jt(e, t) {
1679
+ const { id: n } = ve(), o = F({
1680
+ collapse: le,
1681
+ expand: le,
1682
+ getSize: () => ({
1683
+ asPercentage: 0,
1684
+ inPixels: 0
1685
+ }),
1686
+ isCollapsed: () => !1,
1687
+ resize: le
1688
+ });
1689
+ Ne(t, () => o.current, []), J(() => {
1690
+ Object.assign(
1691
+ o.current,
1692
+ We({ groupId: n, panelId: e })
1693
+ );
1694
+ });
1695
+ }
1696
+ function Ke({
1697
+ children: e,
1698
+ className: t,
1699
+ collapsedSize: n = "0%",
1700
+ collapsible: o = !1,
1701
+ defaultSize: a,
1702
+ disabled: i,
1703
+ elementRef: l,
1704
+ id: r,
1705
+ maxSize: s = "100%",
1706
+ minSize: c = "0%",
1707
+ onResize: u,
1708
+ panelRef: S,
1709
+ style: z,
1710
+ ...b
1711
+ }) {
1712
+ const h = !!r, d = me(r), p = ge({
1713
+ disabled: i
1714
+ }), f = F(null), v = he(f, l), {
1715
+ getPanelStyles: y,
1716
+ id: g,
1717
+ orientation: m,
1718
+ registerPanel: L,
1719
+ togglePanelDisabled: P
1720
+ } = ve(), M = u !== null, U = ee(
1721
+ (w, x, E) => {
1722
+ u?.(w, r, E);
1723
+ }
1724
+ );
1725
+ J(() => {
1726
+ const w = f.current;
1727
+ if (w !== null) {
1728
+ const x = {
1729
+ element: w,
1730
+ id: d,
1731
+ idIsStable: h,
1732
+ mutableValues: {
1733
+ expandToSize: void 0,
1734
+ prevSize: void 0
1735
+ },
1736
+ onResize: M ? U : void 0,
1737
+ panelConstraints: {
1738
+ collapsedSize: n,
1739
+ collapsible: o,
1740
+ defaultSize: a,
1741
+ disabled: p.disabled,
1742
+ maxSize: s,
1743
+ minSize: c
1744
+ }
1745
+ };
1746
+ return L(x);
1747
+ }
1748
+ }, [
1749
+ n,
1750
+ o,
1751
+ a,
1752
+ M,
1753
+ d,
1754
+ h,
1755
+ s,
1756
+ c,
1757
+ U,
1758
+ L,
1759
+ p
1760
+ ]), se(() => {
1761
+ P(d, !!i);
1762
+ }, [i, d, P]), jt(d, S);
1763
+ const H = rt(
1764
+ (w) => (A.addListener("mountedGroupsChange", w), () => {
1765
+ A.removeListener("mountedGroupsChange", w);
1766
+ }),
1767
+ // useSyncExternalStore does not support a custom equality check
1768
+ // stringify avoids re-rendering when the style value hasn't changed
1769
+ () => JSON.stringify(y(g, d)),
1770
+ () => JSON.stringify(y(g, d))
1771
+ );
1772
+ return /* @__PURE__ */ $.jsx(
1773
+ "div",
1774
+ {
1775
+ ...b,
1776
+ "aria-disabled": i || void 0,
1777
+ "data-panel": !0,
1778
+ "data-testid": d,
1779
+ id: d,
1780
+ ref: v,
1781
+ style: {
1782
+ ...Ot,
1783
+ display: "flex",
1784
+ flexBasis: 0,
1785
+ flexShrink: 1,
1786
+ // Prevent Panel content from interfering with panel size
1787
+ overflow: "hidden",
1788
+ ...JSON.parse(H)
1789
+ },
1790
+ children: /* @__PURE__ */ $.jsx(
1791
+ "div",
1792
+ {
1793
+ className: t,
1794
+ style: {
1795
+ maxHeight: "100%",
1796
+ maxWidth: "100%",
1797
+ flexGrow: 1,
1798
+ ...z,
1799
+ // Inform the browser that the library is handling touch events for this element
1800
+ // but still allow users to scroll content within panels in the non-resizing direction
1801
+ // NOTE This is not an inherited style
1802
+ // See github.com/bvaughn/react-resizable-panels/issues/662
1803
+ touchAction: m === "horizontal" ? "pan-y" : "pan-x"
1804
+ },
1805
+ children: e
1806
+ }
1807
+ )
1808
+ }
1809
+ );
1810
+ }
1811
+ Ke.displayName = "Panel";
1812
+ const Ot = {
1813
+ minHeight: 0,
1814
+ maxHeight: "100%",
1815
+ height: "auto",
1816
+ minWidth: 0,
1817
+ maxWidth: "100%",
1818
+ width: "auto",
1819
+ border: "none",
1820
+ borderWidth: 0,
1821
+ padding: 0,
1822
+ margin: 0
1823
+ };
1824
+ function Ft({
1825
+ layout: e,
1826
+ panelConstraints: t,
1827
+ panelId: n,
1828
+ panelIndex: o
1829
+ }) {
1830
+ let a, i;
1831
+ const l = e[n], r = t.find(
1832
+ (s) => s.panelId === n
1833
+ );
1834
+ if (r) {
1835
+ const s = r.maxSize, c = r.collapsible ? r.collapsedSize : r.minSize, u = [o, o + 1];
1836
+ i = _({
1837
+ layout: te({
1838
+ delta: c - l,
1839
+ initialLayout: e,
1840
+ panelConstraints: t,
1841
+ pivotIndices: u,
1842
+ prevLayout: e
1843
+ }),
1844
+ panelConstraints: t
1845
+ })[n], a = _({
1846
+ layout: te({
1847
+ delta: s - l,
1848
+ initialLayout: e,
1849
+ panelConstraints: t,
1850
+ pivotIndices: u,
1851
+ prevLayout: e
1852
+ }),
1853
+ panelConstraints: t
1854
+ })[n];
1855
+ }
1856
+ return {
1857
+ valueControls: n,
1858
+ valueMax: a,
1859
+ valueMin: i,
1860
+ valueNow: l
1861
+ };
1862
+ }
1863
+ function Ze({
1864
+ children: e,
1865
+ className: t,
1866
+ disabled: n,
1867
+ elementRef: o,
1868
+ id: a,
1869
+ style: i,
1870
+ ...l
1871
+ }) {
1872
+ const r = me(a), s = ge({
1873
+ disabled: n
1874
+ }), [c, u] = ue({}), [S, z] = ue("inactive"), b = F(null), h = he(b, o), {
1875
+ disableCursor: d,
1876
+ id: p,
1877
+ orientation: f,
1878
+ registerSeparator: v,
1879
+ toggleSeparatorDisabled: y
1880
+ } = ve(), g = f === "horizontal" ? "vertical" : "horizontal";
1881
+ J(() => {
1882
+ const L = b.current;
1883
+ if (L !== null) {
1884
+ const P = {
1885
+ disabled: s.disabled,
1886
+ element: L,
1887
+ id: r
1888
+ }, M = v(P), U = A.addListener(
1889
+ "interactionStateChange",
1890
+ (w) => {
1891
+ z(
1892
+ w.state !== "inactive" && w.hitRegions.some(
1893
+ (x) => x.separator === P
1894
+ ) ? w.state : "inactive"
1895
+ );
1896
+ }
1897
+ ), H = A.addListener(
1898
+ "mountedGroupsChange",
1899
+ (w) => {
1900
+ w.forEach(
1901
+ ({ derivedPanelConstraints: x, layout: E, separatorToPanels: G }, T) => {
1902
+ if (T.id === p) {
1903
+ const N = G.get(P);
1904
+ if (N) {
1905
+ const V = N[0], Q = T.panels.indexOf(V);
1906
+ u(
1907
+ Ft({
1908
+ layout: E,
1909
+ panelConstraints: x,
1910
+ panelId: V.id,
1911
+ panelIndex: Q
1912
+ })
1913
+ );
1914
+ }
1915
+ }
1916
+ }
1917
+ );
1918
+ }
1919
+ );
1920
+ return () => {
1921
+ U(), H(), M();
1922
+ };
1923
+ }
1924
+ }, [p, r, v, s]), se(() => {
1925
+ y(r, !!n);
1926
+ }, [n, r, y]);
1927
+ let m;
1928
+ return n && !d && (m = "not-allowed"), /* @__PURE__ */ $.jsx(
1929
+ "div",
1930
+ {
1931
+ ...l,
1932
+ "aria-controls": c.valueControls,
1933
+ "aria-disabled": n || void 0,
1934
+ "aria-orientation": g,
1935
+ "aria-valuemax": c.valueMax,
1936
+ "aria-valuemin": c.valueMin,
1937
+ "aria-valuenow": c.valueNow,
1938
+ children: e,
1939
+ className: t,
1940
+ "data-separator": n ? "disabled" : S,
1941
+ "data-testid": r,
1942
+ id: r,
1943
+ ref: h,
1944
+ role: "separator",
1945
+ style: {
1946
+ flexBasis: "auto",
1947
+ cursor: m,
1948
+ ...i,
1949
+ flexGrow: 0,
1950
+ flexShrink: 0,
1951
+ // Inform the browser that the library is handling touch events for this element
1952
+ // See github.com/bvaughn/react-resizable-panels/issues/662
1953
+ touchAction: "none"
1954
+ },
1955
+ tabIndex: n ? void 0 : 0
1956
+ }
1957
+ );
1958
+ }
1959
+ Ze.displayName = "Separator";
1960
+ const Vt = ({
1961
+ className: e,
1962
+ direction: t,
1963
+ ...n
1964
+ }) => /* @__PURE__ */ $.jsx(
1965
+ qe,
1966
+ {
1967
+ orientation: t,
1968
+ className: je("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", e),
1969
+ ...n
1970
+ }
1971
+ ), Bt = Ke, Xt = ({
1972
+ withHandle: e,
1973
+ className: t,
1974
+ ...n
1975
+ }) => /* @__PURE__ */ $.jsx(
1976
+ Ze,
1977
+ {
1978
+ className: je(
1979
+ "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-none data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
1980
+ t
1981
+ ),
1982
+ ...n,
1983
+ children: e && /* @__PURE__ */ $.jsx("div", { className: "bg-border z-10 flex h-4 w-3 items-center justify-center rounded-sm border", children: /* @__PURE__ */ $.jsx(nt, { className: "h-2.5 w-2.5" }) })
1984
+ }
1985
+ );
1986
+ export {
1987
+ Xt as ResizableHandle,
1988
+ Bt as ResizablePanel,
1989
+ Vt as ResizablePanelGroup
1990
+ };