react-resizable-panels 4.7.6 → 4.9.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,15 +1,15 @@
1
1
  "use client";
2
2
  import { jsx as ie } from "react/jsx-runtime";
3
- import { useState as re, useCallback as ne, useId as pt, useLayoutEffect as Be, useEffect as de, useRef as T, createContext as ht, useImperativeHandle as We, useMemo as Ue, useSyncExternalStore as Ke, useContext as mt } from "react";
3
+ import { useState as re, useCallback as ne, useId as pt, useLayoutEffect as We, useEffect as he, useRef as O, createContext as ht, useImperativeHandle as Ue, useMemo as ye, useSyncExternalStore as Ke, 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;
7
7
  }
8
- function St(e, t) {
8
+ function yt(e, t) {
9
9
  const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
10
10
  return t * o;
11
11
  }
12
- function yt(e) {
12
+ function St(e) {
13
13
  return e / 100 * window.innerHeight;
14
14
  }
15
15
  function vt(e) {
@@ -42,7 +42,7 @@ function te({
42
42
  break;
43
43
  }
44
44
  case "rem": {
45
- o = St(t, i);
45
+ o = yt(t, i);
46
46
  break;
47
47
  }
48
48
  case "em": {
@@ -50,7 +50,7 @@ function te({
50
50
  break;
51
51
  }
52
52
  case "vh": {
53
- o = yt(i);
53
+ o = St(i);
54
54
  break;
55
55
  }
56
56
  case "vw": {
@@ -60,7 +60,7 @@ function te({
60
60
  }
61
61
  return o;
62
62
  }
63
- function D(e) {
63
+ function T(e) {
64
64
  return parseFloat(e.toFixed(3));
65
65
  }
66
66
  function Q({
@@ -69,7 +69,7 @@ function Q({
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 ge(e) {
72
+ function Se(e) {
73
73
  const { panels: t } = e, n = Q({ group: e });
74
74
  return n === 0 ? t.map((o) => ({
75
75
  groupResizeBehavior: o.panelConstraints.groupResizeBehavior,
@@ -84,39 +84,39 @@ function ge(e) {
84
84
  const { element: i, panelConstraints: s } = o;
85
85
  let l = 0;
86
86
  if (s.collapsedSize !== void 0) {
87
- const c = te({
87
+ const f = te({
88
88
  groupSize: n,
89
89
  panelElement: i,
90
90
  styleProp: s.collapsedSize
91
91
  });
92
- l = D(c / n * 100);
92
+ l = T(f / n * 100);
93
93
  }
94
94
  let r;
95
95
  if (s.defaultSize !== void 0) {
96
- const c = te({
96
+ const f = te({
97
97
  groupSize: n,
98
98
  panelElement: i,
99
99
  styleProp: s.defaultSize
100
100
  });
101
- r = D(c / n * 100);
101
+ r = T(f / n * 100);
102
102
  }
103
103
  let a = 0;
104
104
  if (s.minSize !== void 0) {
105
- const c = te({
105
+ const f = te({
106
106
  groupSize: n,
107
107
  panelElement: i,
108
108
  styleProp: s.minSize
109
109
  });
110
- a = D(c / n * 100);
110
+ a = T(f / n * 100);
111
111
  }
112
- let u = 100;
112
+ let c = 100;
113
113
  if (s.maxSize !== void 0) {
114
- const c = te({
114
+ const f = te({
115
115
  groupSize: n,
116
116
  panelElement: i,
117
117
  styleProp: s.maxSize
118
118
  });
119
- u = D(c / n * 100);
119
+ c = T(f / n * 100);
120
120
  }
121
121
  return {
122
122
  groupResizeBehavior: s.groupResizeBehavior,
@@ -125,25 +125,25 @@ function ge(e) {
125
125
  defaultSize: r,
126
126
  disabled: s.disabled,
127
127
  minSize: a,
128
- maxSize: u,
128
+ maxSize: c,
129
129
  panelId: o.id
130
130
  };
131
131
  });
132
132
  }
133
- function L(e, t = "Assertion error") {
133
+ function C(e, t = "Assertion error") {
134
134
  if (!e)
135
135
  throw Error(t);
136
136
  }
137
- function Se(e, t) {
137
+ function ve(e, t) {
138
138
  return Array.from(t).sort(
139
- e === "horizontal" ? xt : bt
139
+ e === "horizontal" ? bt : xt
140
140
  );
141
141
  }
142
- function xt(e, t) {
142
+ function bt(e, t) {
143
143
  const n = e.element.offsetLeft - t.element.offsetLeft;
144
144
  return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
145
145
  }
146
- function bt(e, t) {
146
+ function xt(e, t) {
147
147
  const n = e.element.offsetTop - t.element.offsetTop;
148
148
  return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
149
149
  }
@@ -173,128 +173,128 @@ function wt({
173
173
  };
174
174
  let i, s = Number.MAX_VALUE;
175
175
  for (const l of t) {
176
- const { x: r, y: a } = qe(o, l), u = e === "horizontal" ? r : a;
177
- u < s && (s = u, i = l);
176
+ const { x: r, y: a } = qe(o, l), c = e === "horizontal" ? r : a;
177
+ c < s && (s = c, i = l);
178
178
  }
179
- return L(i, "No rect found"), i;
179
+ return C(i, "No rect found"), i;
180
180
  }
181
- let ue;
181
+ let ce;
182
182
  function Pt() {
183
- return ue === void 0 && (typeof matchMedia == "function" ? ue = !!matchMedia("(pointer:coarse)").matches : ue = !1), ue;
183
+ return ce === void 0 && (typeof matchMedia == "function" ? ce = !!matchMedia("(pointer:coarse)").matches : ce = !1), ce;
184
184
  }
185
185
  function Ye(e) {
186
- const { element: t, orientation: n, panels: o, separators: i } = e, s = Se(
186
+ const { element: t, orientation: n, panels: o, separators: i } = e, s = ve(
187
187
  n,
188
188
  Array.from(t.children).filter(Xe).map((b) => ({ element: b }))
189
189
  ).map(({ element: b }) => b), l = [];
190
- let r = !1, a = !1, u = -1, c = -1, m = 0, d, v = [];
190
+ let r = !1, a = !1, c = -1, f = -1, g = 0, d, z = [];
191
191
  {
192
192
  let b = -1;
193
- for (const f of s)
194
- f.hasAttribute("data-panel") && (b++, f.hasAttribute("data-disabled") || (m++, u === -1 && (u = b), c = b));
193
+ for (const u of s)
194
+ u.hasAttribute("data-panel") && (b++, u.hasAttribute("data-disabled") || (g++, c === -1 && (c = b), f = b));
195
195
  }
196
- if (m > 1) {
196
+ if (g > 1) {
197
197
  let b = -1;
198
- for (const f of s)
199
- if (f.hasAttribute("data-panel")) {
198
+ for (const u of s)
199
+ if (u.hasAttribute("data-panel")) {
200
200
  b++;
201
- const h = o.find(
202
- (g) => g.element === f
201
+ const p = o.find(
202
+ (m) => m.element === u
203
203
  );
204
- if (h) {
204
+ if (p) {
205
205
  if (d) {
206
- const g = d.element.getBoundingClientRect(), y = f.getBoundingClientRect();
207
- let z;
206
+ const m = d.element.getBoundingClientRect(), S = u.getBoundingClientRect();
207
+ let v;
208
208
  if (a) {
209
- const S = n === "horizontal" ? new DOMRect(
210
- g.right,
211
- g.top,
209
+ const y = n === "horizontal" ? new DOMRect(
210
+ m.right,
211
+ m.top,
212
212
  0,
213
- g.height
213
+ m.height
214
214
  ) : new DOMRect(
215
- g.left,
216
- g.bottom,
217
- g.width,
215
+ m.left,
216
+ m.bottom,
217
+ m.width,
218
218
  0
219
- ), p = n === "horizontal" ? new DOMRect(y.left, y.top, 0, y.height) : new DOMRect(y.left, y.top, y.width, 0);
220
- switch (v.length) {
219
+ ), h = n === "horizontal" ? new DOMRect(S.left, S.top, 0, S.height) : new DOMRect(S.left, S.top, S.width, 0);
220
+ switch (z.length) {
221
221
  case 0: {
222
- z = [
223
- S,
224
- p
222
+ v = [
223
+ y,
224
+ h
225
225
  ];
226
226
  break;
227
227
  }
228
228
  case 1: {
229
- const P = v[0], M = wt({
229
+ const P = z[0], M = wt({
230
230
  orientation: n,
231
- rects: [g, y],
231
+ rects: [m, S],
232
232
  targetRect: P.element.getBoundingClientRect()
233
233
  });
234
- z = [
234
+ v = [
235
235
  P,
236
- M === g ? p : S
236
+ M === m ? h : y
237
237
  ];
238
238
  break;
239
239
  }
240
240
  default: {
241
- z = v;
241
+ v = z;
242
242
  break;
243
243
  }
244
244
  }
245
245
  } else
246
- v.length ? z = v : z = [
246
+ z.length ? v = z : v = [
247
247
  n === "horizontal" ? new DOMRect(
248
- g.right,
249
- y.top,
250
- y.left - g.right,
251
- y.height
248
+ m.right,
249
+ S.top,
250
+ S.left - m.right,
251
+ S.height
252
252
  ) : new DOMRect(
253
- y.left,
254
- g.bottom,
255
- y.width,
256
- y.top - g.bottom
253
+ S.left,
254
+ m.bottom,
255
+ S.width,
256
+ S.top - m.bottom
257
257
  )
258
258
  ];
259
- for (const S of z) {
260
- let p = "width" in S ? S : S.element.getBoundingClientRect();
259
+ for (const y of v) {
260
+ let h = "width" in y ? y : y.element.getBoundingClientRect();
261
261
  const P = Pt() ? e.resizeTargetMinimumSize.coarse : e.resizeTargetMinimumSize.fine;
262
- if (p.width < P) {
263
- const C = P - p.width;
264
- p = new DOMRect(
265
- p.x - C / 2,
266
- p.y,
267
- p.width + C,
268
- p.height
262
+ if (h.width < P) {
263
+ const L = P - h.width;
264
+ h = new DOMRect(
265
+ h.x - L / 2,
266
+ h.y,
267
+ h.width + L,
268
+ h.height
269
269
  );
270
270
  }
271
- if (p.height < P) {
272
- const C = P - p.height;
273
- p = new DOMRect(
274
- p.x,
275
- p.y - C / 2,
276
- p.width,
277
- p.height + C
271
+ if (h.height < P) {
272
+ const L = P - h.height;
273
+ h = new DOMRect(
274
+ h.x,
275
+ h.y - L / 2,
276
+ h.width,
277
+ h.height + L
278
278
  );
279
279
  }
280
- const M = b <= u || b > c;
280
+ const M = b <= c || b > f;
281
281
  !r && !M && l.push({
282
282
  group: e,
283
283
  groupSize: Q({ group: e }),
284
- panels: [d, h],
285
- separator: "width" in S ? void 0 : S,
286
- rect: p
284
+ panels: [d, p],
285
+ separator: "width" in y ? void 0 : y,
286
+ rect: h
287
287
  }), r = !1;
288
288
  }
289
289
  }
290
- a = !1, d = h, v = [];
290
+ a = !1, d = p, z = [];
291
291
  }
292
- } else if (f.hasAttribute("data-separator")) {
293
- f.ariaDisabled !== null && (r = !0);
294
- const h = i.find(
295
- (g) => g.element === f
292
+ } else if (u.hasAttribute("data-separator")) {
293
+ u.ariaDisabled !== null && (r = !0);
294
+ const p = i.find(
295
+ (m) => m.element === u
296
296
  );
297
- h ? v.push(h) : (d = void 0, v = []);
297
+ p ? z.push(p) : (d = void 0, z = []);
298
298
  } else
299
299
  a = !0;
300
300
  }
@@ -320,8 +320,8 @@ class Je {
320
320
  const a = l[r];
321
321
  try {
322
322
  a.call(null, n);
323
- } catch (u) {
324
- s === null && (i = !0, s = u);
323
+ } catch (c) {
324
+ s === null && (i = !0, s = c);
325
325
  }
326
326
  }
327
327
  if (i)
@@ -344,12 +344,12 @@ const Ze = new Je();
344
344
  function Lt(e) {
345
345
  A = new Map(A), A.delete(e);
346
346
  }
347
- function Me(e, t) {
347
+ function Ee(e, t) {
348
348
  for (const [n] of A)
349
349
  if (n.id === e)
350
350
  return n;
351
351
  }
352
- function $(e, t) {
352
+ function j(e, t) {
353
353
  for (const [n, o] of A)
354
354
  if (n.id === e)
355
355
  return o;
@@ -359,7 +359,7 @@ function $(e, t) {
359
359
  function U() {
360
360
  return A;
361
361
  }
362
- function ye(e, t) {
362
+ function ze(e, t) {
363
363
  return Ze.addListener("groupChange", (n) => {
364
364
  n.group.id === e && t(n);
365
365
  });
@@ -401,19 +401,19 @@ 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: ke(e),
405
- b: ke(t)
404
+ a: De(e),
405
+ b: De(t)
406
406
  };
407
407
  let o;
408
408
  for (; n.a.at(-1) === n.b.at(-1); )
409
409
  o = n.a.pop(), n.b.pop();
410
- L(
410
+ C(
411
411
  o,
412
412
  "Stacking order can only be calculated for elements with a common ancestor"
413
413
  );
414
414
  const i = {
415
- a: Ie(Ee(n.a)),
416
- b: Ie(Ee(n.b))
415
+ a: Ie(ke(n.a)),
416
+ b: Ie(ke(n.b))
417
417
  };
418
418
  if (i.a === i.b) {
419
419
  const s = o.childNodes, l = {
@@ -430,26 +430,26 @@ function Mt(e, t) {
430
430
  return Math.sign(i.a - i.b);
431
431
  }
432
432
  const Et = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
433
- function It(e) {
433
+ function kt(e) {
434
434
  const t = getComputedStyle(Qe(e) ?? e).display;
435
435
  return t === "flex" || t === "inline-flex";
436
436
  }
437
- function kt(e) {
437
+ function It(e) {
438
438
  const t = getComputedStyle(e);
439
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || It(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" || Et.test(t.willChange) || t.webkitOverflowScrolling === "touch");
439
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || kt(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" || Et.test(t.willChange) || t.webkitOverflowScrolling === "touch");
440
440
  }
441
- function Ee(e) {
441
+ function ke(e) {
442
442
  let t = e.length;
443
443
  for (; t--; ) {
444
444
  const n = e[t];
445
- if (L(n, "Missing node"), kt(n)) return n;
445
+ if (C(n, "Missing node"), It(n)) return n;
446
446
  }
447
447
  return null;
448
448
  }
449
449
  function Ie(e) {
450
450
  return e && Number(getComputedStyle(e).zIndex) || 0;
451
451
  }
452
- function ke(e) {
452
+ function De(e) {
453
453
  const t = [];
454
454
  for (; e; )
455
455
  t.push(e), e = Qe(e);
@@ -481,7 +481,7 @@ function Tt({
481
481
  }
482
482
  return !0;
483
483
  }
484
- function ve(e, t) {
484
+ function be(e, t) {
485
485
  const n = [];
486
486
  return t.forEach((o, i) => {
487
487
  if (i.disabled)
@@ -505,11 +505,11 @@ function Ot(e, t) {
505
505
  return !1;
506
506
  return !0;
507
507
  }
508
- function k(e, t, n = 0) {
509
- return Math.abs(D(e) - D(t)) <= n;
508
+ function D(e, t, n = 0) {
509
+ return Math.abs(T(e) - T(t)) <= n;
510
510
  }
511
511
  function G(e, t) {
512
- return k(e, t) ? 0 : e > t ? 1 : -1;
512
+ return D(e, t) ? 0 : e > t ? 1 : -1;
513
513
  }
514
514
  function Y({
515
515
  overrideDisabledPanels: e,
@@ -528,11 +528,11 @@ function Y({
528
528
  return n;
529
529
  if (G(o, a) < 0)
530
530
  if (s) {
531
- const u = (i + a) / 2;
532
- G(o, u) < 0 ? o = i : o = a;
531
+ const c = (i + a) / 2;
532
+ G(o, c) < 0 ? o = i : o = a;
533
533
  } else
534
534
  o = a;
535
- return o = Math.min(r, o), o = D(o), o;
535
+ return o = Math.min(r, o), o = T(o), o;
536
536
  }
537
537
  function se({
538
538
  delta: e,
@@ -542,163 +542,163 @@ function se({
542
542
  prevLayout: i,
543
543
  trigger: s
544
544
  }) {
545
- if (k(e, 0))
545
+ if (D(e, 0))
546
546
  return t;
547
- const l = s === "imperative-api", r = Object.values(t), a = Object.values(i), u = [...r], [c, m] = o;
548
- L(c != null, "Invalid first pivot index"), L(m != null, "Invalid second pivot index");
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");
549
549
  let d = 0;
550
550
  switch (s) {
551
551
  case "keyboard": {
552
552
  {
553
- const f = e < 0 ? m : c, h = n[f];
554
- L(
555
- h,
556
- `Panel constraints not found for index ${f}`
553
+ const u = e < 0 ? g : f, p = n[u];
554
+ C(
555
+ p,
556
+ `Panel constraints not found for index ${u}`
557
557
  );
558
558
  const {
559
- collapsedSize: g = 0,
560
- collapsible: y,
561
- minSize: z = 0
562
- } = h;
563
- if (y) {
564
- const S = r[f];
565
- if (L(
566
- S != null,
567
- `Previous layout not found for panel index ${f}`
568
- ), k(S, g)) {
569
- const p = z - S;
570
- G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
559
+ collapsedSize: m = 0,
560
+ collapsible: S,
561
+ minSize: v = 0
562
+ } = p;
563
+ if (S) {
564
+ const y = r[u];
565
+ if (C(
566
+ y != null,
567
+ `Previous layout not found for panel index ${u}`
568
+ ), D(y, m)) {
569
+ const h = v - y;
570
+ G(h, Math.abs(e)) > 0 && (e = e < 0 ? 0 - h : h);
571
571
  }
572
572
  }
573
573
  }
574
574
  {
575
- const f = e < 0 ? c : m, h = n[f];
576
- L(
577
- h,
578
- `No panel constraints found for index ${f}`
575
+ const u = e < 0 ? f : g, p = n[u];
576
+ C(
577
+ p,
578
+ `No panel constraints found for index ${u}`
579
579
  );
580
580
  const {
581
- collapsedSize: g = 0,
582
- collapsible: y,
583
- minSize: z = 0
584
- } = h;
585
- if (y) {
586
- const S = r[f];
587
- if (L(
588
- S != null,
589
- `Previous layout not found for panel index ${f}`
590
- ), k(S, z)) {
591
- const p = S - g;
592
- G(p, Math.abs(e)) > 0 && (e = e < 0 ? 0 - p : p);
581
+ collapsedSize: m = 0,
582
+ collapsible: S,
583
+ minSize: v = 0
584
+ } = p;
585
+ if (S) {
586
+ const y = r[u];
587
+ if (C(
588
+ y != null,
589
+ `Previous layout not found for panel index ${u}`
590
+ ), D(y, v)) {
591
+ const h = y - m;
592
+ G(h, Math.abs(e)) > 0 && (e = e < 0 ? 0 - h : h);
593
593
  }
594
594
  }
595
595
  }
596
596
  break;
597
597
  }
598
598
  default: {
599
- const f = e < 0 ? m : c, h = n[f];
600
- L(
601
- h,
602
- `Panel constraints not found for index ${f}`
599
+ const u = e < 0 ? g : f, p = n[u];
600
+ C(
601
+ p,
602
+ `Panel constraints not found for index ${u}`
603
603
  );
604
- const g = r[f], { collapsible: y, collapsedSize: z, minSize: S } = h;
605
- if (y && G(g, S) < 0)
604
+ const m = r[u], { collapsible: S, collapsedSize: v, minSize: y } = p;
605
+ if (S && G(m, y) < 0)
606
606
  if (e > 0) {
607
- const p = S - z, P = p / 2, M = g + e;
608
- G(M, S) < 0 && (e = G(e, P) <= 0 ? 0 : p);
607
+ const h = y - v, P = h / 2, M = m + e;
608
+ G(M, y) < 0 && (e = G(e, P) <= 0 ? 0 : h);
609
609
  } else {
610
- const p = S - z, P = 100 - p / 2, M = g - e;
611
- G(M, S) < 0 && (e = G(100 + e, P) > 0 ? 0 : -p);
610
+ const h = y - v, P = 100 - h / 2, M = m - e;
611
+ G(M, y) < 0 && (e = G(100 + e, P) > 0 ? 0 : -h);
612
612
  }
613
613
  break;
614
614
  }
615
615
  }
616
616
  {
617
- const f = e < 0 ? 1 : -1;
618
- let h = e < 0 ? m : c, g = 0;
617
+ const u = e < 0 ? 1 : -1;
618
+ let p = e < 0 ? g : f, m = 0;
619
619
  for (; ; ) {
620
- const z = r[h];
621
- L(
622
- z != null,
623
- `Previous layout not found for panel index ${h}`
620
+ const v = r[p];
621
+ C(
622
+ v != null,
623
+ `Previous layout not found for panel index ${p}`
624
624
  );
625
- const p = Y({
625
+ const h = Y({
626
626
  overrideDisabledPanels: l,
627
- panelConstraints: n[h],
628
- prevSize: z,
627
+ panelConstraints: n[p],
628
+ prevSize: v,
629
629
  size: 100
630
- }) - z;
631
- if (g += p, h += f, h < 0 || h >= n.length)
630
+ }) - v;
631
+ if (m += h, p += u, p < 0 || p >= n.length)
632
632
  break;
633
633
  }
634
- const y = Math.min(Math.abs(e), Math.abs(g));
635
- e = e < 0 ? 0 - y : y;
634
+ const S = Math.min(Math.abs(e), Math.abs(m));
635
+ e = e < 0 ? 0 - S : S;
636
636
  }
637
637
  {
638
- let h = e < 0 ? c : m;
639
- for (; h >= 0 && h < n.length; ) {
640
- const g = Math.abs(e) - Math.abs(d), y = r[h];
641
- L(
642
- y != null,
643
- `Previous layout not found for panel index ${h}`
638
+ let p = e < 0 ? f : g;
639
+ for (; p >= 0 && p < n.length; ) {
640
+ const m = Math.abs(e) - Math.abs(d), S = r[p];
641
+ C(
642
+ S != null,
643
+ `Previous layout not found for panel index ${p}`
644
644
  );
645
- const z = y - g, S = Y({
645
+ const v = S - m, y = Y({
646
646
  overrideDisabledPanels: l,
647
- panelConstraints: n[h],
648
- prevSize: y,
649
- size: z
647
+ panelConstraints: n[p],
648
+ prevSize: S,
649
+ size: v
650
650
  });
651
- if (!k(y, S) && (d += y - S, u[h] = S, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
651
+ if (!D(S, y) && (d += S - y, c[p] = y, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
652
652
  numeric: !0
653
653
  }) >= 0))
654
654
  break;
655
- e < 0 ? h-- : h++;
655
+ e < 0 ? p-- : p++;
656
656
  }
657
657
  }
658
- if (Ot(a, u))
658
+ if (Ot(a, c))
659
659
  return i;
660
660
  {
661
- const f = e < 0 ? m : c, h = r[f];
662
- L(
663
- h != null,
664
- `Previous layout not found for panel index ${f}`
661
+ const u = e < 0 ? g : f, p = r[u];
662
+ C(
663
+ p != null,
664
+ `Previous layout not found for panel index ${u}`
665
665
  );
666
- const g = h + d, y = Y({
666
+ const m = p + d, S = Y({
667
667
  overrideDisabledPanels: l,
668
- panelConstraints: n[f],
669
- prevSize: h,
670
- size: g
668
+ panelConstraints: n[u],
669
+ prevSize: p,
670
+ size: m
671
671
  });
672
- if (u[f] = y, !k(y, g)) {
673
- let z = g - y, p = e < 0 ? m : c;
674
- for (; p >= 0 && p < n.length; ) {
675
- const P = u[p];
676
- L(
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 P = c[h];
676
+ C(
677
677
  P != null,
678
- `Previous layout not found for panel index ${p}`
678
+ `Previous layout not found for panel index ${h}`
679
679
  );
680
- const M = P + z, C = Y({
680
+ const M = P + v, L = Y({
681
681
  overrideDisabledPanels: l,
682
- panelConstraints: n[p],
682
+ panelConstraints: n[h],
683
683
  prevSize: P,
684
684
  size: M
685
685
  });
686
- if (k(P, C) || (z -= C - P, u[p] = C), k(z, 0))
686
+ if (D(P, L) || (v -= L - P, c[h] = L), D(v, 0))
687
687
  break;
688
- e > 0 ? p-- : p++;
688
+ e > 0 ? h-- : h++;
689
689
  }
690
690
  }
691
691
  }
692
- const v = Object.values(u).reduce(
693
- (f, h) => h + f,
692
+ const z = Object.values(c).reduce(
693
+ (u, p) => p + u,
694
694
  0
695
695
  );
696
- if (!k(v, 100, 0.1))
696
+ if (!D(z, 100, 0.1))
697
697
  return i;
698
698
  const b = Object.keys(i);
699
- return u.reduce((f, h, g) => (f[b[g]] = h, f), {});
699
+ return c.reduce((u, p, m) => (u[b[m]] = p, u), {});
700
700
  }
701
- function j(e, t) {
701
+ function V(e, t) {
702
702
  if (Object.keys(e).length !== Object.keys(t).length)
703
703
  return !1;
704
704
  for (const n in e)
@@ -718,42 +718,42 @@ function B({
718
718
  throw Error(
719
719
  `Invalid ${t.length} panel layout: ${o.map((r) => `${r}%`).join(", ")}`
720
720
  );
721
- if (!k(i, 100) && o.length > 0)
721
+ if (!D(i, 100) && o.length > 0)
722
722
  for (let r = 0; r < t.length; r++) {
723
723
  const a = o[r];
724
- L(a != null, `No layout data found for index ${r}`);
725
- const u = 100 / i * a;
726
- o[r] = u;
724
+ C(a != null, `No layout data found for index ${r}`);
725
+ const c = 100 / i * a;
726
+ o[r] = c;
727
727
  }
728
728
  let s = 0;
729
729
  for (let r = 0; r < t.length; r++) {
730
730
  const a = n[r];
731
- L(a != null, `No layout data found for index ${r}`);
732
- const u = o[r];
733
- L(u != null, `No layout data found for index ${r}`);
734
- const c = Y({
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 = Y({
735
735
  overrideDisabledPanels: !0,
736
736
  panelConstraints: t[r],
737
737
  prevSize: a,
738
- size: u
738
+ size: c
739
739
  });
740
- u != c && (s += u - c, o[r] = c);
740
+ c != f && (s += c - f, o[r] = f);
741
741
  }
742
- if (!k(s, 0))
742
+ if (!D(s, 0))
743
743
  for (let r = 0; r < t.length; r++) {
744
744
  const a = o[r];
745
- L(a != null, `No layout data found for index ${r}`);
746
- const u = a + s, c = Y({
745
+ C(a != null, `No layout data found for index ${r}`);
746
+ const c = a + s, f = Y({
747
747
  overrideDisabledPanels: !0,
748
748
  panelConstraints: t[r],
749
749
  prevSize: a,
750
- size: u
750
+ size: c
751
751
  });
752
- if (a !== c && (s -= c - a, o[r] = c, k(s, 0)))
752
+ if (a !== f && (s -= f - a, o[r] = f, D(s, 0)))
753
753
  break;
754
754
  }
755
755
  const l = Object.keys(e);
756
- return o.reduce((r, a, u) => (r[l[u]] = a, r), {});
756
+ return o.reduce((r, a, c) => (r[l[c]] = a, r), {});
757
757
  }
758
758
  function et({
759
759
  groupId: e,
@@ -764,21 +764,21 @@ function et({
764
764
  for (const [
765
765
  a,
766
766
  {
767
- defaultLayoutDeferred: u,
768
- derivedPanelConstraints: c,
769
- layout: m,
767
+ defaultLayoutDeferred: c,
768
+ derivedPanelConstraints: f,
769
+ layout: g,
770
770
  groupSize: d,
771
- separatorToPanels: v
771
+ separatorToPanels: z
772
772
  }
773
773
  ] of r)
774
774
  if (a.id === e)
775
775
  return {
776
- defaultLayoutDeferred: u,
777
- derivedPanelConstraints: c,
776
+ defaultLayoutDeferred: c,
777
+ derivedPanelConstraints: f,
778
778
  group: a,
779
779
  groupSize: d,
780
- layout: m,
781
- separatorToPanels: v
780
+ layout: g,
781
+ separatorToPanels: z
782
782
  };
783
783
  throw Error(`Group ${e} not found`);
784
784
  }, o = () => {
@@ -803,70 +803,70 @@ function et({
803
803
  if (r === a)
804
804
  return;
805
805
  const {
806
- defaultLayoutDeferred: u,
807
- derivedPanelConstraints: c,
808
- group: m,
806
+ defaultLayoutDeferred: c,
807
+ derivedPanelConstraints: f,
808
+ group: g,
809
809
  groupSize: d,
810
- layout: v,
810
+ layout: z,
811
811
  separatorToPanels: b
812
- } = n(), f = m.panels.findIndex((z) => z.id === t), h = f === m.panels.length - 1, g = se({
813
- delta: h ? a - r : r - a,
814
- initialLayout: v,
815
- panelConstraints: c,
816
- pivotIndices: h ? [f - 1, f] : [f, f + 1],
817
- prevLayout: v,
812
+ } = n(), u = g.panels.findIndex((v) => v.id === t), p = u === g.panels.length - 1, m = se({
813
+ delta: p ? a - r : r - a,
814
+ initialLayout: z,
815
+ panelConstraints: f,
816
+ pivotIndices: p ? [u - 1, u] : [u, u + 1],
817
+ prevLayout: z,
818
818
  trigger: "imperative-api"
819
- }), y = B({
820
- layout: g,
821
- panelConstraints: c
819
+ }), S = B({
820
+ layout: m,
821
+ panelConstraints: f
822
822
  });
823
- j(v, y) || _(m, {
824
- defaultLayoutDeferred: u,
825
- derivedPanelConstraints: c,
823
+ V(z, S) || _(g, {
824
+ defaultLayoutDeferred: c,
825
+ derivedPanelConstraints: f,
826
826
  groupSize: d,
827
- layout: y,
827
+ layout: S,
828
828
  separatorToPanels: b
829
829
  });
830
830
  };
831
831
  return {
832
832
  collapse: () => {
833
- const { collapsible: r, collapsedSize: a } = o(), { mutableValues: u } = i(), c = s();
834
- r && c !== a && (u.expandToSize = c, l(a));
833
+ const { collapsible: r, collapsedSize: a } = o(), { mutableValues: c } = i(), f = s();
834
+ r && f !== a && (c.expandToSize = f, l(a));
835
835
  },
836
836
  expand: () => {
837
- const { collapsible: r, collapsedSize: a, minSize: u } = o(), { mutableValues: c } = i(), m = s();
838
- if (r && m === a) {
839
- let d = c.expandToSize ?? u;
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
840
  d === 0 && (d = 1), l(d);
841
841
  }
842
842
  },
843
843
  getSize: () => {
844
- const { group: r } = n(), a = s(), { element: u } = i(), c = r.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
844
+ const { group: r } = n(), a = s(), { element: c } = i(), f = r.orientation === "horizontal" ? c.offsetWidth : c.offsetHeight;
845
845
  return {
846
846
  asPercentage: a,
847
- inPixels: c
847
+ inPixels: f
848
848
  };
849
849
  },
850
850
  isCollapsed: () => {
851
- const { collapsible: r, collapsedSize: a } = o(), u = s();
852
- return r && k(a, u);
851
+ const { collapsible: r, collapsedSize: a } = o(), c = s();
852
+ return r && D(a, c);
853
853
  },
854
854
  resize: (r) => {
855
- const { group: a } = n(), { element: u } = i(), c = Q({ group: a }), m = te({
856
- groupSize: c,
857
- panelElement: u,
855
+ const { group: a } = n(), { element: c } = i(), f = Q({ group: a }), g = te({
856
+ groupSize: f,
857
+ panelElement: c,
858
858
  styleProp: r
859
- }), d = D(m / c * 100);
859
+ }), d = T(g / f * 100);
860
860
  l(d);
861
861
  }
862
862
  };
863
863
  }
864
- function De(e) {
864
+ function Te(e) {
865
865
  if (e.defaultPrevented)
866
866
  return;
867
867
  const t = U();
868
- ve(e, t).forEach((o) => {
869
- if (o.separator) {
868
+ be(e, t).forEach((o) => {
869
+ if (o.separator && !o.separator.disableDoubleClick) {
870
870
  const i = o.panels.find(
871
871
  (s) => s.panelConstraints.defaultSize !== void 0
872
872
  );
@@ -880,7 +880,7 @@ function De(e) {
880
880
  }
881
881
  });
882
882
  }
883
- function fe(e) {
883
+ function de(e) {
884
884
  const t = U();
885
885
  for (const [n] of t)
886
886
  if (n.separators.some(
@@ -912,97 +912,97 @@ function tt({
912
912
  groupSize: l,
913
913
  layout: r,
914
914
  separatorToPanels: a
915
- } = t(), u = B({
915
+ } = t(), c = B({
916
916
  layout: n,
917
917
  panelConstraints: i
918
918
  });
919
- return o ? r : (j(r, u) || _(s, {
919
+ return o ? r : (V(r, c) || _(s, {
920
920
  defaultLayoutDeferred: o,
921
921
  derivedPanelConstraints: i,
922
922
  groupSize: l,
923
- layout: u,
923
+ layout: c,
924
924
  separatorToPanels: a
925
- }), u);
925
+ }), c);
926
926
  }
927
927
  };
928
928
  }
929
- function V(e, t) {
930
- const n = fe(e), o = $(n.id, !0), i = n.separators.find(
931
- (m) => m.element === e
929
+ function H(e, t) {
930
+ const n = de(e), o = j(n.id, !0), i = n.separators.find(
931
+ (g) => g.element === e
932
932
  );
933
- L(i, "Matching separator not found");
933
+ C(i, "Matching separator not found");
934
934
  const s = o.separatorToPanels.get(i);
935
- L(s, "Matching panels not found");
936
- const l = s.map((m) => n.panels.indexOf(m)), a = tt({ groupId: n.id }).getLayout(), u = se({
935
+ C(s, "Matching panels not found");
936
+ const l = s.map((g) => n.panels.indexOf(g)), a = tt({ groupId: n.id }).getLayout(), c = se({
937
937
  delta: t,
938
938
  initialLayout: a,
939
939
  panelConstraints: o.derivedPanelConstraints,
940
940
  pivotIndices: l,
941
941
  prevLayout: a,
942
942
  trigger: "keyboard"
943
- }), c = B({
944
- layout: u,
943
+ }), f = B({
944
+ layout: c,
945
945
  panelConstraints: o.derivedPanelConstraints
946
946
  });
947
- j(a, c) || _(n, {
947
+ V(a, f) || _(n, {
948
948
  defaultLayoutDeferred: o.defaultLayoutDeferred,
949
949
  derivedPanelConstraints: o.derivedPanelConstraints,
950
950
  groupSize: o.groupSize,
951
- layout: c,
951
+ layout: f,
952
952
  separatorToPanels: o.separatorToPanels
953
953
  });
954
954
  }
955
- function Te(e) {
955
+ function Oe(e) {
956
956
  if (e.defaultPrevented)
957
957
  return;
958
- const t = e.currentTarget, n = fe(t);
958
+ const t = e.currentTarget, n = de(t);
959
959
  if (!n.disabled)
960
960
  switch (e.key) {
961
961
  case "ArrowDown": {
962
- e.preventDefault(), n.orientation === "vertical" && V(t, 5);
962
+ e.preventDefault(), n.orientation === "vertical" && H(t, 5);
963
963
  break;
964
964
  }
965
965
  case "ArrowLeft": {
966
- e.preventDefault(), n.orientation === "horizontal" && V(t, -5);
966
+ e.preventDefault(), n.orientation === "horizontal" && H(t, -5);
967
967
  break;
968
968
  }
969
969
  case "ArrowRight": {
970
- e.preventDefault(), n.orientation === "horizontal" && V(t, 5);
970
+ e.preventDefault(), n.orientation === "horizontal" && H(t, 5);
971
971
  break;
972
972
  }
973
973
  case "ArrowUp": {
974
- e.preventDefault(), n.orientation === "vertical" && V(t, -5);
974
+ e.preventDefault(), n.orientation === "vertical" && H(t, -5);
975
975
  break;
976
976
  }
977
977
  case "End": {
978
- e.preventDefault(), V(t, 100);
978
+ e.preventDefault(), H(t, 100);
979
979
  break;
980
980
  }
981
981
  case "Enter": {
982
982
  e.preventDefault();
983
- const o = fe(t), i = $(o.id, !0), { derivedPanelConstraints: s, layout: l, separatorToPanels: r } = i, a = o.separators.find(
983
+ const o = de(t), i = j(o.id, !0), { derivedPanelConstraints: s, layout: l, separatorToPanels: r } = i, a = o.separators.find(
984
984
  (d) => d.element === t
985
985
  );
986
- L(a, "Matching separator not found");
987
- const u = r.get(a);
988
- L(u, "Matching panels not found");
989
- const c = u[0], m = s.find(
990
- (d) => d.panelId === c.id
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
991
991
  );
992
- if (L(m, "Panel metadata not found"), m.collapsible) {
993
- const d = l[c.id], v = m.collapsedSize === d ? o.mutableState.expandedPanelSizes[c.id] ?? m.minSize : m.collapsedSize;
994
- V(t, v - d);
992
+ if (C(g, "Panel metadata not found"), g.collapsible) {
993
+ const d = l[f.id], z = g.collapsedSize === d ? o.mutableState.expandedPanelSizes[f.id] ?? g.minSize : g.collapsedSize;
994
+ H(t, z - d);
995
995
  }
996
996
  break;
997
997
  }
998
998
  case "F6": {
999
999
  e.preventDefault();
1000
- const i = fe(t).separators.map(
1000
+ const i = de(t).separators.map(
1001
1001
  (a) => a.element
1002
1002
  ), s = Array.from(i).findIndex(
1003
1003
  (a) => a === e.currentTarget
1004
1004
  );
1005
- L(s !== null, "Index not found");
1005
+ C(s !== null, "Index not found");
1006
1006
  const l = e.shiftKey ? s > 0 ? s - 1 : i.length - 1 : s + 1 < i.length ? s + 1 : 0;
1007
1007
  i[l].focus({
1008
1008
  preventScroll: !0
@@ -1010,7 +1010,7 @@ function Te(e) {
1010
1010
  break;
1011
1011
  }
1012
1012
  case "Home": {
1013
- e.preventDefault(), V(t, -100);
1013
+ e.preventDefault(), H(t, -100);
1014
1014
  break;
1015
1015
  }
1016
1016
  }
@@ -1019,33 +1019,33 @@ let J = {
1019
1019
  cursorFlags: 0,
1020
1020
  state: "inactive"
1021
1021
  };
1022
- const ze = new Je();
1022
+ const xe = new Je();
1023
1023
  function W() {
1024
1024
  return J;
1025
1025
  }
1026
1026
  function Gt(e) {
1027
- return ze.addListener("change", e);
1027
+ return xe.addListener("change", e);
1028
1028
  }
1029
1029
  function At(e) {
1030
1030
  const t = J, n = { ...J };
1031
- n.cursorFlags = e, J = n, ze.emit("change", {
1031
+ n.cursorFlags = e, J = n, xe.emit("change", {
1032
1032
  prev: t,
1033
1033
  next: n
1034
1034
  });
1035
1035
  }
1036
1036
  function Z(e) {
1037
1037
  const t = J;
1038
- J = e, ze.emit("change", {
1038
+ J = e, xe.emit("change", {
1039
1039
  prev: t,
1040
1040
  next: e
1041
1041
  });
1042
1042
  }
1043
- function Oe(e) {
1043
+ function Ge(e) {
1044
1044
  if (e.defaultPrevented)
1045
1045
  return;
1046
1046
  if (e.pointerType === "mouse" && e.button > 0)
1047
1047
  return;
1048
- const t = U(), n = ve(e, t), o = /* @__PURE__ */ new Map();
1048
+ const t = U(), n = be(e, t), o = /* @__PURE__ */ new Map();
1049
1049
  let i = !1;
1050
1050
  n.forEach((s) => {
1051
1051
  s.separator && (i || (i = !0, s.separator.element.focus({
@@ -1061,11 +1061,11 @@ function Oe(e) {
1061
1061
  state: "active"
1062
1062
  }), n.length && e.preventDefault();
1063
1063
  }
1064
- const Nt = (e) => e, he = () => {
1065
- }, nt = 1, ot = 2, it = 4, rt = 8, Ge = 3, Ae = 12;
1066
- let ce;
1067
- function Ne() {
1068
- return ce === void 0 && (ce = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (ce = !0)), ce;
1064
+ const Nt = (e) => e, ge = () => {
1065
+ }, nt = 1, ot = 2, it = 4, rt = 8, Ae = 3, Ne = 12;
1066
+ let fe;
1067
+ function _e() {
1068
+ return fe === void 0 && (fe = !1, typeof window < "u" && (window.navigator.userAgent.includes("Chrome") || window.navigator.userAgent.includes("Firefox")) && (fe = !0)), fe;
1069
1069
  }
1070
1070
  function _t({
1071
1071
  cursorFlags: e,
@@ -1093,7 +1093,7 @@ function _t({
1093
1093
  if (!(o === 0 && i === 0)) {
1094
1094
  switch (n) {
1095
1095
  case "active": {
1096
- if (e && Ne()) {
1096
+ if (e && _e()) {
1097
1097
  const s = (e & nt) !== 0, l = (e & ot) !== 0, r = (e & it) !== 0, a = (e & rt) !== 0;
1098
1098
  if (s)
1099
1099
  return r ? "se-resize" : a ? "ne-resize" : "e-resize";
@@ -1107,14 +1107,14 @@ function _t({
1107
1107
  break;
1108
1108
  }
1109
1109
  }
1110
- return Ne() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
1110
+ return _e() ? o > 0 && i > 0 ? "move" : o > 0 ? "ew-resize" : "ns-resize" : o > 0 && i > 0 ? "grab" : o > 0 ? "col-resize" : "row-resize";
1111
1111
  }
1112
1112
  }
1113
- const _e = /* @__PURE__ */ new WeakMap();
1114
- function xe(e) {
1113
+ const Fe = /* @__PURE__ */ new WeakMap();
1114
+ function we(e) {
1115
1115
  if (e.defaultView === null || e.defaultView === void 0)
1116
1116
  return;
1117
- let { prevStyle: t, styleSheet: n } = _e.get(e) ?? {};
1117
+ let { prevStyle: t, styleSheet: n } = Fe.get(e) ?? {};
1118
1118
  n === void 0 && (n = new e.defaultView.CSSStyleSheet(), e.adoptedStyleSheets && e.adoptedStyleSheets.push(n));
1119
1119
  const o = W();
1120
1120
  switch (o.state) {
@@ -1135,7 +1135,7 @@ function xe(e) {
1135
1135
  break;
1136
1136
  }
1137
1137
  }
1138
- _e.set(e, {
1138
+ Fe.set(e, {
1139
1139
  prevStyle: t,
1140
1140
  styleSheet: n
1141
1141
  });
@@ -1150,55 +1150,55 @@ function st({
1150
1150
  prevCursorFlags: l
1151
1151
  }) {
1152
1152
  let r = 0;
1153
- n.forEach((u) => {
1154
- const { group: c, groupSize: m } = u, { orientation: d, panels: v } = c, { disableCursor: b } = c.mutableState;
1155
- let f = 0;
1156
- s ? d === "horizontal" ? f = (t.clientX - s.x) / m * 100 : f = (t.clientY - s.y) / m * 100 : d === "horizontal" ? f = t.clientX < 0 ? -100 : 100 : f = t.clientY < 0 ? -100 : 100;
1157
- const h = o.get(c), g = i.get(c);
1158
- if (!h || !g)
1153
+ n.forEach((c) => {
1154
+ const { group: f, groupSize: g } = c, { orientation: d, panels: z } = f, { disableCursor: b } = 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);
1158
+ if (!p || !m)
1159
1159
  return;
1160
1160
  const {
1161
- defaultLayoutDeferred: y,
1162
- derivedPanelConstraints: z,
1163
- groupSize: S,
1164
- layout: p,
1161
+ defaultLayoutDeferred: S,
1162
+ derivedPanelConstraints: v,
1163
+ groupSize: y,
1164
+ layout: h,
1165
1165
  separatorToPanels: P
1166
- } = g;
1167
- if (z && p && P) {
1166
+ } = m;
1167
+ if (v && h && P) {
1168
1168
  const M = se({
1169
- delta: f,
1170
- initialLayout: h,
1171
- panelConstraints: z,
1172
- pivotIndices: u.panels.map((C) => v.indexOf(C)),
1173
- prevLayout: p,
1169
+ delta: u,
1170
+ initialLayout: p,
1171
+ panelConstraints: v,
1172
+ pivotIndices: c.panels.map((L) => z.indexOf(L)),
1173
+ prevLayout: h,
1174
1174
  trigger: "mouse-or-touch"
1175
1175
  });
1176
- if (j(M, p)) {
1177
- if (f !== 0 && !b)
1176
+ if (V(M, h)) {
1177
+ if (u !== 0 && !b)
1178
1178
  switch (d) {
1179
1179
  case "horizontal": {
1180
- r |= f < 0 ? nt : ot;
1180
+ r |= u < 0 ? nt : ot;
1181
1181
  break;
1182
1182
  }
1183
1183
  case "vertical": {
1184
- r |= f < 0 ? it : rt;
1184
+ r |= u < 0 ? it : rt;
1185
1185
  break;
1186
1186
  }
1187
1187
  }
1188
1188
  } else
1189
- _(u.group, {
1190
- defaultLayoutDeferred: y,
1191
- derivedPanelConstraints: z,
1192
- groupSize: S,
1189
+ _(c.group, {
1190
+ defaultLayoutDeferred: S,
1191
+ derivedPanelConstraints: v,
1192
+ groupSize: y,
1193
1193
  layout: M,
1194
1194
  separatorToPanels: P
1195
1195
  });
1196
1196
  }
1197
1197
  });
1198
1198
  let a = 0;
1199
- t.movementX === 0 ? a |= l & Ge : a |= r & Ge, t.movementY === 0 ? a |= l & Ae : a |= r & Ae, At(a), xe(e);
1199
+ t.movementX === 0 ? a |= l & Ae : a |= r & Ae, t.movementY === 0 ? a |= l & Ne : a |= r & Ne, At(a), we(e);
1200
1200
  }
1201
- function Fe(e) {
1201
+ function $e(e) {
1202
1202
  const t = U(), n = W();
1203
1203
  switch (n.state) {
1204
1204
  case "active":
@@ -1212,7 +1212,7 @@ function Fe(e) {
1212
1212
  });
1213
1213
  }
1214
1214
  }
1215
- function $e(e) {
1215
+ function je(e) {
1216
1216
  if (e.defaultPrevented)
1217
1217
  return;
1218
1218
  const t = W(), n = U();
@@ -1226,7 +1226,7 @@ function $e(e) {
1226
1226
  cursorFlags: 0,
1227
1227
  state: "inactive"
1228
1228
  }), t.hitRegions.forEach((o) => {
1229
- const i = $(o.group.id, !0);
1229
+ const i = j(o.group.id, !0);
1230
1230
  _(o.group, i);
1231
1231
  });
1232
1232
  return;
@@ -1248,7 +1248,7 @@ function $e(e) {
1248
1248
  break;
1249
1249
  }
1250
1250
  default: {
1251
- const o = ve(e, n);
1251
+ const o = be(e, n);
1252
1252
  o.length === 0 ? t.state !== "inactive" && Z({
1253
1253
  cursorFlags: 0,
1254
1254
  state: "inactive"
@@ -1256,7 +1256,7 @@ function $e(e) {
1256
1256
  cursorFlags: 0,
1257
1257
  hitRegions: o,
1258
1258
  state: "hover"
1259
- }), xe(e.currentTarget);
1259
+ }), we(e.currentTarget);
1260
1260
  break;
1261
1261
  }
1262
1262
  }
@@ -1282,25 +1282,25 @@ function Ve(e) {
1282
1282
  Z({
1283
1283
  cursorFlags: 0,
1284
1284
  state: "inactive"
1285
- }), t.hitRegions.length > 0 && (xe(e.currentTarget), t.hitRegions.forEach((n) => {
1286
- const o = $(n.group.id, !0);
1285
+ }), t.hitRegions.length > 0 && (we(e.currentTarget), t.hitRegions.forEach((n) => {
1286
+ const o = j(n.group.id, !0);
1287
1287
  _(n.group, o);
1288
1288
  }), e.preventDefault());
1289
1289
  }
1290
1290
  }
1291
- function je(e) {
1291
+ function Be(e) {
1292
1292
  let t = 0, n = 0;
1293
1293
  const o = {};
1294
1294
  for (const s of e)
1295
1295
  if (s.defaultSize !== void 0) {
1296
1296
  t++;
1297
- const l = D(s.defaultSize);
1297
+ const l = T(s.defaultSize);
1298
1298
  n += l, o[s.panelId] = l;
1299
1299
  } else
1300
1300
  o[s.panelId] = void 0;
1301
1301
  const i = e.length - t;
1302
1302
  if (i !== 0) {
1303
- const s = D((100 - n) / i);
1303
+ const s = T((100 - n) / i);
1304
1304
  for (const l of e)
1305
1305
  l.defaultSize === void 0 && (o[l.panelId] = s);
1306
1306
  }
@@ -1309,11 +1309,11 @@ function je(e) {
1309
1309
  function Ft(e, t, n) {
1310
1310
  if (!n[0])
1311
1311
  return;
1312
- const i = e.panels.find((u) => u.element === t);
1312
+ const i = e.panels.find((c) => c.element === t);
1313
1313
  if (!i || !i.onResize)
1314
1314
  return;
1315
1315
  const s = Q({ group: e }), l = e.orientation === "horizontal" ? i.element.offsetWidth : i.element.offsetHeight, r = i.mutableValues.prevSize, a = {
1316
- asPercentage: D(l / s * 100),
1316
+ asPercentage: T(l / s * 100),
1317
1317
  inPixels: l
1318
1318
  };
1319
1319
  i.mutableValues.prevSize = a, i.onResize(a, i.id, r);
@@ -1326,7 +1326,7 @@ function $t(e, t) {
1326
1326
  return !1;
1327
1327
  return !0;
1328
1328
  }
1329
- function Ht({
1329
+ function jt({
1330
1330
  group: e,
1331
1331
  nextGroupSize: t,
1332
1332
  prevGroupSize: n,
@@ -1336,46 +1336,46 @@ function Ht({
1336
1336
  return o;
1337
1337
  let i = 0, s = 0, l = !1;
1338
1338
  const r = /* @__PURE__ */ new Map(), a = [];
1339
- for (const m of e.panels) {
1340
- const d = o[m.id] ?? 0;
1341
- switch (m.panelConstraints.groupResizeBehavior) {
1339
+ for (const g of e.panels) {
1340
+ const d = o[g.id] ?? 0;
1341
+ switch (g.panelConstraints.groupResizeBehavior) {
1342
1342
  case "preserve-pixel-size": {
1343
1343
  l = !0;
1344
- const v = d / 100 * n, b = D(
1345
- v / t * 100
1344
+ const z = d / 100 * n, b = T(
1345
+ z / t * 100
1346
1346
  );
1347
- r.set(m.id, b), i += b;
1347
+ r.set(g.id, b), i += b;
1348
1348
  break;
1349
1349
  }
1350
1350
  case "preserve-relative-size":
1351
1351
  default: {
1352
- a.push(m.id), s += d;
1352
+ a.push(g.id), s += d;
1353
1353
  break;
1354
1354
  }
1355
1355
  }
1356
1356
  }
1357
1357
  if (!l || a.length === 0)
1358
1358
  return o;
1359
- const u = 100 - i, c = { ...o };
1360
- if (r.forEach((m, d) => {
1361
- c[d] = m;
1359
+ const c = 100 - i, f = { ...o };
1360
+ if (r.forEach((g, d) => {
1361
+ f[d] = g;
1362
1362
  }), s > 0)
1363
- for (const m of a) {
1364
- const d = o[m] ?? 0;
1365
- c[m] = D(
1366
- d / s * u
1363
+ for (const g of a) {
1364
+ const d = o[g] ?? 0;
1365
+ f[g] = T(
1366
+ d / s * c
1367
1367
  );
1368
1368
  }
1369
1369
  else {
1370
- const m = D(
1371
- u / a.length
1370
+ const g = T(
1371
+ c / a.length
1372
1372
  );
1373
1373
  for (const d of a)
1374
- c[d] = m;
1374
+ f[d] = g;
1375
1375
  }
1376
- return c;
1376
+ return f;
1377
1377
  }
1378
- function Vt(e, t) {
1378
+ function Ht(e, t) {
1379
1379
  const n = e.map((i) => i.id), o = Object.keys(t);
1380
1380
  if (n.length !== o.length)
1381
1381
  return !1;
@@ -1385,108 +1385,108 @@ function Vt(e, t) {
1385
1385
  return !0;
1386
1386
  }
1387
1387
  const q = /* @__PURE__ */ new Map();
1388
- function jt(e) {
1388
+ function Vt(e) {
1389
1389
  let t = !0;
1390
- L(
1390
+ C(
1391
1391
  e.element.ownerDocument.defaultView,
1392
1392
  "Cannot register an unmounted Group"
1393
1393
  );
1394
- const n = e.element.ownerDocument.defaultView.ResizeObserver, o = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), s = new n((f) => {
1395
- for (const h of f) {
1396
- const { borderBoxSize: g, target: y } = h;
1397
- if (y === e.element) {
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) {
1398
1398
  if (t) {
1399
- const z = Q({ group: e });
1400
- if (z === 0)
1399
+ const v = Q({ group: e });
1400
+ if (v === 0)
1401
1401
  return;
1402
- const S = $(e.id);
1403
- if (!S)
1402
+ const y = j(e.id);
1403
+ if (!y)
1404
1404
  return;
1405
- const p = ge(e), P = S.defaultLayoutDeferred ? je(p) : S.layout, M = Ht({
1405
+ const h = Se(e), P = y.defaultLayoutDeferred ? Be(h) : y.layout, M = jt({
1406
1406
  group: e,
1407
- nextGroupSize: z,
1408
- prevGroupSize: S.groupSize,
1407
+ nextGroupSize: v,
1408
+ prevGroupSize: y.groupSize,
1409
1409
  prevLayout: P
1410
- }), C = B({
1410
+ }), L = B({
1411
1411
  layout: M,
1412
- panelConstraints: p
1412
+ panelConstraints: h
1413
1413
  });
1414
- if (!S.defaultLayoutDeferred && j(S.layout, C) && $t(
1415
- S.derivedPanelConstraints,
1416
- p
1417
- ) && S.groupSize === z)
1414
+ if (!y.defaultLayoutDeferred && V(y.layout, L) && $t(
1415
+ y.derivedPanelConstraints,
1416
+ h
1417
+ ) && y.groupSize === v)
1418
1418
  return;
1419
1419
  _(e, {
1420
1420
  defaultLayoutDeferred: !1,
1421
- derivedPanelConstraints: p,
1422
- groupSize: z,
1423
- layout: C,
1424
- separatorToPanels: S.separatorToPanels
1421
+ derivedPanelConstraints: h,
1422
+ groupSize: v,
1423
+ layout: L,
1424
+ separatorToPanels: y.separatorToPanels
1425
1425
  });
1426
1426
  }
1427
1427
  } else
1428
- Ft(e, y, g);
1428
+ Ft(e, S, m);
1429
1429
  }
1430
1430
  });
1431
- s.observe(e.element), e.panels.forEach((f) => {
1432
- L(
1433
- !o.has(f.id),
1434
- `Panel ids must be unique; id "${f.id}" was used more than once`
1435
- ), o.add(f.id), f.onResize && s.observe(f.element);
1431
+ s.observe(e.element), e.panels.forEach((u) => {
1432
+ 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);
1436
1436
  });
1437
- const l = Q({ group: e }), r = ge(e), a = e.panels.map(({ id: f }) => f).join(",");
1438
- let u = e.mutableState.defaultLayout;
1439
- u && (Vt(e.panels, u) || (u = void 0));
1440
- const c = e.mutableState.layouts[a] ?? u ?? je(r), m = B({
1441
- layout: c,
1437
+ const l = Q({ group: e }), r = Se(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 ?? Be(r), g = B({
1441
+ layout: f,
1442
1442
  panelConstraints: r
1443
1443
  }), d = e.element.ownerDocument;
1444
1444
  q.set(
1445
1445
  d,
1446
1446
  (q.get(d) ?? 0) + 1
1447
1447
  );
1448
- const v = /* @__PURE__ */ new Map();
1449
- return Ye(e).forEach((f) => {
1450
- f.separator && v.set(f.separator, f.panels);
1448
+ const z = /* @__PURE__ */ new Map();
1449
+ return Ye(e).forEach((u) => {
1450
+ u.separator && z.set(u.separator, u.panels);
1451
1451
  }), _(e, {
1452
1452
  defaultLayoutDeferred: l === 0,
1453
1453
  derivedPanelConstraints: r,
1454
1454
  groupSize: l,
1455
- layout: m,
1456
- separatorToPanels: v
1457
- }), e.separators.forEach((f) => {
1458
- L(
1459
- !i.has(f.id),
1460
- `Separator ids must be unique; id "${f.id}" was used more than once`
1461
- ), i.add(f.id), f.element.addEventListener("keydown", Te);
1462
- }), q.get(d) === 1 && (d.addEventListener("dblclick", De, !0), d.addEventListener("pointerdown", Oe, !0), d.addEventListener("pointerleave", Fe), d.addEventListener("pointermove", $e), d.addEventListener("pointerout", He), d.addEventListener("pointerup", Ve, !0)), function() {
1455
+ layout: g,
1456
+ separatorToPanels: z
1457
+ }), e.separators.forEach((u) => {
1458
+ 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", Oe);
1462
+ }), q.get(d) === 1 && (d.addEventListener("dblclick", Te, !0), d.addEventListener("pointerdown", Ge, !0), d.addEventListener("pointerleave", $e), d.addEventListener("pointermove", je), d.addEventListener("pointerout", He), d.addEventListener("pointerup", Ve, !0)), function() {
1463
1463
  t = !1, q.set(
1464
1464
  d,
1465
1465
  Math.max(0, (q.get(d) ?? 0) - 1)
1466
- ), Lt(e), e.separators.forEach((h) => {
1467
- h.element.removeEventListener("keydown", Te);
1466
+ ), Lt(e), e.separators.forEach((p) => {
1467
+ p.element.removeEventListener("keydown", Oe);
1468
1468
  }), q.get(d) || (d.removeEventListener(
1469
1469
  "dblclick",
1470
- De,
1470
+ Te,
1471
1471
  !0
1472
1472
  ), d.removeEventListener(
1473
1473
  "pointerdown",
1474
- Oe,
1474
+ Ge,
1475
1475
  !0
1476
- ), d.removeEventListener("pointerleave", Fe), d.removeEventListener("pointermove", $e), d.removeEventListener("pointerout", He), d.removeEventListener("pointerup", Ve, !0)), s.disconnect();
1476
+ ), d.removeEventListener("pointerleave", $e), d.removeEventListener("pointermove", je), d.removeEventListener("pointerout", He), d.removeEventListener("pointerup", Ve, !0)), s.disconnect();
1477
1477
  };
1478
1478
  }
1479
1479
  function Bt() {
1480
1480
  const [e, t] = re({}), n = ne(() => t({}), []);
1481
1481
  return [e, n];
1482
1482
  }
1483
- function be(e) {
1483
+ function Pe(e) {
1484
1484
  const t = pt();
1485
1485
  return `${e ?? t}`;
1486
1486
  }
1487
- const K = typeof window < "u" ? Be : de;
1487
+ const K = typeof window < "u" ? We : he;
1488
1488
  function oe(e) {
1489
- const t = T(e);
1489
+ const t = O(e);
1490
1490
  return K(() => {
1491
1491
  t.current = e;
1492
1492
  }, [e]), ne(
@@ -1494,7 +1494,7 @@ function oe(e) {
1494
1494
  [t]
1495
1495
  );
1496
1496
  }
1497
- function we(...e) {
1497
+ function Le(...e) {
1498
1498
  return oe((t) => {
1499
1499
  e.forEach((n) => {
1500
1500
  if (n)
@@ -1511,8 +1511,8 @@ function we(...e) {
1511
1511
  });
1512
1512
  });
1513
1513
  }
1514
- function Pe(e) {
1515
- const t = T({ ...e });
1514
+ function Ce(e) {
1515
+ const t = O({ ...e });
1516
1516
  return K(() => {
1517
1517
  for (const n in e)
1518
1518
  t.current[n] = e[n];
@@ -1520,11 +1520,11 @@ function Pe(e) {
1520
1520
  }
1521
1521
  const at = ht(null);
1522
1522
  function Wt(e, t) {
1523
- const n = T({
1523
+ const n = O({
1524
1524
  getLayout: () => ({}),
1525
1525
  setLayout: Nt
1526
1526
  });
1527
- We(t, () => n.current, []), K(() => {
1527
+ Ue(t, () => n.current, []), K(() => {
1528
1528
  Object.assign(
1529
1529
  n.current,
1530
1530
  tt({ groupId: e })
@@ -1541,46 +1541,46 @@ function Ut({
1541
1541
  groupRef: l,
1542
1542
  id: r,
1543
1543
  onLayoutChange: a,
1544
- onLayoutChanged: u,
1545
- orientation: c = "horizontal",
1546
- resizeTargetMinimumSize: m = {
1544
+ onLayoutChanged: c,
1545
+ orientation: f = "horizontal",
1546
+ resizeTargetMinimumSize: g = {
1547
1547
  coarse: 20,
1548
1548
  fine: 10
1549
1549
  },
1550
1550
  style: d,
1551
- ...v
1551
+ ...z
1552
1552
  }) {
1553
- const b = T({
1553
+ const b = O({
1554
1554
  onLayoutChange: {},
1555
1555
  onLayoutChanged: {}
1556
- }), f = oe((x) => {
1557
- j(b.current.onLayoutChange, x) || (b.current.onLayoutChange = x, a?.(x));
1558
- }), h = oe((x) => {
1559
- j(b.current.onLayoutChanged, x) || (b.current.onLayoutChanged = x, u?.(x));
1560
- }), g = be(r), y = T(null), [z, S] = Bt(), p = T({
1556
+ }), u = oe((x) => {
1557
+ V(b.current.onLayoutChange, x) || (b.current.onLayoutChange = x, a?.(x));
1558
+ }), p = oe((x) => {
1559
+ V(b.current.onLayoutChanged, x) || (b.current.onLayoutChanged = x, c?.(x));
1560
+ }), m = Pe(r), S = O(null), [v, y] = Bt(), h = O({
1561
1561
  lastExpandedPanelSizes: {},
1562
1562
  layouts: {},
1563
1563
  panels: [],
1564
- resizeTargetMinimumSize: m,
1564
+ resizeTargetMinimumSize: g,
1565
1565
  separators: []
1566
- }), P = we(y, s);
1567
- Wt(g, l);
1566
+ }), P = Le(S, s);
1567
+ Wt(m, l);
1568
1568
  const M = oe(
1569
1569
  (x, w) => {
1570
- const E = W(), R = Me(x), I = $(x);
1571
- if (I) {
1572
- let O = !1;
1570
+ const E = W(), R = Ee(x), k = j(x);
1571
+ if (k) {
1572
+ let I = !1;
1573
1573
  switch (E.state) {
1574
1574
  case "active": {
1575
- O = E.hitRegions.some(
1576
- (H) => H.group === R
1575
+ I = E.hitRegions.some(
1576
+ ($) => $.group === R
1577
1577
  );
1578
1578
  break;
1579
1579
  }
1580
1580
  }
1581
1581
  return {
1582
- flexGrow: I.layout[w] ?? 1,
1583
- pointerEvents: O ? "none" : void 0
1582
+ flexGrow: k.layout[w] ?? 1,
1583
+ pointerEvents: I ? "none" : void 0
1584
1584
  };
1585
1585
  }
1586
1586
  if (n?.[w])
@@ -1588,135 +1588,138 @@ function Ut({
1588
1588
  flexGrow: n?.[w]
1589
1589
  };
1590
1590
  }
1591
- ), C = Pe({
1591
+ ), L = Ce({
1592
1592
  defaultLayout: n,
1593
1593
  disableCursor: o
1594
- }), X = Ue(
1594
+ }), X = ye(
1595
1595
  () => ({
1596
1596
  get disableCursor() {
1597
- return !!C.disableCursor;
1597
+ return !!L.disableCursor;
1598
1598
  },
1599
1599
  getPanelStyles: M,
1600
- id: g,
1601
- orientation: c,
1600
+ id: m,
1601
+ orientation: f,
1602
1602
  registerPanel: (x) => {
1603
- const w = p.current;
1604
- return w.panels = Se(c, [
1603
+ const w = h.current;
1604
+ return w.panels = ve(f, [
1605
1605
  ...w.panels,
1606
1606
  x
1607
- ]), S(), () => {
1607
+ ]), y(), () => {
1608
1608
  w.panels = w.panels.filter(
1609
1609
  (E) => E !== x
1610
- ), S();
1610
+ ), y();
1611
1611
  };
1612
1612
  },
1613
1613
  registerSeparator: (x) => {
1614
- const w = p.current;
1615
- return w.separators = Se(c, [
1614
+ const w = h.current;
1615
+ return w.separators = ve(f, [
1616
1616
  ...w.separators,
1617
1617
  x
1618
- ]), S(), () => {
1618
+ ]), y(), () => {
1619
1619
  w.separators = w.separators.filter(
1620
1620
  (E) => E !== x
1621
- ), S();
1621
+ ), y();
1622
1622
  };
1623
1623
  },
1624
- togglePanelDisabled: (x, w) => {
1625
- const R = p.current.panels.find(
1626
- (H) => H.id === x
1624
+ updatePanelProps: (x, { disabled: w }) => {
1625
+ const R = h.current.panels.find(
1626
+ ($) => $.id === x
1627
1627
  );
1628
1628
  R && (R.panelConstraints.disabled = w);
1629
- const I = Me(g), O = $(g);
1630
- I && O && _(I, {
1631
- ...O,
1632
- derivedPanelConstraints: ge(I)
1629
+ const k = Ee(m), I = j(m);
1630
+ k && I && _(k, {
1631
+ ...I,
1632
+ derivedPanelConstraints: Se(k)
1633
1633
  });
1634
1634
  },
1635
- toggleSeparatorDisabled: (x, w) => {
1636
- const R = p.current.separators.find(
1635
+ updateSeparatorProps: (x, {
1636
+ disabled: w,
1637
+ disableDoubleClick: E
1638
+ }) => {
1639
+ const k = h.current.separators.find(
1637
1640
  (I) => I.id === x
1638
1641
  );
1639
- R && (R.disabled = w);
1642
+ k && (k.disabled = w, k.disableDoubleClick = E);
1640
1643
  }
1641
1644
  }),
1642
- [M, g, S, c, C]
1643
- ), F = T(null);
1645
+ [M, m, y, f, L]
1646
+ ), F = O(null);
1644
1647
  return K(() => {
1645
- const x = y.current;
1648
+ const x = S.current;
1646
1649
  if (x === null)
1647
1650
  return;
1648
- const w = p.current;
1651
+ const w = h.current;
1649
1652
  let E;
1650
- if (C.defaultLayout !== void 0 && Object.keys(C.defaultLayout).length === w.panels.length) {
1653
+ if (L.defaultLayout !== void 0 && Object.keys(L.defaultLayout).length === w.panels.length) {
1651
1654
  E = {};
1652
1655
  for (const ee of w.panels) {
1653
- const ae = C.defaultLayout[ee.id];
1654
- ae !== void 0 && (E[ee.id] = ae);
1656
+ const le = L.defaultLayout[ee.id];
1657
+ le !== void 0 && (E[ee.id] = le);
1655
1658
  }
1656
1659
  }
1657
1660
  const R = {
1658
1661
  disabled: !!i,
1659
1662
  element: x,
1660
- id: g,
1663
+ id: m,
1661
1664
  mutableState: {
1662
1665
  defaultLayout: E,
1663
- disableCursor: !!C.disableCursor,
1664
- expandedPanelSizes: p.current.lastExpandedPanelSizes,
1665
- layouts: p.current.layouts
1666
+ disableCursor: !!L.disableCursor,
1667
+ expandedPanelSizes: h.current.lastExpandedPanelSizes,
1668
+ layouts: h.current.layouts
1666
1669
  },
1667
- orientation: c,
1670
+ orientation: f,
1668
1671
  panels: w.panels,
1669
1672
  resizeTargetMinimumSize: w.resizeTargetMinimumSize,
1670
1673
  separators: w.separators
1671
1674
  };
1672
1675
  F.current = R;
1673
- const I = jt(R), { defaultLayoutDeferred: O, derivedPanelConstraints: H, layout: Ce } = $(R.id, !0);
1674
- !O && H.length > 0 && (f(Ce), h(Ce));
1675
- const lt = ye(g, (ee) => {
1676
- const { defaultLayoutDeferred: ae, derivedPanelConstraints: Re, layout: le } = ee.next;
1677
- if (ae || Re.length === 0)
1676
+ const k = Vt(R), { defaultLayoutDeferred: I, derivedPanelConstraints: $, layout: ae } = j(R.id, !0);
1677
+ !I && $.length > 0 && (u(ae), p(ae));
1678
+ const lt = ze(m, (ee) => {
1679
+ const { defaultLayoutDeferred: le, derivedPanelConstraints: Me, layout: ue } = ee.next;
1680
+ if (le || Me.length === 0)
1678
1681
  return;
1679
1682
  const ut = R.panels.map(({ id: N }) => N).join(",");
1680
- R.mutableState.layouts[ut] = le, Re.forEach((N) => {
1683
+ R.mutableState.layouts[ut] = ue, Me.forEach((N) => {
1681
1684
  if (N.collapsible) {
1682
- const { layout: pe } = ee.prev ?? {};
1683
- if (pe) {
1684
- const ft = k(
1685
+ const { layout: me } = ee.prev ?? {};
1686
+ if (me) {
1687
+ const ft = D(
1685
1688
  N.collapsedSize,
1686
- le[N.panelId]
1687
- ), dt = k(
1689
+ ue[N.panelId]
1690
+ ), dt = D(
1688
1691
  N.collapsedSize,
1689
- pe[N.panelId]
1692
+ me[N.panelId]
1690
1693
  );
1691
- ft && !dt && (R.mutableState.expandedPanelSizes[N.panelId] = pe[N.panelId]);
1694
+ ft && !dt && (R.mutableState.expandedPanelSizes[N.panelId] = me[N.panelId]);
1692
1695
  }
1693
1696
  }
1694
1697
  });
1695
1698
  const ct = W().state !== "active";
1696
- f(le), ct && h(le);
1699
+ u(ue), ct && p(ue);
1697
1700
  });
1698
1701
  return () => {
1699
- F.current = null, I(), lt();
1702
+ F.current = null, k(), lt();
1700
1703
  };
1701
1704
  }, [
1702
1705
  i,
1703
- g,
1704
- h,
1706
+ m,
1707
+ p,
1708
+ u,
1705
1709
  f,
1706
- c,
1707
- z,
1708
- C
1709
- ]), de(() => {
1710
+ v,
1711
+ L
1712
+ ]), he(() => {
1710
1713
  const x = F.current;
1711
1714
  x && (x.mutableState.defaultLayout = n, x.mutableState.disableCursor = !!o);
1712
1715
  }), /* @__PURE__ */ ie(at.Provider, { value: X, children: /* @__PURE__ */ ie(
1713
1716
  "div",
1714
1717
  {
1715
- ...v,
1718
+ ...z,
1716
1719
  className: t,
1717
1720
  "data-group": !0,
1718
- "data-testid": g,
1719
- id: g,
1721
+ "data-testid": m,
1722
+ id: m,
1720
1723
  ref: P,
1721
1724
  style: {
1722
1725
  height: "100%",
@@ -1724,115 +1727,160 @@ function Ut({
1724
1727
  overflow: "hidden",
1725
1728
  ...d,
1726
1729
  display: "flex",
1727
- flexDirection: c === "horizontal" ? "row" : "column",
1730
+ flexDirection: f === "horizontal" ? "row" : "column",
1728
1731
  flexWrap: "nowrap",
1729
1732
  // Inform the browser that the library is handling touch events for this element
1730
1733
  // but still allow users to scroll content within panels in the non-resizing direction
1731
1734
  // NOTE This is not an inherited style
1732
1735
  // See github.com/bvaughn/react-resizable-panels/issues/662
1733
- touchAction: c === "horizontal" ? "pan-y" : "pan-x"
1736
+ touchAction: f === "horizontal" ? "pan-y" : "pan-x"
1734
1737
  },
1735
1738
  children: e
1736
1739
  }
1737
1740
  ) });
1738
1741
  }
1739
1742
  Ut.displayName = "Group";
1740
- function me(e, t) {
1743
+ function pe(e, t) {
1741
1744
  return `react-resizable-panels:${[e, ...t].join(":")}`;
1742
1745
  }
1743
- function nn({
1746
+ function Kt({
1747
+ id: e,
1748
+ panelIds: t,
1749
+ storage: n
1750
+ }) {
1751
+ const o = pe(e, []), i = n.getItem(o);
1752
+ if (i)
1753
+ try {
1754
+ const s = JSON.parse(i);
1755
+ 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;
1762
+ }
1763
+ } 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;
1774
+ }
1775
+ }
1776
+ }
1777
+ }
1778
+ } catch {
1779
+ }
1780
+ }
1781
+ function on({
1744
1782
  debounceSaveMs: e = 100,
1745
1783
  panelIds: t,
1746
1784
  storage: n = localStorage,
1747
1785
  ...o
1748
1786
  }) {
1749
- const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = me(s, t ?? []), r = Ke(
1750
- Kt,
1787
+ const i = t !== void 0, s = "id" in o ? o.id : o.groupId, l = pe(s, t ?? []), r = Ke(
1788
+ Xt,
1751
1789
  () => n.getItem(l),
1752
1790
  () => n.getItem(l)
1753
- ), a = Ue(
1754
- () => r ? JSON.parse(r) : void 0,
1755
- [r]
1756
- ), u = T(null), c = ne(() => {
1757
- const v = u.current;
1758
- v && (u.current = null, clearTimeout(v));
1791
+ ), a = ye(() => {
1792
+ if (r) {
1793
+ const u = JSON.parse(r), p = Object.values(u);
1794
+ if (Array.from(p).every((m) => typeof m == "number"))
1795
+ return u;
1796
+ }
1797
+ }, [r]), c = ye(() => {
1798
+ if (!a)
1799
+ return Kt({
1800
+ id: s,
1801
+ panelIds: t,
1802
+ storage: n
1803
+ });
1804
+ }, [a, s, t, n]), f = a ?? c, g = O(null), d = ne(() => {
1805
+ const u = g.current;
1806
+ u && (g.current = null, clearTimeout(u));
1759
1807
  }, []);
1760
- Be(() => () => {
1761
- c();
1762
- }, [c]);
1763
- const m = ne(
1764
- (v) => {
1765
- c();
1766
- let b;
1767
- i ? b = me(s, Object.keys(v)) : b = me(s, []);
1808
+ We(() => () => {
1809
+ d();
1810
+ }, [d]);
1811
+ const z = ne(
1812
+ (u) => {
1813
+ d();
1814
+ let p;
1815
+ i ? p = pe(s, Object.keys(u)) : p = pe(s, []);
1768
1816
  try {
1769
- n.setItem(b, JSON.stringify(v));
1770
- } catch (f) {
1771
- console.error(f);
1817
+ n.setItem(p, JSON.stringify(u));
1818
+ } catch (m) {
1819
+ console.error(m);
1772
1820
  }
1773
1821
  },
1774
- [c, i, s, n]
1775
- ), d = ne(
1776
- (v) => {
1777
- c(), e === 0 ? m(v) : u.current = setTimeout(() => {
1778
- m(v);
1822
+ [d, i, s, n]
1823
+ ), b = ne(
1824
+ (u) => {
1825
+ d(), e === 0 ? z(u) : g.current = setTimeout(() => {
1826
+ z(u);
1779
1827
  }, e);
1780
1828
  },
1781
- [c, e, m]
1829
+ [d, e, z]
1782
1830
  );
1783
1831
  return {
1784
1832
  /**
1785
1833
  * Pass this value to `Group` as the `defaultLayout` prop.
1786
1834
  */
1787
- defaultLayout: a,
1835
+ defaultLayout: f,
1788
1836
  /**
1789
1837
  * Attach this callback on the `Group` as the `onLayoutChange` prop.
1790
1838
  *
1791
1839
  * @deprecated Use the {@link onLayoutChanged} prop instead.
1792
1840
  */
1793
- onLayoutChange: d,
1841
+ onLayoutChange: b,
1794
1842
  /**
1795
1843
  * Attach this callback on the `Group` as the `onLayoutChanged` prop.
1796
1844
  */
1797
- onLayoutChanged: m
1845
+ onLayoutChanged: z
1798
1846
  };
1799
1847
  }
1800
- function Kt() {
1848
+ function Xt() {
1801
1849
  return function() {
1802
1850
  };
1803
1851
  }
1804
- function on() {
1852
+ function rn() {
1805
1853
  return re(null);
1806
1854
  }
1807
- function rn() {
1808
- return T(null);
1855
+ function sn() {
1856
+ return O(null);
1809
1857
  }
1810
- function Le() {
1858
+ function Re() {
1811
1859
  const e = mt(at);
1812
- return L(
1860
+ return C(
1813
1861
  e,
1814
1862
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
1815
1863
  ), e;
1816
1864
  }
1817
- function Xt(e, t) {
1818
- const { id: n } = Le(), o = T({
1819
- collapse: he,
1820
- expand: he,
1865
+ function qt(e, t) {
1866
+ const { id: n } = Re(), o = O({
1867
+ collapse: ge,
1868
+ expand: ge,
1821
1869
  getSize: () => ({
1822
1870
  asPercentage: 0,
1823
1871
  inPixels: 0
1824
1872
  }),
1825
1873
  isCollapsed: () => !1,
1826
- resize: he
1874
+ resize: ge
1827
1875
  });
1828
- We(t, () => o.current, []), K(() => {
1876
+ Ue(t, () => o.current, []), K(() => {
1829
1877
  Object.assign(
1830
1878
  o.current,
1831
1879
  et({ groupId: n, panelId: e })
1832
1880
  );
1833
1881
  });
1834
1882
  }
1835
- function qt({
1883
+ function Yt({
1836
1884
  children: e,
1837
1885
  className: t,
1838
1886
  collapsedSize: n = "0%",
@@ -1842,33 +1890,33 @@ function qt({
1842
1890
  elementRef: l,
1843
1891
  groupResizeBehavior: r = "preserve-relative-size",
1844
1892
  id: a,
1845
- maxSize: u = "100%",
1846
- minSize: c = "0%",
1847
- onResize: m,
1893
+ maxSize: c = "100%",
1894
+ minSize: f = "0%",
1895
+ onResize: g,
1848
1896
  panelRef: d,
1849
- style: v,
1897
+ style: z,
1850
1898
  ...b
1851
1899
  }) {
1852
- const f = !!a, h = be(a), g = Pe({
1900
+ const u = !!a, p = Pe(a), m = Ce({
1853
1901
  disabled: s
1854
- }), y = T(null), z = we(y, l), {
1855
- getPanelStyles: S,
1856
- id: p,
1902
+ }), S = O(null), v = Le(S, l), {
1903
+ getPanelStyles: y,
1904
+ id: h,
1857
1905
  orientation: P,
1858
1906
  registerPanel: M,
1859
- togglePanelDisabled: C
1860
- } = Le(), X = m !== null, F = oe(
1861
- (R, I, O) => {
1862
- m?.(R, a, O);
1907
+ updatePanelProps: L
1908
+ } = Re(), X = g !== null, F = oe(
1909
+ (R, k, I) => {
1910
+ g?.(R, a, I);
1863
1911
  }
1864
1912
  );
1865
1913
  K(() => {
1866
- const R = y.current;
1914
+ const R = S.current;
1867
1915
  if (R !== null) {
1868
- const I = {
1916
+ const k = {
1869
1917
  element: R,
1870
- id: h,
1871
- idIsStable: f,
1918
+ id: p,
1919
+ idIsStable: u,
1872
1920
  mutableValues: {
1873
1921
  expandToSize: void 0,
1874
1922
  prevSize: void 0
@@ -1879,12 +1927,12 @@ function qt({
1879
1927
  collapsedSize: n,
1880
1928
  collapsible: o,
1881
1929
  defaultSize: i,
1882
- disabled: g.disabled,
1883
- maxSize: u,
1884
- minSize: c
1930
+ disabled: m.disabled,
1931
+ maxSize: c,
1932
+ minSize: f
1885
1933
  }
1886
1934
  };
1887
- return M(I);
1935
+ return M(k);
1888
1936
  }
1889
1937
  }, [
1890
1938
  r,
@@ -1892,22 +1940,22 @@ function qt({
1892
1940
  o,
1893
1941
  i,
1894
1942
  X,
1895
- h,
1896
- f,
1943
+ p,
1897
1944
  u,
1898
1945
  c,
1946
+ f,
1899
1947
  F,
1900
1948
  M,
1901
- g
1902
- ]), de(() => {
1903
- C(h, !!s);
1904
- }, [s, h, C]), Xt(h, d);
1949
+ m
1950
+ ]), he(() => {
1951
+ L(p, { disabled: s });
1952
+ }, [s, p, L]), qt(p, d);
1905
1953
  const x = () => {
1906
- const R = S(p, h);
1954
+ const R = y(h, p);
1907
1955
  if (R)
1908
1956
  return JSON.stringify(R);
1909
1957
  }, w = Ke(
1910
- (R) => ye(p, R),
1958
+ (R) => ze(h, R),
1911
1959
  x,
1912
1960
  x
1913
1961
  );
@@ -1922,11 +1970,11 @@ function qt({
1922
1970
  ...b,
1923
1971
  "data-disabled": s || void 0,
1924
1972
  "data-panel": !0,
1925
- "data-testid": h,
1926
- id: h,
1927
- ref: z,
1973
+ "data-testid": p,
1974
+ id: p,
1975
+ ref: v,
1928
1976
  style: {
1929
- ...Yt,
1977
+ ...Jt,
1930
1978
  display: "flex",
1931
1979
  flexBasis: 0,
1932
1980
  flexShrink: 1,
@@ -1942,7 +1990,7 @@ function qt({
1942
1990
  maxWidth: "100%",
1943
1991
  flexGrow: 1,
1944
1992
  overflow: "auto",
1945
- ...v,
1993
+ ...z,
1946
1994
  // Inform the browser that the library is handling touch events for this element
1947
1995
  // but still allow users to scroll content within panels in the non-resizing direction
1948
1996
  // NOTE This is not an inherited style
@@ -1955,8 +2003,8 @@ function qt({
1955
2003
  }
1956
2004
  );
1957
2005
  }
1958
- qt.displayName = "Panel";
1959
- const Yt = {
2006
+ Yt.displayName = "Panel";
2007
+ const Jt = {
1960
2008
  minHeight: 0,
1961
2009
  maxHeight: "100%",
1962
2010
  height: "auto",
@@ -1968,13 +2016,13 @@ const Yt = {
1968
2016
  padding: 0,
1969
2017
  margin: 0
1970
2018
  };
1971
- function sn() {
2019
+ function an() {
1972
2020
  return re(null);
1973
2021
  }
1974
- function an() {
1975
- return T(null);
2022
+ function ln() {
2023
+ return O(null);
1976
2024
  }
1977
- function Jt({
2025
+ function Zt({
1978
2026
  layout: e,
1979
2027
  panelConstraints: t,
1980
2028
  panelId: n,
@@ -1985,13 +2033,13 @@ function Jt({
1985
2033
  (a) => a.panelId === n
1986
2034
  );
1987
2035
  if (r) {
1988
- const a = r.maxSize, u = r.collapsible ? r.collapsedSize : r.minSize, c = [o, o + 1];
2036
+ const a = r.maxSize, c = r.collapsible ? r.collapsedSize : r.minSize, f = [o, o + 1];
1989
2037
  s = B({
1990
2038
  layout: se({
1991
- delta: u - l,
2039
+ delta: c - l,
1992
2040
  initialLayout: e,
1993
2041
  panelConstraints: t,
1994
- pivotIndices: c,
2042
+ pivotIndices: f,
1995
2043
  prevLayout: e
1996
2044
  }),
1997
2045
  panelConstraints: t
@@ -2000,7 +2048,7 @@ function Jt({
2000
2048
  delta: a - l,
2001
2049
  initialLayout: e,
2002
2050
  panelConstraints: t,
2003
- pivotIndices: c,
2051
+ pivotIndices: f,
2004
2052
  prevLayout: e
2005
2053
  }),
2006
2054
  panelConstraints: t
@@ -2013,85 +2061,88 @@ function Jt({
2013
2061
  valueNow: l
2014
2062
  };
2015
2063
  }
2016
- function Zt({
2064
+ function Qt({
2017
2065
  children: e,
2018
2066
  className: t,
2019
2067
  disabled: n,
2020
- elementRef: o,
2021
- id: i,
2022
- style: s,
2023
- ...l
2068
+ disableDoubleClick: o,
2069
+ elementRef: i,
2070
+ id: s,
2071
+ style: l,
2072
+ ...r
2024
2073
  }) {
2025
- const r = be(i), a = Pe({
2026
- disabled: n
2027
- }), [u, c] = re({}), [m, d] = re("inactive"), v = T(null), b = we(v, o), {
2028
- disableCursor: f,
2029
- id: h,
2030
- orientation: g,
2031
- registerSeparator: y,
2032
- toggleSeparatorDisabled: z
2033
- } = Le(), S = g === "horizontal" ? "vertical" : "horizontal";
2074
+ const a = Pe(s), c = Ce({
2075
+ disabled: n,
2076
+ disableDoubleClick: o
2077
+ }), [f, g] = re({}), [d, z] = re("inactive"), b = O(null), u = Le(b, i), {
2078
+ disableCursor: p,
2079
+ id: m,
2080
+ orientation: S,
2081
+ registerSeparator: v,
2082
+ updateSeparatorProps: y
2083
+ } = Re(), h = S === "horizontal" ? "vertical" : "horizontal";
2034
2084
  K(() => {
2035
- const P = v.current;
2036
- if (P !== null) {
2037
- const M = {
2038
- disabled: a.disabled,
2039
- element: P,
2040
- id: r
2041
- }, C = y(M), X = Gt(
2042
- (x) => {
2043
- d(
2044
- x.next.state !== "inactive" && x.next.hitRegions.some(
2045
- (w) => w.separator === M
2046
- ) ? x.next.state : "inactive"
2085
+ const M = b.current;
2086
+ if (M !== null) {
2087
+ const L = {
2088
+ disabled: c.disabled,
2089
+ disableDoubleClick: c.disableDoubleClick,
2090
+ element: M,
2091
+ id: a
2092
+ }, X = v(L), F = Gt(
2093
+ (w) => {
2094
+ z(
2095
+ w.next.state !== "inactive" && w.next.hitRegions.some(
2096
+ (E) => E.separator === L
2097
+ ) ? w.next.state : "inactive"
2047
2098
  );
2048
2099
  }
2049
- ), F = ye(
2050
- h,
2051
- (x) => {
2052
- const { derivedPanelConstraints: w, layout: E, separatorToPanels: R } = x.next, I = R.get(M);
2100
+ ), x = ze(
2101
+ m,
2102
+ (w) => {
2103
+ const { derivedPanelConstraints: E, layout: R, separatorToPanels: k } = w.next, I = k.get(L);
2053
2104
  if (I) {
2054
- const O = I[0], H = I.indexOf(O);
2055
- c(
2056
- Jt({
2057
- layout: E,
2058
- panelConstraints: w,
2059
- panelId: O.id,
2060
- panelIndex: H
2105
+ const $ = I[0], ae = I.indexOf($);
2106
+ g(
2107
+ Zt({
2108
+ layout: R,
2109
+ panelConstraints: E,
2110
+ panelId: $.id,
2111
+ panelIndex: ae
2061
2112
  })
2062
2113
  );
2063
2114
  }
2064
2115
  }
2065
2116
  );
2066
2117
  return () => {
2067
- X(), F(), C();
2118
+ F(), x(), X();
2068
2119
  };
2069
2120
  }
2070
- }, [h, r, y, a]), de(() => {
2071
- z(r, !!n);
2072
- }, [n, r, z]);
2073
- let p;
2074
- return n && !f && (p = "not-allowed"), /* @__PURE__ */ ie(
2121
+ }, [m, a, v, c]), he(() => {
2122
+ y(a, { disabled: n, disableDoubleClick: o });
2123
+ }, [n, o, a, y]);
2124
+ let P;
2125
+ return n && !p && (P = "not-allowed"), /* @__PURE__ */ ie(
2075
2126
  "div",
2076
2127
  {
2077
- ...l,
2078
- "aria-controls": u.valueControls,
2128
+ ...r,
2129
+ "aria-controls": f.valueControls,
2079
2130
  "aria-disabled": n || void 0,
2080
- "aria-orientation": S,
2081
- "aria-valuemax": u.valueMax,
2082
- "aria-valuemin": u.valueMin,
2083
- "aria-valuenow": u.valueNow,
2131
+ "aria-orientation": h,
2132
+ "aria-valuemax": f.valueMax,
2133
+ "aria-valuemin": f.valueMin,
2134
+ "aria-valuenow": f.valueNow,
2084
2135
  children: e,
2085
2136
  className: t,
2086
- "data-separator": n ? "disabled" : m,
2087
- "data-testid": r,
2088
- id: r,
2089
- ref: b,
2137
+ "data-separator": n ? "disabled" : d,
2138
+ "data-testid": a,
2139
+ id: a,
2140
+ ref: u,
2090
2141
  role: "separator",
2091
2142
  style: {
2092
2143
  flexBasis: "auto",
2093
- cursor: p,
2094
- ...s,
2144
+ cursor: P,
2145
+ ...l,
2095
2146
  flexGrow: 0,
2096
2147
  flexShrink: 0,
2097
2148
  // Inform the browser that the library is handling touch events for this element
@@ -2102,16 +2153,16 @@ function Zt({
2102
2153
  }
2103
2154
  );
2104
2155
  }
2105
- Zt.displayName = "Separator";
2156
+ Qt.displayName = "Separator";
2106
2157
  export {
2107
2158
  Ut as Group,
2108
- qt as Panel,
2109
- Zt as Separator,
2159
+ Yt as Panel,
2160
+ Qt as Separator,
2110
2161
  Pt as isCoarsePointer,
2111
- nn as useDefaultLayout,
2112
- on as useGroupCallbackRef,
2113
- rn as useGroupRef,
2114
- sn as usePanelCallbackRef,
2115
- an as usePanelRef
2162
+ on as useDefaultLayout,
2163
+ rn as useGroupCallbackRef,
2164
+ sn as useGroupRef,
2165
+ an as usePanelCallbackRef,
2166
+ ln as usePanelRef
2116
2167
  };
2117
2168
  //# sourceMappingURL=react-resizable-panels.js.map