@aiquants/markdown-explorer 0.30.0 → 0.32.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.
Files changed (36) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +12 -8
  3. package/dist/{EditSurface-Cw0kbedj.cjs → EditSurface-BPqqykro.cjs} +3 -3
  4. package/dist/{EditSurface-DY1VNM9L.js → EditSurface-BmbDSrrw.js} +187 -187
  5. package/dist/{ExplorerSplit-x9Qkldh6.cjs → ExplorerSplit-CQxr6b0v.cjs} +1 -1
  6. package/dist/{ExplorerSplit-D3f1FiZ7.js → ExplorerSplit-DPuXOBqs.js} +4 -4
  7. package/dist/{MultiLayout-B0dfZlpx.js → MultiLayout-DKgZ1sBK.js} +238 -232
  8. package/dist/MultiLayout-TXbet9k3.cjs +1 -0
  9. package/dist/{NativeScrollBar-C4vkvdGz.js → NativeScrollBar-C1CtjwBm.js} +2 -2
  10. package/dist/{NativeScrollBar-C2UoYO3i.cjs → NativeScrollBar-UpjxjLlB.cjs} +1 -1
  11. package/dist/{TreeLayout-Bak1y1m4.js → TreeLayout-BpazybVQ.js} +3 -3
  12. package/dist/{TreeLayout-DsFH17x_.cjs → TreeLayout-C0O1OGi4.cjs} +1 -1
  13. package/dist/core/config.d.cts +2 -0
  14. package/dist/core/config.d.ts +2 -0
  15. package/dist/core/labels.d.cts +7 -0
  16. package/dist/core/labels.d.ts +7 -0
  17. package/dist/{index-auQVKY4M.js → index-CcXMPCRS.js} +919 -903
  18. package/dist/{index-DgaTEKsI.cjs → index-DSkK8iLE.cjs} +6 -6
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +6 -6
  21. package/dist/location-BxiJRTyw.cjs +1 -0
  22. package/dist/{location-CKuabtKl.js → location-perTmwct.js} +253 -245
  23. package/dist/{merge-D1jbIOPw.js → merge-3xGYZqbE.js} +1 -1
  24. package/dist/{merge-BEa-lale.cjs → merge-DZI4pkWI.cjs} +1 -1
  25. package/dist/server.cjs +1 -1
  26. package/dist/server.js +2 -2
  27. package/dist/{tapScrollCircle-BSb6lisN.cjs → tapScrollCircle-Cbf17x8g.cjs} +1 -1
  28. package/dist/{tapScrollCircle-DYQ8P2ag.js → tapScrollCircle-DacgW2F_.js} +1 -1
  29. package/dist/{useSplitPersistence-Bf4M35Il.js → useSplitPersistence-Du01PHNg.js} +1 -1
  30. package/dist/{useSplitPersistence-9Nu6J1WF.cjs → useSplitPersistence-pPmE4GTT.cjs} +1 -1
  31. package/docs/behavior/layout.md +19 -9
  32. package/docs/behavior/localization.md +4 -4
  33. package/docs/behavior/url-contract.md +1 -1
  34. package/package.json +12 -12
  35. package/dist/MultiLayout-BXr2UAvl.cjs +0 -1
  36. package/dist/location-l_HysaZR.cjs +0 -1
@@ -1,15 +1,15 @@
1
1
  import { jsxs as ie, jsx as M } from "react/jsx-runtime";
