react-resizable-panels 4.6.4 → 4.6.5

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,21 +1,21 @@
1
1
  "use client";
2
2
  import { jsx as te } from "react/jsx-runtime";
3
- import { useState as ne, useCallback as Q, useId as ot, useLayoutEffect as Ae, useEffect as ue, useRef as O, createContext as it, useImperativeHandle as Ne, useMemo as _e, useSyncExternalStore as Fe, useContext as rt } from "react";
4
- function st(e, t) {
3
+ import { useState as ne, useCallback as Q, useId as rt, useLayoutEffect as Ae, useEffect as ue, useRef as O, createContext as st, useImperativeHandle as Ne, useMemo as _e, useSyncExternalStore as Fe, useContext as at } from "react";
4
+ function lt(e, t) {
5
5
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
6
6
  return t * o;
7
7
  }
8
- function at(e, t) {
8
+ function ut(e, t) {
9
9
  const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
10
10
  return t * o;
11
11
  }
12
- function lt(e) {
12
+ function ct(e) {
13
13
  return e / 100 * window.innerHeight;
14
14
  }
15
- function ut(e) {
15
+ function ft(e) {
16
16
  return e / 100 * window.innerWidth;
17
17
  }
18
- function ct(e) {
18
+ function dt(e) {
19
19
  switch (typeof e) {
20
20
  case "number":
21
21
  return [e, "px"];
@@ -31,7 +31,7 @@ function re({
31
31
  styleProp: n
32
32
  }) {
33
33
  let o;
34
- const [i, s] = ct(n);
34
+ const [i, s] = dt(n);
35
35
  switch (s) {
36
36
  case "%": {
37
37
  o = i / 100 * e;
@@ -42,19 +42,19 @@ function re({
42
42
  break;
43
43
  }
44
44
  case "rem": {
45
- o = at(t, i);
45
+ o = ut(t, i);
46
46
  break;
47
47
  }
48
48
  case "em": {
49
- o = st(t, i);
49
+ o = lt(t, i);
50
50
  break;
51
51
  }
52
52
  case "vh": {
53
- o = lt(i);
53
+ o = ct(i);
54
54
  break;
55
55
  }
56
56
  case "vw": {
57
- o = ut(i);
57
+ o = ft(i);
58
58
  break;
59
59
  }
60
60
  }
@@ -69,7 +69,7 @@ function J({
69
69
  const { orientation: t, panels: n } = e;
70
70
  return n.reduce((o, i) => (o += t === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, o), 0);
71
71
  }
72
- function de(e) {
72
+ function pe(e) {
73
73
  const { panels: t } = e, n = J({ group: e });
74
74
  return n === 0 ? t.map((o) => ({
75
75
  collapsedSize: 0,
@@ -83,39 +83,39 @@ function de(e) {
83
83
  const { element: i, panelConstraints: s } = o;
84
84
  let l = 0;
85
85
  if (s.collapsedSize !== void 0) {
86
- const u = re({
86
+ const c = re({
87
87
  groupSize: n,
88
88
  panelElement: i,
89
89
  styleProp: s.collapsedSize
90
90
  });
91
- l = _(u / n * 100);
91
+ l = _(c / n * 100);
92
92
  }
93
93
  let r;
94
94
  if (s.defaultSize !== void 0) {
95
- const u = re({
95
+ const c = re({
96
96
  groupSize: n,
97
97
  panelElement: i,
98
98
  styleProp: s.defaultSize
99
99
  });
100
- r = _(u / n * 100);
100
+ r = _(c / n * 100);
101
101
  }
102
102
  let a = 0;
103
103
  if (s.minSize !== void 0) {
104
- const u = re({
104
+ const c = re({
105
105
  groupSize: n,
106
106
  panelElement: i,
107
107
  styleProp: s.minSize
108
108
  });
109
- a = _(u / n * 100);
109
+ a = _(c / n * 100);
110
110
  }
111
- let c = 100;
111
+ let u = 100;
112
112
  if (s.maxSize !== void 0) {
113
- const u = re({
113
+ const c = re({
114
114
  groupSize: n,
115
115
  panelElement: i,
116
116
  styleProp: s.maxSize
117
117
  });
118
- c = _(u / n * 100);
118
+ u = _(c / n * 100);
119
119
  }
120
120
  return {
121
121
  collapsedSize: l,
@@ -123,7 +123,7 @@ function de(e) {
123
123
  defaultSize: r,
124
124
  disabled: s.disabled,
125
125
  minSize: a,
126
- maxSize: c,
126
+ maxSize: u,
127
127
  panelId: o.id
128
128
  };
129
129
  });
@@ -132,16 +132,16 @@ function P(e, t = "Assertion error") {
132
132
  if (!e)
133
133
  throw Error(t);
134
134
  }
135
- function pe(e, t) {
135
+ function he(e, t) {
136
136
  return Array.from(t).sort(
137
- e === "horizontal" ? ft : dt
137
+ e === "horizontal" ? pt : ht
138
138
  );
139
139
  }
140
- function ft(e, t) {
140
+ function pt(e, t) {
141
141
  const n = e.element.offsetLeft - t.element.offsetLeft;
142
142
  return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
143
143
  }
144
- function dt(e, t) {
144
+ function ht(e, t) {
145
145
  const n = e.element.offsetTop - t.element.offsetTop;
146
146
  return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
147
147
  }
@@ -160,7 +160,7 @@ function He(e, t) {
160
160
  )
161
161
  };
162
162
  }
163
- function pt({
163
+ function mt({
164
164
  orientation: e,
165
165
  rects: t,
166
166
  targetRect: n
@@ -171,48 +171,48 @@ function pt({
171
171
  };
172
172
  let i, s = Number.MAX_VALUE;
173
173
  for (const l of t) {
174
- const { x: r, y: a } = He(o, l), c = e === "horizontal" ? r : a;
175
- c < s && (s = c, i = l);
174
+ const { x: r, y: a } = He(o, l), u = e === "horizontal" ? r : a;
175
+ u < s && (s = u, i = l);
176
176
  }
177
177
  return P(i, "No rect found"), i;
178
178
  }
179
179
  let se;
180
- function mt() {
180
+ function gt() {
181
181
  return se === void 0 && (typeof matchMedia == "function" ? se = !!matchMedia("(pointer:coarse)").matches : se = !1), se;
182
182
  }
183
183
  function Ve(e) {
184
- const { element: t, orientation: n, panels: o, separators: i } = e, s = pe(
184
+ const { element: t, orientation: n, panels: o, separators: i } = e, s = he(
185
185
  n,
186
- Array.from(t.children).filter($e).map((h) => ({ element: h }))
187
- ).map(({ element: h }) => h), l = [];
188
- let r = !1, a = !1, c = -1, u = -1, g = 0, b, S = [];
186
+ Array.from(t.children).filter($e).map((m) => ({ element: m }))
187
+ ).map(({ element: m }) => m), l = [];
188
+ let r = !1, a = !1, u = -1, c = -1, g = 0, b, S = [];
189
189
  {
190
- let h = -1;
190
+ let m = -1;
191
191
  for (const d of s)
192
- d.hasAttribute("data-panel") && (h++, d.ariaDisabled === null && (g++, c === -1 && (c = h), u = h));
192
+ d.hasAttribute("data-panel") && (m++, d.ariaDisabled === null && (g++, u === -1 && (u = m), c = m));
193
193
  }
194
194
  if (g > 1) {
195
- let h = -1;
195
+ let m = -1;
196
196
  for (const d of s)
197
197
  if (d.hasAttribute("data-panel")) {
198
- h++;
198
+ m++;
199
199
  const f = o.find(
200
- (m) => m.element === d
200
+ (h) => h.element === d
201
201
  );
202
202
  if (f) {
203
203
  if (b) {
204
- const m = b.element.getBoundingClientRect(), v = d.getBoundingClientRect();
204
+ const h = b.element.getBoundingClientRect(), v = d.getBoundingClientRect();
205
205
  let x;
206
206
  if (a) {
207
207
  const y = n === "horizontal" ? new DOMRect(
208
- m.right,
209
- m.top,
208
+ h.right,
209
+ h.top,
210
210
  0,
211
- m.height
211
+ h.height
212
212
  ) : new DOMRect(
213
- m.left,
214
- m.bottom,
215
- m.width,
213
+ h.left,
214
+ h.bottom,
215
+ h.width,
216
216
  0
217
217
  ), p = n === "horizontal" ? new DOMRect(v.left, v.top, 0, v.height) : new DOMRect(v.left, v.top, v.width, 0);
218
218
  switch (S.length) {
@@ -224,14 +224,14 @@ function Ve(e) {
224
224
  break;
225
225
  }
226
226
  case 1: {
227
- const w = S[0], C = pt({
227
+ const w = S[0], C = mt({
228
228
  orientation: n,
229
- rects: [m, v],
229
+ rects: [h, v],
230
230
  targetRect: w.element.getBoundingClientRect()
231
231
  });
232
232
  x = [
233
233
  w,
234
- C === m ? p : y
234
+ C === h ? p : y
235
235
  ];
236
236
  break;
237
237
  }
@@ -243,20 +243,20 @@ function Ve(e) {
243
243
  } else
244
244
  S.length ? x = S : x = [
245
245
  n === "horizontal" ? new DOMRect(
246
- m.right,
246
+ h.right,
247
247
  v.top,
248
- v.left - m.right,
248
+ v.left - h.right,
249
249
  v.height
250
250
  ) : new DOMRect(
251
251
  v.left,
252
- m.bottom,
252
+ h.bottom,
253
253
  v.width,
254
- v.top - m.bottom
254
+ v.top - h.bottom
255
255
  )
256
256
  ];
257
257
  for (const y of x) {
258
258
  let p = "width" in y ? y : y.element.getBoundingClientRect();
259
- const w = mt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
259
+ const w = gt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
260
260
  if (p.width < w) {
261
261
  const R = w - p.width;
262
262
  p = new DOMRect(
@@ -275,7 +275,7 @@ function Ve(e) {
275
275
  p.height + R
276
276
  );
277
277
  }
278
- const C = h <= c || h > u;
278
+ const C = m <= u || m > c;
279
279
  !r && !C && l.push({
280
280
  group: e,
281
281
  groupSize: J({ group: e }),
@@ -290,7 +290,7 @@ function Ve(e) {
290
290
  } else if (d.hasAttribute("data-separator")) {
291
291
  d.ariaDisabled !== null && (r = !0);
292
292
  const f = i.find(
293
- (m) => m.element === d
293
+ (h) => h.element === d
294
294
  );
295
295
  f ? S.push(f) : (b = void 0, S = []);
296
296
  } else
@@ -298,7 +298,7 @@ function Ve(e) {
298
298
  }
299
299
  return l;
300
300
  }
301
- class ht {
301
+ class yt {
302
302
  #e = {};
303
303
  addListener(t, n) {
304
304
  const o = this.#e[t];
@@ -318,8 +318,8 @@ class ht {
318
318
  const a = l[r];
319
319
  try {
320
320
  a.call(null, n);
321
- } catch (c) {
322
- s === null && (i = !0, s = c);
321
+ } catch (u) {
322
+ s === null && (i = !0, s = u);
323
323
  }
324
324
  }
325
325
  if (i)
@@ -347,7 +347,7 @@ let A = {
347
347
  },
348
348
  mountedGroups: /* @__PURE__ */ new Map()
349
349
  };
350
- const $ = new ht();
350
+ const $ = new yt();
351
351
  function G() {
352
352
  return A;
353
353
  }
@@ -377,7 +377,7 @@ function I(e) {
377
377
  });
378
378
  }), $.emit("mountedGroupsChange", A.mountedGroups)), A;
379
379
  }
380
- function gt(e, t, n) {
380
+ function St(e, t, n) {
381
381
  let o, i = {
382
382
  x: 1 / 0,
383
383
  y: 1 / 0
@@ -400,10 +400,10 @@ function gt(e, t, n) {
400
400
  hitRegion: o
401
401
  } : void 0;
402
402
  }
403
- function yt(e) {
403
+ function vt(e) {
404
404
  return e !== null && typeof e == "object" && "nodeType" in e && e.nodeType === Node.DOCUMENT_FRAGMENT_NODE;
405
405
  }
406
- function St(e, t) {
406
+ function xt(e, t) {
407
407
  if (e === t) throw new Error("Cannot compare node with itself");
408
408
  const n = {
409
409
  a: we(e),
@@ -434,20 +434,20 @@ function St(e, t) {
434
434
  }
435
435
  return Math.sign(i.a - i.b);
436
436
  }
437
- const vt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
438
- function xt(e) {
437
+ const zt = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
438
+ function bt(e) {
439
439
  const t = getComputedStyle(je(e) ?? e).display;
440
440
  return t === "flex" || t === "inline-flex";
441
441
  }
442
- function zt(e) {
442
+ function wt(e) {
443
443
  const t = getComputedStyle(e);
444
- 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" || vt.test(t.willChange) || t.webkitOverflowScrolling === "touch");
444
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || bt(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");
445
445
  }
446
446
  function ze(e) {
447
447
  let t = e.length;
448
448
  for (; t--; ) {
449
449
  const n = e[t];
450
- if (P(n, "Missing node"), zt(n)) return n;
450
+ if (P(n, "Missing node"), wt(n)) return n;
451
451
  }
452
452
  return null;
453
453
  }
@@ -462,24 +462,24 @@ function we(e) {
462
462
  }
463
463
  function je(e) {
464
464
  const { parentNode: t } = e;
465
- return yt(t) ? t.host : t;
465
+ return vt(t) ? t.host : t;
466
466
  }
467
- function bt(e, t) {
467
+ function Lt(e, t) {
468
468
  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;
469
469
  }
470
- function wt({
470
+ function Pt({
471
471
  groupElement: e,
472
472
  hitRegion: t,
473
473
  pointerEventTarget: n
474
474
  }) {
475
475
  if (!$e(n) || n.contains(e) || e.contains(n))
476
476
  return !0;
477
- if (St(n, e) > 0) {
477
+ if (xt(n, e) > 0) {
478
478
  let o = n;
479
479
  for (; o; ) {
480
480
  if (o.contains(e))
481
481
  return !0;
482
- if (bt(o.getBoundingClientRect(), t))
482
+ if (Lt(o.getBoundingClientRect(), t))
483
483
  return !1;
484
484
  o = o.parentElement;
485
485
  }
@@ -491,18 +491,18 @@ function me(e, t) {
491
491
  return t.forEach((o, i) => {
492
492
  if (i.disabled)
493
493
  return;
494
- const s = Ve(i), l = gt(i.orientation, s, {
494
+ const s = Ve(i), l = St(i.orientation, s, {
495
495
  x: e.clientX,
496
496
  y: e.clientY
497
497
  });
498
- l && l.distance.x <= 0 && l.distance.y <= 0 && wt({
498
+ l && l.distance.x <= 0 && l.distance.y <= 0 && Pt({
499
499
  groupElement: i.element,
500
500
  hitRegion: l.hitRegion.rect,
501
501
  pointerEventTarget: e.target
502
502
  }) && n.push(l.hitRegion);
503
503
  }), n;
504
504
  }
505
- function Lt(e, t) {
505
+ function Ct(e, t) {
506
506
  if (e.length !== t.length)
507
507
  return !1;
508
508
  for (let n = 0; n < e.length; n++)
@@ -530,8 +530,8 @@ function Y({
530
530
  return n;
531
531
  if (F(o, a) < 0)
532
532
  if (s) {
533
- const c = (i + a) / 2;
534
- F(o, c) < 0 ? o = i : o = a;
533
+ const u = (i + a) / 2;
534
+ F(o, u) < 0 ? o = i : o = a;
535
535
  } else
536
536
  o = a;
537
537
  return o = Math.min(r, o), o = _(o), o;
@@ -546,19 +546,19 @@ function oe({
546
546
  }) {
547
547
  if (k(e, 0))
548
548
  return t;
549
- const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), c = [...r], [u, g] = o;
550
- P(u != null, "Invalid first pivot index"), P(g != null, "Invalid second pivot index");
549
+ const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), u = [...r], [c, g] = o;
550
+ P(c != null, "Invalid first pivot index"), P(g != null, "Invalid second pivot index");
551
551
  let b = 0;
552
552
  switch (s) {
553
553
  case "keyboard": {
554
554
  {
555
- const d = e < 0 ? g : u, f = n[d];
555
+ const d = e < 0 ? g : c, f = n[d];
556
556
  P(
557
557
  f,
558
558
  `Panel constraints not found for index ${d}`
559
559
  );
560
560
  const {
561
- collapsedSize: m = 0,
561
+ collapsedSize: h = 0,
562
562
  collapsible: v,
563
563
  minSize: x = 0
564
564
  } = f;
@@ -567,20 +567,20 @@ function oe({
567
567
  if (P(
568
568
  y != null,
569
569
  `Previous layout not found for panel index ${d}`
570
- ), k(y, m)) {
570
+ ), k(y, h)) {
571
571
  const p = x - y;
572
572
  F(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
573
573
  }
574
574
  }
575
575
  }
576
576
  {
577
- const d = e < 0 ? u : g, f = n[d];
577
+ const d = e < 0 ? c : g, f = n[d];
578
578
  P(
579
579
  f,
580
580
  `No panel constraints found for index ${d}`
581
581
  );
582
582
  const {
583
- collapsedSize: m = 0,
583
+ collapsedSize: h = 0,
584
584
  collapsible: v,
585
585
  minSize: x = 0
586
586
  } = f;
@@ -590,7 +590,7 @@ function oe({
590
590
  y != null,
591
591
  `Previous layout not found for panel index ${d}`
592
592
  ), k(y, x)) {
593
- const p = y - m;
593
+ const p = y - h;
594
594
  F(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
595
595
  }
596
596
  }
@@ -598,18 +598,18 @@ function oe({
598
598
  break;
599
599
  }
600
600
  default: {
601
- const d = e < 0 ? g : u, f = n[d];
601
+ const d = e < 0 ? g : c, f = n[d];
602
602
  P(
603
603
  f,
604
604
  `Panel constraints not found for index ${d}`
605
605
  );
606
- const m = r[d], { collapsible: v, collapsedSize: x, minSize: y } = f;
607
- if (v && F(m, y) < 0)
606
+ const h = r[d], { collapsible: v, collapsedSize: x, minSize: y } = f;
607
+ if (v && F(h, y) < 0)
608
608
  if (e > 0) {
609
- const p = y - x, w = p / 2, C = m + e;
609
+ const p = y - x, w = p / 2, C = h + e;
610
610
  F(C, y) < 0 && (e = F(e, w) <= 0 ? 0 : p);
611
611
  } else {
612
- const p = y - x, w = 100 - p / 2, C = m - e;
612
+ const p = y - x, w = 100 - p / 2, C = h - e;
613
613
  F(C, y) < 0 && (e = F(100 + e, w) > 0 ? 0 : -p);
614
614
  }
615
615
  break;
@@ -617,7 +617,7 @@ function oe({
617
617
  }
618
618
  {
619
619
  const d = e < 0 ? 1 : -1;
620
- let f = e < 0 ? g : u, m = 0;
620
+ let f = e < 0 ? g : c, h = 0;
621
621
  for (; ; ) {
622
622
  const x = r[f];
623
623
  P(
@@ -630,51 +630,51 @@ function oe({
630
630
  prevSize: x,
631
631
  size: 100
632
632
  }) - x;
633
- if (m += p, f += d, f < 0 || f >= n.length)
633
+ if (h += p, f += d, f < 0 || f >= n.length)
634
634
  break;
635
635
  }
636
- const v = Math.min(Math.abs(e), Math.abs(m));
636
+ const v = Math.min(Math.abs(e), Math.abs(h));
637
637
  e = e < 0 ? 0 - v : v;
638
638
  }
639
639
  {
640
- let f = e < 0 ? u : g;
640
+ let f = e < 0 ? c : g;
641
641
  for (; f >= 0 && f < n.length; ) {
642
- const m = Math.abs(e) - Math.abs(b), v = r[f];
642
+ const h = Math.abs(e) - Math.abs(b), v = r[f];
643
643
  P(
644
644
  v != null,
645
645
  `Previous layout not found for panel index ${f}`
646
646
  );
647
- const x = v - m, y = Y({
647
+ const x = v - h, y = Y({
648
648
  overrideDisabledPanels: l,
649
649
  panelConstraints: n[f],
650
650
  prevSize: v,
651
651
  size: x
652
652
  });
653
- if (!k(v, y) && (b += v - y, c[f] = y, b.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
653
+ if (!k(v, y) && (b += v - y, u[f] = y, b.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
654
654
  numeric: !0
655
655
  }) >= 0))
656
656
  break;
657
657
  e < 0 ? f-- : f++;
658
658
  }
659
659
  }
660
- if (Lt(a, c))
660
+ if (Ct(a, u))
661
661
  return i;
662
662
  {
663
- const d = e < 0 ? g : u, f = r[d];
663
+ const d = e < 0 ? g : c, f = r[d];
664
664
  P(
665
665
  f != null,
666
666
  `Previous layout not found for panel index ${d}`
667
667
  );
668
- const m = f + b, v = Y({
668
+ const h = f + b, v = Y({
669
669
  overrideDisabledPanels: l,
670
670
  panelConstraints: n[d],
671
671
  prevSize: f,
672
- size: m
672
+ size: h
673
673
  });
674
- if (c[d] = v, !k(v, m)) {
675
- let x = m - v, p = e < 0 ? g : u;
674
+ if (u[d] = v, !k(v, h)) {
675
+ let x = h - v, p = e < 0 ? g : c;
676
676
  for (; p >= 0 && p < n.length; ) {
677
- const w = c[p];
677
+ const w = u[p];
678
678
  P(
679
679
  w != null,
680
680
  `Previous layout not found for panel index ${p}`
@@ -685,20 +685,20 @@ function oe({
685
685
  prevSize: w,
686
686
  size: C
687
687
  });
688
- if (k(w, R) || (x -= R - w, c[p] = R), k(x, 0))
688
+ if (k(w, R) || (x -= R - w, u[p] = R), k(x, 0))
689
689
  break;
690
690
  e > 0 ? p-- : p++;
691
691
  }
692
692
  }
693
693
  }
694
- const S = Object.values(c).reduce(
694
+ const S = Object.values(u).reduce(
695
695
  (d, f) => f + d,
696
696
  0
697
697
  );
698
698
  if (!k(S, 100, 0.1))
699
699
  return i;
700
- const h = Object.keys(i);
701
- return c.reduce((d, f, m) => (d[h[m]] = f, d), {});
700
+ const m = Object.keys(i);
701
+ return u.reduce((d, f, h) => (d[m[h]] = f, d), {});
702
702
  }
703
703
  function U(e, t) {
704
704
  if (Object.keys(e).length !== Object.keys(t).length)
@@ -724,38 +724,38 @@ function B({
724
724
  for (let r = 0; r < t.length; r++) {
725
725
  const a = o[r];
726
726
  P(a != null, `No layout data found for index ${r}`);
727
- const c = 100 / i * a;
728
- o[r] = c;
727
+ const u = 100 / i * a;
728
+ o[r] = u;
729
729
  }
730
730
  let s = 0;
731
731
  for (let r = 0; r < t.length; r++) {
732
732
  const a = n[r];
733
733
  P(a != null, `No layout data found for index ${r}`);
734
- const c = o[r];
735
- P(c != null, `No layout data found for index ${r}`);
736
- const u = Y({
734
+ const u = o[r];
735
+ P(u != null, `No layout data found for index ${r}`);
736
+ const c = Y({
737
737
  overrideDisabledPanels: !0,
738
738
  panelConstraints: t[r],
739
739
  prevSize: a,
740
- size: c
740
+ size: u
741
741
  });
742
- c != u && (s += c - u, o[r] = u);
742
+ u != c && (s += u - c, o[r] = c);
743
743
  }
744
744
  if (!k(s, 0))
745
745
  for (let r = 0; r < t.length; r++) {
746
746
  const a = o[r];
747
747
  P(a != null, `No layout data found for index ${r}`);
748
- const c = a + s, u = Y({
748
+ const u = a + s, c = Y({
749
749
  overrideDisabledPanels: !0,
750
750
  panelConstraints: t[r],
751
751
  prevSize: a,
752
- size: c
752
+ size: u
753
753
  });
754
- if (a !== u && (s -= u - a, o[r] = u, k(s, 0)))
754
+ if (a !== c && (s -= c - a, o[r] = c, k(s, 0)))
755
755
  break;
756
756
  }
757
757
  const l = Object.keys(e);
758
- return o.reduce((r, a, c) => (r[l[c]] = a, r), {});
758
+ return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
759
759
  }
760
760
  function We({
761
761
  groupId: e,
@@ -766,16 +766,16 @@ function We({
766
766
  for (const [
767
767
  a,
768
768
  {
769
- defaultLayoutDeferred: c,
770
- derivedPanelConstraints: u,
769
+ defaultLayoutDeferred: u,
770
+ derivedPanelConstraints: c,
771
771
  layout: g,
772
772
  separatorToPanels: b
773
773
  }
774
774
  ] of r)
775
775
  if (a.id === e)
776
776
  return {
777
- defaultLayoutDeferred: c,
778
- derivedPanelConstraints: u,
777
+ defaultLayoutDeferred: u,
778
+ derivedPanelConstraints: c,
779
779
  group: a,
780
780
  layout: g,
781
781
  separatorToPanels: b
@@ -803,69 +803,69 @@ function We({
803
803
  if (r === a)
804
804
  return;
805
805
  const {
806
- defaultLayoutDeferred: c,
807
- derivedPanelConstraints: u,
806
+ defaultLayoutDeferred: u,
807
+ derivedPanelConstraints: c,
808
808
  group: g,
809
809
  layout: b,
810
810
  separatorToPanels: S
811
- } = n(), h = g.panels.findIndex((v) => v.id === t), d = h === g.panels.length - 1, f = oe({
811
+ } = n(), m = g.panels.findIndex((v) => v.id === t), d = m === g.panels.length - 1, f = oe({
812
812
  delta: d ? a - r : r - a,
813
813
  initialLayout: b,
814
- panelConstraints: u,
815
- pivotIndices: d ? [h - 1, h] : [h, h + 1],
814
+ panelConstraints: c,
815
+ pivotIndices: d ? [m - 1, m] : [m, m + 1],
816
816
  prevLayout: b,
817
817
  trigger: "imperative-api"
818
- }), m = B({
818
+ }), h = B({
819
819
  layout: f,
820
- panelConstraints: u
820
+ panelConstraints: c
821
821
  });
822
- U(b, m) || I((v) => ({
822
+ U(b, h) || I((v) => ({
823
823
  mountedGroups: new Map(v.mountedGroups).set(g, {
824
- defaultLayoutDeferred: c,
825
- derivedPanelConstraints: u,
826
- layout: m,
824
+ defaultLayoutDeferred: u,
825
+ derivedPanelConstraints: c,
826
+ layout: h,
827
827
  separatorToPanels: S
828
828
  })
829
829
  }));
830
830
  };
831
831
  return {
832
832
  collapse: () => {
833
- const { collapsible: r, collapsedSize: a } = o(), { mutableValues: c } = i(), u = s();
834
- r && u !== a && (c.expandToSize = u, l(a));
833
+ const { collapsible: r, collapsedSize: a } = o(), { mutableValues: u } = i(), c = s();
834
+ r && c !== a && (u.expandToSize = c, l(a));
835
835
  },
836
836
  expand: () => {
837
- const { collapsible: r, collapsedSize: a, minSize: c } = o(), { mutableValues: u } = i(), g = s();
837
+ const { collapsible: r, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), g = s();
838
838
  if (r && g === a) {
839
- let b = u.expandToSize ?? c;
839
+ let b = c.expandToSize ?? u;
840
840
  b === 0 && (b = 1), l(b);
841
841
  }
842
842
  },
843
843
  getSize: () => {
844
- const { group: r } = n(), a = s(), { element: c } = i(), u = r.orientation === "horizontal" ? c.offsetWidth : c.offsetHeight;
844
+ const { group: r } = n(), a = s(), { element: u } = i(), c = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
845
845
  return {
846
846
  asPercentage: a,
847
- inPixels: u
847
+ inPixels: c
848
848
  };
849
849
  },
850
850
  isCollapsed: () => {
851
- const { collapsible: r, collapsedSize: a } = o(), c = s();
852
- return r && k(a, c);
851
+ const { collapsible: r, collapsedSize: a } = o(), u = s();
852
+ return r && k(a, u);
853
853
  },
854
854
  resize: (r) => {
855
855
  if (s() !== r) {
856
- let c;
856
+ let u;
857
857
  switch (typeof r) {
858
858
  case "number": {
859
- const { group: u } = n(), g = J({ group: u });
860
- c = _(r / g * 100);
859
+ const { group: c } = n(), g = J({ group: c });
860
+ u = _(r / g * 100);
861
861
  break;
862
862
  }
863
863
  case "string": {
864
- c = parseFloat(r);
864
+ u = parseFloat(r);
865
865
  break;
866
866
  }
867
867
  }
868
- l(c);
868
+ l(u);
869
869
  }
870
870
  }
871
871
  };
@@ -924,21 +924,14 @@ function Ue({
924
924
  layout: n,
925
925
  panelConstraints: i
926
926
  });
927
- if (o)
928
- return l;
929
- if (!U(l, a)) {
930
- I((u) => ({
931
- mountedGroups: new Map(u.mountedGroups).set(s, {
932
- defaultLayoutDeferred: o,
933
- derivedPanelConstraints: i,
934
- layout: a,
935
- separatorToPanels: r
936
- })
937
- }));
938
- const c = s.panels.map(({ id: u }) => u).join(",");
939
- s.inMemoryLayouts[c] = a;
940
- }
941
- return a;
927
+ return o ? l : (U(l, a) || I((u) => ({
928
+ mountedGroups: new Map(u.mountedGroups).set(s, {
929
+ defaultLayoutDeferred: o,
930
+ derivedPanelConstraints: i,
931
+ layout: a,
932
+ separatorToPanels: r
933
+ })
934
+ })), a);
942
935
  }
943
936
  };
944
937
  }
@@ -953,22 +946,22 @@ function W(e, t) {
953
946
  P(i, "Matching separator not found");
954
947
  const s = o.separatorToPanels.get(i);
955
948
  P(s, "Matching panels not found");
956
- const l = s.map((g) => n.panels.indexOf(g)), a = Ue({ groupId: n.id }).getLayout(), c = oe({
949
+ const l = s.map((g) => n.panels.indexOf(g)), a = Ue({ groupId: n.id }).getLayout(), u = oe({
957
950
  delta: t,
958
951
  initialLayout: a,
959
952
  panelConstraints: o.derivedPanelConstraints,
960
953
  pivotIndices: l,
961
954
  prevLayout: a,
962
955
  trigger: "keyboard"
963
- }), u = B({
964
- layout: c,
956
+ }), c = B({
957
+ layout: u,
965
958
  panelConstraints: o.derivedPanelConstraints
966
959
  });
967
- U(a, u) || I((g) => ({
960
+ U(a, c) || I((g) => ({
968
961
  mountedGroups: new Map(g.mountedGroups).set(n, {
969
962
  defaultLayoutDeferred: o.defaultLayoutDeferred,
970
963
  derivedPanelConstraints: o.derivedPanelConstraints,
971
- layout: u,
964
+ layout: c,
972
965
  separatorToPanels: o.separatorToPanels
973
966
  })
974
967
  }));
@@ -1007,11 +1000,11 @@ function Pe(e) {
1007
1000
  P(r, "Matching separator not found");
1008
1001
  const a = l.get(r);
1009
1002
  P(a, "Matching panels not found");
1010
- const c = a[0], u = i.find(
1011
- (g) => g.panelId === c.id
1003
+ const u = a[0], c = i.find(
1004
+ (g) => g.panelId === u.id
1012
1005
  );
1013
- if (P(u, "Panel metadata not found"), u.collapsible) {
1014
- const g = s[c.id], b = u.collapsedSize === g ? o.inMemoryLastExpandedPanelSizes[c.id] ?? u.minSize : u.collapsedSize;
1006
+ if (P(c, "Panel metadata not found"), c.collapsible) {
1007
+ const g = s[u.id], b = c.collapsedSize === g ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
1015
1008
  W(t, b - g);
1016
1009
  }
1017
1010
  break;
@@ -1054,13 +1047,13 @@ function Ce(e) {
1054
1047
  }
1055
1048
  }), n.length && e.preventDefault();
1056
1049
  }
1057
- const Pt = (e) => e, ce = () => {
1050
+ const Rt = (e) => e, fe = () => {
1058
1051
  }, Ke = 1, Xe = 2, qe = 4, Ye = 8, Re = 3, Me = 12;
1059
1052
  let ae;
1060
1053
  function Ee() {
1061
1054
  return ae === void 0 && (ae = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ae = !0)), ae;
1062
1055
  }
1063
- function Ct({
1056
+ function Mt({
1064
1057
  cursorFlags: e,
1065
1058
  groups: t,
1066
1059
  state: n
@@ -1104,16 +1097,16 @@ function Ct({
1104
1097
  }
1105
1098
  }
1106
1099
  const ke = /* @__PURE__ */ new WeakMap();
1107
- function he(e) {
1100
+ function ge(e) {
1108
1101
  if (e.defaultView === null || e.defaultView === void 0)
1109
1102
  return;
1110
1103
  let { prevStyle: t, styleSheet: n } = ke.get(e) ?? {};
1111
- n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets.push(n));
1104
+ n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
1112
1105
  const { cursorFlags: o, interactionState: i } = G();
1113
1106
  switch (i.state) {
1114
1107
  case "active":
1115
1108
  case "hover": {
1116
- const s = Ct({
1109
+ const s = Mt({
1117
1110
  cursorFlags: o,
1118
1111
  groups: i.hitRegions.map((r) => r.group),
1119
1112
  state: i.state
@@ -1144,28 +1137,28 @@ function Je({
1144
1137
  }) {
1145
1138
  let r = 0;
1146
1139
  const a = new Map(i);
1147
- n.forEach((u) => {
1148
- const { group: g, groupSize: b } = u, { disableCursor: S, orientation: h, panels: d } = g;
1140
+ n.forEach((c) => {
1141
+ const { group: g, groupSize: b } = c, { disableCursor: S, orientation: m, panels: d } = g;
1149
1142
  let f = 0;
1150
- s ? h === "horizontal" ? f = (t.clientX - s.x) / b * 100 : f = (t.clientY - s.y) / b * 100 : h === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
1151
- const m = o.get(g), {
1143
+ s ? m === "horizontal" ? f = (t.clientX - s.x) / b * 100 : f = (t.clientY - s.y) / b * 100 : m === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
1144
+ const h = o.get(g), {
1152
1145
  defaultLayoutDeferred: v,
1153
1146
  derivedPanelConstraints: x,
1154
1147
  layout: y,
1155
1148
  separatorToPanels: p
1156
1149
  } = i.get(g) ?? { defaultLayoutDeferred: !1 };
1157
- if (x && m && y && p) {
1150
+ if (x && h && y && p) {
1158
1151
  const w = oe({
1159
1152
  delta: f,
1160
- initialLayout: m,
1153
+ initialLayout: h,
1161
1154
  panelConstraints: x,
1162
- pivotIndices: u.panels.map((C) => d.indexOf(C)),
1155
+ pivotIndices: c.panels.map((C) => d.indexOf(C)),
1163
1156
  prevLayout: y,
1164
1157
  trigger: "mouse-or-touch"
1165
1158
  });
1166
1159
  if (U(w, y)) {
1167
1160
  if (f !== 0 && !S)
1168
- switch (h) {
1161
+ switch (m) {
1169
1162
  case "horizontal": {
1170
1163
  r |= f < 0 ? Ke : Xe;
1171
1164
  break;
@@ -1175,23 +1168,20 @@ function Je({
1175
1168
  break;
1176
1169
  }
1177
1170
  }
1178
- } else {
1179
- a.set(u.group, {
1171
+ } else
1172
+ a.set(c.group, {
1180
1173
  defaultLayoutDeferred: v,
1181
1174
  derivedPanelConstraints: x,
1182
1175
  layout: w,
1183
1176
  separatorToPanels: p
1184
1177
  });
1185
- const C = u.group.panels.map(({ id: R }) => R).join(",");
1186
- u.group.inMemoryLayouts[C] = w;
1187
- }
1188
1178
  }
1189
1179
  });
1190
- let c = 0;
1191
- t.movementX === 0 ? c |= l & Re : c |= r & Re, t.movementY === 0 ? c |= l & Me : c |= r & Me, I({
1192
- cursorFlags: c,
1180
+ let u = 0;
1181
+ t.movementX === 0 ? u |= l & Re : u |= r & Re, t.movementY === 0 ? u |= l & Me : u |= r & Me, I({
1182
+ cursorFlags: u,
1193
1183
  mountedGroups: a
1194
- }), he(e);
1184
+ }), ge(e);
1195
1185
  }
1196
1186
  function Ge(e) {
1197
1187
  const { cursorFlags: t, interactionState: n, mountedGroups: o } = G();
@@ -1249,7 +1239,7 @@ function Ie(e) {
1249
1239
  hitRegions: i,
1250
1240
  state: "hover"
1251
1241
  }
1252
- }), he(e.currentTarget);
1242
+ }), ge(e.currentTarget);
1253
1243
  break;
1254
1244
  }
1255
1245
  }
@@ -1280,7 +1270,7 @@ function Oe(e) {
1280
1270
  interactionState: {
1281
1271
  state: "inactive"
1282
1272
  }
1283
- }), t.hitRegions.length > 0 && (he(e.currentTarget), I((n) => ({
1273
+ }), t.hitRegions.length > 0 && (ge(e.currentTarget), I((n) => ({
1284
1274
  mountedGroups: new Map(n.mountedGroups)
1285
1275
  })), e.preventDefault());
1286
1276
  }
@@ -1303,10 +1293,10 @@ function Te(e) {
1303
1293
  }
1304
1294
  return o;
1305
1295
  }
1306
- function Rt(e, t, n) {
1296
+ function Et(e, t, n) {
1307
1297
  if (!n[0])
1308
1298
  return;
1309
- const i = e.panels.find((c) => c.element === t);
1299
+ const i = e.panels.find((u) => u.element === t);
1310
1300
  if (!i || !i.onResize)
1311
1301
  return;
1312
1302
  const s = J({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
@@ -1315,7 +1305,7 @@ function Rt(e, t, n) {
1315
1305
  };
1316
1306
  i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
1317
1307
  }
1318
- function Mt(e, t) {
1308
+ function kt(e, t) {
1319
1309
  if (Object.keys(e).length !== Object.keys(t).length)
1320
1310
  return !1;
1321
1311
  for (const o in e)
@@ -1323,7 +1313,7 @@ function Mt(e, t) {
1323
1313
  return !1;
1324
1314
  return !0;
1325
1315
  }
1326
- function Et(e, t) {
1316
+ function Gt(e, t) {
1327
1317
  const n = e.map((i) => i.id), o = Object.keys(t);
1328
1318
  if (n.length !== o.length)
1329
1319
  return !1;
@@ -1333,27 +1323,27 @@ function Et(e, t) {
1333
1323
  return !0;
1334
1324
  }
1335
1325
  const q = /* @__PURE__ */ new Map();
1336
- function kt(e) {
1326
+ function It(e) {
1337
1327
  let t = !0;
1338
1328
  P(
1339
1329
  e.element.ownerDocument.defaultView,
1340
1330
  "Cannot register an unmounted Group"
1341
1331
  );
1342
- const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((h) => {
1343
- for (const d of h) {
1344
- const { borderBoxSize: f, target: m } = d;
1345
- if (m === e.element) {
1332
+ const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((m) => {
1333
+ for (const d of m) {
1334
+ const { borderBoxSize: f, target: h } = d;
1335
+ if (h === e.element) {
1346
1336
  if (t) {
1347
1337
  if (J({ group: e }) === 0)
1348
1338
  return;
1349
1339
  I((x) => {
1350
1340
  const y = x.mountedGroups.get(e);
1351
1341
  if (y) {
1352
- const p = de(e), w = y.defaultLayoutDeferred ? Te(p) : y.layout, C = B({
1342
+ const p = pe(e), w = y.defaultLayoutDeferred ? Te(p) : y.layout, C = B({
1353
1343
  layout: w,
1354
1344
  panelConstraints: p
1355
1345
  });
1356
- return !y.defaultLayoutDeferred && U(w, C) && Mt(
1346
+ return !y.defaultLayoutDeferred && U(w, C) && kt(
1357
1347
  y.derivedPanelConstraints,
1358
1348
  p
1359
1349
  ) ? x : {
@@ -1369,23 +1359,23 @@ function kt(e) {
1369
1359
  });
1370
1360
  }
1371
1361
  } else
1372
- Rt(e, m, f);
1362
+ Et(e, h, f);
1373
1363
  }
1374
1364
  });
1375
- s.observe(e.element), e.panels.forEach((h) => {
1365
+ s.observe(e.element), e.panels.forEach((m) => {
1376
1366
  P(
1377
- !o.has(h.id),
1378
- `Panel ids must be unique; id "${h.id}" was used more than once`
1379
- ), o.add(h.id), h.onResize && s.observe(h.element);
1367
+ !o.has(m.id),
1368
+ `Panel ids must be unique; id "${m.id}" was used more than once`
1369
+ ), o.add(m.id), m.onResize && s.observe(m.element);
1380
1370
  });
1381
- const l = J({ group: e }), r = de(e), a = e.panels.map(({ id: h }) => h).join(",");
1382
- let c = e.defaultLayout;
1383
- c && (Et(e.panels, c) || (c = void 0));
1384
- const u = e.inMemoryLayouts[a] ?? c ?? Te(r), g = B({
1385
- layout: u,
1371
+ const l = J({ group: e }), r = pe(e), a = e.panels.map(({ id: m }) => m).join(",");
1372
+ let u = e.defaultLayout;
1373
+ u && (Gt(e.panels, u) || (u = void 0));
1374
+ const c = e.inMemoryLayouts[a] ?? u ?? Te(r), g = B({
1375
+ layout: c,
1386
1376
  panelConstraints: r
1387
1377
  }), b = Ve(e), S = e.element.ownerDocument;
1388
- return I((h) => {
1378
+ return I((m) => {
1389
1379
  const d = /* @__PURE__ */ new Map();
1390
1380
  return q.set(
1391
1381
  S,
@@ -1393,18 +1383,18 @@ function kt(e) {
1393
1383
  ), b.forEach((f) => {
1394
1384
  f.separator && d.set(f.separator, f.panels);
1395
1385
  }), {
1396
- mountedGroups: new Map(h.mountedGroups).set(e, {
1386
+ mountedGroups: new Map(m.mountedGroups).set(e, {
1397
1387
  defaultLayoutDeferred: l === 0,
1398
1388
  derivedPanelConstraints: r,
1399
1389
  layout: g,
1400
1390
  separatorToPanels: d
1401
1391
  })
1402
1392
  };
1403
- }), e.separators.forEach((h) => {
1393
+ }), e.separators.forEach((m) => {
1404
1394
  P(
1405
- !i.has(h.id),
1406
- `Separator ids must be unique; id "${h.id}" was used more than once`
1407
- ), i.add(h.id), h.element.addEventListener("keydown", Pe);
1395
+ !i.has(m.id),
1396
+ `Separator ids must be unique; id "${m.id}" was used more than once`
1397
+ ), i.add(m.id), m.element.addEventListener("keydown", Pe);
1408
1398
  }), q.get(S) === 1 && (S.addEventListener("dblclick", Le, !0), S.addEventListener("pointerdown", Ce, !0), S.addEventListener("pointerleave", Ge), S.addEventListener("pointermove", Ie), S.addEventListener("pointerout", De), S.addEventListener("pointerup", Oe, !0)), function() {
1409
1399
  t = !1, q.set(
1410
1400
  S,
@@ -1425,12 +1415,12 @@ function kt(e) {
1425
1415
  ), S.removeEventListener("pointerleave", Ge), S.removeEventListener("pointermove", Ie), S.removeEventListener("pointerout", De), S.removeEventListener("pointerup", Oe, !0)), s.disconnect();
1426
1416
  };
1427
1417
  }
1428
- function Gt() {
1418
+ function Dt() {
1429
1419
  const [e, t] = ne({}), n = Q(() => t({}), []);
1430
1420
  return [e, n];
1431
1421
  }
1432
- function ge(e) {
1433
- const t = ot();
1422
+ function ye(e) {
1423
+ const t = rt();
1434
1424
  return `${e ?? t}`;
1435
1425
  }
1436
1426
  const K = typeof window < "u" ? Ae : ue;
@@ -1443,7 +1433,7 @@ function ee(e) {
1443
1433
  [t]
1444
1434
  );
1445
1435
  }
1446
- function ye(...e) {
1436
+ function Se(...e) {
1447
1437
  return ee((t) => {
1448
1438
  e.forEach((n) => {
1449
1439
  if (n)
@@ -1460,18 +1450,18 @@ function ye(...e) {
1460
1450
  });
1461
1451
  });
1462
1452
  }
1463
- function Se(e) {
1453
+ function ve(e) {
1464
1454
  const t = O({ ...e });
1465
1455
  return K(() => {
1466
1456
  for (const n in e)
1467
1457
  t.current[n] = e[n];
1468
1458
  }, [e]), t.current;
1469
1459
  }
1470
- const Ze = it(null);
1471
- function It(e, t) {
1460
+ const Ze = st(null);
1461
+ function Ot(e, t) {
1472
1462
  const n = O({
1473
1463
  getLayout: () => ({}),
1474
- setLayout: Pt
1464
+ setLayout: Rt
1475
1465
  });
1476
1466
  Ne(t, () => n.current, []), K(() => {
1477
1467
  Object.assign(
@@ -1480,7 +1470,7 @@ function It(e, t) {
1480
1470
  );
1481
1471
  });
1482
1472
  }
1483
- function Dt({
1473
+ function Tt({
1484
1474
  children: e,
1485
1475
  className: t,
1486
1476
  defaultLayout: n,
@@ -1490,8 +1480,8 @@ function Dt({
1490
1480
  groupRef: l,
1491
1481
  id: r,
1492
1482
  onLayoutChange: a,
1493
- onLayoutChanged: c,
1494
- orientation: u = "horizontal",
1483
+ onLayoutChanged: u,
1484
+ orientation: c = "horizontal",
1495
1485
  resizeTargetMinimumSize: g = {
1496
1486
  coarse: 20,
1497
1487
  fine: 10
@@ -1499,32 +1489,32 @@ function Dt({
1499
1489
  style: b,
1500
1490
  ...S
1501
1491
  }) {
1502
- const h = O({
1492
+ const m = O({
1503
1493
  onLayoutChange: {},
1504
1494
  onLayoutChanged: {}
1505
1495
  }), d = ee((z) => {
1506
- U(h.current.onLayoutChange, z) || (h.current.onLayoutChange = z, a?.(z));
1496
+ U(m.current.onLayoutChange, z) || (m.current.onLayoutChange = z, a?.(z));
1507
1497
  }), f = ee((z) => {
1508
- U(h.current.onLayoutChanged, z) || (h.current.onLayoutChanged = z, c?.(z));
1509
- }), m = ge(r), v = O(null), [x, y] = Gt(), p = O({
1498
+ U(m.current.onLayoutChanged, z) || (m.current.onLayoutChanged = z, u?.(z));
1499
+ }), h = ye(r), v = O(null), [x, y] = Dt(), p = O({
1510
1500
  lastExpandedPanelSizes: {},
1511
1501
  layouts: {},
1512
1502
  panels: [],
1513
1503
  resizeTargetMinimumSize: g,
1514
1504
  separators: []
1515
- }), w = ye(v, s);
1516
- It(m, l);
1505
+ }), w = Se(v, s);
1506
+ Ot(h, l);
1517
1507
  const C = ee(
1518
1508
  (z, L) => {
1519
- const { interactionState: M, mountedGroups: E } = G();
1520
- for (const D of E.keys())
1509
+ const { interactionState: E, mountedGroups: M } = G();
1510
+ for (const D of M.keys())
1521
1511
  if (D.id === z) {
1522
- const T = E.get(D);
1512
+ const T = M.get(D);
1523
1513
  if (T) {
1524
1514
  let N = !1;
1525
- switch (M.state) {
1515
+ switch (E.state) {
1526
1516
  case "active": {
1527
- N = M.hitRegions.some(
1517
+ N = E.hitRegions.some(
1528
1518
  (Z) => Z.group === D
1529
1519
  );
1530
1520
  break;
@@ -1540,7 +1530,7 @@ function Dt({
1540
1530
  flexGrow: n?.[L] ?? 1
1541
1531
  };
1542
1532
  }
1543
- ), R = Se({
1533
+ ), R = ve({
1544
1534
  defaultLayout: n,
1545
1535
  disableCursor: o
1546
1536
  }), X = _e(
@@ -1549,79 +1539,79 @@ function Dt({
1549
1539
  return !!R.disableCursor;
1550
1540
  },
1551
1541
  getPanelStyles: C,
1552
- id: m,
1553
- orientation: u,
1542
+ id: h,
1543
+ orientation: c,
1554
1544
  registerPanel: (z) => {
1555
1545
  const L = p.current;
1556
- return L.panels = pe(u, [
1546
+ return L.panels = he(c, [
1557
1547
  ...L.panels,
1558
1548
  z
1559
1549
  ]), y(), () => {
1560
1550
  L.panels = L.panels.filter(
1561
- (M) => M !== z
1551
+ (E) => E !== z
1562
1552
  ), y();
1563
1553
  };
1564
1554
  },
1565
1555
  registerSeparator: (z) => {
1566
1556
  const L = p.current;
1567
- return L.separators = pe(u, [
1557
+ return L.separators = he(c, [
1568
1558
  ...L.separators,
1569
1559
  z
1570
1560
  ]), y(), () => {
1571
1561
  L.separators = L.separators.filter(
1572
- (M) => M !== z
1562
+ (E) => E !== z
1573
1563
  ), y();
1574
1564
  };
1575
1565
  },
1576
1566
  togglePanelDisabled: (z, L) => {
1577
- const E = p.current.panels.find(
1567
+ const M = p.current.panels.find(
1578
1568
  (T) => T.id === z
1579
1569
  );
1580
- E && (E.panelConstraints.disabled = L);
1570
+ M && (M.panelConstraints.disabled = L);
1581
1571
  const { mountedGroups: D } = G();
1582
1572
  for (const T of D.keys())
1583
- if (T.id === m) {
1573
+ if (T.id === h) {
1584
1574
  const N = D.get(T);
1585
- N && (N.derivedPanelConstraints = de(T));
1575
+ N && (N.derivedPanelConstraints = pe(T));
1586
1576
  }
1587
1577
  },
1588
1578
  toggleSeparatorDisabled: (z, L) => {
1589
- const E = p.current.separators.find(
1579
+ const M = p.current.separators.find(
1590
1580
  (D) => D.id === z
1591
1581
  );
1592
- E && (E.disabled = L);
1582
+ M && (M.disabled = L);
1593
1583
  }
1594
1584
  }),
1595
- [C, m, y, u, R]
1585
+ [C, h, y, c, R]
1596
1586
  ), V = O(null);
1597
1587
  return K(() => {
1598
1588
  const z = v.current;
1599
1589
  if (z === null)
1600
1590
  return;
1601
1591
  const L = p.current;
1602
- let M;
1592
+ let E;
1603
1593
  if (R.defaultLayout !== void 0 && Object.keys(R.defaultLayout).length === L.panels.length) {
1604
- M = {};
1594
+ E = {};
1605
1595
  for (const H of L.panels) {
1606
1596
  const j = R.defaultLayout[H.id];
1607
- j !== void 0 && (M[H.id] = j);
1597
+ j !== void 0 && (E[H.id] = j);
1608
1598
  }
1609
1599
  }
1610
- const E = {
1611
- defaultLayout: M,
1600
+ const M = {
1601
+ defaultLayout: E,
1612
1602
  disableCursor: !!R.disableCursor,
1613
1603
  disabled: !!i,
1614
1604
  element: z,
1615
- id: m,
1605
+ id: h,
1616
1606
  inMemoryLastExpandedPanelSizes: p.current.lastExpandedPanelSizes,
1617
1607
  inMemoryLayouts: p.current.layouts,
1618
- orientation: u,
1608
+ orientation: c,
1619
1609
  panels: L.panels,
1620
1610
  resizeTargetMinimumSize: L.resizeTargetMinimumSize,
1621
1611
  separators: L.separators
1622
1612
  };
1623
- V.current = E;
1624
- const D = kt(E), N = G().mountedGroups.get(E);
1613
+ V.current = M;
1614
+ const D = It(M), N = G().mountedGroups.get(M);
1625
1615
  if (N) {
1626
1616
  const { defaultLayoutDeferred: H, derivedPanelConstraints: j, layout: ie } = N;
1627
1617
  !H && j.length > 0 && (d(ie), f(ie));
@@ -1634,13 +1624,15 @@ function Dt({
1634
1624
  ), Qe = $.addListener(
1635
1625
  "mountedGroupsChange",
1636
1626
  (H) => {
1637
- const j = H.get(E);
1627
+ const j = H.get(M);
1638
1628
  if (j) {
1639
- const { defaultLayoutDeferred: ie, derivedPanelConstraints: et, layout: xe } = j;
1629
+ const { defaultLayoutDeferred: ie, derivedPanelConstraints: et, layout: ce } = j;
1640
1630
  if (ie || et.length === 0)
1641
1631
  return;
1642
- const { interactionState: tt } = G(), nt = tt.state !== "active";
1643
- d(xe), nt && f(xe);
1632
+ const tt = M.panels.map(({ id: it }) => it).join(",");
1633
+ M.inMemoryLayouts[tt] = ce;
1634
+ const { interactionState: nt } = G(), ot = nt.state !== "active";
1635
+ d(ce), ot && f(ce);
1644
1636
  }
1645
1637
  }
1646
1638
  );
@@ -1649,10 +1641,10 @@ function Dt({
1649
1641
  };
1650
1642
  }, [
1651
1643
  i,
1652
- m,
1644
+ h,
1653
1645
  f,
1654
1646
  d,
1655
- u,
1647
+ c,
1656
1648
  x,
1657
1649
  R
1658
1650
  ]), ue(() => {
@@ -1664,8 +1656,8 @@ function Dt({
1664
1656
  ...S,
1665
1657
  className: t,
1666
1658
  "data-group": !0,
1667
- "data-testid": m,
1668
- id: m,
1659
+ "data-testid": h,
1660
+ id: h,
1669
1661
  ref: w,
1670
1662
  style: {
1671
1663
  height: "100%",
@@ -1673,61 +1665,61 @@ function Dt({
1673
1665
  overflow: "hidden",
1674
1666
  ...b,
1675
1667
  display: "flex",
1676
- flexDirection: u === "horizontal" ? "row" : "column",
1668
+ flexDirection: c === "horizontal" ? "row" : "column",
1677
1669
  flexWrap: "nowrap",
1678
1670
  // Inform the browser that the library is handling touch events for this element
1679
1671
  // but still allow users to scroll content within panels in the non-resizing direction
1680
1672
  // NOTE This is not an inherited style
1681
1673
  // See github.com/bvaughn/react-resizable-panels/issues/662
1682
- touchAction: u === "horizontal" ? "pan-y" : "pan-x"
1674
+ touchAction: c === "horizontal" ? "pan-y" : "pan-x"
1683
1675
  },
1684
1676
  children: e
1685
1677
  }
1686
1678
  ) });
1687
1679
  }
1688
- Dt.displayName = "Group";
1689
- function fe(e, t) {
1680
+ Tt.displayName = "Group";
1681
+ function de(e, t) {
1690
1682
  return `react-resizable-panels:${[e, ...t].join(":")}`;
1691
1683
  }
1692
- function Vt({
1684
+ function Wt({
1693
1685
  debounceSaveMs: e = 100,
1694
1686
  panelIds: t,
1695
1687
  storage: n = localStorage,
1696
1688
  ...o
1697
1689
  }) {
1698
- const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = fe(s, t ?? []), r = Fe(
1699
- Ot,
1690
+ const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = de(s, t ?? []), r = Fe(
1691
+ At,
1700
1692
  () => n.getItem(l),
1701
1693
  () => n.getItem(l)
1702
1694
  ), a = _e(
1703
1695
  () => r ? JSON.parse(r) : void 0,
1704
1696
  [r]
1705
- ), c = O(null), u = Q(() => {
1706
- const S = c.current;
1707
- S && (c.current = null, clearTimeout(S));
1697
+ ), u = O(null), c = Q(() => {
1698
+ const S = u.current;
1699
+ S && (u.current = null, clearTimeout(S));
1708
1700
  }, []);
1709
1701
  Ae(() => () => {
1710
- u();
1711
- }, [u]);
1702
+ c();
1703
+ }, [c]);
1712
1704
  const g = Q(
1713
1705
  (S) => {
1714
- u();
1715
- let h;
1716
- i ? h = fe(s, Object.keys(S)) : h = fe(s, []);
1706
+ c();
1707
+ let m;
1708
+ i ? m = de(s, Object.keys(S)) : m = de(s, []);
1717
1709
  try {
1718
- n.setItem(h, JSON.stringify(S));
1710
+ n.setItem(m, JSON.stringify(S));
1719
1711
  } catch (d) {
1720
1712
  console.error(d);
1721
1713
  }
1722
1714
  },
1723
- [u, i, s, n]
1715
+ [c, i, s, n]
1724
1716
  ), b = Q(
1725
1717
  (S) => {
1726
- u(), e === 0 ? g(S) : c.current = setTimeout(() => {
1718
+ c(), e === 0 ? g(S) : u.current = setTimeout(() => {
1727
1719
  g(S);
1728
1720
  }, e);
1729
1721
  },
1730
- [u, e, g]
1722
+ [c, e, g]
1731
1723
  );
1732
1724
  return {
1733
1725
  /**
@@ -1746,33 +1738,33 @@ function Vt({
1746
1738
  onLayoutChanged: g
1747
1739
  };
1748
1740
  }
1749
- function Ot() {
1741
+ function At() {
1750
1742
  return function() {
1751
1743
  };
1752
1744
  }
1753
- function jt() {
1745
+ function Ut() {
1754
1746
  return ne(null);
1755
1747
  }
1756
- function Wt() {
1748
+ function Bt() {
1757
1749
  return O(null);
1758
1750
  }
1759
- function ve() {
1760
- const e = rt(Ze);
1751
+ function xe() {
1752
+ const e = at(Ze);
1761
1753
  return P(
1762
1754
  e,
1763
1755
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
1764
1756
  ), e;
1765
1757
  }
1766
- function Tt(e, t) {
1767
- const { id: n } = ve(), o = O({
1768
- collapse: ce,
1769
- expand: ce,
1758
+ function Nt(e, t) {
1759
+ const { id: n } = xe(), o = O({
1760
+ collapse: fe,
1761
+ expand: fe,
1770
1762
  getSize: () => ({
1771
1763
  asPercentage: 0,
1772
1764
  inPixels: 0
1773
1765
  }),
1774
1766
  isCollapsed: () => !1,
1775
- resize: ce
1767
+ resize: fe
1776
1768
  });
1777
1769
  Ne(t, () => o.current, []), K(() => {
1778
1770
  Object.assign(
@@ -1781,7 +1773,7 @@ function Tt(e, t) {
1781
1773
  );
1782
1774
  });
1783
1775
  }
1784
- function At({
1776
+ function _t({
1785
1777
  children: e,
1786
1778
  className: t,
1787
1779
  collapsedSize: n = "0%",
@@ -1791,32 +1783,32 @@ function At({
1791
1783
  elementRef: l,
1792
1784
  id: r,
1793
1785
  maxSize: a = "100%",
1794
- minSize: c = "0%",
1795
- onResize: u,
1786
+ minSize: u = "0%",
1787
+ onResize: c,
1796
1788
  panelRef: g,
1797
1789
  style: b,
1798
1790
  ...S
1799
1791
  }) {
1800
- const h = !!r, d = ge(r), f = Se({
1792
+ const m = !!r, d = ye(r), f = ve({
1801
1793
  disabled: s
1802
- }), m = O(null), v = ye(m, l), {
1794
+ }), h = O(null), v = Se(h, l), {
1803
1795
  getPanelStyles: x,
1804
1796
  id: y,
1805
1797
  orientation: p,
1806
1798
  registerPanel: w,
1807
1799
  togglePanelDisabled: C
1808
- } = ve(), R = u !== null, X = ee(
1809
- (z, L, M) => {
1810
- u?.(z, r, M);
1800
+ } = xe(), R = c !== null, X = ee(
1801
+ (z, L, E) => {
1802
+ c?.(z, r, E);
1811
1803
  }
1812
1804
  );
1813
1805
  K(() => {
1814
- const z = m.current;
1806
+ const z = h.current;
1815
1807
  if (z !== null) {
1816
1808
  const L = {
1817
1809
  element: z,
1818
1810
  id: d,
1819
- idIsStable: h,
1811
+ idIsStable: m,
1820
1812
  mutableValues: {
1821
1813
  expandToSize: void 0,
1822
1814
  prevSize: void 0
@@ -1828,7 +1820,7 @@ function At({
1828
1820
  defaultSize: i,
1829
1821
  disabled: f.disabled,
1830
1822
  maxSize: a,
1831
- minSize: c
1823
+ minSize: u
1832
1824
  }
1833
1825
  };
1834
1826
  return w(L);
@@ -1839,15 +1831,15 @@ function At({
1839
1831
  i,
1840
1832
  R,
1841
1833
  d,
1842
- h,
1834
+ m,
1843
1835
  a,
1844
- c,
1836
+ u,
1845
1837
  X,
1846
1838
  w,
1847
1839
  f
1848
1840
  ]), ue(() => {
1849
1841
  C(d, !!s);
1850
- }, [s, d, C]), Tt(d, g);
1842
+ }, [s, d, C]), Nt(d, g);
1851
1843
  const V = Fe(
1852
1844
  (z) => ($.addListener("mountedGroupsChange", z), () => {
1853
1845
  $.removeListener("mountedGroupsChange", z);
@@ -1867,7 +1859,7 @@ function At({
1867
1859
  id: d,
1868
1860
  ref: v,
1869
1861
  style: {
1870
- ...Nt,
1862
+ ...Ft,
1871
1863
  display: "flex",
1872
1864
  flexBasis: 0,
1873
1865
  flexShrink: 1,
@@ -1896,8 +1888,8 @@ function At({
1896
1888
  }
1897
1889
  );
1898
1890
  }
1899
- At.displayName = "Panel";
1900
- const Nt = {
1891
+ _t.displayName = "Panel";
1892
+ const Ft = {
1901
1893
  minHeight: 0,
1902
1894
  maxHeight: "100%",
1903
1895
  height: "auto",
@@ -1909,13 +1901,13 @@ const Nt = {
1909
1901
  padding: 0,
1910
1902
  margin: 0
1911
1903
  };
1912
- function Ut() {
1904
+ function Kt() {
1913
1905
  return ne(null);
1914
1906
  }
1915
- function Bt() {
1907
+ function Xt() {
1916
1908
  return O(null);
1917
1909
  }
1918
- function _t({
1910
+ function $t({
1919
1911
  layout: e,
1920
1912
  panelConstraints: t,
1921
1913
  panelId: n,
@@ -1926,13 +1918,13 @@ function _t({
1926
1918
  (a) => a.panelId === n
1927
1919
  );
1928
1920
  if (r) {
1929
- const a = r.maxSize, c = r.collapsible ? r.collapsedSize : r.minSize, u = [o, o + 1];
1921
+ const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
1930
1922
  s = B({
1931
1923
  layout: oe({
1932
- delta: c - l,
1924
+ delta: u - l,
1933
1925
  initialLayout: e,
1934
1926
  panelConstraints: t,
1935
- pivotIndices: u,
1927
+ pivotIndices: c,
1936
1928
  prevLayout: e
1937
1929
  }),
1938
1930
  panelConstraints: t
@@ -1941,7 +1933,7 @@ function _t({
1941
1933
  delta: a - l,
1942
1934
  initialLayout: e,
1943
1935
  panelConstraints: t,
1944
- pivotIndices: u,
1936
+ pivotIndices: c,
1945
1937
  prevLayout: e
1946
1938
  }),
1947
1939
  panelConstraints: t
@@ -1954,7 +1946,7 @@ function _t({
1954
1946
  valueNow: l
1955
1947
  };
1956
1948
  }
1957
- function Ft({
1949
+ function Ht({
1958
1950
  children: e,
1959
1951
  className: t,
1960
1952
  disabled: n,
@@ -1963,15 +1955,15 @@ function Ft({
1963
1955
  style: s,
1964
1956
  ...l
1965
1957
  }) {
1966
- const r = ge(i), a = Se({
1958
+ const r = ye(i), a = ve({
1967
1959
  disabled: n
1968
- }), [c, u] = ne({}), [g, b] = ne("inactive"), S = O(null), h = ye(S, o), {
1960
+ }), [u, c] = ne({}), [g, b] = ne("inactive"), S = O(null), m = Se(S, o), {
1969
1961
  disableCursor: d,
1970
1962
  id: f,
1971
- orientation: m,
1963
+ orientation: h,
1972
1964
  registerSeparator: v,
1973
1965
  toggleSeparatorDisabled: x
1974
- } = ve(), y = m === "horizontal" ? "vertical" : "horizontal";
1966
+ } = xe(), y = h === "horizontal" ? "vertical" : "horizontal";
1975
1967
  K(() => {
1976
1968
  const w = S.current;
1977
1969
  if (w !== null) {
@@ -1992,14 +1984,14 @@ function Ft({
1992
1984
  "mountedGroupsChange",
1993
1985
  (z) => {
1994
1986
  z.forEach(
1995
- ({ derivedPanelConstraints: L, layout: M, separatorToPanels: E }, D) => {
1987
+ ({ derivedPanelConstraints: L, layout: E, separatorToPanels: M }, D) => {
1996
1988
  if (D.id === f) {
1997
- const T = E.get(C);
1989
+ const T = M.get(C);
1998
1990
  if (T) {
1999
1991
  const N = T[0], Z = D.panels.indexOf(N);
2000
- u(
2001
- _t({
2002
- layout: M,
1992
+ c(
1993
+ $t({
1994
+ layout: E,
2003
1995
  panelConstraints: L,
2004
1996
  panelId: N.id,
2005
1997
  panelIndex: Z
@@ -2023,18 +2015,18 @@ function Ft({
2023
2015
  "div",
2024
2016
  {
2025
2017
  ...l,
2026
- "aria-controls": c.valueControls,
2018
+ "aria-controls": u.valueControls,
2027
2019
  "aria-disabled": n || void 0,
2028
2020
  "aria-orientation": y,
2029
- "aria-valuemax": c.valueMax,
2030
- "aria-valuemin": c.valueMin,
2031
- "aria-valuenow": c.valueNow,
2021
+ "aria-valuemax": u.valueMax,
2022
+ "aria-valuemin": u.valueMin,
2023
+ "aria-valuenow": u.valueNow,
2032
2024
  children: e,
2033
2025
  className: t,
2034
2026
  "data-separator": n ? "disabled" : g,
2035
2027
  "data-testid": r,
2036
2028
  id: r,
2037
- ref: h,
2029
+ ref: m,
2038
2030
  role: "separator",
2039
2031
  style: {
2040
2032
  flexBasis: "auto",
@@ -2050,16 +2042,16 @@ function Ft({
2050
2042
  }
2051
2043
  );
2052
2044
  }
2053
- Ft.displayName = "Separator";
2045
+ Ht.displayName = "Separator";
2054
2046
  export {
2055
- Dt as Group,
2056
- At as Panel,
2057
- Ft as Separator,
2058
- mt as isCoarsePointer,
2059
- Vt as useDefaultLayout,
2060
- jt as useGroupCallbackRef,
2061
- Wt as useGroupRef,
2062
- Ut as usePanelCallbackRef,
2063
- Bt as usePanelRef
2047
+ Tt as Group,
2048
+ _t as Panel,
2049
+ Ht as Separator,
2050
+ gt as isCoarsePointer,
2051
+ Wt as useDefaultLayout,
2052
+ Ut as useGroupCallbackRef,
2053
+ Bt as useGroupRef,
2054
+ Kt as usePanelCallbackRef,
2055
+ Xt as usePanelRef
2064
2056
  };
2065
2057
  //# sourceMappingURL=react-resizable-panels.js.map