react-resizable-panels 4.10.0 → 4.11.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.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { jsx as ae } from "react/jsx-runtime";
3
- import { useState as Q, useCallback as re, useId as pt, useLayoutEffect as Ue, useEffect as me, useRef as O, createContext as ht, useImperativeHandle as Ke, useMemo as Se, useSyncExternalStore as Xe, useContext as mt } from "react";
3
+ import { useState as Q, useCallback as re, useId as pt, useLayoutEffect as Ue, useEffect as me, useRef as T, createContext as ht, useImperativeHandle as Ke, useMemo as Se, useSyncExternalStore as Xe, useContext as mt } from "react";
4
4
  function gt(e, t) {
5
5
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
6
6
  return t * o;
@@ -31,8 +31,8 @@ function ie({
31
31
  styleProp: n
32
32
  }) {
33
33
  let o;
34
- const [i, s] = bt(n);
35
- switch (s) {
34
+ const [i, r] = bt(n);
35
+ switch (r) {
36
36
  case "%": {
37
37
  o = i / 100 * e;
38
38
  break;
@@ -60,7 +60,7 @@ function ie({
60
60
  }
61
61
  return o;
62
62
  }
63
- function T(e) {
63
+ function O(e) {
64
64
  return parseFloat(e.toFixed(3));
65
65
  }
66
66
  function ne({
@@ -81,51 +81,51 @@ function ve(e) {
81
81
  maxSize: 100,
82
82
  panelId: o.id
83
83
  })) : t.map((o) => {
84
- const { element: i, panelConstraints: s } = o;
85
- let l = 0;
86
- if (s.collapsedSize !== void 0) {
87
- const f = ie({
84
+ const { element: i, panelConstraints: r } = o;
85
+ let f = 0;
86
+ if (r.collapsedSize !== void 0) {
87
+ const u = ie({
88
88
  groupSize: n,
89
89
  panelElement: i,
90
- styleProp: s.collapsedSize
90
+ styleProp: r.collapsedSize
91
91
  });
92
- l = T(f / n * 100);
92
+ f = O(u / n * 100);
93
93
  }
94
- let r;
95
- if (s.defaultSize !== void 0) {
96
- const f = ie({
94
+ let a;
95
+ if (r.defaultSize !== void 0) {
96
+ const u = ie({
97
97
  groupSize: n,
98
98
  panelElement: i,
99
- styleProp: s.defaultSize
99
+ styleProp: r.defaultSize
100
100
  });
101
- r = T(f / n * 100);
101
+ a = O(u / n * 100);
102
102
  }
103
- let a = 0;
104
- if (s.minSize !== void 0) {
105
- const f = ie({
103
+ let s = 0;
104
+ if (r.minSize !== void 0) {
105
+ const u = ie({
106
106
  groupSize: n,
107
107
  panelElement: i,
108
- styleProp: s.minSize
108
+ styleProp: r.minSize
109
109
  });
110
- a = T(f / n * 100);
110
+ s = O(u / n * 100);
111
111
  }
112
- let c = 100;
113
- if (s.maxSize !== void 0) {
114
- const f = ie({
112
+ let l = 100;
113
+ if (r.maxSize !== void 0) {
114
+ const u = ie({
115
115
  groupSize: n,
116
116
  panelElement: i,
117
- styleProp: s.maxSize
117
+ styleProp: r.maxSize
118
118
  });
119
- c = T(f / n * 100);
119
+ l = O(u / n * 100);
120
120
  }
121
121
  return {
122
- groupResizeBehavior: s.groupResizeBehavior,
123
- collapsedSize: l,
124
- collapsible: s.collapsible === !0,
125
- defaultSize: r,
126
- disabled: s.disabled,
127
- minSize: a,
128
- maxSize: c,
122
+ groupResizeBehavior: r.groupResizeBehavior,
123
+ collapsedSize: f,
124
+ collapsible: r.collapsible === !0,
125
+ defaultSize: a,
126
+ disabled: r.disabled,
127
+ minSize: s,
128
+ maxSize: l,
129
129
  panelId: o.id
130
130
  };
131
131
  });
@@ -162,7 +162,7 @@ function Ye(e, t) {
162
162
  )
163
163
  };
164
164
  }
165
- function wt({
165
+ function Pt({
166
166
  orientation: e,
167
167
  rects: t,
168
168
  targetRect: n
@@ -171,41 +171,41 @@ function wt({
171
171
  x: n.x + n.width / 2,
172
172
  y: n.y + n.height / 2
173
173
  };
174
- let i, s = Number.MAX_VALUE;
175
- for (const l of t) {
176
- const { x: r, y: a } = Ye(o, l), c = e === "horizontal" ? r : a;
177
- c < s && (s = c, i = l);
174
+ let i, r = Number.MAX_VALUE;
175
+ for (const f of t) {
176
+ const { x: a, y: s } = Ye(o, f), l = e === "horizontal" ? a : s;
177
+ l < r && (r = l, i = f);
178
178
  }
179
179
  return C(i, "No rect found"), i;
180
180
  }
181
181
  let fe;
182
- function Pt() {
182
+ function wt() {
183
183
  return fe === void 0 && (typeof matchMedia == "function" ? fe = !!matchMedia("(pointer:coarse)").matches : fe = !1), fe;
184
184
  }
185
185
  function Je(e) {
186
- const { element: t, orientation: n, panels: o, separators: i } = e, s = be(
186
+ const { element: t, orientation: n, panels: o, separators: i } = e, r = be(
187
187
  n,
188
- Array.from(t.children).filter(qe).map((x) => ({ element: x }))
189
- ).map(({ element: x }) => x), l = [];
190
- let r = !1, a = !1, c = -1, f = -1, g = 0, d, b = [];
188
+ Array.from(t.children).filter(qe).map((z) => ({ element: z }))
189
+ ).map(({ element: z }) => z), f = [];
190
+ let a = !1, s = !1, l = -1, u = -1, h = 0, d, S = [];
191
191
  {
192
- let x = -1;
193
- for (const u of s)
194
- u.hasAttribute("data-panel") && (x++, u.hasAttribute("data-disabled") || (g++, c === -1 && (c = x), f = x));
192
+ let z = -1;
193
+ for (const c of r)
194
+ c.hasAttribute("data-panel") && (z++, c.hasAttribute("data-disabled") || (h++, l === -1 && (l = z), u = z));
195
195
  }
196
- if (g > 1) {
197
- let x = -1;
198
- for (const u of s)
199
- if (u.hasAttribute("data-panel")) {
200
- x++;
196
+ if (h > 1) {
197
+ let z = -1;
198
+ for (const c of r)
199
+ if (c.hasAttribute("data-panel")) {
200
+ z++;
201
201
  const p = o.find(
202
- (m) => m.element === u
202
+ (m) => m.element === c
203
203
  );
204
204
  if (p) {
205
205
  if (d) {
206
- const m = d.element.getBoundingClientRect(), S = u.getBoundingClientRect();
207
- let v;
208
- if (a) {
206
+ const m = d.element.getBoundingClientRect(), v = c.getBoundingClientRect();
207
+ let b;
208
+ if (s) {
209
209
  const y = n === "horizontal" ? new DOMRect(
210
210
  m.right,
211
211
  m.top,
@@ -216,89 +216,89 @@ function Je(e) {
216
216
  m.bottom,
217
217
  m.width,
218
218
  0
219
- ), h = n === "horizontal" ? new DOMRect(S.left, S.top, 0, S.height) : new DOMRect(S.left, S.top, S.width, 0);
220
- switch (b.length) {
219
+ ), g = n === "horizontal" ? new DOMRect(v.left, v.top, 0, v.height) : new DOMRect(v.left, v.top, v.width, 0);
220
+ switch (S.length) {
221
221
  case 0: {
222
- v = [
222
+ b = [
223
223
  y,
224
- h
224
+ g
225
225
  ];
226
226
  break;
227
227
  }
228
228
  case 1: {
229
- const w = b[0], M = wt({
229
+ const P = S[0], M = Pt({
230
230
  orientation: n,
231
- rects: [m, S],
232
- targetRect: w.element.getBoundingClientRect()
231
+ rects: [m, v],
232
+ targetRect: P.element.getBoundingClientRect()
233
233
  });
234
- v = [
235
- w,
236
- M === m ? h : y
234
+ b = [
235
+ P,
236
+ M === m ? g : y
237
237
  ];
238
238
  break;
239
239
  }
240
240
  default: {
241
- v = b;
241
+ b = S;
242
242
  break;
243
243
  }
244
244
  }
245
245
  } else
246
- b.length ? v = b : v = [
246
+ S.length ? b = S : b = [
247
247
  n === "horizontal" ? new DOMRect(
248
248
  m.right,
249
- S.top,
250
- S.left - m.right,
251
- S.height
249
+ v.top,
250
+ v.left - m.right,
251
+ v.height
252
252
  ) : new DOMRect(
253
- S.left,
253
+ v.left,
254
254
  m.bottom,
255
- S.width,
256
- S.top - m.bottom
255
+ v.width,
256
+ v.top - m.bottom
257
257
  )
258
258
  ];
259
- for (const y of v) {
260
- let h = "width" in y ? y : y.element.getBoundingClientRect();
261
- const w = Pt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
262
- if (h.width < w) {
263
- const P = w - h.width;
264
- h = new DOMRect(
265
- h.x - P / 2,
266
- h.y,
267
- h.width + P,
268
- h.height
259
+ for (const y of b) {
260
+ let g = "width" in y ? y : y.element.getBoundingClientRect();
261
+ const P = wt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
262
+ if (g.width < P) {
263
+ const w = P - g.width;
264
+ g = new DOMRect(
265
+ g.x - w / 2,
266
+ g.y,
267
+ g.width + w,
268
+ g.height
269
269
  );
270
270
  }
271
- if (h.height < w) {
272
- const P = w - h.height;
273
- h = new DOMRect(
274
- h.x,
275
- h.y - P / 2,
276
- h.width,
277
- h.height + P
271
+ if (g.height < P) {
272
+ const w = P - g.height;
273
+ g = new DOMRect(
274
+ g.x,
275
+ g.y - w / 2,
276
+ g.width,
277
+ g.height + w
278
278
  );
279
279
  }
280
- const M = x <= c || x > f;
281
- !r && !M && l.push({
280
+ const M = z <= l || z > u;
281
+ !a && !M && f.push({
282
282
  group: e,
283
283
  groupSize: ne({ group: e }),
284
284
  panels: [d, p],
285
285
  separator: "width" in y ? void 0 : y,
286
- rect: h
287
- }), r = !1;
286
+ rect: g
287
+ }), a = !1;
288
288
  }
289
289
  }
290
- a = !1, d = p, b = [];
290
+ s = !1, d = p, S = [];
291
291
  }
292
- } else if (u.hasAttribute("data-separator")) {
293
- u.ariaDisabled !== null && (r = !0);
292
+ } else if (c.hasAttribute("data-separator")) {
293
+ c.ariaDisabled !== null && (a = !0);
294
294
  const p = i.find(
295
- (m) => m.element === u
295
+ (m) => m.element === c
296
296
  );
297
- p ? b.push(p) : (d = void 0, b = []);
297
+ p ? S.push(p) : (d = void 0, S = []);
298
298
  } else
299
- a = !0;
299
+ s = !0;
300
300
  }
301
- return l;
301
+ return f;
302
302
  }
303
303
  class Ze {
304
304
  #e = {};
@@ -314,18 +314,18 @@ class Ze {
314
314
  if (o.length === 1)
315
315
  o[0].call(null, n);
316
316
  else {
317
- let i = !1, s = null;
318
- const l = Array.from(o);
319
- for (let r = 0; r < l.length; r++) {
320
- const a = l[r];
317
+ let i = !1, r = null;
318
+ const f = Array.from(o);
319
+ for (let a = 0; a < f.length; a++) {
320
+ const s = f[a];
321
321
  try {
322
- a.call(null, n);
323
- } catch (c) {
324
- s === null && (i = !0, s = c);
322
+ s.call(null, n);
323
+ } catch (l) {
324
+ r === null && (i = !0, r = l);
325
325
  }
326
326
  }
327
327
  if (i)
328
- throw s;
328
+ throw r;
329
329
  }
330
330
  }
331
331
  removeAllListeners() {
@@ -377,15 +377,15 @@ function Ct(e, t, n) {
377
377
  x: 1 / 0,
378
378
  y: 1 / 0
379
379
  };
380
- for (const s of t) {
381
- const l = Ye(n, s.rect);
380
+ for (const r of t) {
381
+ const f = Ye(n, r.rect);
382
382
  switch (e) {
383
383
  case "horizontal": {
384
- l.x <= i.x && (o = s, i = l);
384
+ f.x <= i.x && (o = r, i = f);
385
385
  break;
386
386
  }
387
387
  case "vertical": {
388
- l.y <= i.y && (o = s, i = l);
388
+ f.y <= i.y && (o = r, i = f);
389
389
  break;
390
390
  }
391
391
  }
@@ -401,8 +401,8 @@ function Rt(e) {
401
401
  function Mt(e, t) {
402
402
  if (e === t) throw new Error("Cannot compare node with itself");
403
403
  const n = {
404
- a: Te(e),
405
- b: Te(t)
404
+ a: Oe(e),
405
+ b: Oe(t)
406
406
  };
407
407
  let o;
408
408
  for (; n.a.at(-1) === n.b.at(-1); )
@@ -416,15 +416,15 @@ function Mt(e, t) {
416
416
  b: De(Ie(n.b))
417
417
  };
418
418
  if (i.a === i.b) {
419
- const s = o.childNodes, l = {
419
+ const r = o.childNodes, f = {
420
420
  a: n.a.at(-1),
421
421
  b: n.b.at(-1)
422
422
  };
423
- let r = s.length;
424
- for (; r--; ) {
425
- const a = s[r];
426
- if (a === l.a) return 1;
427
- if (a === l.b) return -1;
423
+ let a = r.length;
424
+ for (; a--; ) {
425
+ const s = r[a];
426
+ if (s === f.a) return 1;
427
+ if (s === f.b) return -1;
428
428
  }
429
429
  }
430
430
  return Math.sign(i.a - i.b);
@@ -449,7 +449,7 @@ function Ie(e) {
449
449
  function De(e) {
450
450
  return e && Number(getComputedStyle(e).zIndex) || 0;
451
451
  }
452
- function Te(e) {
452
+ function Oe(e) {
453
453
  const t = [];
454
454
  for (; e; )
455
455
  t.push(e), e = et(e);
@@ -462,7 +462,7 @@ function et(e) {
462
462
  function Dt(e, t) {
463
463
  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;
464
464
  }
465
- function Tt({
465
+ function Ot({
466
466
  groupElement: e,
467
467
  hitRegion: t,
468
468
  pointerEventTarget: n
@@ -486,18 +486,18 @@ function xe(e, t) {
486
486
  return t.forEach((o, i) => {
487
487
  if (i.disabled)
488
488
  return;
489
- const s = Je(i), l = Ct(i.orientation, s, {
489
+ const r = Je(i), f = Ct(i.orientation, r, {
490
490
  x: e.clientX,
491
491
  y: e.clientY
492
492
  });
493
- l && l.distance.x <= 0 && l.distance.y <= 0 && Tt({
493
+ f && f.distance.x <= 0 && f.distance.y <= 0 && Ot({
494
494
  groupElement: i.element,
495
- hitRegion: l.hitRegion.rect,
495
+ hitRegion: f.hitRegion.rect,
496
496
  pointerEventTarget: e.target
497
- }) && n.push(l.hitRegion);
497
+ }) && n.push(f.hitRegion);
498
498
  }), n;
499
499
  }
500
- function Ot(e, t) {
500
+ function Tt(e, t) {
501
501
  if (e.length !== t.length)
502
502
  return !1;
503
503
  for (let n = 0; n < e.length; n++)
@@ -505,11 +505,11 @@ function Ot(e, t) {
505
505
  return !1;
506
506
  return !0;
507
507
  }
508
- function D(e, t, n = 0) {
509
- return Math.abs(T(e) - T(t)) <= n;
508
+ function I(e, t, n = 0) {
509
+ return Math.abs(O(e) - O(t)) <= n;
510
510
  }
511
511
  function A(e, t) {
512
- return D(e, t) ? 0 : e > t ? 1 : -1;
512
+ return I(e, t) ? 0 : e > t ? 1 : -1;
513
513
  }
514
514
  function Z({
515
515
  overrideDisabledPanels: e,
@@ -519,20 +519,20 @@ function Z({
519
519
  }) {
520
520
  const {
521
521
  collapsedSize: i = 0,
522
- collapsible: s,
523
- disabled: l,
524
- maxSize: r = 100,
525
- minSize: a = 0
522
+ collapsible: r,
523
+ disabled: f,
524
+ maxSize: a = 100,
525
+ minSize: s = 0
526
526
  } = t;
527
- if (l && !e)
527
+ if (f && !e)
528
528
  return n;
529
- if (A(o, a) < 0)
530
- if (s) {
531
- const c = (i + a) / 2;
532
- A(o, c) < 0 ? o = i : o = a;
529
+ if (A(o, s) < 0)
530
+ if (r) {
531
+ const l = (i + s) / 2;
532
+ A(o, l) < 0 ? o = i : o = s;
533
533
  } else
534
- o = a;
535
- return o = Math.min(r, o), o = T(o), o;
534
+ o = s;
535
+ return o = Math.min(a, o), o = O(o), o;
536
536
  }
537
537
  function le({
538
538
  delta: e,
@@ -540,163 +540,163 @@ function le({
540
540
  panelConstraints: n,
541
541
  pivotIndices: o,
542
542
  prevLayout: i,
543
- trigger: s
543
+ trigger: r
544
544
  }) {
545
- if (D(e, 0))
545
+ if (I(e, 0))
546
546
  return t;
547
- const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), c = [...r], [f, g] = o;
548
- C(f != null, "Invalid first pivot index"), C(g != null, "Invalid second pivot index");
547
+ const f = r === "imperative-api", a = Object.values(t), s = Object.values(i), l = [...a], [u, h] = o;
548
+ C(u != null, "Invalid first pivot index"), C(h != null, "Invalid second pivot index");
549
549
  let d = 0;
550
- switch (s) {
550
+ switch (r) {
551
551
  case "keyboard": {
552
552
  {
553
- const u = e < 0 ? g : f, p = n[u];
553
+ const c = e < 0 ? h : u, p = n[c];
554
554
  C(
555
555
  p,
556
- `Panel constraints not found for index ${u}`
556
+ `Panel constraints not found for index ${c}`
557
557
  );
558
558
  const {
559
559
  collapsedSize: m = 0,
560
- collapsible: S,
561
- minSize: v = 0
560
+ collapsible: v,
561
+ minSize: b = 0
562
562
  } = p;
563
- if (S) {
564
- const y = r[u];
563
+ if (v) {
564
+ const y = a[c];
565
565
  if (C(
566
566
  y != null,
567
- `Previous layout not found for panel index ${u}`
568
- ), D(y, m)) {
569
- const h = v - y;
570
- A(h, Math.abs(e)) > 0 && (e = e < 0 ? 0 - h : h);
567
+ `Previous layout not found for panel index ${c}`
568
+ ), I(y, m)) {
569
+ const g = b - y;
570
+ A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
571
571
  }
572
572
  }
573
573
  }
574
574
  {
575
- const u = e < 0 ? f : g, p = n[u];
575
+ const c = e < 0 ? u : h, p = n[c];
576
576
  C(
577
577
  p,
578
- `No panel constraints found for index ${u}`
578
+ `No panel constraints found for index ${c}`
579
579
  );
580
580
  const {
581
581
  collapsedSize: m = 0,
582
- collapsible: S,
583
- minSize: v = 0
582
+ collapsible: v,
583
+ minSize: b = 0
584
584
  } = p;
585
- if (S) {
586
- const y = r[u];
585
+ if (v) {
586
+ const y = a[c];
587
587
  if (C(
588
588
  y != null,
589
- `Previous layout not found for panel index ${u}`
590
- ), D(y, v)) {
591
- const h = y - m;
592
- A(h, Math.abs(e)) > 0 && (e = e < 0 ? 0 - h : h);
589
+ `Previous layout not found for panel index ${c}`
590
+ ), I(y, b)) {
591
+ const g = y - m;
592
+ A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
593
593
  }
594
594
  }
595
595
  }
596
596
  break;
597
597
  }
598
598
  default: {
599
- const u = e < 0 ? g : f, p = n[u];
599
+ const c = e < 0 ? h : u, p = n[c];
600
600
  C(
601
601
  p,
602
- `Panel constraints not found for index ${u}`
602
+ `Panel constraints not found for index ${c}`
603
603
  );
604
- const m = r[u], { collapsible: S, collapsedSize: v, minSize: y } = p;
605
- if (S && A(m, y) < 0)
604
+ const m = a[c], { collapsible: v, collapsedSize: b, minSize: y } = p;
605
+ if (v && A(m, y) < 0)
606
606
  if (e > 0) {
607
- const h = y - v, w = h / 2, M = m + e;
608
- A(M, y) < 0 && (e = A(e, w) <= 0 ? 0 : h);
607
+ const g = y - b, P = g / 2, M = m + e;
608
+ A(M, y) < 0 && (e = A(e, P) <= 0 ? 0 : g);
609
609
  } else {
610
- const h = y - v, w = 100 - h / 2, M = m - e;
611
- A(M, y) < 0 && (e = A(100 + e, w) > 0 ? 0 : -h);
610
+ const g = y - b, P = 100 - g / 2, M = m - e;
611
+ A(M, y) < 0 && (e = A(100 + e, P) > 0 ? 0 : -g);
612
612
  }
613
613
  break;
614
614
  }
615
615
  }
616
616
  {
617
- const u = e < 0 ? 1 : -1;
618
- let p = e < 0 ? g : f, m = 0;
617
+ const c = e < 0 ? 1 : -1;
618
+ let p = e < 0 ? h : u, m = 0;
619
619
  for (; ; ) {
620
- const v = r[p];
620
+ const b = a[p];
621
621
  C(
622
- v != null,
622
+ b != null,
623
623
  `Previous layout not found for panel index ${p}`
624
624
  );
625
- const h = Z({
626
- overrideDisabledPanels: l,
625
+ const g = Z({
626
+ overrideDisabledPanels: f,
627
627
  panelConstraints: n[p],
628
- prevSize: v,
628
+ prevSize: b,
629
629
  size: 100
630
- }) - v;
631
- if (m += h, p += u, p < 0 || p >= n.length)
630
+ }) - b;
631
+ if (m += g, p += c, p < 0 || p >= n.length)
632
632
  break;
633
633
  }
634
- const S = Math.min(Math.abs(e), Math.abs(m));
635
- e = e < 0 ? 0 - S : S;
634
+ const v = Math.min(Math.abs(e), Math.abs(m));
635
+ e = e < 0 ? 0 - v : v;
636
636
  }
637
637
  {
638
- let p = e < 0 ? f : g;
638
+ let p = e < 0 ? u : h;
639
639
  for (; p >= 0 && p < n.length; ) {
640
- const m = Math.abs(e) - Math.abs(d), S = r[p];
640
+ const m = Math.abs(e) - Math.abs(d), v = a[p];
641
641
  C(
642
- S != null,
642
+ v != null,
643
643
  `Previous layout not found for panel index ${p}`
644
644
  );
645
- const v = S - m, y = Z({
646
- overrideDisabledPanels: l,
645
+ const b = v - m, y = Z({
646
+ overrideDisabledPanels: f,
647
647
  panelConstraints: n[p],
648
- prevSize: S,
649
- size: v
648
+ prevSize: v,
649
+ size: b
650
650
  });
651
- if (!D(S, y) && (d += S - y, c[p] = y, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
651
+ if (!I(v, y) && (d += v - y, l[p] = y, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
652
652
  numeric: !0
653
653
  }) >= 0))
654
654
  break;
655
655
  e < 0 ? p-- : p++;
656
656
  }
657
657
  }
658
- if (Ot(a, c))
658
+ if (Tt(s, l))
659
659
  return i;
660
660
  {
661
- const u = e < 0 ? g : f, p = r[u];
661
+ const c = e < 0 ? h : u, p = a[c];
662
662
  C(
663
663
  p != null,
664
- `Previous layout not found for panel index ${u}`
664
+ `Previous layout not found for panel index ${c}`
665
665
  );
666
- const m = p + d, S = Z({
667
- overrideDisabledPanels: l,
668
- panelConstraints: n[u],
666
+ const m = p + d, v = Z({
667
+ overrideDisabledPanels: f,
668
+ panelConstraints: n[c],
669
669
  prevSize: p,
670
670
  size: m
671
671
  });
672
- if (c[u] = S, !D(S, m)) {
673
- let v = m - S, h = e < 0 ? g : f;
674
- for (; h >= 0 && h < n.length; ) {
675
- const w = c[h];
672
+ if (l[c] = v, !I(v, m)) {
673
+ let b = m - v, g = e < 0 ? h : u;
674
+ for (; g >= 0 && g < n.length; ) {
675
+ const P = l[g];
676
676
  C(
677
- w != null,
678
- `Previous layout not found for panel index ${h}`
677
+ P != null,
678
+ `Previous layout not found for panel index ${g}`
679
679
  );
680
- const M = w + v, P = Z({
681
- overrideDisabledPanels: l,
682
- panelConstraints: n[h],
683
- prevSize: w,
680
+ const M = P + b, w = Z({
681
+ overrideDisabledPanels: f,
682
+ panelConstraints: n[g],
683
+ prevSize: P,
684
684
  size: M
685
685
  });
686
- if (D(w, P) || (v -= P - w, c[h] = P), D(v, 0))
686
+ if (I(P, w) || (b -= w - P, l[g] = w), I(b, 0))
687
687
  break;
688
- e > 0 ? h-- : h++;
688
+ e > 0 ? g-- : g++;
689
689
  }
690
690
  }
691
691
  }
692
- const b = Object.values(c).reduce(
693
- (u, p) => p + u,
692
+ const S = Object.values(l).reduce(
693
+ (c, p) => p + c,
694
694
  0
695
695
  );
696
- if (!D(b, 100, 0.1))
696
+ if (!I(S, 100, 0.1))
697
697
  return i;
698
- const x = Object.keys(i);
699
- return c.reduce((u, p, m) => (u[x[m]] = p, u), {});
698
+ const z = Object.keys(i);
699
+ return l.reduce((c, p, m) => (c[z[m]] = p, c), {});
700
700
  }
701
701
  function W(e, t) {
702
702
  if (Object.keys(e).length !== Object.keys(t).length)
@@ -711,171 +711,194 @@ function U({
711
711
  panelConstraints: t
712
712
  }) {
713
713
  const n = Object.values(e), o = [...n], i = o.reduce(
714
- (r, a) => r + a,
714
+ (a, s) => a + s,
715
715
  0
716
716
  );
717
717
  if (o.length !== t.length)
718
718
  throw Error(
719
- `Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
719
+ `Invalid ${t.length} panel layout: ${o.map((a) => `${a}%`).join(", ")}`
720
720
  );
721
- if (!D(i, 100) && o.length > 0)
722
- for (let r = 0; r < t.length; r++) {
723
- const a = o[r];
724
- C(a != null, `No layout data found for index ${r}`);
725
- const c = 100 / i * a;
726
- o[r] = c;
721
+ if (!I(i, 100) && o.length > 0)
722
+ for (let a = 0; a < t.length; a++) {
723
+ const s = o[a];
724
+ C(s != null, `No layout data found for index ${a}`);
725
+ const l = 100 / i * s;
726
+ o[a] = l;
727
727
  }
728
- let s = 0;
729
- for (let r = 0; r < t.length; r++) {
730
- const a = n[r];
731
- C(a != null, `No layout data found for index ${r}`);
732
- const c = o[r];
733
- C(c != null, `No layout data found for index ${r}`);
734
- const f = Z({
728
+ let r = 0;
729
+ for (let a = 0; a < t.length; a++) {
730
+ const s = n[a];
731
+ C(s != null, `No layout data found for index ${a}`);
732
+ const l = o[a];
733
+ C(l != null, `No layout data found for index ${a}`);
734
+ const u = Z({
735
735
  overrideDisabledPanels: !0,
736
- panelConstraints: t[r],
737
- prevSize: a,
738
- size: c
736
+ panelConstraints: t[a],
737
+ prevSize: s,
738
+ size: l
739
739
  });
740
- c != f && (s += c - f, o[r] = f);
740
+ l != u && (r += l - u, o[a] = u);
741
741
  }
742
- if (!D(s, 0))
743
- for (let r = 0; r < t.length; r++) {
744
- const a = o[r];
745
- C(a != null, `No layout data found for index ${r}`);
746
- const c = a + s, f = Z({
742
+ if (!I(r, 0))
743
+ for (let a = 0; a < t.length; a++) {
744
+ const s = o[a];
745
+ C(s != null, `No layout data found for index ${a}`);
746
+ const l = s + r, u = Z({
747
747
  overrideDisabledPanels: !0,
748
- panelConstraints: t[r],
749
- prevSize: a,
750
- size: c
748
+ panelConstraints: t[a],
749
+ prevSize: s,
750
+ size: l
751
751
  });
752
- if (a !== f && (s -= f - a, o[r] = f, D(s, 0)))
752
+ if (s !== u && (r -= u - s, o[a] = u, I(r, 0)))
753
753
  break;
754
754
  }
755
- const l = Object.keys(e);
756
- return o.reduce((r, a, c) => (r[l[c]] = a, r), {});
755
+ const f = Object.keys(e);
756
+ return o.reduce((a, s, l) => (a[f[l]] = s, a), {});
757
757
  }
758
758
  function tt({
759
759
  groupId: e,
760
760
  panelId: t
761
761
  }) {
762
762
  const n = () => {
763
- const r = X();
763
+ const s = X();
764
764
  for (const [
765
- a,
765
+ l,
766
766
  {
767
- defaultLayoutDeferred: c,
768
- derivedPanelConstraints: f,
769
- layout: g,
770
- groupSize: d,
771
- separatorToPanels: b
767
+ defaultLayoutDeferred: u,
768
+ derivedPanelConstraints: h,
769
+ layout: d,
770
+ groupSize: S,
771
+ separatorToPanels: z
772
772
  }
773
- ] of r)
774
- if (a.id === e)
773
+ ] of s)
774
+ if (l.id === e)
775
775
  return {
776
- defaultLayoutDeferred: c,
777
- derivedPanelConstraints: f,
778
- group: a,
779
- groupSize: d,
780
- layout: g,
781
- separatorToPanels: b
776
+ defaultLayoutDeferred: u,
777
+ derivedPanelConstraints: h,
778
+ group: l,
779
+ groupSize: S,
780
+ layout: d,
781
+ separatorToPanels: z
782
782
  };
783
783
  throw Error(`Group ${e} not found`);
784
784
  }, o = () => {
785
- const r = n().derivedPanelConstraints.find(
786
- (a) => a.panelId === t
785
+ const s = n().derivedPanelConstraints.find(
786
+ (l) => l.panelId === t
787
787
  );
788
- if (r !== void 0)
789
- return r;
788
+ if (s !== void 0)
789
+ return s;
790
790
  throw Error(`Panel constraints not found for Panel ${t}`);
791
791
  }, i = () => {
792
- const r = n().group.panels.find((a) => a.id === t);
793
- if (r !== void 0)
794
- return r;
792
+ const s = n().group.panels.find((l) => l.id === t);
793
+ if (s !== void 0)
794
+ return s;
795
795
  throw Error(`Layout not found for Panel ${t}`);
796
- }, s = () => {
797
- const r = n().layout[t];
798
- if (r !== void 0)
799
- return r;
796
+ }, r = () => {
797
+ const s = n().layout[t];
798
+ if (s !== void 0)
799
+ return s;
800
800
  throw Error(`Layout not found for Panel ${t}`);
801
- }, l = (r) => {
802
- const a = s();
803
- if (r === a)
801
+ }, f = ({
802
+ nextSize: s,
803
+ panels: l,
804
+ prevLayout: u,
805
+ derivedPanelConstraints: h
806
+ }) => {
807
+ const d = r(), S = l.findIndex((m) => m.id === t), z = S === 0, c = S === l.length - 1;
808
+ if (c && s < d && (z || l.slice(0, S).every((m, v) => {
809
+ const b = h[v];
810
+ return b?.collapsible && I(b.collapsedSize, u[b.panelId]);
811
+ }))) {
812
+ const m = l.slice(0, S).reduce((v, b) => v + u[b.id], 0);
813
+ return {
814
+ ...u,
815
+ [t]: O(100 - m)
816
+ };
817
+ }
818
+ return le({
819
+ delta: c ? d - s : s - d,
820
+ initialLayout: u,
821
+ panelConstraints: h,
822
+ pivotIndices: c ? [S - 1, S] : [S, S + 1],
823
+ prevLayout: u,
824
+ trigger: "imperative-api"
825
+ });
826
+ }, a = (s) => {
827
+ const l = r();
828
+ if (s === l)
804
829
  return;
805
830
  const {
806
- defaultLayoutDeferred: c,
807
- derivedPanelConstraints: f,
808
- group: g,
809
- groupSize: d,
810
- layout: b,
811
- separatorToPanels: x
812
- } = n(), u = g.panels.findIndex((v) => v.id === t), p = u === g.panels.length - 1, m = le({
813
- delta: p ? a - r : r - a,
814
- initialLayout: b,
815
- panelConstraints: f,
816
- pivotIndices: p ? [u - 1, u] : [u, u + 1],
817
- prevLayout: b,
818
- trigger: "imperative-api"
819
- }), S = U({
820
- layout: m,
821
- panelConstraints: f
831
+ defaultLayoutDeferred: u,
832
+ derivedPanelConstraints: h,
833
+ group: d,
834
+ groupSize: S,
835
+ layout: z,
836
+ separatorToPanels: c
837
+ } = n(), p = f({
838
+ nextSize: s,
839
+ panels: d.panels,
840
+ prevLayout: z,
841
+ derivedPanelConstraints: h
842
+ }), m = U({
843
+ layout: p,
844
+ panelConstraints: h
822
845
  });
823
- W(b, S) || $(g, {
824
- defaultLayoutDeferred: c,
825
- derivedPanelConstraints: f,
826
- groupSize: d,
827
- layout: S,
828
- separatorToPanels: x
846
+ W(z, m) || $(d, {
847
+ defaultLayoutDeferred: u,
848
+ derivedPanelConstraints: h,
849
+ groupSize: S,
850
+ layout: m,
851
+ separatorToPanels: c
829
852
  });
830
853
  };
831
854
  return {
832
855
  collapse: () => {
833
- const { collapsible: r, collapsedSize: a } = o(), { mutableValues: c } = i(), f = s();
834
- r && f !== a && (c.expandToSize = f, l(a));
856
+ const { collapsible: s, collapsedSize: l } = o(), { mutableValues: u } = i(), h = r();
857
+ s && h !== l && (u.expandToSize = h, a(l));
835
858
  },
836
859
  expand: () => {
837
- const { collapsible: r, collapsedSize: a, minSize: c } = o(), { mutableValues: f } = i(), g = s();
838
- if (r && g === a) {
839
- let d = f.expandToSize ?? c;
840
- d === 0 && (d = 1), l(d);
860
+ const { collapsible: s, collapsedSize: l, minSize: u } = o(), { mutableValues: h } = i(), d = r();
861
+ if (s && d === l) {
862
+ let S = h.expandToSize ?? u;
863
+ S === 0 && (S = 1), a(S);
841
864
  }
842
865
  },
843
866
  getSize: () => {
844
- const { group: r } = n(), a = s(), { element: c } = i(), f = r.orientation === "horizontal" ? c.offsetWidth : c.offsetHeight;
867
+ const { group: s } = n(), l = r(), { element: u } = i(), h = s.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
845
868
  return {
846
- asPercentage: a,
847
- inPixels: f
869
+ asPercentage: l,
870
+ inPixels: h
848
871
  };
849
872
  },
850
873
  isCollapsed: () => {
851
- const { collapsible: r, collapsedSize: a } = o(), c = s();
852
- return r && D(a, c);
874
+ const { collapsible: s, collapsedSize: l } = o(), u = r();
875
+ return s && I(l, u);
853
876
  },
854
- resize: (r) => {
855
- const { group: a } = n(), { element: c } = i(), f = ne({ group: a }), g = ie({
856
- groupSize: f,
857
- panelElement: c,
858
- styleProp: r
859
- }), d = T(g / f * 100);
860
- l(d);
877
+ resize: (s) => {
878
+ const { group: l } = n(), { element: u } = i(), h = ne({ group: l }), d = ie({
879
+ groupSize: h,
880
+ panelElement: u,
881
+ styleProp: s
882
+ }), S = O(d / h * 100);
883
+ a(S);
861
884
  }
862
885
  };
863
886
  }
864
- function Oe(e) {
887
+ function Te(e) {
865
888
  if (e.defaultPrevented)
866
889
  return;
867
890
  const t = X();
868
891
  xe(e, t).forEach((o) => {
869
892
  if (o.separator && !o.separator.disableDoubleClick) {
870
893
  const i = o.panels.find(
871
- (s) => s.panelConstraints.defaultSize !== void 0
894
+ (r) => r.panelConstraints.defaultSize !== void 0
872
895
  );
873
896
  if (i) {
874
- const s = i.panelConstraints.defaultSize, l = tt({
897
+ const r = i.panelConstraints.defaultSize, f = tt({
875
898
  groupId: o.group.id,
876
899
  panelId: i.id
877
900
  });
878
- l && s !== void 0 && (l.resize(s), e.preventDefault());
901
+ f && r !== void 0 && (f.resize(r), e.preventDefault());
879
902
  }
880
903
  }
881
904
  });
@@ -908,47 +931,47 @@ function nt({
908
931
  const {
909
932
  defaultLayoutDeferred: o,
910
933
  derivedPanelConstraints: i,
911
- group: s,
912
- groupSize: l,
913
- layout: r,
914
- separatorToPanels: a
915
- } = t(), c = U({
934
+ group: r,
935
+ groupSize: f,
936
+ layout: a,
937
+ separatorToPanels: s
938
+ } = t(), l = U({
916
939
  layout: n,
917
940
  panelConstraints: i
918
941
  });
919
- return o ? r : (W(r, c) || $(s, {
942
+ return o ? a : (W(a, l) || $(r, {
920
943
  defaultLayoutDeferred: o,
921
944
  derivedPanelConstraints: i,
922
- groupSize: l,
923
- layout: c,
924
- separatorToPanels: a
925
- }), c);
945
+ groupSize: f,
946
+ layout: l,
947
+ separatorToPanels: s
948
+ }), l);
926
949
  }
927
950
  };
928
951
  }
929
952
  function B(e, t) {
930
953
  const n = pe(e), o = H(n.id, !0), i = n.separators.find(
931
- (g) => g.element === e
954
+ (h) => h.element === e
932
955
  );
933
956
  C(i, "Matching separator not found");
934
- const s = o.separatorToPanels.get(i);
935
- C(s, "Matching panels not found");
936
- const l = s.map((g) => n.panels.indexOf(g)), a = nt({ groupId: n.id }).getLayout(), c = le({
957
+ const r = o.separatorToPanels.get(i);
958
+ C(r, "Matching panels not found");
959
+ const f = r.map((h) => n.panels.indexOf(h)), s = nt({ groupId: n.id }).getLayout(), l = le({
937
960
  delta: t,
938
- initialLayout: a,
961
+ initialLayout: s,
939
962
  panelConstraints: o.derivedPanelConstraints,
940
- pivotIndices: l,
941
- prevLayout: a,
963
+ pivotIndices: f,
964
+ prevLayout: s,
942
965
  trigger: "keyboard"
943
- }), f = U({
944
- layout: c,
966
+ }), u = U({
967
+ layout: l,
945
968
  panelConstraints: o.derivedPanelConstraints
946
969
  });
947
- W(a, f) || $(n, {
970
+ W(s, u) || $(n, {
948
971
  defaultLayoutDeferred: o.defaultLayoutDeferred,
949
972
  derivedPanelConstraints: o.derivedPanelConstraints,
950
973
  groupSize: o.groupSize,
951
- layout: f,
974
+ layout: u,
952
975
  separatorToPanels: o.separatorToPanels
953
976
  });
954
977
  }
@@ -980,31 +1003,31 @@ function Ge(e) {
980
1003
  }
981
1004
  case "Enter": {
982
1005
  e.preventDefault();
983
- const o = pe(t), i = H(o.id, !0), { derivedPanelConstraints: s, layout: l, separatorToPanels: r } = i, a = o.separators.find(
1006
+ const o = pe(t), i = H(o.id, !0), { derivedPanelConstraints: r, layout: f, separatorToPanels: a } = i, s = o.separators.find(
984
1007
  (d) => d.element === t
985
1008
  );
986
- C(a, "Matching separator not found");
987
- const c = r.get(a);
988
- C(c, "Matching panels not found");
989
- const f = c[0], g = s.find(
990
- (d) => d.panelId === f.id
1009
+ C(s, "Matching separator not found");
1010
+ const l = a.get(s);
1011
+ C(l, "Matching panels not found");
1012
+ const u = l[0], h = r.find(
1013
+ (d) => d.panelId === u.id
991
1014
  );
992
- if (C(g, "Panel metadata not found"), g.collapsible) {
993
- const d = l[f.id], b = g.collapsedSize === d ? o.mutableState.expandedPanelSizes[f.id] ?? g.minSize : g.collapsedSize;
994
- B(t, b - d);
1015
+ if (C(h, "Panel metadata not found"), h.collapsible) {
1016
+ const d = f[u.id], S = h.collapsedSize === d ? o.mutableState.expandedPanelSizes[u.id] ?? h.minSize : h.collapsedSize;
1017
+ B(t, S - d);
995
1018
  }
996
1019
  break;
997
1020
  }
998
1021
  case "F6": {
999
1022
  e.preventDefault();
1000
1023
  const i = pe(t).separators.map(
1001
- (a) => a.element
1002
- ), s = Array.from(i).findIndex(
1003
- (a) => a === e.currentTarget
1024
+ (s) => s.element
1025
+ ), r = Array.from(i).findIndex(
1026
+ (s) => s === e.currentTarget
1004
1027
  );
1005
- C(s !== null, "Index not found");
1006
- const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
1007
- i[l].focus({
1028
+ C(r !== null, "Index not found");
1029
+ const f = e.shiftKey ? r > 0 ? r - 1 : i.length - 1 : r + 1 < i.length ? r + 1 : 0;
1030
+ i[f].focus({
1008
1031
  preventScroll: !0
1009
1032
  });
1010
1033
  break;
@@ -1019,23 +1042,23 @@ let ee = {
1019
1042
  cursorFlags: 0,
1020
1043
  state: "inactive"
1021
1044
  };
1022
- const we = new Ze();
1045
+ const Pe = new Ze();
1023
1046
  function K() {
1024
1047
  return ee;
1025
1048
  }
1026
1049
  function Gt(e) {
1027
- return we.addListener("change", e);
1050
+ return Pe.addListener("change", e);
1028
1051
  }
1029
1052
  function At(e) {
1030
1053
  const t = ee, n = { ...ee };
1031
- n.cursorFlags = e, ee = n, we.emit("change", {
1054
+ n.cursorFlags = e, ee = n, Pe.emit("change", {
1032
1055
  prev: t,
1033
1056
  next: n
1034
1057
  });
1035
1058
  }
1036
1059
  function te(e) {
1037
1060
  const t = ee;
1038
- ee = e, we.emit("change", {
1061
+ ee = e, Pe.emit("change", {
1039
1062
  prev: t,
1040
1063
  next: e
1041
1064
  });
@@ -1047,12 +1070,14 @@ function Ae(e) {
1047
1070
  return;
1048
1071
  const t = X(), n = xe(e, t), o = /* @__PURE__ */ new Map();
1049
1072
  let i = !1;
1050
- n.forEach((s) => {
1051
- s.separator && (i || (i = !0, s.separator.element.focus({
1073
+ n.forEach((r) => {
1074
+ r.separator && (i || (i = !0, r.separator.element.focus({
1075
+ // @ts-expect-error https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/focus#browser_compatibility
1076
+ focusVisible: !1,
1052
1077
  preventScroll: !0
1053
1078
  })));
1054
- const l = t.get(s.group);
1055
- l && o.set(s.group, l.layout);
1079
+ const f = t.get(r.group);
1080
+ f && o.set(r.group, f.layout);
1056
1081
  }), te({
1057
1082
  cursorFlags: 0,
1058
1083
  hitRegions: n,
@@ -1076,9 +1101,9 @@ function Nt({
1076
1101
  switch (n) {
1077
1102
  case "active":
1078
1103
  case "hover":
1079
- t.forEach((s) => {
1080
- if (!s.mutableState.disableCursor)
1081
- switch (s.orientation) {
1104
+ t.forEach((r) => {
1105
+ if (!r.mutableState.disableCursor)
1106
+ switch (r.orientation) {
1082
1107
  case "horizontal": {
1083
1108
  o++;
1084
1109
  break;
@@ -1094,14 +1119,14 @@ function Nt({
1094
1119
  switch (n) {
1095
1120
  case "active": {
1096
1121
  if (e && _e()) {
1097
- const s = (e & ot) !== 0, l = (e & it) !== 0, r = (e & rt) !== 0, a = (e & st) !== 0;
1098
- if (s)
1099
- return r ? "se-resize" : a ? "ne-resize" : "e-resize";
1100
- if (l)
1101
- return r ? "sw-resize" : a ? "nw-resize" : "w-resize";
1122
+ const r = (e & ot) !== 0, f = (e & it) !== 0, a = (e & rt) !== 0, s = (e & st) !== 0;
1102
1123
  if (r)
1103
- return "s-resize";
1124
+ return a ? "se-resize" : s ? "ne-resize" : "e-resize";
1125
+ if (f)
1126
+ return a ? "sw-resize" : s ? "nw-resize" : "w-resize";
1104
1127
  if (a)
1128
+ return "s-resize";
1129
+ if (s)
1105
1130
  return "n-resize";
1106
1131
  }
1107
1132
  break;
@@ -1111,23 +1136,26 @@ function Nt({
1111
1136
  }
1112
1137
  }
1113
1138
  const $e = /* @__PURE__ */ new WeakMap();
1114
- function Pe(e) {
1139
+ function we(e) {
1115
1140
  if (e.defaultView === null || e.defaultView === void 0)
1116
1141
  return;
1117
1142
  let { prevStyle: t, styleSheet: n } = $e.get(e) ?? {};
1118
- n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
1143
+ n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && (Object.isExtensible(e.adoptedStyleSheets) ? e.adoptedStyleSheets.push(n) : e.adoptedStyleSheets = [
1144
+ ...e.adoptedStyleSheets,
1145
+ n
1146
+ ]));
1119
1147
  const o = K();
1120
1148
  switch (o.state) {
1121
1149
  case "active":
1122
1150
  case "hover": {
1123
1151
  const i = Nt({
1124
1152
  cursorFlags: o.cursorFlags,
1125
- groups: o.hitRegions.map((l) => l.group),
1153
+ groups: o.hitRegions.map((f) => f.group),
1126
1154
  state: o.state
1127
- }), s = `*, *:hover {cursor: ${i} !important; }`;
1128
- if (t === s)
1155
+ }), r = `*, *:hover {cursor: ${i} !important; }`;
1156
+ if (t === r)
1129
1157
  return;
1130
- t = s, i ? n.cssRules.length === 0 ? n.insertRule(s) : n.replaceSync(s) : n.cssRules.length === 1 && n.deleteRule(0);
1158
+ t = r, i ? n.cssRules.length === 0 ? n.insertRule(r) : n.replaceSync(r) : n.cssRules.length === 1 && n.deleteRule(0);
1131
1159
  break;
1132
1160
  }
1133
1161
  case "inactive": {
@@ -1146,57 +1174,57 @@ function at({
1146
1174
  hitRegions: n,
1147
1175
  initialLayoutMap: o,
1148
1176
  mountedGroups: i,
1149
- pointerDownAtPoint: s,
1150
- prevCursorFlags: l
1177
+ pointerDownAtPoint: r,
1178
+ prevCursorFlags: f
1151
1179
  }) {
1152
- let r = 0;
1153
- n.forEach((c) => {
1154
- const { group: f, groupSize: g } = c, { orientation: d, panels: b } = f, { disableCursor: x } = f.mutableState;
1155
- let u = 0;
1156
- s ? d === "horizontal" ? u = (t.clientX - s.x) / g * 100 : u = (t.clientY - s.y) / g * 100 : d === "horizontal" ? u = t.clientX < 0 ? -100 : 100 : u = t.clientY < 0 ? -100 : 100;
1157
- const p = o.get(f), m = i.get(f);
1180
+ let a = 0;
1181
+ n.forEach((l) => {
1182
+ const { group: u, groupSize: h } = l, { orientation: d, panels: S } = u, { disableCursor: z } = u.mutableState;
1183
+ let c = 0;
1184
+ r ? d === "horizontal" ? c = (t.clientX - r.x) / h * 100 : c = (t.clientY - r.y) / h * 100 : d === "horizontal" ? c = t.clientX < 0 ? -100 : 100 : c = t.clientY < 0 ? -100 : 100;
1185
+ const p = o.get(u), m = i.get(u);
1158
1186
  if (!p || !m)
1159
1187
  return;
1160
1188
  const {
1161
- defaultLayoutDeferred: S,
1162
- derivedPanelConstraints: v,
1189
+ defaultLayoutDeferred: v,
1190
+ derivedPanelConstraints: b,
1163
1191
  groupSize: y,
1164
- layout: h,
1165
- separatorToPanels: w
1192
+ layout: g,
1193
+ separatorToPanels: P
1166
1194
  } = m;
1167
- if (v && h && w) {
1195
+ if (b && g && P) {
1168
1196
  const M = le({
1169
- delta: u,
1197
+ delta: c,
1170
1198
  initialLayout: p,
1171
- panelConstraints: v,
1172
- pivotIndices: c.panels.map((P) => b.indexOf(P)),
1173
- prevLayout: h,
1199
+ panelConstraints: b,
1200
+ pivotIndices: l.panels.map((w) => S.indexOf(w)),
1201
+ prevLayout: g,
1174
1202
  trigger: "mouse-or-touch"
1175
1203
  });
1176
- if (W(M, h)) {
1177
- if (u !== 0 && !x)
1204
+ if (W(M, g)) {
1205
+ if (c !== 0 && !z)
1178
1206
  switch (d) {
1179
1207
  case "horizontal": {
1180
- r |= u < 0 ? ot : it;
1208
+ a |= c < 0 ? ot : it;
1181
1209
  break;
1182
1210
  }
1183
1211
  case "vertical": {
1184
- r |= u < 0 ? rt : st;
1212
+ a |= c < 0 ? rt : st;
1185
1213
  break;
1186
1214
  }
1187
1215
  }
1188
1216
  } else
1189
- $(c.group, {
1190
- defaultLayoutDeferred: S,
1191
- derivedPanelConstraints: v,
1217
+ $(l.group, {
1218
+ defaultLayoutDeferred: v,
1219
+ derivedPanelConstraints: b,
1192
1220
  groupSize: y,
1193
1221
  layout: M,
1194
- separatorToPanels: w
1222
+ separatorToPanels: P
1195
1223
  });
1196
1224
  }
1197
1225
  });
1198
- let a = 0;
1199
- t.movementX === 0 ? a |= l & Fe : a |= r & Fe, t.movementY === 0 ? a |= l & Ne : a |= r & Ne, At(a), Pe(e);
1226
+ let s = 0;
1227
+ t.movementX === 0 ? s |= f & Fe : s |= a & Fe, t.movementY === 0 ? s |= f & Ne : s |= a & Ne, At(s), we(e);
1200
1228
  }
1201
1229
  function je(e) {
1202
1230
  const t = X(), n = K();
@@ -1256,7 +1284,7 @@ function He(e) {
1256
1284
  cursorFlags: 0,
1257
1285
  hitRegions: o,
1258
1286
  state: "hover"
1259
- }), Pe(e.currentTarget);
1287
+ }), we(e.currentTarget);
1260
1288
  break;
1261
1289
  }
1262
1290
  }
@@ -1282,7 +1310,7 @@ function Be(e) {
1282
1310
  te({
1283
1311
  cursorFlags: 0,
1284
1312
  state: "inactive"
1285
- }), t.hitRegions.length > 0 && (Pe(e.currentTarget), t.hitRegions.forEach((n) => {
1313
+ }), t.hitRegions.length > 0 && (we(e.currentTarget), t.hitRegions.forEach((n) => {
1286
1314
  const o = H(n.group.id, !0);
1287
1315
  $(n.group, o);
1288
1316
  }), e.preventDefault());
@@ -1291,32 +1319,32 @@ function Be(e) {
1291
1319
  function We(e) {
1292
1320
  let t = 0, n = 0;
1293
1321
  const o = {};
1294
- for (const s of e)
1295
- if (s.defaultSize !== void 0) {
1322
+ for (const r of e)
1323
+ if (r.defaultSize !== void 0) {
1296
1324
  t++;
1297
- const l = T(s.defaultSize);
1298
- n += l, o[s.panelId] = l;
1325
+ const f = O(r.defaultSize);
1326
+ n += f, o[r.panelId] = f;
1299
1327
  } else
1300
- o[s.panelId] = void 0;
1328
+ o[r.panelId] = void 0;
1301
1329
  const i = e.length - t;
1302
1330
  if (i !== 0) {
1303
- const s = T((100 - n) / i);
1304
- for (const l of e)
1305
- l.defaultSize === void 0 && (o[l.panelId] = s);
1331
+ const r = O((100 - n) / i);
1332
+ for (const f of e)
1333
+ f.defaultSize === void 0 && (o[f.panelId] = r);
1306
1334
  }
1307
1335
  return o;
1308
1336
  }
1309
1337
  function _t(e, t, n) {
1310
1338
  if (!n[0])
1311
1339
  return;
1312
- const i = e.panels.find((c) => c.element === t);
1340
+ const i = e.panels.find((l) => l.element === t);
1313
1341
  if (!i || !i.onResize)
1314
1342
  return;
1315
- const s = ne({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
1316
- asPercentage: T(l / s * 100),
1317
- inPixels: l
1343
+ const r = ne({ group: e }), f = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, a = i.mutableValues.prevSize, s = {
1344
+ asPercentage: O(f / r * 100),
1345
+ inPixels: f
1318
1346
  };
1319
- i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
1347
+ i.mutableValues.prevSize = s, i.onResize(s, i.id, a);
1320
1348
  }
1321
1349
  function $t(e, t) {
1322
1350
  if (Object.keys(e).length !== Object.keys(t).length)
@@ -1334,46 +1362,46 @@ function jt({
1334
1362
  }) {
1335
1363
  if (n <= 0 || t <= 0 || n === t)
1336
1364
  return o;
1337
- let i = 0, s = 0, l = !1;
1338
- const r = /* @__PURE__ */ new Map(), a = [];
1339
- for (const g of e.panels) {
1340
- const d = o[g.id] ?? 0;
1341
- switch (g.panelConstraints.groupResizeBehavior) {
1365
+ let i = 0, r = 0, f = !1;
1366
+ const a = /* @__PURE__ */ new Map(), s = [];
1367
+ for (const h of e.panels) {
1368
+ const d = o[h.id] ?? 0;
1369
+ switch (h.panelConstraints.groupResizeBehavior) {
1342
1370
  case "preserve-pixel-size": {
1343
- l = !0;
1344
- const b = d / 100 * n, x = T(
1345
- b / t * 100
1371
+ f = !0;
1372
+ const S = d / 100 * n, z = O(
1373
+ S / t * 100
1346
1374
  );
1347
- r.set(g.id, x), i += x;
1375
+ a.set(h.id, z), i += z;
1348
1376
  break;
1349
1377
  }
1350
1378
  case "preserve-relative-size":
1351
1379
  default: {
1352
- a.push(g.id), s += d;
1380
+ s.push(h.id), r += d;
1353
1381
  break;
1354
1382
  }
1355
1383
  }
1356
1384
  }
1357
- if (!l || a.length === 0)
1385
+ if (!f || s.length === 0)
1358
1386
  return o;
1359
- const c = 100 - i, f = { ...o };
1360
- if (r.forEach((g, d) => {
1361
- f[d] = g;
1362
- }), s > 0)
1363
- for (const g of a) {
1364
- const d = o[g] ?? 0;
1365
- f[g] = T(
1366
- d / s * c
1387
+ const l = 100 - i, u = { ...o };
1388
+ if (a.forEach((h, d) => {
1389
+ u[d] = h;
1390
+ }), r > 0)
1391
+ for (const h of s) {
1392
+ const d = o[h] ?? 0;
1393
+ u[h] = O(
1394
+ d / r * l
1367
1395
  );
1368
1396
  }
1369
1397
  else {
1370
- const g = T(
1371
- c / a.length
1398
+ const h = O(
1399
+ l / s.length
1372
1400
  );
1373
- for (const d of a)
1374
- f[d] = g;
1401
+ for (const d of s)
1402
+ u[d] = h;
1375
1403
  }
1376
- return f;
1404
+ return u;
1377
1405
  }
1378
1406
  function Ht(e, t) {
1379
1407
  const n = e.map((i) => i.id), o = Object.keys(t);
@@ -1391,75 +1419,75 @@ function Vt(e) {
1391
1419
  e.element.ownerDocument.defaultView,
1392
1420
  "Cannot register an unmounted Group"
1393
1421
  );
1394
- const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((u) => {
1395
- for (const p of u) {
1396
- const { borderBoxSize: m, target: S } = p;
1397
- if (S === e.element) {
1422
+ const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), r = new n((c) => {
1423
+ for (const p of c) {
1424
+ const { borderBoxSize: m, target: v } = p;
1425
+ if (v === e.element) {
1398
1426
  if (t) {
1399
- const v = ne({ group: e });
1400
- if (v === 0)
1427
+ const b = ne({ group: e });
1428
+ if (b === 0)
1401
1429
  return;
1402
1430
  const y = H(e.id);
1403
1431
  if (!y)
1404
1432
  return;
1405
- const h = ve(e), w = y.defaultLayoutDeferred ? We(h) : y.layout, M = jt({
1433
+ const g = ve(e), P = y.defaultLayoutDeferred ? We(g) : y.layout, M = jt({
1406
1434
  group: e,
1407
- nextGroupSize: v,
1435
+ nextGroupSize: b,
1408
1436
  prevGroupSize: y.groupSize,
1409
- prevLayout: w
1410
- }), P = U({
1437
+ prevLayout: P
1438
+ }), w = U({
1411
1439
  layout: M,
1412
- panelConstraints: h
1440
+ panelConstraints: g
1413
1441
  });
1414
- if (!y.defaultLayoutDeferred && W(y.layout, P) && $t(
1442
+ if (!y.defaultLayoutDeferred && W(y.layout, w) && $t(
1415
1443
  y.derivedPanelConstraints,
1416
- h
1417
- ) && y.groupSize === v)
1444
+ g
1445
+ ) && y.groupSize === b)
1418
1446
  return;
1419
1447
  $(e, {
1420
1448
  defaultLayoutDeferred: !1,
1421
- derivedPanelConstraints: h,
1422
- groupSize: v,
1423
- layout: P,
1449
+ derivedPanelConstraints: g,
1450
+ groupSize: b,
1451
+ layout: w,
1424
1452
  separatorToPanels: y.separatorToPanels
1425
1453
  });
1426
1454
  }
1427
1455
  } else
1428
- _t(e, S, m);
1456
+ _t(e, v, m);
1429
1457
  }
1430
1458
  });
1431
- s.observe(e.element), e.panels.forEach((u) => {
1459
+ r.observe(e.element), e.panels.forEach((c) => {
1432
1460
  C(
1433
- !o.has(u.id),
1434
- `Panel ids must be unique; id "${u.id}" was used more than once`
1435
- ), o.add(u.id), u.onResize && s.observe(u.element);
1461
+ !o.has(c.id),
1462
+ `Panel ids must be unique; id "${c.id}" was used more than once`
1463
+ ), o.add(c.id), c.onResize && r.observe(c.element);
1436
1464
  });
1437
- const l = ne({ group: e }), r = ve(e), a = e.panels.map(({ id: u }) => u).join(",");
1438
- let c = e.mutableState.defaultLayout;
1439
- c && (Ht(e.panels, c) || (c = void 0));
1440
- const f = e.mutableState.layouts[a] ?? c ?? We(r), g = U({
1441
- layout: f,
1442
- panelConstraints: r
1465
+ const f = ne({ group: e }), a = ve(e), s = e.panels.map(({ id: c }) => c).join(",");
1466
+ let l = e.mutableState.defaultLayout;
1467
+ l && (Ht(e.panels, l) || (l = void 0));
1468
+ const u = e.mutableState.layouts[s] ?? l ?? We(a), h = U({
1469
+ layout: u,
1470
+ panelConstraints: a
1443
1471
  }), d = e.element.ownerDocument;
1444
1472
  J.set(
1445
1473
  d,
1446
1474
  (J.get(d) ?? 0) + 1
1447
1475
  );
1448
- const b = /* @__PURE__ */ new Map();
1449
- return Je(e).forEach((u) => {
1450
- u.separator && b.set(u.separator, u.panels);
1476
+ const S = /* @__PURE__ */ new Map();
1477
+ return Je(e).forEach((c) => {
1478
+ c.separator && S.set(c.separator, c.panels);
1451
1479
  }), $(e, {
1452
- defaultLayoutDeferred: l === 0,
1453
- derivedPanelConstraints: r,
1454
- groupSize: l,
1455
- layout: g,
1456
- separatorToPanels: b
1457
- }), e.separators.forEach((u) => {
1480
+ defaultLayoutDeferred: f === 0,
1481
+ derivedPanelConstraints: a,
1482
+ groupSize: f,
1483
+ layout: h,
1484
+ separatorToPanels: S
1485
+ }), e.separators.forEach((c) => {
1458
1486
  C(
1459
- !i.has(u.id),
1460
- `Separator ids must be unique; id "${u.id}" was used more than once`
1461
- ), i.add(u.id), u.element.addEventListener("keydown", Ge);
1462
- }), J.get(d) === 1 && (d.addEventListener("dblclick", Oe, !0), d.addEventListener("pointerdown", Ae, !0), d.addEventListener("pointerleave", je), d.addEventListener("pointermove", He), d.addEventListener("pointerout", Ve), d.addEventListener("pointerup", Be, !0)), function() {
1487
+ !i.has(c.id),
1488
+ `Separator ids must be unique; id "${c.id}" was used more than once`
1489
+ ), i.add(c.id), c.element.addEventListener("keydown", Ge);
1490
+ }), J.get(d) === 1 && (d.addEventListener("dblclick", Te, !0), d.addEventListener("pointerdown", Ae, !0), d.addEventListener("pointerleave", je), d.addEventListener("pointermove", He), d.addEventListener("pointerout", Ve), d.addEventListener("pointerup", Be, !0)), function() {
1463
1491
  t = !1, J.set(
1464
1492
  d,
1465
1493
  Math.max(0, (J.get(d) ?? 0) - 1)
@@ -1467,13 +1495,13 @@ function Vt(e) {
1467
1495
  p.element.removeEventListener("keydown", Ge);
1468
1496
  }), J.get(d) || (d.removeEventListener(
1469
1497
  "dblclick",
1470
- Oe,
1498
+ Te,
1471
1499
  !0
1472
1500
  ), d.removeEventListener(
1473
1501
  "pointerdown",
1474
1502
  Ae,
1475
1503
  !0
1476
- ), d.removeEventListener("pointerleave", je), d.removeEventListener("pointermove", He), d.removeEventListener("pointerout", Ve), d.removeEventListener("pointerup", Be, !0)), s.disconnect();
1504
+ ), d.removeEventListener("pointerleave", je), d.removeEventListener("pointermove", He), d.removeEventListener("pointerout", Ve), d.removeEventListener("pointerup", Be, !0)), r.disconnect();
1477
1505
  };
1478
1506
  }
1479
1507
  function Bt() {
@@ -1486,7 +1514,7 @@ function Le(e) {
1486
1514
  }
1487
1515
  const q = typeof window < "u" ? Ue : me;
1488
1516
  function se(e) {
1489
- const t = O(e);
1517
+ const t = T(e);
1490
1518
  return q(() => {
1491
1519
  t.current = e;
1492
1520
  }, [e]), re(
@@ -1512,7 +1540,7 @@ function Ce(...e) {
1512
1540
  });
1513
1541
  }
1514
1542
  function Re(e) {
1515
- const t = O({ ...e });
1543
+ const t = T({ ...e });
1516
1544
  return q(() => {
1517
1545
  for (const n in e)
1518
1546
  t.current[n] = e[n];
@@ -1520,7 +1548,7 @@ function Re(e) {
1520
1548
  }
1521
1549
  const lt = ht(null);
1522
1550
  function Wt(e, t) {
1523
- const n = O({
1551
+ const n = T({
1524
1552
  getLayout: () => ({}),
1525
1553
  setLayout: Ft
1526
1554
  });
@@ -1537,42 +1565,42 @@ function Ut({
1537
1565
  defaultLayout: n,
1538
1566
  disableCursor: o,
1539
1567
  disabled: i,
1540
- elementRef: s,
1541
- groupRef: l,
1542
- id: r,
1543
- onLayoutChange: a,
1544
- onLayoutChanged: c,
1545
- orientation: f = "horizontal",
1546
- resizeTargetMinimumSize: g = {
1568
+ elementRef: r,
1569
+ groupRef: f,
1570
+ id: a,
1571
+ onLayoutChange: s,
1572
+ onLayoutChanged: l,
1573
+ orientation: u = "horizontal",
1574
+ resizeTargetMinimumSize: h = {
1547
1575
  coarse: 20,
1548
1576
  fine: 10
1549
1577
  },
1550
1578
  style: d,
1551
- ...b
1579
+ ...S
1552
1580
  }) {
1553
- const x = O({
1581
+ const z = T({
1554
1582
  onLayoutChange: {},
1555
1583
  onLayoutChanged: {}
1556
- }), u = se((z) => {
1557
- W(x.current.onLayoutChange, z) || (x.current.onLayoutChange = z, a?.(z));
1558
- }), p = se((z) => {
1559
- W(x.current.onLayoutChanged, z) || (x.current.onLayoutChanged = z, c?.(z));
1560
- }), m = Le(r), S = O(null), [v, y] = Bt(), h = O({
1584
+ }), c = se((x) => {
1585
+ W(z.current.onLayoutChange, x) || (z.current.onLayoutChange = x, s?.(x));
1586
+ }), p = se((x) => {
1587
+ W(z.current.onLayoutChanged, x) || (z.current.onLayoutChanged = x, l?.(x));
1588
+ }), m = Le(a), v = T(null), [b, y] = Bt(), g = T({
1561
1589
  lastExpandedPanelSizes: {},
1562
1590
  layouts: {},
1563
1591
  panels: [],
1564
- resizeTargetMinimumSize: g,
1592
+ resizeTargetMinimumSize: h,
1565
1593
  separators: []
1566
- }), w = Ce(S, s);
1567
- Wt(m, l);
1594
+ }), P = Ce(v, r);
1595
+ Wt(m, f);
1568
1596
  const M = se(
1569
- (z, L) => {
1570
- const k = K(), R = ke(z), E = H(z);
1597
+ (x, L) => {
1598
+ const k = K(), R = ke(x), E = H(x);
1571
1599
  if (E) {
1572
- let I = !1;
1600
+ let D = !1;
1573
1601
  switch (k.state) {
1574
1602
  case "active": {
1575
- I = k.hitRegions.some(
1603
+ D = k.hitRegions.some(
1576
1604
  (V) => V.group === R
1577
1605
  );
1578
1606
  break;
@@ -1580,7 +1608,7 @@ function Ut({
1580
1608
  }
1581
1609
  return {
1582
1610
  flexGrow: E.layout[L] ?? 1,
1583
- pointerEvents: I ? "none" : void 0
1611
+ pointerEvents: D ? "none" : void 0
1584
1612
  };
1585
1613
  }
1586
1614
  if (n?.[L])
@@ -1588,93 +1616,93 @@ function Ut({
1588
1616
  flexGrow: n?.[L]
1589
1617
  };
1590
1618
  }
1591
- ), P = Re({
1619
+ ), w = Re({
1592
1620
  defaultLayout: n,
1593
1621
  disableCursor: o
1594
1622
  }), G = Se(
1595
1623
  () => ({
1596
1624
  get disableCursor() {
1597
- return !!P.disableCursor;
1625
+ return !!w.disableCursor;
1598
1626
  },
1599
1627
  getPanelStyles: M,
1600
1628
  id: m,
1601
- orientation: f,
1602
- registerPanel: (z) => {
1603
- const L = h.current;
1604
- return L.panels = be(f, [
1629
+ orientation: u,
1630
+ registerPanel: (x) => {
1631
+ const L = g.current;
1632
+ return L.panels = be(u, [
1605
1633
  ...L.panels,
1606
- z
1634
+ x
1607
1635
  ]), y(), () => {
1608
1636
  L.panels = L.panels.filter(
1609
- (k) => k !== z
1637
+ (k) => k !== x
1610
1638
  ), y();
1611
1639
  };
1612
1640
  },
1613
- registerSeparator: (z) => {
1614
- const L = h.current;
1615
- return L.separators = be(f, [
1641
+ registerSeparator: (x) => {
1642
+ const L = g.current;
1643
+ return L.separators = be(u, [
1616
1644
  ...L.separators,
1617
- z
1645
+ x
1618
1646
  ]), y(), () => {
1619
1647
  L.separators = L.separators.filter(
1620
- (k) => k !== z
1648
+ (k) => k !== x
1621
1649
  ), y();
1622
1650
  };
1623
1651
  },
1624
- updatePanelProps: (z, { disabled: L }) => {
1625
- const R = h.current.panels.find(
1626
- (V) => V.id === z
1652
+ updatePanelProps: (x, { disabled: L }) => {
1653
+ const R = g.current.panels.find(
1654
+ (V) => V.id === x
1627
1655
  );
1628
1656
  R && (R.panelConstraints.disabled = L);
1629
- const E = ke(m), I = H(m);
1630
- E && I && $(E, {
1631
- ...I,
1657
+ const E = ke(m), D = H(m);
1658
+ E && D && $(E, {
1659
+ ...D,
1632
1660
  derivedPanelConstraints: ve(E)
1633
1661
  });
1634
1662
  },
1635
- updateSeparatorProps: (z, {
1663
+ updateSeparatorProps: (x, {
1636
1664
  disabled: L,
1637
1665
  disableDoubleClick: k
1638
1666
  }) => {
1639
- const E = h.current.separators.find(
1640
- (I) => I.id === z
1667
+ const E = g.current.separators.find(
1668
+ (D) => D.id === x
1641
1669
  );
1642
1670
  E && (E.disabled = L, E.disableDoubleClick = k);
1643
1671
  }
1644
1672
  }),
1645
- [M, m, y, f, P]
1646
- ), N = O(null);
1673
+ [M, m, y, u, w]
1674
+ ), N = T(null);
1647
1675
  return q(() => {
1648
- const z = S.current;
1649
- if (z === null)
1676
+ const x = v.current;
1677
+ if (x === null)
1650
1678
  return;
1651
- const L = h.current;
1679
+ const L = g.current;
1652
1680
  let k;
1653
- if (P.defaultLayout !== void 0 && Object.keys(P.defaultLayout).length === L.panels.length) {
1681
+ if (w.defaultLayout !== void 0 && Object.keys(w.defaultLayout).length === L.panels.length) {
1654
1682
  k = {};
1655
1683
  for (const j of L.panels) {
1656
- const Y = P.defaultLayout[j.id];
1684
+ const Y = w.defaultLayout[j.id];
1657
1685
  Y !== void 0 && (k[j.id] = Y);
1658
1686
  }
1659
1687
  }
1660
1688
  const R = {
1661
1689
  disabled: !!i,
1662
- element: z,
1690
+ element: x,
1663
1691
  id: m,
1664
1692
  mutableState: {
1665
1693
  defaultLayout: k,
1666
- disableCursor: !!P.disableCursor,
1667
- expandedPanelSizes: h.current.lastExpandedPanelSizes,
1668
- layouts: h.current.layouts
1694
+ disableCursor: !!w.disableCursor,
1695
+ expandedPanelSizes: g.current.lastExpandedPanelSizes,
1696
+ layouts: g.current.layouts
1669
1697
  },
1670
- orientation: f,
1698
+ orientation: u,
1671
1699
  panels: L.panels,
1672
1700
  resizeTargetMinimumSize: L.resizeTargetMinimumSize,
1673
1701
  separators: L.separators
1674
1702
  };
1675
1703
  N.current = R;
1676
- const E = Vt(R), { defaultLayoutDeferred: I, derivedPanelConstraints: V, layout: ue } = H(R.id, !0);
1677
- !I && V.length > 0 && (u(ue), p(ue));
1704
+ const E = Vt(R), { defaultLayoutDeferred: D, derivedPanelConstraints: V, layout: ue } = H(R.id, !0);
1705
+ !D && V.length > 0 && (c(ue), p(ue));
1678
1706
  const oe = ze(m, (j) => {
1679
1707
  const { defaultLayoutDeferred: Y, derivedPanelConstraints: Ee, layout: ce } = j.next;
1680
1708
  if (Y || Ee.length === 0)
@@ -1684,10 +1712,10 @@ function Ut({
1684
1712
  if (_.collapsible) {
1685
1713
  const { layout: ge } = j.prev ?? {};
1686
1714
  if (ge) {
1687
- const ft = D(
1715
+ const ft = I(
1688
1716
  _.collapsedSize,
1689
1717
  ce[_.panelId]
1690
- ), dt = D(
1718
+ ), dt = I(
1691
1719
  _.collapsedSize,
1692
1720
  ge[_.panelId]
1693
1721
  );
@@ -1696,7 +1724,7 @@ function Ut({
1696
1724
  }
1697
1725
  });
1698
1726
  const ct = K().state !== "active";
1699
- u(ce), ct && p(ce);
1727
+ c(ce), ct && p(ce);
1700
1728
  });
1701
1729
  return () => {
1702
1730
  N.current = null, E(), oe();
@@ -1705,35 +1733,35 @@ function Ut({
1705
1733
  i,
1706
1734
  m,
1707
1735
  p,
1736
+ c,
1708
1737
  u,
1709
- f,
1710
- v,
1711
- P
1738
+ b,
1739
+ w
1712
1740
  ]), me(() => {
1713
- const z = N.current;
1714
- z && (z.mutableState.defaultLayout = n, z.mutableState.disableCursor = !!o);
1741
+ const x = N.current;
1742
+ x && (x.mutableState.defaultLayout = n, x.mutableState.disableCursor = !!o);
1715
1743
  }), /* @__PURE__ */ ae(lt.Provider, { value: G, children: /* @__PURE__ */ ae(
1716
1744
  "div",
1717
1745
  {
1718
- ...b,
1746
+ ...S,
1719
1747
  className: t,
1720
1748
  "data-group": !0,
1721
1749
  "data-testid": m,
1722
1750
  id: m,
1723
- ref: w,
1751
+ ref: P,
1724
1752
  style: {
1725
1753
  height: "100%",
1726
1754
  width: "100%",
1727
1755
  overflow: "hidden",
1728
1756
  ...d,
1729
1757
  display: "flex",
1730
- flexDirection: f === "horizontal" ? "row" : "column",
1758
+ flexDirection: u === "horizontal" ? "row" : "column",
1731
1759
  flexWrap: "nowrap",
1732
1760
  // Inform the browser that the library is handling touch events for this element
1733
1761
  // but still allow users to scroll content within panels in the non-resizing direction
1734
1762
  // NOTE This is not an inherited style
1735
1763
  // See github.com/bvaughn/react-resizable-panels/issues/662
1736
- touchAction: f === "horizontal" ? "pan-y" : "pan-x"
1764
+ touchAction: u === "horizontal" ? "pan-y" : "pan-x"
1737
1765
  },
1738
1766
  children: e
1739
1767
  }
@@ -1751,26 +1779,26 @@ function Kt({
1751
1779
  const o = he(e, []), i = n.getItem(o);
1752
1780
  if (i)
1753
1781
  try {
1754
- const s = JSON.parse(i);
1782
+ const r = JSON.parse(i);
1755
1783
  if (t) {
1756
- const l = t.join(","), r = s[l];
1757
- if (r && Array.isArray(r.layout) && t.length === r.layout.length) {
1758
- const a = {};
1759
- for (let c = 0; c < t.length; c++)
1760
- a[t[c]] = r.layout[c];
1761
- return a;
1784
+ const f = t.join(","), a = r[f];
1785
+ if (a && Array.isArray(a.layout) && t.length === a.layout.length) {
1786
+ const s = {};
1787
+ for (let l = 0; l < t.length; l++)
1788
+ s[t[l]] = a.layout[l];
1789
+ return s;
1762
1790
  }
1763
1791
  } else {
1764
- const l = Object.keys(s);
1765
- if (l.length === 1) {
1766
- const r = s[l[0]];
1767
- if (r && Array.isArray(r.layout)) {
1768
- const a = l[0].split(",");
1769
- if (a.length === r.layout.length) {
1770
- const c = {};
1771
- for (let f = 0; f < a.length; f++)
1772
- c[a[f]] = r.layout[f];
1773
- return c;
1792
+ const f = Object.keys(r);
1793
+ if (f.length === 1) {
1794
+ const a = r[f[0]];
1795
+ if (a && Array.isArray(a.layout)) {
1796
+ const s = f[0].split(",");
1797
+ if (s.length === a.layout.length) {
1798
+ const l = {};
1799
+ for (let u = 0; u < s.length; u++)
1800
+ l[s[u]] = a.layout[u];
1801
+ return l;
1774
1802
  }
1775
1803
  }
1776
1804
  }
@@ -1784,65 +1812,65 @@ function on({
1784
1812
  storage: n = localStorage,
1785
1813
  ...o
1786
1814
  }) {
1787
- const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = he(s, t ?? []), r = Xe(
1815
+ const i = t !== void 0, r = "id" in o ? o.id : o.groupId, f = he(r, t ?? []), a = Xe(
1788
1816
  Xt,
1789
- () => n.getItem(l),
1790
- () => n.getItem(l)
1791
- ), a = Se(() => {
1792
- if (r) {
1793
- const u = JSON.parse(r), p = Object.values(u);
1817
+ () => n.getItem(f),
1818
+ () => n.getItem(f)
1819
+ ), s = Se(() => {
1820
+ if (a) {
1821
+ const c = JSON.parse(a), p = Object.values(c);
1794
1822
  if (Array.from(p).every((m) => typeof m == "number"))
1795
- return u;
1823
+ return c;
1796
1824
  }
1797
- }, [r]), c = Se(() => {
1798
- if (!a)
1825
+ }, [a]), l = Se(() => {
1826
+ if (!s)
1799
1827
  return Kt({
1800
- id: s,
1828
+ id: r,
1801
1829
  panelIds: t,
1802
1830
  storage: n
1803
1831
  });
1804
- }, [a, s, t, n]), f = a ?? c, g = O(null), d = re(() => {
1805
- const u = g.current;
1806
- u && (g.current = null, clearTimeout(u));
1832
+ }, [s, r, t, n]), u = s ?? l, h = T(null), d = re(() => {
1833
+ const c = h.current;
1834
+ c && (h.current = null, clearTimeout(c));
1807
1835
  }, []);
1808
1836
  Ue(() => () => {
1809
1837
  d();
1810
1838
  }, [d]);
1811
- const b = re(
1812
- (u) => {
1839
+ const S = re(
1840
+ (c) => {
1813
1841
  d();
1814
1842
  let p;
1815
- i ? p = he(s, Object.keys(u)) : p = he(s, []);
1843
+ i ? p = he(r, Object.keys(c)) : p = he(r, []);
1816
1844
  try {
1817
- n.setItem(p, JSON.stringify(u));
1845
+ n.setItem(p, JSON.stringify(c));
1818
1846
  } catch (m) {
1819
1847
  console.error(m);
1820
1848
  }
1821
1849
  },
1822
- [d, i, s, n]
1823
- ), x = re(
1824
- (u) => {
1825
- d(), e === 0 ? b(u) : g.current = setTimeout(() => {
1826
- b(u);
1850
+ [d, i, r, n]
1851
+ ), z = re(
1852
+ (c) => {
1853
+ d(), e === 0 ? S(c) : h.current = setTimeout(() => {
1854
+ S(c);
1827
1855
  }, e);
1828
1856
  },
1829
- [d, e, b]
1857
+ [d, e, S]
1830
1858
  );
1831
1859
  return {
1832
1860
  /**
1833
1861
  * Pass this value to `Group` as the `defaultLayout` prop.
1834
1862
  */
1835
- defaultLayout: f,
1863
+ defaultLayout: u,
1836
1864
  /**
1837
1865
  * Attach this callback on the `Group` as the `onLayoutChange` prop.
1838
1866
  *
1839
1867
  * @deprecated Use the {@link onLayoutChanged} prop instead.
1840
1868
  */
1841
- onLayoutChange: x,
1869
+ onLayoutChange: z,
1842
1870
  /**
1843
1871
  * Attach this callback on the `Group` as the `onLayoutChanged` prop.
1844
1872
  */
1845
- onLayoutChanged: b
1873
+ onLayoutChanged: S
1846
1874
  };
1847
1875
  }
1848
1876
  function Xt() {
@@ -1853,7 +1881,7 @@ function rn() {
1853
1881
  return Q(null);
1854
1882
  }
1855
1883
  function sn() {
1856
- return O(null);
1884
+ return T(null);
1857
1885
  }
1858
1886
  function Me() {
1859
1887
  const e = mt(lt);
@@ -1863,7 +1891,7 @@ function Me() {
1863
1891
  ), e;
1864
1892
  }
1865
1893
  function qt(e, t) {
1866
- const { id: n } = Me(), o = O({
1894
+ const { id: n } = Me(), o = T({
1867
1895
  collapse: ye,
1868
1896
  expand: ye,
1869
1897
  getSize: () => ({
@@ -1886,78 +1914,78 @@ function Yt({
1886
1914
  collapsedSize: n = "0%",
1887
1915
  collapsible: o = !1,
1888
1916
  defaultSize: i,
1889
- disabled: s,
1890
- elementRef: l,
1891
- groupResizeBehavior: r = "preserve-relative-size",
1892
- id: a,
1893
- maxSize: c = "100%",
1894
- minSize: f = "0%",
1895
- onResize: g,
1917
+ disabled: r,
1918
+ elementRef: f,
1919
+ groupResizeBehavior: a = "preserve-relative-size",
1920
+ id: s,
1921
+ maxSize: l = "100%",
1922
+ minSize: u = "0%",
1923
+ onResize: h,
1896
1924
  panelRef: d,
1897
- style: b,
1898
- ...x
1925
+ style: S,
1926
+ ...z
1899
1927
  }) {
1900
- const u = !!a, p = Le(a), m = Re({
1901
- disabled: s
1902
- }), S = O(null), v = Ce(S, l), {
1928
+ const c = !!s, p = Le(s), m = Re({
1929
+ disabled: r
1930
+ }), v = T(null), b = Ce(v, f), {
1903
1931
  getPanelStyles: y,
1904
- id: h,
1905
- orientation: w,
1932
+ id: g,
1933
+ orientation: P,
1906
1934
  registerPanel: M,
1907
- updatePanelProps: P
1908
- } = Me(), G = g !== null, N = se(
1909
- (R, E, I) => {
1910
- g?.(R, a, I);
1935
+ updatePanelProps: w
1936
+ } = Me(), G = h !== null, N = se(
1937
+ (R, E, D) => {
1938
+ h?.(R, s, D);
1911
1939
  }
1912
1940
  );
1913
1941
  q(() => {
1914
- const R = S.current;
1942
+ const R = v.current;
1915
1943
  if (R !== null) {
1916
1944
  const E = {
1917
1945
  element: R,
1918
1946
  id: p,
1919
- idIsStable: u,
1947
+ idIsStable: c,
1920
1948
  mutableValues: {
1921
1949
  expandToSize: void 0,
1922
1950
  prevSize: void 0
1923
1951
  },
1924
1952
  onResize: G ? N : void 0,
1925
1953
  panelConstraints: {
1926
- groupResizeBehavior: r,
1954
+ groupResizeBehavior: a,
1927
1955
  collapsedSize: n,
1928
1956
  collapsible: o,
1929
1957
  defaultSize: i,
1930
1958
  disabled: m.disabled,
1931
- maxSize: c,
1932
- minSize: f
1959
+ maxSize: l,
1960
+ minSize: u
1933
1961
  }
1934
1962
  };
1935
1963
  return M(E);
1936
1964
  }
1937
1965
  }, [
1938
- r,
1966
+ a,
1939
1967
  n,
1940
1968
  o,
1941
1969
  i,
1942
1970
  G,
1943
1971
  p,
1944
- u,
1945
1972
  c,
1946
- f,
1973
+ l,
1974
+ u,
1947
1975
  N,
1948
1976
  M,
1949
1977
  m
1950
1978
  ]), me(() => {
1951
- P(p, { disabled: s });
1952
- }, [s, p, P]), qt(p, d);
1953
- const z = () => {
1954
- const R = y(h, p);
1979
+ w(p, { disabled: r });
1980
+ }, [r, p, w]), qt(p, d);
1981
+ const x = () => {
1982
+ const R = y(g, p);
1955
1983
  if (R)
1956
1984
  return JSON.stringify(R);
1957
1985
  }, L = Xe(
1958
- (R) => ze(h, R),
1959
- z,
1960
- z
1986
+ (R) => ze(g, R),
1987
+ x,
1988
+ x
1961
1989
  );
1962
1990
  let k;
1963
1991
  return L ? k = JSON.parse(L) : i ? k = {
@@ -1967,12 +1995,12 @@ function Yt({
1967
1995
  } : k = { flexGrow: 1 }, /* @__PURE__ */ ae(
1968
1996
  "div",
1969
1997
  {
1970
- ...x,
1971
- "data-disabled": s || void 0,
1998
+ ...z,
1999
+ "data-disabled": r || void 0,
1972
2000
  "data-panel": !0,
1973
2001
  "data-testid": p,
1974
2002
  id: p,
1975
- ref: v,
2003
+ ref: b,
1976
2004
  style: {
1977
2005
  ...Jt,
1978
2006
  display: "flex",
@@ -1990,12 +2018,12 @@ function Yt({
1990
2018
  maxWidth: "100%",
1991
2019
  flexGrow: 1,
1992
2020
  overflow: "auto",
1993
- ...b,
2021
+ ...S,
1994
2022
  // Inform the browser that the library is handling touch events for this element
1995
2023
  // but still allow users to scroll content within panels in the non-resizing direction
1996
2024
  // NOTE This is not an inherited style
1997
2025
  // See github.com/bvaughn/react-resizable-panels/issues/662
1998
- touchAction: w === "horizontal" ? "pan-y" : "pan-x"
2026
+ touchAction: P === "horizontal" ? "pan-y" : "pan-x"
1999
2027
  },
2000
2028
  children: e
2001
2029
  }
@@ -2020,7 +2048,7 @@ function an() {
2020
2048
  return Q(null);
2021
2049
  }
2022
2050
  function ln() {
2023
- return O(null);
2051
+ return T(null);
2024
2052
  }
2025
2053
  function Zt({
2026
2054
  layout: e,
@@ -2028,27 +2056,27 @@ function Zt({
2028
2056
  panelId: n,
2029
2057
  panelIndex: o
2030
2058
  }) {
2031
- let i, s;
2032
- const l = e[n], r = t.find(
2033
- (a) => a.panelId === n
2059
+ let i, r;
2060
+ const f = e[n], a = t.find(
2061
+ (s) => s.panelId === n
2034
2062
  );
2035
- if (r) {
2036
- const a = r.maxSize, c = r.collapsible ? r.collapsedSize : r.minSize, f = [o, o + 1];
2037
- s = U({
2063
+ if (a) {
2064
+ const s = a.maxSize, l = a.collapsible ? a.collapsedSize : a.minSize, u = [o, o + 1];
2065
+ r = U({
2038
2066
  layout: le({
2039
- delta: c - l,
2067
+ delta: l - f,
2040
2068
  initialLayout: e,
2041
2069
  panelConstraints: t,
2042
- pivotIndices: f,
2070
+ pivotIndices: u,
2043
2071
  prevLayout: e
2044
2072
  }),
2045
2073
  panelConstraints: t
2046
2074
  })[n], i = U({
2047
2075
  layout: le({
2048
- delta: a - l,
2076
+ delta: s - f,
2049
2077
  initialLayout: e,
2050
2078
  panelConstraints: t,
2051
- pivotIndices: f,
2079
+ pivotIndices: u,
2052
2080
  prevLayout: e
2053
2081
  }),
2054
2082
  panelConstraints: t
@@ -2057,8 +2085,8 @@ function Zt({
2057
2085
  return {
2058
2086
  valueControls: n,
2059
2087
  valueMax: i,
2060
- valueMin: s,
2061
- valueNow: l
2088
+ valueMin: r,
2089
+ valueNow: f
2062
2090
  };
2063
2091
  }
2064
2092
  function Qt({
@@ -2067,46 +2095,46 @@ function Qt({
2067
2095
  disabled: n,
2068
2096
  disableDoubleClick: o,
2069
2097
  elementRef: i,
2070
- id: s,
2071
- style: l,
2072
- ...r
2098
+ id: r,
2099
+ style: f,
2100
+ ...a
2073
2101
  }) {
2074
- const a = Le(s), c = Re({
2102
+ const s = Le(r), l = Re({
2075
2103
  disabled: n,
2076
2104
  disableDoubleClick: o
2077
- }), [f, g] = Q({}), [d, b] = Q("inactive"), [x, u] = Q(!1), p = O(null), m = Ce(p, i), {
2078
- disableCursor: S,
2079
- id: v,
2105
+ }), [u, h] = Q({}), [d, S] = Q("inactive"), [z, c] = Q(!1), p = T(null), m = Ce(p, i), {
2106
+ disableCursor: v,
2107
+ id: b,
2080
2108
  orientation: y,
2081
- registerSeparator: h,
2082
- updateSeparatorProps: w
2109
+ registerSeparator: g,
2110
+ updateSeparatorProps: P
2083
2111
  } = Me(), M = y === "horizontal" ? "vertical" : "horizontal";
2084
2112
  q(() => {
2085
2113
  const N = p.current;
2086
2114
  if (N !== null) {
2087
- const z = {
2088
- disabled: c.disabled,
2089
- disableDoubleClick: c.disableDoubleClick,
2115
+ const x = {
2116
+ disabled: l.disabled,
2117
+ disableDoubleClick: l.disableDoubleClick,
2090
2118
  element: N,
2091
- id: a
2092
- }, L = h(z), k = Gt(
2119
+ id: s
2120
+ }, L = g(x), k = Gt(
2093
2121
  (E) => {
2094
- b(
2122
+ S(
2095
2123
  E.next.state !== "inactive" && E.next.hitRegions.some(
2096
- (I) => I.separator === z
2124
+ (D) => D.separator === x
2097
2125
  ) ? E.next.state : "inactive"
2098
2126
  );
2099
2127
  }
2100
2128
  ), R = ze(
2101
- v,
2129
+ b,
2102
2130
  (E) => {
2103
- const { derivedPanelConstraints: I, layout: V, separatorToPanels: ue } = E.next, oe = ue.get(z);
2131
+ const { derivedPanelConstraints: D, layout: V, separatorToPanels: ue } = E.next, oe = ue.get(x);
2104
2132
  if (oe) {
2105
2133
  const j = oe[0], Y = oe.indexOf(j);
2106
- g(
2134
+ h(
2107
2135
  Zt({
2108
2136
  layout: V,
2109
- panelConstraints: I,
2137
+ panelConstraints: D,
2110
2138
  panelId: j.id,
2111
2139
  panelIndex: Y
2112
2140
  })
@@ -2118,11 +2146,11 @@ function Qt({
2118
2146
  k(), R(), L();
2119
2147
  };
2120
2148
  }
2121
- }, [v, a, h, c]), me(() => {
2122
- w(a, { disabled: n, disableDoubleClick: o });
2123
- }, [n, o, a, w]);
2124
- let P;
2125
- n && !S && (P = "not-allowed");
2149
+ }, [b, s, g, l]), me(() => {
2150
+ P(s, { disabled: n, disableDoubleClick: o });
2151
+ }, [n, o, s, P]);
2152
+ let w;
2153
+ n && !v && (w = "not-allowed");
2126
2154
  let G;
2127
2155
  if (n)
2128
2156
  G = "disabled";
@@ -2133,31 +2161,31 @@ function Qt({
2133
2161
  break;
2134
2162
  }
2135
2163
  default:
2136
- x ? G = "focus" : G = d;
2164
+ z ? G = "focus" : G = d;
2137
2165
  }
2138
2166
  return /* @__PURE__ */ ae(
2139
2167
  "div",
2140
2168
  {
2141
- ...r,
2142
- "aria-controls": f.valueControls,
2169
+ ...a,
2170
+ "aria-controls": u.valueControls,
2143
2171
  "aria-disabled": n || void 0,
2144
2172
  "aria-orientation": M,
2145
- "aria-valuemax": f.valueMax,
2146
- "aria-valuemin": f.valueMin,
2147
- "aria-valuenow": f.valueNow,
2173
+ "aria-valuemax": u.valueMax,
2174
+ "aria-valuemin": u.valueMin,
2175
+ "aria-valuenow": u.valueNow,
2148
2176
  children: e,
2149
2177
  className: t,
2150
2178
  "data-separator": G,
2151
- "data-testid": a,
2152
- id: a,
2153
- onBlur: () => u(!1),
2154
- onFocus: () => u(!0),
2179
+ "data-testid": s,
2180
+ id: s,
2181
+ onBlur: () => c(!1),
2182
+ onFocus: () => c(!0),
2155
2183
  ref: m,
2156
2184
  role: "separator",
2157
2185
  style: {
2158
2186
  flexBasis: "auto",
2159
- cursor: P,
2160
- ...l,
2187
+ cursor: w,
2188
+ ...f,
2161
2189
  flexGrow: 0,
2162
2190
  flexShrink: 0,
2163
2191
  // Inform the browser that the library is handling touch events for this element
@@ -2173,7 +2201,7 @@ export {
2173
2201
  Ut as Group,
2174
2202
  Yt as Panel,
2175
2203
  Qt as Separator,
2176
- Pt as isCoarsePointer,
2204
+ wt as isCoarsePointer,
2177
2205
  on as useDefaultLayout,
2178
2206
  rn as useGroupCallbackRef,
2179
2207
  sn as useGroupRef,