2
- import { createContext as Je, use as Ne, useRef as q, useState as $, useLayoutEffect as F, useMemo as D, useSyncExternalStore as Xe, useCallback as R, memo as Qe, useEffect as U, useImperativeHandle as Ze } from "react";
3
- import { n as ce, e as Me, o as en, P as nn, q as tn } from "./location-CKuabtKl.js";
4
- import { L as on, u as J, M as rn, O as ln, D as sn, i as an, f as cn, Q as V, h as Ae, R as un, N as dn, S as ke, U as mn, V as Ie, W as fn, X as Le, Y as pn } from "./index-auQVKY4M.js";
5
- import { S as gn, a as hn, b as vn } from "./ExplorerSplit-D3f1FiZ7.js";
6
- import { SCROLL_AREA_SELECTOR as Re, SCROLL_ROOT_SELECTOR as te, PANEL_ACTION_ATTRIBUTE as he, generateColumnIds as wn, sortColumnIds as De, generateColumnId as _e, NO_PANEL_DRAG_ATTRIBUTE as yn, useDragDropColumns as Sn, DEFAULT_DEBUG_CONFIG as ve, DragDropLayout as xn } from "@aiquants/drag-drop-panels";
7
- import { useNavigate as En, useLocation as On } from "react-router";
8
- import { s as Pn, r as bn, w as Cn } from "./storage-CmGHg7OA.js";
9
- import { H as Tn, i as Nn } from "./dataRoute-DLhQfdoW.js";
10
- import { createPortal as Mn } from "react-dom";
11
- import { HostedScrollArea as An } from "@aiquants/markdown";
12
- const kn = () => {
2
+ import { createContext as Je, use as Ne, useRef as q, useState as $, useLayoutEffect as F, useMemo as D, useSyncExternalStore as Xe, useCallback as L, memo as Ze, useEffect as U, useImperativeHandle as Qe } from "react";
3
+ import { n as ce, e as Me, o as en, P as nn, q as tn } from "./location-perTmwct.js";
4
+ import { M as on, u as J, O as rn, Q as ln, D as sn, i as an, f as cn, R as V, G as un, h as Ae, S as dn, N as mn, U as ke, V as fn, W as Ie, X as pn, Y as Re, Z as gn } from "./index-CcXMPCRS.js";
5
+ import { S as hn, a as vn, b as wn } from "./ExplorerSplit-DPuXOBqs.js";
6
+ import { SCROLL_AREA_SELECTOR as Le, SCROLL_ROOT_SELECTOR as te, PANEL_ACTION_ATTRIBUTE as he, generateColumnIds as yn, sortColumnIds as De, generateColumnId as _e, NO_PANEL_DRAG_ATTRIBUTE as Sn, useDragDropColumns as xn, DEFAULT_DEBUG_CONFIG as ve, DragDropLayout as En } from "@aiquants/drag-drop-panels";
7
+ import { useNavigate as On, useLocation as Pn } from "react-router";
8
+ import { s as bn, r as Cn, w as Tn } from "./storage-CmGHg7OA.js";
9
+ import { H as Nn, i as Mn } from "./dataRoute-DLhQfdoW.js";
10
+ import { createPortal as An } from "react-dom";
11
+ import { HostedScrollArea as kn } from "@aiquants/markdown";
12
+ const In = () => {
13
13
  const e = /* @__PURE__ */ new Map();
14
14
  return {
15
15
  hold: (n, t) => {
@@ -26,20 +26,20 @@ const kn = () => {
26
26
  const e = Ne(ze);
27
27
  if (e === null) throw new Error("[markdown-explorer] multi-view panels must be rendered inside the multi-view stage");
28
28
  return e;
29
- }, In = (e, n) => {
29
+ }, Rn = (e, n) => {
30
30
  const t = e.pendingHashes.get(n);
31
31
  return t === void 0 ? null : t;
32
- }, Ln = 0xcbf29ce484222325n, Rn = 0x100000001b3n, Dn = (1n << 64n) - 1n, _n = (1n << 53n) - 1n, zn = new TextEncoder(), Hn = (e) => {
32
+ }, Ln = 0xcbf29ce484222325n, Dn = 0x100000001b3n, _n = (1n << 64n) - 1n, zn = (1n << 53n) - 1n, Hn = new TextEncoder(), Bn = (e) => {
33
33
  let n = Ln;
34
- for (const t of zn.encode(e))
35
- n = (n ^ BigInt(t)) * Rn & Dn;
36
- return Number(n & _n);
37
- }, oe = 256, Bn = (e) => `aqmx-p-${Hn(e).toString(36)}`, He = (e, n) => {
38
- const t = Bn(e);
34
+ for (const t of Hn.encode(e))
35
+ n = (n ^ BigInt(t)) * Dn & _n;
36
+ return Number(n & zn);
37
+ }, oe = 256, qn = (e) => `aqmx-p-${Bn(e).toString(36)}`, He = (e, n) => {
38
+ const t = qn(e);
39
39
  let o = t;
40
40
  for (let r = 2; n.has(o); r += 1) o = `${t}-${String(r)}`;
41
41
  return o;
42
- }, qn = /* @__PURE__ */ new Map(), Fn = (e, n = qn) => {
42
+ }, Fn = /* @__PURE__ */ new Map(), Vn = (e, n = Fn) => {
43
43
  const t = new Set(e.flatMap((r) => n.get(r) ?? [])), o = /* @__PURE__ */ new Map();
44
44
  for (const r of e) {
45
45
  const l = n.get(r) ?? He(r, t);
@@ -52,11 +52,11 @@ const kn = () => {
52
52
  }, qe = (e, n) => {
53
53
  const [t, ...o] = ce(n.logical, n.visible);
54
54
  if (t === void 0) throw new RangeError("[markdown-explorer] there must be at least one visible column");
55
- const r = ([u, p]) => e.slice(u, p).reduce((i, y) => i + y.length, 0);
55
+ const r = ([d, p]) => e.slice(d, p).reduce((i, y) => i + y.length, 0);
56
56
  let l = t;
57
- for (const u of o) r(u) < r(l) && (l = u);
57
+ for (const d of o) r(d) < r(l) && (l = d);
58
58
  let a = l[0];
59
- for (let u = l[0]; u < l[1]; u += 1) (e[u]?.length ?? 0) < (e[a]?.length ?? 0) && (a = u);
59
+ for (let d = l[0]; d < l[1]; d += 1) (e[d]?.length ?? 0) < (e[a]?.length ?? 0) && (a = d);
60
60
  return a;
61
61
  }, re = (e, n) => {
62
62
  const t = Array.from({ length: n.logical }, () => []), o = [];
@@ -66,24 +66,24 @@ const kn = () => {
66
66
  }
67
67
  for (const r of o) t[qe(t, n)]?.push(r);
68
68
  return t;
69
- }, Vn = (e, n) => ce(e.length, n).map(([t, o]) => e.slice(t, o).flat()), $n = (e, n, t) => {
70
- const [o, r] = n, l = r - o, a = e.length, u = Array.from({ length: l }, (w, d) => {
69
+ }, $n = (e, n) => ce(e.length, n).map(([t, o]) => e.slice(t, o).flat()), Un = (e, n, t) => {
70
+ const [o, r] = n, l = r - o, a = e.length, d = Array.from({ length: l }, (w, u) => {
71
71
  const v = [0];
72
- for (const g of e) v.push((v.at(-1) ?? 0) + (t(g) === o + d ? 1 : 0));
72
+ for (const g of e) v.push((v.at(-1) ?? 0) + (t(g) === o + u ? 1 : 0));
73
73
  return v;
74
- }), p = (w, d, v) => (u[w]?.[v] ?? 0) - (u[w]?.[d] ?? 0), i = Array.from({ length: l + 1 }, () => Array.from({ length: a + 1 }, () => Number.NEGATIVE_INFINITY)), y = Array.from({ length: l + 1 }, () => Array.from({ length: a + 1 }, () => 0)), E = i[0];
74
+ }), p = (w, u, v) => (d[w]?.[v] ?? 0) - (d[w]?.[u] ?? 0), i = Array.from({ length: l + 1 }, () => Array.from({ length: a + 1 }, () => Number.NEGATIVE_INFINITY)), y = Array.from({ length: l + 1 }, () => Array.from({ length: a + 1 }, () => 0)), E = i[0];
75
75
  E && (E[0] = 0);
76
76
  for (let w = 0; w < l; w += 1)
77
- for (let d = 0; d <= a; d += 1)
78
- for (let v = 0; v <= d; v += 1) {
79
- const g = (i[w]?.[v] ?? Number.NEGATIVE_INFINITY) + p(w, v, d), O = i[w + 1], C = y[w + 1];
80
- O && C && g > (O[d] ?? Number.NEGATIVE_INFINITY) && (O[d] = g, C[d] = v);
77
+ for (let u = 0; u <= a; u += 1)
78
+ for (let v = 0; v <= u; v += 1) {
79
+ const g = (i[w]?.[v] ?? Number.NEGATIVE_INFINITY) + p(w, v, u), O = i[w + 1], C = y[w + 1];
80
+ O && C && g > (O[u] ?? Number.NEGATIVE_INFINITY) && (O[u] = g, C[u] = v);
81
81
  }
82
82
  const b = Array.from({ length: l }, () => []);
83
83
  let k = a;
84
84
  for (let w = l; w > 0; w -= 1) {
85
- const d = y[w]?.[k] ?? 0;
86
- b[w - 1] = e.slice(d, k), k = d;
85
+ const u = y[w]?.[k] ?? 0;
86
+ b[w - 1] = e.slice(u, k), k = u;
87
87
  }
88
88
  return b;
89
89
  }, Fe = (e, n) => {
@@ -96,7 +96,7 @@ const kn = () => {
96
96
  o.delete(r);
97
97
  }
98
98
  return { docs: t, columnOf: o };
99
- }, Un = (e, n, t, o) => {
99
+ }, jn = (e, n, t, o) => {
100
100
  if (e.docs.includes(n)) return { state: e, outcome: "existing" };
101
101
  if (e.docs.length >= o) return { state: e, outcome: "rejected" };
102
102
  const r = re(e, t), l = Be(e, n, t.logical) ?? qe(r, t);
@@ -111,10 +111,10 @@ const kn = () => {
111
111
  o.delete(n);
112
112
  const r = new Map(e.panelIds);
113
113
  return r.delete(n), { ...e, docs: e.docs.filter((l) => l !== n), hidden: t, markup: o, panelIds: r, maximized: e.maximized === n ? null : e.maximized };
114
- }, jn = (e, n, t, o) => {
114
+ }, Gn = (e, n, t, o) => {
115
115
  if (e.hidden.has(n)) return { state: $e(e, n, !1), outcome: "shown" };
116
116
  if (e.docs.includes(n)) return { state: Ve(e, n), outcome: "closed" };
117
- const r = Un(e, n, t, o);
117
+ const r = jn(e, n, t, o);
118
118
  return { state: r.state, outcome: r.outcome === "rejected" ? "rejected" : "opened" };
119
119
  }, Yn = (e, n, t) => {
120
120
  if (n === t || !e.docs.includes(n)) return { state: e, outcome: "ignored" };
@@ -123,9 +123,9 @@ const kn = () => {
123
123
  r !== void 0 && (o.delete(t), o.set(t, r));
124
124
  const l = new Set(e.hidden);
125
125
  l.delete(n);
126
- const a = new Map(e.panelIds), u = a.get(n);
127
- if (u === void 0) throw new Error(`[markdown-explorer] the open document ${JSON.stringify(n)} has no panel id`);
128
- a.delete(n), a.set(t, u);
126
+ const a = new Map(e.panelIds), d = a.get(n);
127
+ if (d === void 0) throw new Error(`[markdown-explorer] the open document ${JSON.stringify(n)} has no panel id`);
128
+ a.delete(n), a.set(t, d);
129
129
  const p = new Set(e.markup);
130
130
  return p.delete(n), {
131
131
  state: { docs: e.docs.map((i) => i === n ? t : i), maximized: e.maximized === n ? t : e.maximized, columnOf: o, hidden: l, markup: p, panelIds: a },
@@ -135,24 +135,24 @@ const kn = () => {
135
135
  if (!e.docs.includes(n) || e.hidden.has(n) === t) return e;
136
136
  const o = new Set(e.hidden);
137
137
  return t ? o.add(n) : o.delete(n), { ...e, hidden: o, maximized: t && e.maximized === n ? null : e.maximized };
138
- }, Gn = (e, n, t) => {
138
+ }, Wn = (e, n, t) => {
139
139
  if (!e.docs.includes(n) || e.markup.has(n) === t) return e;
140
140
  const o = new Set(e.markup);
141
141
  return t ? o.add(n) : o.delete(n), { ...e, markup: o };
142
- }, Wn = (e, n) => {
142
+ }, Kn = (e, n) => {
143
143
  if (e.maximized === n || n !== null && !e.docs.includes(n)) return e;
144
144
  if (n === null || !e.hidden.has(n)) return { ...e, maximized: n };
145
145
  const t = new Set(e.hidden);
146
146
  return t.delete(n), { ...e, maximized: n, hidden: t };
147
- }, Kn = (e, n, t) => {
147
+ }, Jn = (e, n, t) => {
148
148
  const o = re(e, t), r = /* @__PURE__ */ new Map();
149
149
  for (const [i, y] of o.entries())
150
150
  for (const E of y) r.set(E, i);
151
- const l = new Set(e.docs), a = /* @__PURE__ */ new Set(), u = ce(t.logical, t.visible), p = Array.from({ length: t.logical }, () => []);
152
- for (const [i, y] of u.entries()) {
151
+ const l = new Set(e.docs), a = /* @__PURE__ */ new Set(), d = ce(t.logical, t.visible), p = Array.from({ length: t.logical }, () => []);
152
+ for (const [i, y] of d.entries()) {
153
153
  const E = (n[i] ?? []).filter((b) => l.has(b) && !a.has(b));
154
154
  for (const b of E) a.add(b);
155
- for (const [b, k] of $n(E, y, (w) => r.get(w)).entries())
155
+ for (const [b, k] of Un(E, y, (w) => r.get(w)).entries())
156
156
  p[y[0] + b]?.push(...k);
157
157
  }
158
158
  for (const i of e.docs)
@@ -166,7 +166,7 @@ const kn = () => {
166
166
  columnOf: e.stored.columnOf,
167
167
  hidden: new Set([...e.stored.hidden].filter((l) => o.has(l) && l !== r)),
168
168
  markup: new Set(e.markup.filter((l) => o.has(l))),
169
- panelIds: Fn(t, e.panelIds)
169
+ panelIds: Vn(t, e.panelIds)
170
170
  };
171
171
  }, we = (e, n) => {
172
172
  if (e.docs.every((o) => e.columnOf.has(o))) return e;
@@ -179,40 +179,40 @@ const kn = () => {
179
179
  t.delete(o);
180
180
  }
181
181
  return { ...e, columnOf: t };
182
- }, Ue = 1, G = Object.freeze({ columnOf: /* @__PURE__ */ new Map(), hidden: /* @__PURE__ */ new Set() }), Jn = (e, n) => {
183
- if (e === null || e === "") return G;
182
+ }, Ue = 1, Y = Object.freeze({ columnOf: /* @__PURE__ */ new Map(), hidden: /* @__PURE__ */ new Set() }), Xn = (e, n) => {
183
+ if (e === null || e === "") return Y;
184
184
  let t;
185
185
  try {
186
186
  t = JSON.parse(e);
187
187
  } catch {
188
- return G;
188
+ return Y;
189
189
  }
190
- if (t === null || typeof t != "object" || Array.isArray(t)) return G;
190
+ if (t === null || typeof t != "object" || Array.isArray(t)) return Y;
191
191
  const o = t;
192
- if (o.v !== Ue) return G;
192
+ if (o.v !== Ue) return Y;
193
193
  const r = /* @__PURE__ */ new Map();
194
194
  if (Array.isArray(o.columnOf))
195
195
  for (const a of o.columnOf.slice(-oe))
196
196
  Array.isArray(a) && a.length === 2 && typeof a[0] == "string" && a[0] !== "" && Number.isInteger(a[1]) && a[1] >= 0 && a[1] < n && (r.delete(a[0]), r.set(a[0], a[1]));
197
197
  const l = new Set(Array.isArray(o.hidden) ? o.hidden.filter((a) => typeof a == "string" && a !== "") : []);
198
198
  return { columnOf: r, hidden: l };
199
- }, Xn = (e) => JSON.stringify({
199
+ }, Zn = (e) => JSON.stringify({
200
200
  v: Ue,
201
201
  columnOf: [...e.columnOf.entries()].slice(-oe),
202
202
  hidden: e.docs.filter((n) => e.hidden.has(n))
203
203
  }), de = (e, n) => {
204
204
  const t = e.get(n);
205
- return t === void 0 ? Tn(n) : t;
205
+ return t === void 0 ? Nn(n) : t;
206
206
  }, X = (e) => {
207
207
  const n = /* @__PURE__ */ new Map();
208
208
  for (const [t, o] of e.panelIds) n.set(o, t);
209
209
  return n;
210
210
  }, ye = (e) => {
211
- if (!Nn(e)) throw new RangeError(`[markdown-explorer] not an acceptable document path: ${JSON.stringify(e.slice(0, 80))}`);
211
+ if (!Mn(e)) throw new RangeError(`[markdown-explorer] not an acceptable document path: ${JSON.stringify(e.slice(0, 80))}`);
212
212
  }, Qn = ({ config: e, location: n, writeUrl: t, persist: o }) => {
213
- const { maxPanels: r, columns: l } = e.multiView, a = on(), u = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
213
+ const { maxPanels: r, columns: l } = e.multiView, a = on(), d = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
214
214
  let i = {
215
- layout: le({ docs: n.docs, maximized: n.maximized, markup: n.markup, stored: G }, r),
215
+ layout: le({ docs: n.docs, maximized: n.maximized, markup: n.markup, stored: Y }, r),
216
216
  source: n.source,
217
217
  visibleColumns: l,
218
218
  ready: !1,
@@ -221,7 +221,7 @@ const kn = () => {
221
221
  pendingHashes: /* @__PURE__ */ new Map()
222
222
  }, y = !1;
223
223
  const E = (s) => y ? we(s, { logical: l, visible: i.visibleColumns }) : s, b = (s, h) => Me(e, { view: "multi", source: s, docs: h.docs, maximized: h.maximized, markup: h.markup }), k = (s) => ({ docs: s.docs, maximized: s.maximized, markup: [...s.markup] });
224
- let w = b(n.source, n), d = n.source, v = w;
224
+ let w = b(n.source, n), u = n.source, v = w;
225
225
  const g = [], O = [];
226
226
  let C = null;
227
227
  const A = () => {
@@ -231,24 +231,24 @@ const kn = () => {
231
231
  i = { ...i, ...s }, a.emit();
232
232
  }, c = () => {
233
233
  if (!i.ready) return;
234
- const s = Xn(i.layout);
234
+ const s = Zn(i.layout);
235
235
  s !== C && (C = s, o(s));
236
236
  }, f = (s, h, P) => {
237
237
  const I = b(s, k(h));
238
- I !== w && (w = I, d = s, g.push(I), t(I, P));
238
+ I !== w && (w = I, u = s, g.push(I), t(I, P));
239
239
  }, m = (s) => {
240
240
  const h = new Set(s.panelIds.values());
241
- for (const x of [...u.keys()]) h.has(x) || u.delete(x);
241
+ for (const x of [...d.keys()]) h.has(x) || d.delete(x);
242
242
  for (const x of [...p.keys()]) h.has(x) || p.delete(x);
243
243
  const P = new Set(s.docs), I = [...i.titles.keys()].every((x) => P.has(x)) ? i.titles : new Map([...i.titles].filter(([x]) => P.has(x))), S = [...i.pendingHashes.keys()].every((x) => h.has(x)) ? i.pendingHashes : new Map([...i.pendingHashes].filter(([x]) => h.has(x)));
244
244
  return { titles: I, pendingHashes: S };
245
- }, T = (s) => s === i.layout ? !1 : (N({ layout: s, ...m(s) }), f(d, s, "replace"), c(), !0), L = () => ({ logical: l, visible: i.visibleColumns });
245
+ }, T = (s) => s === i.layout ? !1 : (N({ layout: s, ...m(s) }), f(u, s, "replace"), c(), !0), R = () => ({ logical: l, visible: i.visibleColumns });
246
246
  return {
247
247
  getSnapshot: () => i,
248
248
  subscribe: a.subscribe,
249
249
  toggle: (s) => {
250
250
  ye(s);
251
- const { state: h, outcome: P } = jn(i.layout, s, L(), r);
251
+ const { state: h, outcome: P } = Gn(i.layout, s, R(), r);
252
252
  return T(h), P;
253
253
  },
254
254
  close: (s) => T(Ve(i.layout, s)),
@@ -257,12 +257,12 @@ const kn = () => {
257
257
  const { state: P, outcome: I } = Yn(i.layout, s, h);
258
258
  if (I !== "navigated") return I;
259
259
  const S = P.panelIds.get(h);
260
- return S !== void 0 && (u.delete(S), p.delete(S)), T(P), I;
260
+ return S !== void 0 && (d.delete(S), p.delete(S)), T(P), I;
261
261
  },
262
262
  setHidden: (s, h) => T($e(i.layout, s, h)),
263
- maximize: (s) => T(Wn(i.layout, s)),
264
- setMarkup: (s, h) => T(Gn(i.layout, s, h)),
265
- arrange: (s) => T(Kn(i.layout, s, { logical: l, visible: s.length })),
263
+ maximize: (s) => T(Kn(i.layout, s)),
264
+ setMarkup: (s, h) => T(Wn(i.layout, s, h)),
265
+ arrange: (s) => T(Jn(i.layout, s, { logical: l, visible: s.length })),
266
266
  changeSource: (s) => {
267
267
  f(s, i.layout, "push");
268
268
  },
@@ -278,7 +278,7 @@ const kn = () => {
278
278
  const P = g.indexOf(h);
279
279
  if (P >= 0)
280
280
  return g.splice(0, P + 1), s.source !== i.source && N({ source: s.source }), A(), !1;
281
- g.length = 0, w = h, d = s.source;
281
+ g.length = 0, w = h, u = s.source;
282
282
  const I = E(le({ docs: s.docs, maximized: s.maximized, markup: s.markup, stored: { columnOf: i.layout.columnOf, hidden: i.layout.hidden }, panelIds: i.layout.panelIds }, r));
283
283
  return N({ layout: I, source: s.source, ...m(I) }), c(), A(), !0;
284
284
  },
@@ -312,10 +312,10 @@ const kn = () => {
312
312
  P !== h && N({ pendingHashes: new Map(i.pendingHashes).set(s, h) });
313
313
  },
314
314
  saveReadingPosition: (s, h, P) => {
315
- i.layout.panelIds.get(h) === s && u.set(s, { doc: h, position: P });
315
+ i.layout.panelIds.get(h) === s && d.set(s, { doc: h, position: P });
316
316
  },
317
317
  readingPositionOf: (s, h) => {
318
- const P = u.get(s);
318
+ const P = d.get(s);
319
319
  return P === void 0 || P.doc !== h ? null : P.position;
320
320
  },
321
321
  saveImageView: (s, h, P) => {
@@ -329,80 +329,80 @@ const kn = () => {
329
329
  }, _ = (e, n) => {
330
330
  const t = () => n(e.getSnapshot());
331
331
  return Xe(e.subscribe, t, t);
332
- }, Zn = (e) => {
333
- const { config: n, storageNamespace: t } = J(), o = En(), r = q(o), l = Pn(t).multiLayout, [a] = $(
332
+ }, et = (e) => {
333
+ const { config: n, storageNamespace: t } = J(), o = On(), r = q(o), l = bn(t).multiLayout, [a] = $(
334
334
  () => Qn({
335
335
  config: n,
336
336
  location: e,
337
337
  writeUrl: (i, y) => {
338
338
  r.current(i, rn(y === "replace" ? "browse" : "switch-source"));
339
339
  },
340
- persist: (i) => Cn(l, i)
340
+ persist: (i) => Tn(l, i)
341
341
  })
342
342
  );
343
343
  F(() => {
344
344
  r.current = o;
345
345
  }, [o]);
346
- const u = On(), p = D(() => ({ location: e, navigated: u }), [e, u]);
346
+ const d = Pn(), p = D(() => ({ location: e, navigated: d }), [e, d]);
347
347
  return F(() => {
348
348
  a.observeLocation(p.location);
349
349
  }, [a, p]), F(() => {
350
- a.loadStored(Jn(bn(l), n.multiView.columns));
350
+ a.loadStored(Xn(Cn(l), n.multiView.columns));
351
351
  }, [a, l, n]), a;
352
- }, et = (e) => {
353
- const n = e.closest(Re);
352
+ }, nt = (e) => {
353
+ const n = e.closest(Le);
354
354
  if (n === null) throw new Error("[markdown-explorer] a panel's document region is not inside the panel's scroll area");
355
355
  return n;
356
- }, nt = ({ docPath: e, panelId: n, maximized: t, title: o, onContentShown: r }) => {
357
- const { store: l, followLink: a, revealInPanel: u, keepAtStartInPanel: p } = ue(), { announcer: i } = J(), y = _(l, (c) => In(c, n)), E = _(l, (c) => c.layout.markup.has(e)), b = R((c, f) => a(n, e, c, f), [a, n, e]), k = R(() => l.setPendingHash(n, null), [l, n]), w = D(() => ({ read: (c) => l.imageViewOf(n, c), save: (c, f) => l.saveImageView(n, c, f) }), [l, n]), d = R(
356
+ }, tt = ({ docPath: e, panelId: n, maximized: t, title: o, onContentShown: r }) => {
357
+ const { store: l, followLink: a, revealInPanel: d, keepAtStartInPanel: p } = ue(), { announcer: i } = J(), y = _(l, (c) => Rn(c, n)), E = _(l, (c) => c.layout.markup.has(e)), b = L((c, f) => a(n, e, c, f), [a, n, e]), k = L(() => l.setPendingHash(n, null), [l, n]), w = D(() => ({ read: (c) => l.imageViewOf(n, c), save: (c, f) => l.saveImageView(n, c, f) }), [l, n]), u = L(
358
358
  (c, f) => {
359
359
  f.kind !== "failure" && l.setTitle(c, f.name), r(c);
360
360
  },
361
361
  [l, r]
362
- ), v = R(
362
+ ), v = L(
363
363
  (c) => {
364
364
  l.whenUrlRendered(() => i.announce(c));
365
365
  },
366
366
  [l, i]
367
367
  ), g = D(
368
368
  () => ({
369
- scrollerOf: et,
370
- reveal: (c) => u(n, c),
369
+ scrollerOf: nt,
370
+ reveal: (c) => d(n, c),
371
371
  keepAtStart: (c, f) => p(n, c, f)
372
372
  }),
373
- [u, p, n]
373
+ [d, p, n]
374
374
  ), O = D(
375
375
  () => ({ kind: "panel", maximized: t, onDocumentLink: b, pendingHash: y, onHashConsumed: k, announceFailure: v, paneScroll: g }),
376
376
  [t, b, y, k, v, g]
377
- ), C = D(() => ({ kind: "panel", documentName: o, maximized: t }), [o, t]), A = R(() => l.setMarkup(e, !l.getSnapshot().layout.markup.has(e)), [l, e]), N = D(() => ({ shown: E, toggle: A }), [E, A]);
377
+ ), C = D(() => ({ kind: "panel", documentName: o, maximized: t }), [o, t]), A = L(() => l.setMarkup(e, !l.getSnapshot().layout.markup.has(e)), [l, e]), N = D(() => ({ shown: E, toggle: A }), [E, A]);
378
378
  return /* @__PURE__ */ ie(ln, { value: w, children: [
379
379
  /* @__PURE__ */ M(sn, { path: e, placement: C, markup: N }),
380
- /* @__PURE__ */ M(an, { path: e, absence: cn, markup: E, variant: O, onDocumentShown: d })
380
+ /* @__PURE__ */ M(an, { path: e, absence: cn, markup: E, variant: O, onDocumentShown: u })
381
381
  ] });
382
- }, Se = () => typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function" && typeof HTMLElement.prototype.hidePopover == "function", me = "data-aqmx-column-probe", Z = "data-panel-id", ae = "--aqmx-multi-panel-chrome", tt = (e) => e === "normal" ? 0 : V(e), ot = (e, n) => {
382
+ }, Se = () => typeof HTMLElement < "u" && typeof HTMLElement.prototype.showPopover == "function" && typeof HTMLElement.prototype.hidePopover == "function", me = "data-aqmx-column-probe", Q = "data-panel-id", ae = "--aqmx-multi-panel-chrome", ot = (e) => e === "normal" ? 0 : V(e), rt = (e, n) => {
383
383
  const t = e.querySelector(te)?.firstElementChild, o = e.querySelector(`[${me}]`), r = o instanceof HTMLElement ? o.getBoundingClientRect().width : Number.NaN;
384
384
  if (!(t instanceof HTMLElement))
385
385
  return { plan: { trackInlineSize: Number.NaN, gap: Number.NaN, minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: Number.NaN };
386
- const l = getComputedStyle(t), a = t.clientWidth - V(l.paddingLeft) - V(l.paddingRight), u = t.clientHeight - V(l.paddingTop) - V(l.paddingBottom);
387
- return { plan: { trackInlineSize: a, gap: tt(l.columnGap), minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: u };
388
- }, rt = (e, n) => {
386
+ const l = getComputedStyle(t), a = t.clientWidth - V(l.paddingLeft) - V(l.paddingRight), d = t.clientHeight - V(l.paddingTop) - V(l.paddingBottom);
387
+ return { plan: { trackInlineSize: a, gap: ot(l.columnGap), minColumnInlineSize: r, logicalColumns: n }, stageBlockSize: d };
388
+ }, lt = (e, n) => {
389
389
  if (e.getClientRects().length === 0) return Number.NaN;
390
390
  const t = getComputedStyle(e);
391
391
  return n.getBoundingClientRect().top - e.getBoundingClientRect().top + V(t.paddingBottom) + V(t.borderBottomWidth);
392
- }, ee = "data-aqmx-panel-frame", xe = "--aqmx-multi-panel-pinned-block-size", lt = (e) => {
392
+ }, ee = "data-aqmx-panel-frame", xe = "--aqmx-multi-panel-pinned-block-size", st = (e) => {
393
393
  const { docPath: n, panelId: t } = e;
394
394
  if (typeof n != "string" || typeof t != "string") throw new TypeError("[markdown-explorer] a multi-view panel needs string docPath and panelId props");
395
395
  return { docPath: n, panelId: t };
396
- }, st = (e) => {
396
+ }, it = (e) => {
397
397
  const n = getComputedStyle(e), t = Number.parseFloat(n.lineHeight);
398
398
  return Number.isFinite(t) ? t : Number.parseFloat(n.fontSize);
399
- }, it = (e, n, t) => e.deltaMode === WheelEvent.DOM_DELTA_PAGE ? e.deltaY * n.clientHeight : e.deltaMode !== WheelEvent.DOM_DELTA_LINE ? e.deltaY : e.deltaY * t(n), W = (e) => {
400
- const n = e.closest(Re);
399
+ }, at = (e, n, t) => e.deltaMode === WheelEvent.DOM_DELTA_PAGE ? e.deltaY * n.clientHeight : e.deltaMode !== WheelEvent.DOM_DELTA_LINE ? e.deltaY : e.deltaY * t(n), W = (e) => {
400
+ const n = e.closest(Le);
401
401
  return n instanceof HTMLElement ? n : null;
402
402
  }, je = (e) => {
403
403
  const n = e.firstElementChild;
404
404
  return n instanceof HTMLElement && getComputedStyle(n).position === "sticky" ? n : null;
405
- }, Ye = (e, n) => {
405
+ }, Ge = (e, n) => {
406
406
  const t = n.getBoundingClientRect().top, o = je(e);
407
407
  return o === null ? t : Math.max(t, o.getBoundingClientRect().bottom);
408
408
  }, Ee = (e, n) => {
@@ -412,13 +412,13 @@ const kn = () => {
412
412
  (e[r]?.getBoundingClientRect().bottom ?? Number.NEGATIVE_INFINITY) > n ? o = r : t = r + 1;
413
413
  }
414
414
  return t < e.length ? t : -1;
415
- }, at = (e, n) => {
416
- const t = Ye(e, n), o = [];
415
+ }, ct = (e, n) => {
416
+ const t = Ge(e, n), o = [];
417
417
  let r = e;
418
418
  for (let a = Ee([...r.children], t); a >= 0; a = Ee([...r.children], t)) {
419
- const u = r.children[a];
420
- if (u === void 0) break;
421
- o.push(a), r = u;
419
+ const d = r.children[a];
420
+ if (d === void 0) break;
421
+ o.push(a), r = d;
422
422
  }
423
423
  const l = r.getBoundingClientRect();
424
424
  return { scrollTop: n.scrollTop, anchor: o.length === 0 ? null : { path: o, offset: l.top - t, height: l.height } };
@@ -427,12 +427,12 @@ const kn = () => {
427
427
  let o = e;
428
428
  for (const p of t.anchor.path) o = o?.children[p];
429
429
  if (o === void 0) return;
430
- const r = o.getBoundingClientRect(), { offset: l, height: a } = t.anchor, u = l < 0 && a > 0 ? l / a * r.height : l;
431
- n.scrollTop += r.top - Ye(e, n) - u;
432
- }, ct = Object.freeze(["data-testid", "aria-label", "title", "href", "id", "name"]), Ge = (e) => {
430
+ const r = o.getBoundingClientRect(), { offset: l, height: a } = t.anchor, d = l < 0 && a > 0 ? l / a * r.height : l;
431
+ n.scrollTop += r.top - Ge(e, n) - d;
432
+ }, ut = Object.freeze(["data-testid", "aria-label", "title", "href", "id", "name"]), Ye = (e) => {
433
433
  const n = e.getAttribute(he);
434
- return JSON.stringify(n === null ? [e.tagName, ...ct.map((t) => e.getAttribute(t))] : [e.tagName, he, n]);
435
- }, ut = (e, n) => {
434
+ return JSON.stringify(n === null ? [e.tagName, ...ut.map((t) => e.getAttribute(t))] : [e.tagName, he, n]);
435
+ }, dt = (e, n) => {
436
436
  if (n === null || !e.contains(n)) return null;
437
437
  const t = [];
438
438
  for (let o = n; o !== e; ) {
@@ -440,21 +440,21 @@ const kn = () => {
440
440
  if (r === null) return null;
441
441
  t.unshift([...r.children].indexOf(o)), o = r;
442
442
  }
443
- return { path: t, signature: Ge(n) };
444
- }, dt = (e, n, t) => {
443
+ return { path: t, signature: Ye(n) };
444
+ }, mt = (e, n, t) => {
445
445
  let o = e;
446
446
  for (const r of t.path) o = o?.children[r];
447
- o instanceof HTMLElement && Ge(o) === t.signature && un(o) || n.focus({ preventScroll: !0 });
448
- }, mt = (e, n, t) => {
447
+ o instanceof HTMLElement && Ye(o) === t.signature && dn(o) || n.focus({ preventScroll: !0 });
448
+ }, ft = (e, n, t) => {
449
449
  if (e.shiftKey || Math.abs(e.deltaX) > Math.abs(e.deltaY)) return;
450
450
  const o = e.ctrlKey || e.metaKey, r = o ? W(n) : n.closest(te);
451
451
  if (!(r instanceof HTMLElement)) return;
452
- const l = it(e, r, t);
453
- (o || ft(r, l)) && (e.preventDefault(), r.scrollTop += l);
454
- }, ft = (e, n) => n < 0 ? e.scrollTop > 0 : n > 0 ? Math.ceil(e.scrollTop + e.clientHeight) < e.scrollHeight : !1, pt = (e) => e.scrollHeight > e.clientHeight, gt = (e, n, t) => {
452
+ const l = at(e, r, t);
453
+ (o || pt(r, l)) && (e.preventDefault(), r.scrollTop += l);
454
+ }, pt = (e, n) => n < 0 ? e.scrollTop > 0 : n > 0 ? Math.ceil(e.scrollTop + e.clientHeight) < e.scrollHeight : !1, gt = (e) => e.scrollHeight > e.clientHeight, ht = (e, n, t) => {
455
455
  let o = Number.NaN, r = Number.NaN;
456
456
  const l = je(t), a = () => {
457
- const i = rt(e, n);
457
+ const i = lt(e, n);
458
458
  if (!Number.isFinite(i)) return;
459
459
  const y = l === null ? 0 : l.getBoundingClientRect().height;
460
460
  y !== r && (r = y, t.style.setProperty(xe, `${String(y)}px`));
@@ -462,85 +462,90 @@ const kn = () => {
462
462
  E !== o && (o = E, e.style.setProperty(ae, `${String(E)}px`));
463
463
  };
464
464
  a();
465
- let u = null;
465
+ let d = null;
466
466
  const p = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
467
- u === null && (u = requestAnimationFrame(() => {
468
- u = null, a();
467
+ d === null && (d = requestAnimationFrame(() => {
468
+ d = null, a();
469
469
  }));
470
470
  });
471
471
  return p?.observe(e), p?.observe(n), l !== null && p?.observe(l), () => {
472
- p?.disconnect(), u !== null && cancelAnimationFrame(u), e.style.removeProperty(ae), t.style.removeProperty(xe);
472
+ p?.disconnect(), d !== null && cancelAnimationFrame(d), e.style.removeProperty(ae), t.style.removeProperty(xe);
473
473
  };
474
- }, ht = (e) => {
475
- const { docPath: n, panelId: t } = lt(e), { store: o, Body: r, maximize: l, focusCarry: a } = ue(), u = _(o, (d) => d.layout.maximized === n), p = _(o, (d) => de(d.titles, n)), i = q(null), y = q(null), E = q(null), b = q(null);
474
+ }, vt = (e) => {
475
+ const { docPath: n, panelId: t } = st(e), { store: o, Body: r, maximize: l, focusCarry: a } = ue(), d = _(o, (u) => u.layout.maximized === n), p = _(o, (u) => de(u.titles, n)), i = q(null), y = q(null), E = q(null), b = q(null);
476
476
  U(() => {
477
- const d = i.current, v = d === null ? null : W(d);
478
- if (d === null || v === null || u) return;
477
+ const u = i.current, v = u === null ? null : W(u);
478
+ if (u === null || v === null || d) return;
479
479
  const g = /* @__PURE__ */ new Map(), O = (f) => {
480
480
  const m = g.get(f);
481
481
  if (m !== void 0) return m;
482
- const T = st(f);
482
+ const T = it(f);
483
483
  return g.set(f, T), T;
484
- }, C = (f) => mt(f, d, O);
484
+ }, C = (f) => ft(f, u, O);
485
485
  let A = !1;
486
486
  const N = () => {
487
- const f = pt(v);
488
- f !== A && (A = f, f ? d.addEventListener("wheel", C, { capture: !0, passive: !1 }) : d.removeEventListener("wheel", C, { capture: !0 }));
487
+ const f = gt(v);
488
+ f !== A && (A = f, f ? u.addEventListener("wheel", C, { capture: !0, passive: !1 }) : u.removeEventListener("wheel", C, { capture: !0 }));
489
489
  };
490
490
  N();
491
491
  const c = typeof ResizeObserver > "u" ? null : new ResizeObserver(N);
492
- return c?.observe(v), c?.observe(d), () => {
493
- c?.disconnect(), d.removeEventListener("wheel", C, { capture: !0 });
492
+ return c?.observe(v), c?.observe(u), () => {
493
+ c?.disconnect(), u.removeEventListener("wheel", C, { capture: !0 });
494
494
  };
495
- }, [u]), F(() => {
496
- const d = i.current, v = d === null ? null : W(d), g = d === null ? null : d.closest(`[${Z}]`);
497
- if (!(d === null || v === null || !(g instanceof HTMLElement)))
498
- return gt(g, v, d);
495
+ }, [d]), F(() => {
496
+ const u = i.current, v = u === null ? null : W(u), g = u === null ? null : u.closest(`[${Q}]`);
497
+ if (!(u === null || v === null || !(g instanceof HTMLElement)))
498
+ return ht(g, v, u);
499
499
  }, []), F(() => {
500
- const d = i.current, v = d === null ? null : W(d);
501
- if (d === null || v === null) return;
500
+ const u = i.current, v = u === null ? null : W(u);
501
+ if (u === null || v === null) return;
502
502
  const g = (f) => {
503
- Oe(d, v, f), b.current = v.scrollTop;
503
+ Oe(u, v, f), b.current = v.scrollTop;
504
504
  }, O = o.readingPositionOf(t, n);
505
505
  y.current = O === null ? null : { doc: n, position: O }, O !== null && g(O);
506
- let C = null, A = d.getBoundingClientRect().width;
506
+ let C = null, A = u.getBoundingClientRect().width;
507
507
  const N = () => {
508
508
  C === null && (C = requestAnimationFrame(() => {
509
509
  C = null;
510
510
  const f = b.current;
511
- if (b.current = null, f !== null && v.scrollTop === f || d.getBoundingClientRect().width !== A) return;
511
+ if (b.current = null, f !== null && v.scrollTop === f || u.getBoundingClientRect().width !== A) return;
512
512
  const m = E.current;
513
- m !== null && o.saveReadingPosition(t, m, at(d, v));
513
+ m !== null && o.saveReadingPosition(t, m, ct(u, v));
514
514
  }));
515
515
  };
516
516
  v.addEventListener("scroll", N, { passive: !0 });
517
517
  const c = typeof ResizeObserver > "u" ? null : new ResizeObserver(() => {
518
- const f = d.getBoundingClientRect().width;
518
+ const f = u.getBoundingClientRect().width;
519
519
  if (f === A) return;
520
520
  A = f;
521
521
  const m = o.readingPositionOf(t, n);
522
522
  m !== null && g(m);
523
523
  });
524
- return c?.observe(d), () => {
524
+ return c?.observe(u), () => {
525
525
  v.removeEventListener("scroll", N), c?.disconnect(), C !== null && cancelAnimationFrame(C);
526
526
  };
527
527
  }, [o, t, n]), F(() => {
528
- const d = i.current, v = d === null ? null : d.closest(`[${Z}]`);
529
- if (d === null || v === null) return;
528
+ const u = i.current, v = u === null ? null : u.closest(`[${Q}]`);
529
+ if (u === null || v === null) return;
530
530
  const g = a.take(t);
531
- return g !== null && dt(v, d, g), () => {
532
- const O = ut(v, v.ownerDocument.activeElement);
531
+ return g !== null && mt(v, u, g), () => {
532
+ const O = dt(v, v.ownerDocument.activeElement);
533
533
  O !== null && a.hold(t, O);
534
534
  };
535
535
  }, [a, t]);
536
- const k = R((d) => {
536
+ const k = L((u) => {
537
537
  const v = i.current, g = v === null ? null : W(v);
538
538
  if (v === null || g === null) return;
539
539
  const O = E.current;
540
- E.current = d;
540
+ E.current = u;
541
541
  const C = y.current;
542
- y.current = null, C !== null && C.doc === d ? (Oe(v, g, C.position), b.current = g.scrollTop) : O !== null && O !== d && (g.scrollTop = 0);
543
- }, []), w = R(() => l(n), [l, n]);
542
+ y.current = null, C !== null && C.doc === u ? (Oe(v, g, C.position), b.current = g.scrollTop) : O !== null && O !== u && (g.scrollTop = 0);
543
+ }, []), w = L(
544
+ (u) => {
545
+ un(u.target) || l(n);
546
+ },
547
+ [l, n]
548
+ );
544
549
  return (
545
550
  /* @__PURE__ */ M(
546
551
  "div",
@@ -551,22 +556,22 @@ const kn = () => {
551
556
  className: "aqmx-multi-panel-frame",
552
557
  tabIndex: -1,
553
558
  "data-aqmx-panel-frame": t,
554
- "data-aqmx-maximized": u ? "true" : "false",
559
+ "data-aqmx-maximized": d ? "true" : "false",
555
560
  "data-testid": "markdown-explorer-panel-frame",
556
- ...u ? Ae : {},
557
- onDoubleClick: u ? void 0 : w,
558
- children: /* @__PURE__ */ M(r, { docPath: n, panelId: t, maximized: u, title: p, onContentShown: k })
561
+ ...d ? Ae : {},
562
+ onDoubleClick: d ? void 0 : w,
563
+ children: /* @__PURE__ */ M(r, { docPath: n, panelId: t, maximized: d, title: p, onContentShown: k })
559
564
  }
560
565
  )
561
566
  );
562
- }, vt = Qe(ht), Q = (e, n) => {
567
+ }, wt = Ze(vt), Z = (e, n) => {
563
568
  const t = e.panelIds.get(n);
564
569
  if (t === void 0) throw new Error(`[markdown-explorer] the open document ${JSON.stringify(n)} has no panel id`);
565
570
  return t;
566
- }, Pe = (e) => Object.fromEntries(wn(e).map((n) => [n, []])), wt = (e, n) => {
567
- const t = Vn(re(e, n), n.visible);
568
- return Object.fromEntries(t.map((o, r) => [_e(r), o.map((l) => Q(e, l))]));
569
- }, yt = (e, n) => {
571
+ }, Pe = (e) => Object.fromEntries(yn(e).map((n) => [n, []])), yt = (e, n) => {
572
+ const t = $n(re(e, n), n.visible);
573
+ return Object.fromEntries(t.map((o, r) => [_e(r), o.map((l) => Z(e, l))]));
574
+ }, St = (e, n) => {
570
575
  const t = X(e);
571
576
  return De(Object.keys(n)).map(
572
577
  (o) => (n[o] ?? []).flatMap((r) => {
@@ -574,7 +579,7 @@ const kn = () => {
574
579
  return l === void 0 ? [] : [l];
575
580
  })
576
581
  );
577
- }, St = (e) => ({
582
+ }, xt = (e) => ({
578
583
  switchToCustomDragMode: e.panelSwitchToCustomDrag,
579
584
  switchToNormalDragMode: e.panelSwitchToNormalDrag,
580
585
  hidePanel: e.panelHide,
@@ -586,6 +591,7 @@ const kn = () => {
586
591
  movePanelToNextColumn: e.panelMoveNextColumn,
587
592
  movePanelUp: e.panelMoveUp,
588
593
  movePanelDown: e.panelMoveDown,
594
+ morePanelActions: e.panelMoreActions,
589
595
  customDragModeBadge: e.panelCustomDragBadge,
590
596
  panelMoved: e.panelMoved,
591
597
  panelMoveUnavailable: e.panelMoveUnavailable,
@@ -597,29 +603,29 @@ const kn = () => {
597
603
  emptyColumn: e.multiColumnEmpty,
598
604
  dropZone: e.multiColumnRegion,
599
605
  dropHere: e.panelDropHere
600
- }), xt = "--aqmx-multi-stage-bar-gutter", Et = Object.freeze({ [xt]: `${String(dn)}px` }), Ot = Object.freeze({ blockSize: "100%", paddingInlineEnd: `${String(mn)}px` }), Pt = Object.freeze({ [yn]: "", style: Object.freeze({ display: "flex" }) }), bt = (e) => /* @__PURE__ */ M("div", { ...Pt, children: /* @__PURE__ */ M(ke, { scroller: e, withCircle: !0 }) }), Ct = ({ props: e, children: n }) => /* @__PURE__ */ M(An, { scrollerProps: { ...e, style: Ot }, renderScrollBar: bt, children: n }), Tt = (e) => /* @__PURE__ */ M(ke, { scroller: e, withCircle: !1 }), fe = "--aqmx-stage-block", Nt = "--aqmx-multi-panel-body-floor", Mt = `calc(var(${fe}) * ${String(tn)})`, At = `max(calc(var(${fe}) * ${String(nn)}), calc(var(${ae}) + var(${Nt})))`, kt = (e, n) => {
606
+ }), Et = "--aqmx-multi-stage-bar-gutter", Ot = Object.freeze({ [Et]: `${String(mn)}px` }), Pt = Object.freeze({ blockSize: "100%", paddingInlineEnd: `${String(fn)}px` }), bt = Object.freeze({ [Sn]: "", style: Object.freeze({ display: "flex" }) }), Ct = (e) => /* @__PURE__ */ M("div", { ...bt, children: /* @__PURE__ */ M(ke, { scroller: e, withCircle: !0 }) }), Tt = ({ props: e, children: n }) => /* @__PURE__ */ M(kn, { scrollerProps: { ...e, style: Pt }, renderScrollBar: Ct, children: n }), Nt = (e) => /* @__PURE__ */ M(ke, { scroller: e, withCircle: !1 }), fe = "--aqmx-stage-block", Mt = "--aqmx-multi-panel-body-floor", At = `calc(var(${fe}) * ${String(tn)})`, kt = `max(calc(var(${fe}) * ${String(nn)}), calc(var(${ae}) + var(${Mt})))`, It = (e, n) => {
601
607
  const t = Object.entries(e);
602
608
  return t.length !== Object.keys(n).length ? !1 : t.every(([o, r]) => {
603
609
  const l = n[o];
604
- return l !== void 0 && l.length === r.length && l.every((a, u) => r[u] === a);
610
+ return l !== void 0 && l.length === r.length && l.every((a, d) => r[d] === a);
605
611
  });
606
612
  }, K = (e, n, t, o) => {
607
613
  Ie(e);
608
- const r = e.querySelector(`[${Z}="${n}"]`);
614
+ const r = e.querySelector(`[${Q}="${n}"]`);
609
615
  if (!(r instanceof HTMLElement)) return;
610
616
  const l = t !== null && r.contains(t) ? t : null, a = [{ element: r, boundary: r.closest(te) }];
611
- l !== null && a.push({ element: l, boundary: r }), fn(
617
+ l !== null && a.push({ element: l, boundary: r }), pn(
612
618
  e,
613
- () => r.isConnected ? (r.scrollIntoView(Le), l?.isConnected !== !0 ? r : (o(l), l)) : null,
619
+ () => r.isConnected ? (r.scrollIntoView(Re), l?.isConnected !== !0 ? r : (o(l), l)) : null,
614
620
  a
615
621
  );
616
622
  }, ne = (e) => {
617
- e.scrollIntoView(Le);
623
+ e.scrollIntoView(Re);
618
624
  }, We = (e, n) => {
619
625
  const t = e.querySelector(`[${ee}="${n}"]`);
620
626
  return t instanceof HTMLElement ? (K(e, n, null, ne), t.focus({ preventScroll: !0 }), !0) : !1;
621
627
  }, pe = (e, n) => {
622
- const t = e.querySelector(`[${Z}="${n}"]`);
628
+ const t = e.querySelector(`[${Q}="${n}"]`);
623
629
  return t instanceof HTMLElement && t.contains(e.ownerDocument.activeElement);
624
630
  }, be = (e, n) => {
625
631
  if (!pe(e, n)) return null;
@@ -637,7 +643,7 @@ const kn = () => {
637
643
  const t = e.current;
638
644
  t !== null && We(t, n);
639
645
  });
640
- }, It = (e, n, t) => {
646
+ }, Rt = (e, n, t) => {
641
647
  requestAnimationFrame(() => {
642
648
  const o = e.current;
643
649
  if (o === null) return;
@@ -647,25 +653,25 @@ const kn = () => {
647
653
  a instanceof HTMLElement && a.focus({ preventScroll: !0 });
648
654
  });
649
655
  }, Lt = ({ store: e, stageRef: n }) => {
650
- const { config: t, labels: o, announcer: r, edits: l } = J(), { maximize: a } = ue(), u = t.multiView.columns, p = _(e, (S) => S.layout), i = _(e, (S) => S.visibleColumns), y = _(e, (S) => S.titles), E = _(e, (S) => S.layout.maximized !== null || S.splitDragging), [b, k] = $(!1), [w] = $(() => Pe(i)), d = D(() => St(o), [o]), v = R(
656
+ const { config: t, labels: o, announcer: r, edits: l } = J(), { maximize: a } = ue(), d = t.multiView.columns, p = _(e, (S) => S.layout), i = _(e, (S) => S.visibleColumns), y = _(e, (S) => S.titles), E = _(e, (S) => S.layout.maximized !== null || S.splitDragging), [b, k] = $(!1), [w] = $(() => Pe(i)), u = D(() => xt(o), [o]), v = L(
651
657
  (S) => {
652
- e.arrange(yt(e.getSnapshot().layout, S));
658
+ e.arrange(St(e.getSnapshot().layout, S));
653
659
  },
654
660
  [e]
655
- ), g = Sn({ initialColumnPanels: w, initialPanelVisibility: {}, debugConfig: ve, onColumnPanelsChange: v }), { columnPanels: O, setColumnPanels: C } = g, A = q(E), N = q(O);
661
+ ), g = xn({ initialColumnPanels: w, initialPanelVisibility: {}, debugConfig: ve, onColumnPanelsChange: v }), { columnPanels: O, setColumnPanels: C } = g, A = q(E), N = q(O);
656
662
  F(() => {
657
663
  A.current = E, N.current = O;
658
664
  }, [E, O]);
659
- const c = R(
665
+ const c = L(
660
666
  (S) => {
661
667
  const x = n.current;
662
668
  if (x === null) return;
663
- const { plan: B, stageBlockSize: z } = ot(x, u);
669
+ const { plan: B, stageBlockSize: z } = rt(x, d);
664
670
  if (Number.isFinite(z) && z > 0 && x.style.setProperty(fe, `${String(z)}px`), A.current && !S) return;
665
671
  const H = en(e.getSnapshot().visibleColumns, B);
666
672
  H !== null && e.setVisibleColumns(H);
667
673
  },
668
- [e, n, u]
674
+ [e, n, d]
669
675
  );
670
676
  F(() => {
671
677
  c(!0), k(!0);
@@ -684,17 +690,17 @@ const kn = () => {
684
690
  }, [n, c]), U(() => {
685
691
  E || c(!1);
686
692
  }, [E, c]);
687
- const f = D(() => b ? wt(p, { logical: u, visible: i }) : Pe(i), [b, p, u, i]);
693
+ const f = D(() => b ? yt(p, { logical: d, visible: i }) : Pe(i), [b, p, d, i]);
688
694
  F(() => {
689
- kt(N.current, f) || C(f);
695
+ It(N.current, f) || C(f);
690
696
  }, [f, C]);
691
697
  const m = D(() => De(Object.keys(O)).map((S) => ({ id: S, key: S, className: "aqmx-multi-column" })), [O]), T = D(
692
698
  () => p.docs.map((S) => {
693
- const x = Q(p, S);
694
- return { id: x, component: vt, title: de(y, S), props: { docPath: S, panelId: x }, minHeight: Mt, maxHeight: At };
699
+ const x = Z(p, S);
700
+ return { id: x, component: wt, title: de(y, S), props: { docPath: S, panelId: x }, minHeight: At, maxHeight: kt };
695
701
  }),
696
702
  [p, y]
697
- ), L = D(() => Object.fromEntries(p.docs.map((S) => [Q(p, S), !p.hidden.has(S)])), [p]), s = p.maximized === null ? null : Q(p, p.maximized), h = R(
703
+ ), R = D(() => Object.fromEntries(p.docs.map((S) => [Z(p, S), !p.hidden.has(S)])), [p]), s = p.maximized === null ? null : Z(p, p.maximized), h = L(
698
704
  (S) => {
699
705
  const { layout: x } = e.getSnapshot();
700
706
  for (const [B, z] of X(x)) {
@@ -706,25 +712,25 @@ const kn = () => {
706
712
  r.announce(o.panelShown(j)), Ke(n, B);
707
713
  continue;
708
714
  }
709
- const Y = n.current, ge = Y === null ? null : be(Y, B);
715
+ const G = n.current, ge = G === null ? null : be(G, B);
710
716
  e.setHidden(z, !0) && (r.announce(o.panelHidden(j)), ge !== null && Ce(n, ge));
711
717
  }
712
718
  },
713
719
  [e, n, r, o]
714
- ), P = R(
720
+ ), P = L(
715
721
  (S) => {
716
722
  const x = X(e.getSnapshot().layout).get(S);
717
723
  if (x === void 0) return;
718
724
  const B = () => {
719
- const H = e.titleOf(x), j = n.current, Y = j === null ? null : be(j, S);
720
- e.close(x) && (r.announce(o.panelClosed(H)), Y !== null && Ce(n, Y));
725
+ const H = e.titleOf(x), j = n.current, G = j === null ? null : be(j, S);
726
+ e.close(x) && (r.announce(o.panelClosed(H)), G !== null && Ce(n, G));
721
727
  }, z = l.unsavedAmong([x]);
722
728
  z.length === 0 ? B() : l.askToDiscard(z).then((H) => {
723
729
  H && B();
724
730
  });
725
731
  },
726
732
  [e, n, r, o, l]
727
- ), I = R(
733
+ ), I = L(
728
734
  (S) => {
729
735
  if (S === null) {
730
736
  a(null);
@@ -736,13 +742,13 @@ const kn = () => {
736
742
  [e, a]
737
743
  );
738
744
  return /* @__PURE__ */ M("div", { className: "aqmx-multi-layout", "aria-busy": !b, children: /* @__PURE__ */ M(
739
- xn,
745
+ En,
740
746
  {
741
747
  columns: m,
742
748
  panels: T,
743
749
  columnPanels: O,
744
750
  onColumnPanelsChange: v,
745
- panelVisibility: L,
751
+ panelVisibility: R,
746
752
  onPanelVisibilityChange: h,
747
753
  dragState: g.dragState,
748
754
  dragOverPosition: g.dragOverPosition,
@@ -766,41 +772,41 @@ const kn = () => {
766
772
  onPanelMaximizeChange: I,
767
773
  maximizedPanel: s,
768
774
  dragHandle: "header",
769
- labels: d,
775
+ labels: u,
770
776
  panelClassName: "aqmx-multi-panel",
771
- renderPanelScrollArea: Ct,
772
- renderStageScrollBar: Tt
777
+ renderPanelScrollArea: Tt,
778
+ renderStageScrollBar: Nt
773
779
  }
774
780
  ) });
775
- }, se = { blockStart: "--aqmx-multi-toast-block-start", inlineEnd: "--aqmx-multi-toast-inline-end", room: "--aqmx-multi-toast-room" }, Rt = (e, n) => {
781
+ }, se = { blockStart: "--aqmx-multi-toast-block-start", inlineEnd: "--aqmx-multi-toast-inline-end", room: "--aqmx-multi-toast-room" }, Dt = (e, n) => {
776
782
  const t = n.getBoundingClientRect(), o = [t.left + 1, t.left + t.width / 2, t.right - 1], r = [t.top + 1, t.top + t.height / 2, t.bottom - 1];
777
783
  return o.some(
778
784
  (l) => r.some((a) => {
779
- const u = n.ownerDocument.elementsFromPoint(l, a), p = u.findIndex((y) => n.contains(y)), i = u.findIndex((y) => e.contains(y));
785
+ const d = n.ownerDocument.elementsFromPoint(l, a), p = d.findIndex((y) => n.contains(y)), i = d.findIndex((y) => e.contains(y));
780
786
  return p !== -1 && i !== -1 && i < p;
781
787
  })
782
788
  );
783
- }, Dt = (e, n) => {
789
+ }, _t = (e, n) => {
784
790
  const t = n.getBoundingClientRect(), o = n.ownerDocument.documentElement.clientWidth, r = getComputedStyle(n).direction === "rtl";
785
791
  return e.style.setProperty(se.blockStart, `${String(t.top)}px`), e.style.setProperty(se.inlineEnd, `${String(r ? t.left : o - t.right)}px`), e.style.setProperty(se.room, `${String(t.width)}px`), e.showPopover(), () => {
786
792
  e.isConnected && e.hidePopover();
787
793
  };
788
- }, _t = ({ store: e, body: n, limitNotice: t, onLimitNoticeCovered: o, ref: r }) => {
789
- const { config: l, labels: a, announcer: u, edits: p } = J(), i = q(null), y = q(null), E = _(e, (c) => c.ready), b = _(e, (c) => c.layout.docs.length > 0), k = _(e, (c) => c.visibleColumns), w = Ne(gn), d = R(
794
+ }, zt = ({ store: e, body: n, limitNotice: t, onLimitNoticeCovered: o, ref: r }) => {
795
+ const { config: l, labels: a, announcer: d, edits: p } = J(), i = q(null), y = q(null), E = _(e, (c) => c.ready), b = _(e, (c) => c.layout.docs.length > 0), k = _(e, (c) => c.visibleColumns), w = Ne(hn), u = L(
790
796
  (c) => {
791
- const { layout: f } = e.getSnapshot(), m = f.maximized, T = c === null && m !== null ? f.panelIds.get(m) : void 0, L = i.current, s = T !== void 0 && L !== null && pe(L, T);
792
- e.maximize(c) && (c !== null ? u.announce(a.panelMaximized(e.titleOf(c))) : m !== null && u.announce(a.panelRestored(e.titleOf(m))), T !== void 0 && It(i, T, s));
797
+ const { layout: f } = e.getSnapshot(), m = f.maximized, T = c === null && m !== null ? f.panelIds.get(m) : void 0, R = i.current, s = T !== void 0 && R !== null && pe(R, T);
798
+ e.maximize(c) && (c !== null ? d.announce(a.panelMaximized(e.titleOf(c))) : m !== null && d.announce(a.panelRestored(e.titleOf(m))), T !== void 0 && Rt(i, T, s));
793
799
  },
794
- [e, u, a]
795
- ), v = R(
800
+ [e, d, a]
801
+ ), v = L(
796
802
  (c, f, m, T) => {
797
803
  if (m === f) {
798
804
  e.setPendingHash(c, T);
799
805
  return;
800
806
  }
801
- const L = p.unsavedAmong([f]);
802
- if (L.length > 0) {
803
- p.askToDiscard(L).then((I) => {
807
+ const R = p.unsavedAmong([f]);
808
+ if (R.length > 0) {
809
+ p.askToDiscard(R).then((I) => {
804
810
  I && v(c, f, m, T);
805
811
  });
806
812
  return;
@@ -812,30 +818,30 @@ const kn = () => {
812
818
  }
813
819
  if (s !== "existing") return;
814
820
  const { layout: h } = e.getSnapshot(), P = h.panelIds.get(m);
815
- P !== void 0 && (u.announce(a.panelAlreadyOpen(e.titleOf(m))), h.maximized === null ? e.setHidden(m, !1) : d(m), e.setPendingHash(P, T), Ke(i, P));
821
+ P !== void 0 && (d.announce(a.panelAlreadyOpen(e.titleOf(m))), h.maximized === null ? e.setHidden(m, !1) : u(m), e.setPendingHash(P, T), Ke(i, P));
816
822
  },
817
- [e, u, a, d, p]
823
+ [e, d, a, u, p]
818
824
  );
819
825
  F(() => {
820
826
  if (t === null || w !== null || !Se()) return;
821
827
  const c = y.current, f = i.current;
822
828
  if (c === null || f === null) throw new Error("[markdown-explorer] the panel-limit notice and the stage must be mounted together");
823
- return Dt(c, f);
829
+ return _t(c, f);
824
830
  }, [t, w]), U(() => {
825
831
  const c = y.current;
826
832
  if (t === null || c === null) return;
827
833
  const { ownerDocument: f } = c;
828
834
  let m = null;
829
- const T = (L) => {
830
- const s = L.target;
835
+ const T = (R) => {
836
+ const s = R.target;
831
837
  s instanceof Element && (m !== null && cancelAnimationFrame(m), m = requestAnimationFrame(() => {
832
- m = null, f.activeElement === s && c.isConnected && Rt(c, s) && o();
838
+ m = null, f.activeElement === s && c.isConnected && Dt(c, s) && o();
833
839
  }));
834
840
  };
835
841
  return f.addEventListener("focusin", T, !0), () => {
836
842
  f.removeEventListener("focusin", T, !0), m !== null && cancelAnimationFrame(m);
837
843
  };
838
- }, [t, w, o]), Ze(
844
+ }, [t, w, o]), Qe(
839
845
  r,
840
846
  () => ({
841
847
  bringIntoView: (c) => {
@@ -852,22 +858,22 @@ const kn = () => {
852
858
  c !== null && Ie(c);
853
859
  };
854
860
  }, []);
855
- const g = R((c, f) => {
861
+ const g = L((c, f) => {
856
862
  const m = i.current;
857
863
  m !== null && K(m, c, f, ne);
858
- }, []), O = R((c, f, m) => {
864
+ }, []), O = L((c, f, m) => {
859
865
  const T = i.current;
860
- T !== null && K(T, c, m, (L) => pn(f, L));
861
- }, []), [C] = $(kn), A = D(() => ({ store: e, Body: n, followLink: v, maximize: d, revealInPanel: g, keepAtStartInPanel: O, focusCarry: C }), [e, n, v, d, g, O, C]), N = D(() => Array.from({ length: l.multiView.columns }, (c, f) => _e(f)), [l]);
866
+ T !== null && K(T, c, m, (R) => gn(f, R));
867
+ }, []), [C] = $(In), A = D(() => ({ store: e, Body: n, followLink: v, maximize: u, revealInPanel: g, keepAtStartInPanel: O, focusCarry: C }), [e, n, v, u, g, O, C]), N = D(() => Array.from({ length: l.multiView.columns }, (c, f) => _e(f)), [l]);
862
868
  return (
863
- /* @__PURE__ */ ie("section", { ref: i, className: "aqmx-multi-stage", style: Et, tabIndex: -1, "aria-label": a.multiRegion, "aria-busy": b && !E, "data-testid": "markdown-explorer-stage", "data-aqmx-visible-columns": k, ...Ae, children: [
869
+ /* @__PURE__ */ ie("section", { ref: i, className: "aqmx-multi-stage", style: Ot, tabIndex: -1, "aria-label": a.multiRegion, "aria-busy": b && !E, "data-testid": "markdown-explorer-stage", "data-aqmx-visible-columns": k, ...Ae, children: [
864
870
  /* @__PURE__ */ M("span", { className: "aqmx-multi-probe", "aria-hidden": "true", [me]: "" }),
865
871
  b ? E ? /* @__PURE__ */ M(ze, { value: A, children: /* @__PURE__ */ M(Lt, { store: e, stageRef: i }) }) : /* @__PURE__ */ M("div", { className: "aqmx-multi-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-stage-skeleton", children: N.map((c) => /* @__PURE__ */ ie("div", { className: "aqmx-skeleton aqmx-multi-skeleton-column", children: [
866
872
  /* @__PURE__ */ M("span", {}),
867
873
  /* @__PURE__ */ M("span", {}),
868
874
  /* @__PURE__ */ M("span", {})
869
875
  ] }, c)) }) : /* @__PURE__ */ M("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-multi-empty", children: /* @__PURE__ */ M("p", { className: "aqmx-empty-title", children: a.multiEmpty }) }),
870
- t === null ? null : w !== null ? Mn(
876
+ t === null ? null : w !== null ? An(
871
877
  /* @__PURE__ */ M("div", { ref: y, className: "aqmx-toast aqmx-multi-toast", "data-testid": "markdown-explorer-panel-limit", children: t }),
872
878
  w
873
879
  ) : (
@@ -875,14 +881,14 @@ const kn = () => {
875
881
  )
876
882
  ] })
877
883
  );
878
- }, zt = 3e3, Ht = (e, n) => {
884
+ }, Ht = 3e3, Bt = (e, n) => {
879
885
  if (n !== null) return n;
880
886
  const [t] = e;
881
887
  return t === void 0 ? null : t;
882
888
  }, Te = (e, n, t) => {
883
889
  const o = new Set(e), r = n.filter((a) => !o.has(a)), l = r.length > 0 ? r.at(-1) : t !== null && n.includes(t) ? t : n.at(-1);
884
890
  return l === void 0 ? null : l;
885
- }, Bt = (e, n, t) => {
891
+ }, qt = (e, n, t) => {
886
892
  switch (n) {
887
893
  case "opened":
888
894
  return e.panelOpened(t);
@@ -895,10 +901,10 @@ const kn = () => {
895
901
  throw new RangeError(`[markdown-explorer] unknown toggle outcome ${JSON.stringify(o)}`);
896
902
  }
897
903
  }
898
- }, Xt = ({ location: e }) => {
899
- const { config: n, labels: t, announcer: o } = J(), r = Zn(e), l = _(r, (m) => m.layout.docs), a = _(r, (m) => m.layout.maximized), u = _(r, (m) => m.layout.markup), p = _(r, (m) => m.source), [i, y] = $(() => ({ docs: l, latest: Te([], l, null) }));
904
+ }, Zt = ({ location: e }) => {
905
+ const { config: n, labels: t, announcer: o } = J(), r = et(e), l = _(r, (m) => m.layout.docs), a = _(r, (m) => m.layout.maximized), d = _(r, (m) => m.layout.markup), p = _(r, (m) => m.source), [i, y] = $(() => ({ docs: l, latest: Te([], l, null) }));
900
906
  i.docs !== l && y({ docs: l, latest: Te(i.docs, l, i.latest) });
901
- const E = a !== null ? a : i.latest, [b, k] = $(!1), w = q(null), [d, v] = $(0), g = q(null), O = q(null);
907
+ const E = a !== null ? a : i.latest, [b, k] = $(!1), w = q(null), [u, v] = $(0), g = q(null), O = q(null);
902
908
  F(() => {
903
909
  const m = g.current;
904
910
  g.current = null, m !== null && (r.whenUrlRendered(() => o.announce(m.announcement)), O.current?.bringIntoView(m.doc));
@@ -908,45 +914,45 @@ const kn = () => {
908
914
  },
909
915
  []
910
916
  );
911
- const C = R(() => {
917
+ const C = L(() => {
912
918
  w.current !== null && clearTimeout(w.current), k(!0), w.current = setTimeout(() => {
913
919
  w.current = null, k(!1);
914
- }, zt);
915
- }, []), A = R(() => {
920
+ }, Ht);
921
+ }, []), A = L(() => {
916
922
  w.current !== null && clearTimeout(w.current), w.current = null, k(!1);
917
- }, []), N = R(
923
+ }, []), N = L(
918
924
  (m) => {
919
- const T = r.titleOf(m), L = r.toggle(m);
920
- L === "rejected" && C();
921
- const s = L === "rejected" ? t.panelLimit(n.multiView.maxPanels) : Bt(t, L, T);
922
- if (L === "shown") {
925
+ const T = r.titleOf(m), R = r.toggle(m);
926
+ R === "rejected" && C();
927
+ const s = R === "rejected" ? t.panelLimit(n.multiView.maxPanels) : qt(t, R, T);
928
+ if (R === "shown") {
923
929
  g.current = { doc: m, announcement: s }, v((h) => h + 1);
924
930
  return;
925
931
  }
926
932
  r.whenUrlRendered(() => {
927
- o.announce(s), L === "opened" && O.current?.bringIntoView(m);
933
+ o.announce(s), R === "opened" && O.current?.bringIntoView(m);
928
934
  });
929
935
  },
930
936
  [r, C, o, t, n]
931
937
  ), c = D(() => new Set(l), [l]), f = D(() => {
932
- const m = Ht(l, a);
933
- return { href: Me(n, { view: "tree", source: p, doc: m, markup: m !== null && u.has(m) }), target: "tree" };
934
- }, [n, p, l, a, u]);
938
+ const m = Bt(l, a);
939
+ return { href: Me(n, { view: "tree", source: p, doc: m, markup: m !== null && d.has(m) }), target: "tree" };
940
+ }, [n, p, l, a, d]);
935
941
  return /* @__PURE__ */ M(
936
- hn,
942
+ vn,
937
943
  {
938
944
  view: "multi",
939
- explorer: /* @__PURE__ */ M(vn, { mode: "multi", sourceId: p, currentPath: E, openPaths: c, onOpenDocument: N, onSourceChange: r.changeSource, onRevealSource: r.revealSource, viewSwitch: f }),
940
- content: /* @__PURE__ */ M(_t, { ref: O, store: r, body: nt, limitNotice: b ? t.panelLimit(n.multiView.maxPanels) : null, onLimitNoticeCovered: A }),
945
+ explorer: /* @__PURE__ */ M(wn, { mode: "multi", sourceId: p, currentPath: E, openPaths: c, onOpenDocument: N, onSourceChange: r.changeSource, onRevealSource: r.revealSource, viewSwitch: f }),
946
+ content: /* @__PURE__ */ M(zt, { ref: O, store: r, body: tt, limitNotice: b ? t.panelLimit(n.multiView.maxPanels) : null, onLimitNoticeCovered: A }),
941
947
  contentCoversPage: a !== null,
942
- sheetDismissals: d,
948
+ sheetDismissals: u,
943
949
  onDraggingChange: r.setSplitDragging
944
950
  }
945
951
  );
946
952
  };
947
953
  export {
948
- Xt as MultiLayout,
949
- zt as PANEL_LIMIT_NOTICE_MS,
954
+ Zt as MultiLayout,
955
+ Ht as PANEL_LIMIT_NOTICE_MS,
950
956
  Te as latestOpenedDocument,
951
- Ht as treeSwitchDocument
957
+ Bt as treeSwitchDocument
952
958
  };