@aiquants/markdown-explorer 0.10.0 → 0.11.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 (38) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -1
  3. package/dist/{EditSurface-1Jf0CG-f.js → EditSurface-BK_Pz_LF.js} +1 -1
  4. package/dist/{EditSurface-B-l3Do_C.cjs → EditSurface-CfbYYXrc.cjs} +1 -1
  5. package/dist/ExplorerSplit-51frK8xf.cjs +1 -0
  6. package/dist/{ExplorerSplit-D0zf7Cr_.js → ExplorerSplit-DwlWWfRv.js} +216 -213
  7. package/dist/{MultiLayout-Bq10p3a3.cjs → MultiLayout-B4PtS45V.cjs} +1 -1
  8. package/dist/{MultiLayout-Jy9BKofx.js → MultiLayout-CeR_l6Rb.js} +4 -4
  9. package/dist/{NativeScrollBar-CyiyL47o.js → NativeScrollBar-CVWeTlHC.js} +1 -1
  10. package/dist/{NativeScrollBar-Dt6xH5Mb.cjs → NativeScrollBar-Dp4YWBp7.cjs} +1 -1
  11. package/dist/{TreeLayout-kVWFEKJD.cjs → TreeLayout-D-NyhuVM.cjs} +1 -1
  12. package/dist/{TreeLayout-8pRo1ANN.js → TreeLayout-min5AOhr.js} +3 -3
  13. package/dist/core/contracts.d.cts +1 -0
  14. package/dist/core/contracts.d.ts +1 -0
  15. package/dist/core/labels.d.cts +2 -0
  16. package/dist/core/labels.d.ts +2 -0
  17. package/dist/core/treeSettings.d.cts +2 -1
  18. package/dist/core/treeSettings.d.ts +2 -1
  19. package/dist/dataRoute-CIFFX5bd.cjs +1 -0
  20. package/dist/{dataRoute-Csl1WBDz.js → dataRoute-CU9CKP44.js} +54 -54
  21. package/dist/{index-CfcJEnrC.js → index-BPj19kIo.js} +10 -6
  22. package/dist/{index-sNJrKoGN.cjs → index-DJ_FUtYM.cjs} +4 -4
  23. package/dist/index.cjs +1 -1
  24. package/dist/index.js +3 -3
  25. package/dist/{location-Dc1qNEGm.js → location-BT23fKeh.js} +123 -112
  26. package/dist/location-LNl0QOXI.cjs +1 -0
  27. package/dist/{merge-D0aGvFKC.cjs → merge-AnqxGn__.cjs} +1 -1
  28. package/dist/{merge-SRCxtHk2.js → merge-hyUGPGbJ.js} +1 -1
  29. package/dist/sanitizeWorker.cjs +1 -1
  30. package/dist/sanitizeWorker.js +1 -1
  31. package/dist/server.cjs +1 -1
  32. package/dist/server.js +548 -540
  33. package/docs/behavior/dom-hooks.md +1 -1
  34. package/docs/behavior/localization.md +1 -0
  35. package/package.json +1 -1
  36. package/dist/ExplorerSplit-WX8afxrQ.cjs +0 -1
  37. package/dist/dataRoute-8pyILcjL.cjs +0 -1
  38. package/dist/location-CRYkEWiC.cjs +0 -1
@@ -1,8 +1,8 @@
1
- import { jsx as m, jsxs as O, Fragment as Ge } from "react/jsx-runtime";
2
- import { u as D, F as Nt, q as Oe, o as Ye, r as kt, k as Pe, s as Lt, t as Ot, h as Pt, w as At, x as qt, y as Ct } from "./index-CfcJEnrC.js";
1
+ import { jsx as m, jsxs as A, Fragment as Ge } from "react/jsx-runtime";
2
+ import { u as D, F as Nt, q as Ae, o as Ye, r as kt, k as Oe, s as Lt, t as At, h as Ot, w as Pt, x as qt, y as Ct } from "./index-BPj19kIo.js";
3
3
  import * as p from "react";
4
- import { use as be, createContext as Ae, useState as q, useCallback as w, useMemo as F, useRef as g, useLayoutEffect as I, useEffect as _, useSyncExternalStore as Ee, Suspense as Qe, useId as ye } from "react";
5
- import { C as Ft, k as Mt, l as Je, v as _t, m as It, n as Dt, E as Ht, o as Be, q as $t, s as Zt, S as ve, t as Bt, F as zt, A as Vt } from "./location-Dc1qNEGm.js";
4
+ import { use as be, createContext as Pe, useState as q, useCallback as w, useMemo as F, useRef as g, useLayoutEffect as I, useEffect as _, useSyncExternalStore as Ee, Suspense as Qe, useId as ye } from "react";
5
+ import { C as Ft, k as Mt, l as Je, v as _t, m as It, n as Dt, E as Ht, o as Be, q as $t, s as Zt, S as ve, t as Bt, F as zt, A as Vt } from "./location-BT23fKeh.js";
6
6
  import { useDirectoryTreeState as jt, DirectoryTree as Kt } from "@aiquants/directory-tree";
7
7
  import { T as Ut } from "./tapScrollCircle-u4EXeLhx.js";
8
8
  import { s as Wt } from "./storage-BSthKLSG.js";
