react-resizable-panels 4.12.3 → 4.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  "use client";
2
- import { jsx as ae } from "react/jsx-runtime";
3
- import { useState as Q, useCallback as re, useId as mt, useLayoutEffect as Ke, useEffect as me, useRef as O, createContext as gt, useImperativeHandle as Xe, useMemo as Se, useSyncExternalStore as qe, useContext as yt } from "react";
2
+ import { jsx as se } from "react/jsx-runtime";
3
+ import { useState as Q, useCallback as ie, useId as mt, useLayoutEffect as Ke, useEffect as ge, useRef as O, createContext as gt, useImperativeHandle as Xe, useMemo as ve, useSyncExternalStore as qe, useContext as yt } from "react";
4
4
  function St(e, t) {
5
5
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
6
6
  return t * o;
@@ -25,7 +25,7 @@ function xt(e) {
25
25
  }
26
26
  }
27
27
  }
28
- function ie({
28
+ function oe({
29
29
  groupSize: e,
30
30
  panelElement: t,
31
31
  styleProp: n
@@ -69,7 +69,7 @@ function ne({
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 ve(e) {
72
+ function be(e) {
73
73
  const { panels: t } = e, n = ne({ group: e });
74
74
  return n === 0 ? t.map((o) => ({
75
75
  groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
@@ -84,7 +84,7 @@ function ve(e) {
84
84
  const { element: i, panelConstraints: s } = o;
85
85
  let u = 0;
86
86
  if (s.collapsedSize !== void 0) {
87
- const c = ie({
87
+ const c = oe({
88
88
  groupSize: n,
89
89
  panelElement: i,
90
90
  styleProp: s.collapsedSize
@@ -93,7 +93,7 @@ function ve(e) {
93
93
  }
94
94
  let a;
95
95
  if (s.defaultSize !== void 0) {
96
- const c = ie({
96
+ const c = oe({
97
97
  groupSize: n,
98
98
  panelElement: i,
99
99
  styleProp: s.defaultSize
@@ -102,7 +102,7 @@ function ve(e) {
102
102
  }
103
103
  let r = 0;
104
104
  if (s.minSize !== void 0) {
105
- const c = ie({
105
+ const c = oe({
106
106
  groupSize: n,
107
107
  panelElement: i,
108
108
  styleProp: s.minSize
@@ -111,7 +111,7 @@ function ve(e) {
111
111
  }
112
112
  let l = 100;
113
113
  if (s.maxSize !== void 0) {
114
- const c = ie({
114
+ const c = oe({
115
115
  groupSize: n,
116
116
  panelElement: i,
117
117
  styleProp: s.maxSize
@@ -134,7 +134,7 @@ function C(e, t = "Assertion error") {
134
134
  if (!e)
135
135
  throw Error(t);
136
136
  }
137
- function be(e, t) {
137
+ function ze(e, t) {
138
138
  return Array.from(t).sort(
139
139
  e === "horizontal" ? Pt : wt
140
140
  );
@@ -178,12 +178,12 @@ function Lt({
178
178
  }
179
179
  return C(i, "No rect found"), i;
180
180
  }
181
- let fe;
181
+ let de;
182
182
  function Ct() {
183
- return fe === void 0 && (typeof matchMedia == "function" ? fe = !!matchMedia("(pointer:coarse)").matches : fe = !1), fe;
183
+ return de === void 0 && (typeof matchMedia == "function" ? de = !!matchMedia("(pointer:coarse)").matches : de = !1), de;
184
184
  }
185
185
  function Ze(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, s = ze(
187
187
  n,
188
188
  Array.from(t.children).filter(Ye).map((z) => ({ element: z }))
189
189
  ).map(({ element: z }) => z), u = [];
@@ -343,32 +343,32 @@ let ee = {
343
343
  cursorFlags: 0,
344
344
  state: "inactive"
345
345
  };
346
- const ze = new Qe();
346
+ const xe = new Qe();
347
347
  function W() {
348
348
  return ee;
349
349
  }
350
350
  function Rt(e) {
351
- return ze.addListener("change", e);
351
+ return xe.addListener("change", e);
352
352
  }
353
353
  function Et(e) {
354
354
  const t = ee, n = { ...ee };
355
- n.cursorFlags = e, ee = n, ze.emit("change", {
355
+ n.cursorFlags = e, ee = n, xe.emit("change", {
356
356
  prev: t,
357
357
  next: n
358
358
  });
359
359
  }
360
360
  function te(e) {
361
361
  const t = ee;
362
- ee = e, ze.emit("change", {
362
+ ee = e, xe.emit("change", {
363
363
  prev: t,
364
364
  next: e
365
365
  });
366
366
  }
367
- const Mt = (e) => e, ye = () => {
367
+ const Mt = (e) => e, Se = () => {
368
368
  }, et = 1, tt = 2, nt = 4, ot = 8, Ie = 3, ke = 12;
369
- let de;
369
+ let pe;
370
370
  function De() {
371
- return de === void 0 && (de = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (de = !0)), de;
371
+ return pe === void 0 && (pe = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (pe = !0)), pe;
372
372
  }
373
373
  function It({
374
374
  cursorFlags: e,
@@ -414,7 +414,7 @@ function It({
414
414
  }
415
415
  }
416
416
  const Te = /* @__PURE__ */ new WeakMap();
417
- function xe(e) {
417
+ function Pe(e) {
418
418
  if (!e.defaultView || !e.adoptedStyleSheets)
419
419
  return;
420
420
  let { prevStyle: t, styleSheet: n } = Te.get(e) ?? {};
@@ -466,7 +466,7 @@ function H(e, t) {
466
466
  function V() {
467
467
  return F;
468
468
  }
469
- function Pe(e, t) {
469
+ function we(e, t) {
470
470
  return it.addListener("groupChange", (n) => {
471
471
  n.group.id === e && t(n);
472
472
  });
@@ -488,7 +488,7 @@ function rt(e) {
488
488
  te({
489
489
  cursorFlags: 0,
490
490
  state: "inactive"
491
- }), t.hitRegions.length > 0 && (xe(e), o = !0, t.hitRegions.forEach((i) => {
491
+ }), t.hitRegions.length > 0 && (Pe(e), o = !0, t.hitRegions.forEach((i) => {
492
492
  if (!n.has(i.group))
493
493
  return;
494
494
  const s = H(i.group.id, !0);
@@ -611,7 +611,7 @@ function _t({
611
611
  }
612
612
  return !0;
613
613
  }
614
- function we(e, t) {
614
+ function Le(e, t) {
615
615
  const n = [];
616
616
  return t.forEach((o, i) => {
617
617
  if (i.disabled)
@@ -635,11 +635,11 @@ function $t(e, t) {
635
635
  return !1;
636
636
  return !0;
637
637
  }
638
- function k(e, t, n = 0) {
638
+ function D(e, t, n = 0) {
639
639
  return Math.abs(T(e) - T(t)) <= n;
640
640
  }
641
641
  function A(e, t) {
642
- return k(e, t) ? 0 : e > t ? 1 : -1;
642
+ return D(e, t) ? 0 : e > t ? 1 : -1;
643
643
  }
644
644
  function Z({
645
645
  overrideDisabledPanels: e,
@@ -664,7 +664,7 @@ function Z({
664
664
  o = r;
665
665
  return o = Math.min(a, o), o = T(o), o;
666
666
  }
667
- function le({
667
+ function ae({
668
668
  delta: e,
669
669
  initialLayout: t,
670
670
  panelConstraints: n,
@@ -672,7 +672,7 @@ function le({
672
672
  prevLayout: i,
673
673
  trigger: s
674
674
  }) {
675
- if (k(e, 0))
675
+ if (D(e, 0))
676
676
  return t;
677
677
  const u = s === "imperative-api", a = Object.values(t), r = Object.values(i), l = [...a], [c, m] = o;
678
678
  C(c != null, "Invalid first pivot index"), C(m != null, "Invalid second pivot index");
@@ -695,7 +695,7 @@ function le({
695
695
  if (C(
696
696
  v != null,
697
697
  `Previous layout not found for panel index ${f}`
698
- ), k(v, h)) {
698
+ ), D(v, h)) {
699
699
  const g = b - v;
700
700
  A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
701
701
  }
@@ -717,7 +717,7 @@ function le({
717
717
  if (C(
718
718
  v != null,
719
719
  `Previous layout not found for panel index ${f}`
720
- ), k(v, b)) {
720
+ ), D(v, b)) {
721
721
  const g = v - h;
722
722
  A(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
723
723
  }
@@ -778,7 +778,7 @@ function le({
778
778
  prevSize: y,
779
779
  size: b
780
780
  });
781
- if (!k(y, v) && (p += y - v, l[d] = v, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
781
+ if (!D(y, v) && (p += y - v, l[d] = v, p.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
782
782
  numeric: !0
783
783
  }) >= 0))
784
784
  break;
@@ -799,7 +799,7 @@ function le({
799
799
  prevSize: d,
800
800
  size: h
801
801
  });
802
- if (l[f] = y, !k(y, h)) {
802
+ if (l[f] = y, !D(y, h)) {
803
803
  let b = h - y, g = e < 0 ? m : c;
804
804
  for (; g >= 0 && g < n.length; ) {
805
805
  const w = l[g];
@@ -813,7 +813,7 @@ function le({
813
813
  prevSize: w,
814
814
  size: E
815
815
  });
816
- if (k(w, L) || (b -= L - w, l[g] = L), k(b, 0))
816
+ if (D(w, L) || (b -= L - w, l[g] = L), D(b, 0))
817
817
  break;
818
818
  e > 0 ? g-- : g++;
819
819
  }
@@ -823,7 +823,7 @@ function le({
823
823
  (f, d) => d + f,
824
824
  0
825
825
  );
826
- if (!k(S, 100, 0.1))
826
+ if (!D(S, 100, 0.1))
827
827
  return i;
828
828
  const z = Object.keys(i);
829
829
  return l.reduce((f, d, h) => (f[z[h]] = d, f), {});
@@ -848,7 +848,7 @@ function X({
848
848
  throw Error(
849
849
  `Invalid ${t.length} panel layout: ${o.map((a) => `${a}%`).join(", ")}`
850
850
  );
851
- if (!k(i, 100) && o.length > 0)
851
+ if (!D(i, 100) && o.length > 0)
852
852
  for (let a = 0; a < t.length; a++) {
853
853
  const r = o[a];
854
854
  C(r != null, `No layout data found for index ${a}`);
@@ -869,7 +869,7 @@ function X({
869
869
  });
870
870
  l != c && (s += l - c, o[a] = c);
871
871
  }
872
- if (!k(s, 0))
872
+ if (!D(s, 0))
873
873
  for (let a = 0; a < t.length; a++) {
874
874
  const r = o[a];
875
875
  C(r != null, `No layout data found for index ${a}`);
@@ -879,7 +879,7 @@ function X({
879
879
  prevSize: r,
880
880
  size: l
881
881
  });
882
- if (r !== c && (s -= c - r, o[a] = c, k(s, 0)))
882
+ if (r !== c && (s -= c - r, o[a] = c, D(s, 0)))
883
883
  break;
884
884
  }
885
885
  const u = Object.keys(e);
@@ -937,7 +937,7 @@ function at({
937
937
  const p = s(), S = l.findIndex((h) => h.id === t), z = S === 0, f = S === l.length - 1;
938
938
  if (f && r < p && (z || l.slice(0, S).every((h, y) => {
939
939
  const b = m[y];
940
- return b?.collapsible && k(b.collapsedSize, c[b.panelId]);
940
+ return b?.collapsible && D(b.collapsedSize, c[b.panelId]);
941
941
  }))) {
942
942
  const h = l.slice(0, S).reduce((y, b) => y + c[b.id], 0);
943
943
  return {
@@ -945,7 +945,7 @@ function at({
945
945
  [t]: T(100 - h)
946
946
  };
947
947
  }
948
- return le({
948
+ return ae({
949
949
  delta: f ? p - r : r - p,
950
950
  initialLayout: c,
951
951
  panelConstraints: m,
@@ -1002,10 +1002,10 @@ function at({
1002
1002
  },
1003
1003
  isCollapsed: () => {
1004
1004
  const { collapsible: r, collapsedSize: l } = o(), c = s();
1005
- return r && k(l, c);
1005
+ return r && D(l, c);
1006
1006
  },
1007
1007
  resize: (r) => {
1008
- const { group: l } = n(), { element: c } = i(), m = ne({ group: l }), p = ie({
1008
+ const { group: l } = n(), { element: c } = i(), m = ne({ group: l }), p = oe({
1009
1009
  groupSize: m,
1010
1010
  panelElement: c,
1011
1011
  styleProp: r
@@ -1018,7 +1018,7 @@ function _e(e) {
1018
1018
  if (e.defaultPrevented)
1019
1019
  return;
1020
1020
  const t = V();
1021
- we(e, t).forEach((o) => {
1021
+ Le(e, t).forEach((o) => {
1022
1022
  if (o.separator && !o.separator.disableDoubleClick) {
1023
1023
  const i = o.panels.find(
1024
1024
  (s) => s.panelConstraints.defaultSize !== void 0
@@ -1033,7 +1033,7 @@ function _e(e) {
1033
1033
  }
1034
1034
  });
1035
1035
  }
1036
- function pe(e) {
1036
+ function he(e) {
1037
1037
  const t = V();
1038
1038
  for (const [n] of t)
1039
1039
  if (n.separators.some(
@@ -1080,13 +1080,13 @@ function lt({
1080
1080
  };
1081
1081
  }
1082
1082
  function B(e, t) {
1083
- const n = pe(e), o = H(n.id, !0), i = n.separators.find(
1083
+ const n = he(e), o = H(n.id, !0), i = n.separators.find(
1084
1084
  (m) => m.element === e
1085
1085
  );
1086
1086
  C(i, "Matching separator not found");
1087
1087
  const s = o.separatorToPanels.get(i);
1088
1088
  C(s, "Matching panels not found");
1089
- const u = s.map((m) => n.panels.indexOf(m)), r = lt({ groupId: n.id }).getLayout(), l = le({
1089
+ const u = s.map((m) => n.panels.indexOf(m)), r = lt({ groupId: n.id }).getLayout(), l = ae({
1090
1090
  delta: t,
1091
1091
  initialLayout: r,
1092
1092
  panelConstraints: o.derivedPanelConstraints,
@@ -1116,7 +1116,7 @@ function B(e, t) {
1116
1116
  function $e(e) {
1117
1117
  if (e.defaultPrevented)
1118
1118
  return;
1119
- const t = e.currentTarget, n = pe(t);
1119
+ const t = e.currentTarget, n = he(t);
1120
1120
  if (!n.disabled)
1121
1121
  switch (e.key) {
1122
1122
  case "ArrowDown": {
@@ -1141,7 +1141,7 @@ function $e(e) {
1141
1141
  }
1142
1142
  case "Enter": {
1143
1143
  e.preventDefault();
1144
- const o = pe(t), i = H(o.id, !0), { derivedPanelConstraints: s, layout: u, separatorToPanels: a } = i, r = o.separators.find(
1144
+ const o = he(t), i = H(o.id, !0), { derivedPanelConstraints: s, layout: u, separatorToPanels: a } = i, r = o.separators.find(
1145
1145
  (p) => p.element === t
1146
1146
  );
1147
1147
  C(r, "Matching separator not found");
@@ -1158,7 +1158,7 @@ function $e(e) {
1158
1158
  }
1159
1159
  case "F6": {
1160
1160
  e.preventDefault();
1161
- const i = pe(t).separators.map(
1161
+ const i = he(t).separators.map(
1162
1162
  (r) => r.element
1163
1163
  ), s = Array.from(i).findIndex(
1164
1164
  (r) => r === e.currentTarget
@@ -1181,7 +1181,7 @@ function je(e) {
1181
1181
  return;
1182
1182
  if (e.pointerType === "mouse" && e.button > 0)
1183
1183
  return;
1184
- const t = V(), n = we(e, t), o = /* @__PURE__ */ new Map();
1184
+ const t = V(), n = Le(e, t), o = /* @__PURE__ */ new Map();
1185
1185
  let i = !1;
1186
1186
  n.forEach((s) => {
1187
1187
  s.separator && (i || (i = !0, s.separator.element.focus({
@@ -1224,7 +1224,7 @@ function ut({
1224
1224
  separatorToPanels: w
1225
1225
  } = h;
1226
1226
  if (b && g && w) {
1227
- const E = le({
1227
+ const E = ae({
1228
1228
  delta: f,
1229
1229
  initialLayout: d,
1230
1230
  panelConstraints: b,
@@ -1255,7 +1255,7 @@ function ut({
1255
1255
  }
1256
1256
  });
1257
1257
  let r = 0;
1258
- t.movementX === 0 ? r |= u & Ie : r |= a & Ie, t.movementY === 0 ? r |= u & ke : r |= a & ke, Et(r), xe(e);
1258
+ t.movementX === 0 ? r |= u & Ie : r |= a & Ie, t.movementY === 0 ? r |= u & ke : r |= a & ke, Et(r), Pe(e);
1259
1259
  }
1260
1260
  function He(e) {
1261
1261
  const t = V(), n = W();
@@ -1297,7 +1297,7 @@ function Ve(e) {
1297
1297
  for (const o of t.hitRegions)
1298
1298
  if (o.separator) {
1299
1299
  const { element: i } = o.separator;
1300
- i.hasPointerCapture?.(e.pointerId) || i.setPointerCapture?.(e.pointerId);
1300
+ i.isConnected && !i.hasPointerCapture?.(e.pointerId) && i.setPointerCapture?.(e.pointerId);
1301
1301
  }
1302
1302
  ut({
1303
1303
  document: e.currentTarget,
@@ -1311,7 +1311,7 @@ function Ve(e) {
1311
1311
  break;
1312
1312
  }
1313
1313
  default: {
1314
- const o = we(e, n);
1314
+ const o = Le(e, n);
1315
1315
  o.length === 0 ? t.state !== "inactive" && te({
1316
1316
  cursorFlags: 0,
1317
1317
  state: "inactive"
@@ -1319,7 +1319,7 @@ function Ve(e) {
1319
1319
  cursorFlags: 0,
1320
1320
  hitRegions: o,
1321
1321
  state: "hover"
1322
- }), xe(e.currentTarget);
1322
+ }), Pe(e.currentTarget);
1323
1323
  break;
1324
1324
  }
1325
1325
  }
@@ -1458,7 +1458,7 @@ function Wt(e) {
1458
1458
  const v = H(e.id);
1459
1459
  if (!v)
1460
1460
  return;
1461
- const g = ve(e), w = v.defaultLayoutDeferred ? We(g) : v.layout, E = Ut({
1461
+ const g = be(e), w = v.defaultLayoutDeferred ? We(g) : v.layout, E = Ut({
1462
1462
  group: e,
1463
1463
  nextGroupSize: b,
1464
1464
  prevGroupSize: v.groupSize,
@@ -1490,7 +1490,7 @@ function Wt(e) {
1490
1490
  `Panel ids must be unique; id "${f.id}" was used more than once`
1491
1491
  ), o.add(f.id), f.onResize && s.observe(f.element);
1492
1492
  });
1493
- const u = ne({ group: e }), a = ve(e), r = e.panels.map(({ id: f }) => f).join(",");
1493
+ const u = ne({ group: e }), a = be(e), r = e.panels.map(({ id: f }) => f).join(",");
1494
1494
  let l = e.mutableState.defaultLayout;
1495
1495
  l && (Bt(e.panels, l) || (l = void 0));
1496
1496
  const c = e.mutableState.layouts[r] ?? l ?? We(a), m = X({
@@ -1537,25 +1537,25 @@ function Wt(e) {
1537
1537
  };
1538
1538
  }
1539
1539
  function Kt() {
1540
- const [e, t] = Q({}), n = re(() => t({}), []);
1540
+ const [e, t] = Q({}), n = ie(() => t({}), []);
1541
1541
  return [e, n];
1542
1542
  }
1543
- function Le(e) {
1543
+ function Ce(e) {
1544
1544
  const t = mt();
1545
1545
  return `${e ?? t}`;
1546
1546
  }
1547
- const q = typeof window < "u" ? Ke : me;
1548
- function se(e) {
1547
+ const q = typeof window < "u" ? Ke : ge;
1548
+ function re(e) {
1549
1549
  const t = O(e);
1550
1550
  return q(() => {
1551
1551
  t.current = e;
1552
- }, [e]), re(
1552
+ }, [e]), ie(
1553
1553
  (...n) => t.current?.(...n),
1554
1554
  [t]
1555
1555
  );
1556
1556
  }
1557
- function Ce(...e) {
1558
- return se((t) => {
1557
+ function Re(...e) {
1558
+ return re((t) => {
1559
1559
  e.forEach((n) => {
1560
1560
  if (n)
1561
1561
  switch (typeof n) {
@@ -1571,7 +1571,7 @@ function Ce(...e) {
1571
1571
  });
1572
1572
  });
1573
1573
  }
1574
- function Re(e) {
1574
+ function Ee(e) {
1575
1575
  const t = O({ ...e });
1576
1576
  return q(() => {
1577
1577
  for (const n in e)
@@ -1613,28 +1613,28 @@ function qt({
1613
1613
  const z = O({
1614
1614
  onLayoutChange: {},
1615
1615
  onLayoutChanged: {}
1616
- }), f = se((x) => {
1616
+ }), f = re((x) => {
1617
1617
  K(z.current.onLayoutChange, x) || (z.current.onLayoutChange = x, r?.(x));
1618
- }), d = se(
1618
+ }), d = re(
1619
1619
  (x, P) => {
1620
1620
  K(z.current.onLayoutChanged, x) || (z.current.onLayoutChanged = x, l?.(x, { isUserInteraction: P }));
1621
1621
  }
1622
- ), h = Le(a), y = O(null), [b, v] = Kt(), g = O({
1622
+ ), h = Ce(a), y = O(null), [b, v] = Kt(), g = O({
1623
1623
  lastExpandedPanelSizes: {},
1624
1624
  layouts: {},
1625
1625
  panels: [],
1626
1626
  resizeTargetMinimumSize: m,
1627
1627
  separators: []
1628
- }), w = Ce(y, s);
1628
+ }), w = Re(y, s);
1629
1629
  Xt(h, u);
1630
- const E = se(
1630
+ const E = re(
1631
1631
  (x, P) => {
1632
1632
  const I = W(), R = Oe(x), M = H(x);
1633
1633
  if (M) {
1634
- let D = !1;
1634
+ let k = !1;
1635
1635
  switch (I.state) {
1636
1636
  case "active": {
1637
- D = I.hitRegions.some(
1637
+ k = I.hitRegions.some(
1638
1638
  (U) => U.group === R
1639
1639
  );
1640
1640
  break;
@@ -1642,7 +1642,7 @@ function qt({
1642
1642
  }
1643
1643
  return {
1644
1644
  flexGrow: M.layout[P] ?? 1,
1645
- pointerEvents: D ? "none" : void 0
1645
+ pointerEvents: k ? "none" : void 0
1646
1646
  };
1647
1647
  }
1648
1648
  if (n?.[P])
@@ -1650,10 +1650,10 @@ function qt({
1650
1650
  flexGrow: n?.[P]
1651
1651
  };
1652
1652
  }
1653
- ), L = Re({
1653
+ ), L = Ee({
1654
1654
  defaultLayout: n,
1655
1655
  disableCursor: o
1656
- }), G = Se(
1656
+ }), G = ve(
1657
1657
  () => ({
1658
1658
  get disableCursor() {
1659
1659
  return !!L.disableCursor;
@@ -1663,7 +1663,7 @@ function qt({
1663
1663
  orientation: c,
1664
1664
  registerPanel: (x) => {
1665
1665
  const P = g.current;
1666
- return P.panels = be(c, [
1666
+ return P.panels = ze(c, [
1667
1667
  ...P.panels,
1668
1668
  x
1669
1669
  ]), v(), () => {
@@ -1674,7 +1674,7 @@ function qt({
1674
1674
  },
1675
1675
  registerSeparator: (x) => {
1676
1676
  const P = g.current;
1677
- return P.separators = be(c, [
1677
+ return P.separators = ze(c, [
1678
1678
  ...P.separators,
1679
1679
  x
1680
1680
  ]), v(), () => {
@@ -1688,10 +1688,10 @@ function qt({
1688
1688
  (U) => U.id === x
1689
1689
  );
1690
1690
  R && (R.panelConstraints.disabled = P);
1691
- const M = Oe(h), D = H(h);
1692
- M && D && j(M, {
1693
- ...D,
1694
- derivedPanelConstraints: ve(M)
1691
+ const M = Oe(h), k = H(h);
1692
+ M && k && j(M, {
1693
+ ...k,
1694
+ derivedPanelConstraints: be(M)
1695
1695
  });
1696
1696
  },
1697
1697
  updateSeparatorProps: (x, {
@@ -1699,7 +1699,7 @@ function qt({
1699
1699
  disableDoubleClick: I
1700
1700
  }) => {
1701
1701
  const M = g.current.separators.find(
1702
- (D) => D.id === x
1702
+ (k) => k.id === x
1703
1703
  );
1704
1704
  M && (M.disabled = P, M.disableDoubleClick = I);
1705
1705
  }
@@ -1735,33 +1735,33 @@ function qt({
1735
1735
  separators: P.separators
1736
1736
  };
1737
1737
  N.current = R;
1738
- const M = Wt(R), { defaultLayoutDeferred: D, derivedPanelConstraints: U, layout: ue } = H(R.id, !0);
1739
- !D && U.length > 0 && (f(ue), d(ue, !1));
1740
- const oe = Pe(h, (_) => {
1741
- const { defaultLayoutDeferred: Y, derivedPanelConstraints: Me, layout: ce } = _.next;
1742
- if (Y || Me.length === 0)
1738
+ const M = Wt(R), { defaultLayoutDeferred: k, derivedPanelConstraints: U, layout: le } = H(R.id, !0);
1739
+ !k && U.length > 0 && (f(le), d(le, !1));
1740
+ const ue = we(h, (_) => {
1741
+ const { defaultLayoutDeferred: Y, derivedPanelConstraints: ce, layout: fe } = _.next;
1742
+ if (Y || ce.length === 0)
1743
1743
  return;
1744
1744
  const ft = R.panels.map(({ id: $ }) => $).join(",");
1745
- R.mutableState.layouts[ft] = ce, Me.forEach(($) => {
1745
+ R.mutableState.layouts[ft] = fe, ce.forEach(($) => {
1746
1746
  if ($.collapsible) {
1747
- const { layout: ge } = _.prev ?? {};
1748
- if (ge) {
1749
- const pt = k(
1747
+ const { layout: ye } = _.prev ?? {};
1748
+ if (ye) {
1749
+ const pt = D(
1750
1750
  $.collapsedSize,
1751
- ce[$.panelId]
1752
- ), ht = k(
1751
+ fe[$.panelId]
1752
+ ), ht = D(
1753
1753
  $.collapsedSize,
1754
- ge[$.panelId]
1754
+ ye[$.panelId]
1755
1755
  );
1756
- pt && !ht && (R.mutableState.expandedPanelSizes[$.panelId] = ge[$.panelId]);
1756
+ pt && !ht && (R.mutableState.expandedPanelSizes[$.panelId] = ye[$.panelId]);
1757
1757
  }
1758
1758
  }
1759
1759
  });
1760
1760
  const dt = W().state !== "active";
1761
- f(ce), dt && d(ce, _.isUserInteraction);
1761
+ f(fe), dt && d(fe, _.isUserInteraction);
1762
1762
  });
1763
1763
  return () => {
1764
- N.current = null, M(), oe();
1764
+ N.current = null, M(), ue();
1765
1765
  };
1766
1766
  }, [
1767
1767
  i,
@@ -1771,10 +1771,10 @@ function qt({
1771
1771
  c,
1772
1772
  b,
1773
1773
  L
1774
- ]), me(() => {
1774
+ ]), ge(() => {
1775
1775
  const x = N.current;
1776
1776
  x && (x.mutableState.defaultLayout = n, x.mutableState.disableCursor = !!o);
1777
- }), /* @__PURE__ */ ae(ct.Provider, { value: G, children: /* @__PURE__ */ ae(
1777
+ }), /* @__PURE__ */ se(ct.Provider, { value: G, children: /* @__PURE__ */ se(
1778
1778
  "div",
1779
1779
  {
1780
1780
  ...S,
@@ -1802,7 +1802,7 @@ function qt({
1802
1802
  ) });
1803
1803
  }
1804
1804
  qt.displayName = "Group";
1805
- function he(e, t) {
1805
+ function me(e, t) {
1806
1806
  return `react-resizable-panels:${[e, ...t].join(":")}`;
1807
1807
  }
1808
1808
  function Yt({
@@ -1810,7 +1810,7 @@ function Yt({
1810
1810
  panelIds: t,
1811
1811
  storage: n
1812
1812
  }) {
1813
- const o = he(e, []), i = n.getItem(o);
1813
+ const o = me(e, []), i = n.getItem(o);
1814
1814
  if (i)
1815
1815
  try {
1816
1816
  const s = JSON.parse(i);
@@ -1847,31 +1847,31 @@ function an({
1847
1847
  storage: o = localStorage,
1848
1848
  ...i
1849
1849
  }) {
1850
- const s = n !== void 0, u = "id" in i ? i.id : i.groupId, a = he(u, n ?? []), r = qe(
1850
+ const s = n !== void 0, u = "id" in i ? i.id : i.groupId, a = me(u, n ?? []), r = qe(
1851
1851
  Jt,
1852
1852
  () => o.getItem(a),
1853
1853
  () => o.getItem(a)
1854
- ), l = Se(() => {
1854
+ ), l = ve(() => {
1855
1855
  if (r) {
1856
1856
  const d = JSON.parse(r), h = Object.values(d);
1857
1857
  if (Array.from(h).every((y) => typeof y == "number"))
1858
1858
  return d;
1859
1859
  }
1860
- }, [r]), c = Se(() => {
1860
+ }, [r]), c = ve(() => {
1861
1861
  if (!l)
1862
1862
  return Yt({
1863
1863
  id: u,
1864
1864
  panelIds: n,
1865
1865
  storage: o
1866
1866
  });
1867
- }, [l, u, n, o]), m = l ?? c, p = O(null), S = re(() => {
1867
+ }, [l, u, n, o]), m = l ?? c, p = O(null), S = ie(() => {
1868
1868
  const d = p.current;
1869
1869
  d && (p.current = null, clearTimeout(d));
1870
1870
  }, []);
1871
1871
  Ke(() => () => {
1872
1872
  S();
1873
1873
  }, [S]);
1874
- const z = re(
1874
+ const z = ie(
1875
1875
  // The hook persists every layout commit -- including library-driven ones --
1876
1876
  // because it owns its own storage and the goal is to remember whatever
1877
1877
  // layout the user is currently looking at. Consumers that only want to
@@ -1882,7 +1882,7 @@ function an({
1882
1882
  return;
1883
1883
  S();
1884
1884
  let y;
1885
- s ? y = he(u, Object.keys(d)) : y = he(u, []);
1885
+ s ? y = me(u, Object.keys(d)) : y = me(u, []);
1886
1886
  try {
1887
1887
  o.setItem(y, JSON.stringify(d));
1888
1888
  } catch (b) {
@@ -1896,7 +1896,7 @@ function an({
1896
1896
  t,
1897
1897
  o
1898
1898
  ]
1899
- ), f = re(
1899
+ ), f = ie(
1900
1900
  (d) => {
1901
1901
  S(), e === 0 ? z(d, { isUserInteraction: !1 }) : p.current = setTimeout(() => {
1902
1902
  z(d, { isUserInteraction: !1 });
@@ -1931,7 +1931,7 @@ function ln() {
1931
1931
  function un() {
1932
1932
  return O(null);
1933
1933
  }
1934
- function Ee() {
1934
+ function Me() {
1935
1935
  const e = yt(ct);
1936
1936
  return C(
1937
1937
  e,
@@ -1939,15 +1939,15 @@ function Ee() {
1939
1939
  ), e;
1940
1940
  }
1941
1941
  function Zt(e, t) {
1942
- const { id: n } = Ee(), o = O({
1943
- collapse: ye,
1944
- expand: ye,
1942
+ const { id: n } = Me(), o = O({
1943
+ collapse: Se,
1944
+ expand: Se,
1945
1945
  getSize: () => ({
1946
1946
  asPercentage: 0,
1947
1947
  inPixels: 0
1948
1948
  }),
1949
1949
  isCollapsed: () => !1,
1950
- resize: ye
1950
+ resize: Se
1951
1951
  });
1952
1952
  Xe(t, () => o.current, []), q(() => {
1953
1953
  Object.assign(
@@ -1973,17 +1973,17 @@ function Qt({
1973
1973
  style: S,
1974
1974
  ...z
1975
1975
  }) {
1976
- const f = !!r, d = Le(r), h = Re({
1976
+ const f = !!r, d = Ce(r), h = Ee({
1977
1977
  disabled: s
1978
- }), y = O(null), b = Ce(y, u), {
1978
+ }), y = O(null), b = Re(y, u), {
1979
1979
  getPanelStyles: v,
1980
1980
  id: g,
1981
1981
  orientation: w,
1982
1982
  registerPanel: E,
1983
1983
  updatePanelProps: L
1984
- } = Ee(), G = m !== null, N = se(
1985
- (R, M, D) => {
1986
- m?.(R, r, D);
1984
+ } = Me(), G = m !== null, N = re(
1985
+ (R, M, k) => {
1986
+ m?.(R, r, k);
1987
1987
  }
1988
1988
  );
1989
1989
  q(() => {
@@ -2023,7 +2023,7 @@ function Qt({
2023
2023
  N,
2024
2024
  E,
2025
2025
  h
2026
- ]), me(() => {
2026
+ ]), ge(() => {
2027
2027
  L(d, { disabled: s });
2028
2028
  }, [s, d, L]), Zt(d, p);
2029
2029
  const x = () => {
@@ -2031,7 +2031,7 @@ function Qt({
2031
2031
  if (R)
2032
2032
  return JSON.stringify(R);
2033
2033
  }, P = qe(
2034
- (R) => Pe(g, R),
2034
+ (R) => we(g, R),
2035
2035
  x,
2036
2036
  x
2037
2037
  );
@@ -2040,7 +2040,7 @@ function Qt({
2040
2040
  flexGrow: void 0,
2041
2041
  flexShrink: void 0,
2042
2042
  flexBasis: i
2043
- } : I = { flexGrow: 1 }, /* @__PURE__ */ ae(
2043
+ } : I = { flexGrow: 1 }, /* @__PURE__ */ se(
2044
2044
  "div",
2045
2045
  {
2046
2046
  ...z,
@@ -2057,7 +2057,7 @@ function Qt({
2057
2057
  overflow: "visible",
2058
2058
  ...I
2059
2059
  },
2060
- children: /* @__PURE__ */ ae(
2060
+ children: /* @__PURE__ */ se(
2061
2061
  "div",
2062
2062
  {
2063
2063
  className: t,
@@ -2111,7 +2111,7 @@ function tn({
2111
2111
  if (a) {
2112
2112
  const r = a.maxSize, l = a.collapsible ? a.collapsedSize : a.minSize, c = [o, o + 1];
2113
2113
  s = X({
2114
- layout: le({
2114
+ layout: ae({
2115
2115
  delta: l - u,
2116
2116
  initialLayout: e,
2117
2117
  panelConstraints: t,
@@ -2120,7 +2120,7 @@ function tn({
2120
2120
  }),
2121
2121
  panelConstraints: t
2122
2122
  })[n], i = X({
2123
- layout: le({
2123
+ layout: ae({
2124
2124
  delta: r - u,
2125
2125
  initialLayout: e,
2126
2126
  panelConstraints: t,
@@ -2147,16 +2147,16 @@ function nn({
2147
2147
  style: u,
2148
2148
  ...a
2149
2149
  }) {
2150
- const r = Le(s), l = Re({
2150
+ const r = Ce(s), l = Ee({
2151
2151
  disabled: n,
2152
2152
  disableDoubleClick: o
2153
- }), [c, m] = Q({}), [p, S] = Q("inactive"), [z, f] = Q(!1), d = O(null), h = Ce(d, i), {
2153
+ }), [c, m] = Q({}), [p, S] = Q("inactive"), [z, f] = Q(!1), d = O(null), h = Re(d, i), {
2154
2154
  disableCursor: y,
2155
2155
  id: b,
2156
2156
  orientation: v,
2157
2157
  registerSeparator: g,
2158
2158
  updateSeparatorProps: w
2159
- } = Ee(), E = v === "horizontal" ? "vertical" : "horizontal";
2159
+ } = Me(), E = v === "horizontal" ? "vertical" : "horizontal";
2160
2160
  q(() => {
2161
2161
  const N = d.current;
2162
2162
  if (N !== null) {
@@ -2169,20 +2169,22 @@ function nn({
2169
2169
  (M) => {
2170
2170
  S(
2171
2171
  M.next.state !== "inactive" && M.next.hitRegions.some(
2172
- (D) => D.separator === x
2172
+ (k) => k.separator === x
2173
2173
  ) ? M.next.state : "inactive"
2174
2174
  );
2175
2175
  }
2176
- ), R = Pe(
2176
+ ), R = we(
2177
2177
  b,
2178
2178
  (M) => {
2179
- const { derivedPanelConstraints: D, layout: U, separatorToPanels: ue } = M.next, oe = ue.get(x);
2180
- if (oe) {
2181
- const _ = oe[0], Y = oe.indexOf(_);
2179
+ const { derivedPanelConstraints: k, layout: U, separatorToPanels: le } = M.next, ue = le.get(x);
2180
+ if (ue) {
2181
+ const _ = ue[0], Y = k.findIndex(
2182
+ (ce) => ce.panelId === _.id
2183
+ );
2182
2184
  m(
2183
2185
  tn({
2184
2186
  layout: U,
2185
- panelConstraints: D,
2187
+ panelConstraints: k,
2186
2188
  panelId: _.id,
2187
2189
  panelIndex: Y
2188
2190
  })
@@ -2194,7 +2196,7 @@ function nn({
2194
2196
  I(), R(), P();
2195
2197
  };
2196
2198
  }
2197
- }, [b, r, g, l]), me(() => {
2199
+ }, [b, r, g, l]), ge(() => {
2198
2200
  w(r, { disabled: n, disableDoubleClick: o });
2199
2201
  }, [n, o, r, w]);
2200
2202
  let L;
@@ -2211,7 +2213,7 @@ function nn({
2211
2213
  default:
2212
2214
  z ? G = "focus" : G = p;
2213
2215
  }
2214
- return /* @__PURE__ */ ae(
2216
+ return /* @__PURE__ */ se(
2215
2217
  "div",
2216
2218
  {
2217
2219
  ...a,