react-resizable-panels 4.0.9-alpha.0 → 4.0.10

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,11 +1,11 @@
1
1
  "use client";
2
- import { jsx as B } from "react/jsx-runtime";
3
- import { useId as We, useLayoutEffect as je, useEffect as Be, useRef as T, useCallback as Le, createContext as Ue, useImperativeHandle as Pe, useState as I, useMemo as Ce, useSyncExternalStore as Ve, useContext as Ke } from "react";
4
- function x(e, t = "Assertion error") {
2
+ import { jsx as K } from "react/jsx-runtime";
3
+ import { useId as Xe, useLayoutEffect as Ye, useEffect as Ce, useRef as O, useCallback as Ee, createContext as qe, useImperativeHandle as Me, useState as I, useMemo as Ie, useSyncExternalStore as Ze, useContext as Je } from "react";
4
+ function z(e, t = "Assertion error") {
5
5
  if (!e)
6
6
  throw Error(t);
7
7
  }
8
- function H({
8
+ function B({
9
9
  group: e
10
10
  }) {
11
11
  const { orientation: t, panels: n } = e;
@@ -13,73 +13,141 @@ function H({
13
13
  }
14
14
  function se(e, t) {
15
15
  return t.sort(
16
- e === "horizontal" ? Xe : Ye
16
+ e === "horizontal" ? Qe : et
17
17
  );
18
18
  }
19
- function Xe(e, t) {
19
+ function Qe(e, t) {
20
20
  const n = e.element.offsetLeft - t.element.offsetLeft;
21
21
  return n !== 0 ? n : e.element.offsetWidth - t.element.offsetWidth;
22
22
  }
23
- function Ye(e, t) {
23
+ function et(e, t) {
24
24
  const n = e.element.offsetTop - t.element.offsetTop;
25
25
  return n !== 0 ? n : e.element.offsetHeight - t.element.offsetHeight;
26
26
  }
27
- function Re(e) {
27
+ function Ge(e, t) {
28
+ return {
29
+ x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
30
+ Math.abs(e.x - t.left),
31
+ Math.abs(e.x - t.right)
32
+ ),
33
+ y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(
34
+ Math.abs(e.y - t.top),
35
+ Math.abs(e.y - t.bottom)
36
+ )
37
+ };
38
+ }
39
+ function tt({
40
+ orientation: e,
41
+ rects: t,
42
+ targetRect: n
43
+ }) {
44
+ const o = {
45
+ x: n.x + n.width / 2,
46
+ y: n.y + n.height / 2
47
+ };
48
+ let r, a = Number.MAX_VALUE;
49
+ for (const l of t) {
50
+ const { x: i, y: s } = Ge(o, l), u = e === "horizontal" ? i : s;
51
+ u < a && (a = u, r = l);
52
+ }
53
+ return z(r, "No rect found"), r;
54
+ }
55
+ function ke(e) {
28
56
  const { element: t, orientation: n, panels: o, separators: r } = e, a = se(
29
57
  n,
30
- Array.from(t.children).filter((l) => l instanceof HTMLElement).map((l) => ({ element: l }))
31
- ).map(({ element: l }) => l), u = [];
32
- let i, s;
33
- for (const l of a) {
34
- const c = o.find(
35
- (d) => d.element === l
36
- );
37
- if (c) {
38
- if (i) {
39
- const d = i.element.getBoundingClientRect(), z = l.getBoundingClientRect();
40
- u.push({
41
- group: e,
42
- groupSize: H({ group: e }),
43
- panels: [i, c],
44
- separator: s,
45
- rect: n === "horizontal" ? new DOMRect(
46
- d.right,
47
- z.top,
48
- z.left - d.right,
49
- z.height
50
- ) : new DOMRect(
51
- z.left,
52
- d.bottom,
53
- z.width,
54
- z.top - d.bottom
55
- )
56
- });
58
+ Array.from(t.children).filter((c) => c instanceof HTMLElement).map((c) => ({ element: c }))
59
+ ).map(({ element: c }) => c), l = [];
60
+ let i = !1, s, u = [];
61
+ for (const c of a)
62
+ if (c.hasAttribute("data-panel")) {
63
+ const h = o.find(
64
+ (m) => m.element === c
65
+ );
66
+ if (h) {
67
+ if (s) {
68
+ const m = s.element.getBoundingClientRect(), p = c.getBoundingClientRect();
69
+ let f;
70
+ if (i) {
71
+ const d = n === "horizontal" ? new DOMRect(m.right, m.top, 0, m.height) : new DOMRect(
72
+ m.left,
73
+ m.bottom,
74
+ m.width,
75
+ 0
76
+ ), y = n === "horizontal" ? new DOMRect(p.left, p.top, 0, p.height) : new DOMRect(p.left, p.top, p.width, 0);
77
+ switch (u.length) {
78
+ case 0: {
79
+ f = [
80
+ d,
81
+ y
82
+ ];
83
+ break;
84
+ }
85
+ case 1: {
86
+ const g = u[0], v = tt({
87
+ orientation: n,
88
+ rects: [m, p],
89
+ targetRect: g.element.getBoundingClientRect()
90
+ });
91
+ f = [
92
+ g,
93
+ v === m ? y : d
94
+ ];
95
+ break;
96
+ }
97
+ default: {
98
+ f = u;
99
+ break;
100
+ }
101
+ }
102
+ } else
103
+ u.length ? f = u : f = [
104
+ n === "horizontal" ? new DOMRect(
105
+ m.right,
106
+ p.top,
107
+ p.left - m.right,
108
+ p.height
109
+ ) : new DOMRect(
110
+ p.left,
111
+ m.bottom,
112
+ p.width,
113
+ p.top - m.bottom
114
+ )
115
+ ];
116
+ for (const d of f)
117
+ l.push({
118
+ group: e,
119
+ groupSize: B({ group: e }),
120
+ panels: [s, h],
121
+ separator: "width" in d ? void 0 : d,
122
+ rect: "width" in d ? d : d.element.getBoundingClientRect()
123
+ });
124
+ }
125
+ i = !1, s = h, u = [];
57
126
  }
58
- i = c, s = void 0;
59
- } else {
60
- const d = r.find(
61
- (z) => z.element === l
127
+ } else if (c.hasAttribute("data-separator")) {
128
+ const h = r.find(
129
+ (m) => m.element === c
62
130
  );
63
- d ? s = d : (i = void 0, s = void 0);
64
- }
65
- }
66
- return u;
131
+ h ? u.push(h) : (s = void 0, u = []);
132
+ } else
133
+ i = !0;
134
+ return l;
67
135
  }
68
- function qe(e, t) {
136
+ function nt(e, t) {
69
137
  const n = getComputedStyle(e), o = parseFloat(n.fontSize);
70
138
  return t * o;
71
139
  }
72
- function Ze(e, t) {
140
+ function ot(e, t) {
73
141
  const n = getComputedStyle(e.ownerDocument.body), o = parseFloat(n.fontSize);
74
142
  return t * o;
75
143
  }
76
- function Je(e) {
144
+ function it(e) {
77
145
  return e / 100 * window.innerHeight;
78
146
  }
79
- function Qe(e) {
147
+ function rt(e) {
80
148
  return e / 100 * window.innerWidth;
81
149
  }
82
- function et(e) {
150
+ function st(e) {
83
151
  switch (typeof e) {
84
152
  case "number":
85
153
  return [e, "px"];
@@ -89,13 +157,13 @@ function et(e) {
89
157
  }
90
158
  }
91
159
  }
92
- function Q({
160
+ function te({
93
161
  groupSize: e,
94
162
  panelElement: t,
95
163
  styleProp: n
96
164
  }) {
97
165
  let o;
98
- const [r, a] = et(n);
166
+ const [r, a] = st(n);
99
167
  switch (a) {
100
168
  case "%": {
101
169
  o = r / 100 * e;
@@ -106,19 +174,19 @@ function Q({
106
174
  break;
107
175
  }
108
176
  case "rem": {
109
- o = Ze(t, r);
177
+ o = ot(t, r);
110
178
  break;
111
179
  }
112
180
  case "em": {
113
- o = qe(t, r);
181
+ o = nt(t, r);
114
182
  break;
115
183
  }
116
184
  case "vh": {
117
- o = Je(r);
185
+ o = it(r);
118
186
  break;
119
187
  }
120
188
  case "vw": {
121
- o = Qe(r);
189
+ o = rt(r);
122
190
  break;
123
191
  }
124
192
  }
@@ -127,8 +195,8 @@ function Q({
127
195
  function G(e) {
128
196
  return parseFloat(e.toFixed(3));
129
197
  }
130
- function pe(e) {
131
- const { panels: t } = e, n = H({ group: e });
198
+ function ye(e) {
199
+ const { panels: t } = e, n = B({ group: e });
132
200
  return n === 0 ? t.map((o) => ({
133
201
  collapsedSize: 0,
134
202
  collapsible: o.panelConstraints.collapsible === !0,
@@ -138,18 +206,18 @@ function pe(e) {
138
206
  panelId: o.id
139
207
  })) : t.map((o) => {
140
208
  const { element: r, panelConstraints: a } = o;
141
- let u = 0;
209
+ let l = 0;
142
210
  if (a.collapsedSize) {
143
- const c = Q({
211
+ const c = te({
144
212
  groupSize: n,
145
213
  panelElement: r,
146
214
  styleProp: a.collapsedSize
147
215
  });
148
- u = G(c / n * 100);
216
+ l = G(c / n * 100);
149
217
  }
150
218
  let i;
151
219
  if (a.defaultSize) {
152
- const c = Q({
220
+ const c = te({
153
221
  groupSize: n,
154
222
  panelElement: r,
155
223
  styleProp: a.defaultSize
@@ -158,33 +226,33 @@ function pe(e) {
158
226
  }
159
227
  let s = 0;
160
228
  if (a.minSize) {
161
- const c = Q({
229
+ const c = te({
162
230
  groupSize: n,
163
231
  panelElement: r,
164
232
  styleProp: a.minSize
165
233
  });
166
234
  s = G(c / n * 100);
167
235
  }
168
- let l = 100;
236
+ let u = 100;
169
237
  if (a.maxSize) {
170
- const c = Q({
238
+ const c = te({
171
239
  groupSize: n,
172
240
  panelElement: r,
173
241
  styleProp: a.maxSize
174
242
  });
175
- l = G(c / n * 100);
243
+ u = G(c / n * 100);
176
244
  }
177
245
  return {
178
- collapsedSize: u,
246
+ collapsedSize: l,
179
247
  collapsible: a.collapsible === !0,
180
248
  defaultSize: i,
181
249
  minSize: s,
182
- maxSize: l,
250
+ maxSize: u,
183
251
  panelId: o.id
184
252
  };
185
253
  });
186
254
  }
187
- class tt {
255
+ class at {
188
256
  #e = {};
189
257
  addListener(t, n) {
190
258
  const o = this.#e[t];
@@ -199,13 +267,13 @@ class tt {
199
267
  o[0].call(null, n);
200
268
  else {
201
269
  let r = !1, a = null;
202
- const u = Array.from(o);
203
- for (let i = 0; i < u.length; i++) {
204
- const s = u[i];
270
+ const l = Array.from(o);
271
+ for (let i = 0; i < l.length; i++) {
272
+ const s = l[i];
205
273
  try {
206
274
  s.call(null, n);
207
- } catch (l) {
208
- a === null && (r = !0, a = l);
275
+ } catch (u) {
276
+ a === null && (r = !0, a = u);
209
277
  }
210
278
  }
211
279
  if (r)
@@ -226,49 +294,49 @@ class tt {
226
294
  function P(e, t, n = 0) {
227
295
  return Math.abs(G(e) - G(t)) <= n;
228
296
  }
229
- let R = {
297
+ let C = {
230
298
  cursorFlags: 0,
231
299
  interactionState: {
232
300
  state: "inactive"
233
301
  },
234
302
  mountedGroups: /* @__PURE__ */ new Map()
235
303
  };
236
- const D = new tt();
237
- function O() {
238
- return R;
304
+ const _ = new at();
305
+ function D() {
306
+ return C;
239
307
  }
240
308
  function E(e) {
241
- const t = typeof e == "function" ? e(R) : e;
242
- if (R === t)
243
- return R;
244
- const n = R;
245
- return R = {
246
- ...R,
309
+ const t = typeof e == "function" ? e(C) : e;
310
+ if (C === t)
311
+ return C;
312
+ const n = C;
313
+ return C = {
314
+ ...C,
247
315
  ...t
248
- }, t.cursorFlags !== void 0 && D.emit("cursorFlagsChange", R.cursorFlags), t.interactionState !== void 0 && D.emit("interactionStateChange", R.interactionState), t.mountedGroups !== void 0 && (R.mountedGroups.forEach((o, r) => {
316
+ }, t.cursorFlags !== void 0 && _.emit("cursorFlagsChange", C.cursorFlags), t.interactionState !== void 0 && _.emit("interactionStateChange", C.interactionState), t.mountedGroups !== void 0 && (C.mountedGroups.forEach((o, r) => {
249
317
  o.derivedPanelConstraints.forEach((a) => {
250
318
  if (a.collapsible) {
251
- const { layout: u } = n.mountedGroups.get(r) ?? {};
252
- if (u) {
319
+ const { layout: l } = n.mountedGroups.get(r) ?? {};
320
+ if (l) {
253
321
  const i = P(
254
322
  a.collapsedSize,
255
323
  o.layout[a.panelId]
256
324
  ), s = P(
257
325
  a.collapsedSize,
258
- u[a.panelId]
326
+ l[a.panelId]
259
327
  );
260
- i && !s && (r.inMemoryLastExpandedPanelSizes[a.panelId] = u[a.panelId]);
328
+ i && !s && (r.inMemoryLastExpandedPanelSizes[a.panelId] = l[a.panelId]);
261
329
  }
262
330
  }
263
331
  });
264
- }), D.emit("mountedGroupsChange", R.mountedGroups)), R;
332
+ }), _.emit("mountedGroupsChange", C.mountedGroups)), C;
265
333
  }
266
- const nt = (e) => e, ie = () => {
267
- }, Ee = 1, Me = 2, Ie = 4, Ge = 8, me = {
334
+ const lt = (e) => e, ie = () => {
335
+ }, De = 1, Oe = 2, Te = 4, _e = 8, ge = {
268
336
  coarse: 10,
269
337
  precise: 5
270
338
  };
271
- function ot({
339
+ function ut({
272
340
  cursorFlags: e,
273
341
  groups: t,
274
342
  state: n
@@ -295,11 +363,11 @@ function ot({
295
363
  return null;
296
364
  switch (n) {
297
365
  case "active": {
298
- const a = (e & Ee) !== 0, u = (e & Me) !== 0, i = (e & Ie) !== 0, s = (e & Ge) !== 0;
366
+ const a = (e & De) !== 0, l = (e & Oe) !== 0, i = (e & Te) !== 0, s = (e & _e) !== 0;
299
367
  if (e) {
300
368
  if (a)
301
369
  return i ? "se-resize" : s ? "ne-resize" : "e-resize";
302
- if (u)
370
+ if (l)
303
371
  return i ? "sw-resize" : s ? "nw-resize" : "w-resize";
304
372
  if (i)
305
373
  return "s-resize";
@@ -314,11 +382,11 @@ function ot({
314
382
  let re, k;
315
383
  function le() {
316
384
  k === void 0 && (k = new CSSStyleSheet(), document.adoptedStyleSheets = [k]);
317
- const { cursorFlags: e, interactionState: t } = O();
385
+ const { cursorFlags: e, interactionState: t } = D();
318
386
  switch (t.state) {
319
387
  case "active":
320
388
  case "hover": {
321
- const n = ot({
389
+ const n = ut({
322
390
  cursorFlags: e,
323
391
  groups: t.hitRegions.map((r) => r.group),
324
392
  state: t.state
@@ -334,7 +402,7 @@ function le() {
334
402
  }
335
403
  }
336
404
  }
337
- function it(e, t) {
405
+ function ct(e, t) {
338
406
  if (e.length !== t.length)
339
407
  return !1;
340
408
  for (let n = 0; n < e.length; n++)
@@ -342,10 +410,10 @@ function it(e, t) {
342
410
  return !1;
343
411
  return !0;
344
412
  }
345
- function U(e, t) {
413
+ function X(e, t) {
346
414
  return P(e, t) ? 0 : e > t ? 1 : -1;
347
415
  }
348
- function F({
416
+ function j({
349
417
  panelConstraints: e,
350
418
  size: t
351
419
  }) {
@@ -355,15 +423,15 @@ function F({
355
423
  maxSize: r = 100,
356
424
  minSize: a = 0
357
425
  } = e;
358
- if (U(t, a) < 0)
426
+ if (X(t, a) < 0)
359
427
  if (o) {
360
- const u = (n + a) / 2;
361
- U(t, u) < 0 ? t = n : t = a;
428
+ const l = (n + a) / 2;
429
+ X(t, l) < 0 ? t = n : t = a;
362
430
  } else
363
431
  t = a;
364
432
  return t = Math.min(r, t), t = G(t), t;
365
433
  }
366
- function V({
434
+ function Y({
367
435
  delta: e,
368
436
  initialLayout: t,
369
437
  panelConstraints: n,
@@ -373,141 +441,141 @@ function V({
373
441
  }) {
374
442
  if (P(e, 0))
375
443
  return t;
376
- const u = Object.values(t), i = Object.values(r), s = [...u], [l, c] = o;
377
- x(l != null, "Invalid first pivot index"), x(c != null, "Invalid second pivot index");
378
- let d = 0;
444
+ const l = Object.values(t), i = Object.values(r), s = [...l], [u, c] = o;
445
+ z(u != null, "Invalid first pivot index"), z(c != null, "Invalid second pivot index");
446
+ let h = 0;
379
447
  if (a === "keyboard") {
380
448
  {
381
- const f = e < 0 ? c : l, p = n[f];
382
- x(
383
- p,
449
+ const f = e < 0 ? c : u, d = n[f];
450
+ z(
451
+ d,
384
452
  `Panel constraints not found for index ${f}`
385
453
  );
386
454
  const {
387
- collapsedSize: h = 0,
388
- collapsible: y,
389
- minSize: S = 0
390
- } = p;
391
- if (y) {
392
- const v = u[f];
393
- if (x(
394
- v != null,
455
+ collapsedSize: y = 0,
456
+ collapsible: g,
457
+ minSize: v = 0
458
+ } = d;
459
+ if (g) {
460
+ const x = l[f];
461
+ if (z(
462
+ x != null,
395
463
  `Previous layout not found for panel index ${f}`
396
- ), P(v, h)) {
397
- const g = S - v;
398
- U(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
464
+ ), P(x, y)) {
465
+ const S = v - x;
466
+ X(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
399
467
  }
400
468
  }
401
469
  }
402
470
  {
403
- const f = e < 0 ? l : c, p = n[f];
404
- x(
405
- p,
471
+ const f = e < 0 ? u : c, d = n[f];
472
+ z(
473
+ d,
406
474
  `No panel constraints found for index ${f}`
407
475
  );
408
476
  const {
409
- collapsedSize: h = 0,
410
- collapsible: y,
411
- minSize: S = 0
412
- } = p;
413
- if (y) {
414
- const v = u[f];
415
- if (x(
416
- v != null,
477
+ collapsedSize: y = 0,
478
+ collapsible: g,
479
+ minSize: v = 0
480
+ } = d;
481
+ if (g) {
482
+ const x = l[f];
483
+ if (z(
484
+ x != null,
417
485
  `Previous layout not found for panel index ${f}`
418
- ), P(v, S)) {
419
- const g = v - h;
420
- U(g, Math.abs(e)) > 0 && (e = e < 0 ? 0 - g : g);
486
+ ), P(x, v)) {
487
+ const S = x - y;
488
+ X(S, Math.abs(e)) > 0 && (e = e < 0 ? 0 - S : S);
421
489
  }
422
490
  }
423
491
  }
424
492
  }
425
493
  {
426
494
  const f = e < 0 ? 1 : -1;
427
- let p = e < 0 ? c : l, h = 0;
495
+ let d = e < 0 ? c : u, y = 0;
428
496
  for (; ; ) {
429
- const S = u[p];
430
- x(
431
- S != null,
432
- `Previous layout not found for panel index ${p}`
497
+ const v = l[d];
498
+ z(
499
+ v != null,
500
+ `Previous layout not found for panel index ${d}`
433
501
  );
434
- const g = F({
435
- panelConstraints: n[p],
502
+ const S = j({
503
+ panelConstraints: n[d],
436
504
  size: 100
437
- }) - S;
438
- if (h += g, p += f, p < 0 || p >= n.length)
505
+ }) - v;
506
+ if (y += S, d += f, d < 0 || d >= n.length)
439
507
  break;
440
508
  }
441
- const y = Math.min(Math.abs(e), Math.abs(h));
442
- e = e < 0 ? 0 - y : y;
509
+ const g = Math.min(Math.abs(e), Math.abs(y));
510
+ e = e < 0 ? 0 - g : g;
443
511
  }
444
512
  {
445
- let p = e < 0 ? l : c;
446
- for (; p >= 0 && p < n.length; ) {
447
- const h = Math.abs(e) - Math.abs(d), y = u[p];
448
- x(
449
- y != null,
450
- `Previous layout not found for panel index ${p}`
513
+ let d = e < 0 ? u : c;
514
+ for (; d >= 0 && d < n.length; ) {
515
+ const y = Math.abs(e) - Math.abs(h), g = l[d];
516
+ z(
517
+ g != null,
518
+ `Previous layout not found for panel index ${d}`
451
519
  );
452
- const S = y - h, v = F({
453
- panelConstraints: n[p],
454
- size: S
520
+ const v = g - y, x = j({
521
+ panelConstraints: n[d],
522
+ size: v
455
523
  });
456
- if (!P(y, v) && (d += y - v, s[p] = v, d.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
524
+ if (!P(g, x) && (h += g - x, s[d] = x, h.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
457
525
  numeric: !0
458
526
  }) >= 0))
459
527
  break;
460
- e < 0 ? p-- : p++;
528
+ e < 0 ? d-- : d++;
461
529
  }
462
530
  }
463
- if (it(i, s))
531
+ if (ct(i, s))
464
532
  return r;
465
533
  {
466
- const f = e < 0 ? c : l, p = u[f];
467
- x(
468
- p != null,
534
+ const f = e < 0 ? c : u, d = l[f];
535
+ z(
536
+ d != null,
469
537
  `Previous layout not found for panel index ${f}`
470
538
  );
471
- const h = p + d, y = F({
539
+ const y = d + h, g = j({
472
540
  panelConstraints: n[f],
473
- size: h
541
+ size: y
474
542
  });
475
- if (s[f] = y, !P(y, h)) {
476
- let S = h - y, g = e < 0 ? c : l;
477
- for (; g >= 0 && g < n.length; ) {
478
- const w = s[g];
479
- x(
480
- w != null,
481
- `Previous layout not found for panel index ${g}`
543
+ if (s[f] = g, !P(g, y)) {
544
+ let v = y - g, S = e < 0 ? c : u;
545
+ for (; S >= 0 && S < n.length; ) {
546
+ const b = s[S];
547
+ z(
548
+ b != null,
549
+ `Previous layout not found for panel index ${S}`
482
550
  );
483
- const L = w + S, C = F({
484
- panelConstraints: n[g],
551
+ const L = b + v, R = j({
552
+ panelConstraints: n[S],
485
553
  size: L
486
554
  });
487
- if (P(w, C) || (S -= C - w, s[g] = C), P(S, 0))
555
+ if (P(b, R) || (v -= R - b, s[S] = R), P(v, 0))
488
556
  break;
489
- e > 0 ? g-- : g++;
557
+ e > 0 ? S-- : S++;
490
558
  }
491
559
  }
492
560
  }
493
- const z = Object.values(s).reduce(
494
- (f, p) => p + f,
561
+ const m = Object.values(s).reduce(
562
+ (f, d) => d + f,
495
563
  0
496
564
  );
497
- if (!P(z, 100, 0.1))
565
+ if (!P(m, 100, 0.1))
498
566
  return r;
499
- const m = Object.keys(r);
500
- return s.reduce((f, p, h) => (f[m[h]] = p, f), {});
567
+ const p = Object.keys(r);
568
+ return s.reduce((f, d, y) => (f[p[y]] = d, f), {});
501
569
  }
502
- function W(e, t) {
570
+ function U(e, t) {
503
571
  if (Object.keys(e).length !== Object.keys(t).length)
504
572
  return !1;
505
573
  for (const n in e)
506
- if (U(e[n], t[n]) !== 0)
574
+ if (t[n] === void 0 || X(e[n], t[n]) !== 0)
507
575
  return !1;
508
576
  return !0;
509
577
  }
510
- function ke({
578
+ function Ae({
511
579
  event: e,
512
580
  hitRegions: t,
513
581
  initialLayoutMap: n,
@@ -515,64 +583,66 @@ function ke({
515
583
  pointerDownAtPoint: r
516
584
  }) {
517
585
  let a = 0;
518
- const u = new Map(o);
586
+ const l = new Map(o);
519
587
  t.forEach((i) => {
520
- const { group: s, groupSize: l } = i, { disableCursor: c, orientation: d, panels: z } = s;
521
- let m = 0;
522
- r ? d === "horizontal" ? m = (e.clientX - r.x) / l * 100 : m = (e.clientY - r.y) / l * 100 : d === "horizontal" ? m = e.clientX < 0 ? -100 : 100 : m = e.clientY < 0 ? -100 : 100;
588
+ const { group: s, groupSize: u } = i, { disableCursor: c, orientation: h, panels: m } = s;
589
+ let p = 0;
590
+ r ? h === "horizontal" ? p = (e.clientX - r.x) / u * 100 : p = (e.clientY - r.y) / u * 100 : h === "horizontal" ? p = e.clientX < 0 ? -100 : 100 : p = e.clientY < 0 ? -100 : 100;
523
591
  const f = n.get(s), {
524
- derivedPanelConstraints: p,
525
- layout: h,
526
- separatorToPanels: y
527
- } = o.get(s) ?? {};
528
- if (p && f && h && y) {
529
- const S = V({
530
- delta: m,
592
+ defaultLayoutDeferred: d,
593
+ derivedPanelConstraints: y,
594
+ layout: g,
595
+ separatorToPanels: v
596
+ } = o.get(s) ?? { defaultLayoutDeferred: !1 };
597
+ if (y && f && g && v) {
598
+ const x = Y({
599
+ delta: p,
531
600
  initialLayout: f,
532
- panelConstraints: p,
533
- pivotIndices: i.panels.map((v) => z.indexOf(v)),
534
- prevLayout: h,
601
+ panelConstraints: y,
602
+ pivotIndices: i.panels.map((S) => m.indexOf(S)),
603
+ prevLayout: g,
535
604
  trigger: "mouse-or-touch"
536
605
  });
537
- if (W(S, h)) {
538
- if (m !== 0 && !c)
539
- switch (d) {
606
+ if (U(x, g)) {
607
+ if (p !== 0 && !c)
608
+ switch (h) {
540
609
  case "horizontal": {
541
- a |= m < 0 ? Ee : Me;
610
+ a |= p < 0 ? De : Oe;
542
611
  break;
543
612
  }
544
613
  case "vertical": {
545
- a |= m < 0 ? Ie : Ge;
614
+ a |= p < 0 ? Te : _e;
546
615
  break;
547
616
  }
548
617
  }
549
618
  } else {
550
- u.set(i.group, {
551
- derivedPanelConstraints: p,
552
- layout: S,
553
- separatorToPanels: y
619
+ l.set(i.group, {
620
+ defaultLayoutDeferred: d,
621
+ derivedPanelConstraints: y,
622
+ layout: x,
623
+ separatorToPanels: v
554
624
  });
555
- const v = i.group.panels.map(({ id: g }) => g).join(",");
556
- i.group.inMemoryLayouts[v] = S;
625
+ const S = i.group.panels.map(({ id: b }) => b).join(",");
626
+ i.group.inMemoryLayouts[S] = x;
557
627
  }
558
628
  }
559
629
  }), E({
560
630
  cursorFlags: a,
561
- mountedGroups: u
631
+ mountedGroups: l
562
632
  }), le();
563
633
  }
564
- function he(e) {
634
+ function ve(e) {
565
635
  if (e.defaultPrevented)
566
636
  return;
567
637
  if (e.relatedTarget !== null)
568
638
  return;
569
639
  if (e.clientX === 0 && e.clientY === 0)
570
640
  return;
571
- const { interactionState: t, mountedGroups: n } = O();
641
+ const { interactionState: t, mountedGroups: n } = D();
572
642
  switch (t.state) {
573
643
  case "active":
574
644
  t.hitRegions.forEach((o) => {
575
- e.currentTarget === o.group.element && ke({
645
+ e.currentTarget === o.group.element && Ae({
576
646
  event: e,
577
647
  hitRegions: t.hitRegions,
578
648
  initialLayoutMap: t.initialLayoutMap,
@@ -581,10 +651,10 @@ function he(e) {
581
651
  });
582
652
  }
583
653
  }
584
- function te(e) {
654
+ function oe(e) {
585
655
  const t = e.parentElement;
586
- x(t, "Parent group element not found");
587
- const { mountedGroups: n } = O();
656
+ z(t, "Parent group element not found");
657
+ const { mountedGroups: n } = D();
588
658
  for (const [o] of n)
589
659
  if (o.element === t)
590
660
  return o;
@@ -605,186 +675,177 @@ function A({
605
675
  if (!P(r, 100) && o.length > 0)
606
676
  for (let i = 0; i < t.length; i++) {
607
677
  const s = o[i];
608
- x(s != null, `No layout data found for index ${i}`);
609
- const l = 100 / r * s;
610
- o[i] = l;
678
+ z(s != null, `No layout data found for index ${i}`);
679
+ const u = 100 / r * s;
680
+ o[i] = u;
611
681
  }
612
682
  let a = 0;
613
683
  for (let i = 0; i < t.length; i++) {
614
684
  const s = o[i];
615
- x(s != null, `No layout data found for index ${i}`);
616
- const l = F({
685
+ z(s != null, `No layout data found for index ${i}`);
686
+ const u = j({
617
687
  panelConstraints: t[i],
618
688
  size: s
619
689
  });
620
- s != l && (a += s - l, o[i] = l);
690
+ s != u && (a += s - u, o[i] = u);
621
691
  }
622
692
  if (!P(a, 0))
623
693
  for (let i = 0; i < t.length; i++) {
624
694
  const s = o[i];
625
- x(s != null, `No layout data found for index ${i}`);
626
- const l = s + a, c = F({
695
+ z(s != null, `No layout data found for index ${i}`);
696
+ const u = s + a, c = j({
627
697
  panelConstraints: t[i],
628
- size: l
698
+ size: u
629
699
  });
630
700
  if (s !== c && (a -= c - s, o[i] = c, P(a, 0)))
631
701
  break;
632
702
  }
633
- const u = Object.keys(e);
634
- return o.reduce((i, s, l) => (i[u[l]] = s, i), {});
703
+ const l = Object.keys(e);
704
+ return o.reduce((i, s, u) => (i[l[u]] = s, i), {});
635
705
  }
636
- function Oe({
706
+ function Ne({
637
707
  groupId: e
638
708
  }) {
639
709
  const t = () => {
640
- const { mountedGroups: n } = O();
710
+ const { mountedGroups: n } = D();
641
711
  for (const [o, r] of n)
642
712
  if (o.id === e)
643
713
  return { group: o, ...r };
644
- throw Error(`Group ${e} not found`);
714
+ throw Error(`Could not find Group with id "${e}"`);
645
715
  };
646
716
  return {
647
717
  getLayout() {
648
- const { layout: n } = t();
649
- return n;
718
+ const { defaultLayoutDeferred: n, layout: o } = t();
719
+ return n ? {} : o;
650
720
  },
651
721
  setLayout(n) {
652
722
  const {
653
- derivedPanelConstraints: o,
654
- group: r,
655
- layout: a,
656
- separatorToPanels: u
657
- } = t(), i = A({
723
+ defaultLayoutDeferred: o,
724
+ derivedPanelConstraints: r,
725
+ group: a,
726
+ layout: l,
727
+ separatorToPanels: i
728
+ } = t(), s = A({
658
729
  layout: n,
659
- panelConstraints: o
730
+ panelConstraints: r
660
731
  });
661
- return W(a, i) || E((s) => ({
662
- mountedGroups: new Map(s.mountedGroups).set(r, {
663
- derivedPanelConstraints: o,
664
- layout: i,
665
- separatorToPanels: u
732
+ return o ? l : (U(l, s) || E((u) => ({
733
+ mountedGroups: new Map(u.mountedGroups).set(a, {
734
+ defaultLayoutDeferred: o,
735
+ derivedPanelConstraints: r,
736
+ layout: s,
737
+ separatorToPanels: i
666
738
  })
667
- })), i;
739
+ })), s);
668
740
  }
669
741
  };
670
742
  }
671
- function Te(e) {
672
- const { mountedGroups: t } = O(), n = t.get(e);
673
- return x(n, `Mounted Group ${e.id} not found`), n;
743
+ function $e(e) {
744
+ const { mountedGroups: t } = D(), n = t.get(e);
745
+ return z(n, `Mounted Group ${e.id} not found`), n;
674
746
  }
675
- function _(e, t) {
676
- const n = te(e), o = Te(n), r = n.separators.find(
677
- (d) => d.element === e
747
+ function T(e, t) {
748
+ const n = oe(e), o = $e(n), r = n.separators.find(
749
+ (h) => h.element === e
678
750
  );
679
- x(r, "Matching separator not found");
751
+ z(r, "Matching separator not found");
680
752
  const a = o.separatorToPanels.get(r);
681
- x(a, "Matching panels not found");
682
- const u = a.map((d) => n.panels.indexOf(d)), s = Oe({ groupId: n.id }).getLayout(), l = V({
753
+ z(a, "Matching panels not found");
754
+ const l = a.map((h) => n.panels.indexOf(h)), s = Ne({ groupId: n.id }).getLayout(), u = Y({
683
755
  delta: t,
684
756
  initialLayout: s,
685
757
  panelConstraints: o.derivedPanelConstraints,
686
- pivotIndices: u,
758
+ pivotIndices: l,
687
759
  prevLayout: s,
688
760
  trigger: "keyboard"
689
761
  }), c = A({
690
- layout: l,
762
+ layout: u,
691
763
  panelConstraints: o.derivedPanelConstraints
692
764
  });
693
- W(s, c) || E((d) => ({
694
- mountedGroups: new Map(d.mountedGroups).set(n, {
765
+ U(s, c) || E((h) => ({
766
+ mountedGroups: new Map(h.mountedGroups).set(n, {
767
+ defaultLayoutDeferred: o.defaultLayoutDeferred,
695
768
  derivedPanelConstraints: o.derivedPanelConstraints,
696
769
  layout: c,
697
770
  separatorToPanels: o.separatorToPanels
698
771
  })
699
772
  }));
700
773
  }
701
- function ge(e) {
774
+ function Se(e) {
702
775
  if (e.defaultPrevented)
703
776
  return;
704
- const t = e.currentTarget, n = te(t);
777
+ const t = e.currentTarget, n = oe(t);
705
778
  if (!n.disabled)
706
779
  switch (e.key) {
707
780
  case "ArrowDown": {
708
- e.preventDefault(), n.orientation === "vertical" && _(t, 5);
781
+ e.preventDefault(), n.orientation === "vertical" && T(t, 5);
709
782
  break;
710
783
  }
711
784
  case "ArrowLeft": {
712
- e.preventDefault(), n.orientation === "horizontal" && _(t, -5);
785
+ e.preventDefault(), n.orientation === "horizontal" && T(t, -5);
713
786
  break;
714
787
  }
715
788
  case "ArrowRight": {
716
- e.preventDefault(), n.orientation === "horizontal" && _(t, 5);
789
+ e.preventDefault(), n.orientation === "horizontal" && T(t, 5);
717
790
  break;
718
791
  }
719
792
  case "ArrowUp": {
720
- e.preventDefault(), n.orientation === "vertical" && _(t, -5);
793
+ e.preventDefault(), n.orientation === "vertical" && T(t, -5);
721
794
  break;
722
795
  }
723
796
  case "End": {
724
- e.preventDefault(), _(t, 100);
797
+ e.preventDefault(), T(t, 100);
725
798
  break;
726
799
  }
727
800
  case "Enter": {
728
801
  e.preventDefault();
729
- const o = te(t), { derivedPanelConstraints: r, layout: a, separatorToPanels: u } = Te(o), i = o.separators.find(
730
- (d) => d.element === t
802
+ const o = oe(t), { derivedPanelConstraints: r, layout: a, separatorToPanels: l } = $e(o), i = o.separators.find(
803
+ (h) => h.element === t
731
804
  );
732
- x(i, "Matching separator not found");
733
- const s = u.get(i);
734
- x(s, "Matching panels not found");
735
- const l = s[0], c = r.find(
736
- (d) => d.panelId === l.id
805
+ z(i, "Matching separator not found");
806
+ const s = l.get(i);
807
+ z(s, "Matching panels not found");
808
+ const u = s[0], c = r.find(
809
+ (h) => h.panelId === u.id
737
810
  );
738
- if (x(c, "Panel metadata not found"), c.collapsible) {
739
- const d = a[l.id], z = c.collapsedSize === d ? o.inMemoryLastExpandedPanelSizes[l.id] ?? c.minSize : c.collapsedSize;
740
- _(t, z - d);
811
+ if (z(c, "Panel metadata not found"), c.collapsible) {
812
+ const h = a[u.id], m = c.collapsedSize === h ? o.inMemoryLastExpandedPanelSizes[u.id] ?? c.minSize : c.collapsedSize;
813
+ T(t, m - h);
741
814
  }
742
815
  break;
743
816
  }
744
817
  case "F6": {
745
818
  e.preventDefault();
746
- const r = te(t).separators.map(
819
+ const r = oe(t).separators.map(
747
820
  (s) => s.element
748
821
  ), a = Array.from(r).findIndex(
749
822
  (s) => s === e.currentTarget
750
823
  );
751
- x(a !== null, "Index not found");
752
- const u = e.shiftKey ? a > 0 ? a - 1 : r.length - 1 : a + 1 < r.length ? a + 1 : 0;
753
- r[u].focus();
824
+ z(a !== null, "Index not found");
825
+ const l = e.shiftKey ? a > 0 ? a - 1 : r.length - 1 : a + 1 < r.length ? a + 1 : 0;
826
+ r[l].focus();
754
827
  break;
755
828
  }
756
829
  case "Home": {
757
- e.preventDefault(), _(t, -100);
830
+ e.preventDefault(), T(t, -100);
758
831
  break;
759
832
  }
760
833
  }
761
834
  }
762
- function rt(e, t) {
763
- return {
764
- x: e.x >= t.left && e.x <= t.right ? 0 : Math.min(
765
- Math.abs(e.x - t.left),
766
- Math.abs(e.x - t.right)
767
- ),
768
- y: e.y >= t.top && e.y <= t.bottom ? 0 : Math.min(
769
- Math.abs(e.y - t.top),
770
- Math.abs(e.y - t.bottom)
771
- )
772
- };
773
- }
774
- function st(e, t, n) {
835
+ function ft(e, t, n) {
775
836
  let o, r = {
776
837
  x: 1 / 0,
777
838
  y: 1 / 0
778
839
  };
779
840
  for (const a of t) {
780
- const u = rt(n, a.rect);
841
+ const l = Ge(n, a.rect);
781
842
  switch (e) {
782
843
  case "horizontal": {
783
- u.x <= r.x && (o = a, r = u);
844
+ l.x <= r.x && (o = a, r = l);
784
845
  break;
785
846
  }
786
847
  case "vertical": {
787
- u.y <= r.y && (o = a, r = u);
848
+ l.y <= r.y && (o = a, r = l);
788
849
  break;
789
850
  }
790
851
  }
@@ -794,133 +855,133 @@ function st(e, t, n) {
794
855
  hitRegion: o
795
856
  } : void 0;
796
857
  }
797
- let ee;
798
- function at() {
799
- return ee === void 0 && (typeof matchMedia == "function" ? ee = !!matchMedia("(pointer:coarse)").matches : ee = !1), ee;
858
+ let ne;
859
+ function dt() {
860
+ return ne === void 0 && (typeof matchMedia == "function" ? ne = !!matchMedia("(pointer:coarse)").matches : ne = !1), ne;
800
861
  }
801
- function lt(e, t) {
862
+ function pt(e, t) {
802
863
  if (e === t) throw new Error("Cannot compare node with itself");
803
864
  const n = {
804
- a: Se(e),
805
- b: Se(t)
865
+ a: we(e),
866
+ b: we(t)
806
867
  };
807
868
  let o;
808
869
  for (; n.a.at(-1) === n.b.at(-1); )
809
870
  e = n.a.pop(), t = n.b.pop(), o = e;
810
- x(
871
+ z(
811
872
  o,
812
873
  "Stacking order can only be calculated for elements with a common ancestor"
813
874
  );
814
875
  const r = {
815
- a: ve(ye(n.a)),
816
- b: ve(ye(n.b))
876
+ a: ze(xe(n.a)),
877
+ b: ze(xe(n.b))
817
878
  };
818
879
  if (r.a === r.b) {
819
- const a = o.childNodes, u = {
880
+ const a = o.childNodes, l = {
820
881
  a: n.a.at(-1),
821
882
  b: n.b.at(-1)
822
883
  };
823
884
  let i = a.length;
824
885
  for (; i--; ) {
825
886
  const s = a[i];
826
- if (s === u.a) return 1;
827
- if (s === u.b) return -1;
887
+ if (s === l.a) return 1;
888
+ if (s === l.b) return -1;
828
889
  }
829
890
  }
830
891
  return Math.sign(r.a - r.b);
831
892
  }
832
- const ut = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
833
- function ct(e) {
834
- const t = getComputedStyle(_e(e) ?? e).display;
893
+ const ht = /\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;
894
+ function mt(e) {
895
+ const t = getComputedStyle(Fe(e) ?? e).display;
835
896
  return t === "flex" || t === "inline-flex";
836
897
  }
837
- function ft(e) {
898
+ function yt(e) {
838
899
  const t = getComputedStyle(e);
839
- return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || ct(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" || ut.test(t.willChange) || t.webkitOverflowScrolling === "touch");
900
+ return !!(t.position === "fixed" || t.zIndex !== "auto" && (t.position !== "static" || mt(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" || ht.test(t.willChange) || t.webkitOverflowScrolling === "touch");
840
901
  }
841
- function ye(e) {
902
+ function xe(e) {
842
903
  let t = e.length;
843
904
  for (; t--; ) {
844
905
  const n = e[t];
845
- if (x(n, "Missing node"), ft(n)) return n;
906
+ if (z(n, "Missing node"), yt(n)) return n;
846
907
  }
847
908
  return null;
848
909
  }
849
- function ve(e) {
910
+ function ze(e) {
850
911
  return e && Number(getComputedStyle(e).zIndex) || 0;
851
912
  }
852
- function Se(e) {
913
+ function we(e) {
853
914
  const t = [];
854
915
  for (; e; )
855
- t.push(e), e = _e(e);
916
+ t.push(e), e = Fe(e);
856
917
  return t;
857
918
  }
858
- function _e(e) {
919
+ function Fe(e) {
859
920
  const { parentNode: t } = e;
860
921
  return t && t instanceof ShadowRoot ? t.host : t;
861
922
  }
862
- function dt(e, t) {
923
+ function gt(e, t) {
863
924
  return e.x < t.x + t.width && e.x + e.width > t.x && e.y < t.y + t.height && e.y + e.height > t.y;
864
925
  }
865
- function pt({
926
+ function vt({
866
927
  groupElement: e,
867
928
  hitRegion: t,
868
929
  pointerEventTarget: n
869
930
  }) {
870
931
  if (!(n instanceof HTMLElement) || n.contains(e) || e.contains(n))
871
932
  return !0;
872
- if (lt(n, e) > 0) {
933
+ if (pt(n, e) > 0) {
873
934
  let o = n;
874
935
  for (; o; ) {
875
936
  if (o.contains(e))
876
937
  return !0;
877
- if (dt(o.getBoundingClientRect(), t))
938
+ if (gt(o.getBoundingClientRect(), t))
878
939
  return !1;
879
940
  o = o.parentElement;
880
941
  }
881
942
  }
882
943
  return !0;
883
944
  }
884
- function De(e, t) {
945
+ function He(e, t) {
885
946
  const n = [];
886
947
  return t.forEach((o, r) => {
887
948
  if (r.disabled)
888
949
  return;
889
- const a = at() ? me.coarse : me.precise, u = Re(r), i = st(r.orientation, u, {
950
+ const a = dt() ? ge.coarse : ge.precise, l = ke(r), i = ft(r.orientation, l, {
890
951
  x: e.clientX,
891
952
  y: e.clientY
892
953
  });
893
- i && i.distance.x <= a && i.distance.y <= a && pt({
954
+ i && i.distance.x <= a && i.distance.y <= a && vt({
894
955
  groupElement: r.element,
895
956
  hitRegion: i.hitRegion.rect,
896
957
  pointerEventTarget: e.target
897
958
  }) && n.push(i.hitRegion);
898
959
  }), n;
899
960
  }
900
- function xe(e) {
961
+ function be(e) {
901
962
  if (e.defaultPrevented)
902
963
  return;
903
- const { mountedGroups: t } = O(), n = De(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Map();
964
+ const { mountedGroups: t } = D(), n = He(e, t), o = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set(), l = /* @__PURE__ */ new Map();
904
965
  let i = !1;
905
966
  n.forEach((s) => {
906
967
  o.add(s.group), s.panels.forEach((c) => {
907
968
  r.add(c);
908
969
  }), s.separator && (a.add(s.separator), i || (i = !0, s.separator.element.focus()));
909
- const l = t.get(s.group);
910
- l && u.set(s.group, l.layout);
970
+ const u = t.get(s.group);
971
+ u && l.set(s.group, u.layout);
911
972
  }), E({
912
973
  interactionState: {
913
974
  hitRegions: n,
914
- initialLayoutMap: u,
975
+ initialLayoutMap: l,
915
976
  pointerDownAtPoint: { x: e.clientX, y: e.clientY },
916
977
  state: "active"
917
978
  }
918
979
  }), n.length && e.preventDefault();
919
980
  }
920
- function ze(e) {
981
+ function Le(e) {
921
982
  if (e.defaultPrevented)
922
983
  return;
923
- const { interactionState: t, mountedGroups: n } = O();
984
+ const { interactionState: t, mountedGroups: n } = D();
924
985
  switch (t.state) {
925
986
  case "active": {
926
987
  if (
@@ -937,7 +998,7 @@ function ze(e) {
937
998
  );
938
999
  return;
939
1000
  }
940
- ke({
1001
+ Ae({
941
1002
  event: e,
942
1003
  hitRegions: t.hitRegions,
943
1004
  initialLayoutMap: t.initialLayoutMap,
@@ -947,7 +1008,7 @@ function ze(e) {
947
1008
  break;
948
1009
  }
949
1010
  default: {
950
- const o = De(e, n);
1011
+ const o = He(e, n);
951
1012
  o.length === 0 ? t.state !== "inactive" && E({
952
1013
  interactionState: { state: "inactive" }
953
1014
  }) : E({
@@ -960,11 +1021,11 @@ function ze(e) {
960
1021
  }
961
1022
  }
962
1023
  }
963
- function be(e) {
1024
+ function Pe(e) {
964
1025
  if (e.defaultPrevented)
965
1026
  return;
966
1027
  e.preventDefault();
967
- const { interactionState: t } = O();
1028
+ const { interactionState: t } = D();
968
1029
  switch (t.state) {
969
1030
  case "active":
970
1031
  E({
@@ -975,32 +1036,32 @@ function be(e) {
975
1036
  }), le();
976
1037
  }
977
1038
  }
978
- function we(e) {
1039
+ function Re(e) {
979
1040
  let t = 0, n = 0;
980
1041
  const o = {};
981
1042
  for (const a of e)
982
1043
  if (a.defaultSize !== void 0) {
983
1044
  t++;
984
- const u = G(a.defaultSize);
985
- n += u, o[a.panelId] = u;
1045
+ const l = G(a.defaultSize);
1046
+ n += l, o[a.panelId] = l;
986
1047
  } else
987
1048
  o[a.panelId] = void 0;
988
1049
  const r = e.length - t;
989
1050
  if (r !== 0) {
990
1051
  const a = G((100 - n) / r);
991
- for (const u of e)
992
- u.defaultSize === void 0 && (o[u.panelId] = a);
1052
+ for (const l of e)
1053
+ l.defaultSize === void 0 && (o[l.panelId] = a);
993
1054
  }
994
1055
  return o;
995
1056
  }
996
- function mt(e, t, n) {
1057
+ function St(e, t, n) {
997
1058
  const o = n[0];
998
1059
  if (!o)
999
1060
  return;
1000
- const r = e.panels.find((u) => u.element === t);
1061
+ const r = e.panels.find((l) => l.element === t);
1001
1062
  if (!r || !r.onResize)
1002
1063
  return;
1003
- const a = H({ group: e });
1064
+ const a = B({ group: e });
1004
1065
  r.onResize(
1005
1066
  {
1006
1067
  asPercentage: G(
@@ -1011,89 +1072,89 @@ function mt(e, t, n) {
1011
1072
  r.id
1012
1073
  );
1013
1074
  }
1014
- function ht(e) {
1075
+ function xt(e) {
1015
1076
  let t = !0;
1016
- x(
1017
- e.separators.length === 0 || e.separators.length < e.panels.length,
1018
- "Invalid Group configuration; too many Separator components"
1019
- );
1020
- const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((m) => {
1021
- for (const f of m) {
1022
- const { borderBoxSize: p, target: h } = f;
1023
- if (h === e.element) {
1077
+ const n = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set(), r = new ResizeObserver((p) => {
1078
+ for (const f of p) {
1079
+ const { borderBoxSize: d, target: y } = f;
1080
+ if (y === e.element) {
1024
1081
  if (t) {
1025
- if (H({ group: e }) === 0)
1082
+ if (B({ group: e }) === 0)
1026
1083
  return;
1027
- E((S) => {
1028
- const v = S.mountedGroups.get(e);
1029
- if (v) {
1030
- const g = pe(e), w = v.defaultLayoutDeferred ? we(g) : v.layout, L = A({
1031
- layout: w,
1032
- panelConstraints: g
1084
+ E((v) => {
1085
+ const x = v.mountedGroups.get(e);
1086
+ if (x) {
1087
+ const S = ye(e), b = x.defaultLayoutDeferred ? Re(S) : x.layout, L = A({
1088
+ layout: b,
1089
+ panelConstraints: S
1033
1090
  });
1034
- return !v.defaultLayoutDeferred && W(w, L) ? S : {
1035
- mountedGroups: new Map(S.mountedGroups).set(e, {
1036
- derivedPanelConstraints: g,
1091
+ return !x.defaultLayoutDeferred && U(b, L) ? v : {
1092
+ mountedGroups: new Map(v.mountedGroups).set(e, {
1093
+ defaultLayoutDeferred: !1,
1094
+ derivedPanelConstraints: S,
1037
1095
  layout: L,
1038
- separatorToPanels: v.separatorToPanels
1096
+ separatorToPanels: x.separatorToPanels
1039
1097
  })
1040
1098
  };
1041
1099
  }
1042
- return S;
1100
+ return v;
1043
1101
  });
1044
1102
  }
1045
1103
  } else
1046
- mt(e, h, p);
1104
+ St(e, y, d);
1047
1105
  }
1048
1106
  });
1049
- r.observe(e.element), e.panels.forEach((m) => {
1050
- x(
1051
- !n.has(m.id),
1052
- `Panel ids must be unique; id "${m.id}" was used more than once`
1053
- ), n.add(m.id), m.onResize && r.observe(m.element);
1107
+ r.observe(e.element), e.panels.forEach((p) => {
1108
+ z(
1109
+ !n.has(p.id),
1110
+ `Panel ids must be unique; id "${p.id}" was used more than once`
1111
+ ), n.add(p.id), p.onResize && r.observe(p.element);
1054
1112
  });
1055
- const a = H({ group: e }), u = pe(e), i = e.panels.map(({ id: m }) => m).join(",");
1113
+ const a = B({ group: e }), l = ye(e), i = e.panels.map(({ id: p }) => p).join(",");
1056
1114
  let s = e.defaultLayout;
1057
1115
  s && e.panels.length !== Object.keys(s).length && (s = void 0);
1058
- const l = e.inMemoryLayouts[i] ?? s ?? we(u), c = A({
1059
- layout: l,
1060
- panelConstraints: u
1061
- }), d = Re(e), z = E((m) => ({
1062
- mountedGroups: new Map(m.mountedGroups).set(e, {
1063
- defaultLayoutDeferred: a === 0,
1064
- derivedPanelConstraints: u,
1065
- layout: c,
1066
- separatorToPanels: new Map(
1067
- d.filter((f) => f.separator).map((f) => [f.separator, f.panels])
1068
- )
1069
- })
1070
- }));
1071
- return e.element.addEventListener("pointerleave", he), e.separators.forEach((m) => {
1072
- x(
1073
- !o.has(m.id),
1074
- `Separator ids must be unique; id "${m.id}" was used more than once`
1075
- ), o.add(m.id), m.element.addEventListener("keydown", ge);
1076
- }), z.mountedGroups.size === 1 && (window.addEventListener("pointerdown", xe), window.addEventListener("pointermove", ze), window.addEventListener("pointerup", be)), function() {
1116
+ const u = e.inMemoryLayouts[i] ?? s ?? Re(l), c = A({
1117
+ layout: u,
1118
+ panelConstraints: l
1119
+ }), h = ke(e), m = E((p) => {
1120
+ const f = /* @__PURE__ */ new Map();
1121
+ return h.forEach((d) => {
1122
+ d.separator && f.set(d.separator, d.panels);
1123
+ }), {
1124
+ mountedGroups: new Map(p.mountedGroups).set(e, {
1125
+ defaultLayoutDeferred: a === 0,
1126
+ derivedPanelConstraints: l,
1127
+ layout: c,
1128
+ separatorToPanels: f
1129
+ })
1130
+ };
1131
+ });
1132
+ return e.element.addEventListener("pointerleave", ve), e.separators.forEach((p) => {
1133
+ z(
1134
+ !o.has(p.id),
1135
+ `Separator ids must be unique; id "${p.id}" was used more than once`
1136
+ ), o.add(p.id), p.element.addEventListener("keydown", Se);
1137
+ }), m.mountedGroups.size === 1 && (window.addEventListener("pointerdown", be), window.addEventListener("pointermove", Le), window.addEventListener("pointerup", Pe)), function() {
1077
1138
  t = !1;
1078
- const f = E((p) => {
1079
- const h = new Map(p.mountedGroups);
1080
- return h.delete(e), { mountedGroups: h };
1139
+ const f = E((d) => {
1140
+ const y = new Map(d.mountedGroups);
1141
+ return y.delete(e), { mountedGroups: y };
1081
1142
  });
1082
- e.element.removeEventListener("pointerleave", he), e.separators.forEach((p) => {
1083
- p.element.removeEventListener("keydown", ge);
1084
- }), f.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", xe), window.removeEventListener("pointermove", ze), window.removeEventListener("pointerup", be)), r.disconnect();
1143
+ e.element.removeEventListener("pointerleave", ve), e.separators.forEach((d) => {
1144
+ d.element.removeEventListener("keydown", Se);
1145
+ }), f.mountedGroups.size === 0 && (window.removeEventListener("pointerdown", be), window.removeEventListener("pointermove", Le), window.removeEventListener("pointerup", Pe)), r.disconnect();
1085
1146
  };
1086
1147
  }
1087
1148
  function ue(e) {
1088
- const t = We();
1149
+ const t = Xe();
1089
1150
  return `${e ?? t}`;
1090
1151
  }
1091
- const j = typeof window < "u" ? je : Be;
1152
+ const N = typeof window < "u" ? Ye : Ce;
1092
1153
  function ce(e) {
1093
- const t = T(e);
1094
- return j(() => {
1154
+ const t = O(e);
1155
+ return N(() => {
1095
1156
  t.current = e;
1096
- }, [e]), Le((n) => t.current?.(n), [t]);
1157
+ }, [e]), Ee((n) => t.current?.(n), [t]);
1097
1158
  }
1098
1159
  function fe(...e) {
1099
1160
  return ce((t) => {
@@ -1112,136 +1173,161 @@ function fe(...e) {
1112
1173
  });
1113
1174
  });
1114
1175
  }
1115
- const Ae = "--react-resizable-panels--panel--pointer-events";
1116
- function Ne(e, t) {
1176
+ function zt(e) {
1177
+ const t = O({ ...e });
1178
+ return N(() => {
1179
+ for (const n in e)
1180
+ t.current[n] = e[n];
1181
+ }, [e]), t.current;
1182
+ }
1183
+ const We = "--react-resizable-panels--panel--pointer-events";
1184
+ function je(e, t) {
1117
1185
  const n = e.replace(/[^a-zA-Z0-9\-_]/g, ""), o = t.replace(/[^a-zA-Z0-9\-_]/g, "");
1118
1186
  return `--react-resizable-panels--${n}--${o}`;
1119
1187
  }
1120
- const $e = Ue(null);
1121
- function gt(e, t) {
1122
- const n = T({
1188
+ const Be = qe(null);
1189
+ function wt(e, t) {
1190
+ const n = O({
1123
1191
  getLayout: () => ({}),
1124
- setLayout: nt
1192
+ setLayout: lt
1125
1193
  });
1126
- Pe(t, () => n.current, []), j(() => {
1194
+ Me(t, () => n.current, []), N(() => {
1127
1195
  Object.assign(
1128
1196
  n.current,
1129
- Oe({ groupId: e })
1197
+ Ne({ groupId: e })
1130
1198
  );
1131
1199
  });
1132
1200
  }
1133
- function Pt({
1201
+ function Gt({
1134
1202
  children: e,
1135
1203
  className: t,
1136
1204
  defaultLayout: n,
1137
1205
  disableCursor: o,
1138
1206
  disabled: r,
1139
1207
  elementRef: a,
1140
- groupRef: u,
1208
+ groupRef: l,
1141
1209
  id: i,
1142
1210
  onLayoutChange: s,
1143
- orientation: l = "horizontal",
1211
+ orientation: u = "horizontal",
1144
1212
  style: c,
1145
- ...d
1213
+ ...h
1146
1214
  }) {
1147
- const z = T({}), m = ce((b) => {
1148
- W(z.current, b) || (z.current = b, s?.(b));
1149
- }), f = ue(i), [p, h] = I(!1), [y, S] = I(null), [v, g] = I(n ?? {}), [w, L] = I([]), [C, K] = I([]), ne = T({}), X = T({}), Y = fe(S, a);
1150
- gt(f, u);
1151
- const q = Ce(
1215
+ const m = O({}), p = ce((w) => {
1216
+ U(m.current, w) || (m.current = w, s?.(w));
1217
+ }), f = ue(i), [d, y] = I(!1), [g, v] = I(null), [x, S] = I(n ?? {}), [b, L] = I([]), [R, q] = I([]), Z = O({
1218
+ lastExpandedPanelSizes: {},
1219
+ layouts: {}
1220
+ }), J = fe(v, a);
1221
+ wt(f, l);
1222
+ const Q = Ie(
1152
1223
  () => ({
1153
1224
  id: f,
1154
- orientation: l,
1155
- registerPanel: (b) => (L((M) => se(l, [...M, b])), () => {
1156
- L((M) => M.filter((N) => N !== b));
1225
+ orientation: u,
1226
+ registerPanel: (w) => (L((M) => se(u, [...M, w])), () => {
1227
+ L((M) => M.filter((F) => F !== w));
1157
1228
  }),
1158
- registerSeparator: (b) => (K(
1159
- (M) => se(l, [...M, b])
1229
+ registerSeparator: (w) => (q(
1230
+ (M) => se(u, [...M, w])
1160
1231
  ), () => {
1161
- K(
1162
- (M) => M.filter((N) => N !== b)
1232
+ q(
1233
+ (M) => M.filter((F) => F !== w)
1163
1234
  );
1164
1235
  })
1165
1236
  }),
1166
- [f, l]
1167
- );
1168
- j(() => {
1169
- if (y === null || w.length === 0)
1237
+ [f, u]
1238
+ ), $ = zt({
1239
+ defaultLayout: n,
1240
+ disableCursor: o
1241
+ }), V = O(null);
1242
+ N(() => {
1243
+ if (g === null)
1170
1244
  return;
1171
- const b = {
1172
- defaultLayout: n,
1173
- disableCursor: !!o,
1245
+ const w = {
1246
+ defaultLayout: $.defaultLayout,
1247
+ disableCursor: !!$.disableCursor,
1174
1248
  disabled: !!r,
1175
- element: y,
1249
+ element: g,
1176
1250
  id: f,
1177
- inMemoryLastExpandedPanelSizes: ne.current,
1178
- inMemoryLayouts: X.current,
1179
- orientation: l,
1180
- panels: w,
1181
- separators: C
1182
- }, M = ht(b), oe = O().mountedGroups.get(b);
1183
- oe && (g(oe.layout), m?.(oe.layout));
1184
- const Fe = D.addListener(
1251
+ inMemoryLastExpandedPanelSizes: Z.current.lastExpandedPanelSizes,
1252
+ inMemoryLayouts: Z.current.layouts,
1253
+ orientation: u,
1254
+ panels: b,
1255
+ separators: R
1256
+ };
1257
+ V.current = w;
1258
+ const M = xt(w), he = D().mountedGroups.get(w);
1259
+ if (he) {
1260
+ const { defaultLayoutDeferred: H, derivedPanelConstraints: W, layout: ee } = he;
1261
+ !H && W.length > 0 && (S(ee), p?.(ee));
1262
+ }
1263
+ const Ue = _.addListener(
1185
1264
  "interactionStateChange",
1186
- (J) => {
1187
- switch (J.state) {
1265
+ (H) => {
1266
+ switch (H.state) {
1188
1267
  case "active": {
1189
- h(
1190
- J.hitRegions.some(
1191
- ($) => $.group === b
1268
+ y(
1269
+ H.hitRegions.some(
1270
+ (W) => W.group === w
1192
1271
  )
1193
1272
  );
1194
1273
  break;
1195
1274
  }
1196
1275
  default: {
1197
- h(!1);
1276
+ y(!1);
1198
1277
  break;
1199
1278
  }
1200
1279
  }
1201
1280
  }
1202
- ), He = D.addListener(
1281
+ ), Ve = _.addListener(
1203
1282
  "mountedGroupsChange",
1204
- (J) => {
1205
- const $ = J.get(b);
1206
- $ && $.derivedPanelConstraints.length > 0 && (g($.layout), m?.($.layout));
1283
+ (H) => {
1284
+ const W = H.get(w);
1285
+ if (W) {
1286
+ const { defaultLayoutDeferred: ee, derivedPanelConstraints: Ke, layout: me } = W;
1287
+ if (ee || Ke.length === 0)
1288
+ return;
1289
+ S(me), p?.(me);
1290
+ }
1207
1291
  }
1208
1292
  );
1209
1293
  return () => {
1210
- M(), Fe(), He();
1294
+ V.current = null, M(), Ue(), Ve();
1211
1295
  };
1212
1296
  }, [
1213
- n,
1214
- o,
1215
1297
  r,
1216
- y,
1298
+ g,
1217
1299
  f,
1218
- m,
1219
- l,
1220
- w,
1221
- C
1222
- ]);
1223
- const Z = {
1224
- [Ae]: p ? "none" : void 0
1300
+ p,
1301
+ u,
1302
+ b,
1303
+ R,
1304
+ $
1305
+ ]), Ce(() => {
1306
+ const w = V.current;
1307
+ w && (w.defaultLayout = n, w.disableCursor = !!o);
1308
+ });
1309
+ const pe = {
1310
+ [We]: d ? "none" : void 0
1225
1311
  };
1226
- for (const b in v) {
1227
- const M = Ne(f, b), N = v[b];
1228
- Z[M] = N;
1312
+ for (const w in x) {
1313
+ const M = je(f, w), F = x[w];
1314
+ pe[M] = F;
1229
1315
  }
1230
- return /* @__PURE__ */ B($e.Provider, { value: q, children: /* @__PURE__ */ B(
1316
+ return /* @__PURE__ */ K(Be.Provider, { value: Q, children: /* @__PURE__ */ K(
1231
1317
  "div",
1232
1318
  {
1233
- ...d,
1234
- "aria-orientation": l,
1319
+ ...h,
1320
+ "aria-orientation": u,
1235
1321
  className: t,
1236
1322
  "data-group": !0,
1237
1323
  "data-testid": f,
1238
1324
  id: f,
1239
- ref: Y,
1325
+ ref: J,
1240
1326
  style: {
1241
1327
  ...c,
1242
- ...Z,
1328
+ ...pe,
1243
1329
  display: "flex",
1244
- flexDirection: l === "horizontal" ? "row" : "column",
1330
+ flexDirection: u === "horizontal" ? "row" : "column",
1245
1331
  flexWrap: "nowrap"
1246
1332
  },
1247
1333
  children: e
@@ -1251,7 +1337,7 @@ function Pt({
1251
1337
  function ae(e) {
1252
1338
  return `react-resizable-panels:${e}`;
1253
1339
  }
1254
- function yt({
1340
+ function bt({
1255
1341
  id: e,
1256
1342
  layout: t,
1257
1343
  storage: n
@@ -1263,19 +1349,19 @@ function yt({
1263
1349
  console.error(o);
1264
1350
  }
1265
1351
  }
1266
- function Ct({
1352
+ function kt({
1267
1353
  groupId: e,
1268
1354
  storage: t
1269
1355
  }) {
1270
- const n = Ve(
1271
- vt,
1356
+ const n = Ze(
1357
+ Lt,
1272
1358
  () => t.getItem(ae(e)),
1273
1359
  () => t.getItem(ae(e))
1274
- ), o = Ce(
1360
+ ), o = Ie(
1275
1361
  () => n ? JSON.parse(n) : void 0,
1276
1362
  [n]
1277
- ), r = Le(
1278
- (a) => yt({
1363
+ ), r = Ee(
1364
+ (a) => bt({
1279
1365
  id: e,
1280
1366
  layout: a,
1281
1367
  storage: t
@@ -1287,35 +1373,46 @@ function Ct({
1287
1373
  onLayoutChange: r
1288
1374
  };
1289
1375
  }
1290
- function vt() {
1376
+ function Lt() {
1291
1377
  return function() {
1292
1378
  };
1293
1379
  }
1294
- function Rt() {
1380
+ function Dt() {
1295
1381
  return I(null);
1296
1382
  }
1297
- function Et() {
1298
- return T(null);
1383
+ function Ot() {
1384
+ return O(null);
1299
1385
  }
1300
1386
  function de() {
1301
- const e = Ke($e);
1302
- return x(
1387
+ const e = Je(Be);
1388
+ return z(
1303
1389
  e,
1304
1390
  "Group Context not found; did you render a Panel or Separator outside of a Group?"
1305
1391
  ), e;
1306
1392
  }
1307
- function St({
1393
+ function Pt({
1308
1394
  groupId: e,
1309
1395
  panelId: t
1310
1396
  }) {
1311
1397
  const n = () => {
1312
- const { mountedGroups: i } = O();
1398
+ const { mountedGroups: i } = D();
1313
1399
  for (const [
1314
1400
  s,
1315
- { derivedPanelConstraints: l, layout: c, separatorToPanels: d }
1401
+ {
1402
+ defaultLayoutDeferred: u,
1403
+ derivedPanelConstraints: c,
1404
+ layout: h,
1405
+ separatorToPanels: m
1406
+ }
1316
1407
  ] of i)
1317
1408
  if (s.id === e)
1318
- return { derivedPanelConstraints: l, group: s, layout: c, separatorToPanels: d };
1409
+ return {
1410
+ defaultLayoutDeferred: u,
1411
+ derivedPanelConstraints: c,
1412
+ group: s,
1413
+ layout: h,
1414
+ separatorToPanels: m
1415
+ };
1319
1416
  throw Error(`Group ${e} not found`);
1320
1417
  }, o = () => {
1321
1418
  const i = n().derivedPanelConstraints.find(
@@ -1334,75 +1431,77 @@ function St({
1334
1431
  if (i !== void 0)
1335
1432
  return i;
1336
1433
  throw Error(`Layout not found for Panel ${t}`);
1337
- }, u = (i) => {
1434
+ }, l = (i) => {
1338
1435
  const s = a();
1339
1436
  if (i === s)
1340
1437
  return;
1341
1438
  const {
1342
- derivedPanelConstraints: l,
1343
- group: c,
1344
- layout: d,
1345
- separatorToPanels: z
1346
- } = n(), m = c.panels.findIndex((y) => y.id === t), f = m === c.panels.length - 1, p = V({
1347
- delta: f ? s - i : i - s,
1348
- initialLayout: d,
1349
- panelConstraints: l,
1350
- pivotIndices: f ? [m - 1, m] : [m, m + 1],
1351
- prevLayout: d,
1439
+ defaultLayoutDeferred: u,
1440
+ derivedPanelConstraints: c,
1441
+ group: h,
1442
+ layout: m,
1443
+ separatorToPanels: p
1444
+ } = n(), f = h.panels.findIndex((v) => v.id === t), d = f === h.panels.length - 1, y = Y({
1445
+ delta: d ? s - i : i - s,
1446
+ initialLayout: m,
1447
+ panelConstraints: c,
1448
+ pivotIndices: d ? [f - 1, f] : [f, f + 1],
1449
+ prevLayout: m,
1352
1450
  trigger: "imperative-api"
1353
- }), h = A({
1354
- layout: p,
1355
- panelConstraints: l
1451
+ }), g = A({
1452
+ layout: y,
1453
+ panelConstraints: c
1356
1454
  });
1357
- W(d, h) || E((y) => ({
1358
- mountedGroups: new Map(y.mountedGroups).set(c, {
1359
- derivedPanelConstraints: l,
1360
- layout: h,
1361
- separatorToPanels: z
1455
+ U(m, g) || E((v) => ({
1456
+ mountedGroups: new Map(v.mountedGroups).set(h, {
1457
+ defaultLayoutDeferred: u,
1458
+ derivedPanelConstraints: c,
1459
+ layout: g,
1460
+ separatorToPanels: p
1362
1461
  })
1363
1462
  }));
1364
1463
  };
1365
1464
  return {
1366
1465
  collapse: () => {
1367
- const { collapsible: i, collapsedSize: s } = o(), l = a();
1368
- i && l !== s && u(s);
1466
+ const { collapsible: i, collapsedSize: s } = o(), u = a();
1467
+ i && u !== s && l(s);
1369
1468
  },
1370
1469
  expand: () => {
1371
- const { collapsible: i, collapsedSize: s, minSize: l } = o(), c = a();
1372
- i && c === s && u(l);
1470
+ const { collapsible: i, collapsedSize: s, minSize: u } = o(), c = a();
1471
+ i && c === s && l(u);
1373
1472
  },
1374
1473
  getSize: () => {
1375
- const { group: i } = n(), s = a(), { element: l } = r(), c = i.orientation === "horizontal" ? l.offsetWidth : l.offsetHeight;
1474
+ const { group: i } = n(), s = a(), { element: u } = r(), c = i.orientation === "horizontal" ? u.offsetWidth : u.offsetHeight;
1376
1475
  return {
1377
1476
  asPercentage: s,
1378
1477
  inPixels: c
1379
1478
  };
1380
1479
  },
1381
1480
  isCollapsed: () => {
1382
- const { collapsible: i, collapsedSize: s } = o(), l = a();
1383
- return i && P(s, l);
1481
+ const { collapsible: i, collapsedSize: s } = o(), u = a();
1482
+ return i && P(s, u);
1384
1483
  },
1385
1484
  resize: (i) => {
1386
1485
  if (a() !== i) {
1387
- let l;
1486
+ let u;
1388
1487
  switch (typeof i) {
1389
1488
  case "number": {
1390
- const { group: c } = n(), d = H({ group: c });
1391
- l = G(i / d * 100);
1489
+ const { group: c } = n(), h = B({ group: c });
1490
+ u = G(i / h * 100);
1392
1491
  break;
1393
1492
  }
1394
1493
  case "string": {
1395
- l = parseFloat(i);
1494
+ u = parseFloat(i);
1396
1495
  break;
1397
1496
  }
1398
1497
  }
1399
- u(l);
1498
+ l(u);
1400
1499
  }
1401
1500
  }
1402
1501
  };
1403
1502
  }
1404
- function xt(e, t) {
1405
- const { id: n } = de(), o = T({
1503
+ function Rt(e, t) {
1504
+ const { id: n } = de(), o = O({
1406
1505
  collapse: ie,
1407
1506
  expand: ie,
1408
1507
  getSize: () => ({
@@ -1412,38 +1511,38 @@ function xt(e, t) {
1412
1511
  isCollapsed: () => !1,
1413
1512
  resize: ie
1414
1513
  });
1415
- Pe(t, () => o.current, []), j(() => {
1514
+ Me(t, () => o.current, []), N(() => {
1416
1515
  Object.assign(
1417
1516
  o.current,
1418
- St({ groupId: n, panelId: e })
1517
+ Pt({ groupId: n, panelId: e })
1419
1518
  );
1420
1519
  });
1421
1520
  }
1422
- function Mt({
1521
+ function Tt({
1423
1522
  children: e,
1424
1523
  className: t,
1425
1524
  collapsedSize: n = "0%",
1426
1525
  collapsible: o = !1,
1427
1526
  defaultSize: r,
1428
1527
  elementRef: a,
1429
- id: u,
1528
+ id: l,
1430
1529
  maxSize: i = "100%",
1431
1530
  minSize: s = "0%",
1432
- onResize: l,
1531
+ onResize: u,
1433
1532
  panelRef: c,
1434
- style: d,
1435
- ...z
1533
+ style: h,
1534
+ ...m
1436
1535
  }) {
1437
- const m = !!u, f = ue(u), [p, h] = I(null), y = fe(h, a), { id: S, registerPanel: v } = de(), g = l !== null, w = ce((C) => {
1438
- l?.(C, u);
1536
+ const p = !!l, f = ue(l), [d, y] = I(null), g = fe(y, a), { id: v, registerPanel: x } = de(), S = u !== null, b = ce((R) => {
1537
+ u?.(R, l);
1439
1538
  });
1440
- j(() => {
1441
- if (p !== null)
1442
- return v({
1443
- element: p,
1539
+ N(() => {
1540
+ if (d !== null)
1541
+ return x({
1542
+ element: d,
1444
1543
  id: f,
1445
- idIsStable: m,
1446
- onResize: g ? w : void 0,
1544
+ idIsStable: p,
1545
+ onResize: S ? b : void 0,
1447
1546
  panelConstraints: {
1448
1547
  collapsedSize: n,
1449
1548
  collapsible: o,
@@ -1456,26 +1555,26 @@ function Mt({
1456
1555
  n,
1457
1556
  o,
1458
1557
  r,
1459
- p,
1460
- g,
1558
+ d,
1559
+ S,
1461
1560
  f,
1462
- m,
1561
+ p,
1463
1562
  i,
1464
1563
  s,
1465
- w,
1466
- v
1467
- ]), xt(f, c);
1468
- const L = Ne(S, f);
1469
- return /* @__PURE__ */ B(
1564
+ b,
1565
+ x
1566
+ ]), Rt(f, c);
1567
+ const L = je(v, f);
1568
+ return /* @__PURE__ */ K(
1470
1569
  "div",
1471
1570
  {
1472
- ...z,
1571
+ ...m,
1473
1572
  "data-panel": !0,
1474
1573
  "data-testid": f,
1475
1574
  id: f,
1476
- ref: y,
1575
+ ref: g,
1477
1576
  style: {
1478
- ...zt,
1577
+ ...Ct,
1479
1578
  flexBasis: 0,
1480
1579
  flexGrow: `var(${L}, 1)`,
1481
1580
  flexShrink: 1,
@@ -1483,16 +1582,16 @@ function Mt({
1483
1582
  overflow: "hidden",
1484
1583
  // Disable pointer events inside of a panel during resize
1485
1584
  // This avoid edge cases like nested iframes
1486
- pointerEvents: `var(${Ae})`
1585
+ pointerEvents: `var(${We})`
1487
1586
  },
1488
- children: /* @__PURE__ */ B(
1587
+ children: /* @__PURE__ */ K(
1489
1588
  "div",
1490
1589
  {
1491
1590
  className: t,
1492
1591
  style: {
1493
1592
  width: "100%",
1494
1593
  height: "100%",
1495
- ...d
1594
+ ...h
1496
1595
  },
1497
1596
  children: e
1498
1597
  }
@@ -1500,7 +1599,7 @@ function Mt({
1500
1599
  }
1501
1600
  );
1502
1601
  }
1503
- const zt = {
1602
+ const Ct = {
1504
1603
  minHeight: "unset",
1505
1604
  maxHeight: "unset",
1506
1605
  height: "unset",
@@ -1516,27 +1615,27 @@ const zt = {
1516
1615
  padding: "unset",
1517
1616
  margin: "unset"
1518
1617
  };
1519
- function It() {
1618
+ function _t() {
1520
1619
  return I(null);
1521
1620
  }
1522
- function Gt() {
1523
- return T(null);
1621
+ function At() {
1622
+ return O(null);
1524
1623
  }
1525
- function bt({
1624
+ function Et({
1526
1625
  layout: e,
1527
1626
  panelConstraints: t,
1528
1627
  panelId: n,
1529
1628
  panelIndex: o
1530
1629
  }) {
1531
1630
  let r, a;
1532
- const u = e[n], i = t.find(
1631
+ const l = e[n], i = t.find(
1533
1632
  (s) => s.panelId === n
1534
1633
  );
1535
1634
  if (i) {
1536
- const s = i.maxSize, l = a = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
1635
+ const s = i.maxSize, u = a = i.collapsible ? i.collapsedSize : i.minSize, c = [o, o + 1];
1537
1636
  a = A({
1538
- layout: V({
1539
- delta: l - u,
1637
+ layout: Y({
1638
+ delta: u - l,
1540
1639
  initialLayout: e,
1541
1640
  panelConstraints: t,
1542
1641
  pivotIndices: c,
@@ -1545,8 +1644,8 @@ function bt({
1545
1644
  }),
1546
1645
  panelConstraints: t
1547
1646
  })[n], r = A({
1548
- layout: V({
1549
- delta: s - u,
1647
+ layout: Y({
1648
+ delta: s - l,
1550
1649
  initialLayout: e,
1551
1650
  panelConstraints: t,
1552
1651
  pivotIndices: c,
@@ -1560,10 +1659,10 @@ function bt({
1560
1659
  valueControls: n,
1561
1660
  valueMax: r,
1562
1661
  valueMin: a,
1563
- valueNow: u
1662
+ valueNow: l
1564
1663
  };
1565
1664
  }
1566
- function kt({
1665
+ function Nt({
1567
1666
  children: e,
1568
1667
  className: t,
1569
1668
  elementRef: n,
@@ -1571,40 +1670,40 @@ function kt({
1571
1670
  style: r,
1572
1671
  ...a
1573
1672
  }) {
1574
- const u = ue(o), [i, s] = I({}), [l, c] = I("inactive"), [d, z] = I(null), m = fe(z, n), {
1673
+ const l = ue(o), [i, s] = I({}), [u, c] = I("inactive"), [h, m] = I(null), p = fe(m, n), {
1575
1674
  id: f,
1576
- orientation: p,
1577
- registerSeparator: h
1578
- } = de(), y = p === "horizontal" ? "vertical" : "horizontal";
1579
- return j(() => {
1580
- if (d !== null) {
1581
- const S = {
1582
- element: d,
1583
- id: u
1584
- }, v = h(S), g = D.addListener(
1675
+ orientation: d,
1676
+ registerSeparator: y
1677
+ } = de(), g = d === "horizontal" ? "vertical" : "horizontal";
1678
+ return N(() => {
1679
+ if (h !== null) {
1680
+ const v = {
1681
+ element: h,
1682
+ id: l
1683
+ }, x = y(v), S = _.addListener(
1585
1684
  "interactionStateChange",
1586
1685
  (L) => {
1587
1686
  c(
1588
1687
  L.state !== "inactive" && L.hitRegions.some(
1589
- (C) => C.separator === S
1688
+ (R) => R.separator === v
1590
1689
  ) ? L.state : "inactive"
1591
1690
  );
1592
1691
  }
1593
- ), w = D.addListener(
1692
+ ), b = _.addListener(
1594
1693
  "mountedGroupsChange",
1595
1694
  (L) => {
1596
1695
  L.forEach(
1597
- ({ derivedPanelConstraints: C, layout: K, separatorToPanels: ne }, X) => {
1598
- if (X.id === f) {
1599
- const Y = ne.get(S);
1600
- if (Y) {
1601
- const q = Y[0], Z = X.panels.indexOf(q);
1696
+ ({ derivedPanelConstraints: R, layout: q, separatorToPanels: Z }, J) => {
1697
+ if (J.id === f) {
1698
+ const Q = Z.get(v);
1699
+ if (Q) {
1700
+ const $ = Q[0], V = J.panels.indexOf($);
1602
1701
  s(
1603
- bt({
1604
- layout: K,
1605
- panelConstraints: C,
1606
- panelId: q.id,
1607
- panelIndex: Z
1702
+ Et({
1703
+ layout: q,
1704
+ panelConstraints: R,
1705
+ panelId: $.id,
1706
+ panelIndex: V
1608
1707
  })
1609
1708
  );
1610
1709
  }
@@ -1614,24 +1713,24 @@ function kt({
1614
1713
  }
1615
1714
  );
1616
1715
  return () => {
1617
- g(), w(), v();
1716
+ S(), b(), x();
1618
1717
  };
1619
1718
  }
1620
- }, [d, f, u, h]), /* @__PURE__ */ B(
1719
+ }, [h, f, l, y]), /* @__PURE__ */ K(
1621
1720
  "div",
1622
1721
  {
1623
1722
  ...a,
1624
1723
  "aria-controls": i.valueControls,
1625
- "aria-orientation": y,
1724
+ "aria-orientation": g,
1626
1725
  "aria-valuemax": i.valueMax,
1627
1726
  "aria-valuemin": i.valueMin,
1628
1727
  "aria-valuenow": i.valueNow,
1629
1728
  children: e,
1630
1729
  className: t,
1631
- "data-separator": l,
1632
- "data-testid": u,
1633
- id: u,
1634
- ref: m,
1730
+ "data-separator": u,
1731
+ "data-testid": l,
1732
+ id: l,
1733
+ ref: p,
1635
1734
  role: "separator",
1636
1735
  style: {
1637
1736
  flexBasis: "auto",
@@ -1644,13 +1743,13 @@ function kt({
1644
1743
  );
1645
1744
  }
1646
1745
  export {
1647
- Pt as Group,
1648
- Mt as Panel,
1649
- kt as Separator,
1650
- Ct as useDefaultLayout,
1651
- Rt as useGroupCallbackRef,
1652
- Et as useGroupRef,
1653
- It as usePanelCallbackRef,
1654
- Gt as usePanelRef
1746
+ Gt as Group,
1747
+ Tt as Panel,
1748
+ Nt as Separator,
1749
+ kt as useDefaultLayout,
1750
+ Dt as useGroupCallbackRef,
1751
+ Ot as useGroupRef,
1752
+ _t as usePanelCallbackRef,
1753
+ At as usePanelRef
1655
1754
  };
1656
1755
  //# sourceMappingURL=react-resizable-panels.js.map