@@ -97,7 +97,7 @@ function an({
97
97
  }
98
98
  const ln = /* @__PURE__ */ p.forwardRef(an), on = () => {
99
99
  const { notices: e } = D(), t = be(e);
100
- return t.length === 0 ? null : /* @__PURE__ */ m("div", { className: "aqmx-explorer-notices", children: t.map((n) => /* @__PURE__ */ O("div", { className: "aqmx-callout", "data-aqmx-tone": n.tone, "data-testid": "markdown-explorer-notice", "data-aqmx-notice": n.id, children: [
100
+ return t.length === 0 ? null : /* @__PURE__ */ m("div", { className: "aqmx-explorer-notices", children: t.map((n) => /* @__PURE__ */ A("div", { className: "aqmx-callout", "data-aqmx-tone": n.tone, "data-testid": "markdown-explorer-notice", "data-aqmx-notice": n.id, children: [
101
101
  /* @__PURE__ */ m("p", { className: "aqmx-callout-title", children: n.title }),
102
102
  n.body === void 0 ? null : /* @__PURE__ */ m("p", { className: "aqmx-callout-body", children: n.body }),
103
103
  n.action === void 0 ? null : (
@@ -126,7 +126,7 @@ function sn({
126
126
  clipRule: "evenodd"
127
127
  }));
128
128
  }
129
- const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt = "\0", dn = () => {
129
+ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Pe(!0), et = "\0loop\0", tt = "\0", dn = () => {
130
130
  const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = (l) => {
131
131
  const a = e.get(l);
132
132
  if (a !== void 0) return a;
@@ -135,19 +135,19 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
135
135
  }, o = (l, a, s) => {
136
136
  let d = !1;
137
137
  const u = l.map((f) => {
138
- const h = i(f, a, s);
138
+ const h = c(f, a, s);
139
139
  return h !== f && (d = !0), h;
140
140
  });
141
141
  if (!d) return l;
142
- const c = n.get(l);
143
- return c !== void 0 && c.length === u.length && c.every((f, h) => f === u[h]) ? c : (n.set(l, u), u);
144
- }, i = (l, a, s) => {
142
+ const i = n.get(l);
143
+ return i !== void 0 && i.length === u.length && i.every((f, h) => f === u[h]) ? i : (n.set(l, u), u);
144
+ }, c = (l, a, s) => {
145
145
  if (l.type !== "directory") return l;
146
146
  if (s.has(l.path)) return r(l);
147
- const d = l.lazy === !0 ? a(l.path) : void 0, u = d?.status === "loaded", c = u ? d.entries : l.children;
148
- if (c === void 0) return l;
147
+ const d = l.lazy === !0 ? a(l.path) : void 0, u = d?.status === "loaded", i = u ? d.entries : l.children;
148
+ if (i === void 0) return l;
149
149
  s.add(l.path);
150
- const f = o(c, a, s);
150
+ const f = o(i, a, s);
151
151
  if (s.delete(l.path), !u && f === l.children) return l;
152
152
  const h = t.get(l);
153
153
  if (h !== void 0 && h.state === d && h.children === f) return h.grafted;
@@ -156,8 +156,8 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
156
156
  };
157
157
  return (l, a) => o(l, a, /* @__PURE__ */ new Set());
158
158
  }, un = (e, t) => `${et}${e}${tt}${t}`, pe = (e) => e.startsWith(et), mn = (e) => e.slice(e.lastIndexOf(tt) + 1), se = "data-aqmx-path", fn = (e, t, n, r, o) => {
159
- const i = { aqmxPath: e.path };
160
- return n && (i.aqmxOpen = !0), (r === "loading" || r === "failed") && (i.aqmxChildren = r), {
159
+ const c = { aqmxPath: e.path };
160
+ return e.modifiedAt !== void 0 && (c.aqmxModifiedAt = e.modifiedAt), n && (c.aqmxOpen = !0), (r === "loading" || r === "failed") && (c.aqmxChildren = r), {
161
161
  name: e.name,
162
162
  type: e.type,
163
163
  absolutePath: e.path,
@@ -165,31 +165,34 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
165
165
  mimeType: e.mimeType,
166
166
  children: t,
167
167
  label: o,
168
- data: i
168
+ data: c
169
169
  };
170
170
  }, pn = (e, t, n, r) => {
171
171
  const o = un(t, e.path);
172
172
  return { name: n, type: "directory", absolutePath: o, relativePath: o, children: r, data: { aqmxLoop: e.path } };
173
173
  }, hn = () => {
174
174
  const e = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap(), r = [], o = (a, s, d) => {
175
- const u = a.map((f) => f.type === "loop" ? i(f, s, d) : l(f, s)), c = n.get(a);
176
- return c !== void 0 && c.length === u.length && c.every((f, h) => f === u[h]) ? c : (n.set(a, u), u);
177
- }, i = (a, s, d) => {
175
+ const u = a.map((f) => f.type === "loop" ? c(f, s, d) : l(f, s)), i = n.get(a);
176
+ return i !== void 0 && i.length === u.length && i.every((f, h) => f === u[h]) ? i : (n.set(a, u), u);
177
+ }, c = (a, s, d) => {
178
178
  const u = t.get(a);
179
179
  if (u !== void 0 && u.parentKey === d && u.loopFolderName === s.loopFolderName) return u.row;
180
- const c = pn(a, d, s.loopFolderName(a.name), r);
181
- return t.set(a, { row: c, parentKey: d, loopFolderName: s.loopFolderName }), c;
180
+ const i = pn(a, d, s.loopFolderName(a.name), r);
181
+ return t.set(a, { row: i, parentKey: d, loopFolderName: s.loopFolderName }), i;
182
182
  }, l = (a, s) => {
183
- const d = a.type === "directory" ? a.children === void 0 ? r : o(a.children, s, a.path) : void 0, u = s.openPaths.has(a.path), c = a.type === "directory" && a.lazy === !0 ? s.childrenOf(a.path)?.status : void 0, f = c === "failed" ? s.renderFailedFolder : void 0, h = e.get(a);
184
- if (h !== void 0 && h.open === u && h.childrenStatus === c && h.children === d && h.renderFailedFolder === f)
183
+ const d = a.type === "directory" ? a.children === void 0 ? r : o(a.children, s, a.path) : void 0, u = s.openPaths.has(a.path), i = a.type === "directory" && a.lazy === !0 ? s.childrenOf(a.path)?.status : void 0, f = i === "failed" ? s.renderFailedFolder : void 0, h = e.get(a);
184
+ if (h !== void 0 && h.open === u && h.childrenStatus === i && h.children === d && h.renderFailedFolder === f)
185
185
  return h.row;
186
- const v = fn(a, d, u, c, f === void 0 ? void 0 : f(a));
187
- return e.set(a, { row: v, open: u, childrenStatus: c, children: d, renderFailedFolder: f }), v;
186
+ const v = fn(a, d, u, i, f === void 0 ? void 0 : f(a));
187
+ return e.set(a, { row: v, open: u, childrenStatus: i, children: d, renderFailedFolder: f }), v;
188
188
  };
189
189
  return (a, s) => o(a, s, "");
190
190
  }, xn = (e) => {
191
191
  if (e === void 0) return;
192
- const t = (n) => ({ name: n.name, path: n.absolutePath, type: n.type });
192
+ const t = (n) => {
193
+ const r = n.data?.aqmxModifiedAt;
194
+ return typeof r == "number" ? { name: n.name, path: n.absolutePath, type: n.type, modifiedAt: r } : { name: n.name, path: n.absolutePath, type: n.type };
195
+ };
193
196
  return (n, r) => e(t(n), t(r));
194
197
  }, Le = (e, t) => {
195
198
  const n = e.filter((r) => r.type === "directory");
@@ -197,8 +200,8 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
197
200
  }, wn = (e, t) => {
198
201
  const n = /* @__PURE__ */ new Map();
199
202
  let r = 0;
200
- const o = (i) => {
201
- for (const l of Le(i, t.compare))
203
+ const o = (c) => {
204
+ for (const l of Le(c, t.compare))
202
205
  if (t.isShownExpanded(l.path)) {
203
206
  if (l.lazy !== !0) {
204
207
  l.children !== void 0 && o(l.children);
@@ -224,21 +227,21 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
224
227
  return null;
225
228
  }, vn = (e, t, n, r) => {
226
229
  let o = e;
227
- for (const i of t) {
228
- const l = o.find((a) => a.type === "directory" && a.path === i);
230
+ for (const c of t) {
231
+ const l = o.find((a) => a.type === "directory" && a.path === c);
229
232
  if (l === void 0) return "missing";
230
233
  if (l.lazy === !0) return r.childrenOf(l.path)?.status === "failed" ? "failed" : "loading";
231
234
  if (!r.isShownExpanded(l.path)) return "loading";
232
235
  o = l.children ?? [];
233
236
  }
234
- return o.some((i) => i.type === "file" && i.path === n) ? "ready" : "missing";
237
+ return o.some((c) => c.type === "file" && c.path === n) ? "ready" : "missing";
235
238
  }, Ve = /* @__PURE__ */ new Set(), bn = (e, t) => e.has(t) ? e : new Set(e).add(t), En = (e, t) => {
236
239
  if (!t.some((r) => e.has(r))) return e;
237
240
  const n = new Set(t);
238
241
  return new Set([...e].filter((r) => !n.has(r)));
239
242
  }, yn = (e, t) => [...e].every((n) => t.has(n)) ? e : new Set([...e].filter((n) => t.has(n))), Rn = () => {
240
- const [e, t] = q(Ve), n = w((l) => t((a) => bn(a, l)), []), r = w((l) => t((a) => En(a, l)), []), o = w((l) => t((a) => yn(a, l)), []), i = w(() => t(Ve), []);
241
- return F(() => ({ direct: e, markDirect: n, unmarkDirect: r, pruneDirect: o, clearDirect: i }), [e, n, r, o, i]);
243
+ const [e, t] = q(Ve), n = w((l) => t((a) => bn(a, l)), []), r = w((l) => t((a) => En(a, l)), []), o = w((l) => t((a) => yn(a, l)), []), c = w(() => t(Ve), []);
244
+ return F(() => ({ direct: e, markDirect: n, unmarkDirect: r, pruneDirect: o, clearDirect: c }), [e, n, r, o, c]);
242
245
  }, Sn = (e) => ({
243
246
  budget: e,
244
247
  handled: /* @__PURE__ */ new Set(),
@@ -252,7 +255,7 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
252
255
  const n = [];
253
256
  let r = Le(t.entries, t.compare);
254
257
  for (let o = 1; r.length > 0; o += 1) {
255
- const i = [];
258
+ const c = [];
256
259
  for (const l of r) {
257
260
  const { path: a } = l;
258
261
  if (t.isShownExpanded(a))
@@ -272,9 +275,9 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
272
275
  }
273
276
  n.push(a), e.opened += 1;
274
277
  }
275
- l.lazy !== !0 && l.children !== void 0 && i.push(...Le(l.children, t.compare));
278
+ l.lazy !== !0 && l.children !== void 0 && c.push(...Le(l.children, t.compare));
276
279
  }
277
- r = i;
280
+ r = c;
278
281
  }
279
282
  return n;
280
283
  }, rt = (e, t) => e.every((n) => n.type !== "directory" || t(n.path) && (n.lazy === !0 || n.children === void 0 || rt(n.children, t))), Nn = (e, t) => {
@@ -288,7 +291,7 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
288
291
  I(() => {
289
292
  n.current = e;
290
293
  });
291
- const i = w(() => {
294
+ const c = w(() => {
292
295
  t.current === null && (t.current = Sn(n.current.budget), o({ state: "running", opened: 0 }));
293
296
  }, []), l = w(() => {
294
297
  t.current = null, o(Ne);
@@ -302,18 +305,18 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
302
305
  o(f.kind === "done" ? Ne : { state: "stopped", stop: f.kind, opened: f.opened }), n.current.onFinish(f);
303
306
  return;
304
307
  }
305
- const { opened: c } = d;
306
- o((f) => f.state === "running" && f.opened === c ? f : { state: "running", opened: c });
308
+ const { opened: i } = d;
309
+ o((f) => f.state === "running" && f.opened === i ? f : { state: "running", opened: i });
307
310
  }, []);
308
- return F(() => ({ status: r, start: i, end: l, advance: a }), [r, i, l, a]);
309
- }, je = ["pointerdown", "wheel", "touchstart", "keydown", "focusin"], Ln = 8, Ke = { least: Number.POSITIVE_INFINITY, stalled: 0 }, On = ({ tree: e, container: t, path: n, chain: r, rows: o, cancel: i, displayed: l, placement: a }) => {
310
- const s = g(null), d = g(!0), u = g(Ke), c = g(null), f = g(null), h = g(r), v = g(a);
311
+ return F(() => ({ status: r, start: c, end: l, advance: a }), [r, c, l, a]);
312
+ }, je = ["pointerdown", "wheel", "touchstart", "keydown", "focusin"], Ln = 8, Ke = { least: Number.POSITIVE_INFINITY, stalled: 0 }, An = ({ tree: e, container: t, path: n, chain: r, rows: o, cancel: c, displayed: l, placement: a }) => {
313
+ const s = g(null), d = g(!0), u = g(Ke), i = g(null), f = g(null), h = g(r), v = g(a);
311
314
  I(() => {
312
315
  h.current = r, v.current = a;
313
316
  }, [r, a]);
314
317
  const E = w(() => {
315
- const L = c.current;
316
- L !== null && (c.current = null, L.phase === "asking" ? L.controller.abort() : h.current?.open(null));
318
+ const L = i.current;
319
+ L !== null && (i.current = null, L.phase === "asking" ? L.controller.abort() : h.current?.open(null));
317
320
  }, []), S = w(() => {
318
321
  s.current = null, E();
319
322
  }, [E]), C = w(() => {
@@ -324,16 +327,16 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
324
327
  if (b === null) return;
325
328
  const R = v.current(b);
326
329
  if (R === 0) {
327
- d.current = !0, c.current?.phase === "opening" && E();
330
+ d.current = !0, i.current?.phase === "opening" && E();
328
331
  return;
329
332
  }
330
333
  if (e.current?.scrollToPath(b, { align: "nearest" }) === !0) {
331
- c.current?.phase === "opening" && E();
332
- const { least: P, stalled: H } = u.current;
333
- u.current = R < P ? { least: R, stalled: 0 } : { least: P, stalled: H + 1 }, u.current.stalled < Ln && C();
334
+ i.current?.phase === "opening" && E();
335
+ const { least: O, stalled: H } = u.current;
336
+ u.current = R < O ? { least: R, stalled: 0 } : { least: O, stalled: H + 1 }, u.current.stalled < Ln && C();
334
337
  return;
335
338
  }
336
- const y = c.current;
339
+ const y = i.current;
337
340
  if (y === null) {
338
341
  s.current = null;
339
342
  return;
@@ -363,23 +366,23 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
363
366
  const b = h.current;
364
367
  if (k && b !== null) {
365
368
  const R = new AbortController(), y = { phase: "asking", controller: R };
366
- c.current = y, b.ancestors(n, R.signal).then((P) => {
367
- c.current === y && (P === null ? c.current = null : (c.current = { phase: "opening", folders: P }, h.current?.open(P)), T());
369
+ i.current = y, b.ancestors(n, R.signal).then((O) => {
370
+ i.current === y && (O === null ? i.current = null : (i.current = { phase: "opening", folders: O }, h.current?.open(O)), T());
368
371
  });
369
372
  }
370
373
  T();
371
374
  }, [n, k, t, S, T]), _(() => {
372
- (c.current?.phase === "opening" || s.current !== null && !d.current) && T();
375
+ (i.current?.phase === "opening" || s.current !== null && !d.current) && T();
373
376
  }, [o, T]);
374
- const Z = g(i);
377
+ const Z = g(c);
375
378
  _(() => {
376
- Z.current !== i && (Z.current = i, S());
377
- }, [i, S]);
379
+ Z.current !== c && (Z.current = c, S());
380
+ }, [c, S]);
378
381
  const M = g(l);
379
382
  _(() => {
380
383
  M.current && !l && E(), M.current = l;
381
384
  }, [l, E]);
382
- }, Pn = "--aqmx-tree-line", An = Object.freeze(["(forced-colors: active)", "(prefers-color-scheme: dark)"]), qn = "data-aqmx-tree-probe", Cn = Object.freeze({ rowHeight: Ft, lineColor: null }), Fn = /^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/u, Mn = (e) => {
385
+ }, On = "--aqmx-tree-line", Pn = Object.freeze(["(forced-colors: active)", "(prefers-color-scheme: dark)"]), qn = "data-aqmx-tree-probe", Cn = Object.freeze({ rowHeight: Ft, lineColor: null }), Fn = /^rgb\((\d{1,3}), (\d{1,3}), (\d{1,3})\)$/u, Mn = (e) => {
383
386
  const t = Fn.exec(e);
384
387
  return t === null ? e : `#${t.slice(1).map((n) => Number(n).toString(16).padStart(2, "0")).join("")}`;
385
388
  }, _n = (e, t) => {
@@ -387,26 +390,26 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
387
390
  return I(() => {
388
391
  const o = e.current;
389
392
  if (o === null) return;
390
- const i = () => {
391
- const s = Math.round(o.getBoundingClientRect().height), d = getComputedStyle(o), u = d.getPropertyValue(Pn).trim() === "" ? null : Mn(d.color);
392
- r((c) => {
393
- const f = Number.isFinite(s) && s > 0 ? s : c.rowHeight;
394
- return c.rowHeight === f && c.lineColor === u ? c : { rowHeight: f, lineColor: u };
393
+ const c = () => {
394
+ const s = Math.round(o.getBoundingClientRect().height), d = getComputedStyle(o), u = d.getPropertyValue(On).trim() === "" ? null : Mn(d.color);
395
+ r((i) => {
396
+ const f = Number.isFinite(s) && s > 0 ? s : i.rowHeight;
397
+ return i.rowHeight === f && i.lineColor === u ? i : { rowHeight: f, lineColor: u };
395
398
  });
396
399
  };
397
- i();
398
- const l = An.map((s) => window.matchMedia(s));
399
- for (const s of l) s.addEventListener("change", i);
400
- const a = typeof ResizeObserver > "u" ? null : new ResizeObserver(i);
400
+ c();
401
+ const l = Pn.map((s) => window.matchMedia(s));
402
+ for (const s of l) s.addEventListener("change", c);
403
+ const a = typeof ResizeObserver > "u" ? null : new ResizeObserver(c);
401
404
  return a?.observe(o), () => {
402
- for (const s of l) s.removeEventListener("change", i);
405
+ for (const s of l) s.removeEventListener("change", c);
403
406
  a?.disconnect();
404
407
  };
405
408
  }, [e, t]), n;
406
409
  }, at = "markdown-explorer-tree-scroll", In = 0.5, lt = (e, t) => [...e.querySelectorAll(`[role="treeitem"][${se}]`)].find((n) => n.getAttribute(se) === t), Dn = (e, t) => {
407
410
  const n = lt(e, t), r = n?.closest(`[data-testid="${at}"]`);
408
411
  if (n === void 0 || r === null || r === void 0) return Number.POSITIVE_INFINITY;
409
- const o = r.getBoundingClientRect(), i = n.getBoundingClientRect(), l = o.top - i.top, a = i.height > o.height ? Math.abs(l) : Math.max(0, l) + Math.max(0, i.bottom - o.bottom);
412
+ const o = r.getBoundingClientRect(), c = n.getBoundingClientRect(), l = o.top - c.top, a = c.height > o.height ? Math.abs(l) : Math.max(0, l) + Math.max(0, c.bottom - o.bottom);
410
413
  return a <= In ? 0 : a;
411
414
  }, Hn = {
412
415
  testId: at,
@@ -427,9 +430,9 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
427
430
  return t === null || t.getAttribute("data-entry-type") !== "file" ? null : t.getAttribute(se);
428
431
  }, ot = (e, t, n, r) => n === "folder-limit" ? e.expandAllFolderLimit(r, t.maxFolders, e.expandAll) : e.expandAllDepthLimit(r, t.maxDepth), Un = (e, t, n) => n.kind === "done" ? e.expandAllDone(n.opened, n.failed, n.complete) : ot(e, t, n.kind, n.opened), st = () => {
429
432
  const { labels: e } = D();
430
- return /* @__PURE__ */ O("div", { className: "aqmx-explorer-loading", "aria-busy": "true", "data-testid": "markdown-explorer-tree-loading", children: [
433
+ return /* @__PURE__ */ A("div", { className: "aqmx-explorer-loading", "aria-busy": "true", "data-testid": "markdown-explorer-tree-loading", children: [
431
434
  /* @__PURE__ */ m("p", { className: "aqmx-explorer-loading-text", children: e.treeLoading }),
432
- /* @__PURE__ */ O("div", { className: "aqmx-skeleton", "aria-hidden": "true", children: [
435
+ /* @__PURE__ */ A("div", { className: "aqmx-skeleton", "aria-hidden": "true", children: [
433
436
  /* @__PURE__ */ m("span", {}),
434
437
  /* @__PURE__ */ m("span", {}),
435
438
  /* @__PURE__ */ m("span", {}),
@@ -439,17 +442,17 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
439
442
  ] });
440
443
  }, Wn = () => {
441
444
  const { labels: e } = D();
442
- return /* @__PURE__ */ O("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-tree-empty", children: [
445
+ return /* @__PURE__ */ A("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-tree-empty", children: [
443
446
  /* @__PURE__ */ m(cn, { className: "aqmx-explorer-empty-icon", "aria-hidden": "true" }),
444
447
  /* @__PURE__ */ m("p", { className: "aqmx-empty-title", children: e.treeEmptyTitle }),
445
448
  /* @__PURE__ */ m("p", { className: "aqmx-explorer-empty-body", children: e.treeEmptyBody })
446
449
  ] });
447
450
  }, Xn = ({ name: e, onRetry: t }) => {
448
451
  const { labels: n } = D(), r = ye();
449
- return /* @__PURE__ */ O("span", { className: "aqmx-explorer-folder-failed", children: [
452
+ return /* @__PURE__ */ A("span", { className: "aqmx-explorer-folder-failed", children: [
450
453
  /* @__PURE__ */ m("span", { className: "aqmx-explorer-folder-name", children: e }),
451
454
  /* @__PURE__ */ m("span", { id: r, className: "aqmx-explorer-folder-error", children: n.folderLoadFailed }),
452
- /* @__PURE__ */ O(
455
+ /* @__PURE__ */ A(
453
456
  "button",
454
457
  {
455
458
  type: "button",
@@ -458,14 +461,14 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
458
461
  "data-testid": "markdown-explorer-folder-retry",
459
462
  onClick: (o) => {
460
463
  o.stopPropagation();
461
- const i = o.currentTarget, l = i.ownerDocument.activeElement === i ? i.closest('[role="treeitem"]') : null;
464
+ const c = o.currentTarget, l = c.ownerDocument.activeElement === c ? c.closest('[role="treeitem"]') : null;
462
465
  l instanceof HTMLElement && Ye(l), t();
463
466
  },
464
467
  onKeyDown: (o) => {
465
468
  o.key !== "Escape" && o.stopPropagation();
466
469
  },
467
470
  children: [
468
- /* @__PURE__ */ m(Oe, { className: "aqmx-explorer-folder-retry-icon", "aria-hidden": "true" }),
471
+ /* @__PURE__ */ m(Ae, { className: "aqmx-explorer-folder-retry-icon", "aria-hidden": "true" }),
469
472
  /* @__PURE__ */ m("span", { className: "aqmx-explorer-folder-retry-text", children: n.retry })
470
473
  ]
471
474
  }
@@ -477,25 +480,25 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
477
480
  mode: n,
478
481
  sourceId: r,
479
482
  settings: o,
480
- reveal: i,
483
+ reveal: c,
481
484
  openPaths: l,
482
485
  selection: a,
483
486
  onOpenDocument: s,
484
487
  onRevealSource: d,
485
488
  expansion: u,
486
- onShown: c,
489
+ onShown: i,
487
490
  marks: f,
488
491
  claimsHeld: h,
489
492
  expandAll: v,
490
493
  revealCancel: E
491
494
  }) => {
492
- const { trees: S, documents: C, labels: T, locale: k, theme: Z, data: M, config: L, sources: b, reveals: R } = D(), y = be(qe), [P] = q(hn), H = g(null), { rowHeight: de, lineColor: X } = _n(H, Z), { isExpanded: B, toggle: ee, expandMultiple: K, collapseMultiple: ae, expanded: V, isPending: le } = u, { alwaysExpanded: G, sortMode: $, folderPlacement: U } = o, { direct: ue, markDirect: W, unmarkDirect: ce, pruneDirect: me } = f, { running: oe, advance: he } = v, fe = g(null), te = g(null), N = F(() => Mt({ sortMode: $, folderPlacement: U }), [$, U]), Y = F(() => xn(N), [N]), z = w((x) => S.children(r, x), [S, r]), ne = F(() => gn(e), [e]), re = w((x) => !pe(x) && (B(x) || G && !ne.has(x)), [B, G, ne]), Q = g({ shownExpanded: re, isExpanded: B, unloadedFolders: ne, entries: e, childrenOf: z });
495
+ const { trees: S, documents: C, labels: T, locale: k, theme: Z, data: M, config: L, sources: b, reveals: R } = D(), y = be(qe), [O] = q(hn), H = g(null), { rowHeight: de, lineColor: X } = _n(H, Z), { isExpanded: B, toggle: ee, expandMultiple: K, collapseMultiple: ae, expanded: V, isPending: le } = u, { alwaysExpanded: G, sortMode: $, folderPlacement: U } = o, { direct: ue, markDirect: W, unmarkDirect: ce, pruneDirect: me } = f, { running: oe, advance: he } = v, fe = g(null), te = g(null), N = F(() => Mt({ sortMode: $, folderPlacement: U }), [$, U]), Y = F(() => xn(N), [N]), z = w((x) => S.children(r, x), [S, r]), ne = F(() => gn(e), [e]), re = w((x) => !pe(x) && (B(x) || G && !ne.has(x)), [B, G, ne]), Q = g({ shownExpanded: re, isExpanded: B, unloadedFolders: ne, entries: e, childrenOf: z });
493
496
  I(() => {
494
497
  Q.current = { shownExpanded: re, isExpanded: B, unloadedFolders: ne, entries: e, childrenOf: z };
495
498
  }, [re, B, ne, e, z]);
496
499
  const Me = w((x) => {
497
500
  fe.current?.scrollToPath(x, { align: "nearest" }), requestAnimationFrame(() => {
498
- const A = te.current, j = A === null ? void 0 : lt(A, x);
501
+ const P = te.current, j = P === null ? void 0 : lt(P, x);
499
502
  j !== void 0 && Ye(j);
500
503
  });
501
504
  }, []), pt = w(
@@ -509,14 +512,14 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
509
512
  [Me, W, ce, ee]
510
513
  ), Re = w(
511
514
  (x) => {
512
- const A = x.filter((j) => !pe(j));
513
- A.length !== 0 && (ce(A), ae(A));
515
+ const P = x.filter((j) => !pe(j));
516
+ P.length !== 0 && (ce(P), ae(P));
514
517
  },
515
518
  [ce, ae]
516
519
  ), ht = w(
517
520
  (x) => {
518
- const A = x.filter((j) => !pe(j));
519
- A.length !== 0 && (A.length < x.length && A.every((j) => Q.current.shownExpanded(j)) ? Re(A) : K(A));
521
+ const P = x.filter((j) => !pe(j));
522
+ P.length !== 0 && (P.length < x.length && P.every((j) => Q.current.shownExpanded(j)) ? Re(P) : K(P));
520
523
  },
521
524
  [K, Re]
522
525
  ), _e = w(
@@ -530,7 +533,7 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
530
533
  }
531
534
  ),
532
535
  [S, r, W, K]
533
- ), Ie = n === "multi" ? l : zn, { loopFolderName: De } = T, xt = F(() => P(e, { openPaths: Ie, childrenOf: z, renderFailedFolder: _e, loopFolderName: De }), [P, e, Ie, z, _e, De, t]), wt = kt(C, Kn), He = g([]), xe = w(() => {
536
+ ), Ie = n === "multi" ? l : zn, { loopFolderName: De } = T, xt = F(() => O(e, { openPaths: Ie, childrenOf: z, renderFailedFolder: _e, loopFolderName: De }), [O, e, Ie, z, _e, De, t]), wt = kt(C, Kn), He = g([]), xe = w(() => {
534
537
  for (const x of He.current) Q.current.unloadedFolders.has(x) && W(x);
535
538
  }, [W]), { maxDepth: Se } = L.revealDocument, $e = g(d);
536
539
  I(() => {
@@ -538,30 +541,30 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
538
541
  }, [d]);
539
542
  const gt = F(
540
543
  () => ({
541
- ancestors: async (x, A) => {
544
+ ancestors: async (x, P) => {
542
545
  const j = R.take(r, x);
543
546
  if (j !== null) return j;
544
547
  if (!R.mayMove(x)) {
545
- const ie = await M.ancestors(r, x, A);
548
+ const ie = await M.ancestors(r, x, P);
546
549
  return ie.status !== "ok" || ie.ancestors === null || ie.ancestors.length > Se ? null : ie.ancestors;
547
550
  }
548
- const J = await M.reveal(r, x, A);
549
- return J.status !== "ok" || J.source === null || J.ancestors.length > Se ? null : J.source === r ? J.ancestors : (A.aborted || !b.some((ie) => ie.id === J.source) || (R.move(J.source, x, J.ancestors), $e.current(J.source)), null);
551
+ const J = await M.reveal(r, x, P);
552
+ return J.status !== "ok" || J.source === null || J.ancestors.length > Se ? null : J.source === r ? J.ancestors : (P.aborted || !b.some((ie) => ie.id === J.source) || (R.move(J.source, x, J.ancestors), $e.current(J.source)), null);
550
553
  },
551
554
  open: (x) => {
552
555
  He.current = x ?? [], x !== null && (xe(), K([...x]));
553
556
  },
554
- progress: (x, A) => vn(Q.current.entries, x, A, { isShownExpanded: Q.current.shownExpanded, childrenOf: Q.current.childrenOf })
557
+ progress: (x, P) => vn(Q.current.entries, x, P, { isShownExpanded: Q.current.shownExpanded, childrenOf: Q.current.childrenOf })
555
558
  }),
556
559
  [M, r, b, R, Se, xe, K]
557
560
  );
558
561
  _(() => xe(), [xe, ne]);
559
562
  const vt = F(() => [e, t, V], [e, t, V]), bt = w((x) => te.current === null ? Number.POSITIVE_INFINITY : Dn(te.current, x), []);
560
- On({ tree: fe, container: te, path: i.path, chain: i.openFolders ? gt : null, rows: vt, cancel: E, displayed: y, placement: bt });
563
+ An({ tree: fe, container: te, path: c.path, chain: c.openFolders ? gt : null, rows: vt, cancel: E, displayed: y, placement: bt });
561
564
  const Ze = w((x) => ue.has(x), [ue]), we = F(() => wn(e, { isShownExpanded: re, childrenOf: z, compare: N, isDirect: Ze }), [e, re, z, N, Ze, t]), ge = y && h;
562
565
  I(() => {
563
- c(e);
564
- }, [e, c]), I(() => () => c(null), [c]), _(() => S.claimChildren(r, ge ? we.folders : Vn), [S, r, ge, we]), _(() => me(ne), [me, ne]), _(() => {
566
+ i(e);
567
+ }, [e, i]), I(() => () => i(null), [i]), _(() => S.claimChildren(r, ge ? we.folders : Vn), [S, r, ge, we]), _(() => me(ne), [me, ne]), _(() => {
565
568
  ge && oe && he({ entries: e, isShownExpanded: re, childrenOf: z, compare: N, expanded: V, waiting: we.waiting, expansionPending: le });
566
569
  }, [ge, oe, he, e, re, z, N, V, we, le]);
567
570
  const Et = w(
@@ -570,8 +573,8 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
570
573
  },
571
574
  [R, s]
572
575
  ), { onChange: Te } = a, yt = F(
573
- () => Te === null ? void 0 : (x, A) => {
574
- pe(x.absolutePath) || Te({ path: x.absolutePath, name: x.name, selected: A });
576
+ () => Te === null ? void 0 : (x, P) => {
577
+ pe(x.absolutePath) || Te({ path: x.absolutePath, name: x.name, selected: P });
575
578
  },
576
579
  [Te]
577
580
  ), Rt = F(() => new Set(a.items), [a.items]), St = F(
@@ -585,7 +588,7 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
585
588
  }),
586
589
  [T]
587
590
  ), Tt = X === null ? { showTreeLines: !1 } : { showTreeLines: o.lines, lineColor: X };
588
- return /* @__PURE__ */ O("div", { ref: te, className: "aqmx-explorer-tree", "data-testid": "markdown-explorer-tree", ...wt, children: [
591
+ return /* @__PURE__ */ A("div", { ref: te, className: "aqmx-explorer-tree", "data-testid": "markdown-explorer-tree", ...wt, children: [
589
592
  /* @__PURE__ */ m("span", { ref: H, className: "aqmx-explorer-tree-probe", "aria-hidden": "true", [qn]: "" }),
590
593
  /* @__PURE__ */ m(
591
594
  Kt,
@@ -624,68 +627,68 @@ const cn = /* @__PURE__ */ p.forwardRef(sn), qe = Ae(!0), et = "\0loop\0", tt =
624
627
  )
625
628
  ] });
626
629
  }, Yn = ({ pending: e, status: t }) => {
627
- const { labels: n } = D(), r = t.state !== "running", [o, i] = q(0), l = g(!0);
630
+ const { labels: n } = D(), r = t.state !== "running", [o, c] = q(0), l = g(!0);
628
631
  I(() => {
629
632
  const s = l.current;
630
633
  if (l.current = r, !r || e > 0 && !s) {
631
- i(0);
634
+ c(0);
632
635
  return;
633
636
  }
634
637
  if (e > 0) {
635
- i(e);
638
+ c(e);
636
639
  return;
637
640
  }
638
641
  if (o === 0) return;
639
- const d = setTimeout(() => i(0), 0);
642
+ const d = setTimeout(() => c(0), 0);
640
643
  return () => clearTimeout(d);
641
644
  }, [r, e, o]);
642
645
  const a = r && e === 0 ? o : e;
643
- return a === 0 && r ? null : /* @__PURE__ */ O("p", { className: "aqmx-explorer-tree-progress", "data-testid": "markdown-explorer-tree-progress", "data-aqmx-loading": String(a), "data-aqmx-expand-all": t.state, children: [
644
- a > 0 ? /* @__PURE__ */ m(Oe, { className: "aqmx-explorer-tree-progress-icon", "aria-hidden": "true" }) : null,
646
+ return a === 0 && r ? null : /* @__PURE__ */ A("p", { className: "aqmx-explorer-tree-progress", "data-testid": "markdown-explorer-tree-progress", "data-aqmx-loading": String(a), "data-aqmx-expand-all": t.state, children: [
647
+ a > 0 ? /* @__PURE__ */ m(Ae, { className: "aqmx-explorer-tree-progress-icon", "aria-hidden": "true" }) : null,
645
648
  /* @__PURE__ */ m("span", { children: t.state === "running" ? n.expandAllProgress(t.opened, a) : n.foldersLoading(a) })
646
649
  ] });
647
650
  }, Qn = ({ stop: e, opened: t, budget: n }) => {
648
651
  const { labels: r } = D();
649
652
  return /* @__PURE__ */ m("p", { className: "aqmx-explorer-expand-all-stop", "data-testid": "markdown-explorer-expand-all-stop", "data-aqmx-stop": e, children: ot(r, n, e, t) });
650
653
  }, Jn = ({ entries: e, ...t }) => {
651
- const { trees: n } = D(), r = Ee(n.subscribe, n.version, n.version), { sourceId: o } = t, [i] = q(dn), l = F(() => i(e, (a) => n.children(o, a)), [i, e, n, o, r]);
654
+ const { trees: n } = D(), r = Ee(n.subscribe, n.version, n.version), { sourceId: o } = t, [c] = q(dn), l = F(() => c(e, (a) => n.children(o, a)), [c, e, n, o, r]);
652
655
  return l.length === 0 ? /* @__PURE__ */ m(Wn, {}) : /* @__PURE__ */ m(Gn, { entries: l, version: r, ...t });
653
656
  }, er = ({ result: e, onRetry: t, ...n }) => {
654
657
  const { renderTreeFailure: r } = D(), o = be(e);
655
658
  if (o.status === "deferred") return /* @__PURE__ */ m(st, {});
656
659
  if (o.status === "ok") return /* @__PURE__ */ m(Jn, { entries: o.entries, ...n });
657
- const i = r?.(o.failure);
658
- return /* @__PURE__ */ m("div", { className: "aqmx-explorer-tree-message", "data-testid": "markdown-explorer-tree-failure", "data-aqmx-failure": o.failure.reason, children: i !== void 0 ? i : /* @__PURE__ */ m(Nt, { failure: o.failure, alert: !0, onRetry: t, testId: null }) });
660
+ const c = r?.(o.failure);
661
+ return /* @__PURE__ */ m("div", { className: "aqmx-explorer-tree-message", "data-testid": "markdown-explorer-tree-failure", "data-aqmx-failure": o.failure.reason, children: c !== void 0 ? c : /* @__PURE__ */ m(Nt, { failure: o.failure, alert: !0, onRetry: t, testId: null }) });
659
662
  }, tr = ({ onControls: e, ...t }) => {
660
- const { trees: n, storageNamespace: r, labels: o, announcer: i, config: l } = D(), { sourceId: a } = t, s = jt({ storageKey: Wt(r).treeExpansion(a) });
663
+ const { trees: n, storageNamespace: r, labels: o, announcer: c, config: l } = D(), { sourceId: a } = t, s = jt({ storageKey: Wt(r).treeExpansion(a) });
661
664
  Ee(n.subscribe, n.version, n.version);
662
665
  const d = n.read(a), u = w(() => n.retry(a), [n, a]);
663
666
  I(() => n.open(a), [n, a]);
664
- const c = Rn(), { expanded: f, expandMultiple: h, collapseAll: v } = s, [E, S] = q(null), C = E !== f, T = g(f);
667
+ const i = Rn(), { expanded: f, expandMultiple: h, collapseAll: v } = s, [E, S] = q(null), C = E !== f, T = g(f);
665
668
  I(() => {
666
669
  T.current = f;
667
670
  }, [f]);
668
- const k = l.expandAll, Z = w(() => i.announce(o.expandAllStarted), [i, o]), M = w(($) => i.announce(Un(o, k, $)), [i, o, k]), L = kn({ budget: k, expandMultiple: h, onStart: Z, onFinish: M }), { status: b, start: R, end: y, advance: P } = L, H = b.state === "running", de = F(() => ({ running: H, advance: P }), [H, P]), X = g(null), [B, ee] = q(!1), K = w(($) => {
671
+ const k = l.expandAll, Z = w(() => c.announce(o.expandAllStarted), [c, o]), M = w(($) => c.announce(Un(o, k, $)), [c, o, k]), L = kn({ budget: k, expandMultiple: h, onStart: Z, onFinish: M }), { status: b, start: R, end: y, advance: O } = L, H = b.state === "running", de = F(() => ({ running: H, advance: O }), [H, O]), X = g(null), [B, ee] = q(!1), K = w(($) => {
669
672
  X.current = $, ee($ !== null);
670
673
  }, []);
671
674
  _(
672
675
  () => n.subscribeChildrenFailures(($) => {
673
676
  const U = $.sourceId === a && X.current !== null ? nt(X.current, $.path) : null;
674
- U !== null && i.announce({ list: o.foldersLoadFailedNamed, item: U.name });
677
+ U !== null && c.announce({ list: o.foldersLoadFailedNamed, item: U.name });
675
678
  }),
676
- [n, a, i, o]
679
+ [n, a, c, o]
677
680
  );
678
- const { clearDirect: ae } = c, [V, le] = q(0), G = w(() => {
681
+ const { clearDirect: ae } = i, [V, le] = q(0), G = w(() => {
679
682
  le(($) => $ + 1), y(), ae(), S(T.current), v();
680
683
  }, [y, ae, v]);
681
684
  return _(() => {
682
685
  e({ collapseAll: G, expandAll: B ? R : null, expanding: H });
683
686
  }, [e, G, R, B, H]), _(() => () => e(null), [e]), _(() => {
684
687
  B || y();
685
- }, [B, y]), /* @__PURE__ */ O(Ge, { children: [
688
+ }, [B, y]), /* @__PURE__ */ A(Ge, { children: [
686
689
  b.state === "stopped" ? /* @__PURE__ */ m(Qn, { stop: b.stop, opened: b.opened, budget: k }) : null,
687
- /* @__PURE__ */ O("div", { className: "aqmx-explorer-tree-area", children: [
688
- /* @__PURE__ */ m(Qe, { fallback: /* @__PURE__ */ m(st, {}), children: /* @__PURE__ */ m(er, { result: d, onRetry: u, expansion: s, onShown: K, marks: c, claimsHeld: C, expandAll: de, revealCancel: V, ...t }) }),
690
+ /* @__PURE__ */ A("div", { className: "aqmx-explorer-tree-area", children: [
691
+ /* @__PURE__ */ m(Qe, { fallback: /* @__PURE__ */ m(st, {}), children: /* @__PURE__ */ m(er, { result: d, onRetry: u, expansion: s, onShown: K, marks: i, claimsHeld: C, expandAll: de, revealCancel: V, ...t }) }),
689
692
  /* @__PURE__ */ m(Yn, { pending: n.pendingChildren(a), status: b })
690
693
  ] })
691
694
  ] });
@@ -712,38 +715,38 @@ function nr({
712
715
  }));
713
716
  }
714
717
  const ct = /* @__PURE__ */ p.forwardRef(nr), Ue = "markdown-explorer-selection-remove", rr = ({ selection: e, onRemove: t, onClear: n, onOpenSelection: r, onLeave: o }) => {
715
- const { labels: i } = D(), l = ye(), a = g(null), s = [...e], d = (c, f) => {
718
+ const { labels: c } = D(), l = ye(), a = g(null), s = [...e], d = (i, f) => {
716
719
  if (f.ownerDocument.activeElement === f) {
717
720
  const h = a.current === null ? [] : [...a.current.querySelectorAll(`[data-testid="${Ue}"]`)], v = h.indexOf(f), E = [h[v + 1], h[v - 1]].find((S) => S !== void 0);
718
721
  E === void 0 ? o() : E.focus();
719
722
  }
720
- t(c);
723
+ t(i);
721
724
  }, u = () => {
722
- const c = a.current;
723
- c !== null && c.contains(c.ownerDocument.activeElement) && o(), n();
725
+ const i = a.current;
726
+ i !== null && i.contains(i.ownerDocument.activeElement) && o(), n();
724
727
  };
725
- return /* @__PURE__ */ O("section", { ref: a, className: "aqmx-explorer-tray", "aria-labelledby": l, "data-testid": "markdown-explorer-selection-tray", children: [
726
- /* @__PURE__ */ O("div", { className: "aqmx-explorer-tray-header", children: [
727
- /* @__PURE__ */ m("p", { id: l, className: "aqmx-explorer-tray-title", children: i.selectionTitle(s.length) }),
728
- /* @__PURE__ */ m("button", { type: "button", className: "aqmx-explorer-tray-button", "data-testid": "markdown-explorer-selection-clear", onClick: u, children: i.clearSelection })
728
+ return /* @__PURE__ */ A("section", { ref: a, className: "aqmx-explorer-tray", "aria-labelledby": l, "data-testid": "markdown-explorer-selection-tray", children: [
729
+ /* @__PURE__ */ A("div", { className: "aqmx-explorer-tray-header", children: [
730
+ /* @__PURE__ */ m("p", { id: l, className: "aqmx-explorer-tray-title", children: c.selectionTitle(s.length) }),
731
+ /* @__PURE__ */ m("button", { type: "button", className: "aqmx-explorer-tray-button", "data-testid": "markdown-explorer-selection-clear", onClick: u, children: c.clearSelection })
729
732
  ] }),
730
- /* @__PURE__ */ m("ul", { className: "aqmx-explorer-tray-list", children: s.map(([c, f]) => /* @__PURE__ */ O("li", { className: "aqmx-explorer-tray-item", children: [
731
- /* @__PURE__ */ m("span", { className: "aqmx-explorer-tray-name", title: c, children: f }),
733
+ /* @__PURE__ */ m("ul", { className: "aqmx-explorer-tray-list", children: s.map(([i, f]) => /* @__PURE__ */ A("li", { className: "aqmx-explorer-tray-item", children: [
734
+ /* @__PURE__ */ m("span", { className: "aqmx-explorer-tray-name", title: i, children: f }),
732
735
  /* @__PURE__ */ m(
733
736
  "button",
734
737
  {
735
738
  type: "button",
736
739
  className: "aqmx-icon-button aqmx-explorer-tray-remove",
737
- "aria-label": i.removeFromSelection(f),
738
- title: i.removeFromSelection(f),
740
+ "aria-label": c.removeFromSelection(f),
741
+ title: c.removeFromSelection(f),
739
742
  "data-testid": Ue,
740
- "data-aqmx-path": c,
741
- onClick: (h) => d(c, h.currentTarget),
743
+ "data-aqmx-path": i,
744
+ onClick: (h) => d(i, h.currentTarget),
742
745
  children: /* @__PURE__ */ m(ct, { "aria-hidden": "true" })
743
746
  }
744
747
  )
745
- ] }, c)) }),
746
- r === void 0 ? null : /* @__PURE__ */ m("button", { type: "button", className: "aqmx-explorer-tray-open", "data-testid": "markdown-explorer-selection-open", onClick: () => r(s.map(([c]) => c)), children: i.openSelectionInMulti(s.length) })
748
+ ] }, i)) }),
749
+ r === void 0 ? null : /* @__PURE__ */ m("button", { type: "button", className: "aqmx-explorer-tray-open", "data-testid": "markdown-explorer-selection-open", onClick: () => r(s.map(([i]) => i)), children: c.openSelectionInMulti(s.length) })
747
750
  ] });
748
751
  }, ke = /* @__PURE__ */ new Map(), ar = (e, t) => {
749
752
  if (t.selected === e.has(t.path)) return e;
@@ -753,7 +756,7 @@ const ct = /* @__PURE__ */ p.forwardRef(nr), Ue = "markdown-explorer-selection-r
753
756
  if (!e.has(t)) return e;
754
757
  const n = new Map(e);
755
758
  return n.delete(t), n;
756
- }, it = Ae(null), or = (e) => {
759
+ }, it = Pe(null), or = (e) => {
757
760
  const t = be(it);
758
761
  I(() => {
759
762
  if (t !== null)
@@ -1000,7 +1003,7 @@ function kr({
1000
1003
  }));
1001
1004
  }
1002
1005
  const Lr = /* @__PURE__ */ p.forwardRef(kr);
1003
- function Or({
1006
+ function Ar({
1004
1007
  title: e,
1005
1008
  titleId: t,
1006
1009
  ...n
@@ -1019,7 +1022,7 @@ function Or({
1019
1022
  d: "M5.625 3.75a2.625 2.625 0 1 0 0 5.25h12.75a2.625 2.625 0 0 0 0-5.25H5.625ZM3.75 11.25a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75ZM3 15.75a.75.75 0 0 1 .75-.75h16.5a.75.75 0 0 1 0 1.5H3.75a.75.75 0 0 1-.75-.75ZM3.75 18.75a.75.75 0 0 0 0 1.5h16.5a.75.75 0 0 0 0-1.5H3.75Z"
1020
1023
  }));
1021
1024
  }
1022
- const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1025
+ const Or = /* @__PURE__ */ p.forwardRef(Ar), Pr = Object.freeze({
1023
1026
  sortMode: dr,
1024
1027
  folderPlacement: Sr,
1025
1028
  selectionMode: mr,
@@ -1028,7 +1031,7 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1028
1031
  alwaysExpanded: cr,
1029
1032
  revealDocument: Lt,
1030
1033
  removeRootIndent: pr,
1031
- lines: Pr,
1034
+ lines: Or,
1032
1035
  expandIcons: xr,
1033
1036
  directoryIcons: Nr,
1034
1037
  fileIcons: yr
@@ -1036,25 +1039,25 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1036
1039
  const n = e[t.labelKey];
1037
1040
  if (typeof n != "string") throw new TypeError(`[markdown-explorer] the tree setting ${t.key} must name a string label; labels.${t.labelKey} is a ${typeof n}`);
1038
1041
  return n;
1039
- }, qr = ({ id: e, settings: t, descriptors: n, onAdvance: r, onClose: o, ref: i }) => {
1042
+ }, qr = ({ id: e, settings: t, descriptors: n, onAdvance: r, onClose: o, ref: c }) => {
1040
1043
  const { labels: l } = D(), a = g([]);
1041
1044
  _(() => {
1042
1045
  a.current[0]?.focus();
1043
1046
  }, []);
1044
1047
  const s = w(
1045
1048
  (u) => {
1046
- const c = n.length;
1047
- a.current[(u % c + c) % c]?.focus();
1049
+ const i = n.length;
1050
+ a.current[(u % i + i) % i]?.focus();
1048
1051
  },
1049
1052
  [n.length]
1050
1053
  ), d = w(
1051
- (u, c) => {
1054
+ (u, i) => {
1052
1055
  switch (u.key) {
1053
1056
  case "ArrowDown":
1054
- u.preventDefault(), s(c + 1);
1057
+ u.preventDefault(), s(i + 1);
1055
1058
  break;
1056
1059
  case "ArrowUp":
1057
- u.preventDefault(), s(c - 1);
1060
+ u.preventDefault(), s(i - 1);
1058
1061
  break;
1059
1062
  case "Home":
1060
1063
  u.preventDefault(), s(0);
@@ -1063,7 +1066,7 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1063
1066
  u.preventDefault(), s(n.length - 1);
1064
1067
  break;
1065
1068
  case "Escape":
1066
- Pe(u), o();
1069
+ Oe(u), o();
1067
1070
  break;
1068
1071
  case "Tab":
1069
1072
  o();
@@ -1072,13 +1075,13 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1072
1075
  },
1073
1076
  [n.length, s, o]
1074
1077
  );
1075
- return /* @__PURE__ */ m("div", { ref: i, id: e, role: "menu", "aria-label": l.treeSettings, className: "aqmx-explorer-menu", "data-testid": "markdown-explorer-tree-settings-menu", children: n.map((u, c) => {
1076
- const f = Ar[u.key], h = dt(l, u), v = Je(l, t, u.key), E = t[u.key], S = typeof E == "boolean" ? { role: "menuitemcheckbox", "aria-checked": E, "aria-label": h } : { role: "menuitem", "aria-label": `${h}: ${v}` };
1077
- return /* @__PURE__ */ O(
1078
+ return /* @__PURE__ */ m("div", { ref: c, id: e, role: "menu", "aria-label": l.treeSettings, className: "aqmx-explorer-menu", "data-testid": "markdown-explorer-tree-settings-menu", children: n.map((u, i) => {
1079
+ const f = Pr[u.key], h = dt(l, u), v = Je(l, t, u.key), E = t[u.key], S = typeof E == "boolean" ? { role: "menuitemcheckbox", "aria-checked": E, "aria-label": h } : { role: "menuitem", "aria-label": `${h}: ${v}` };
1080
+ return /* @__PURE__ */ A(
1078
1081
  "button",
1079
1082
  {
1080
1083
  ref: (C) => {
1081
- a.current[c] = C;
1084
+ a.current[i] = C;
1082
1085
  },
1083
1086
  type: "button",
1084
1087
  tabIndex: -1,
@@ -1088,7 +1091,7 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1088
1091
  "data-testid": "markdown-explorer-tree-settings-item",
1089
1092
  "data-aqmx-setting": u.key,
1090
1093
  onClick: () => r(u),
1091
- onKeyDown: (C) => d(C, c),
1094
+ onKeyDown: (C) => d(C, i),
1092
1095
  children: [
1093
1096
  /* @__PURE__ */ m(f, { className: "aqmx-explorer-menu-icon", "aria-hidden": "true" }),
1094
1097
  /* @__PURE__ */ m("span", { className: "aqmx-explorer-menu-name", children: h }),
@@ -1099,18 +1102,18 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1099
1102
  );
1100
1103
  }) });
1101
1104
  }, Cr = ({ settings: e, descriptors: t, onAdvance: n }) => {
1102
- const { labels: r, announcer: o } = D(), [i, l] = q(!1), a = g(null), s = g(null), d = g(null), u = ye(), c = w(() => {
1105
+ const { labels: r, announcer: o } = D(), [c, l] = q(!1), a = g(null), s = g(null), d = g(null), u = ye(), i = w(() => {
1103
1106
  a.current?.focus(), l(!1);
1104
1107
  }, []);
1105
1108
  _(() => {
1106
- if (!i) return;
1109
+ if (!c) return;
1107
1110
  const v = (E) => {
1108
1111
  E.target instanceof Node && (a.current?.contains(E.target) === !0 || s.current?.contains(E.target) === !0) || (l(!1), d.current !== null && window.clearTimeout(d.current), d.current = window.setTimeout(() => {
1109
1112
  d.current = null, (document.activeElement === null || document.activeElement === document.body) && a.current?.focus();
1110
1113
  }, 0));
1111
1114
  };
1112
1115
  return document.addEventListener("pointerdown", v), () => document.removeEventListener("pointerdown", v);
1113
- }, [i]), _(
1116
+ }, [c]), _(
1114
1117
  () => () => {
1115
1118
  d.current !== null && window.clearTimeout(d.current);
1116
1119
  },
@@ -1118,9 +1121,9 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1118
1121
  );
1119
1122
  const f = w(
1120
1123
  (v) => {
1121
- v.key !== "Escape" || !i || (Pe(v), c());
1124
+ v.key !== "Escape" || !c || (Oe(v), i());
1122
1125
  },
1123
- [i, c]
1126
+ [c, i]
1124
1127
  ), h = w(
1125
1128
  (v) => {
1126
1129
  const E = n(v.key);
@@ -1136,8 +1139,8 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1136
1139
  type: "button",
1137
1140
  className: "aqmx-icon-button",
1138
1141
  "aria-haspopup": "menu",
1139
- "aria-expanded": i,
1140
- "aria-controls": i ? u : void 0,
1142
+ "aria-expanded": c,
1143
+ "aria-controls": c ? u : void 0,
1141
1144
  "aria-label": r.treeSettings,
1142
1145
  title: r.treeSettings,
1143
1146
  "data-testid": "markdown-explorer-tree-settings",
@@ -1146,13 +1149,13 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1146
1149
  children: /* @__PURE__ */ m(gr, { "aria-hidden": "true" })
1147
1150
  }
1148
1151
  ),
1149
- menu: i ? /* @__PURE__ */ m(qr, { ref: s, id: u, settings: e, descriptors: t, onAdvance: h, onClose: c }) : null
1152
+ menu: c ? /* @__PURE__ */ m(qr, { ref: s, id: u, settings: e, descriptors: t, onAdvance: h, onClose: i }) : null
1150
1153
  };
1151
1154
  }, Fr = () => {
1152
1155
  const { treeSettings: e } = D();
1153
1156
  return { settings: Ee(e.subscribe, e.getSnapshot, e.getServerSnapshot), advance: e.advance };
1154
1157
  }, We = /* @__PURE__ */ new Set(), Mr = '[role="tree"] [role="treeitem"][tabindex="0"]', _r = "[data-directory-tree-tab-stop]", oa = (e) => {
1155
- const { mode: t, sourceId: n, currentPath: r, openPaths: o, onOpenDocument: i, onSourceChange: l, onRevealSource: a, viewSwitch: s } = e, { labels: d, sources: u, trees: c, documents: f, announcer: h, reveals: v } = D(), { settings: E, advance: S } = Fr(), C = F(() => _t(t === "tree"), [t]), T = t === "tree" && E.selectionMode === "multiple";
1158
+ const { mode: t, sourceId: n, currentPath: r, openPaths: o, onOpenDocument: c, onSourceChange: l, onRevealSource: a, viewSwitch: s } = e, { labels: d, sources: u, trees: i, documents: f, announcer: h, reveals: v } = D(), { settings: E, advance: S } = Fr(), C = F(() => _t(t === "tree"), [t]), T = t === "tree" && E.selectionMode === "multiple";
1156
1159
  or(T);
1157
1160
  const k = e.mode === "tree" ? e.tray.onGatheredChange : null, Z = e.mode === "tree" ? e.onOpenSelection : void 0, M = e.mode === "tree" && T ? e.tray.gathered : ke, L = w(
1158
1161
  (N) => {
@@ -1160,7 +1163,7 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1160
1163
  return Y.selectionMode !== "multiple" && k?.(ke), Y;
1161
1164
  },
1162
1165
  [S, k]
1163
- ), b = Cr({ settings: E, descriptors: C, onAdvance: L }), R = w((N) => k?.((Y) => ar(Y, N)), [k]), y = w((N) => k?.((Y) => lr(Y, N)), [k]), P = w(() => k?.(ke), [k]), H = g(null), de = w(() => {
1166
+ ), b = Cr({ settings: E, descriptors: C, onAdvance: L }), R = w((N) => k?.((Y) => ar(Y, N)), [k]), y = w((N) => k?.((Y) => lr(Y, N)), [k]), O = w(() => k?.(ke), [k]), H = g(null), de = w(() => {
1164
1167
  const N = H.current;
1165
1168
  if (N === null) return;
1166
1169
  [Mr, _r, '[data-testid="markdown-explorer-tree-settings"]'].map((z) => N.querySelector(z)).find((z) => z !== null)?.focus();
@@ -1183,20 +1186,20 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1183
1186
  if (!W.current) {
1184
1187
  W.current = !0, $(!0), ue(null);
1185
1188
  try {
1186
- const N = await c.refresh(n);
1189
+ const N = await i.refresh(n);
1187
1190
  if (N.status === "superseded") return;
1188
1191
  f.invalidate(), N.status === "failed" ? ue({ sourceId: n, failure: N.failure }) : h.announce(d.treeRefreshed);
1189
1192
  } finally {
1190
1193
  W.current = !1, $(!1);
1191
1194
  }
1192
1195
  }
1193
- }, [c, f, n, h, d]), me = V === null ? null : V.expandAll, oe = V?.expanding === !0, he = u.find((N) => N.id === n), fe = s.target === "multi" ? ln : rn, te = s.target === "multi" ? d.switchToMulti : d.switchToTree;
1194
- return /* @__PURE__ */ O("nav", { ref: H, "aria-label": d.explorerRegion, className: "aqmx-explorer", "data-testid": "markdown-explorer-explorer", "data-aqmx-mode": t, children: [
1195
- /* @__PURE__ */ O("div", { className: "aqmx-explorer-header", children: [
1196
+ }, [i, f, n, h, d]), me = V === null ? null : V.expandAll, oe = V?.expanding === !0, he = u.find((N) => N.id === n), fe = s.target === "multi" ? ln : rn, te = s.target === "multi" ? d.switchToMulti : d.switchToTree;
1197
+ return /* @__PURE__ */ A("nav", { ref: H, "aria-label": d.explorerRegion, className: "aqmx-explorer", "data-testid": "markdown-explorer-explorer", "data-aqmx-mode": t, children: [
1198
+ /* @__PURE__ */ A("div", { className: "aqmx-explorer-header", children: [
1196
1199
  u.length > 1 ? /* @__PURE__ */ m("select", { className: "aqmx-explorer-source", "aria-label": d.sourceLabel, title: he?.label, value: n, onChange: (N) => ae(N.currentTarget.value), "data-testid": "markdown-explorer-source-select", children: u.map((N) => /* @__PURE__ */ m("option", { value: N.id, children: N.label }, N.id)) }) : null,
1197
- /* @__PURE__ */ O("div", { className: "aqmx-explorer-actions", children: [
1198
- /* @__PURE__ */ m(Ot, { to: s.href, navigation: "switch-view", className: "aqmx-icon-button", "aria-label": te, title: te, "data-testid": "markdown-explorer-view-switch", "data-aqmx-target": s.target, children: /* @__PURE__ */ m(fe, { "aria-hidden": "true" }) }),
1199
- /* @__PURE__ */ O(
1200
+ /* @__PURE__ */ A("div", { className: "aqmx-explorer-actions", children: [
1201
+ /* @__PURE__ */ m(At, { to: s.href, navigation: "switch-view", className: "aqmx-icon-button", "aria-label": te, title: te, "data-testid": "markdown-explorer-view-switch", "data-aqmx-target": s.target, children: /* @__PURE__ */ m(fe, { "aria-hidden": "true" }) }),
1202
+ /* @__PURE__ */ A(
1200
1203
  "button",
1201
1204
  {
1202
1205
  type: "button",
@@ -1210,7 +1213,7 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1210
1213
  ce();
1211
1214
  },
1212
1215
  children: [
1213
- /* @__PURE__ */ m(Oe, { "aria-hidden": "true" }),
1216
+ /* @__PURE__ */ m(Ae, { "aria-hidden": "true" }),
1214
1217
  /* @__PURE__ */ m("span", { children: d.refreshTreeLabel })
1215
1218
  ]
1216
1219
  }
@@ -1234,11 +1237,11 @@ const Pr = /* @__PURE__ */ p.forwardRef(Or), Ar = Object.freeze({
1234
1237
  b.trigger
1235
1238
  ] })
1236
1239
  ] }),
1237
- /* @__PURE__ */ O("div", { className: "aqmx-explorer-body", "data-aqmx-explorer-body": "", children: [
1238
- U !== null && U.sourceId === n ? /* @__PURE__ */ m("p", { role: "alert", className: "aqmx-explorer-refresh-failure", "data-testid": "markdown-explorer-refresh-failure", "data-aqmx-failure": U.failure.reason, children: d.treeRefreshFailed(Pt(d, U.failure.reason)) }) : null,
1240
+ /* @__PURE__ */ A("div", { className: "aqmx-explorer-body", "data-aqmx-explorer-body": "", children: [
1241
+ U !== null && U.sourceId === n ? /* @__PURE__ */ m("p", { role: "alert", className: "aqmx-explorer-refresh-failure", "data-testid": "markdown-explorer-refresh-failure", "data-aqmx-failure": U.failure.reason, children: d.treeRefreshFailed(Ot(d, U.failure.reason)) }) : null,
1239
1242
  /* @__PURE__ */ m(Qe, { fallback: null, children: /* @__PURE__ */ m(on, {}) }),
1240
- /* @__PURE__ */ m(tr, { mode: t, sourceId: n, settings: E, reveal: K, openPaths: o, selection: ee, onOpenDocument: i, onRevealSource: a, onControls: le }, n),
1241
- T && M.size > 0 ? /* @__PURE__ */ m(rr, { selection: M, onRemove: y, onClear: P, onOpenSelection: Z, onLeave: de }) : null,
1243
+ /* @__PURE__ */ m(tr, { mode: t, sourceId: n, settings: E, reveal: K, openPaths: o, selection: ee, onOpenDocument: c, onRevealSource: a, onControls: le }, n),
1244
+ T && M.size > 0 ? /* @__PURE__ */ m(rr, { selection: M, onRemove: y, onClear: O, onOpenSelection: Z, onLeave: de }) : null,
1242
1245
  b.menu
1243
1246
  ] })
1244
1247
  ] });
@@ -1268,8 +1271,8 @@ function Zr({
1268
1271
  }));
1269
1272
  }
1270
1273
  const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t, covered: n, onNoticeSlotChange: r, dismissals: o }) => {
1271
- const { labels: i } = D(), l = Yt(), { location: a } = At(), [s, d] = q(!1), [u, c] = q({ navigated: l, source: a.source }), [f, h] = q(!1);
1272
- u.navigated !== l && (c({ navigated: l, source: a.source }), u.source === a.source && !f && d(!1));
1274
+ const { labels: c } = D(), l = Yt(), { location: a } = Pt(), [s, d] = q(!1), [u, i] = q({ navigated: l, source: a.source }), [f, h] = q(!1);
1275
+ u.navigated !== l && (i({ navigated: l, source: a.source }), u.source === a.source && !f && d(!1));
1273
1276
  const [v, E] = q(o);
1274
1277
  v !== o && (E(o), d(!1));
1275
1278
  const S = g(null), C = g(null), T = g(null), k = g(!1), Z = ye();
@@ -1278,30 +1281,30 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1278
1281
  y !== null && (s && !y.open ? (y.showModal(), C.current?.focus()) : !s && y.open && (y.close(), t.current?.focus()), r(s ? T.current : null));
1279
1282
  }, [s, t, r]), I(() => () => r(null), [r]);
1280
1283
  const M = w((y) => {
1281
- y.key !== "Escape" || y.defaultPrevented || (Pe(y), d(!1));
1284
+ y.key !== "Escape" || y.defaultPrevented || (Oe(y), d(!1));
1282
1285
  }, []), L = w((y) => {
1283
1286
  k.current = y.target === y.currentTarget;
1284
1287
  }, []), b = w((y) => {
1285
- const P = k.current;
1286
- k.current = !1, P && y.target === y.currentTarget && d(!1);
1288
+ const O = k.current;
1289
+ k.current = !1, O && y.target === y.currentTarget && d(!1);
1287
1290
  }, []), R = w(() => {
1288
1291
  d(!1);
1289
1292
  }, []);
1290
- return /* @__PURE__ */ O(Ge, { children: [
1291
- /* @__PURE__ */ m("div", { className: "aqmx-sheet-bar", inert: n, children: /* @__PURE__ */ O("button", { ref: t, type: "button", className: "aqmx-sheet-toggle", "aria-haspopup": "dialog", "aria-expanded": s, "aria-controls": Z, "data-testid": "markdown-explorer-sheet-toggle", onClick: () => d(!0), children: [
1293
+ return /* @__PURE__ */ A(Ge, { children: [
1294
+ /* @__PURE__ */ m("div", { className: "aqmx-sheet-bar", inert: n, children: /* @__PURE__ */ A("button", { ref: t, type: "button", className: "aqmx-sheet-toggle", "aria-haspopup": "dialog", "aria-expanded": s, "aria-controls": Z, "data-testid": "markdown-explorer-sheet-toggle", onClick: () => d(!0), children: [
1292
1295
  /* @__PURE__ */ m(Br, { "aria-hidden": "true" }),
1293
- /* @__PURE__ */ m("span", { children: i.showExplorer })
1296
+ /* @__PURE__ */ m("span", { children: c.showExplorer })
1294
1297
  ] }) }),
1295
- /* @__PURE__ */ m("dialog", { ref: S, id: Z, className: "aqmx-sheet", "aria-label": i.explorerRegion, "data-testid": "markdown-explorer-sheet", onKeyDown: M, onPointerDown: L, onClick: b, onClose: R, children: /* @__PURE__ */ O("div", { className: "aqmx-sheet-panel", children: [
1296
- /* @__PURE__ */ O("div", { className: "aqmx-sheet-header", children: [
1298
+ /* @__PURE__ */ m("dialog", { ref: S, id: Z, className: "aqmx-sheet", "aria-label": c.explorerRegion, "data-testid": "markdown-explorer-sheet", onKeyDown: M, onPointerDown: L, onClick: b, onClose: R, children: /* @__PURE__ */ A("div", { className: "aqmx-sheet-panel", children: [
1299
+ /* @__PURE__ */ A("div", { className: "aqmx-sheet-header", children: [
1297
1300
  /* @__PURE__ */ m("div", { ref: T, className: "aqmx-sheet-notice-slot" }),
1298
- /* @__PURE__ */ m("button", { ref: C, type: "button", className: "aqmx-sheet-close", "aria-label": i.hideExplorer, title: i.hideExplorer, "data-testid": "markdown-explorer-sheet-close", onClick: () => d(!1), children: /* @__PURE__ */ m(ct, { "aria-hidden": "true" }) })
1301
+ /* @__PURE__ */ m("button", { ref: C, type: "button", className: "aqmx-sheet-close", "aria-label": c.hideExplorer, title: c.hideExplorer, "data-testid": "markdown-explorer-sheet-close", onClick: () => d(!1), children: /* @__PURE__ */ m(ct, { "aria-hidden": "true" }) })
1299
1302
  ] }),
1300
1303
  /* @__PURE__ */ m("div", { className: "aqmx-sheet-body", children: /* @__PURE__ */ m(qe, { value: s, children: /* @__PURE__ */ m(it, { value: h, children: e }) }) }),
1301
1304
  /* @__PURE__ */ m(qt, { holds: s, testId: "markdown-explorer-sheet-announcer" })
1302
1305
  ] }) })
1303
1306
  ] });
1304
- }, Vr = Ae(null), Ce = "aqmx-explorer", mt = "aqmx-content", Fe = '[role="tree"] [role="treeitem"]', jr = `${Fe}[tabindex="0"]`, Kr = "[data-directory-tree-tab-stop]", Ur = (e, t) => {
1307
+ }, Vr = Pe(null), Ce = "aqmx-explorer", mt = "aqmx-content", Fe = '[role="tree"] [role="treeitem"]', jr = `${Fe}[tabindex="0"]`, Kr = "[data-directory-tree-tab-stop]", Ur = (e, t) => {
1305
1308
  for (const n of e.querySelectorAll(`[data-panel-id="${Ce}"] ${Fe}`)) if (n.getAttribute(se) === t) return n;
1306
1309
  return null;
1307
1310
  }, Xe = (e, t) => ({
@@ -1310,32 +1313,32 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1310
1313
  }), Wr = (e, t) => {
1311
1314
  const [n, r] = q(() => Xe(0, 0));
1312
1315
  return I(() => {
1313
- const o = e.current, i = t.current;
1314
- if (o === null || i === null) throw new Error("[markdown-explorer] the split frame is not mounted");
1315
- const l = { frame: o.getBoundingClientRect().width, rem: i.getBoundingClientRect().width }, a = () => {
1316
+ const o = e.current, c = t.current;
1317
+ if (o === null || c === null) throw new Error("[markdown-explorer] the split frame is not mounted");
1318
+ const l = { frame: o.getBoundingClientRect().width, rem: c.getBoundingClientRect().width }, a = () => {
1316
1319
  const d = Xe(l.frame, l.rem);
1317
1320
  r((u) => u.inlineSize === d.inlineSize && u.rootFontPixels === d.rootFontPixels ? u : d);
1318
1321
  };
1319
1322
  a();
1320
1323
  const s = new ResizeObserver((d) => {
1321
1324
  for (const u of d) {
1322
- const [c] = u.borderBoxSize;
1323
- c !== void 0 && (u.target === o && (l.frame = c.inlineSize), u.target === i && (l.rem = c.inlineSize));
1325
+ const [i] = u.borderBoxSize;
1326
+ i !== void 0 && (u.target === o && (l.frame = i.inlineSize), u.target === c && (l.rem = i.inlineSize));
1324
1327
  }
1325
1328
  a();
1326
1329
  });
1327
- return s.observe(o), s.observe(i), () => s.disconnect();
1330
+ return s.observe(o), s.observe(c), () => s.disconnect();
1328
1331
  }, [e, t]), n;
1329
1332
  }, ft = (e) => `aqmx-split-handle-${e}`, Xr = (e, { frameRef: t, sheetToggleRef: n, handleId: r }) => {
1330
- const o = g(!1), i = g(null), l = g(!1);
1333
+ const o = g(!1), c = g(null), l = g(!1);
1331
1334
  I(() => {
1332
1335
  const s = t.current;
1333
1336
  if (s === null) throw new Error("[markdown-explorer] the split frame is not mounted");
1334
- const d = (c) => {
1335
- const f = c.target instanceof Element ? c.target : null;
1336
- o.current = f !== null && f.closest(`[data-panel-id="${mt}"]`) === null, !l.current && (i.current = f?.closest(`${Fe}[${se}]`)?.getAttribute(se) ?? null);
1337
- }, u = (c) => {
1338
- c.relatedTarget instanceof Node && !s.contains(c.relatedTarget) && (o.current = !1);
1337
+ const d = (i) => {
1338
+ const f = i.target instanceof Element ? i.target : null;
1339
+ o.current = f !== null && f.closest(`[data-panel-id="${mt}"]`) === null, !l.current && (c.current = f?.closest(`${Fe}[${se}]`)?.getAttribute(se) ?? null);
1340
+ }, u = (i) => {
1341
+ i.relatedTarget instanceof Node && !s.contains(i.relatedTarget) && (o.current = !1);
1339
1342
  };
1340
1343
  return s.addEventListener("focusin", d), s.addEventListener("focusout", u), () => {
1341
1344
  s.removeEventListener("focusin", d), s.removeEventListener("focusout", u);
@@ -1348,8 +1351,8 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1348
1351
  const s = t.current;
1349
1352
  if (s === null || !o.current) return;
1350
1353
  const d = (u) => {
1351
- const { activeElement: c, body: f } = s.ownerDocument;
1352
- if (c !== null && c !== f) return;
1354
+ const { activeElement: i, body: f } = s.ownerDocument;
1355
+ if (i !== null && i !== f) return;
1353
1356
  const h = u.find((v) => v !== null);
1354
1357
  if (h != null) {
1355
1358
  l.current = !0;
@@ -1366,21 +1369,21 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1366
1369
  }
1367
1370
  queueMicrotask(() => {
1368
1371
  if (a.current !== e || !o.current) return;
1369
- const u = i.current, c = `[data-panel-id="${Ce}"]`;
1372
+ const u = c.current, i = `[data-panel-id="${Ce}"]`;
1370
1373
  d([
1371
1374
  u === null ? null : Ur(s, u),
1372
- s.querySelector(`${c} ${jr}`),
1373
- s.querySelector(`${c} ${Kr}`),
1375
+ s.querySelector(`${i} ${jr}`),
1376
+ s.querySelector(`${i} ${Kr}`),
1374
1377
  s.querySelector(`[data-resize-handle-id="${r}"]`)
1375
1378
  ]);
1376
1379
  });
1377
1380
  }, [e, t, n, r]);
1378
- }, sa = ({ view: e, explorer: t, content: n, contentCoversPage: r = !1, sheetDismissals: o = 0, onDraggingChange: i }) => {
1379
- const l = g(null), [a, s] = q(null), d = g(null), u = g(null), { inlineSize: c, rootFontPixels: f } = Wr(l, d), h = c !== null && c < It(f);
1380
- return Xr(h, { frameRef: l, sheetToggleRef: u, handleId: ft(e) }), /* @__PURE__ */ O("div", { ref: l, className: "aqmx-split-frame", "data-aqmx-explorer-mode": h ? "sheet" : "split", children: [
1381
+ }, sa = ({ view: e, explorer: t, content: n, contentCoversPage: r = !1, sheetDismissals: o = 0, onDraggingChange: c }) => {
1382
+ const l = g(null), [a, s] = q(null), d = g(null), u = g(null), { inlineSize: i, rootFontPixels: f } = Wr(l, d), h = i !== null && i < It(f);
1383
+ return Xr(h, { frameRef: l, sheetToggleRef: u, handleId: ft(e) }), /* @__PURE__ */ A("div", { ref: l, className: "aqmx-split-frame", "data-aqmx-explorer-mode": h ? "sheet" : "split", children: [
1381
1384
  /* @__PURE__ */ m("span", { ref: d, className: "aqmx-rem-probe", "aria-hidden": "true", "data-aqmx-rem-probe": "" }),
1382
1385
  h ? /* @__PURE__ */ m(zr, { explorer: t, toggleRef: u, covered: r, onNoticeSlotChange: s, dismissals: o }) : null,
1383
- /* @__PURE__ */ m(Vr, { value: h ? a : null, children: /* @__PURE__ */ m(Gr, { view: e, sheet: h, explorer: t, content: n, contentCoversPage: r, onDraggingChange: i, explorerMinPixels: Dt(f) }) })
1386
+ /* @__PURE__ */ m(Vr, { value: h ? a : null, children: /* @__PURE__ */ m(Gr, { view: e, sheet: h, explorer: t, content: n, contentCoversPage: r, onDraggingChange: c, explorerMinPixels: Dt(f) }) })
1384
1387
  ] });
1385
1388
  }, Gr = ({
1386
1389
  view: e,
@@ -1388,19 +1391,19 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1388
1391
  explorer: n,
1389
1392
  content: r,
1390
1393
  contentCoversPage: o,
1391
- onDraggingChange: i,
1394
+ onDraggingChange: c,
1392
1395
  explorerMinPixels: l
1393
1396
  }) => {
1394
- const { viewSettings: a, labels: s } = D(), u = Ct((b) => e === "tree" ? b.treeExplorer : b.multiExplorer) ?? (e === "tree" ? $t : Zt), c = g(null), f = g(null), h = g(!1), v = g(!1), [E, S] = q(!1), C = g(i);
1397
+ const { viewSettings: a, labels: s } = D(), u = Ct((b) => e === "tree" ? b.treeExplorer : b.multiExplorer) ?? (e === "tree" ? $t : Zt), i = g(null), f = g(null), h = g(!1), v = g(!1), [E, S] = q(!1), C = g(c);
1395
1398
  I(() => {
1396
- C.current = i;
1397
- }, [i]);
1399
+ C.current = c;
1400
+ }, [c]);
1398
1401
  const T = w(() => {
1399
- const b = c.current;
1402
+ const b = i.current;
1400
1403
  if (b === null || b.length !== 2) return;
1401
- const [R = 0, y = 0] = b, P = R + y;
1402
- if (P <= 0 || R <= 0) return;
1403
- const H = Math.min(Be, R / P * 100);
1404
+ const [R = 0, y = 0] = b, O = R + y;
1405
+ if (O <= 0 || R <= 0) return;
1406
+ const H = Math.min(Be, R / O * 100);
1404
1407
  a.update(e === "tree" ? { treeExplorer: H } : { multiExplorer: H });
1405
1408
  }, [a, e]), k = w(() => {
1406
1409
  f.current !== null && clearTimeout(f.current), f.current = setTimeout(() => {
@@ -1415,22 +1418,22 @@ const Br = /* @__PURE__ */ p.forwardRef(Zr), zr = ({ explorer: e, toggleRef: t,
1415
1418
  );
1416
1419
  const Z = $r(), M = w(
1417
1420
  (b, R) => {
1418
- c.current = b;
1419
- const [y = 0, P = 0] = b;
1420
- b.length === 2 && P > 0 && S(y <= 0), R.source === "keyboard" ? k() : R.source === "pointer" && (h.current = !0);
1421
+ i.current = b;
1422
+ const [y = 0, O = 0] = b;
1423
+ b.length === 2 && O > 0 && S(y <= 0), R.source === "keyboard" ? k() : R.source === "pointer" && (h.current = !0);
1421
1424
  },
1422
1425
  [k]
1423
1426
  ), L = w(
1424
1427
  (b) => {
1425
- if (v.current = b, i?.(b), b) {
1428
+ if (v.current = b, c?.(b), b) {
1426
1429
  h.current = !1;
1427
1430
  return;
1428
1431
  }
1429
1432
  h.current && (h.current = !1, k());
1430
1433
  },
1431
- [i, k]
1434
+ [c, k]
1432
1435
  );
1433
- return /* @__PURE__ */ O(Xt, { id: `aqmx-split-${e}`, direction: "horizontal", onLayout: M, className: "aqmx-split", "data-aqmx-split": e, children: [
1436
+ return /* @__PURE__ */ A(Xt, { id: `aqmx-split-${e}`, direction: "horizontal", onLayout: M, className: "aqmx-split", "data-aqmx-split": e, children: [
1434
1437
  t ? null : /* @__PURE__ */ m(
1435
1438
  ze,
1436
1439
  {