@aiquants/markdown-explorer 0.27.0 → 0.28.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 (37) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +8 -4
  3. package/dist/{EditSurface-sUNqYw9o.js → EditSurface-BYKUL-a1.js} +30 -30
  4. package/dist/{EditSurface-B1yD7ywF.cjs → EditSurface-wXPvuB2n.cjs} +2 -2
  5. package/dist/{ExplorerSplit-pClUl3-e.js → ExplorerSplit-Bz-1G42e.js} +94 -94
  6. package/dist/{ExplorerSplit-Bn3ZnEMZ.cjs → ExplorerSplit-CLxr4_0K.cjs} +1 -1
  7. package/dist/MultiLayout-Coc-HQUb.cjs +1 -0
  8. package/dist/{MultiLayout-B-ft4_Vs.js → MultiLayout-DpxzsXKz.js} +167 -168
  9. package/dist/NativeScrollBar-CDgYgxXK.cjs +1 -0
  10. package/dist/{NativeScrollBar-ByawerpG.js → NativeScrollBar-DLdveoaN.js} +6 -7
  11. package/dist/{TreeLayout-DjIVKBG4.js → TreeLayout-C8TuS9ue.js} +9 -9
  12. package/dist/{TreeLayout-CXHbKdxy.cjs → TreeLayout-CJrJNZHq.cjs} +1 -1
  13. package/dist/{index-BNAkC0g3.js → index-CdYr9OQ-.js} +850 -845
  14. package/dist/index-CjyRD7qg.cjs +15 -0
  15. package/dist/index.cjs +1 -1
  16. package/dist/index.js +10 -10
  17. package/dist/{location-BNFdxzhn.js → location-CKuabtKl.js} +83 -82
  18. package/dist/location-l_HysaZR.cjs +1 -0
  19. package/dist/{merge-DhHzRcAI.js → merge-BQgbDcHR.js} +1 -1
  20. package/dist/{merge-BBU1pDoT.cjs → merge-DRLuveD9.cjs} +1 -1
  21. package/dist/server.cjs +1 -1
  22. package/dist/server.js +2 -2
  23. package/dist/styles/markdown-explorer.css +1 -1
  24. package/dist/tapScrollCircle-B2A6CmmI.js +13 -0
  25. package/dist/tapScrollCircle-qD8iSmfq.cjs +1 -0
  26. package/dist/{useSplitPersistence-xGOSwpLM.cjs → useSplitPersistence-9Nu6J1WF.cjs} +1 -1
  27. package/dist/{useSplitPersistence-D5EjJwCg.js → useSplitPersistence-Bf4M35Il.js} +1 -1
  28. package/docs/behavior/layout.md +4 -1
  29. package/package.json +5 -5
  30. package/dist/MultiLayout-0Jh08fxo.cjs +0 -1
  31. package/dist/NativeScrollBar-D9QrjRJa.cjs +0 -1
  32. package/dist/index-DRMNpWDJ.cjs +0 -15
  33. package/dist/location-yvU5HUY1.cjs +0 -1
  34. package/dist/scrollBarGeometry-C46jBtmM.cjs +0 -1
  35. package/dist/scrollBarGeometry-DOBdGNV-.js +0 -4
  36. package/dist/tapScrollCircle-C5DGI-0H.cjs +0 -1
  37. package/dist/tapScrollCircle-u4EXeLhx.js +0 -6
@@ -1,18 +1,18 @@
1
1
  import { jsxs as B, jsx as c, Fragment as pe } from "react/jsx-runtime";
2
2
  import * as E from "react";
3
3
  import { createContext as ve, use as se, useMemo as X, useSyncExternalStore as oe, useRef as U, useLayoutEffect as Y, useCallback as F, useId as Te, useEffect as ee, Component as Yn, Suspense as Ie, lazy as Pt, useState as V, useEffectEvent as le } from "react";
4
- import { useParams as uo, useSearchParams as fo, matchPath as mo, useBlocker as ho, useNavigate as po, Link as go, useHref as nt, useLocation as Xn, useRevalidator as wo } from "react-router";
5
- import { k as vo, h as Jn, H as bo, E as Qn, a as er, I as yo, J as Qt, K as ko, L as Le, e as Ne, m as Eo, M as So, O as xo, Q as To, R as en, T as Ro, U as tn, V as Oo, w as Co, W as Mo } from "./location-BNFdxzhn.js";
4
+ import { useParams as ho, useSearchParams as po, matchPath as go, useBlocker as wo, useNavigate as vo, Link as bo, useHref as nt, useLocation as Xn, useRevalidator as yo } from "react-router";
5
+ import { k as ko, h as Jn, H as Eo, E as Qn, a as er, I as So, J as Qt, K as xo, s as To, L as Ro, M as Me, e as Ne, m as Co, O as Oo, Q as Lo, R as Mo, T as en, U as Ao, V as tn, W as No, w as Do, X as Po } from "./location-CKuabtKl.js";
6
6
  import { SPREADSHEET_BLOCK_LABEL_PLACEHOLDERS as nn, SPREADSHEET_BLOCK_LABEL_CATALOGS as Xe } from "@aiquants/markdown/code-blocks";
7
- import { H as fe, i as Lo, I as rt, J as Ao, A as te, K as dt, B as ut, z as No, L as Do, f as Po, N as Io, O as $o, P as _o, Q as Fo, R as rn, x as qo, S as Bo, T as Uo, U as Ho, D as zo, y as jo, V as Vo, W as Zo, X as Wo, w as on } from "./dataRoute-DLhQfdoW.js";
8
- import { HostedScrollArea as sn, SpreadsheetBlock as Go, useMarkdownToolbarState as Ko, MarkdownViewer as tr } from "@aiquants/markdown";
9
- import { SOURCE_LINES_ATTRIBUTE as nr, parseSourceLines as Yo } from "@aiquants/markdown/source-lines";
10
- import { iterateTsvRows as Xo, iterateTsvPrefixRows as Jo, serializeTsv as Qo } from "@aiquants/spreadsheet/tsv";
7
+ import { H as fe, i as Io, I as rt, J as $o, A as te, K as dt, B as ut, z as _o, L as Fo, f as qo, N as Bo, O as Uo, P as Ho, Q as zo, R as rn, x as jo, S as Vo, T as Zo, U as Wo, D as Go, y as Ko, V as Yo, W as Xo, X as Jo, w as on } from "./dataRoute-DLhQfdoW.js";
8
+ import { HostedScrollArea as sn, SpreadsheetBlock as Qo, useMarkdownToolbarState as es, MarkdownViewer as tr } from "@aiquants/markdown";
9
+ import { SOURCE_LINES_ATTRIBUTE as nr, parseSourceLines as ts } from "@aiquants/markdown/source-lines";
10
+ import { iterateTsvRows as ns, iterateTsvPrefixRows as rs, serializeTsv as os } from "@aiquants/spreadsheet/tsv";
11
11
  import { SPREADSHEET_MAX_OPERATION_CELLS as an } from "@aiquants/spreadsheet/view";
12
- import { DEFAULT_CONTENT_ALIGN as es } from "@aiquants/markdown/viewer-settings";
13
- import { w as Rt, r as Ot, a as ts, b as ln, s as Ce, c as ns } from "./storage-CmGHg7OA.js";
14
- import { createShouldRevalidate as rs } from "@aiquants/route-revalidation";
15
- const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`, rr = Object.freeze(Object.keys(Xe.en)), or = (e) => Object.fromEntries(rr.map((t) => [It(t), Xe[e][t].text])), ss = Object.freeze({
12
+ import { DEFAULT_CONTENT_ALIGN as ss } from "@aiquants/markdown/viewer-settings";
13
+ import { w as Rt, r as Ct, a as as, b as ln, s as Oe, c as is } from "./storage-CmGHg7OA.js";
14
+ import { createShouldRevalidate as ls } from "@aiquants/route-revalidation";
15
+ const cn = Object.freeze(["en", "ja"]), cs = "en", It = (e) => `viewerSpreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`, rr = Object.freeze(Object.keys(Xe.en)), or = (e) => Object.fromEntries(rr.map((t) => [It(t), Xe[e][t].text])), ds = Object.freeze({
16
16
  panelMoved: Object.freeze(["title", "column", "position"]),
17
17
  panelMoveUnavailable: Object.freeze(["title", "move"]),
18
18
  panelDragStarted: Object.freeze(["title"]),
@@ -20,7 +20,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
20
20
  multiColumnRegion: Object.freeze(["column"]),
21
21
  viewerSvgImageSourceRegion: Object.freeze(["name"]),
22
22
  ...Object.fromEntries(rr.filter((e) => nn[e].length > 0).map((e) => [It(e), nn[e]]))
23
- }), as = /\{(\w+)\}/gu, sr = {
23
+ }), us = /\{(\w+)\}/gu, sr = {
24
24
  ...or("en"),
25
25
  explorerRegion: "Explorer",
26
26
  sourceLabel: "Source",
@@ -316,7 +316,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
316
316
  multiColumnEmpty: "This column is empty",
317
317
  multiColumnRegion: "Column {column}",
318
318
  panelDropHere: "Drop the panel here"
319
- }, is = {
319
+ }, fs = {
320
320
  ...or("ja"),
321
321
  explorerRegion: "エクスプローラー",
322
322
  sourceLabel: "ソース",
@@ -612,23 +612,23 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
612
612
  multiColumnEmpty: "この列は空です",
613
613
  multiColumnRegion: "{column} 列目",
614
614
  panelDropHere: "ここへパネルをドロップ"
615
- }, ls = Object.freeze({
615
+ }, ms = Object.freeze({
616
616
  en: Object.freeze(sr),
617
- ja: Object.freeze(is)
618
- }), ar = Object.freeze(Object.keys(sr)), cs = new Set(ar), ds = (e) => cs.has(e), Ge = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, ir = (e) => {
619
- if (e === void 0) return os;
617
+ ja: Object.freeze(fs)
618
+ }), ar = Object.freeze(Object.keys(sr)), hs = new Set(ar), ps = (e) => hs.has(e), Ge = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, ir = (e) => {
619
+ if (e === void 0) return cs;
620
620
  if (cn.includes(e)) return e;
621
621
  throw new RangeError(`[markdown-explorer] locale is the UI language (${cn.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Ge(e)}`);
622
622
  }, dn = (e, t) => {
623
- const n = ls[ir(e)];
623
+ const n = ms[ir(e)];
624
624
  if (t === void 0) return n;
625
625
  if (t === null || typeof t != "object")
626
626
  throw new RangeError(`[markdown-explorer] labels must be an object; got ${Ge(t)}`);
627
- if (!vo(t))
627
+ if (!ko(t))
628
628
  throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Ge(t)}`);
629
629
  const r = t, o = { ...n };
630
630
  for (const s of Object.keys(r)) {
631
- if (!ds(s))
631
+ if (!ps(s))
632
632
  throw new RangeError(`[markdown-explorer] labels.${s} is not a known label key; expected one of ${ar.join(", ")}`);
633
633
  const a = r[s];
634
634
  if (a === void 0) continue;
@@ -637,21 +637,21 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
637
637
  throw new TypeError(`[markdown-explorer] labels.${s} must be a ${i}; got ${Ge(a)}`);
638
638
  if (typeof a == "string" && a.trim() === "")
639
639
  throw new RangeError(`[markdown-explorer] labels.${s} must be a non-blank string`);
640
- const f = ss[s];
640
+ const f = ds[s];
641
641
  if (typeof a == "string" && f !== void 0) {
642
- for (const [, u] of a.matchAll(as))
642
+ for (const [, u] of a.matchAll(us))
643
643
  if (!f.includes(u ?? ""))
644
644
  throw new RangeError(`[markdown-explorer] labels.${s} uses the unknown placeholder {${String(u)}}; it accepts ${f.map((l) => `{${l}}`).join(", ")}`);
645
645
  }
646
646
  o[s] = a;
647
647
  }
648
648
  return Object.freeze(o);
649
- }, us = (e, t) => {
649
+ }, gs = (e, t) => {
650
650
  if (Object.is(e, t)) return !0;
651
651
  if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
652
652
  const n = e, r = t, o = Object.keys(n), s = Object.keys(r);
653
653
  return o.length === s.length && s.every((a) => Object.hasOwn(n, a) && Object.is(n[a], r[a]));
654
- }, un = Object.freeze(["light", "dark"]), fs = (e) => {
654
+ }, un = Object.freeze(["light", "dark"]), ws = (e) => {
655
655
  if (e === void 0) return "light";
656
656
  if (un.includes(e)) return e;
657
657
  throw new RangeError(`[markdown-explorer] theme must be ${un.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
@@ -663,7 +663,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
663
663
  const { viewSettings: t } = $(), n = () => e(t.getSnapshot());
664
664
  return oe(t.subscribe, n, n);
665
665
  }, $t = () => {
666
- const { config: e } = $(), t = uo()["*"], [n] = fo(), r = n.toString();
666
+ const { config: e } = $(), t = ho()["*"], [n] = po(), r = n.toString();
667
667
  return X(() => Jn(e, t, new URLSearchParams(r)), [e, t, r]);
668
668
  }, cr = {
669
669
  unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
@@ -681,7 +681,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
681
681
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: a }),
682
682
  e.reason === "unauthorized" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
683
683
  ] });
684
- }, ms = (e, t) => {
684
+ }, vs = (e, t) => {
685
685
  const { phase: n, save: r, dirty: o } = t;
686
686
  switch (n.kind) {
687
687
  case "opening":
@@ -707,7 +707,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
707
707
  break;
708
708
  }
709
709
  return o ? e.draftUnsaved : "";
710
- }, hs = (e, t, n) => {
710
+ }, bs = (e, t, n) => {
711
711
  switch (t.kind) {
712
712
  case "draft":
713
713
  return e.draftNotSaved;
@@ -733,28 +733,28 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
733
733
  for (const t of [...e]) t();
734
734
  }
735
735
  };
736
- }, ps = "<<<<<<<", gs = "=======", ws = ">>>>>>>", fn = (e, t) => e === t || e.startsWith(`${t} `), mn = (e) => vs(e.split(`
737
- `)), vs = (e) => {
736
+ }, ys = "<<<<<<<", ks = "=======", Es = ">>>>>>>", fn = (e, t) => e === t || e.startsWith(`${t} `), mn = (e) => Ss(e.split(`
737
+ `)), Ss = (e) => {
738
738
  const t = [];
739
739
  let n = null, r = null, o = 0;
740
740
  for (const s of e) {
741
741
  o += 1;
742
742
  const a = s.charCodeAt(0);
743
- a !== 60 && a !== 61 && a !== 62 || (fn(s, ps) ? (n = o, r = null) : s === gs ? n !== null && r === null ? r = o : n = null : fn(s, ws) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
743
+ a !== 60 && a !== 61 && a !== 62 || (fn(s, ys) ? (n = o, r = null) : s === ks ? n !== null && r === null ? r = o : n = null : fn(s, Es) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
744
744
  }
745
745
  return t;
746
746
  }, hn = (e) => e.includes(`\r
747
747
  `) ? `\r
748
748
  ` : `
749
749
  `, ft = (e) => e.replace(/\r\n?/gu, `
750
- `), bs = (e, t) => t === `
750
+ `), xs = (e, t) => t === `
751
751
  ` ? e : e.replaceAll(`
752
752
  `, `\r
753
- `), ys = 3, ks = /^\d+(?:\.\d+)?$/u, Es = (e) => {
754
- if (e === null || !ks.test(e)) return null;
753
+ `), Ts = 3, Rs = /^\d+(?:\.\d+)?$/u, Cs = (e) => {
754
+ if (e === null || !Rs.test(e)) return null;
755
755
  const t = Number(e);
756
756
  return t >= er && t <= Qn ? t : null;
757
- }, mt = Object.freeze({ kind: "idle" }), pn = Object.freeze({ kind: "draft" }), Ss = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
757
+ }, mt = Object.freeze({ kind: "idle" }), pn = Object.freeze({ kind: "draft" }), Os = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
758
758
  const s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), l = qe();
759
759
  let d = null, h = null, g = null;
760
760
  const v = (m, p) => {
@@ -775,7 +775,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
775
775
  }
776
776
  const I = ft(A.text), _ = A.kind === "draft";
777
777
  p.base = { text: I, version: _ ? null : A.version }, p.draft = I, p.ending = hn(A.text), v(p, { phase: { kind: "editing" }, history: _ ? !1 : A.history, dirty: !1, save: _ ? pn : mt, generation: p.value.generation + 1 });
778
- }, C = (m) => {
778
+ }, O = (m) => {
779
779
  const p = s.get(m);
780
780
  p !== void 0 && (p.controller.abort(), s.delete(m), i.delete(m));
781
781
  }, R = (m, p, x) => (m.set(p, x), () => {
@@ -800,27 +800,27 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
800
800
  const { signal: I } = p.controller;
801
801
  let _ = { text: p.base.text, version: x }, b = p.draft, S = !1;
802
802
  v(p, { save: { kind: "saving" } });
803
- for (let M = 0; M < ys; M += 1) {
804
- const L = await e.save(m, _.version, bs(b, p.ending), I);
805
- if (!y(m, p) || I.aborted || !("kind" in L)) return;
806
- if (L.kind === "saved") {
807
- f.get(m)?.flush(), p.base = { text: b, version: L.version }, q(m, p, { kind: "saved", merged: S }, { dirty: p.draft !== b });
803
+ for (let L = 0; L < Ts; L += 1) {
804
+ const M = await e.save(m, _.version, xs(b, p.ending), I);
805
+ if (!y(m, p) || I.aborted || !("kind" in M)) return;
806
+ if (M.kind === "saved") {
807
+ f.get(m)?.flush(), p.base = { text: b, version: M.version }, q(m, p, { kind: "saved", merged: S }, { dirty: p.draft !== b });
808
808
  return;
809
809
  }
810
- if (L.kind === "grant") {
811
- q(m, p, { kind: "grant", href: L.href });
810
+ if (M.kind === "grant") {
811
+ q(m, p, { kind: "grant", href: M.href });
812
812
  return;
813
813
  }
814
- if (L.kind === "failure") {
815
- q(m, p, { kind: "failed", failure: L.failure });
814
+ if (M.kind === "failure") {
815
+ q(m, p, { kind: "failed", failure: M.failure });
816
816
  return;
817
817
  }
818
- const { mergeDraft: P } = await import("./merge-DhHzRcAI.js");
818
+ const { mergeDraft: P } = await import("./merge-BQgbDcHR.js");
819
819
  if (!y(m, p) || I.aborted) return;
820
820
  const H = f.get(m);
821
821
  H?.flush();
822
- const K = ft(L.text), w = P(_.text, p.draft, K, t());
823
- if (_ = { text: K, version: L.version }, p.base = _, p.ending = hn(L.text), p.draft = w.text, H?.adopt(w.text), w.kind === "conflicts") {
822
+ const K = ft(M.text), w = P(_.text, p.draft, K, t());
823
+ if (_ = { text: K, version: M.version }, p.base = _, p.ending = hn(M.text), p.draft = w.text, H?.adopt(w.text), w.kind === "conflicts") {
824
824
  q(m, p, { kind: "conflicts", count: w.conflicts }, { dirty: !0, generation: p.value.generation + 1 });
825
825
  return;
826
826
  }
@@ -889,7 +889,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
889
889
  close: (m) => {
890
890
  if (!s.has(m)) return;
891
891
  const p = f.get(m), x = p === void 0 ? null : p.returnPoint();
892
- C(m), x === null ? a.delete(m) : a.set(m, x), l.emit();
892
+ O(m), x === null ? a.delete(m) : a.set(m, x), l.emit();
893
893
  },
894
894
  takeReturn: (m) => {
895
895
  const p = a.get(m) ?? null;
@@ -897,7 +897,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
897
897
  },
898
898
  dirtyPaths: () => [...s.values()].filter((m) => m.value.dirty).map((m) => m.value.path),
899
899
  discard: (m) => {
900
- for (const p of m) C(p);
900
+ for (const p of m) O(p);
901
901
  m.length > 0 && l.emit();
902
902
  },
903
903
  editorState: {
@@ -928,7 +928,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
928
928
  paths: m,
929
929
  settle: (A) => {
930
930
  if (g === x) {
931
- if (g = null, A) for (const I of m) C(I);
931
+ if (g = null, A) for (const I of m) O(I);
932
932
  l.emit(), p(A);
933
933
  }
934
934
  }
@@ -940,7 +940,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
940
940
  setSideBySide: (m) => {
941
941
  d !== m && (d = m, r.write(m), l.emit());
942
942
  },
943
- editorShare: () => (h ??= o.read() ?? bo, h),
943
+ editorShare: () => (h ??= o.read() ?? Eo, h),
944
944
  setEditorShare: (m) => {
945
945
  if (!Number.isFinite(m)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(m)}`);
946
946
  const p = Math.min(Qn, Math.max(er, m));
@@ -957,16 +957,16 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
957
957
  };
958
958
  }, dr = (e) => {
959
959
  e.preventDefault(), e.stopPropagation();
960
- }, xs = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, ur = "data-aqmx-content-pane", Ct = Object.freeze({ [ur]: "" }), Ts = "--aqmx-dialog-left", Rs = "--aqmx-dialog-top", Os = '[data-testid="markdown-explorer"]', Cs = (e) => {
961
- const t = e.closest(Os)?.querySelectorAll(`[${ur}]`), n = t?.item(t.length - 1);
960
+ }, Ls = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, ur = "data-aqmx-content-pane", Ot = Object.freeze({ [ur]: "" }), Ms = "--aqmx-dialog-left", As = "--aqmx-dialog-top", Ns = '[data-testid="markdown-explorer"]', Ds = (e) => {
961
+ const t = e.closest(Ns)?.querySelectorAll(`[${ur}]`), n = t?.item(t.length - 1);
962
962
  if (!(n instanceof HTMLElement)) throw new Error("[markdown-explorer] a dialog opened where the explorer marks no content pane");
963
963
  return n;
964
- }, Ms = (e) => {
965
- const t = xs(getComputedStyle(e).marginTop);
964
+ }, Ps = (e) => {
965
+ const t = Ls(getComputedStyle(e).marginTop);
966
966
  if (Number.isNaN(t)) return null;
967
- const n = Cs(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: s, top: a } = yo(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
968
- return e.style.setProperty(Ts, `${String(s)}px`), e.style.setProperty(Rs, `${String(a)}px`), n;
969
- }, Ls = (e) => e.preventDefault(), fr = ({ open: e, onOpen: t, onDismiss: n }) => {
967
+ const n = Ds(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: s, top: a } = So(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
968
+ return e.style.setProperty(Ms, `${String(s)}px`), e.style.setProperty(As, `${String(a)}px`), n;
969
+ }, Is = (e) => e.preventDefault(), fr = ({ open: e, onOpen: t, onDismiss: n }) => {
970
970
  const r = U(null), o = U(null), s = U(!1), a = U(t);
971
971
  Y(() => {
972
972
  a.current = t;
@@ -984,7 +984,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
984
984
  const d = new ResizeObserver(() => g());
985
985
  let h = null;
986
986
  const g = () => {
987
- const y = Ms(l);
987
+ const y = Ps(l);
988
988
  y === null || y === h || (h !== null && d.unobserve(h), d.observe(y), h = y);
989
989
  };
990
990
  g(), d.observe(l);
@@ -1006,7 +1006,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1006
1006
  ), u = F(() => {
1007
1007
  s.current && n();
1008
1008
  }, [n]);
1009
- return { ref: r, onKeyDown: i, onClick: f, onCancel: Ls, onClose: u };
1009
+ return { ref: r, onKeyDown: i, onClick: f, onCancel: Is, onClose: u };
1010
1010
  }, mr = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: s, onCancel: a, testId: i }) => {
1011
1011
  const f = U(null), u = Te(), l = Te(), d = F(() => f.current?.focus(), []), h = fr({ open: e, onOpen: d, onDismiss: a });
1012
1012
  return /* @__PURE__ */ c("dialog", { ...h, className: "aqmx-confirm", "aria-labelledby": u, "aria-describedby": l, "data-testid": i, children: /* @__PURE__ */ B("div", { className: "aqmx-confirm-panel", children: [
@@ -1027,7 +1027,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1027
1027
  t.status = "rejected", t.reason = n;
1028
1028
  }
1029
1029
  )), t;
1030
- }, hr = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ae = (e) => e.status === "fulfilled" ? e.value : void 0, As = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), Ns = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), Ds = (e, t, n) => {
1030
+ }, hr = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ae = (e) => e.status === "fulfilled" ? e.value : void 0, $s = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), _s = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), Fs = (e, t, n) => {
1031
1031
  const r = /* @__PURE__ */ new Set(), o = [...e].reverse();
1032
1032
  for (let s = o.pop(); s !== void 0; s = o.pop()) {
1033
1033
  if (s.type !== "directory" || r.has(s.path)) continue;
@@ -1037,19 +1037,19 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1037
1037
  if (i !== null) for (const f of [...i].reverse()) o.push(f);
1038
1038
  }
1039
1039
  return null;
1040
- }, Ps = (e, t, n) => {
1040
+ }, qs = (e, t, n) => {
1041
1041
  const r = Ae(e.read(t));
1042
- if (r === void 0 || r.status === "deferred") return As;
1042
+ if (r === void 0 || r.status === "deferred") return $s;
1043
1043
  if (r.status === "error") return { readme: { status: "failed", failure: r.failure, retry: () => e.retry(t) }, claim: !1 };
1044
- const o = Ds(r.entries, n, (a) => e.children(t, a));
1044
+ const o = Fs(r.entries, n, (a) => e.children(t, a));
1045
1045
  if (o !== null) return { readme: { status: "ok", readme: Qt(o) }, claim: !1 };
1046
1046
  const s = e.children(t, n);
1047
- return s === void 0 || s.status === "loading" ? Ns : s.status === "failed" ? { readme: { status: "failed", failure: s.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: Qt(s.entries) }, claim: !0 };
1048
- }, Is = (e, t, n) => {
1049
- const { readme: r } = Ps(e, t, n);
1047
+ return s === void 0 || s.status === "loading" ? _s : s.status === "failed" ? { readme: { status: "failed", failure: s.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: Qt(s.entries) }, claim: !0 };
1048
+ }, Bs = (e, t, n) => {
1049
+ const { readme: r } = qs(e, t, n);
1050
1050
  return r.status === "ok" ? r.readme : null;
1051
- }, $s = (e, t, n) => {
1052
- const r = mo({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
1051
+ }, Us = (e, t, n) => {
1052
+ const r = go({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
1053
1053
  if (r === null) return /* @__PURE__ */ new Set();
1054
1054
  const { location: o } = Jn(e, r.params["*"], new URLSearchParams(t.search));
1055
1055
  switch (o.view) {
@@ -1064,22 +1064,22 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1064
1064
  }
1065
1065
  }, pr = (e) => {
1066
1066
  const { edits: t } = $(), n = F(() => t.session(e), [t, e]);
1067
- return oe(t.subscribe, n, _s);
1068
- }, gr = () => !1, _s = () => {
1069
- }, Fs = () => {
1067
+ return oe(t.subscribe, n, Hs);
1068
+ }, gr = () => !1, Hs = () => {
1069
+ }, zs = () => {
1070
1070
  const { edits: e } = $();
1071
1071
  return oe(e.subscribe, e.hasSessions, gr);
1072
- }, qs = () => {
1072
+ }, js = () => {
1073
1073
  const { edits: e } = $();
1074
1074
  return oe(e.subscribe, e.sideBySide, gr);
1075
- }, Bs = () => null, Us = () => {
1075
+ }, Vs = () => null, Zs = () => {
1076
1076
  const { edits: e, labels: t, config: n, trees: r } = $(), o = U([]), s = F(
1077
1077
  ({ nextLocation: g }) => {
1078
- const v = $s(n, g, (y, T) => Is(r, y, T));
1078
+ const v = Us(n, g, (y, T) => Bs(r, y, T));
1079
1079
  return e.flushDrafts(), o.current = e.dirtyPaths().filter((y) => !v.has(y)), o.current.length > 0;
1080
1080
  },
1081
1081
  [e, n, r]
1082
- ), a = ho(s), i = Fs();
1082
+ ), a = wo(s), i = zs();
1083
1083
  ee(() => {
1084
1084
  if (!i) return;
1085
1085
  const g = (v) => {
@@ -1087,7 +1087,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1087
1087
  };
1088
1088
  return window.addEventListener("beforeunload", g), () => window.removeEventListener("beforeunload", g);
1089
1089
  }, [i, e]);
1090
- const f = oe(e.subscribe, e.discardRequest, Bs), u = a.state === "blocked", l = u ? o.current : f === null ? [] : f.paths, d = l.map((g) => fe(g)).join(", "), h = l.length > 0 && l.every((g) => e.session(g)?.save.kind === "draft");
1090
+ const f = oe(e.subscribe, e.discardRequest, Vs), u = a.state === "blocked", l = u ? o.current : f === null ? [] : f.paths, d = l.map((g) => fe(g)).join(", "), h = l.length > 0 && l.every((g) => e.session(g)?.save.kind === "draft");
1091
1091
  return /* @__PURE__ */ c(
1092
1092
  mr,
1093
1093
  {
@@ -1114,7 +1114,7 @@ const cn = Object.freeze(["en", "ja"]), os = "en", It = (e) => `viewerSpreadshee
1114
1114
  }
1115
1115
  );
1116
1116
  };
1117
- function Hs({
1117
+ function Ws({
1118
1118
  title: e,
1119
1119
  titleId: t,
1120
1120
  ...n
@@ -1135,18 +1135,18 @@ function Hs({
1135
1135
  clipRule: "evenodd"
1136
1136
  }));
1137
1137
  }
1138
- const zs = /* @__PURE__ */ E.forwardRef(Hs);
1138
+ const Gs = /* @__PURE__ */ E.forwardRef(Ws);
1139
1139
  let ht = null;
1140
- const wr = () => (ht ??= import("./EditSurface-sUNqYw9o.js").catch((e) => {
1140
+ const wr = () => (ht ??= import("./EditSurface-BYKUL-a1.js").catch((e) => {
1141
1141
  throw ht = null, e;
1142
- }), ht), js = () => {
1142
+ }), ht), Ks = () => {
1143
1143
  wr().catch(() => {
1144
1144
  });
1145
- }, Vs = (e) => {
1145
+ }, Ys = (e) => {
1146
1146
  const { default: t } = se(wr());
1147
1147
  return /* @__PURE__ */ c(t, { ...e });
1148
1148
  };
1149
- class Zs extends Yn {
1149
+ class Xs extends Yn {
1150
1150
  state = { failed: !1 };
1151
1151
  static getDerivedStateFromError() {
1152
1152
  return { failed: !0 };
@@ -1156,7 +1156,7 @@ class Zs extends Yn {
1156
1156
  return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
1157
1157
  }
1158
1158
  }
1159
- const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg, [data-aqmd-spreadsheet-editable], [data-aqmd-spreadsheet-fullscreen], [data-aqmd-svg-image-source]', Ks = 200, _e = (e) => Yo(e.getAttribute(nr)), Ys = (e, t) => {
1159
+ const _t = `[${nr}]`, Js = "[data-aqmd-content]", Qs = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg, [data-aqmd-spreadsheet-editable], [data-aqmd-spreadsheet-fullscreen], [data-aqmd-svg-image-source]', ea = 200, _e = (e) => ts(e.getAttribute(nr)), ta = (e, t) => {
1160
1160
  for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
1161
1161
  const o = _e(r);
1162
1162
  if (o !== null) return { block: r, lines: o, own: !0 };
@@ -1168,43 +1168,43 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1168
1168
  o !== null && (n = { block: r, lines: o });
1169
1169
  }
1170
1170
  return n === null ? null : { ...n, own: !1 };
1171
- }, Xs = (e, t) => {
1171
+ }, na = (e, t) => {
1172
1172
  let n = 0;
1173
1173
  for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
1174
1174
  return n;
1175
- }, Js = (e) => e.closest(Ws) !== null && e.closest(Gs) === null, Qs = (e, t, n) => {
1176
- const r = Ys(e, t);
1175
+ }, ra = (e) => e.closest(Js) !== null && e.closest(Qs) === null, oa = (e, t, n) => {
1176
+ const r = ta(e, t);
1177
1177
  if (r === null) return null;
1178
1178
  const { block: o, own: s } = r;
1179
1179
  if (!s) {
1180
1180
  const i = r.lines.last + 1;
1181
1181
  return { lines: { first: i, last: i }, word: null, occurrence: 0, clientTop: Qe(e) };
1182
1182
  }
1183
- const a = ra(o, n);
1183
+ const a = la(o, n);
1184
1184
  return a === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Qe(o) } : { lines: r.lines, word: a.text, occurrence: a.occurrence, clientTop: a.clientTop };
1185
- }, ea = (e, t) => {
1185
+ }, sa = (e, t) => {
1186
1186
  let n = null, r = null, o = null;
1187
1187
  for (const a of e.querySelectorAll(_t)) {
1188
1188
  const i = _e(a);
1189
1189
  if (i === null) continue;
1190
- n ??= na(t, a);
1190
+ n ??= ia(t, a);
1191
1191
  const { top: f, bottom: u } = a.getBoundingClientRect();
1192
1192
  f <= n && n < u ? r = { lines: i, block: a } : o === null && f >= n && (o = { lines: i, block: a });
1193
1193
  }
1194
1194
  const s = r === null ? o : r;
1195
1195
  return s === null ? null : { lines: s.lines, word: null, occurrence: 0, clientTop: Qe(s.block) };
1196
- }, ta = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, na = (e, t) => {
1196
+ }, aa = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, ia = (e, t) => {
1197
1197
  const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
1198
- return ta(e) + (Number.isFinite(n) ? n : 0);
1199
- }, ra = (e, t) => {
1198
+ return aa(e) + (Number.isFinite(n) ? n : 0);
1199
+ }, la = (e, t) => {
1200
1200
  if (t === null || t.rangeCount === 0) return null;
1201
1201
  const n = t.getRangeAt(0);
1202
1202
  if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
1203
1203
  const r = n.toString().trim();
1204
- if (r === "" || r.length > Ks || /[\r\n]/u.test(r)) return null;
1204
+ if (r === "" || r.length > ea || /[\r\n]/u.test(r)) return null;
1205
1205
  const o = e.ownerDocument.createRange();
1206
- return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: Xs(o.toString(), r), clientTop: n.getBoundingClientRect().top };
1207
- }, nu = (e, t) => {
1206
+ return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: na(o.toString(), r), clientTop: n.getBoundingClientRect().top };
1207
+ }, lu = (e, t) => {
1208
1208
  const n = e.split(`
1209
1209
  `), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), s = { line: r, column: 0 };
1210
1210
  if (t.word === null) return s;
@@ -1216,21 +1216,21 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1216
1216
  a += 1;
1217
1217
  }
1218
1218
  }
1219
- return a > 0 ? oa(n, r, o, t.word) ?? s : s;
1220
- }, oa = (e, t, n, r) => {
1219
+ return a > 0 ? ca(n, r, o, t.word) ?? s : s;
1220
+ }, ca = (e, t, n, r) => {
1221
1221
  for (let o = n; o >= t; o -= 1) {
1222
1222
  const s = (e[o - 1] ?? "").lastIndexOf(r);
1223
1223
  if (s >= 0) return { line: o, column: s };
1224
1224
  }
1225
1225
  return null;
1226
- }, sa = (e, t) => {
1226
+ }, da = (e, t) => {
1227
1227
  let n = null, r = null;
1228
1228
  for (const o of e.querySelectorAll(_t)) {
1229
1229
  const s = _e(o);
1230
1230
  s === null || s.first > t || (s.last >= t ? n = o : (r === null || s.last >= r.last) && (r = { element: o, last: s.last }));
1231
1231
  }
1232
1232
  return n !== null ? n : r === null ? null : r.element;
1233
- }, aa = (e, t) => {
1233
+ }, ua = (e, t) => {
1234
1234
  const { bottom: n } = e.getBoundingClientRect(), r = Qe(e), o = _e(e);
1235
1235
  if (o === null) return r;
1236
1236
  const s = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
@@ -1251,15 +1251,15 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1251
1251
  "switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
1252
1252
  "switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
1253
1253
  "follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
1254
- }), ru = (e) => Ft[e], ot = () => {
1255
- const e = po();
1254
+ }), cu = (e) => Ft[e], ot = () => {
1255
+ const e = vo();
1256
1256
  return F(
1257
1257
  (t, n) => {
1258
1258
  e(t, Ft[n]);
1259
1259
  },
1260
1260
  [e]
1261
1261
  );
1262
- }, ia = ({ navigation: e, ...t }) => /* @__PURE__ */ c(go, { ...t, ...Ft[e] }), vr = (e) => {
1262
+ }, fa = ({ navigation: e, ...t }) => /* @__PURE__ */ c(bo, { ...t, ...Ft[e] }), vr = (e) => {
1263
1263
  const t = e.ownerDocument;
1264
1264
  if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
1265
1265
  if (e.hasAttribute("tabindex")) return !1;
@@ -1269,7 +1269,7 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1269
1269
  t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
1270
1270
  };
1271
1271
  return e.addEventListener("blur", n), !0;
1272
- }, la = (e, t) => {
1272
+ }, ma = (e, t) => {
1273
1273
  const n = U(null), r = U(null), o = U(null), s = F(() => {
1274
1274
  n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
1275
1275
  }, []);
@@ -1296,7 +1296,7 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1296
1296
  const l = t(u);
1297
1297
  l !== r.current && (s(), l !== null && (r.current = l, n.current = window.setTimeout(() => {
1298
1298
  n.current = null, a(l);
1299
- }, ko)));
1299
+ }, xo)));
1300
1300
  },
1301
1301
  [s, t, a]
1302
1302
  ), f = F(
@@ -1314,8 +1314,8 @@ const _t = `[${nr}]`, Ws = "[data-aqmd-content]", Gs = 'a[href], button, input,
1314
1314
  }),
1315
1315
  [i, f]
1316
1316
  );
1317
- }, ca = Pt(() => import("./NativeScrollBar-ByawerpG.js").then((e) => ({ default: e.NativeScrollBar })));
1318
- class da extends Yn {
1317
+ }, ha = Pt(() => import("./NativeScrollBar-DLdveoaN.js").then((e) => ({ default: e.NativeScrollBar })));
1318
+ class pa extends Yn {
1319
1319
  state = { failed: !1 };
1320
1320
  static getDerivedStateFromError() {
1321
1321
  return { failed: !0 };
@@ -1327,7 +1327,7 @@ class da extends Yn {
1327
1327
  return this.state.failed ? null : this.props.children;
1328
1328
  }
1329
1329
  }
1330
- const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children: /* @__PURE__ */ c(Ie, { fallback: null, children: /* @__PURE__ */ c(ca, { scroller: e, withCircle: t }) }) }), br = (e) => /* @__PURE__ */ c(ua, { scroller: e, withCircle: !0 }), yr = () => {
1330
+ const ga = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(pa, { children: /* @__PURE__ */ c(Ie, { fallback: null, children: /* @__PURE__ */ c(ha, { scroller: e, withCircle: t }) }) }), br = (e) => /* @__PURE__ */ c(ga, { scroller: e, withCircle: !0 }), du = 8, yr = To, kr = Ro[3], Er = yr + 2 * kr, uu = -(yr + kr), Sr = () => {
1331
1331
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
1332
1332
  let n = !1;
1333
1333
  const r = (o) => {
@@ -1361,9 +1361,9 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1361
1361
  return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((s, a) => et(s, t[a]));
1362
1362
  const n = e, r = t, o = Object.keys(n);
1363
1363
  return o.length !== Object.keys(r).length ? !1 : o.every((s) => Object.hasOwn(r, s) && et(n[s], r[s]));
1364
- }, fa = 55e3, gn = Object.freeze({ status: "deferred" }), pt = Object.freeze({ status: "refreshed" }), gt = Object.freeze({ status: "shown", failed: !1 }), je = Object.freeze({ status: "shown", failed: !0 }), Ve = Object.freeze({ status: "superseded" }), ge = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, ma = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", ha = ({ client: e, capacity: t }) => {
1364
+ }, wa = 55e3, gn = Object.freeze({ status: "deferred" }), pt = Object.freeze({ status: "refreshed" }), gt = Object.freeze({ status: "shown", failed: !1 }), je = Object.freeze({ status: "shown", failed: !0 }), Ve = Object.freeze({ status: "superseded" }), ge = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, va = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", ba = ({ client: e, capacity: t }) => {
1365
1365
  if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
1366
- const n = /* @__PURE__ */ new Map(), r = yr(), o = qe(), s = /* @__PURE__ */ new WeakSet(), a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1366
+ const n = /* @__PURE__ */ new Map(), r = Sr(), o = qe(), s = /* @__PURE__ */ new WeakSet(), a = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
1367
1367
  let u = 0;
1368
1368
  const l = o.emit, d = () => (u += 1, u), h = () => {
1369
1369
  if (!(n.size <= t))
@@ -1373,92 +1373,92 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1373
1373
  }
1374
1374
  }, g = (b, S) => {
1375
1375
  n.delete(b), n.set(b, S);
1376
- }, v = (b) => performance.now() - b.validatedAt >= fa, y = (b, S, M) => {
1377
- const L = n.get(b), P = ge(L?.snapshot), H = M || L?.refreshPending === !0, K = $e(e.document(b, { refresh: H }).then((k) => ({ status: "loaded", document: k }))), w = { snapshot: { status: "pending", promise: K, previous: P }, validatedAt: performance.now(), opened: S, background: null, refreshPending: !1, seeded: void 0, stamp: d() };
1376
+ }, v = (b) => performance.now() - b.validatedAt >= wa, y = (b, S, L) => {
1377
+ const M = n.get(b), P = ge(M?.snapshot), H = L || M?.refreshPending === !0, K = $e(e.document(b, { refresh: H }).then((k) => ({ status: "loaded", document: k }))), w = { snapshot: { status: "pending", promise: K, previous: P }, validatedAt: performance.now(), opened: S, background: null, refreshPending: !1, seeded: void 0, stamp: d() };
1378
1378
  return g(b, w), h(), K.then((k) => {
1379
1379
  n.get(b) === w && (w.snapshot = k, w.stamp = d(), l());
1380
1380
  }), w;
1381
- }, T = (b, S, M, L, P, H) => {
1382
- S.background === M && (S.background = null, !(n.get(b) !== S || S.snapshot !== L) && (P.kind === "failure" && L.document.kind !== "failure" || (S.validatedAt = H, S.stamp = d(), et(L.document, P) || (S.snapshot = { status: "loaded", document: P }), l())));
1383
- }, C = async (b, S) => {
1384
- const M = S.snapshot;
1385
- if (M.status !== "loaded") return null;
1386
- const L = {};
1387
- S.background = L;
1381
+ }, T = (b, S, L, M, P, H) => {
1382
+ S.background === L && (S.background = null, !(n.get(b) !== S || S.snapshot !== M) && (P.kind === "failure" && M.document.kind !== "failure" || (S.validatedAt = H, S.stamp = d(), et(M.document, P) || (S.snapshot = { status: "loaded", document: P }), l())));
1383
+ }, O = async (b, S) => {
1384
+ const L = S.snapshot;
1385
+ if (L.status !== "loaded") return null;
1386
+ const M = {};
1387
+ S.background = M;
1388
1388
  const P = performance.now(), H = e.document(b, { refresh: S.refreshPending });
1389
1389
  S.refreshPending = !1;
1390
- const K = await H, w = S.background === L && n.get(b) === S && S.snapshot === M;
1391
- return T(b, S, L, M, K, P), w ? K : null;
1390
+ const K = await H, w = S.background === M && n.get(b) === S && S.snapshot === L;
1391
+ return T(b, S, M, L, K, P), w ? K : null;
1392
1392
  }, R = (b, S) => {
1393
- const { snapshot: M } = S;
1394
- return M.status === "pending" ? !1 : M.status === "loaded" && M.document.kind !== "failure" ? (C(b, S), !1) : (M.status === "loaded" && s.add(M), y(b, !0, !1), !0);
1393
+ const { snapshot: L } = S;
1394
+ return L.status === "pending" ? !1 : L.status === "loaded" && L.document.kind !== "failure" ? (O(b, S), !1) : (L.status === "loaded" && s.add(L), y(b, !0, !1), !0);
1395
1395
  }, q = (b) => {
1396
1396
  i.delete(b);
1397
1397
  const S = f.get(b);
1398
1398
  if (S !== void 0) {
1399
1399
  f.delete(b);
1400
- for (const M of S) M();
1400
+ for (const L of S) L();
1401
1401
  }
1402
- }, D = (b, S) => new Promise((M) => {
1402
+ }, D = (b, S) => new Promise((L) => {
1403
1403
  if (i.get(b) === S || !r.isHeld(b)) {
1404
- M();
1404
+ L();
1405
1405
  return;
1406
1406
  }
1407
- const L = f.get(b);
1408
- L === void 0 ? f.set(b, /* @__PURE__ */ new Set([M])) : L.add(M);
1407
+ const M = f.get(b);
1408
+ M === void 0 ? f.set(b, /* @__PURE__ */ new Set([L])) : M.add(L);
1409
1409
  }), m = (b, S) => {
1410
- const M = a.get(b);
1411
- if (M === void 0) {
1410
+ const L = a.get(b);
1411
+ if (L === void 0) {
1412
1412
  S.resolve(null);
1413
1413
  return;
1414
1414
  }
1415
- if (M.last !== null && M.last.stamp >= S.stamp) {
1416
- S.resolve(M.last);
1415
+ if (L.last !== null && L.last.stamp >= S.stamp) {
1416
+ S.resolve(L.last);
1417
1417
  return;
1418
1418
  }
1419
- M.waiters.add(S);
1420
- }, p = async (b, S, M) => {
1421
- const L = await new Promise((P) => m(b, { stamp: S.stamp, resolve: P }));
1419
+ L.waiters.add(S);
1420
+ }, p = async (b, S, L) => {
1421
+ const M = await new Promise((P) => m(b, { stamp: S.stamp, resolve: P }));
1422
1422
  if (n.get(b) !== S) return Ve;
1423
- if (L === null) return M ? pt : gt;
1424
- if (!M) return L.failure === null ? gt : je;
1425
- switch (L.before) {
1423
+ if (M === null) return L ? pt : gt;
1424
+ if (!L) return M.failure === null ? gt : je;
1425
+ switch (M.before) {
1426
1426
  case "copy":
1427
- return L.failure === null ? pt : { status: "failed", failure: L.failure };
1427
+ return M.failure === null ? pt : { status: "failed", failure: M.failure };
1428
1428
  case "failure":
1429
- return L.failure === null ? gt : je;
1429
+ return M.failure === null ? gt : je;
1430
1430
  case "none":
1431
- return L.failure === null ? pt : je;
1431
+ return M.failure === null ? pt : je;
1432
1432
  }
1433
1433
  }, x = (b) => {
1434
1434
  const S = { showing: "none", last: null, waiters: /* @__PURE__ */ new Set() };
1435
1435
  a.set(b, S);
1436
- let M = !1;
1436
+ let L = !1;
1437
1437
  return {
1438
- settle: (L, P) => {
1439
- if (M || L === void 0) return;
1440
- const H = { stamp: L, failure: P, before: S.showing };
1438
+ settle: (M, P) => {
1439
+ if (L || M === void 0) return;
1440
+ const H = { stamp: M, failure: P, before: S.showing };
1441
1441
  S.last = H, P === null ? S.showing = "copy" : S.showing === "none" && (S.showing = "failure");
1442
1442
  for (const K of [...S.waiters])
1443
- L < K.stamp || (S.waiters.delete(K), K.resolve(H));
1443
+ M < K.stamp || (S.waiters.delete(K), K.resolve(H));
1444
1444
  },
1445
1445
  release: () => {
1446
- if (M) return;
1447
- M = !0, a.get(b) === S && a.delete(b);
1448
- const L = [...S.waiters];
1449
- S.waiters.clear(), L.length > 0 && queueMicrotask(() => {
1450
- for (const P of L) m(b, P);
1446
+ if (L) return;
1447
+ L = !0, a.get(b) === S && a.delete(b);
1448
+ const M = [...S.waiters];
1449
+ S.waiters.clear(), M.length > 0 && queueMicrotask(() => {
1450
+ for (const P of M) m(b, P);
1451
1451
  });
1452
1452
  }
1453
1453
  };
1454
1454
  }, A = (b) => {
1455
1455
  const S = r.hold(b);
1456
- let M = !1;
1456
+ let L = !1;
1457
1457
  return () => {
1458
- if (M) return;
1459
- M = !0, S();
1460
- const L = n.get(b);
1461
- L !== void 0 && g(b, L), h(), r.isHeld(b) || queueMicrotask(() => {
1458
+ if (L) return;
1459
+ L = !0, S();
1460
+ const M = n.get(b);
1461
+ M !== void 0 && g(b, M), h(), r.isHeld(b) || queueMicrotask(() => {
1462
1462
  r.isHeld(b) || q(b);
1463
1463
  });
1464
1464
  };
@@ -1472,12 +1472,12 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1472
1472
  S !== void 0 && S.snapshot.status !== "deferred" || (y(b, !1, !1), l());
1473
1473
  },
1474
1474
  open: (b) => {
1475
- const S = r.resumes(b), M = A(b), L = n.get(b);
1476
- if (L === void 0 || L.snapshot.status === "deferred")
1477
- return y(b, !0, !1), l(), M;
1478
- if (g(b, L), S) return M;
1479
- const { snapshot: P } = L;
1480
- return P.status === "pending" ? (L.opened = !0, M) : P.document.kind === "failure" ? (L.opened || v(L) ? (s.add(P), y(b, !0, !1), l()) : L.opened = !0, M) : (L.opened = !0, L.background === null && v(L) && C(b, L), M);
1475
+ const S = r.resumes(b), L = A(b), M = n.get(b);
1476
+ if (M === void 0 || M.snapshot.status === "deferred")
1477
+ return y(b, !0, !1), l(), L;
1478
+ if (g(b, M), S) return L;
1479
+ const { snapshot: P } = M;
1480
+ return P.status === "pending" ? (M.opened = !0, L) : P.document.kind === "failure" ? (M.opened || v(M) ? (s.add(P), y(b, !0, !1), l()) : M.opened = !0, L) : (M.opened = !0, M.background === null && v(M) && O(b, M), L);
1481
1481
  },
1482
1482
  retain: A,
1483
1483
  retry: (b) => {
@@ -1485,54 +1485,54 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1485
1485
  S === void 0 || S.snapshot.status !== "loaded" || S.snapshot.document.kind !== "failure" || (y(b, !0, !1), l());
1486
1486
  },
1487
1487
  seed: (b, S) => {
1488
- const M = performance.now(), L = $e(
1488
+ const L = performance.now(), M = $e(
1489
1489
  S.then(
1490
1490
  (k) => k === null ? gn : { status: "loaded", document: k },
1491
1491
  () => gn
1492
1492
  )
1493
1493
  ), P = n.get(b);
1494
1494
  if (P !== void 0 && P.snapshot.status === "loaded") {
1495
- const k = P.snapshot, O = {};
1496
- P.background = O, L.then((N) => {
1495
+ const k = P.snapshot, C = {};
1496
+ P.background = C, M.then((N) => {
1497
1497
  if (N.status === "loaded") {
1498
- T(b, P, O, k, N.document, M);
1498
+ T(b, P, C, k, N.document, L);
1499
1499
  return;
1500
1500
  }
1501
- P.background === O && (P.background = null);
1501
+ P.background === C && (P.background = null);
1502
1502
  });
1503
1503
  return;
1504
1504
  }
1505
- const H = P !== void 0 && P.snapshot.status === "pending" ? P.snapshot.previous : null, K = { status: "pending", promise: L, previous: H }, w = { snapshot: K, validatedAt: M, opened: P?.opened === !0, background: null, refreshPending: P?.refreshPending === !0, seeded: K, stamp: d() };
1506
- g(b, w), h(), L.then((k) => {
1505
+ const H = P !== void 0 && P.snapshot.status === "pending" ? P.snapshot.previous : null, K = { status: "pending", promise: M, previous: H }, w = { snapshot: K, validatedAt: L, opened: P?.opened === !0, background: null, refreshPending: P?.refreshPending === !0, seeded: K, stamp: d() };
1506
+ g(b, w), h(), M.then((k) => {
1507
1507
  n.get(b) === w && (k.status === "deferred" && r.isHeld(b) ? y(b, w.opened, !1) : (w.snapshot = k, w.stamp = d()), l());
1508
1508
  });
1509
1509
  },
1510
1510
  invalidate: () => {
1511
1511
  let b = !1;
1512
- for (const [S, M] of [...n]) {
1513
- if (M.validatedAt = Number.NEGATIVE_INFINITY, M.opened = !0, M.refreshPending = !0, !r.isHeld(S)) continue;
1514
- const { snapshot: L } = M;
1515
- if (L.status !== "pending") {
1516
- R(S, M) && (b = !0);
1512
+ for (const [S, L] of [...n]) {
1513
+ if (L.validatedAt = Number.NEGATIVE_INFINITY, L.opened = !0, L.refreshPending = !0, !r.isHeld(S)) continue;
1514
+ const { snapshot: M } = L;
1515
+ if (M.status !== "pending") {
1516
+ R(S, L) && (b = !0);
1517
1517
  continue;
1518
1518
  }
1519
- L.promise.then(() => {
1520
- n.get(S) === M && M.refreshPending && r.isHeld(S) && R(S, M) && l();
1519
+ M.promise.then(() => {
1520
+ n.get(S) === L && L.refreshPending && r.isHeld(S) && R(S, L) && l();
1521
1521
  });
1522
1522
  }
1523
1523
  b && l();
1524
1524
  },
1525
1525
  refresh: async (b) => {
1526
1526
  const S = n.get(b);
1527
- if (S !== void 0 && ma(S.snapshot)) {
1527
+ if (S !== void 0 && va(S.snapshot)) {
1528
1528
  S.refreshPending = !0;
1529
- const P = await C(b, S);
1529
+ const P = await O(b, S);
1530
1530
  return P === null ? Ve : P.kind === "failure" ? { status: "failed", failure: P.failure } : p(b, S, !0);
1531
1531
  }
1532
- const M = y(b, !0, !0);
1533
- if (l(), M.snapshot.status !== "pending") return Ve;
1534
- const L = await M.snapshot.promise;
1535
- return n.get(b) !== M || L.status !== "loaded" ? Ve : L.document.kind === "failure" ? je : (await D(b, L), p(b, M, !1));
1532
+ const L = y(b, !0, !0);
1533
+ if (l(), L.snapshot.status !== "pending") return Ve;
1534
+ const M = await L.snapshot.promise;
1535
+ return n.get(b) !== L || M.status !== "loaded" ? Ve : M.document.kind === "failure" ? je : (await D(b, M), p(b, L, !1));
1536
1536
  },
1537
1537
  clear: () => {
1538
1538
  n.clear();
@@ -1543,19 +1543,19 @@ const ua = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(da, { children:
1543
1543
  readPart: x,
1544
1544
  noteShown: (b, S) => {
1545
1545
  i.set(b, S);
1546
- const M = f.get(b);
1547
- if (M !== void 0) {
1546
+ const L = f.get(b);
1547
+ if (L !== void 0) {
1548
1548
  f.delete(b);
1549
- for (const L of M) L();
1549
+ for (const M of L) M();
1550
1550
  }
1551
1551
  },
1552
1552
  noteFailureShown: (b) => s.has(b) ? !1 : (s.add(b), !0)
1553
1553
  };
1554
- }, we = ve("fill"), pa = Object.freeze({ blockSize: "100%" }), Be = ({ scrollerProps: e, children: t }) => se(we) === "content" ? /* @__PURE__ */ c(sn, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(sn, { scrollerProps: { ...e, style: pa }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: br, children: t }), ga = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), wa = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), Oe = ({ label: e, testId: t }) => /* @__PURE__ */ B(pe, { children: [
1555
- /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": t, children: ga.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
1554
+ }, we = ve("fill"), ya = "--aqmx-tap-circle-gutter", ka = Object.freeze({ blockSize: "100%", [ya]: `${String(Er)}px` }), Be = ({ scrollerProps: e, children: t }) => se(we) === "content" ? /* @__PURE__ */ c(sn, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(sn, { scrollerProps: { ...e, style: ka }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: br, children: t }), Ea = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), Sa = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), Ce = ({ label: e, testId: t }) => /* @__PURE__ */ B(pe, { children: [
1555
+ /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": t, children: Ea.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
1556
1556
  /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: e })
1557
- ] }), qt = ({ failure: e, onRetry: t, testId: n }) => /* @__PURE__ */ c(Be, { scrollerProps: wa, children: /* @__PURE__ */ c(Re, { failure: e, alert: !1, onRetry: t, testId: n }) });
1558
- function va({
1557
+ ] }), qt = ({ failure: e, onRetry: t, testId: n }) => /* @__PURE__ */ c(Be, { scrollerProps: Sa, children: /* @__PURE__ */ c(Re, { failure: e, alert: !1, onRetry: t, testId: n }) });
1558
+ function xa({
1559
1559
  title: e,
1560
1560
  titleId: t,
1561
1561
  ...n
@@ -1580,8 +1580,8 @@ function va({
1580
1580
  clipRule: "evenodd"
1581
1581
  }));
1582
1582
  }
1583
- const ba = /* @__PURE__ */ E.forwardRef(va);
1584
- function ya({
1583
+ const Ta = /* @__PURE__ */ E.forwardRef(xa);
1584
+ function Ra({
1585
1585
  title: e,
1586
1586
  titleId: t,
1587
1587
  ...n
@@ -1604,8 +1604,8 @@ function ya({
1604
1604
  d: "M3.5 6A1.5 1.5 0 0 0 2 7.5v9A1.5 1.5 0 0 0 3.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L8.44 6.439A1.5 1.5 0 0 0 7.378 6H3.5Z"
1605
1605
  }));
1606
1606
  }
1607
- const ka = /* @__PURE__ */ E.forwardRef(ya);
1608
- function Ea({
1607
+ const Ca = /* @__PURE__ */ E.forwardRef(Ra);
1608
+ function Oa({
1609
1609
  title: e,
1610
1610
  titleId: t,
1611
1611
  ...n
@@ -1626,33 +1626,33 @@ function Ea({
1626
1626
  clipRule: "evenodd"
1627
1627
  }));
1628
1628
  }
1629
- const Sa = /* @__PURE__ */ E.forwardRef(Ea), xa = 2e3, wn = Object.freeze({ outcome: "idle" }), Ta = (e) => {
1629
+ const La = /* @__PURE__ */ E.forwardRef(Oa), Ma = 2e3, wn = Object.freeze({ outcome: "idle" }), Aa = (e) => {
1630
1630
  const t = navigator.clipboard;
1631
1631
  return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
1632
- }, Ra = ({ text: e }) => {
1632
+ }, Na = ({ text: e }) => {
1633
1633
  const { announcer: t, labels: n } = $(), [r, o] = V(wn);
1634
1634
  ee(() => {
1635
1635
  if (r.outcome === "idle") return;
1636
- const f = setTimeout(() => o(wn), xa);
1636
+ const f = setTimeout(() => o(wn), Ma);
1637
1637
  return () => clearTimeout(f);
1638
1638
  }, [r]);
1639
1639
  const s = (f) => {
1640
1640
  o({ outcome: f }), t.announce(f === "copied" ? n.copiedText : n.copyTextFailed);
1641
1641
  }, a = () => {
1642
- Ta(e).then(
1642
+ Aa(e).then(
1643
1643
  () => s("copied"),
1644
1644
  () => s("failed")
1645
1645
  );
1646
1646
  }, i = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
1647
1647
  return (
1648
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: i, onClick: a, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(ba, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(Sa, {}) : /* @__PURE__ */ c(ka, {}) })
1648
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: i, onClick: a, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(Ta, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(La, {}) : /* @__PURE__ */ c(Ca, {}) })
1649
1649
  );
1650
- }, kr = ve(null), Oa = () => {
1651
- const e = se(kr);
1650
+ }, xr = ve(null), Da = () => {
1651
+ const e = se(xr);
1652
1652
  if (e === null) throw new Error("[markdown-explorer] a document's content reads its own part only inside a document pane (DocumentContentChannelContext)");
1653
1653
  return e;
1654
1654
  };
1655
- function Ca({
1655
+ function Pa({
1656
1656
  title: e,
1657
1657
  titleId: t,
1658
1658
  ...n
@@ -1673,8 +1673,8 @@ function Ca({
1673
1673
  d: "M3.5 12.75a.75.75 0 0 0-1.5 0v2.5A2.75 2.75 0 0 0 4.75 18h10.5A2.75 2.75 0 0 0 18 15.25v-2.5a.75.75 0 0 0-1.5 0v2.5c0 .69-.56 1.25-1.25 1.25H4.75c-.69 0-1.25-.56-1.25-1.25v-2.5Z"
1674
1674
  }));
1675
1675
  }
1676
- const Ma = /* @__PURE__ */ E.forwardRef(Ca);
1677
- function La({
1676
+ const Ia = /* @__PURE__ */ E.forwardRef(Pa);
1677
+ function $a({
1678
1678
  title: e,
1679
1679
  titleId: t,
1680
1680
  ...n
@@ -1699,17 +1699,17 @@ function La({
1699
1699
  clipRule: "evenodd"
1700
1700
  }));
1701
1701
  }
1702
- const Aa = /* @__PURE__ */ E.forwardRef(La), Ue = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
1702
+ const _a = /* @__PURE__ */ E.forwardRef($a), Ue = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
1703
1703
  const { labels: s } = $();
1704
1704
  return /* @__PURE__ */ B("div", { className: "aqmx-document-toolbar", children: [
1705
1705
  /* @__PURE__ */ c("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
1706
1706
  /* @__PURE__ */ c("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
1707
1707
  o,
1708
- /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": s.openInNewTab, title: s.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(Aa, {}) }),
1709
- /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": s.download, title: s.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(Ma, {}) })
1708
+ /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": s.openInNewTab, title: s.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(_a, {}) }),
1709
+ /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": s.download, title: s.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(Ia, {}) })
1710
1710
  ] });
1711
1711
  };
1712
- function Na({
1712
+ function Fa({
1713
1713
  title: e,
1714
1714
  titleId: t,
1715
1715
  ...n
@@ -1730,39 +1730,39 @@ function Na({
1730
1730
  clipRule: "evenodd"
1731
1731
  }));
1732
1732
  }
1733
- const Da = /* @__PURE__ */ E.forwardRef(Na), Pa = Object.freeze({ className: "aqmx-document-stage" }), Ia = ({ document: e }) => {
1733
+ const qa = /* @__PURE__ */ E.forwardRef(Fa), Ba = Object.freeze({ className: "aqmx-document-stage" }), Ua = ({ document: e }) => {
1734
1734
  const { labels: t } = $();
1735
1735
  return /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
1736
- /* @__PURE__ */ c(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(Da, {}) }),
1737
- /* @__PURE__ */ c(Be, { scrollerProps: Pa, children: /* @__PURE__ */ B("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1736
+ /* @__PURE__ */ c(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(qa, {}) }),
1737
+ /* @__PURE__ */ c(Be, { scrollerProps: Ba, children: /* @__PURE__ */ B("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1738
1738
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
1739
1739
  /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
1740
1740
  ] }) })
1741
1741
  ] });
1742
- }, st = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", $a = (e) => {
1742
+ }, st = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", Ha = (e) => {
1743
1743
  const t = e.indexOf("#");
1744
1744
  return t === -1 ? "" : e.slice(t);
1745
- }, _a = /(%[0-9A-Fa-f]{2})/u, Bt = (e) => {
1745
+ }, za = /(%[0-9A-Fa-f]{2})/u, Bt = (e) => {
1746
1746
  if (!e.startsWith("#") || e.length === 1) return null;
1747
- const t = new TextEncoder(), n = e.slice(1).split(_a).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1747
+ const t = new TextEncoder(), n = e.slice(1).split(za).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1748
1748
  return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
1749
- }, Er = (e) => `#${encodeURIComponent(e)}`, Fa = (e) => {
1749
+ }, Tr = (e) => `#${encodeURIComponent(e)}`, ja = (e) => {
1750
1750
  if (e === "#") return !0;
1751
1751
  const t = Bt(e);
1752
1752
  return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
1753
- }, Sr = (e, t) => {
1753
+ }, Rr = (e, t) => {
1754
1754
  if (t === "") return null;
1755
1755
  for (const n of e.querySelectorAll("[id]"))
1756
1756
  if (n.id === t) return n;
1757
1757
  return null;
1758
- }, qa = "http://www.w3.org/1999/xhtml", vn = (e, t) => {
1758
+ }, Va = "http://www.w3.org/1999/xhtml", vn = (e, t) => {
1759
1759
  if (t === "") return null;
1760
- const n = Sr(e, t);
1760
+ const n = Rr(e, t);
1761
1761
  if (n !== null) return n;
1762
1762
  for (const r of e.querySelectorAll("a[name]"))
1763
- if (r.localName === "a" && r.namespaceURI === qa && r.getAttribute("name") === t) return r;
1763
+ if (r.localName === "a" && r.namespaceURI === Va && r.getAttribute("name") === t) return r;
1764
1764
  return null;
1765
- }, xr = (e, t) => {
1765
+ }, Cr = (e, t) => {
1766
1766
  if (e === null || !t.startsWith("#")) return null;
1767
1767
  const n = vn(e, t.slice(1));
1768
1768
  if (n !== null) return n;
@@ -1776,22 +1776,22 @@ const Da = /* @__PURE__ */ E.forwardRef(Na), Pa = Object.freeze({ className: "aq
1776
1776
  }
1777
1777
  const { overflowY: r } = getComputedStyle(e);
1778
1778
  return r === "auto" || r === "scroll";
1779
- }, Ba = (e) => {
1779
+ }, Za = (e) => {
1780
1780
  const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
1781
1781
  return o !== "hidden" && o !== "clip";
1782
- }, Ua = (e, t) => {
1782
+ }, Wa = (e, t) => {
1783
1783
  const n = t.closest(st), r = n !== null && e.contains(n) ? n : e;
1784
1784
  if (r.scrollHeight > r.clientHeight && bn(r)) return r;
1785
1785
  const o = e.getBoundingClientRect().height, { documentElement: s, scrollingElement: a } = e.ownerDocument;
1786
1786
  for (let i = e.parentElement; i !== null && i !== s; i = i.parentElement)
1787
1787
  if (bn(i) && i.scrollHeight > i.clientHeight && i.clientHeight < o) return i;
1788
- return a instanceof Element && Ba(e.ownerDocument) && a.scrollHeight > a.clientHeight && a.clientHeight < o ? a : r;
1789
- }, Ha = Object.freeze({
1790
- scrollerOf: Ua,
1788
+ return a instanceof Element && Za(e.ownerDocument) && a.scrollHeight > a.clientHeight && a.clientHeight < o ? a : r;
1789
+ }, Ga = Object.freeze({
1790
+ scrollerOf: Wa,
1791
1791
  reveal: (e) => {
1792
- e.scrollIntoView(Mt);
1792
+ e.scrollIntoView(Lt);
1793
1793
  }
1794
- }), Mt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), za = (e, t) => {
1794
+ }), Lt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), Ka = (e, t) => {
1795
1795
  for (let n = t; n !== null && n !== e; n = n.parentElement) {
1796
1796
  const r = n.parentElement;
1797
1797
  if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
@@ -1799,23 +1799,23 @@ const Da = /* @__PURE__ */ E.forwardRef(Na), Pa = Object.freeze({ className: "aq
1799
1799
  n.removeAttribute("hidden");
1800
1800
  }
1801
1801
  }
1802
- }, ja = (e, t) => {
1802
+ }, Ya = (e, t) => {
1803
1803
  if (t.getClientRects().length === 0) return;
1804
1804
  const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), s = Number.parseFloat(r), a = t.getBoundingClientRect(), i = a.height + s + Number.parseFloat(o) > e.clientHeight;
1805
1805
  if (!i && Math.abs(a.top - s - n) < 1) {
1806
- t.scrollIntoView(Mt);
1806
+ t.scrollIntoView(Lt);
1807
1807
  return;
1808
1808
  }
1809
- e.scrollBy({ top: i ? a.top - n - e.clientHeight : a.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Mt);
1810
- }, Va = (e, t) => {
1809
+ e.scrollBy({ top: i ? a.top - n - e.clientHeight : a.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Lt);
1810
+ }, Xa = (e, t) => {
1811
1811
  const n = t.scrollerOf(e, e.querySelector(st) ?? e);
1812
1812
  n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
1813
1813
  }, yn = (e, t, n) => {
1814
1814
  if (e === null) return null;
1815
- const r = xr(e, t);
1816
- return r === null ? (Fa(t) && Va(e, n), null) : (za(e, r), ja(n.scrollerOf(e, r), r), n.reveal(r), r);
1815
+ const r = Cr(e, t);
1816
+ return r === null ? (ja(t) && Xa(e, n), null) : (Ka(e, r), Ya(n.scrollerOf(e, r), r), n.reveal(r), r);
1817
1817
  };
1818
- function Za({
1818
+ function Ja({
1819
1819
  title: e,
1820
1820
  titleId: t,
1821
1821
  ...n
@@ -1834,8 +1834,8 @@ function Za({
1834
1834
  d: "M3.28 2.22a.75.75 0 0 0-1.06 1.06L5.44 6.5H2.75a.75.75 0 0 0 0 1.5h4.5A.75.75 0 0 0 8 7.25v-4.5a.75.75 0 0 0-1.5 0v2.69L3.28 2.22ZM13.5 2.75a.75.75 0 0 0-1.5 0v4.5c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-2.69l3.22-3.22a.75.75 0 0 0-1.06-1.06L13.5 5.44V2.75ZM3.28 17.78l3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 1 0 1.06 1.06ZM13.5 14.56l3.22 3.22a.75.75 0 1 0 1.06-1.06l-3.22-3.22h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0v-2.69Z"
1835
1835
  }));
1836
1836
  }
1837
- const Wa = /* @__PURE__ */ E.forwardRef(Za);
1838
- function Ga({
1837
+ const Qa = /* @__PURE__ */ E.forwardRef(Ja);
1838
+ function ei({
1839
1839
  title: e,
1840
1840
  titleId: t,
1841
1841
  ...n
@@ -1858,8 +1858,8 @@ function Ga({
1858
1858
  clipRule: "evenodd"
1859
1859
  }));
1860
1860
  }
1861
- const Ka = /* @__PURE__ */ E.forwardRef(Ga);
1862
- function Ya({
1861
+ const ti = /* @__PURE__ */ E.forwardRef(ei);
1862
+ function ni({
1863
1863
  title: e,
1864
1864
  titleId: t,
1865
1865
  ...n
@@ -1882,8 +1882,8 @@ function Ya({
1882
1882
  clipRule: "evenodd"
1883
1883
  }));
1884
1884
  }
1885
- const Xa = /* @__PURE__ */ E.forwardRef(Ya);
1886
- function Ja({
1885
+ const ri = /* @__PURE__ */ E.forwardRef(ni);
1886
+ function oi({
1887
1887
  title: e,
1888
1888
  titleId: t,
1889
1889
  ...n
@@ -1904,7 +1904,7 @@ function Ja({
1904
1904
  clipRule: "evenodd"
1905
1905
  }));
1906
1906
  }
1907
- const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = Object.freeze({ [Lt]: "allow" }), ei = `[${Lt}="${At[Lt]}"]`, ti = () => {
1907
+ const si = /* @__PURE__ */ E.forwardRef(oi), Mt = "data-aqmx-key-repeat", At = Object.freeze({ [Mt]: "allow" }), ai = `[${Mt}="${At[Mt]}"]`, ii = () => {
1908
1908
  let e = null;
1909
1909
  return {
1910
1910
  onKeyDownCapture: (t) => {
@@ -1913,7 +1913,7 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
1913
1913
  e = t.target instanceof Element ? t.target : null;
1914
1914
  return;
1915
1915
  }
1916
- e !== null && t.target === e && e.closest(ei) !== null || (t.preventDefault(), t.stopPropagation());
1916
+ e !== null && t.target === e && e.closest(ai) !== null || (t.preventDefault(), t.stopPropagation());
1917
1917
  }
1918
1918
  },
1919
1919
  onKeyUpCapture: (t) => {
@@ -1923,7 +1923,7 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
1923
1923
  t.target === e && (e = null);
1924
1924
  }
1925
1925
  };
1926
- }, Ke = Object.freeze([1 / Le ** 2, 1 / Le, 1, Le, Le ** 2]), kn = Object.freeze({ mode: "fit" }), ni = 1, Tr = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), En = `[data-testid="${Tr["data-testid"]}"]`, ri = ve(null), oi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= ni ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Sn = (e, t, n) => {
1926
+ }, Ke = Object.freeze([1 / Me ** 2, 1 / Me, 1, Me, Me ** 2]), kn = Object.freeze({ mode: "fit" }), li = 1, Or = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), En = `[data-testid="${Or["data-testid"]}"]`, ci = ve(null), di = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= li ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Sn = (e, t, n) => {
1927
1927
  if (e.mode === "level") {
1928
1928
  const o = e.index + n;
1929
1929
  return o >= 0 && o < Ke.length ? o : null;
@@ -1939,19 +1939,19 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
1939
1939
  if (t === null) return null;
1940
1940
  const r = Sn(e, t.scale, n);
1941
1941
  return r === null ? null : { mode: "level", index: r, base: t.base };
1942
- }, si = (e, t) => {
1942
+ }, ui = (e, t) => {
1943
1943
  if (e <= 0 || t <= 0) return 0;
1944
- const n = Math.trunc(Math.log(t / e) / Math.log(Le));
1944
+ const n = Math.trunc(Math.log(t / e) / Math.log(Me));
1945
1945
  return n === 0 ? 0 : n;
1946
1946
  }, Tn = (e) => {
1947
1947
  const t = e[0], n = e[1];
1948
1948
  return e.length !== 2 || t === void 0 || n === void 0 ? null : { distance: Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY), middle: { x: (t.clientX + n.clientX) / 2, y: (t.clientY + n.clientY) / 2 } };
1949
- }, ai = (e) => {
1949
+ }, fi = (e) => {
1950
1950
  const t = Ke[e];
1951
1951
  if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
1952
1952
  return t;
1953
- }, Rn = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, ii = ({ document: e }) => {
1954
- const { labels: t } = $(), n = se(ri), [r] = V(() => n === null ? null : n.read(e.url)), [o, s] = V(r === null ? kn : r.zoom), [a, i] = V(r === null ? null : r.reported), [f, u] = V(null), l = U(null), d = F((D) => {
1953
+ }, Rn = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, mi = ({ document: e }) => {
1954
+ const { labels: t } = $(), n = se(ci), [r] = V(() => n === null ? null : n.read(e.url)), [o, s] = V(r === null ? kn : r.zoom), [a, i] = V(r === null ? null : r.reported), [f, u] = V(null), l = U(null), d = F((D) => {
1955
1955
  const { naturalWidth: m, naturalHeight: p } = D;
1956
1956
  i((x) => Rn(x, m, p));
1957
1957
  }, []), h = F(
@@ -1974,9 +1974,9 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
1974
1974
  const p = new ResizeObserver(m);
1975
1975
  return p.observe(D), () => p.disconnect();
1976
1976
  }, [a, o.mode]);
1977
- const g = a === null || f === null ? null : oi(a, f), v = xn(o, g, -1), y = xn(o, g, 1), T = o.mode === "level" ? ai(o.index) : null, C = U({ zoomIn: y, zoomOut: v });
1977
+ const g = a === null || f === null ? null : di(a, f), v = xn(o, g, -1), y = xn(o, g, 1), T = o.mode === "level" ? fi(o.index) : null, O = U({ zoomIn: y, zoomOut: v });
1978
1978
  Y(() => {
1979
- C.current = { zoomIn: y, zoomOut: v };
1979
+ O.current = { zoomIn: y, zoomOut: v };
1980
1980
  });
1981
1981
  const R = U(null);
1982
1982
  Y(() => {
@@ -1993,13 +1993,13 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
1993
1993
  const _ = Tn(I.touches);
1994
1994
  if (m === null || _ === null) return;
1995
1995
  I.preventDefault();
1996
- const b = si(m.distance, _.distance);
1996
+ const b = ui(m.distance, _.distance);
1997
1997
  if (b === m.steps) return;
1998
- const S = b > m.steps ? 1 : -1, M = S === 1 ? C.current.zoomIn : C.current.zoomOut;
1999
- if (M === null) return;
1998
+ const S = b > m.steps ? 1 : -1, L = S === 1 ? O.current.zoomIn : O.current.zoomOut;
1999
+ if (L === null) return;
2000
2000
  m.steps += S;
2001
- const L = D.getBoundingClientRect(), P = _.middle.x - L.left, H = _.middle.y - L.top;
2002
- R.current = D.scrollWidth > 0 && D.scrollHeight > 0 ? { x: P, y: H, across: (D.scrollLeft + P) / D.scrollWidth, down: (D.scrollTop + H) / D.scrollHeight } : null, s(M);
2001
+ const M = D.getBoundingClientRect(), P = _.middle.x - M.left, H = _.middle.y - M.top;
2002
+ R.current = D.scrollWidth > 0 && D.scrollHeight > 0 ? { x: P, y: H, across: (D.scrollLeft + P) / D.scrollWidth, down: (D.scrollTop + H) / D.scrollHeight } : null, s(L);
2003
2003
  }, A = (I) => {
2004
2004
  I.touches.length < 2 && (m = null);
2005
2005
  };
@@ -2009,7 +2009,7 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2009
2009
  }, []);
2010
2010
  const q = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
2011
2011
  return /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
2012
- /* @__PURE__ */ B(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(Qa, {}), children: [
2012
+ /* @__PURE__ */ B(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(si, {}), children: [
2013
2013
  /* @__PURE__ */ c(
2014
2014
  "button",
2015
2015
  {
@@ -2022,7 +2022,7 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2022
2022
  v !== null && s(v);
2023
2023
  },
2024
2024
  ...At,
2025
- children: /* @__PURE__ */ c(Ka, {})
2025
+ children: /* @__PURE__ */ c(ti, {})
2026
2026
  }
2027
2027
  ),
2028
2028
  /* @__PURE__ */ c("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: T === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(T * 100)) }),
@@ -2038,32 +2038,32 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2038
2038
  y !== null && s(y);
2039
2039
  },
2040
2040
  ...At,
2041
- children: /* @__PURE__ */ c(Xa, {})
2041
+ children: /* @__PURE__ */ c(ri, {})
2042
2042
  }
2043
2043
  ),
2044
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => s(kn), children: /* @__PURE__ */ c(Wa, {}) })
2044
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => s(kn), children: /* @__PURE__ */ c(Qa, {}) })
2045
2045
  ] }),
2046
- /* @__PURE__ */ c(Be, { scrollerProps: Tr, children: /* @__PURE__ */ c("img", { ref: h, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: q, onLoad: (D) => d(D.currentTarget), "data-testid": "markdown-explorer-image" }) })
2046
+ /* @__PURE__ */ c(Be, { scrollerProps: Or, children: /* @__PURE__ */ c("img", { ref: h, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: q, onLoad: (D) => d(D.currentTarget), "data-testid": "markdown-explorer-image" }) })
2047
2047
  ] });
2048
- }, li = async (e, t, n) => {
2048
+ }, hi = async (e, t, n) => {
2049
2049
  const r = await e.text(t, n);
2050
2050
  if (!("kind" in r)) throw n.reason;
2051
2051
  return r.kind === "text" ? { kind: "text", text: r.text, truncated: r.truncated } : { kind: "failure", retryable: r.failure.reason === "failed" };
2052
- }, Rr = ve(null), at = ve(void 0), Or = ve(null), it = () => {
2053
- const e = se(Rr);
2052
+ }, Lr = ve(null), at = ve(void 0), Mr = ve(null), it = () => {
2053
+ const e = se(Lr);
2054
2054
  if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
2055
2055
  return e;
2056
- }, ci = () => {
2057
- const e = se(Or);
2056
+ }, pi = () => {
2057
+ const e = se(Mr);
2058
2058
  if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
2059
2059
  return e;
2060
- }, lt = (e, t, n, r) => t.kind === "panel" ? Ne(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? Ne(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : Ne(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), di = ({ children: e }) => {
2060
+ }, lt = (e, t, n, r) => t.kind === "panel" ? Ne(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? Ne(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : Ne(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), gi = ({ children: e }) => {
2061
2061
  const { config: t } = $(), n = it(), r = $t(), o = r.kind === "location" ? r.location.source : void 0, s = nt(lt(t, n.navigation, o, n.currentPath));
2062
- return /* @__PURE__ */ c(at, { value: o, children: /* @__PURE__ */ c(Or, { value: s, children: e }) });
2063
- }, ui = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', fi = (e) => {
2064
- const t = e instanceof Element ? e.closest(ui) : null;
2062
+ return /* @__PURE__ */ c(at, { value: o, children: /* @__PURE__ */ c(Mr, { value: s, children: e }) });
2063
+ }, wi = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', vi = (e) => {
2064
+ const t = e instanceof Element ? e.closest(wi) : null;
2065
2065
  return t === null ? null : t.getAttribute("data-doc-path");
2066
- }, ct = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, mi = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: s, onDocumentLink: a, scope: i, children: f }) => {
2066
+ }, ct = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, bi = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: s, onDocumentLink: a, scope: i, children: f }) => {
2067
2067
  const u = nt(e);
2068
2068
  return /* @__PURE__ */ c("a", { ...s, href: u, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (d) => {
2069
2069
  if (ct(d)) {
@@ -2074,10 +2074,10 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2074
2074
  a(t, n);
2075
2075
  }
2076
2076
  }, children: f });
2077
- }, hi = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: s }) => {
2078
- const { config: a } = $(), i = it(), f = se(at), u = $a(e), { navigation: l } = i, d = `${lt(a, l, f, t)}${u}`, h = n === !1 ? "false" : void 0;
2079
- return l.kind === "page" ? /* @__PURE__ */ c(ia, { ...o, to: d, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": h, children: s }) : /* @__PURE__ */ c(mi, { to: d, docPath: t, fragment: u, exists: h, className: r, attributes: o, onDocumentLink: l.onDocumentLink, scope: i, children: s });
2080
- }, pi = ({ className: e, attributes: t, children: n }) => {
2077
+ }, yi = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: s }) => {
2078
+ const { config: a } = $(), i = it(), f = se(at), u = Ha(e), { navigation: l } = i, d = `${lt(a, l, f, t)}${u}`, h = n === !1 ? "false" : void 0;
2079
+ return l.kind === "page" ? /* @__PURE__ */ c(fa, { ...o, to: d, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": h, children: s }) : /* @__PURE__ */ c(bi, { to: d, docPath: t, fragment: u, exists: h, className: r, attributes: o, onDocumentLink: l.onDocumentLink, scope: i, children: s });
2080
+ }, ki = ({ className: e, attributes: t, children: n }) => {
2081
2081
  const { labels: r } = $();
2082
2082
  return (
2083
2083
  /* @__PURE__ */ B("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
@@ -2089,34 +2089,34 @@ const Qa = /* @__PURE__ */ E.forwardRef(Ja), Lt = "data-aqmx-key-repeat", At = O
2089
2089
  ] })
2090
2090
  ] })
2091
2091
  );
2092
- }, gi = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
2092
+ }, Ei = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
2093
2093
  const { config: s } = $(), a = se(at), i = nt(`${lt(s, r.navigation, a, r.currentPath)}${e}`);
2094
2094
  return /* @__PURE__ */ c("a", { ...n, href: i, className: t, onClick: (u) => {
2095
2095
  ct(u) && (u.preventDefault(), r.scrollWithin(e));
2096
2096
  }, children: o });
2097
- }, wi = ({ href: e, className: t, attributes: n, children: r }) => {
2097
+ }, Si = ({ href: e, className: t, attributes: n, children: r }) => {
2098
2098
  const o = it();
2099
2099
  return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (a) => {
2100
2100
  if (!ct(a)) return;
2101
2101
  const i = a.currentTarget;
2102
2102
  e === "#" ? o.followEmptyFragment(a.nativeEvent) : i.href === i.ownerDocument.URL && o.followSameUrlJump(e, a.nativeEvent);
2103
- }, children: r }) : /* @__PURE__ */ c(gi, { href: e, className: t, attributes: n, scope: o, children: r });
2104
- }, vi = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: s, children: a }) => t === "doc" ? n === void 0 || !Lo(n) ? /* @__PURE__ */ c(pi, { className: o, attributes: s, children: a }) : /* @__PURE__ */ c(hi, { href: e, docPath: n, docExists: r, className: o, attributes: s, children: a }) : e.startsWith("#") ? /* @__PURE__ */ c(wi, { href: e, className: o, attributes: s, children: a }) : /* @__PURE__ */ c("a", { ...s, href: e, className: o, children: a }), bi = () => {
2103
+ }, children: r }) : /* @__PURE__ */ c(Ei, { href: e, className: t, attributes: n, scope: o, children: r });
2104
+ }, xi = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: s, children: a }) => t === "doc" ? n === void 0 || !Io(n) ? /* @__PURE__ */ c(ki, { className: o, attributes: s, children: a }) : /* @__PURE__ */ c(yi, { href: e, docPath: n, docExists: r, className: o, attributes: s, children: a }) : e.startsWith("#") ? /* @__PURE__ */ c(Si, { href: e, className: o, attributes: s, children: a }) : /* @__PURE__ */ c("a", { ...s, href: e, className: o, children: a }), Ti = () => {
2105
2105
  const { config: e } = $(), t = it(), n = se(at), r = ot();
2106
2106
  return F(
2107
2107
  (o, s) => {
2108
2108
  if (!ct(s)) return !0;
2109
2109
  s.preventDefault();
2110
- const a = Er(o.id), { navigation: i } = t;
2110
+ const a = Tr(o.id), { navigation: i } = t;
2111
2111
  return i.kind === "panel" || Bt(s.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(a), !0) : (r(`${lt(e, i, n, t.currentPath)}${a}`, "follow-link"), !0);
2112
2112
  },
2113
2113
  [e, t, n, r]
2114
2114
  );
2115
- }, yi = () => {
2116
- const e = ci();
2117
- return F((t) => `${e}${Er(t.id)}`, [e]);
2115
+ }, Ri = () => {
2116
+ const e = pi();
2117
+ return F((t) => `${e}${Tr(t.id)}`, [e]);
2118
2118
  };
2119
- function ki({
2119
+ function Ci({
2120
2120
  title: e,
2121
2121
  titleId: t,
2122
2122
  ...n
@@ -2135,8 +2135,8 @@ function ki({
2135
2135
  d: "M3 3.5A1.5 1.5 0 0 1 4.5 2h6.879a1.5 1.5 0 0 1 1.06.44l4.122 4.12A1.5 1.5 0 0 1 17 7.622V16.5a1.5 1.5 0 0 1-1.5 1.5h-11A1.5 1.5 0 0 1 3 16.5v-13Z"
2136
2136
  }));
2137
2137
  }
2138
- const Ei = /* @__PURE__ */ E.forwardRef(ki);
2139
- function Si({
2138
+ const Oi = /* @__PURE__ */ E.forwardRef(Ci);
2139
+ function Li({
2140
2140
  title: e,
2141
2141
  titleId: t,
2142
2142
  ...n
@@ -2157,8 +2157,8 @@ function Si({
2157
2157
  clipRule: "evenodd"
2158
2158
  }));
2159
2159
  }
2160
- const xi = /* @__PURE__ */ E.forwardRef(Si);
2161
- function Ti({
2160
+ const Mi = /* @__PURE__ */ E.forwardRef(Li);
2161
+ function Ai({
2162
2162
  title: e,
2163
2163
  titleId: t,
2164
2164
  ...n
@@ -2179,9 +2179,9 @@ function Ti({
2179
2179
  clipRule: "evenodd"
2180
2180
  }));
2181
2181
  }
2182
- const Ri = /* @__PURE__ */ E.forwardRef(Ti), Oi = Object.freeze({ className: "aqmx-document-stage" }), Ci = () => () => {
2183
- }, Mi = () => navigator.pdfViewerEnabled !== !1, Li = () => null, Ai = ({ document: e }) => {
2184
- const { labels: t } = $(), n = oe(Ci, Mi, Li);
2182
+ const Ni = /* @__PURE__ */ E.forwardRef(Ai), Di = Object.freeze({ className: "aqmx-document-stage" }), Pi = () => () => {
2183
+ }, Ii = () => navigator.pdfViewerEnabled !== !1, $i = () => null, _i = ({ document: e }) => {
2184
+ const { labels: t } = $(), n = oe(Pi, Ii, $i);
2185
2185
  return n === null ? null : n ? /* @__PURE__ */ c("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" }) : /* @__PURE__ */ B("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-pdf-not-shown", children: [
2186
2186
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.pdfNotShown }),
2187
2187
  /* @__PURE__ */ B("div", { className: "aqmx-callout-actions", children: [
@@ -2189,20 +2189,20 @@ const Ri = /* @__PURE__ */ E.forwardRef(Ti), Oi = Object.freeze({ className: "aq
2189
2189
  /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-pdf-not-shown-download", children: t.download })
2190
2190
  ] })
2191
2191
  ] });
2192
- }, Ni = (e) => {
2192
+ }, Fi = (e) => {
2193
2193
  switch (e) {
2194
2194
  case "video":
2195
- return /* @__PURE__ */ c(xi, {});
2195
+ return /* @__PURE__ */ c(Mi, {});
2196
2196
  case "audio":
2197
- return /* @__PURE__ */ c(Ri, {});
2197
+ return /* @__PURE__ */ c(Ni, {});
2198
2198
  case "pdf":
2199
- return /* @__PURE__ */ c(Ei, {});
2199
+ return /* @__PURE__ */ c(Oi, {});
2200
2200
  default: {
2201
2201
  const t = e;
2202
2202
  throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
2203
2203
  }
2204
2204
  }
2205
- }, Di = ({ document: e }) => {
2205
+ }, qi = ({ document: e }) => {
2206
2206
  const { labels: t } = $();
2207
2207
  switch (e.mediaType) {
2208
2208
  case "video":
@@ -2214,15 +2214,15 @@ const Ri = /* @__PURE__ */ E.forwardRef(Ti), Oi = Object.freeze({ className: "aq
2214
2214
  /* @__PURE__ */ c("audio", { className: "aqmx-document-audio", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
2215
2215
  );
2216
2216
  case "pdf":
2217
- return /* @__PURE__ */ c(Ai, { document: e });
2217
+ return /* @__PURE__ */ c(_i, { document: e });
2218
2218
  default: {
2219
2219
  const n = e.mediaType;
2220
2220
  throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
2221
2221
  }
2222
2222
  }
2223
- }, Pi = ({ document: e }) => /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
2224
- /* @__PURE__ */ c(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: Ni(e.mediaType) }),
2225
- /* @__PURE__ */ c(Be, { scrollerProps: Oi, children: /* @__PURE__ */ c(Di, { document: e }) })
2223
+ }, Bi = ({ document: e }) => /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
2224
+ /* @__PURE__ */ c(Ue, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: Fi(e.mediaType) }),
2225
+ /* @__PURE__ */ c(Be, { scrollerProps: Di, children: /* @__PURE__ */ c(qi, { document: e }) })
2226
2226
  ] }), Ut = (e) => {
2227
2227
  switch (e.kind) {
2228
2228
  case "markdown":
@@ -2234,14 +2234,14 @@ const Ri = /* @__PURE__ */ E.forwardRef(Ti), Oi = Object.freeze({ className: "aq
2234
2234
  default:
2235
2235
  return null;
2236
2236
  }
2237
- }, Ii = (e) => {
2237
+ }, Ui = (e) => {
2238
2238
  const { documents: t } = $(), n = F(() => t.peek(e), [t, e]), r = F(() => t.peekSeeded(e), [t, e]), o = oe(t.subscribe, n, r), s = ge(o);
2239
2239
  return s === null ? null : Ut(s.document);
2240
- }, $i = (e) => {
2240
+ }, Hi = (e) => {
2241
2241
  const { config: t } = $(), n = ot(), r = F(() => n(Ne(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
2242
2242
  return X(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
2243
2243
  };
2244
- function _i({
2244
+ function zi({
2245
2245
  title: e,
2246
2246
  titleId: t,
2247
2247
  ...n
@@ -2262,16 +2262,16 @@ function _i({
2262
2262
  clipRule: "evenodd"
2263
2263
  }));
2264
2264
  }
2265
- const Fi = /* @__PURE__ */ E.forwardRef(_i), qi = 100, Bi = 32767, Ye = Object.freeze({ maxCells: an, maxColumns: an / qi, maxCellLength: Bi }), Cr = 44, Mr = 10, Lr = 13, Ze = '"', On = (e, t) => {
2265
+ const ji = /* @__PURE__ */ E.forwardRef(zi), Vi = 100, Zi = 32767, Ye = Object.freeze({ maxCells: an, maxColumns: an / Vi, maxCellLength: Zi }), Ar = 44, Nr = 10, Dr = 13, Ze = '"', Cn = (e, t) => {
2266
2266
  let n = t;
2267
2267
  for (; n < e.length; ) {
2268
2268
  const r = e.charCodeAt(n);
2269
- if (r === Cr || r === Mr || r === Lr) return n;
2269
+ if (r === Ar || r === Nr || r === Dr) return n;
2270
2270
  n += 1;
2271
2271
  }
2272
2272
  return n;
2273
2273
  };
2274
- function* Ui(e, t) {
2274
+ function* Wi(e, t) {
2275
2275
  let n = [], r = 0;
2276
2276
  for (; ; ) {
2277
2277
  let o;
@@ -2291,10 +2291,10 @@ function* Ui(e, t) {
2291
2291
  r = f + 1;
2292
2292
  break;
2293
2293
  }
2294
- const i = On(e, r);
2294
+ const i = Cn(e, r);
2295
2295
  o += e.slice(r, i), r = i;
2296
2296
  } else {
2297
- const a = On(e, r);
2297
+ const a = Cn(e, r);
2298
2298
  o = e.slice(r, a), r = a;
2299
2299
  }
2300
2300
  if (n.push(o), r >= e.length) {
@@ -2302,15 +2302,15 @@ function* Ui(e, t) {
2302
2302
  return;
2303
2303
  }
2304
2304
  const s = e.charCodeAt(r);
2305
- if (r += 1, s !== Cr && (yield n, n = [], s === Lr && e.charCodeAt(r) === Mr && (r += 1), r >= e.length))
2305
+ if (r += 1, s !== Ar && (yield n, n = [], s === Dr && e.charCodeAt(r) === Nr && (r += 1), r >= e.length))
2306
2306
  return;
2307
2307
  }
2308
2308
  }
2309
- const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e), zi = (e, t) => {
2309
+ const Gi = (e, t, n) => t === "csv" ? Wi(e, n) : n === "whole" ? ns(e) : rs(e), Ki = (e, t) => {
2310
2310
  if (e.length <= t) return e;
2311
2311
  const n = e.charCodeAt(t - 1);
2312
2312
  return e.slice(0, n >= 55296 && n <= 56319 ? t - 1 : t);
2313
- }, Ar = (e, t) => {
2313
+ }, Pr = (e, t) => {
2314
2314
  const n = [];
2315
2315
  let r = 0, o = !1, s = !1;
2316
2316
  for (const i of e) {
@@ -2319,17 +2319,17 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2319
2319
  s = !0;
2320
2320
  break;
2321
2321
  }
2322
- const l = f.some((d) => d.length > t.maxCellLength) ? f.map((d) => zi(d, t.maxCellLength)) : f;
2322
+ const l = f.some((d) => d.length > t.maxCellLength) ? f.map((d) => Ki(d, t.maxCellLength)) : f;
2323
2323
  l !== i && (o = !0), n.push(l), r = u;
2324
2324
  }
2325
2325
  return { rows: n.map((i) => i.length === r ? i : [...i, ...Array(r - i.length).fill("")]), truncated: s || o, full: s };
2326
2326
  }, wt = (e, t, n, r, o) => {
2327
- const s = Eo(e, t, r);
2328
- if (s === null) return { kind: "unreadable", code: "encoding", encodings: So(e, t, r) };
2327
+ const s = Co(e, t, r);
2328
+ if (s === null) return { kind: "unreadable", code: "encoding", encodings: Oo(e, t, r) };
2329
2329
  if (s.includes("\0")) return { kind: "unreadable", code: "binary" };
2330
- const a = Ar(Hi(s, n, t ? "whole" : "prefix"), o);
2330
+ const a = Pr(Gi(s, n, t ? "whole" : "prefix"), o);
2331
2331
  return t ? a.truncated || a.rows.some((i) => i.some((f) => f !== "")) ? { kind: "table", table: a } : { kind: "empty" } : a.rows.length === 0 ? { kind: "unreadable", code: "long-row" } : { kind: "table", table: { ...a, truncated: !0 } };
2332
- }, ji = Object.freeze({ maxPartBytes: 64 * 1024 * 1024, maxSheets: 256 }), Nr = (e) => {
2332
+ }, Yi = Object.freeze({ maxPartBytes: 64 * 1024 * 1024, maxSheets: 256 }), Ir = (e) => {
2333
2333
  const t = [];
2334
2334
  let n = 0, r = !1;
2335
2335
  const o = (s) => {
@@ -2355,14 +2355,14 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2355
2355
  for (let d = 0; d < i && !r; d += 1) o(d === 0 ? u : [...u]);
2356
2356
  },
2357
2357
  full: () => r,
2358
- table: () => Ar(t, e)
2358
+ table: () => Pr(t, e)
2359
2359
  };
2360
- }, Vi = (e) => {
2360
+ }, Xi = (e) => {
2361
2361
  const t = Array.from(e.currentTarget.querySelectorAll('[role="tab"]')), n = e.target instanceof HTMLButtonElement ? t.indexOf(e.target) : -1;
2362
2362
  if (n === -1) return;
2363
2363
  const r = getComputedStyle(e.currentTarget).direction === "rtl" ? "ArrowRight" : "ArrowLeft", o = r === "ArrowLeft" ? "ArrowRight" : "ArrowLeft", s = e.key === o ? (n + 1) % t.length : e.key === r ? (n - 1 + t.length) % t.length : e.key === "Home" ? 0 : e.key === "End" ? t.length - 1 : null;
2364
2364
  s !== null && (e.preventDefault(), t[s]?.focus());
2365
- }, Zi = ({ names: e, selected: t, onSelect: n, label: r, tabIdOf: o, panelId: s }) => /* @__PURE__ */ c("div", { role: "tablist", "aria-label": r, className: "aqmx-sheet-tabs", "data-testid": "markdown-explorer-spreadsheet-sheets", onKeyDown: Vi, children: e.map((a, i) => /* @__PURE__ */ c(
2365
+ }, Ji = ({ names: e, selected: t, onSelect: n, label: r, tabIdOf: o, panelId: s }) => /* @__PURE__ */ c("div", { role: "tablist", "aria-label": r, className: "aqmx-sheet-tabs", "data-testid": "markdown-explorer-spreadsheet-sheets", onKeyDown: Xi, children: e.map((a, i) => /* @__PURE__ */ c(
2366
2366
  "button",
2367
2367
  {
2368
2368
  type: "button",
@@ -2377,8 +2377,8 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2377
2377
  children: a
2378
2378
  },
2379
2379
  i
2380
- )) }), Dr = 64 * 1024, Wi = (e) => {
2381
- let t = new Uint8Array(Math.min(e, Dr)), n = 0;
2380
+ )) }), $r = 64 * 1024, Qi = (e) => {
2381
+ let t = new Uint8Array(Math.min(e, $r)), n = 0;
2382
2382
  return {
2383
2383
  append: (r) => {
2384
2384
  if (n + r.byteLength > t.byteLength) {
@@ -2390,22 +2390,22 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2390
2390
  bytes: () => t.subarray(0, n),
2391
2391
  length: () => n
2392
2392
  };
2393
- }, Gi = async (e) => {
2393
+ }, el = async (e) => {
2394
2394
  for (; ; ) {
2395
2395
  const { done: t, value: n } = await e.read();
2396
2396
  if (t) return !0;
2397
2397
  if (n.byteLength > 0) return !1;
2398
2398
  }
2399
- }, Ki = async (e, t) => {
2400
- const { format: n, legacyEncoding: r, maxBytes: o, budget: s } = t, a = e.getReader(), i = Wi(o);
2401
- let f = Dr;
2399
+ }, tl = async (e, t) => {
2400
+ const { format: n, legacyEncoding: r, maxBytes: o, budget: s } = t, a = e.getReader(), i = Qi(o);
2401
+ let f = $r;
2402
2402
  try {
2403
2403
  for (; ; ) {
2404
2404
  const { done: u, value: l } = await a.read();
2405
2405
  if (u) return wt(i.bytes(), !0, n, r, s);
2406
2406
  const d = o - i.length();
2407
2407
  if (i.append(l.byteLength > d ? l.subarray(0, d) : l), i.length() === o) {
2408
- const g = l.byteLength <= d && await Gi(a);
2408
+ const g = l.byteLength <= d && await el(a);
2409
2409
  return wt(i.bytes(), g, n, r, s);
2410
2410
  }
2411
2411
  if (i.length() < f) continue;
@@ -2417,53 +2417,53 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2417
2417
  a.cancel().catch(() => {
2418
2418
  });
2419
2419
  }
2420
- }, Pr = async (e, t, n, r) => {
2420
+ }, _r = async (e, t, n, r) => {
2421
2421
  const o = await e.asset(rt(t), r);
2422
2422
  if (o.status === "cancelled") return null;
2423
2423
  if (o.status === "error") return { kind: "failure", failure: o.failure };
2424
2424
  let s;
2425
2425
  try {
2426
- s = await Ki(o.body, n);
2426
+ s = await tl(o.body, n);
2427
2427
  } catch {
2428
2428
  return r.aborted ? null : { kind: "failure", failure: { reason: "failed" } };
2429
2429
  }
2430
2430
  return r.aborted ? null : s.kind === "table" ? { kind: "table", rows: s.table.rows, truncated: s.table.truncated } : s;
2431
2431
  }, Ht = (e, t, n) => {
2432
- const { documents: r, labels: o } = $(), s = Oa(), a = F(() => r.answerStampOf(e), [r, e]), i = oe(r.subscribe, a, a), [f, u] = V(0), l = X(() => ({ read: n, stamp: i, attempt: f }), [n, i, f]), [d, h] = V({ settled: null, shown: null, failure: null }), g = U(null), v = le((C, R) => {
2433
- if (g.current?.settle(R.stamp, C.kind === "failure" ? C.failure : null), C.kind === "read") {
2434
- h({ settled: R, shown: C.value, failure: null });
2432
+ const { documents: r, labels: o } = $(), s = Da(), a = F(() => r.answerStampOf(e), [r, e]), i = oe(r.subscribe, a, a), [f, u] = V(0), l = X(() => ({ read: n, stamp: i, attempt: f }), [n, i, f]), [d, h] = V({ settled: null, shown: null, failure: null }), g = U(null), v = le((O, R) => {
2433
+ if (g.current?.settle(R.stamp, O.kind === "failure" ? O.failure : null), O.kind === "read") {
2434
+ h({ settled: R, shown: O.value, failure: null });
2435
2435
  return;
2436
2436
  }
2437
2437
  if (d.shown !== null) {
2438
2438
  h({ settled: R, shown: d.shown, failure: null });
2439
2439
  return;
2440
2440
  }
2441
- h({ settled: R, shown: null, failure: C.failure }), s.announceFailure(o.documentFailed(t, de(o, C.failure.reason)));
2441
+ h({ settled: R, shown: null, failure: O.failure }), s.announceFailure(o.documentFailed(t, de(o, O.failure.reason)));
2442
2442
  });
2443
2443
  ee(() => {
2444
- const C = s.readPart();
2445
- return g.current = C, () => {
2446
- g.current = null, C.release();
2444
+ const O = s.readPart();
2445
+ return g.current = O, () => {
2446
+ g.current = null, O.release();
2447
2447
  };
2448
2448
  }, [s]), ee(() => {
2449
- const C = new AbortController();
2450
- return l.read(C.signal).then((R) => {
2451
- R !== null && !C.signal.aborted && v(R, l);
2452
- }), () => C.abort();
2449
+ const O = new AbortController();
2450
+ return l.read(O.signal).then((R) => {
2451
+ R !== null && !O.signal.aborted && v(R, l);
2452
+ }), () => O.abort();
2453
2453
  }, [l]);
2454
2454
  const y = d.settled !== l && (d.shown !== null || d.failure !== null);
2455
2455
  Y(() => y ? s.holdBusy() : void 0, [y, s]);
2456
- const T = F(() => u((C) => C + 1), []);
2456
+ const T = F(() => u((O) => O + 1), []);
2457
2457
  return { shown: d.shown, failure: d.failure, retry: T };
2458
- }, Ir = (e, t) => {
2458
+ }, Fr = (e, t) => {
2459
2459
  const n = {};
2460
2460
  for (const r of Object.keys(Xe[t])) {
2461
2461
  const o = e[It(r)];
2462
2462
  o !== Xe[t][r].text && (n[r] = o);
2463
2463
  }
2464
2464
  return n;
2465
- }, Yi = (e, t) => Object.fromEntries(Object.entries(Ir(e, t)).map(([n, r]) => [`spreadsheet${n.charAt(0).toUpperCase()}${n.slice(1)}`, r])), Xi = (e, t) => ({
2466
- ...Yi(e, t),
2465
+ }, nl = (e, t) => Object.fromEntries(Object.entries(Fr(e, t)).map(([n, r]) => [`spreadsheet${n.charAt(0).toUpperCase()}${n.slice(1)}`, r])), rl = (e, t) => ({
2466
+ ...nl(e, t),
2467
2467
  loading: e.viewerLoading,
2468
2468
  errorPrefix: e.viewerErrorPrefix,
2469
2469
  styleTitle: e.viewerStyleTitle,
@@ -2521,28 +2521,28 @@ const Hi = (e, t, n) => t === "csv" ? Ui(e, n) : n === "whole" ? Xo(e) : Jo(e),
2521
2521
  svgImageCopyImage: e.viewerSvgImageCopyImage,
2522
2522
  svgImageCopiedImage: e.viewerSvgImageCopiedImage,
2523
2523
  svgImageCopyImageFailed: e.viewerSvgImageCopyImageFailed
2524
- }), $r = (e, t, n) => {
2524
+ }), qr = (e, t, n) => {
2525
2525
  if (t !== void 0) return t;
2526
2526
  if (n !== void 0) return n;
2527
2527
  const [r] = e.documentStyles;
2528
2528
  if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
2529
2529
  return r.name;
2530
- }, _r = (e, t) => e !== void 0 ? e : t !== void 0 ? t : es;
2530
+ }, Br = (e, t) => e !== void 0 ? e : t !== void 0 ? t : ss;
2531
2531
  class ne extends Error {
2532
2532
  refusal;
2533
2533
  constructor(t, n) {
2534
2534
  super(n), this.name = "WorkbookError", this.refusal = t;
2535
2535
  }
2536
2536
  }
2537
- const Ji = /* @__PURE__ */ new Map([
2537
+ const ol = /* @__PURE__ */ new Map([
2538
2538
  ["lt", "<"],
2539
2539
  ["gt", ">"],
2540
2540
  ["amp", "&"],
2541
2541
  ["quot", '"'],
2542
2542
  ["apos", "'"]
2543
- ]), Qi = /&(#x[0-9A-Fa-f]+|#[0-9]+|[A-Za-z_][A-Za-z0-9._-]*);/gu, el = /([^\s=/>]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/gu, tl = /^[^\s/>]+/u, Se = (e) => {
2543
+ ]), sl = /&(#x[0-9A-Fa-f]+|#[0-9]+|[A-Za-z_][A-Za-z0-9._-]*);/gu, al = /([^\s=/>]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/gu, il = /^[^\s/>]+/u, Se = (e) => {
2544
2544
  throw new ne("not-workbook", `the XML ${e}`);
2545
- }, Cn = (e) => Number.isInteger(e) && e >= 0 && e <= 1114111 ? String.fromCodePoint(e) : Se(`refers to the code point ${e}`), Fr = (e) => e.includes("&") ? e.replace(Qi, (t, n) => n.startsWith("#x") ? Cn(Number.parseInt(n.slice(2), 16)) : n.startsWith("#") ? Cn(Number.parseInt(n.slice(1), 10)) : Ji.get(n) ?? Se(`names the undeclared entity ${t}`)) : e, Nt = (e) => e.slice(e.indexOf(":") + 1), nl = (e, t) => {
2545
+ }, On = (e) => Number.isInteger(e) && e >= 0 && e <= 1114111 ? String.fromCodePoint(e) : Se(`refers to the code point ${e}`), Ur = (e) => e.includes("&") ? e.replace(sl, (t, n) => n.startsWith("#x") ? On(Number.parseInt(n.slice(2), 16)) : n.startsWith("#") ? On(Number.parseInt(n.slice(1), 10)) : ol.get(n) ?? Se(`names the undeclared entity ${t}`)) : e, Nt = (e) => e.slice(e.indexOf(":") + 1), ll = (e, t) => {
2546
2546
  let n = "";
2547
2547
  for (let r = t; r < e.length; r += 1) {
2548
2548
  const o = e[r];
@@ -2554,18 +2554,18 @@ const Ji = /* @__PURE__ */ new Map([
2554
2554
  return r;
2555
2555
  }
2556
2556
  return -1;
2557
- }, rl = (e) => {
2557
+ }, cl = (e) => {
2558
2558
  const t = /* @__PURE__ */ new Map();
2559
- for (const n of e.matchAll(el)) t.set(Nt(n[1] ?? ""), Fr(n[2] ?? n[3] ?? ""));
2559
+ for (const n of e.matchAll(al)) t.set(Nt(n[1] ?? ""), Ur(n[2] ?? n[3] ?? ""));
2560
2560
  return t;
2561
- }, qr = (e, t) => {
2561
+ }, Hr = (e, t) => {
2562
2562
  let n = "";
2563
2563
  const r = () => {
2564
2564
  let o = 0;
2565
2565
  for (; !t(); ) {
2566
2566
  const s = n.indexOf("<", o);
2567
2567
  if (s === -1) break;
2568
- if (s > o && (e.text?.(Fr(n.slice(o, s))), o = s), n.startsWith("<!--", s)) {
2568
+ if (s > o && (e.text?.(Ur(n.slice(o, s))), o = s), n.startsWith("<!--", s)) {
2569
2569
  const u = n.indexOf("-->", s + 4);
2570
2570
  if (u === -1) break;
2571
2571
  o = u + 3;
@@ -2585,14 +2585,14 @@ const Ji = /* @__PURE__ */ new Map([
2585
2585
  o = u + 2;
2586
2586
  continue;
2587
2587
  }
2588
- const i = nl(n, s + 1);
2588
+ const i = ll(n, s + 1);
2589
2589
  if (i === -1) break;
2590
2590
  const f = n.slice(s + 1, i);
2591
2591
  if (f.startsWith("/"))
2592
2592
  e.end?.(Nt(f.slice(1).trim()));
2593
2593
  else {
2594
- const u = f.endsWith("/"), l = u ? f.slice(0, -1) : f, d = tl.exec(l)?.[0] ?? Se("has a tag without a name"), h = Nt(d);
2595
- e.start?.(h, rl(l.slice(d.length)), u), u && e.end?.(h);
2594
+ const u = f.endsWith("/"), l = u ? f.slice(0, -1) : f, d = il.exec(l)?.[0] ?? Se("has a tag without a name"), h = Nt(d);
2595
+ e.start?.(h, cl(l.slice(d.length)), u), u && e.end?.(h);
2596
2596
  }
2597
2597
  o = i + 1;
2598
2598
  }
@@ -2607,7 +2607,7 @@ const Ji = /* @__PURE__ */ new Map([
2607
2607
  }
2608
2608
  };
2609
2609
  }, He = async (e, t, n) => {
2610
- const r = qr(t, n), o = new TextDecoder("utf-8", { fatal: !0 }), s = e.getReader();
2610
+ const r = Hr(t, n), o = new TextDecoder("utf-8", { fatal: !0 }), s = e.getReader();
2611
2611
  try {
2612
2612
  for (; !n(); ) {
2613
2613
  const { done: a, value: i } = await s.read();
@@ -2624,44 +2624,44 @@ const Ji = /* @__PURE__ */ new Map([
2624
2624
  s.cancel().catch(() => {
2625
2625
  });
2626
2626
  }
2627
- }, ol = 101010256, sl = 33639248, al = 67324752, Br = 22, il = 65535, Mn = 46, Ln = 30, ll = 1, An = 0, cl = 8, dl = 65535, Me = 4294967295, ul = new TextDecoder("utf-8"), ae = (e) => {
2627
+ }, dl = 101010256, ul = 33639248, fl = 67324752, zr = 22, ml = 65535, Ln = 46, Mn = 30, hl = 1, An = 0, pl = 8, gl = 65535, Le = 4294967295, wl = new TextDecoder("utf-8"), ae = (e) => {
2628
2628
  throw new ne("not-workbook", `the ZIP package ${e}`);
2629
- }, fl = (e) => {
2630
- const t = e.byteLength - Br, n = Math.max(0, t - il);
2629
+ }, vl = (e) => {
2630
+ const t = e.byteLength - zr, n = Math.max(0, t - ml);
2631
2631
  for (let r = t; r >= n; r -= 1)
2632
- if (e.getUint32(r, !0) === ol) return r;
2632
+ if (e.getUint32(r, !0) === dl) return r;
2633
2633
  return ae("has no end of central directory record");
2634
- }, ml = (e) => {
2635
- if (e.byteLength < Br) return ae("is shorter than its end record");
2636
- const t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = fl(t), r = t.getUint16(n + 4, !0), o = t.getUint16(n + 6, !0), s = t.getUint16(n + 10, !0), a = t.getUint32(n + 12, !0), i = t.getUint32(n + 16, !0);
2634
+ }, bl = (e) => {
2635
+ if (e.byteLength < zr) return ae("is shorter than its end record");
2636
+ const t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = vl(t), r = t.getUint16(n + 4, !0), o = t.getUint16(n + 6, !0), s = t.getUint16(n + 10, !0), a = t.getUint32(n + 12, !0), i = t.getUint32(n + 16, !0);
2637
2637
  if (r !== 0 || o !== 0) return ae("spans several disks");
2638
- if (s === dl || a === Me || i === Me) return ae("is a ZIP64 package");
2638
+ if (s === gl || a === Le || i === Le) return ae("is a ZIP64 package");
2639
2639
  if (i + a > n) return ae("has a central directory past its end record");
2640
2640
  const f = /* @__PURE__ */ new Map();
2641
2641
  let u = i;
2642
2642
  for (let l = 0; l < s; l += 1) {
2643
- if (u + Mn > n || t.getUint32(u, !0) !== sl) return ae("has a malformed central directory");
2644
- const d = t.getUint16(u + 8, !0), h = t.getUint16(u + 10, !0), g = t.getUint32(u + 20, !0), v = t.getUint32(u + 24, !0), y = t.getUint16(u + 28, !0), T = t.getUint16(u + 30, !0), C = t.getUint16(u + 32, !0), R = t.getUint32(u + 42, !0), q = u + Mn;
2643
+ if (u + Ln > n || t.getUint32(u, !0) !== ul) return ae("has a malformed central directory");
2644
+ const d = t.getUint16(u + 8, !0), h = t.getUint16(u + 10, !0), g = t.getUint32(u + 20, !0), v = t.getUint32(u + 24, !0), y = t.getUint16(u + 28, !0), T = t.getUint16(u + 30, !0), O = t.getUint16(u + 32, !0), R = t.getUint32(u + 42, !0), q = u + Ln;
2645
2645
  if (q + y > n) return ae("has a name past its central directory");
2646
- const D = ul.decode(e.subarray(q, q + y));
2647
- if (g === Me || v === Me || R === Me) return ae("has a ZIP64 entry");
2646
+ const D = wl.decode(e.subarray(q, q + y));
2647
+ if (g === Le || v === Le || R === Le) return ae("has a ZIP64 entry");
2648
2648
  if (!D.endsWith("/")) {
2649
2649
  if (f.has(D)) return ae(`names ${D} twice`);
2650
- f.set(D, { name: D, encrypted: (d & ll) !== 0, method: h, compressedSize: g, uncompressedSize: v, localHeaderOffset: R });
2650
+ f.set(D, { name: D, encrypted: (d & hl) !== 0, method: h, compressedSize: g, uncompressedSize: v, localHeaderOffset: R });
2651
2651
  }
2652
- u = q + y + T + C;
2652
+ u = q + y + T + O;
2653
2653
  }
2654
2654
  return { bytes: e, entries: f };
2655
- }, hl = (e, t) => {
2655
+ }, yl = (e, t) => {
2656
2656
  const { bytes: n } = e, r = new DataView(n.buffer, n.byteOffset, n.byteLength), o = t.localHeaderOffset;
2657
- if (o + Ln > n.byteLength || r.getUint32(o, !0) !== al) return ae(`has no local header for ${t.name}`);
2658
- const s = o + Ln + r.getUint16(o + 26, !0) + r.getUint16(o + 28, !0), a = s + t.compressedSize;
2657
+ if (o + Mn > n.byteLength || r.getUint32(o, !0) !== fl) return ae(`has no local header for ${t.name}`);
2658
+ const s = o + Mn + r.getUint16(o + 26, !0) + r.getUint16(o + 28, !0), a = s + t.compressedSize;
2659
2659
  return a > n.byteLength ? ae(`has the data of ${t.name} past its end`) : { start: s, end: a };
2660
- }, Ur = (e) => new ReadableStream({
2660
+ }, jr = (e) => new ReadableStream({
2661
2661
  start(t) {
2662
2662
  e.byteLength > 0 && t.enqueue(e), t.close();
2663
2663
  }
2664
- }), pl = (e) => Ur(e).pipeThrough(new DecompressionStream("deflate-raw")), gl = (e, t) => {
2664
+ }), kl = (e) => jr(e).pipeThrough(new DecompressionStream("deflate-raw")), El = (e, t) => {
2665
2665
  let n = 0;
2666
2666
  return new TransformStream({
2667
2667
  transform(r, o) {
@@ -2676,10 +2676,10 @@ const Ji = /* @__PURE__ */ new Map([
2676
2676
  const r = e.entries.get(t);
2677
2677
  if (r === void 0) return null;
2678
2678
  if (r.encrypted) throw new ne("encrypted", `${t} is encrypted`);
2679
- if (r.method !== An && r.method !== cl) return ae(`compresses ${t} with method ${r.method}`);
2679
+ if (r.method !== An && r.method !== pl) return ae(`compresses ${t} with method ${r.method}`);
2680
2680
  if (r.uncompressedSize > n) throw new ne("too-large", `${t} declares ${r.uncompressedSize} bytes`);
2681
- const { start: o, end: s } = hl(e, r), a = e.bytes.subarray(o, s);
2682
- return (r.method === An ? Ur(a) : pl(a)).pipeThrough(gl(t, n));
2681
+ const { start: o, end: s } = yl(e, r), a = e.bytes.subarray(o, s);
2682
+ return (r.method === An ? jr(a) : kl(a)).pipeThrough(El(t, n));
2683
2683
  }, tt = async (e, t, n) => {
2684
2684
  const r = Fe(e, t, n);
2685
2685
  if (r === null) return null;
@@ -2698,10 +2698,10 @@ const Ji = /* @__PURE__ */ new Map([
2698
2698
  } finally {
2699
2699
  s.releaseLock();
2700
2700
  }
2701
- }, Nn = "content.xml", wl = "META-INF/manifest.xml", Hr = (e) => {
2701
+ }, Nn = "content.xml", Sl = "META-INF/manifest.xml", Vr = (e) => {
2702
2702
  throw new ne("not-workbook", `the spreadsheet ${e}`);
2703
- }, Dn = (e, t) => Fe(e, Nn, t.maxPartBytes) ?? Hr(`has no ${Nn}`), vl = async (e, t) => {
2704
- const n = Fe(e, wl, t.maxPartBytes);
2703
+ }, Dn = (e, t) => Fe(e, Nn, t.maxPartBytes) ?? Vr(`has no ${Nn}`), xl = async (e, t) => {
2704
+ const n = Fe(e, Sl, t.maxPartBytes);
2705
2705
  if (n === null) return !1;
2706
2706
  let r = !1;
2707
2707
  return await He(
@@ -2713,7 +2713,7 @@ const Ji = /* @__PURE__ */ new Map([
2713
2713
  },
2714
2714
  () => r
2715
2715
  ), r;
2716
- }, bl = async (e) => {
2716
+ }, Tl = async (e) => {
2717
2717
  const t = [], n = /* @__PURE__ */ new Set();
2718
2718
  let r = null, o = 0;
2719
2719
  return await He(
@@ -2731,8 +2731,8 @@ const Ji = /* @__PURE__ */ new Map([
2731
2731
  }, vt = (e) => {
2732
2732
  const t = Number(e);
2733
2733
  return Number.isInteger(t) && t > 0 ? t : 1;
2734
- }, yl = async (e, t, n) => {
2735
- const r = Nr(n);
2734
+ }, Rl = async (e, t, n) => {
2735
+ const r = Ir(n);
2736
2736
  let o = 0, s = 0, a = !1, i = !1, f = 0, u = 1, l = /* @__PURE__ */ new Map(), d = 0, h = null;
2737
2737
  return await He(
2738
2738
  e,
@@ -2771,18 +2771,18 @@ const Ji = /* @__PURE__ */ new Map([
2771
2771
  },
2772
2772
  () => i || r.full()
2773
2773
  ), r.table();
2774
- }, kl = async (e, t) => {
2775
- if (await vl(e, t)) throw new ne("encrypted", "the spreadsheet's manifest names encryption data");
2776
- const { tables: n, hidingStyles: r } = await bl(Dn(e, t)), o = [];
2774
+ }, Cl = async (e, t) => {
2775
+ if (await xl(e, t)) throw new ne("encrypted", "the spreadsheet's manifest names encryption data");
2776
+ const { tables: n, hidingStyles: r } = await Tl(Dn(e, t)), o = [];
2777
2777
  let s = 0;
2778
2778
  return n.forEach((a, i) => {
2779
2779
  if (r.has(a.style)) {
2780
2780
  s += 1;
2781
2781
  return;
2782
2782
  }
2783
- o.push({ name: a.name, read: async (f) => yl(Dn(e, t), i, f) });
2784
- }), o.length === 0 && Hr("shows no table"), { sheets: o.slice(0, t.maxSheets), unshownSheets: s, unlistedSheets: Math.max(0, o.length - t.maxSheets) };
2785
- }, Ee = Object.freeze({ kind: "general" }), El = new Map([
2783
+ o.push({ name: a.name, read: async (f) => Rl(Dn(e, t), i, f) });
2784
+ }), o.length === 0 && Vr("shows no table"), { sheets: o.slice(0, t.maxSheets), unshownSheets: s, unlistedSheets: Math.max(0, o.length - t.maxSheets) };
2785
+ }, Ee = Object.freeze({ kind: "general" }), Ol = new Map([
2786
2786
  [0, "General"],
2787
2787
  [1, "0"],
2788
2788
  [2, "0.00"],
@@ -2814,7 +2814,7 @@ const Ji = /* @__PURE__ */ new Map([
2814
2814
  [47, "mmss.0"],
2815
2815
  [48, "##0.0E+0"],
2816
2816
  [49, "@"]
2817
- ]), Sl = /^\[(h+|m+|s+)\]$/iu, xl = (e) => {
2817
+ ]), Ll = /^\[(h+|m+|s+)\]$/iu, Ml = (e) => {
2818
2818
  let t = "", n = !1;
2819
2819
  for (let r = 0; r < e.length; r += 1) {
2820
2820
  const o = e[r];
@@ -2826,13 +2826,13 @@ const Ji = /* @__PURE__ */ new Map([
2826
2826
  r += 1;
2827
2827
  else if (o === "[") {
2828
2828
  const s = e.indexOf("]", r + 1), a = e.slice(r, s === -1 ? e.length : s + 1);
2829
- Sl.test(a) && (t += a.slice(1, -1), n = !0), r = s === -1 ? e.length : s;
2829
+ Ll.test(a) && (t += a.slice(1, -1), n = !0), r = s === -1 ? e.length : s;
2830
2830
  } else
2831
2831
  t += o;
2832
2832
  }
2833
2833
  return { text: t.toLowerCase(), elapsed: n };
2834
- }, Tl = (e) => {
2835
- const { text: t, elapsed: n } = xl(e);
2834
+ }, Al = (e) => {
2835
+ const { text: t, elapsed: n } = Ml(e);
2836
2836
  if (t === "" || t === "general" || t.includes("@") || /[0#?.]e[+-]/u.test(t)) return Ee;
2837
2837
  const r = n || /[hs]/u.test(t) || t.includes("am/pm") || t.includes("a/p"), o = /[ydge]/u.test(t.replace(/am\/pm|a\/p/gu, "")) || t.includes("m") && !r;
2838
2838
  if (o || r) return { kind: "date-time", date: o, time: r, seconds: t.includes("s"), elapsed: n };
@@ -2841,9 +2841,9 @@ const Ji = /* @__PURE__ */ new Map([
2841
2841
  if (s === void 0) return Ee;
2842
2842
  const a = /,*$/u.exec(s)?.[0].length ?? 0, [i = "", f = ""] = s.slice(0, s.length - a).split("."), u = (f.match(/[0#?]/gu) ?? []).length;
2843
2843
  return t.includes("%") ? { kind: "percent", decimals: u } : { kind: "fixed", decimals: u, grouping: i.includes(","), scale: 1e3 ** a };
2844
- }, Rl = (e, t) => {
2845
- const n = t.get(e) ?? El.get(e);
2846
- return n === void 0 ? Ee : Tl(n);
2844
+ }, Nl = (e, t) => {
2845
+ const n = t.get(e) ?? Ol.get(e);
2846
+ return n === void 0 ? Ee : Al(n);
2847
2847
  }, zt = (e) => {
2848
2848
  if (Number.isInteger(e) && Math.abs(e) < 1e15) return String(e);
2849
2849
  const [t = "", n] = e.toPrecision(15).split("e"), r = t.includes(".") ? t.replace(/0+$/u, "").replace(/\.$/u, "") : t;
@@ -2853,62 +2853,62 @@ const Ji = /* @__PURE__ */ new Map([
2853
2853
  if (r.includes("e")) return zt(e);
2854
2854
  const [o = "", s] = r.split("."), a = n ? o.replace(/\B(?=(\d{3})+(?!\d))/gu, ",") : o;
2855
2855
  return `${e < 0 && /[1-9]/u.test(r) ? "-" : ""}${a}${s === void 0 ? "" : `.${s}`}`;
2856
- }, Ol = 864e5, In = 86400, Cl = 2958465, xe = (e, t) => String(e).padStart(t, "0"), Ml = (e, t) => {
2856
+ }, Dl = 864e5, In = 86400, Pl = 2958465, xe = (e, t) => String(e).padStart(t, "0"), Il = (e, t) => {
2857
2857
  if (!t && e === 0) return "1900-01-00";
2858
2858
  if (!t && e === 60) return "1900-02-29";
2859
- const n = t ? Date.UTC(1904, 0, 1) : e < 60 ? Date.UTC(1899, 11, 31) : Date.UTC(1899, 11, 30), r = new Date(n + e * Ol);
2859
+ const n = t ? Date.UTC(1904, 0, 1) : e < 60 ? Date.UTC(1899, 11, 31) : Date.UTC(1899, 11, 30), r = new Date(n + e * Dl);
2860
2860
  return `${xe(r.getUTCFullYear(), 4)}-${xe(r.getUTCMonth() + 1, 2)}-${xe(r.getUTCDate(), 2)}`;
2861
- }, Ll = (e, t, n) => {
2862
- if (e < 0 || e >= Cl + 1) return zt(e);
2861
+ }, $l = (e, t, n) => {
2862
+ if (e < 0 || e >= Pl + 1) return zt(e);
2863
2863
  let r = Math.floor(e), o = Math.round((e - r) * In);
2864
2864
  o === In && (r += 1, o = 0);
2865
2865
  const s = Math.floor(o / 3600), a = Math.floor(o % 3600 / 60), i = `${xe(t.elapsed ? r * 24 + s : s, 2)}:${xe(a, 2)}${t.seconds ? `:${xe(o % 60, 2)}` : ""}`;
2866
2866
  if (t.elapsed || !t.date) return i;
2867
- const f = Ml(r, n);
2867
+ const f = Il(r, n);
2868
2868
  return t.time ? `${f} ${i}` : f;
2869
- }, Al = (e, t, n) => {
2869
+ }, _l = (e, t, n) => {
2870
2870
  switch (t.kind) {
2871
2871
  case "general":
2872
2872
  return zt(e);
2873
2873
  case "date-time":
2874
- return Ll(e, t, n);
2874
+ return $l(e, t, n);
2875
2875
  case "percent":
2876
2876
  return `${Pn(e * 100, t.decimals, !1)}%`;
2877
2877
  case "fixed":
2878
2878
  return Pn(e / t.scale, t.decimals, t.grouping);
2879
2879
  }
2880
- }, zr = "_rels/.rels", ce = (e) => {
2880
+ }, Zr = "_rels/.rels", ce = (e) => {
2881
2881
  throw new ne("not-workbook", `the workbook ${e}`);
2882
2882
  }, jt = (e, t) => {
2883
- const n = qr(t, () => !1);
2883
+ const n = Hr(t, () => !1);
2884
2884
  n.write(e), n.finish();
2885
- }, Nl = (e, t) => {
2885
+ }, Fl = (e, t) => {
2886
2886
  try {
2887
2887
  return decodeURIComponent(e);
2888
2888
  } catch {
2889
2889
  return ce(`points to a malformed part name (${t})`);
2890
2890
  }
2891
- }, Dl = (e, t) => {
2891
+ }, ql = (e, t) => {
2892
2892
  const r = [...t.startsWith("/") ? [] : e.split("/").slice(0, -1)];
2893
2893
  for (const o of t.split("/"))
2894
- o === "" || o === "." || (o === ".." ? (r.length === 0 && ce(`points above its root (${t})`), r.pop()) : r.push(Nl(o, t)));
2894
+ o === "" || o === "." || (o === ".." ? (r.length === 0 && ce(`points above its root (${t})`), r.pop()) : r.push(Fl(o, t)));
2895
2895
  return r.join("/");
2896
- }, Pl = (e) => {
2896
+ }, Bl = (e) => {
2897
2897
  const t = e.lastIndexOf("/");
2898
2898
  return `${e.slice(0, t + 1)}_rels/${e.slice(t + 1)}.rels`;
2899
2899
  }, $n = async (e, t, n) => {
2900
- const r = await tt(e, t === "" ? zr : Pl(t), n.maxPartBytes), o = /* @__PURE__ */ new Map();
2900
+ const r = await tt(e, t === "" ? Zr : Bl(t), n.maxPartBytes), o = /* @__PURE__ */ new Map();
2901
2901
  return r === null || jt(r, {
2902
2902
  start: (s, a) => {
2903
2903
  if (s !== "Relationship") return;
2904
2904
  const i = a.get("Id"), f = a.get("Type"), u = a.get("Target");
2905
- i === void 0 || f === void 0 || u === void 0 || a.get("TargetMode") === "External" || o.set(i, { type: f, target: Dl(t, u) });
2905
+ i === void 0 || f === void 0 || u === void 0 || a.get("TargetMode") === "External" || o.set(i, { type: f, target: ql(t, u) });
2906
2906
  }
2907
2907
  }), o;
2908
2908
  }, bt = (e, t) => {
2909
2909
  for (const n of e.values()) if (n.type.endsWith(`/${t}`)) return n.target;
2910
2910
  return null;
2911
- }, Il = (e) => {
2911
+ }, Ul = (e) => {
2912
2912
  const t = [];
2913
2913
  let n = !1;
2914
2914
  return jt(e, {
@@ -2919,7 +2919,7 @@ const Ji = /* @__PURE__ */ new Map([
2919
2919
  } else r === "sheet" && t.push({ name: o.get("name") ?? "", state: o.get("state") ?? "visible", relationship: o.get("id") ?? "" });
2920
2920
  }
2921
2921
  }), { sheets: t, date1904: n };
2922
- }, $l = async (e) => {
2922
+ }, Hl = async (e) => {
2923
2923
  const t = [];
2924
2924
  let n = null, r = !1, o = 0;
2925
2925
  return await He(
@@ -2937,7 +2937,7 @@ const Ji = /* @__PURE__ */ new Map([
2937
2937
  },
2938
2938
  () => !1
2939
2939
  ), t;
2940
- }, _l = (e) => {
2940
+ }, zl = (e) => {
2941
2941
  const t = /* @__PURE__ */ new Map(), n = [];
2942
2942
  let r = !1;
2943
2943
  return jt(e, {
@@ -2955,19 +2955,19 @@ const Ji = /* @__PURE__ */ new Map([
2955
2955
  end: (o) => {
2956
2956
  o === "cellXfs" && (r = !1);
2957
2957
  }
2958
- }), n.map((o) => Rl(o, t));
2959
- }, Fl = /^(\d{4}-\d{2}-\d{2})(?:T(\d{2}:\d{2}(?::\d{2})?)(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?$/u, ql = (e) => {
2960
- const t = Fl.exec(e);
2958
+ }), n.map((o) => Nl(o, t));
2959
+ }, jl = /^(\d{4}-\d{2}-\d{2})(?:T(\d{2}:\d{2}(?::\d{2})?)(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?$/u, Vl = (e) => {
2960
+ const t = jl.exec(e);
2961
2961
  if (t === null) return e;
2962
2962
  const [, n, r] = t;
2963
2963
  return r === void 0 || /^00:00(?::00)?$/u.test(r) ? n ?? e : `${n} ${r}`;
2964
- }, Bl = /^([A-Za-z]{1,3})(\d+)$/u, Ul = (e) => {
2965
- const t = Bl.exec(e)?.[1];
2964
+ }, Zl = /^([A-Za-z]{1,3})(\d+)$/u, Wl = (e) => {
2965
+ const t = Zl.exec(e)?.[1];
2966
2966
  if (t === void 0) return null;
2967
2967
  let n = 0;
2968
2968
  for (const r of t.toUpperCase()) n = n * 26 + (r.charCodeAt(0) - 64);
2969
2969
  return n - 1;
2970
- }, Hl = (e, t, n, r) => {
2970
+ }, Gl = (e, t, n, r) => {
2971
2971
  const o = e.value.join("");
2972
2972
  switch (e.type) {
2973
2973
  case "s":
@@ -2980,16 +2980,16 @@ const Ji = /* @__PURE__ */ new Map([
2980
2980
  case "e":
2981
2981
  return o;
2982
2982
  case "d":
2983
- return ql(o.trim());
2983
+ return Vl(o.trim());
2984
2984
  default: {
2985
2985
  const s = o.trim();
2986
2986
  if (s === "") return "";
2987
2987
  const a = Number(s);
2988
- return Number.isFinite(a) ? Al(a, n[e.style] ?? Ee, r) : s;
2988
+ return Number.isFinite(a) ? _l(a, n[e.style] ?? Ee, r) : s;
2989
2989
  }
2990
2990
  }
2991
- }, zl = async (e, t, n, r, o) => {
2992
- const s = Nr(t);
2991
+ }, Kl = async (e, t, n, r, o) => {
2992
+ const s = Ir(t);
2993
2993
  let a = -1, i = /* @__PURE__ */ new Map(), f = 0, u = null;
2994
2994
  return await He(
2995
2995
  e,
@@ -2999,13 +2999,13 @@ const Ji = /* @__PURE__ */ new Map([
2999
2999
  const g = Number(d.get("r"));
3000
3000
  a = Number.isInteger(g) && g > a + 1 ? g - 1 : a + 1, i = /* @__PURE__ */ new Map(), f = 0;
3001
3001
  } else if (l === "c") {
3002
- const g = Ul(d.get("r") ?? "") ?? f, v = Number(d.get("s") ?? "0");
3002
+ const g = Wl(d.get("r") ?? "") ?? f, v = Number(d.get("s") ?? "0");
3003
3003
  u = { column: g, type: d.get("t") ?? "n", style: Number.isInteger(v) ? v : 0, value: [], inline: [], inValue: !1, inInlineText: !1, phoneticDepth: 0 };
3004
3004
  } else u !== null && (l === "v" ? u.inValue = !h : l === "rPh" && !h ? u.phoneticDepth += 1 : l === "t" && u.type === "inlineStr" && u.phoneticDepth === 0 && (u.inInlineText = !h));
3005
3005
  },
3006
3006
  end: (l) => {
3007
3007
  if (l === "c" && u !== null) {
3008
- const d = Hl(u, n, r, o);
3008
+ const d = Gl(u, n, r, o);
3009
3009
  d !== "" && i.set(u.column, d), f = u.column + 1, u = null;
3010
3010
  } else l === "row" ? s.addRow(a, i, 1) : u !== null && (l === "v" ? u.inValue = !1 : l === "rPh" ? u.phoneticDepth = Math.max(0, u.phoneticDepth - 1) : l === "t" && (u.inInlineText = !1));
3011
3011
  },
@@ -3015,8 +3015,8 @@ const Ji = /* @__PURE__ */ new Map([
3015
3015
  },
3016
3016
  s.full
3017
3017
  ), s.table();
3018
- }, jl = async (e, t) => {
3019
- const n = bt(await $n(e, "", t), "officeDocument") ?? ce("has no officeDocument relationship"), r = await tt(e, n, t.maxPartBytes) ?? ce(`has no part ${n}`), { sheets: o, date1904: s } = Il(r), a = await $n(e, n, t), i = bt(a, "sharedStrings"), f = i === null ? null : Fe(e, i, t.maxPartBytes), u = f === null ? [] : await $l(f), l = bt(a, "styles"), d = l === null ? null : await tt(e, l, t.maxPartBytes), h = d === null ? [] : _l(d), g = [];
3018
+ }, Yl = async (e, t) => {
3019
+ const n = bt(await $n(e, "", t), "officeDocument") ?? ce("has no officeDocument relationship"), r = await tt(e, n, t.maxPartBytes) ?? ce(`has no part ${n}`), { sheets: o, date1904: s } = Ul(r), a = await $n(e, n, t), i = bt(a, "sharedStrings"), f = i === null ? null : Fe(e, i, t.maxPartBytes), u = f === null ? [] : await Hl(f), l = bt(a, "styles"), d = l === null ? null : await tt(e, l, t.maxPartBytes), h = d === null ? [] : zl(d), g = [];
3020
3020
  let v = 0;
3021
3021
  for (const y of o) {
3022
3022
  const T = a.get(y.relationship) ?? ce(`lists the sheet ${y.name} without its relationship`);
@@ -3026,27 +3026,27 @@ const Ji = /* @__PURE__ */ new Map([
3026
3026
  }
3027
3027
  e.entries.has(T.target) || ce(`has no part ${T.target} for the sheet ${y.name}`), g.push({
3028
3028
  name: y.name,
3029
- read: async (C) => {
3029
+ read: async (O) => {
3030
3030
  const R = Fe(e, T.target, t.maxPartBytes) ?? ce(`has no part ${T.target}`);
3031
- return zl(R, C, u, h, s);
3031
+ return Kl(R, O, u, h, s);
3032
3032
  }
3033
3033
  });
3034
3034
  }
3035
3035
  return g.length === 0 && ce("shows no sheet"), { sheets: g.slice(0, t.maxSheets), unshownSheets: v, unlistedSheets: Math.max(0, g.length - t.maxSheets) };
3036
- }, Vl = Object.freeze([80, 75, 3, 4]), Zl = Object.freeze([208, 207, 17, 224, 161, 177, 26, 225]), yt = Uint8Array.from([..."EncryptedPackage"].flatMap((e) => [e.charCodeAt(0), 0])), Wl = /* @__PURE__ */ new Set(["application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.spreadsheet-template"]), Gl = "mimetype", jr = (e, t) => e.byteLength >= t.length && t.every((n, r) => e[r] === n), Vr = (e) => jr(e, Vl), Zr = (e) => jr(e, Zl), Kl = (e) => {
3036
+ }, Xl = Object.freeze([80, 75, 3, 4]), Jl = Object.freeze([208, 207, 17, 224, 161, 177, 26, 225]), yt = Uint8Array.from([..."EncryptedPackage"].flatMap((e) => [e.charCodeAt(0), 0])), Ql = /* @__PURE__ */ new Set(["application/vnd.oasis.opendocument.spreadsheet", "application/vnd.oasis.opendocument.spreadsheet-template"]), ec = "mimetype", Wr = (e, t) => e.byteLength >= t.length && t.every((n, r) => e[r] === n), Gr = (e) => Wr(e, Xl), Kr = (e) => Wr(e, Jl), tc = (e) => {
3037
3037
  const t = e.byteLength - yt.byteLength;
3038
3038
  for (let n = 0; n <= t; n += 1)
3039
3039
  if (e[n] === yt[0] && yt.every((r, o) => e[n + o] === r)) return !0;
3040
3040
  return !1;
3041
- }, Yl = async (e, t) => {
3042
- if (Zr(e))
3043
- throw Kl(e) ? new ne("encrypted", "the bytes are a password-protected workbook") : new ne("not-workbook", "the bytes are a compound file (a legacy .xls)");
3044
- if (!Vr(e)) throw new ne("not-workbook", "the bytes are no ZIP package");
3045
- const n = ml(e), r = await tt(n, Gl, t.maxPartBytes);
3046
- if (r !== null && Wl.has(r.trim())) return kl(n, t);
3047
- if (n.entries.has(zr)) return jl(n, t);
3041
+ }, nc = async (e, t) => {
3042
+ if (Kr(e))
3043
+ throw tc(e) ? new ne("encrypted", "the bytes are a password-protected workbook") : new ne("not-workbook", "the bytes are a compound file (a legacy .xls)");
3044
+ if (!Gr(e)) throw new ne("not-workbook", "the bytes are no ZIP package");
3045
+ const n = bl(e), r = await tt(n, ec, t.maxPartBytes);
3046
+ if (r !== null && Ql.has(r.trim())) return Cl(n, t);
3047
+ if (n.entries.has(Zr)) return Yl(n, t);
3048
3048
  throw new ne("not-workbook", "the ZIP package is neither an OpenDocument spreadsheet nor an Office Open XML package");
3049
- }, Xl = async (e, t) => {
3049
+ }, rc = async (e, t) => {
3050
3050
  const n = e.getReader(), r = [];
3051
3051
  let o = 0;
3052
3052
  try {
@@ -3065,34 +3065,34 @@ const Ji = /* @__PURE__ */ new Map([
3065
3065
  for (const i of r)
3066
3066
  s.set(i, a), a += i.byteLength;
3067
3067
  return s;
3068
- }, Wr = async (e, t) => {
3068
+ }, Yr = async (e, t) => {
3069
3069
  try {
3070
3070
  return { kind: "table", table: await e.read(t) };
3071
3071
  } catch (n) {
3072
3072
  return { kind: "refused", refusal: n instanceof ne ? n.refusal : "not-workbook" };
3073
3073
  }
3074
- }, Jl = async (e, t, n, r, o) => {
3075
- const s = await e.asset(Ao(t), o);
3074
+ }, oc = async (e, t, n, r, o) => {
3075
+ const s = await e.asset($o(t), o);
3076
3076
  if (s.status === "cancelled") return null;
3077
3077
  if (s.status === "error") return { kind: "failure", failure: s.failure };
3078
3078
  let a;
3079
3079
  try {
3080
- a = await Xl(s.body, n.maxBytes);
3080
+ a = await rc(s.body, n.maxBytes);
3081
3081
  } catch {
3082
3082
  return o.aborted ? null : { kind: "failure", failure: { reason: "failed" } };
3083
3083
  }
3084
3084
  if (o.aborted) return null;
3085
3085
  if (a === null) return { kind: "refused", refusal: "too-large" };
3086
- if (!(Vr(a) || Zr(a))) return { kind: "not-package" };
3086
+ if (!(Gr(a) || Kr(a))) return { kind: "not-package" };
3087
3087
  try {
3088
- const i = await Yl(a, n.limits), f = r === null ? -1 : i.sheets.findIndex((h) => h.name === r), u = Math.max(f, 0), l = i.sheets[u];
3088
+ const i = await nc(a, n.limits), f = r === null ? -1 : i.sheets.findIndex((h) => h.name === r), u = Math.max(f, 0), l = i.sheets[u];
3089
3089
  if (l === void 0) return { kind: "refused", refusal: "not-workbook" };
3090
- const d = await Wr(l, n.budget);
3090
+ const d = await Yr(l, n.budget);
3091
3091
  return o.aborted ? null : { kind: "workbook", workbook: i, selected: u, sheet: d };
3092
3092
  } catch (i) {
3093
3093
  return i instanceof ne ? { kind: "refused", refusal: i.refusal } : o.aborted ? null : { kind: "failure", failure: { reason: "failed" } };
3094
3094
  }
3095
- }, Ql = Object.freeze({ className: "aqmx-document-spreadsheet-body", "data-aqmx-document-scroller": "" }), ec = (e, t) => {
3095
+ }, sc = Object.freeze({ className: "aqmx-document-spreadsheet-body", "data-aqmx-document-scroller": "" }), ac = (e, t) => {
3096
3096
  switch (t.code) {
3097
3097
  case "encoding":
3098
3098
  return e.spreadsheetUnreadableEncoding(t.encodings);
@@ -3110,13 +3110,13 @@ const Ji = /* @__PURE__ */ new Map([
3110
3110
  case "too-large":
3111
3111
  return e.spreadsheetWorkbookTooLarge;
3112
3112
  }
3113
- }, kt = (e) => e.every((t) => t.every((n) => n === "")), Gr = ({ name: e, url: t, openUrl: n, state: r, children: o }) => /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-spreadsheet-view", "data-aqmx-spreadsheet": r, children: [
3114
- /* @__PURE__ */ c(Ue, { name: e, openUrl: n, downloadUrl: t, icon: /* @__PURE__ */ c(Fi, {}) }),
3115
- /* @__PURE__ */ c(Be, { scrollerProps: Ql, children: /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet-column", children: o }) })
3116
- ] }), Kr = ({ rows: e, title: t }) => {
3117
- const { labels: n, locale: r, theme: o } = $(), s = se(we), a = X(() => ({ ...Ir(n, r), table: t, fullscreenDialog: n.spreadsheetFullscreen(t) }), [n, r, t]), i = X(() => Qo(e), [e]);
3113
+ }, kt = (e) => e.every((t) => t.every((n) => n === "")), Xr = ({ name: e, url: t, openUrl: n, state: r, children: o }) => /* @__PURE__ */ B("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-spreadsheet-view", "data-aqmx-spreadsheet": r, children: [
3114
+ /* @__PURE__ */ c(Ue, { name: e, openUrl: n, downloadUrl: t, icon: /* @__PURE__ */ c(ji, {}) }),
3115
+ /* @__PURE__ */ c(Be, { scrollerProps: sc, children: /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet-column", children: o }) })
3116
+ ] }), Jr = ({ rows: e, title: t }) => {
3117
+ const { labels: n, locale: r, theme: o } = $(), s = se(we), a = X(() => ({ ...Fr(n, r), table: t, fullscreenDialog: n.spreadsheetFullscreen(t) }), [n, r, t]), i = X(() => os(e), [e]);
3118
3118
  return (
3119
- /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet", "data-theme": o, children: /* @__PURE__ */ c(Go, { tsv: i, layout: s === "fill" ? "fill" : "inline", locale: r, labels: a }) })
3119
+ /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet", "data-theme": o, children: /* @__PURE__ */ c(Qo, { tsv: i, layout: s === "fill" ? "fill" : "inline", locale: r, labels: a }) })
3120
3120
  );
3121
3121
  }, De = ({ note: e, testId: t, code: n, download: r }) => {
3122
3122
  const { labels: o } = $();
@@ -3124,81 +3124,81 @@ const Ji = /* @__PURE__ */ new Map([
3124
3124
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: e }),
3125
3125
  /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: r.url, download: r.name, "data-testid": "markdown-explorer-spreadsheet-unreadable-download", children: o.download })
3126
3126
  ] }) });
3127
- }, Yr = ({ reading: e, name: t, url: n }) => {
3127
+ }, Qr = ({ reading: e, name: t, url: n }) => {
3128
3128
  const { labels: r } = $();
3129
3129
  switch (e.kind) {
3130
3130
  case "table":
3131
3131
  return /* @__PURE__ */ B(pe, { children: [
3132
3132
  e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-truncated", children: r.spreadsheetTruncated }) : null,
3133
- /* @__PURE__ */ c(Kr, { rows: e.rows, title: t })
3133
+ /* @__PURE__ */ c(Jr, { rows: e.rows, title: t })
3134
3134
  ] });
3135
3135
  case "empty":
3136
3136
  return /* @__PURE__ */ c(De, { note: r.spreadsheetEmpty, testId: "markdown-explorer-spreadsheet-empty" });
3137
3137
  case "unreadable":
3138
- return /* @__PURE__ */ c(De, { note: ec(r, e), testId: "markdown-explorer-spreadsheet-unreadable", code: e.code, download: { url: n, name: t } });
3138
+ return /* @__PURE__ */ c(De, { note: ac(r, e), testId: "markdown-explorer-spreadsheet-unreadable", code: e.code, download: { url: n, name: t } });
3139
3139
  }
3140
- }, tc = ({ path: e, document: t }) => t.format === "workbook" ? /* @__PURE__ */ c(rc, { path: e, document: t }) : /* @__PURE__ */ c(nc, { path: e, document: t, format: t.format }), nc = ({ path: e, document: t, format: n }) => {
3140
+ }, ic = ({ path: e, document: t }) => t.format === "workbook" ? /* @__PURE__ */ c(cc, { path: e, document: t }) : /* @__PURE__ */ c(lc, { path: e, document: t, format: t.format }), lc = ({ path: e, document: t, format: n }) => {
3141
3141
  const { config: r, data: o, labels: s } = $(), { name: a, url: i } = t, f = F(
3142
3142
  async (h) => {
3143
- const g = await Pr(o, i, { format: n, legacyEncoding: r.legacyTextEncoding, maxBytes: r.spreadsheets.maxBytes, budget: Ye }, h);
3143
+ const g = await _r(o, i, { format: n, legacyEncoding: r.legacyTextEncoding, maxBytes: r.spreadsheets.maxBytes, budget: Ye }, h);
3144
3144
  return g === null || g.kind === "failure" ? g : { kind: "read", value: g };
3145
3145
  },
3146
3146
  [o, i, n, r.legacyTextEncoding, r.spreadsheets.maxBytes]
3147
3147
  ), { shown: u, failure: l, retry: d } = Ht(e, a, f);
3148
- return /* @__PURE__ */ B(Gr, { name: a, url: i, openUrl: rt(i), state: u === null ? l === null ? "loading" : "failure" : u.kind, children: [
3149
- u === null && l === null ? /* @__PURE__ */ c(Oe, { label: s.spreadsheetLoading, testId: "markdown-explorer-spreadsheet-skeleton" }) : null,
3148
+ return /* @__PURE__ */ B(Xr, { name: a, url: i, openUrl: rt(i), state: u === null ? l === null ? "loading" : "failure" : u.kind, children: [
3149
+ u === null && l === null ? /* @__PURE__ */ c(Ce, { label: s.spreadsheetLoading, testId: "markdown-explorer-spreadsheet-skeleton" }) : null,
3150
3150
  u === null && l !== null ? /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet-failure", children: /* @__PURE__ */ c(Re, { failure: l, alert: !1, onRetry: d, testId: "markdown-explorer-spreadsheet-failure" }) }) : null,
3151
- u === null ? null : /* @__PURE__ */ c(Yr, { reading: u, name: a, url: i })
3151
+ u === null ? null : /* @__PURE__ */ c(Qr, { reading: u, name: a, url: i })
3152
3152
  ] });
3153
- }, rc = ({ path: e, document: t }) => {
3153
+ }, cc = ({ path: e, document: t }) => {
3154
3154
  const { config: n, data: r, labels: o } = $(), { name: s, url: a, firstSheetText: i } = t, f = Te(), u = U(null), l = F(
3155
3155
  async (b) => {
3156
- const S = await Jl(r, a, { maxBytes: n.spreadsheets.maxWorkbookBytes, limits: ji, budget: Ye }, u.current, b);
3156
+ const S = await oc(r, a, { maxBytes: n.spreadsheets.maxWorkbookBytes, limits: Yi, budget: Ye }, u.current, b);
3157
3157
  if (S === null || S.kind === "failure") return S;
3158
3158
  if (S.kind === "workbook") return { kind: "read", value: S };
3159
3159
  if (i !== null) {
3160
- const M = await Pr(r, a, { format: i, legacyEncoding: n.legacyTextEncoding, maxBytes: n.spreadsheets.maxBytes, budget: Ye }, b);
3161
- return M === null || M.kind === "failure" ? M : { kind: "read", value: { kind: "first-sheet", reading: M } };
3160
+ const L = await _r(r, a, { format: i, legacyEncoding: n.legacyTextEncoding, maxBytes: n.spreadsheets.maxBytes, budget: Ye }, b);
3161
+ return L === null || L.kind === "failure" ? L : { kind: "read", value: { kind: "first-sheet", reading: L } };
3162
3162
  }
3163
3163
  return { kind: "read", value: { kind: "refused", refusal: S.kind === "not-package" ? "not-workbook" : S.refusal } };
3164
3164
  },
3165
3165
  [r, a, i, n.legacyTextEncoding, n.spreadsheets.maxBytes, n.spreadsheets.maxWorkbookBytes]
3166
- ), { shown: d, failure: h, retry: g } = Ht(e, s, l), [v, y] = V(null), T = U(/* @__PURE__ */ new WeakMap()), C = d?.kind === "workbook" ? d : null, R = C === null ? null : v !== null && v.workbook === C.workbook ? v : { workbook: C.workbook, index: C.selected, reading: C.sheet }, q = (b) => {
3167
- if (C === null) return;
3168
- const S = C.workbook.sheets[b];
3166
+ ), { shown: d, failure: h, retry: g } = Ht(e, s, l), [v, y] = V(null), T = U(/* @__PURE__ */ new WeakMap()), O = d?.kind === "workbook" ? d : null, R = O === null ? null : v !== null && v.workbook === O.workbook ? v : { workbook: O.workbook, index: O.selected, reading: O.sheet }, q = (b) => {
3167
+ if (O === null) return;
3168
+ const S = O.workbook.sheets[b];
3169
3169
  if (S === void 0) return;
3170
3170
  u.current = S.name;
3171
- let M = T.current.get(C.workbook);
3172
- M === void 0 && (M = /* @__PURE__ */ new Map([[C.selected, C.sheet]]), T.current.set(C.workbook, M));
3173
- const L = M.get(b), P = { workbook: C.workbook, index: b, reading: L ?? null };
3174
- if (y(P), L !== void 0) return;
3175
- const H = M;
3176
- Wr(S, Ye).then((K) => {
3171
+ let L = T.current.get(O.workbook);
3172
+ L === void 0 && (L = /* @__PURE__ */ new Map([[O.selected, O.sheet]]), T.current.set(O.workbook, L));
3173
+ const M = L.get(b), P = { workbook: O.workbook, index: b, reading: M ?? null };
3174
+ if (y(P), M !== void 0) return;
3175
+ const H = L;
3176
+ Yr(S, Ye).then((K) => {
3177
3177
  H.set(b, K), y((w) => w === P ? { ...P, reading: K } : w);
3178
3178
  });
3179
- }, D = R === null ? null : R.reading === null ? "loading" : R.reading.kind === "refused" ? "unreadable" : kt(R.reading.table.rows) ? "empty" : "table", m = d === null ? h === null ? "loading" : "failure" : d.kind === "first-sheet" ? d.reading.kind : d.kind === "refused" ? "unreadable" : D ?? "loading", p = i === null ? a : rt(a), x = (b) => `${f}-sheet-${b}`, A = `${f}-panel`, I = R === null ? null : C?.workbook.sheets[R.index]?.name ?? null, _ = C !== null && C.workbook.sheets.length > 1;
3180
- return /* @__PURE__ */ B(Gr, { name: s, url: a, openUrl: p, state: m, children: [
3181
- d === null && h === null ? /* @__PURE__ */ c(Oe, { label: o.spreadsheetLoading, testId: "markdown-explorer-spreadsheet-skeleton" }) : null,
3179
+ }, D = R === null ? null : R.reading === null ? "loading" : R.reading.kind === "refused" ? "unreadable" : kt(R.reading.table.rows) ? "empty" : "table", m = d === null ? h === null ? "loading" : "failure" : d.kind === "first-sheet" ? d.reading.kind : d.kind === "refused" ? "unreadable" : D ?? "loading", p = i === null ? a : rt(a), x = (b) => `${f}-sheet-${b}`, A = `${f}-panel`, I = R === null ? null : O?.workbook.sheets[R.index]?.name ?? null, _ = O !== null && O.workbook.sheets.length > 1;
3180
+ return /* @__PURE__ */ B(Xr, { name: s, url: a, openUrl: p, state: m, children: [
3181
+ d === null && h === null ? /* @__PURE__ */ c(Ce, { label: o.spreadsheetLoading, testId: "markdown-explorer-spreadsheet-skeleton" }) : null,
3182
3182
  d === null && h !== null ? /* @__PURE__ */ c("div", { className: "aqmx-document-spreadsheet-failure", children: /* @__PURE__ */ c(Re, { failure: h, alert: !1, onRetry: g, testId: "markdown-explorer-spreadsheet-failure" }) }) : null,
3183
3183
  d?.kind === "refused" ? /* @__PURE__ */ c(De, { note: _n(o, d.refusal), testId: "markdown-explorer-spreadsheet-unreadable", code: d.refusal, download: { url: a, name: s } }) : null,
3184
3184
  d?.kind === "first-sheet" ? /* @__PURE__ */ B(pe, { children: [
3185
3185
  /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-first-sheet", children: o.spreadsheetWorkbookFirstSheet }),
3186
- /* @__PURE__ */ c(Yr, { reading: d.reading, name: s, url: a })
3186
+ /* @__PURE__ */ c(Qr, { reading: d.reading, name: s, url: a })
3187
3187
  ] }) : null,
3188
- C === null || R === null || I === null ? null : /* @__PURE__ */ B(pe, { children: [
3189
- C.workbook.unshownSheets > 0 ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-unshown-sheets", children: o.spreadsheetUnshownSheets(C.workbook.unshownSheets) }) : null,
3190
- C.workbook.unlistedSheets > 0 ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-unlisted-sheets", children: o.spreadsheetUnlistedSheets(C.workbook.sheets.length) }) : null,
3191
- _ ? /* @__PURE__ */ c(Zi, { names: C.workbook.sheets.map((b) => b.name), selected: R.index, onSelect: q, label: o.spreadsheetSheets(s), tabIdOf: x, panelId: A }) : null,
3188
+ O === null || R === null || I === null ? null : /* @__PURE__ */ B(pe, { children: [
3189
+ O.workbook.unshownSheets > 0 ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-unshown-sheets", children: o.spreadsheetUnshownSheets(O.workbook.unshownSheets) }) : null,
3190
+ O.workbook.unlistedSheets > 0 ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-unlisted-sheets", children: o.spreadsheetUnlistedSheets(O.workbook.sheets.length) }) : null,
3191
+ _ ? /* @__PURE__ */ c(Ji, { names: O.workbook.sheets.map((b) => b.name), selected: R.index, onSelect: q, label: o.spreadsheetSheets(s), tabIdOf: x, panelId: A }) : null,
3192
3192
  /* @__PURE__ */ B("div", { className: "aqmx-document-spreadsheet-sheet", "data-testid": "markdown-explorer-spreadsheet-sheet", "data-aqmx-sheet": R.index, ..._ ? { role: "tabpanel", id: A, "aria-labelledby": x(R.index) } : {}, children: [
3193
- R.reading === null ? /* @__PURE__ */ c(Oe, { label: o.spreadsheetSheetLoading, testId: "markdown-explorer-spreadsheet-sheet-skeleton" }) : null,
3193
+ R.reading === null ? /* @__PURE__ */ c(Ce, { label: o.spreadsheetSheetLoading, testId: "markdown-explorer-spreadsheet-sheet-skeleton" }) : null,
3194
3194
  R.reading?.kind === "table" && R.reading.table.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-spreadsheet-truncated", children: o.spreadsheetTruncated }) : null,
3195
3195
  R.reading?.kind === "refused" ? /* @__PURE__ */ c(De, { note: _n(o, R.reading.refusal), testId: "markdown-explorer-spreadsheet-unreadable", code: R.reading.refusal, download: { url: a, name: s } }) : null,
3196
3196
  R.reading?.kind === "table" && kt(R.reading.table.rows) ? /* @__PURE__ */ c(De, { note: o.spreadsheetSheetEmpty, testId: "markdown-explorer-spreadsheet-empty" }) : null,
3197
- R.reading?.kind === "table" && !kt(R.reading.table.rows) ? /* @__PURE__ */ c(Kr, { rows: R.reading.table.rows, title: o.spreadsheetSheetName(s, I) }, R.index) : null
3197
+ R.reading?.kind === "table" && !kt(R.reading.table.rows) ? /* @__PURE__ */ c(Jr, { rows: R.reading.table.rows, title: o.spreadsheetSheetName(s, I) }, R.index) : null
3198
3198
  ] })
3199
3199
  ] })
3200
3200
  ] });
3201
- }, oc = Object.freeze({ kind: "empty" }), sc = (e, t, n) => {
3201
+ }, dc = Object.freeze({ kind: "empty" }), uc = (e, t, n) => {
3202
3202
  if (t.view === "multi" || t.overrides[n] === void 0) return null;
3203
3203
  const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
3204
3204
  return Ne(e, { ...t, overrides: r });
@@ -3210,7 +3210,7 @@ const Ji = /* @__PURE__ */ new Map([
3210
3210
  i
3211
3211
  ] })
3212
3212
  );
3213
- }, ac = ({ absence: e, announces: t, announceFailure: n }) => {
3213
+ }, fc = ({ absence: e, announces: t, announceFailure: n }) => {
3214
3214
  const { labels: r, announcer: o } = $(), s = e.kind === "no-readme" ? e.folder : null, a = e.kind === "failure" ? e.folder : null, i = e.kind === "failure" ? e.failure : null;
3215
3215
  switch (ee(() => {
3216
3216
  t && s !== null && o.announce(r.folderReadmeMissing(fe(s)));
@@ -3228,55 +3228,55 @@ const Ji = /* @__PURE__ */ new Map([
3228
3228
  }
3229
3229
  }, Vt = ({ label: e }) => {
3230
3230
  const { labels: t } = $();
3231
- return /* @__PURE__ */ c(Pe, { kind: "loading", label: e, stale: !1, busy: !0, children: /* @__PURE__ */ c(Oe, { label: t.documentLoading, testId: "markdown-explorer-document-skeleton" }) });
3232
- }, Fn = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), ic = ({ path: e, document: t, viewer: n, editing: r }) => {
3233
- const { reportMathDiagnostics: o, edits: s } = $(), a = X(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), i = bi(), f = yi(), u = X(() => o === void 0 ? void 0 : (m) => o(e, m), [o, e]), l = U(null), { editable: d, doubleClick: h, region: g, paneScroll: v, stale: y } = r;
3231
+ return /* @__PURE__ */ c(Pe, { kind: "loading", label: e, stale: !1, busy: !0, children: /* @__PURE__ */ c(Ce, { label: t.documentLoading, testId: "markdown-explorer-document-skeleton" }) });
3232
+ }, Fn = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), mc = ({ path: e, document: t, viewer: n, editing: r }) => {
3233
+ const { reportMathDiagnostics: o, edits: s } = $(), a = X(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), i = Ti(), f = Ri(), u = X(() => o === void 0 ? void 0 : (m) => o(e, m), [o, e]), l = U(null), { editable: d, doubleClick: h, region: g, paneScroll: v, stale: y } = r;
3234
3234
  Y(() => {
3235
3235
  if (d)
3236
3236
  return s.bindView(e, {
3237
3237
  anchor: () => {
3238
3238
  const m = l.current, p = g(), x = m === null ? null : m.querySelector(st);
3239
- return m === null || p === null || x === null ? null : ea(m, v.scrollerOf(p, x));
3239
+ return m === null || p === null || x === null ? null : sa(m, v.scrollerOf(p, x));
3240
3240
  }
3241
3241
  });
3242
3242
  }, [s, e, d, g, v]);
3243
3243
  const T = (m) => {
3244
3244
  const p = l.current, { target: x } = m;
3245
- !h || p === null || !(x instanceof Element) || !Js(x) || (m.stopPropagation(), s.start(e, Qs(x, p, p.ownerDocument.getSelection())));
3246
- }, C = U(null), R = U(y);
3245
+ !h || p === null || !(x instanceof Element) || !ra(x) || (m.stopPropagation(), s.start(e, oa(x, p, p.ownerDocument.getSelection())));
3246
+ }, O = U(null), R = U(y);
3247
3247
  Y(() => {
3248
3248
  R.current = y;
3249
3249
  });
3250
3250
  const q = le((m) => {
3251
- const p = l.current, x = g(), A = p === null ? null : sa(p, m.line);
3251
+ const p = l.current, x = g(), A = p === null ? null : da(p, m.line);
3252
3252
  if (x === null || A === null) return !1;
3253
3253
  const I = v.scrollerOf(x, A);
3254
- return I.scrollTop += aa(A, m.line) - m.clientTop, !0;
3254
+ return I.scrollTop += ua(A, m.line) - m.clientTop, !0;
3255
3255
  }), D = le((m) => {
3256
3256
  const p = g();
3257
3257
  if (p === null) return;
3258
3258
  const x = () => {
3259
3259
  for (const I of Fn) p.removeEventListener(I, A, !0);
3260
- C.current?.release === x && (C.current = null);
3260
+ O.current?.release === x && (O.current = null);
3261
3261
  }, A = () => x();
3262
3262
  for (const I of Fn) p.addEventListener(I, A, { capture: !0, passive: !0 });
3263
- C.current = { point: m, release: x };
3263
+ O.current = { point: m, release: x };
3264
3264
  });
3265
3265
  return Y(() => {
3266
3266
  const m = s.takeReturn(e);
3267
3267
  if (m !== null)
3268
3268
  return queueMicrotask(() => {
3269
3269
  q(m) && R.current && D(m);
3270
- }), () => C.current?.release();
3270
+ }), () => O.current?.release();
3271
3271
  }, [s, e]), Y(() => {
3272
- const m = C.current;
3272
+ const m = O.current;
3273
3273
  m === null || y || (m.release(), q(m.point));
3274
3274
  }, [t, y]),
3275
3275
  /* @__PURE__ */ c("div", { ref: l, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ c(tr, { ...n, onHeadingSelect: i, headingHref: f, onMathDiagnostics: u, parseResult: a, content: null }) });
3276
- }, Xr = ({ document: e, viewer: t }) => {
3276
+ }, eo = ({ document: e, viewer: t }) => {
3277
3277
  const { labels: n } = $();
3278
3278
  return /* @__PURE__ */ B(pe, { children: [
3279
- /* @__PURE__ */ c(Ue, { name: e.name, openUrl: rt(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(zs, {}), children: e.truncated ? null : /* @__PURE__ */ c(Ra, { text: e.text }) }),
3279
+ /* @__PURE__ */ c(Ue, { name: e.name, openUrl: rt(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(Gs, {}), children: e.truncated ? null : /* @__PURE__ */ c(Na, { text: e.text }) }),
3280
3280
  e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
3281
3281
  /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(tr, { ...t, parseResult: null, content: e.text }) })
3282
3282
  ] });
@@ -3288,35 +3288,35 @@ const Ji = /* @__PURE__ */ new Map([
3288
3288
  },
3289
3289
  [r, e]
3290
3290
  ), { shown: a, failure: i, retry: f } = Ht(e, t, s);
3291
- return a !== null ? /* @__PURE__ */ c(Xr, { document: a, viewer: n }) : i !== null ? /* @__PURE__ */ c(qt, { failure: i, onRetry: f, testId: "markdown-explorer-markup-failure" }) : /* @__PURE__ */ c(Oe, { label: o.markupLoading, testId: "markdown-explorer-markup-skeleton" });
3292
- }, lc = Object.freeze({ reason: "failed" }), cc = (e) => {
3291
+ return a !== null ? /* @__PURE__ */ c(eo, { document: a, viewer: n }) : i !== null ? /* @__PURE__ */ c(qt, { failure: i, onRetry: f, testId: "markdown-explorer-markup-failure" }) : /* @__PURE__ */ c(Ce, { label: o.markupLoading, testId: "markdown-explorer-markup-skeleton" });
3292
+ }, hc = Object.freeze({ reason: "failed" }), pc = (e) => {
3293
3293
  const { labels: t } = $();
3294
3294
  return /* @__PURE__ */ c(
3295
- Zs,
3295
+ Xs,
3296
3296
  {
3297
- fallback: (n) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(Re, { failure: lc, alert: !1, onRetry: n, testId: "markdown-explorer-edit-load-failure" }) }),
3298
- children: /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c(Oe, { label: t.editLoading, testId: "markdown-explorer-edit-skeleton" }), children: /* @__PURE__ */ c(Vs, { ...e }) })
3297
+ fallback: (n) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(Re, { failure: hc, alert: !1, onRetry: n, testId: "markdown-explorer-edit-load-failure" }) }),
3298
+ children: /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c(Ce, { label: t.editLoading, testId: "markdown-explorer-edit-skeleton" }), children: /* @__PURE__ */ c(Ys, { ...e }) })
3299
3299
  }
3300
3300
  );
3301
- }, dc = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: s }) => {
3301
+ }, gc = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: s }) => {
3302
3302
  switch (t.kind) {
3303
3303
  case "markdown": {
3304
3304
  const { session: a, layout: i, region: f, paneScroll: u, stale: l } = s;
3305
- if (n === "edit" && a !== void 0) return /* @__PURE__ */ c(cc, { path: e, name: t.name, session: a, layout: i, viewer: r, region: f, paneScroll: u });
3305
+ if (n === "edit" && a !== void 0) return /* @__PURE__ */ c(pc, { path: e, name: t.name, session: a, layout: i, viewer: r, region: f, paneScroll: u });
3306
3306
  if (n === "markup") return /* @__PURE__ */ c(Et, { path: e, name: t.name, viewer: r });
3307
3307
  const d = t.edit !== null && (t.edit.kind === "inline" || t.edit.kind === "draft");
3308
- return /* @__PURE__ */ c(ic, { path: e, document: t, viewer: r, editing: { editable: d, doubleClick: d && i === "fill", region: f, paneScroll: u, stale: l } });
3308
+ return /* @__PURE__ */ c(mc, { path: e, document: t, viewer: r, editing: { editable: d, doubleClick: d && i === "fill", region: f, paneScroll: u, stale: l } });
3309
3309
  }
3310
3310
  case "text":
3311
- return /* @__PURE__ */ c(Xr, { document: t, viewer: r });
3311
+ return /* @__PURE__ */ c(eo, { document: t, viewer: r });
3312
3312
  case "image":
3313
- return n === "markup" && Ut(t) === "svg" ? /* @__PURE__ */ c(Et, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(ii, { document: t });
3313
+ return n === "markup" && Ut(t) === "svg" ? /* @__PURE__ */ c(Et, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(mi, { document: t });
3314
3314
  case "media":
3315
- return /* @__PURE__ */ c(Pi, { document: t });
3315
+ return /* @__PURE__ */ c(Bi, { document: t });
3316
3316
  case "spreadsheet":
3317
- return n === "markup" ? /* @__PURE__ */ c(Et, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(tc, { path: e, document: t });
3317
+ return n === "markup" ? /* @__PURE__ */ c(Et, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(ic, { path: e, document: t });
3318
3318
  case "file":
3319
- return /* @__PURE__ */ c(Ia, { document: t });
3319
+ return /* @__PURE__ */ c(Ua, { document: t });
3320
3320
  case "failure":
3321
3321
  return /* @__PURE__ */ c(qt, { failure: t.failure, onRetry: o, testId: "markdown-explorer-document-failure" });
3322
3322
  default: {
@@ -3324,15 +3324,15 @@ const Ji = /* @__PURE__ */ new Map([
3324
3324
  throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(a)}`);
3325
3325
  }
3326
3326
  }
3327
- }, uc = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', fc = (e, t, n) => {
3328
- const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : xr(e, n), r === void 0 ? null : Sr(e, r.id), e.querySelector(st), e.querySelector(uc)];
3327
+ }, wc = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', vc = (e, t, n) => {
3328
+ const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : Cr(e, n), r === void 0 ? null : Rr(e, r.id), e.querySelector(st), e.querySelector(wc)];
3329
3329
  for (const s of o)
3330
3330
  if (s instanceof HTMLElement && vr(s)) return s;
3331
3331
  return null;
3332
3332
  }, qn = (e, t, n) => {
3333
3333
  const { activeElement: r, body: o } = e.ownerDocument, s = r === null || r === o;
3334
3334
  t instanceof HTMLElement && n && (s || e.contains(r)) && vr(t);
3335
- }, mc = (e) => {
3335
+ }, bc = (e) => {
3336
3336
  const t = U(!1);
3337
3337
  return Y(() => {
3338
3338
  const n = e.current;
@@ -3358,10 +3358,10 @@ const Ji = /* @__PURE__ */ new Map([
3358
3358
  clearTimeout(a), o.removeEventListener("pointerdown", i, !0), o.removeEventListener("mousedown", i, !0), o.removeEventListener("focusin", f, !0), o.removeEventListener("blur", l), o.removeEventListener("focus", d), n.removeEventListener("focusout", u);
3359
3359
  };
3360
3360
  }, [e]), t;
3361
- }, hc = Object.freeze({ count: 0, recovered: !1 }), pc = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: s, regionLabel: a, navigation: i, fragment: f, paneScroll: u, announces: l, announceFailure: d, onDocumentShown: h }) => {
3362
- const { labels: g, announcer: v, documents: y } = $(), { document: T } = t, C = U(null), R = U(null), q = U(null), D = U(0), m = mc(C), p = U({ path: e, document: T }), x = U(null), A = F(
3361
+ }, yc = Object.freeze({ count: 0, recovered: !1 }), kc = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: s, regionLabel: a, navigation: i, fragment: f, paneScroll: u, announces: l, announceFailure: d, onDocumentShown: h }) => {
3362
+ const { labels: g, announcer: v, documents: y } = $(), { document: T } = t, O = U(null), R = U(null), q = U(null), D = U(0), m = bc(O), p = U({ path: e, document: T }), x = U(null), A = F(
3363
3363
  (j) => {
3364
- const Z = C.current, Q = yn(Z, j, u);
3364
+ const Z = O.current, Q = yn(Z, j, u);
3365
3365
  Z !== null && Q !== null && qn(Z, Q, m.current);
3366
3366
  },
3367
3367
  [u, m]
@@ -3380,11 +3380,11 @@ const Ji = /* @__PURE__ */ new Map([
3380
3380
  }, 0);
3381
3381
  },
3382
3382
  [A]
3383
- ), b = X(() => ({ navigation: i, currentPath: e, scrollWithin: A, followSameUrlJump: I, followEmptyFragment: _ }), [i, e, A, I, _]), S = F(() => y.retry(e), [y, e]), M = la(y, fi), L = pr(e), P = L !== void 0 ? "edit" : n ? "markup" : "rendered", H = Ut(T) === null ? void 0 : P, K = F(() => C.current, []), w = X(() => ({ session: L, layout: s, region: K, paneScroll: u, stale: r }), [L, s, K, u, r]), k = H === "edit" ? !1 : r, O = se(we), N = H === "edit" && s === "fill" ? "fill" : O, [z, W] = V(0), J = U(0), G = U(!1), [ie, Wt] = V(hc), [Gt, to] = V(0), Kt = U(d), Yt = U(r);
3383
+ ), b = X(() => ({ navigation: i, currentPath: e, scrollWithin: A, followSameUrlJump: I, followEmptyFragment: _ }), [i, e, A, I, _]), S = F(() => y.retry(e), [y, e]), L = ma(y, vi), M = pr(e), P = M !== void 0 ? "edit" : n ? "markup" : "rendered", H = Ut(T) === null ? void 0 : P, K = F(() => O.current, []), w = X(() => ({ session: M, layout: s, region: K, paneScroll: u, stale: r }), [M, s, K, u, r]), k = H === "edit" ? !1 : r, C = se(we), N = H === "edit" && s === "fill" ? "fill" : C, [z, W] = V(0), J = U(0), G = U(!1), [ie, Wt] = V(yc), [Gt, oo] = V(0), Kt = U(d), Yt = U(r);
3384
3384
  Y(() => {
3385
3385
  Kt.current = d, Yt.current = r;
3386
3386
  }, [d, r]);
3387
- const no = X(
3387
+ const so = X(
3388
3388
  () => ({
3389
3389
  announceFailure: (j) => {
3390
3390
  Yt.current || Kt.current(j);
@@ -3404,7 +3404,7 @@ const Ji = /* @__PURE__ */ new Map([
3404
3404
  }
3405
3405
  },
3406
3406
  release: () => {
3407
- re || (re = !0, j.release(), J.current -= 1, Z || to((be) => be + 1));
3407
+ re || (re = !0, j.release(), J.current -= 1, Z || oo((be) => be + 1));
3408
3408
  }
3409
3409
  };
3410
3410
  },
@@ -3417,7 +3417,7 @@ const Ji = /* @__PURE__ */ new Map([
3417
3417
  }
3418
3418
  }),
3419
3419
  [y, e]
3420
- ), Xt = k || z > 0, ro = le((j, Z) => {
3420
+ ), Xt = k || z > 0, ao = le((j, Z) => {
3421
3421
  const Q = R.current;
3422
3422
  if (Q !== null && Q.path === j && Q.snapshot === Z) return;
3423
3423
  R.current = { path: j, snapshot: Z }, y.noteShown(j, Z);
@@ -3429,32 +3429,32 @@ const Ji = /* @__PURE__ */ new Map([
3429
3429
  h?.(j, re), !(!l || Q !== null && Q.path === j && Q.snapshot.document.kind !== "failure") && (G.current = J.current > 0, G.current || v.announce(g.documentShown(re.name)));
3430
3430
  });
3431
3431
  ee(() => {
3432
- ro(e, t);
3432
+ ao(e, t);
3433
3433
  }, [e, t]);
3434
- const oo = le(() => {
3434
+ const io = le(() => {
3435
3435
  f.kind === "panel" && f.consume();
3436
3436
  }), Jt = le((j) => {
3437
- const Z = C.current;
3437
+ const Z = O.current;
3438
3438
  if (Z === null || !m.current) return null;
3439
3439
  const { activeElement: Q, body: re } = Z.ownerDocument;
3440
- return Q !== null && Q !== re ? null : fc(Z, T, j);
3441
- }), so = le((j) => {
3440
+ return Q !== null && Q !== re ? null : vc(Z, T, j);
3441
+ }), lo = le((j) => {
3442
3442
  const Z = G.current;
3443
3443
  G.current = !1, !r && (j && Jt(null), l && (j || Z) && T.kind !== "failure" && v.announce(g.documentShown(T.name)));
3444
3444
  });
3445
3445
  ee(() => {
3446
- ie.count > 0 && so(ie.recovered);
3446
+ ie.count > 0 && lo(ie.recovered);
3447
3447
  }, [ie]);
3448
- const ao = le(() => {
3448
+ const co = le(() => {
3449
3449
  J.current > 0 || !G.current || (G.current = !1, l && !r && T.kind !== "failure" && v.announce(g.documentShown(T.name)));
3450
3450
  });
3451
3451
  ee(() => {
3452
- Gt > 0 && ao();
3452
+ Gt > 0 && co();
3453
3453
  }, [Gt]);
3454
- const io = le((j) => {
3455
- const Z = C.current;
3454
+ const uo = le((j) => {
3455
+ const Z = O.current;
3456
3456
  Z !== null && qn(Z, j, m.current);
3457
- }), lo = le((j) => u.reveal(j)), co = le((j) => yn(C.current, j, u));
3457
+ }), fo = le((j) => u.reveal(j)), mo = le((j) => yn(O.current, j, u));
3458
3458
  return ee(() => {
3459
3459
  if (r) return;
3460
3460
  const j = p.current.path !== e, Z = j || p.current.document !== T;
@@ -3462,49 +3462,49 @@ const Ji = /* @__PURE__ */ new Map([
3462
3462
  const Q = x.current !== e;
3463
3463
  x.current = e;
3464
3464
  let re = null;
3465
- f.kind === "page" ? q.current !== f.navigation && (q.current = f.navigation, D.current += 1, re = f.fragment) : f.fragment !== null && (re = f.fragment, oo());
3465
+ f.kind === "page" ? q.current !== f.navigation && (q.current = f.navigation, D.current += 1, re = f.fragment) : f.fragment !== null && (re = f.fragment, io());
3466
3466
  const be = () => {
3467
- const ye = re === null ? null : co(re);
3467
+ const ye = re === null ? null : mo(re);
3468
3468
  if (!Z) {
3469
- ye !== null && io(ye);
3469
+ ye !== null && uo(ye);
3470
3470
  return;
3471
3471
  }
3472
3472
  const ze = Jt(f.fragment);
3473
- j && ye === null && ze !== null && lo(ze);
3473
+ j && ye === null && ze !== null && fo(ze);
3474
3474
  };
3475
3475
  Q ? queueMicrotask(be) : be();
3476
- }, [f, e, T, r]), /* @__PURE__ */ c(we, { value: N, children: /* @__PURE__ */ c(Pe, { kind: T.kind, view: H, label: a(e, T), stale: Xt, busy: Xt, frameRef: C, intent: M, children: /* @__PURE__ */ c(Rr, { value: b, children: /* @__PURE__ */ c(di, { children: /* @__PURE__ */ c(kr, { value: no, children: /* @__PURE__ */ c(dc, { path: e, document: T, view: P, viewer: o, onRetry: S, editing: w }, e) }) }) }) }) });
3477
- }, Zt = Object.freeze({ kind: "skeleton" }), gc = (e, t, n, r, o) => {
3476
+ }, [f, e, T, r]), /* @__PURE__ */ c(we, { value: N, children: /* @__PURE__ */ c(Pe, { kind: T.kind, view: H, label: a(e, T), stale: Xt, busy: Xt, frameRef: O, intent: L, children: /* @__PURE__ */ c(Lr, { value: b, children: /* @__PURE__ */ c(gi, { children: /* @__PURE__ */ c(xr, { value: so, children: /* @__PURE__ */ c(gc, { path: e, document: T, view: P, viewer: o, onRetry: S, editing: w }, e) }) }) }) }) });
3477
+ }, Zt = Object.freeze({ kind: "skeleton" }), Ec = (e, t, n, r, o) => {
3478
3478
  if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
3479
3479
  const s = ge(t);
3480
3480
  if (s !== null) return { kind: "document", path: e, snapshot: s, stale: !0 };
3481
3481
  if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
3482
3482
  const a = n === null || n === e ? null : ge(r);
3483
3483
  return n === null || a === null ? Zt : { kind: "document", path: n, snapshot: a, stale: !0 };
3484
- }, wc = (e, t) => t.status === "deferred" ? Zt : { kind: "document", path: e, snapshot: t, stale: !1 }, vc = ({ requestedPath: e, content: t, markup: n, ...r }) => {
3485
- const o = t.kind === "streaming" ? wc(t.path, se(t.promise)) : t;
3486
- return o.kind !== "document" ? /* @__PURE__ */ c(Vt, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(pc, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
3487
- }, Jr = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: s, paneScroll: a, announces: i, announceFailure: f, onDocumentShown: u }) => {
3488
- const { config: l, labels: d, locale: h, theme: g, documents: v, data: y } = $(), T = Ko(), C = U(!1);
3484
+ }, Sc = (e, t) => t.status === "deferred" ? Zt : { kind: "document", path: e, snapshot: t, stale: !1 }, xc = ({ requestedPath: e, content: t, markup: n, ...r }) => {
3485
+ const o = t.kind === "streaming" ? Sc(t.path, se(t.promise)) : t;
3486
+ return o.kind !== "document" ? /* @__PURE__ */ c(Vt, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(kc, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
3487
+ }, to = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: s, paneScroll: a, announces: i, announceFailure: f, onDocumentShown: u }) => {
3488
+ const { config: l, labels: d, locale: h, theme: g, documents: v, data: y } = $(), T = es(), O = U(!1);
3489
3489
  Y(() => {
3490
- C.current = !0;
3490
+ O.current = !0;
3491
3491
  }, []);
3492
3492
  const [R, q] = V(null), [D, m] = V(n), p = F(() => e === null ? void 0 : v.peek(e), [v, e]), x = oe(v.subscribe, p, p), A = F(() => R === null ? void 0 : v.peek(R), [v, R]), I = oe(v.subscribe, A, A);
3493
3493
  Y(() => e === null ? void 0 : v.open(e), [v, e]), Y(() => R === null ? void 0 : v.retain(R), [v, R]);
3494
- const _ = e === null ? Zt : gc(e, x, R, I, !C.current), b = e === null ? null : _.kind === "document" && !_.stale ? _.path : R;
3494
+ const _ = e === null ? Zt : Ec(e, x, R, I, !O.current), b = e === null ? null : _.kind === "document" && !_.stale ? _.path : R;
3495
3495
  b !== R && q(b);
3496
3496
  const S = _.kind !== "document" || _.path === e;
3497
3497
  S && n !== D && m(n);
3498
- const M = X(() => Xi(d, h), [d, h]), L = X(() => ({ read: (O, N) => li(y, O, N) }), [y]), P = X(() => [...l.iframeHosts], [l]), H = o.kind === "panel", K = X(
3498
+ const L = X(() => rl(d, h), [d, h]), M = X(() => ({ read: (C, N) => hi(y, C, N) }), [y]), P = X(() => [...l.iframeHosts], [l]), H = o.kind === "panel", K = X(
3499
3499
  () => ({
3500
- labels: M,
3500
+ labels: L,
3501
3501
  spreadsheetLocale: h,
3502
3502
  emptyMessage: d.documentEmpty,
3503
3503
  theme: g,
3504
3504
  availableStyles: l.documentStyles,
3505
3505
  iFrameAllowedDomains: P,
3506
3506
  embeds: l.embeds,
3507
- linkComponent: vi,
3507
+ linkComponent: xi,
3508
3508
  toolbar: T,
3509
3509
  style: r.style,
3510
3510
  onStyleChange: r.onStyleChange,
@@ -3517,12 +3517,13 @@ const Ji = /* @__PURE__ */ new Map([
3517
3517
  width: r.width === void 0 ? void 0 : `min(${r.width}, 100%)`,
3518
3518
  maxWidth: r.maxWidth === void 0 ? void 0 : `min(${r.maxWidth}, 100%)`,
3519
3519
  renderScrollBar: H ? void 0 : br,
3520
- imageSource: L
3520
+ scrollBarGutter: H ? void 0 : Er,
3521
+ imageSource: M
3521
3522
  }),
3522
- [M, h, d.documentEmpty, g, l.documentStyles, P, l.embeds, T, r, H, L]
3523
- ), w = F((O, N) => H ? N === null || N.kind === "failure" ? fe(O) : N.name : d.documentRegion, [H, d.documentRegion]), k = H ? "content" : "fill";
3524
- return e === null ? /* @__PURE__ */ c(we, { value: k, children: /* @__PURE__ */ c(ac, { absence: t, announces: i, announceFailure: f }) }) : /* @__PURE__ */ c(we, { value: k, children: /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c(Vt, { label: w(e, null) }), children: /* @__PURE__ */ c(
3525
- vc,
3523
+ [L, h, d.documentEmpty, g, l.documentStyles, P, l.embeds, T, r, H, M]
3524
+ ), w = F((C, N) => H ? N === null || N.kind === "failure" ? fe(C) : N.name : d.documentRegion, [H, d.documentRegion]), k = H ? "content" : "fill";
3525
+ return e === null ? /* @__PURE__ */ c(we, { value: k, children: /* @__PURE__ */ c(fc, { absence: t, announces: i, announceFailure: f }) }) : /* @__PURE__ */ c(we, { value: k, children: /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c(Vt, { label: w(e, null) }), children: /* @__PURE__ */ c(
3526
+ xc,
3526
3527
  {
3527
3528
  requestedPath: e,
3528
3529
  content: _,
@@ -3538,15 +3539,15 @@ const Ji = /* @__PURE__ */ new Map([
3538
3539
  onDocumentShown: u
3539
3540
  }
3540
3541
  ) }) });
3541
- }, bc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
3542
+ }, Tc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
3542
3543
  const { config: s, viewSettings: a, announcer: i } = $(), f = Je((I) => I.style), u = Je((I) => I.align), l = ot(), d = Xn(), h = $t(), { view: g, overrides: v, embed: y } = r, T = F(
3543
3544
  (I) => {
3544
3545
  if (h.kind !== "location") return;
3545
- const _ = sc(s, h.location, I);
3546
+ const _ = uc(s, h.location, I);
3546
3547
  _ !== null && l(_, "browse");
3547
3548
  },
3548
3549
  [s, l, h]
3549
- ), C = F(
3550
+ ), O = F(
3550
3551
  (I) => {
3551
3552
  a.update({ style: I }), T("style");
3552
3553
  },
@@ -3556,10 +3557,10 @@ const Ji = /* @__PURE__ */ new Map([
3556
3557
  a.update({ align: I }), T("align");
3557
3558
  },
3558
3559
  [a, T]
3559
- ), q = $r(s, v.style, f), D = _r(v.align, u), m = X(
3560
+ ), q = qr(s, v.style, f), D = Br(v.align, u), m = X(
3560
3561
  () => ({
3561
3562
  style: q,
3562
- onStyleChange: C,
3563
+ onStyleChange: O,
3563
3564
  align: D,
3564
3565
  onAlignChange: R,
3565
3566
  showToc: y.showToc !== !1,
@@ -3570,11 +3571,11 @@ const Ji = /* @__PURE__ */ new Map([
3570
3571
  maxWidth: y.maxWidth,
3571
3572
  editLayout: "fill"
3572
3573
  }),
3573
- [q, C, D, R, y]
3574
+ [q, O, D, R, y]
3574
3575
  ), p = X(() => ({ kind: "page", view: g, overrides: v, embed: y }), [g, v, y]), x = X(() => ({ kind: "page", fragment: d.hash, navigation: d }), [d]), A = F((I) => i.announce(I), [i]);
3575
- return /* @__PURE__ */ c(Jr, { path: e, absence: t, markup: n, display: m, navigation: p, fragment: x, paneScroll: Ha, announces: !0, announceFailure: A, onDocumentShown: o });
3576
- }, yc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
3577
- const { config: s, viewSettings: a } = $(), i = Je((p) => p.style), f = Je((p) => p.align), [u, l] = V(() => $r(s, void 0, i)), d = _r(void 0, f), h = F((p) => a.update({ align: p }), [a]), { maximized: g, onDocumentLink: v, pendingHash: y, onHashConsumed: T, announceFailure: C, paneScroll: R } = r, q = X(
3576
+ return /* @__PURE__ */ c(to, { path: e, absence: t, markup: n, display: m, navigation: p, fragment: x, paneScroll: Ga, announces: !0, announceFailure: A, onDocumentShown: o });
3577
+ }, Rc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
3578
+ const { config: s, viewSettings: a } = $(), i = Je((p) => p.style), f = Je((p) => p.align), [u, l] = V(() => qr(s, void 0, i)), d = Br(void 0, f), h = F((p) => a.update({ align: p }), [a]), { maximized: g, onDocumentLink: v, pendingHash: y, onHashConsumed: T, announceFailure: O, paneScroll: R } = r, q = X(
3578
3579
  () => ({
3579
3580
  style: u,
3580
3581
  onStyleChange: l,
@@ -3590,9 +3591,9 @@ const Ji = /* @__PURE__ */ new Map([
3590
3591
  }),
3591
3592
  [u, d, h, g]
3592
3593
  ), D = X(() => ({ kind: "panel", onDocumentLink: v }), [v]), m = X(() => ({ kind: "panel", fragment: y, consume: T }), [y, T]);
3593
- return /* @__PURE__ */ c(Jr, { path: e, absence: t, markup: n, display: q, navigation: D, fragment: m, paneScroll: R, announces: !1, announceFailure: C, onDocumentShown: o });
3594
- }, kc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ c(bc, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ c(yc, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
3595
- function Ec({
3594
+ return /* @__PURE__ */ c(to, { path: e, absence: t, markup: n, display: q, navigation: D, fragment: m, paneScroll: R, announces: !1, announceFailure: O, onDocumentShown: o });
3595
+ }, Cc = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ c(Tc, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ c(Rc, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
3596
+ function Oc({
3596
3597
  title: e,
3597
3598
  titleId: t,
3598
3599
  ...n
@@ -3613,8 +3614,8 @@ function Ec({
3613
3614
  clipRule: "evenodd"
3614
3615
  }));
3615
3616
  }
3616
- const Sc = /* @__PURE__ */ E.forwardRef(Ec);
3617
- function xc({
3617
+ const Lc = /* @__PURE__ */ E.forwardRef(Oc);
3618
+ function Mc({
3618
3619
  title: e,
3619
3620
  titleId: t,
3620
3621
  ...n
@@ -3635,8 +3636,8 @@ function xc({
3635
3636
  clipRule: "evenodd"
3636
3637
  }));
3637
3638
  }
3638
- const Qr = /* @__PURE__ */ E.forwardRef(xc);
3639
- function Tc({
3639
+ const no = /* @__PURE__ */ E.forwardRef(Mc);
3640
+ function Ac({
3640
3641
  title: e,
3641
3642
  titleId: t,
3642
3643
  ...n
@@ -3657,8 +3658,8 @@ function Tc({
3657
3658
  clipRule: "evenodd"
3658
3659
  }));
3659
3660
  }
3660
- const Rc = /* @__PURE__ */ E.forwardRef(Tc);
3661
- function Oc({
3661
+ const Nc = /* @__PURE__ */ E.forwardRef(Ac);
3662
+ function Dc({
3662
3663
  title: e,
3663
3664
  titleId: t,
3664
3665
  ...n
@@ -3683,8 +3684,8 @@ function Oc({
3683
3684
  clipRule: "evenodd"
3684
3685
  }));
3685
3686
  }
3686
- const Cc = /* @__PURE__ */ E.forwardRef(Oc);
3687
- function Mc({
3687
+ const Pc = /* @__PURE__ */ E.forwardRef(Dc);
3688
+ function Ic({
3688
3689
  title: e,
3689
3690
  titleId: t,
3690
3691
  ...n
@@ -3705,8 +3706,8 @@ function Mc({
3705
3706
  clipRule: "evenodd"
3706
3707
  }));
3707
3708
  }
3708
- const Lc = /* @__PURE__ */ E.forwardRef(Mc);
3709
- function Ac({
3709
+ const $c = /* @__PURE__ */ E.forwardRef(Ic);
3710
+ function _c({
3710
3711
  title: e,
3711
3712
  titleId: t,
3712
3713
  ...n
@@ -3729,8 +3730,8 @@ function Ac({
3729
3730
  d: "M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
3730
3731
  }));
3731
3732
  }
3732
- const Nc = /* @__PURE__ */ E.forwardRef(Ac);
3733
- function Dc({
3733
+ const Fc = /* @__PURE__ */ E.forwardRef(_c);
3734
+ function qc({
3734
3735
  title: e,
3735
3736
  titleId: t,
3736
3737
  ...n
@@ -3753,8 +3754,8 @@ function Dc({
3753
3754
  clipRule: "evenodd"
3754
3755
  }));
3755
3756
  }
3756
- const Pc = /* @__PURE__ */ E.forwardRef(Dc);
3757
- function Ic({
3757
+ const Bc = /* @__PURE__ */ E.forwardRef(qc);
3758
+ function Uc({
3758
3759
  title: e,
3759
3760
  titleId: t,
3760
3761
  ...n
@@ -3775,8 +3776,8 @@ function Ic({
3775
3776
  d: "M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"
3776
3777
  }));
3777
3778
  }
3778
- const $c = /* @__PURE__ */ E.forwardRef(Ic);
3779
- function _c({
3779
+ const Hc = /* @__PURE__ */ E.forwardRef(Uc);
3780
+ function zc({
3780
3781
  title: e,
3781
3782
  titleId: t,
3782
3783
  ...n
@@ -3795,7 +3796,7 @@ function _c({
3795
3796
  d: "M15 3.75H9v16.5h6V3.75ZM16.5 20.25h3.375c1.035 0 1.875-.84 1.875-1.875V5.625c0-1.036-.84-1.875-1.875-1.875H16.5v16.5ZM4.125 3.75H7.5v16.5H4.125a1.875 1.875 0 0 1-1.875-1.875V5.625c0-1.036.84-1.875 1.875-1.875Z"
3796
3797
  }));
3797
3798
  }
3798
- const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId: n }) => {
3799
+ const jc = /* @__PURE__ */ E.forwardRef(zc), Vc = ({ href: e, onRetry: t, testId: n }) => {
3799
3800
  const { labels: r, onEditGrant: o } = $(), [s, a] = V(!1), i = () => {
3800
3801
  o === void 0 || s || (a(!0), o(e).then((f) => {
3801
3802
  f && t();
@@ -3811,22 +3812,22 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3811
3812
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
3812
3813
  ] })
3813
3814
  ] });
3814
- }, Bc = "Control+E Meta+E", Uc = (e, t, n) => n && t ? "split" : e.view, Bn = (e, t, n, r) => {
3815
+ }, Zc = "Control+E Meta+E", Wc = (e, t, n) => n && t ? "split" : e.view, Bn = (e, t, n, r) => {
3815
3816
  if (n === "split") {
3816
3817
  e.setSideBySide(!0);
3817
3818
  return;
3818
3819
  }
3819
3820
  e.setView(t, n), r && e.sideBySide() && e.setSideBySide(!1);
3820
- }, ou = (e) => e === "split" ? null : e, Hc = (e) => e === "preview" ? "editor" : "preview", zc = (e) => /Mac|iPhone|iPad|iPod/u.test(e), jc = (e, t) => {
3821
+ }, fu = (e) => e === "split" ? null : e, Gc = (e) => e === "preview" ? "editor" : "preview", Kc = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Yc = (e, t) => {
3821
3822
  if (e.isComposing || e.altKey || e.shiftKey || (t ? !e.metaKey || e.ctrlKey : !e.ctrlKey || e.metaKey)) return !1;
3822
3823
  const n = e.key.toLowerCase();
3823
3824
  return n === "e" || e.code === "KeyE" && /^\p{L}$/u.test(n) && !/^[a-z]$/u.test(n);
3824
3825
  }, Un = (e, t, n) => {
3825
3826
  const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
3826
3827
  return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
3827
- }, Vc = ({ path: e, documentName: t, open: n, onClose: r }) => {
3828
- const { data: o, edits: s, labels: a, locale: i, announcer: f } = $(), u = Te(), [l, d] = V(null), [h, g] = V(0), [v, y] = V(null), [T, C] = V(null), R = X(() => new Intl.DateTimeFormat(i, { dateStyle: "medium", timeStyle: "short" }), [i]), q = F(() => {
3829
- y(null), C(null);
3828
+ }, Xc = ({ path: e, documentName: t, open: n, onClose: r }) => {
3829
+ const { data: o, edits: s, labels: a, locale: i, announcer: f } = $(), u = Te(), [l, d] = V(null), [h, g] = V(0), [v, y] = V(null), [T, O] = V(null), R = X(() => new Intl.DateTimeFormat(i, { dateStyle: "medium", timeStyle: "short" }), [i]), q = F(() => {
3830
+ y(null), O(null);
3830
3831
  }, []), D = fr({ open: n, onOpen: q, onDismiss: r });
3831
3832
  ee(() => {
3832
3833
  if (!n) return;
@@ -3837,8 +3838,8 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3837
3838
  }, [n, o, e, h]), ee(() => {
3838
3839
  if (!n || v === null) return;
3839
3840
  const x = new AbortController();
3840
- return C(null), o.revision(e, v, x.signal).then((A) => {
3841
- "kind" in A && C(A);
3841
+ return O(null), o.revision(e, v, x.signal).then((A) => {
3842
+ "kind" in A && O(A);
3842
3843
  }), () => x.abort();
3843
3844
  }, [n, o, e, v]);
3844
3845
  const m = () => {
@@ -3859,12 +3860,12 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3859
3860
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": T === null || T.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: m, children: a.historyRestore })
3860
3861
  ] })
3861
3862
  ] }) });
3862
- }, Zc = (e) => {
3863
+ }, Jc = (e) => {
3863
3864
  const { documents: t } = $(), n = F(() => t.peek(e), [t, e]), r = F(() => t.peekSeeded(e), [t, e]), o = oe(t.subscribe, n, r), s = ge(o)?.document;
3864
3865
  return s === void 0 || s.kind === "failure" ? { edit: null, name: fe(e) } : { edit: s.kind === "markdown" || s.kind === "spreadsheet" ? s.edit : null, name: s.name };
3865
3866
  }, me = (e) => {
3866
3867
  e.stopPropagation();
3867
- }, Wc = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
3868
+ }, Qc = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
3868
3869
  const { draftConverter: s, edits: a, labels: i } = $(), f = oe(
3869
3870
  a.subscribe,
3870
3871
  () => a.session(e) !== void 0,
@@ -3878,7 +3879,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3878
3879
  const y = a.session(e);
3879
3880
  y?.dirty === !0 ? l(y.save.kind === "draft" ? "draft" : "unsaved") : a.close(e);
3880
3881
  }, h = () => {
3881
- f || (js(), r && a.sideBySide() && s?.prepare?.());
3882
+ f || (Ks(), r && a.sideBySide() && s?.prepare?.());
3882
3883
  }, g = n ? o ? i.editDraftDocumentNamed(t) : i.editDocumentNamed(t) : null, v = o ? i.editDraftDocument : i.editDocument;
3883
3884
  return /* @__PURE__ */ B(pe, { children: [
3884
3885
  /* @__PURE__ */ B(
@@ -3895,7 +3896,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3895
3896
  onPointerEnter: h,
3896
3897
  onFocus: h,
3897
3898
  children: [
3898
- /* @__PURE__ */ c($c, { "aria-hidden": "true" }),
3899
+ /* @__PURE__ */ c(Hc, { "aria-hidden": "true" }),
3899
3900
  g === null ? /* @__PURE__ */ c("span", { children: i.editDocumentLabel }) : null
3900
3901
  ]
3901
3902
  }
@@ -3916,7 +3917,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3916
3917
  }
3917
3918
  )
3918
3919
  ] });
3919
- }, Gc = ({ href: e, documentName: t, iconOnly: n }) => {
3920
+ }, ed = ({ href: e, documentName: t, iconOnly: n }) => {
3920
3921
  const { labels: r } = $(), o = n ? r.editExternallyNamed(t) : null;
3921
3922
  return /* @__PURE__ */ B(
3922
3923
  "a",
@@ -3930,29 +3931,29 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3930
3931
  "data-testid": "markdown-explorer-document-edit-external",
3931
3932
  onDoubleClick: me,
3932
3933
  children: [
3933
- /* @__PURE__ */ c(Rc, { "aria-hidden": "true" }),
3934
+ /* @__PURE__ */ c(Nc, { "aria-hidden": "true" }),
3934
3935
  o === null ? /* @__PURE__ */ c("span", { children: r.editExternallyLabel }) : null
3935
3936
  ]
3936
3937
  }
3937
3938
  );
3938
- }, Kc = ({ session: e }) => {
3939
- const { labels: t } = $(), n = ms(t, e);
3939
+ }, td = ({ session: e }) => {
3940
+ const { labels: t } = $(), n = vs(t, e);
3940
3941
  return /* @__PURE__ */ c("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
3941
- }, Yc = Object.freeze(["editor", "split", "preview"]), Xc = Object.freeze(["editor", "preview"]), Jc = Object.freeze({ editor: Qr, split: Fc, preview: Pc }), Qc = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
3942
- const { draftConverter: s, edits: a, labels: i } = $(), f = qs(), u = Uc(r, f, o), l = o ? Yc : Xc, d = Te(), h = U(/* @__PURE__ */ new Map()), g = {
3942
+ }, nd = Object.freeze(["editor", "split", "preview"]), rd = Object.freeze(["editor", "preview"]), od = Object.freeze({ editor: no, split: jc, preview: Bc }), sd = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
3943
+ const { draftConverter: s, edits: a, labels: i } = $(), f = js(), u = Wc(r, f, o), l = o ? nd : rd, d = Te(), h = U(/* @__PURE__ */ new Map()), g = {
3943
3944
  editor: { label: i.editViewEditor, tooltip: i.editViewEditorTooltip },
3944
3945
  split: { label: i.editViewSplit, tooltip: i.editViewSplitTooltip },
3945
3946
  preview: { label: i.editViewPreview, tooltip: i.editViewPreviewTooltip }
3946
3947
  }, v = () => {
3947
3948
  a.preparePreview(e), s?.prepare?.();
3948
3949
  }, y = (T) => {
3949
- if (!jc(T.nativeEvent, zc(navigator.platform))) return;
3950
+ if (!Yc(T.nativeEvent, Kc(navigator.platform))) return;
3950
3951
  dr(T);
3951
- const C = Hc(u);
3952
- Bn(a, e, C, o), h.current.get(C)?.focus();
3952
+ const O = Gc(u);
3953
+ Bn(a, e, O, o), h.current.get(O)?.focus();
3953
3954
  };
3954
3955
  return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? i.editViewNamed(t) : i.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: y, children: l.map((T) => {
3955
- const C = Jc[T], { label: R, tooltip: q } = g[T], D = T === "preview" ? v : void 0;
3956
+ const O = od[T], { label: R, tooltip: q } = g[T], D = T === "preview" ? v : void 0;
3956
3957
  return /* @__PURE__ */ B("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
3957
3958
  /* @__PURE__ */ c(
3958
3959
  "input",
@@ -3965,7 +3966,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3965
3966
  value: T,
3966
3967
  checked: T === u,
3967
3968
  "aria-label": R,
3968
- "aria-keyshortcuts": T === "split" ? void 0 : Bc,
3969
+ "aria-keyshortcuts": T === "split" ? void 0 : Zc,
3969
3970
  title: q,
3970
3971
  "data-testid": `markdown-explorer-edit-view-${T}`,
3971
3972
  onChange: () => Bn(a, e, T, o),
@@ -3974,11 +3975,11 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3974
3975
  onFocus: D
3975
3976
  }
3976
3977
  ),
3977
- /* @__PURE__ */ c(C, { "aria-hidden": "true" }),
3978
+ /* @__PURE__ */ c(O, { "aria-hidden": "true" }),
3978
3979
  n ? null : /* @__PURE__ */ c("span", { children: R })
3979
3980
  ] }, T);
3980
3981
  }) });
3981
- }, ed = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
3982
+ }, ad = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
3982
3983
  const { edits: s, labels: a } = $(), [i, f] = V(!1);
3983
3984
  if (r.phase.kind !== "editing") return null;
3984
3985
  const u = r.save.kind === "saving", l = u || !r.dirty, d = () => {
@@ -3988,35 +3989,35 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
3988
3989
  }, h = (g) => n ? { className: "aqmx-icon-button", "aria-label": g } : { className: "aqmx-icon-button aqmx-labelled-button" };
3989
3990
  return /* @__PURE__ */ B(pe, { children: [
3990
3991
  r.save.kind === "conflicts" ? /* @__PURE__ */ B("button", { type: "button", ...h(a.conflictNext), title: a.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => s.nextConflict(e), onDoubleClick: me, children: [
3991
- /* @__PURE__ */ c(Cc, { "aria-hidden": "true" }),
3992
+ /* @__PURE__ */ c(Pc, { "aria-hidden": "true" }),
3992
3993
  n ? null : /* @__PURE__ */ c("span", { children: a.conflictNext })
3993
3994
  ] }) : null,
3994
- /* @__PURE__ */ c(Qc, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
3995
+ /* @__PURE__ */ c(sd, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
3995
3996
  r.history ? /* @__PURE__ */ B("button", { type: "button", ...h(a.historyOpen), title: a.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => f(!0), onDoubleClick: me, children: [
3996
- /* @__PURE__ */ c(Lc, { "aria-hidden": "true" }),
3997
+ /* @__PURE__ */ c($c, { "aria-hidden": "true" }),
3997
3998
  n ? null : /* @__PURE__ */ c("span", { children: a.historyOpen })
3998
3999
  ] }) : null,
3999
4000
  r.save.kind === "draft" ? null : /* @__PURE__ */ B("button", { type: "button", ...h(a.saveDraft), title: a.saveDraftTooltip, "aria-disabled": l, "aria-busy": u, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: d, onDoubleClick: me, children: [
4000
- /* @__PURE__ */ c(Nc, { "aria-hidden": "true" }),
4001
+ /* @__PURE__ */ c(Fc, { "aria-hidden": "true" }),
4001
4002
  n ? null : /* @__PURE__ */ c("span", { children: a.saveDraft })
4002
4003
  ] }),
4003
- r.history ? /* @__PURE__ */ c(Vc, { path: e, documentName: t, open: i, onClose: () => f(!1) }) : null
4004
+ r.history ? /* @__PURE__ */ c(Xc, { path: e, documentName: t, open: i, onClose: () => f(!1) }) : null
4004
4005
  ] });
4005
- }, td = ({ path: e, session: t }) => {
4006
+ }, id = ({ path: e, session: t }) => {
4006
4007
  const { edits: n } = $();
4007
- return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(qc, { href: t.save.href, onRetry: () => {
4008
+ return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(Vc, { href: t.save.href, onRetry: () => {
4008
4009
  n.save(e);
4009
4010
  }, testId: "markdown-explorer-save-grant" });
4010
- }, nd = /* @__PURE__ */ new Set(), rd = (e, t, n) => {
4011
- const { documents: r, announcer: o, labels: s } = $(), a = F(() => r.peek(e), [r, e]), i = F(() => r.peekSeeded(e), [r, e]), f = oe(r.subscribe, a, i), u = F(() => r.answerStampOf(e), [r, e]), l = oe(r.subscribe, u, u), [d] = V(() => /* @__PURE__ */ new Set()), [h, g] = V(nd), [v, y] = V(null);
4011
+ }, ld = /* @__PURE__ */ new Set(), cd = (e, t, n) => {
4012
+ const { documents: r, announcer: o, labels: s } = $(), a = F(() => r.peek(e), [r, e]), i = F(() => r.peekSeeded(e), [r, e]), f = oe(r.subscribe, a, i), u = F(() => r.answerStampOf(e), [r, e]), l = oe(r.subscribe, u, u), [d] = V(() => /* @__PURE__ */ new Set()), [h, g] = V(ld), [v, y] = V(null);
4012
4013
  v !== null && (v.path !== e || v.markup !== n) && y(null);
4013
4014
  const T = U(null);
4014
4015
  Y(() => (T.current = e, () => {
4015
4016
  T.current = null;
4016
4017
  }), [e]);
4017
- const C = U(n);
4018
+ const O = U(n);
4018
4019
  Y(() => {
4019
- C.current = n;
4020
+ O.current = n;
4020
4021
  }, [n]);
4021
4022
  const R = F(() => {
4022
4023
  const m = e, p = r.peek(m);
@@ -4025,7 +4026,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4025
4026
  const x = await r.refresh(m);
4026
4027
  if (T.current !== m || x.status === "superseded") return;
4027
4028
  if (x.status === "failed") {
4028
- y({ path: m, failure: x.failure, stamp: r.answerStampOf(m), markup: C.current }), o.announce(s.documentRefreshFailed(de(s, x.failure.reason)));
4029
+ y({ path: m, failure: x.failure, stamp: r.answerStampOf(m), markup: O.current }), o.announce(s.documentRefreshFailed(de(s, x.failure.reason)));
4029
4030
  return;
4030
4031
  }
4031
4032
  if (x.status === "shown" && (t || x.failed)) return;
@@ -4038,7 +4039,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4038
4039
  })());
4039
4040
  }, [e, t, d, r, o, s]), q = h.has(e), D = v !== null && v.path === e && v.stamp === l && v.markup === n ? v.failure : null;
4040
4041
  return { refreshing: q, unavailable: q || f?.status === "pending", failure: D, refresh: R };
4041
- }, od = (e, t) => {
4042
+ }, dd = (e, t) => {
4042
4043
  switch (t) {
4043
4044
  case "markdown":
4044
4045
  return e.showMarkup;
@@ -4048,30 +4049,30 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4048
4049
  case "tsv":
4049
4050
  return e.showSpreadsheetMarkup(t.toUpperCase());
4050
4051
  }
4051
- }, sd = Object.freeze({ kind: "page" }), ad = ({ path: e, placement: t, markup: n }) => {
4052
- const { labels: r } = $(), { refreshing: o, unavailable: s, failure: a, refresh: i } = rd(e, t.kind === "page", n.shown), f = Ii(e), u = Zc(e), l = pr(e), d = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, h = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, g = t.kind === "panel", v = t.kind === "panel" ? t.documentName : u.name, y = t.kind === "page" || t.maximized;
4052
+ }, ud = Object.freeze({ kind: "page" }), fd = ({ path: e, placement: t, markup: n }) => {
4053
+ const { labels: r } = $(), { refreshing: o, unavailable: s, failure: a, refresh: i } = cd(e, t.kind === "page", n.shown), f = Ui(e), u = Jc(e), l = pr(e), d = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, h = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, g = t.kind === "panel", v = t.kind === "panel" ? t.documentName : u.name, y = t.kind === "page" || t.maximized;
4053
4054
  return /* @__PURE__ */ B("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": l === void 0 ? void 0 : "true", children: [
4054
4055
  /* @__PURE__ */ B("div", { className: "aqmx-document-refresh-row", children: [
4055
- l === void 0 ? null : /* @__PURE__ */ c(Kc, { session: l }),
4056
- l === void 0 ? null : /* @__PURE__ */ c(ed, { path: e, documentName: v, iconOnly: g, session: l, previewAvailable: y }),
4056
+ l === void 0 ? null : /* @__PURE__ */ c(td, { session: l }),
4057
+ l === void 0 ? null : /* @__PURE__ */ c(ad, { path: e, documentName: v, iconOnly: g, session: l, previewAvailable: y }),
4057
4058
  l === void 0 && f !== null ? /* @__PURE__ */ B(
4058
4059
  "button",
4059
4060
  {
4060
4061
  type: "button",
4061
4062
  className: h === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
4062
- title: h === null ? od(r, f) : h,
4063
+ title: h === null ? dd(r, f) : h,
4063
4064
  "aria-label": h === null ? void 0 : h,
4064
4065
  "aria-pressed": n.shown,
4065
4066
  "data-testid": "markdown-explorer-document-markup",
4066
4067
  onClick: n.toggle,
4067
4068
  onDoubleClick: me,
4068
4069
  children: [
4069
- /* @__PURE__ */ c(Qr, { "aria-hidden": "true" }),
4070
+ /* @__PURE__ */ c(no, { "aria-hidden": "true" }),
4070
4071
  h === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
4071
4072
  ]
4072
4073
  }
4073
4074
  ) : null,
4074
- l !== void 0 || u.edit?.kind === "inline" || u.edit?.kind === "draft" ? /* @__PURE__ */ c(Wc, { path: e, documentName: v, iconOnly: g, previewAvailable: y, draft: u.edit?.kind === "draft" }) : u.edit?.kind === "external" ? /* @__PURE__ */ c(Gc, { href: u.edit.href, documentName: v, iconOnly: g }) : null,
4075
+ l !== void 0 || u.edit?.kind === "inline" || u.edit?.kind === "draft" ? /* @__PURE__ */ c(Qc, { path: e, documentName: v, iconOnly: g, previewAvailable: y, draft: u.edit?.kind === "draft" }) : u.edit?.kind === "external" ? /* @__PURE__ */ c(ed, { href: u.edit.href, documentName: v, iconOnly: g }) : null,
4075
4076
  l === void 0 ? /* @__PURE__ */ B(
4076
4077
  "button",
4077
4078
  {
@@ -4086,27 +4087,27 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4086
4087
  onClick: i,
4087
4088
  onDoubleClick: me,
4088
4089
  children: [
4089
- /* @__PURE__ */ c(Sc, { "aria-hidden": "true" }),
4090
+ /* @__PURE__ */ c(Lc, { "aria-hidden": "true" }),
4090
4091
  d === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
4091
4092
  ]
4092
4093
  }
4093
4094
  ) : null
4094
4095
  ] }),
4095
4096
  l !== void 0 || a === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": a.reason, children: r.documentRefreshFailed(de(r, a.reason)) }),
4096
- l === void 0 ? null : /* @__PURE__ */ c(td, { path: e, session: l })
4097
+ l === void 0 ? null : /* @__PURE__ */ c(id, { path: e, session: l })
4097
4098
  ] });
4098
- }, id = ({ location: e }) => {
4099
- const t = e.doc, n = X(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = $i(e);
4100
- return /* @__PURE__ */ B("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...Ct, children: [
4101
- /* @__PURE__ */ c(ad, { path: t, placement: sd, markup: r }),
4102
- /* @__PURE__ */ c(kc, { path: t, absence: oc, markup: e.markup, variant: n })
4099
+ }, md = ({ location: e }) => {
4100
+ const t = e.doc, n = X(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Hi(e);
4101
+ return /* @__PURE__ */ B("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...Ot, children: [
4102
+ /* @__PURE__ */ c(fd, { path: t, placement: ud, markup: r }),
4103
+ /* @__PURE__ */ c(Cc, { path: t, absence: dc, markup: e.markup, variant: n })
4103
4104
  ] });
4104
- }, ld = ({ holds: e, testId: t }) => {
4105
+ }, hd = ({ holds: e, testId: t }) => {
4105
4106
  const { labels: n, announcer: r } = $(), o = Te();
4106
4107
  Y(() => e ? r.claim(o) : void 0, [e, r, o]);
4107
4108
  const s = F(() => r.shownIn(o), [r, o]), a = oe(r.subscribe, s, s);
4108
4109
  return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: a.length > 1 ? n.announcementSequence(a) : a[0] });
4109
- }, ke = Object.freeze([]), cd = (e) => {
4110
+ }, ke = Object.freeze([]), pd = (e) => {
4110
4111
  const t = /* @__PURE__ */ new Set();
4111
4112
  let n = ke, r = [], o = !1;
4112
4113
  const s = [], a = (l) => {
@@ -4144,13 +4145,13 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4144
4145
  }, ue = Object.freeze({ status: "cancelled" }), Hn = (e) => {
4145
4146
  if (e === null || typeof e != "object") return null;
4146
4147
  const { failure: t } = e;
4147
- if (Do(t) !== null) return null;
4148
+ if (Fo(t) !== null) return null;
4148
4149
  const { reason: n, code: r } = t;
4149
- return Po(n, r);
4150
- }, dd = ({ dataPath: e, onScope: t, fetch: n }) => {
4150
+ return qo(n, r);
4151
+ }, gd = ({ dataPath: e, onScope: t, fetch: n }) => {
4151
4152
  const r = n ?? ((l, d) => globalThis.fetch(l, d)), o = (l, d) => `${e}/${l}?${new URLSearchParams(d).toString()}`, s = (l) => {
4152
4153
  l.status === 401 && t(null);
4153
- const d = l.headers.get(No);
4154
+ const d = l.headers.get(_o);
4154
4155
  d !== null && t(d);
4155
4156
  }, a = async (l, d, h, g) => {
4156
4157
  let v;
@@ -4173,29 +4174,29 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4173
4174
  T = !1;
4174
4175
  }
4175
4176
  if (T) return y;
4176
- const C = Hn(y);
4177
- return g(C !== null ? C : { reason: v.status === 200 ? "failed" : dt(v.status) });
4178
- }, i = { [on]: qo }, f = { [on]: jo, "Content-Type": `${zo}; charset=utf-8` }, u = async (l, d, h) => {
4177
+ const O = Hn(y);
4178
+ return g(O !== null ? O : { reason: v.status === 200 ? "failed" : dt(v.status) });
4179
+ }, i = { [on]: jo }, f = { [on]: Ko, "Content-Type": `${Go}; charset=utf-8` }, u = async (l, d, h) => {
4179
4180
  const g = await a(l, d, h, (v) => ut(v.reason, v.code));
4180
4181
  return d.signal.aborted ? ue : g;
4181
4182
  };
4182
4183
  return {
4183
4184
  tree: (l) => a(o("tree", { [te.source]: l }), { method: "GET" }, rn, (d) => ({ status: "error", failure: d })),
4184
4185
  children: async (l, d, h) => {
4185
- const g = await a(o("children", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, Fo, (v) => ({ status: "error", failure: v }));
4186
+ const g = await a(o("children", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, zo, (v) => ({ status: "error", failure: v }));
4186
4187
  return h.aborted ? ue : g;
4187
4188
  },
4188
4189
  ancestors: async (l, d, h) => {
4189
- const g = await a(o("ancestors", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, _o, (v) => ({ status: "error", failure: v }));
4190
+ const g = await a(o("ancestors", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, Ho, (v) => ({ status: "error", failure: v }));
4190
4191
  return h.aborted ? ue : g;
4191
4192
  },
4192
4193
  reveal: async (l, d, h) => {
4193
- const g = await a(o("reveal", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, $o, (v) => ({ status: "error", failure: v }));
4194
+ const g = await a(o("reveal", { [te.source]: l, [te.path]: d }), { method: "GET", signal: h }, Uo, (v) => ({ status: "error", failure: v }));
4194
4195
  return h.aborted ? ue : g;
4195
4196
  },
4196
- document: (l, { refresh: d }) => a(o("document", { [te.path]: l }), d ? { method: "GET", headers: i } : { method: "GET" }, Wo, (h) => ut(h.reason, h.code)),
4197
+ document: (l, { refresh: d }) => a(o("document", { [te.path]: l }), d ? { method: "GET", headers: i } : { method: "GET" }, Jo, (h) => ut(h.reason, h.code)),
4197
4198
  text: async (l, d) => {
4198
- const h = await a(o("text", { [te.path]: l }), { method: "GET", signal: d }, Io, (g) => ut(g.reason, g.code));
4199
+ const h = await a(o("text", { [te.path]: l }), { method: "GET", signal: d }, Bo, (g) => ut(g.reason, g.code));
4199
4200
  return d.aborted ? ue : h;
4200
4201
  },
4201
4202
  asset: async (l, d) => {
@@ -4216,14 +4217,14 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4216
4217
  const v = Hn(g);
4217
4218
  return { status: "error", failure: v === null ? { reason: dt(h.status) } : v };
4218
4219
  },
4219
- edit: (l, d) => u(o("edit", { [te.path]: l }), { method: "GET", signal: d }, Zo),
4220
- save: (l, d, h, g) => u(o("save", { [te.path]: l, [te.base]: d }), { method: "POST", headers: f, body: h, signal: g }, Vo),
4221
- preview: (l, d, h) => u(o("preview", { [te.path]: l }), { method: "POST", headers: f, body: d, signal: h }, Ho),
4222
- revisions: (l, d) => u(o("revisions", { [te.path]: l }), { method: "GET", signal: d }, Uo),
4223
- revision: (l, d, h) => u(o("revision", { [te.path]: l, [te.revision]: d }), { method: "GET", signal: h }, Bo),
4220
+ edit: (l, d) => u(o("edit", { [te.path]: l }), { method: "GET", signal: d }, Xo),
4221
+ save: (l, d, h, g) => u(o("save", { [te.path]: l, [te.base]: d }), { method: "POST", headers: f, body: h, signal: g }, Yo),
4222
+ preview: (l, d, h) => u(o("preview", { [te.path]: l }), { method: "POST", headers: f, body: d, signal: h }, Wo),
4223
+ revisions: (l, d) => u(o("revisions", { [te.path]: l }), { method: "GET", signal: d }, Zo),
4224
+ revision: (l, d, h) => u(o("revision", { [te.path]: l, [te.revision]: d }), { method: "GET", signal: h }, Vo),
4224
4225
  refresh: (l) => a(o("refresh", { [te.source]: l }), { method: "POST", headers: i }, rn, (d) => ({ status: "error", failure: d }))
4225
4226
  };
4226
- }, ud = () => {
4227
+ }, wd = () => {
4227
4228
  let e = null, t = null;
4228
4229
  return {
4229
4230
  settle: (n) => {
@@ -4238,11 +4239,11 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4238
4239
  return t = null, o;
4239
4240
  }
4240
4241
  };
4241
- }, fd = (e) => {
4242
- const t = Ot(e);
4242
+ }, vd = (e) => {
4243
+ const t = Ct(e);
4243
4244
  if (t === null) return tn;
4244
4245
  try {
4245
- return Oo(JSON.parse(t));
4246
+ return No(JSON.parse(t));
4246
4247
  } catch (n) {
4247
4248
  return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), tn;
4248
4249
  }
@@ -4250,7 +4251,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4250
4251
  let n = null;
4251
4252
  const r = () => {
4252
4253
  if (n === null) {
4253
- const s = fd(e);
4254
+ const s = vd(e);
4254
4255
  n = { changes: s, settings: en(t, s) };
4255
4256
  }
4256
4257
  return n;
@@ -4262,34 +4263,34 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4262
4263
  getServerSnapshot: () => t,
4263
4264
  subscribe: o.subscribe,
4264
4265
  advance: (s) => {
4265
- const { changes: a, settings: i } = r(), f = xo(a, s, To(i, s)[s], t);
4266
- return n = { changes: f, settings: en(t, f) }, o.emit(), Rt(e, Ro(f)), n.settings;
4266
+ const { changes: a, settings: i } = r(), f = Lo(a, s, Mo(i, s)[s], t);
4267
+ return n = { changes: f, settings: en(t, f) }, o.emit(), Rt(e, Ao(f)), n.settings;
4267
4268
  }
4268
4269
  };
4269
- }, md = Object.freeze({ status: "refreshed" }), hd = Object.freeze({ status: "superseded" }), Dt = Object.freeze({ status: "deferred" }), pd = hr(Dt), eo = 4, gd = eo - 1, jn = Object.freeze({ status: "loading" }), wd = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), vd = (e) => {
4270
- const t = /* @__PURE__ */ new Map(), n = yr(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = qe(), f = /* @__PURE__ */ new Set();
4270
+ }, bd = Object.freeze({ status: "refreshed" }), yd = Object.freeze({ status: "superseded" }), Dt = Object.freeze({ status: "deferred" }), kd = hr(Dt), ro = 4, Ed = ro - 1, jn = Object.freeze({ status: "loading" }), Sd = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), xd = (e) => {
4271
+ const t = /* @__PURE__ */ new Map(), n = Sr(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map(), i = qe(), f = /* @__PURE__ */ new Set();
4271
4272
  let u = 0, l = 0;
4272
4273
  const d = { direct: null, bulk: null }, h = /* @__PURE__ */ new Set();
4273
4274
  let g = !1, v = 0;
4274
4275
  const y = () => {
4275
4276
  v += 1, i.emit();
4276
- }, T = (w) => o.get(w) ?? 0, C = (w) => {
4277
+ }, T = (w) => o.get(w) ?? 0, O = (w) => {
4277
4278
  let k = a.get(w);
4278
4279
  return k === void 0 && (k = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, a.set(w, k)), k;
4279
- }, R = (w, k, O) => {
4280
- w.inFlight.delete(k), u -= 1, O.lane === "bulk" && (l -= 1);
4280
+ }, R = (w, k, C) => {
4281
+ w.inFlight.delete(k), u -= 1, C.lane === "bulk" && (l -= 1);
4281
4282
  }, q = (w) => {
4282
4283
  const k = a.get(w);
4283
4284
  if (k !== void 0) {
4284
- for (const [O, N] of [...k.inFlight])
4285
- R(k, O, N), N.controller.abort();
4285
+ for (const [C, N] of [...k.inFlight])
4286
+ R(k, C, N), N.controller.abort();
4286
4287
  k.direct.clear(), k.bulk.clear(), k.unclaimed.clear();
4287
4288
  }
4288
4289
  }, D = (w) => {
4289
4290
  const k = T(w) + 1;
4290
4291
  return o.set(w, k), q(w), k;
4291
4292
  }, m = (w, k) => {
4292
- const O = Ae(w), N = { promise: w, opened: k, stale: !1, loadedAt: O?.status === "ok" ? O.loadedAt : null };
4293
+ const C = Ae(w), N = { promise: w, opened: k, stale: !1, loadedAt: C?.status === "ok" ? C.loadedAt : null };
4293
4294
  return w.status === "pending" && w.then((z) => {
4294
4295
  z.status === "ok" && (N.loadedAt = z.loadedAt);
4295
4296
  }), N;
@@ -4297,7 +4298,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4297
4298
  let k = r.get(w);
4298
4299
  return k === void 0 && (k = /* @__PURE__ */ new Map(), r.set(w, k)), k;
4299
4300
  }, x = (w) => {
4300
- const k = [...a.keys()], O = d[w], N = O === null ? 0 : k.indexOf(O) + 1;
4301
+ const k = [...a.keys()], C = d[w], N = C === null ? 0 : k.indexOf(C) + 1;
4301
4302
  for (let z = 0; z < k.length; z += 1) {
4302
4303
  const W = k[(N + z) % k.length], J = W === void 0 ? void 0 : a.get(W);
4303
4304
  if (!(W === void 0 || J === void 0)) {
@@ -4307,108 +4308,108 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4307
4308
  }
4308
4309
  }
4309
4310
  return null;
4310
- }, A = (w, k, O, N) => {
4311
+ }, A = (w, k, C, N) => {
4311
4312
  const z = a.get(w);
4312
- if (z === void 0 || z.inFlight.get(k) !== O) return;
4313
- R(z, k, O);
4313
+ if (z === void 0 || z.inFlight.get(k) !== C) return;
4314
+ R(z, k, C);
4314
4315
  const W = (z.claims.get(k) ?? 0) > 0, J = p(w);
4315
4316
  if (N.status === "ok" ? J.set(k, { status: "loaded", entries: N.entries }) : N.status === "error" && W ? J.set(k, { status: "failed", failure: N.failure }) : J.delete(k), y(), N.status === "error" && W) {
4316
4317
  const G = { sourceId: w, path: k, failure: N.failure };
4317
4318
  for (const ie of [...f]) ie(G);
4318
4319
  }
4319
4320
  _();
4320
- }, I = (w, k, O) => {
4321
- const N = { controller: new AbortController(), lane: O };
4322
- C(w).inFlight.set(k, N), u += 1, O === "bulk" && (l += 1), e.children(w, k, N.controller.signal).then(
4321
+ }, I = (w, k, C) => {
4322
+ const N = { controller: new AbortController(), lane: C };
4323
+ O(w).inFlight.set(k, N), u += 1, C === "bulk" && (l += 1), e.children(w, k, N.controller.signal).then(
4323
4324
  (z) => A(w, k, N, z),
4324
- () => A(w, k, N, wd)
4325
+ () => A(w, k, N, Sd)
4325
4326
  );
4326
4327
  }, _ = () => {
4327
- for (; u < eo; ) {
4328
+ for (; u < ro; ) {
4328
4329
  const w = x("direct");
4329
4330
  if (w !== null) {
4330
4331
  I(w.sourceId, w.path, "direct");
4331
4332
  continue;
4332
4333
  }
4333
- const k = l < gd ? x("bulk") : null;
4334
+ const k = l < Ed ? x("bulk") : null;
4334
4335
  if (k === null) return;
4335
4336
  I(k.sourceId, k.path, "bulk");
4336
4337
  }
4337
- }, b = (w, k, O) => {
4338
- if (!(k.direct.delete(O) || k.bulk.delete(O))) {
4339
- const z = k.inFlight.get(O);
4338
+ }, b = (w, k, C) => {
4339
+ if (!(k.direct.delete(C) || k.bulk.delete(C))) {
4340
+ const z = k.inFlight.get(C);
4340
4341
  if (z === void 0) return !1;
4341
- R(k, O, z), z.controller.abort();
4342
+ R(k, C, z), z.controller.abort();
4342
4343
  }
4343
- return r.get(w)?.delete(O), !0;
4344
+ return r.get(w)?.delete(C), !0;
4344
4345
  }, S = () => {
4345
4346
  g = !1;
4346
4347
  let w = !1;
4347
4348
  for (const k of h) {
4348
- const O = C(k);
4349
- for (const N of O.unclaimed)
4350
- (O.claims.get(N) ?? 0) === 0 && b(k, O, N) && (w = !0);
4351
- O.unclaimed.clear();
4349
+ const C = O(k);
4350
+ for (const N of C.unclaimed)
4351
+ (C.claims.get(N) ?? 0) === 0 && b(k, C, N) && (w = !0);
4352
+ C.unclaimed.clear();
4352
4353
  }
4353
4354
  h.clear(), w && (y(), _());
4354
- }, M = (w, k) => {
4355
+ }, L = (w, k) => {
4355
4356
  t.set(w, m($e(e.tree(w)), k));
4356
- }, L = (w, k, O) => {
4357
+ }, M = (w, k, C) => {
4357
4358
  D(w);
4358
- const N = m(hr(k), O);
4359
+ const N = m(hr(k), C);
4359
4360
  return t.set(w, N), r.delete(w), y(), _(), N;
4360
- }, P = (w, k, O, N) => {
4361
- if (O !== T(w) || t.get(w) !== k) return;
4361
+ }, P = (w, k, C, N) => {
4362
+ if (C !== T(w) || t.get(w) !== k) return;
4362
4363
  const z = Ae(k.promise);
4363
4364
  if (!(N.status !== "ok" || z?.status !== "ok" || k.loadedAt === null || N.loadedAt <= k.loadedAt)) {
4364
4365
  if (et(z.entries, N.entries)) {
4365
4366
  k.loadedAt = N.loadedAt;
4366
4367
  return;
4367
4368
  }
4368
- L(w, N, k.opened);
4369
+ M(w, N, k.opened);
4369
4370
  }
4370
4371
  }, H = (w, k) => {
4371
- const O = t.get(w);
4372
- return O !== void 0 && Ae(O.promise)?.status === k;
4372
+ const C = t.get(w);
4373
+ return C !== void 0 && Ae(C.promise)?.status === k;
4373
4374
  }, K = (w, k) => {
4374
4375
  k.stale = !1;
4375
- const O = T(w);
4376
- e.tree(w).then((N) => P(w, k, O, N));
4376
+ const C = T(w);
4377
+ e.tree(w).then((N) => P(w, k, C, N));
4377
4378
  };
4378
4379
  return {
4379
- read: (w) => t.get(w)?.promise ?? pd,
4380
+ read: (w) => t.get(w)?.promise ?? kd,
4380
4381
  open: (w) => {
4381
- const k = n.resumes(w), O = n.hold(w), N = t.get(w);
4382
- return N === void 0 || H(w, "deferred") ? (M(w, !0), y()) : k || (N.opened && H(w, "error") ? (M(w, !0), y()) : (N.opened = !0, N.stale && H(w, "ok") && K(w, N))), O;
4382
+ const k = n.resumes(w), C = n.hold(w), N = t.get(w);
4383
+ return N === void 0 || H(w, "deferred") ? (L(w, !0), y()) : k || (N.opened && H(w, "error") ? (L(w, !0), y()) : (N.opened = !0, N.stale && H(w, "ok") && K(w, N))), C;
4383
4384
  },
4384
4385
  retry: (w) => {
4385
- H(w, "error") && (M(w, !0), y());
4386
+ H(w, "error") && (L(w, !0), y());
4386
4387
  },
4387
4388
  seed: (w, k) => {
4388
- const O = k.then(
4389
+ const C = k.then(
4389
4390
  (W) => W === null ? Dt : W,
4390
4391
  () => Dt
4391
4392
  ), N = t.get(w);
4392
4393
  if (N !== void 0 && H(w, "ok")) {
4393
4394
  const W = T(w);
4394
- O.then((J) => P(w, N, W, J));
4395
+ C.then((J) => P(w, N, W, J));
4395
4396
  return;
4396
4397
  }
4397
4398
  D(w);
4398
- const z = m($e(O), N?.opened === !0);
4399
- t.set(w, z), r.delete(w), _(), O.then((W) => {
4400
- t.get(w) === z && (W.status === "deferred" && n.isHeld(w) && M(w, z.opened), y());
4399
+ const z = m($e(C), N?.opened === !0);
4400
+ t.set(w, z), r.delete(w), _(), C.then((W) => {
4401
+ t.get(w) === z && (W.status === "deferred" && n.isHeld(w) && L(w, z.opened), y());
4401
4402
  });
4402
4403
  },
4403
4404
  refresh: async (w) => {
4404
4405
  const k = (s.get(w) ?? 0) + 1;
4405
4406
  s.set(w, k);
4406
- const O = await e.refresh(w);
4407
- if (s.get(w) !== k) return hd;
4408
- if (O.status === "error") return { status: "failed", failure: O.failure };
4407
+ const C = await e.refresh(w);
4408
+ if (s.get(w) !== k) return yd;
4409
+ if (C.status === "error") return { status: "failed", failure: C.failure };
4409
4410
  const N = t.get(w);
4410
- if (!(N !== void 0 && N.loadedAt !== null && H(w, "ok") && N.loadedAt > O.loadedAt)) {
4411
- const W = L(w, O, !0);
4411
+ if (!(N !== void 0 && N.loadedAt !== null && H(w, "ok") && N.loadedAt > C.loadedAt)) {
4412
+ const W = M(w, C, !0);
4412
4413
  if (N !== void 0 && N.promise.status === "pending") {
4413
4414
  const J = T(w);
4414
4415
  N.promise.then((G) => P(w, W, J, G));
@@ -4416,36 +4417,36 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4416
4417
  }
4417
4418
  for (const [W, J] of t)
4418
4419
  W !== w && Ae(J.promise)?.status === "ok" && (J.stale = !0);
4419
- return md;
4420
+ return bd;
4420
4421
  },
4421
4422
  children: (w, k) => r.get(w)?.get(k),
4422
4423
  claimChildren: (w, k) => {
4423
- const O = C(w), N = p(w);
4424
+ const C = O(w), N = p(w);
4424
4425
  let z = !1, W = !1;
4425
4426
  for (const [G, ie] of k)
4426
- O.claims.set(G, (O.claims.get(G) ?? 0) + 1), N.get(G) === void 0 ? (N.set(G, jn), O[ie].add(G), z = !0, W = !0) : ie === "direct" && O.bulk.delete(G) && (O.direct.add(G), W = !0);
4427
+ C.claims.set(G, (C.claims.get(G) ?? 0) + 1), N.get(G) === void 0 ? (N.set(G, jn), C[ie].add(G), z = !0, W = !0) : ie === "direct" && C.bulk.delete(G) && (C.direct.add(G), W = !0);
4427
4428
  z && y(), W && _();
4428
4429
  let J = !1;
4429
4430
  return () => {
4430
4431
  if (!J) {
4431
4432
  J = !0;
4432
4433
  for (const G of k.keys()) {
4433
- const ie = (O.claims.get(G) ?? 0) - 1;
4434
- ie > 0 ? O.claims.set(G, ie) : (O.claims.delete(G), O.unclaimed.add(G));
4434
+ const ie = (C.claims.get(G) ?? 0) - 1;
4435
+ ie > 0 ? C.claims.set(G, ie) : (C.claims.delete(G), C.unclaimed.add(G));
4435
4436
  }
4436
4437
  h.add(w), !g && (g = !0, queueMicrotask(S));
4437
4438
  }
4438
4439
  };
4439
4440
  },
4440
4441
  retryChildren: (w, k) => {
4441
- const O = r.get(w);
4442
- if (O === void 0 || O.get(k)?.status !== "failed") return;
4443
- const N = C(w);
4442
+ const C = r.get(w);
4443
+ if (C === void 0 || C.get(k)?.status !== "failed") return;
4444
+ const N = O(w);
4444
4445
  if ((N.claims.get(k) ?? 0) > 0) {
4445
- O.set(k, jn), N.direct.add(k), y(), _();
4446
+ C.set(k, jn), N.direct.add(k), y(), _();
4446
4447
  return;
4447
4448
  }
4448
- O.delete(k), y();
4449
+ C.delete(k), y();
4449
4450
  },
4450
4451
  pendingChildren: (w) => {
4451
4452
  const k = a.get(w);
@@ -4462,7 +4463,7 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4462
4463
  subscribe: i.subscribe,
4463
4464
  version: () => v
4464
4465
  };
4465
- }, bd = (e, t) => {
4466
+ }, Td = (e, t) => {
4466
4467
  let n = e;
4467
4468
  const r = qe();
4468
4469
  return {
@@ -4472,26 +4473,26 @@ const Fc = /* @__PURE__ */ E.forwardRef(_c), qc = ({ href: e, onRetry: t, testId
4472
4473
  n = { ...n, ...o }, t(n), r.emit();
4473
4474
  }
4474
4475
  };
4475
- }, yd = 1;
4476
+ }, Rd = 1;
4476
4477
  let We = 0, he = null;
4477
- const kd = () => {
4478
+ const Cd = () => {
4478
4479
  const { documentElement: e, body: t } = document;
4479
4480
  We === 0 && (he = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), We += 1;
4480
4481
  let n = !1;
4481
4482
  return () => {
4482
4483
  n || (n = !0, We -= 1, !(We > 0 || he === null) && (e.style.overflow = he.htmlOverflow, t.style.overflow = he.bodyOverflow, e.style.scrollbarGutter = he.htmlGutter, t.style.scrollbarGutter = he.bodyGutter, he = null));
4483
4484
  };
4484
- }, Ed = [
4485
+ }, Od = [
4485
4486
  { selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
4486
4487
  { selector: "[data-aqmx-explorer-body]", name: "tree area" }
4487
- ], Vn = 1, Sd = 1e3, Zn = (e) => e.getClientRects().length > 0, St = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", xd = (e) => {
4488
+ ], Vn = 1, Ld = 1e3, Zn = (e) => e.getClientRects().length > 0, St = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", Md = (e) => {
4488
4489
  if (!Zn(e)) return null;
4489
4490
  const t = e.getBoundingClientRect(), n = window.innerHeight;
4490
- if (t.bottom > n + yd)
4491
+ if (t.bottom > n + Rd)
4491
4492
  return `[markdown-explorer] the explorer ends ${String(Math.round(t.bottom))}px down a ${String(n)}px viewport while lockDocumentScroll stops the page from scrolling, so the rest cannot be reached. ${St}`;
4492
4493
  if (t.height < Vn)
4493
4494
  return `[markdown-explorer] the explorer collapsed to ${String(Math.round(t.height))}px while lockDocumentScroll stops the page from scrolling, so nothing can be read. ${St}`;
4494
- for (const { selector: r, name: o } of Ed)
4495
+ for (const { selector: r, name: o } of Od)
4495
4496
  for (const s of e.querySelectorAll(r)) {
4496
4497
  if (!Zn(s)) continue;
4497
4498
  const a = s.getBoundingClientRect().height;
@@ -4499,39 +4500,39 @@ const kd = () => {
4499
4500
  return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(a))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${St}`;
4500
4501
  }
4501
4502
  return null;
4502
- }, Td = (e) => {
4503
+ }, Ad = (e) => {
4503
4504
  let t = !1, n;
4504
4505
  const r = () => {
4505
4506
  n = void 0;
4506
- const a = xd(e);
4507
+ const a = Md(e);
4507
4508
  a !== null && (t = !0, console.error(a));
4508
4509
  }, o = () => {
4509
- t || (clearTimeout(n), n = setTimeout(r, Sd));
4510
+ t || (clearTimeout(n), n = setTimeout(r, Ld));
4510
4511
  }, s = typeof ResizeObserver > "u" ? null : new ResizeObserver(o);
4511
4512
  return s?.observe(e), window.addEventListener("resize", o), o(), () => {
4512
4513
  clearTimeout(n), s?.disconnect(), window.removeEventListener("resize", o);
4513
4514
  };
4514
- }, Rd = (e, t) => {
4515
- ee(() => e ? kd() : void 0, [e]), ee(() => {
4515
+ }, Nd = (e, t) => {
4516
+ ee(() => e ? Cd() : void 0, [e]), ee(() => {
4516
4517
  const n = t.current;
4517
4518
  if (!(!e || n === null))
4518
- return Td(n);
4519
+ return Ad(n);
4519
4520
  }, [e, t]);
4520
- }, Wn = '[data-testid="markdown-explorer-view-switch"]', Od = [
4521
+ }, Wn = '[data-testid="markdown-explorer-view-switch"]', Dd = [
4521
4522
  { control: Wn, successors: [Wn, '[data-testid="markdown-explorer-sheet-toggle"]'] },
4522
4523
  { control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
4523
- ], Cd = (e) => {
4524
- for (const t of Od) {
4524
+ ], Pd = (e) => {
4525
+ for (const t of Dd) {
4525
4526
  const n = e.closest(t.control);
4526
4527
  if (n !== null) return { element: n, control: t };
4527
4528
  }
4528
4529
  return null;
4529
- }, Md = (e, t) => {
4530
+ }, Id = (e, t) => {
4530
4531
  const n = U(null);
4531
4532
  ee(() => {
4532
4533
  const o = (i) => {
4533
4534
  const f = e.current;
4534
- n.current = f !== null && i instanceof Element && f.contains(i) ? Cd(i) : null;
4535
+ n.current = f !== null && i instanceof Element && f.contains(i) ? Pd(i) : null;
4535
4536
  }, s = (i) => o(i.target);
4536
4537
  o(document.activeElement);
4537
4538
  const a = (i) => {
@@ -4569,7 +4570,7 @@ const kd = () => {
4569
4570
  });
4570
4571
  return i.observe(a, { childList: !0, subtree: !0 }), () => i.disconnect();
4571
4572
  }, [t, e]);
4572
- }, Ld = Pt(() => import("./TreeLayout-DjIVKBG4.js").then((e) => ({ default: e.TreeLayout }))), Ad = Pt(() => import("./MultiLayout-B-ft4_Vs.js").then((e) => ({ default: e.MultiLayout }))), Nd = 64, Dd = {
4573
+ }, $d = Pt(() => import("./TreeLayout-C8TuS9ue.js").then((e) => ({ default: e.TreeLayout }))), _d = Pt(() => import("./MultiLayout-DpxzsXKz.js").then((e) => ({ default: e.MultiLayout }))), Fd = 64, qd = {
4573
4574
  request: (e) => {
4574
4575
  requestAnimationFrame(e);
4575
4576
  }
@@ -4578,12 +4579,12 @@ const kd = () => {
4578
4579
  }, xt = (e, t) => {
4579
4580
  t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
4580
4581
  for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
4581
- }, Pd = (e, t) => {
4582
+ }, Bd = (e, t) => {
4582
4583
  const [n, r] = V(() => ({ overrides: t, locale: e, labels: dn(e, t) }));
4583
- if (n.locale === e && us(n.overrides, t)) return n.labels;
4584
+ if (n.locale === e && gs(n.overrides, t)) return n.labels;
4584
4585
  const o = { overrides: t, locale: e, labels: dn(e, t) };
4585
4586
  return r(o), o.labels;
4586
- }, Id = (e, t, n) => {
4587
+ }, Ud = (e, t, n) => {
4587
4588
  const [r, o] = V(() => ({ scope: t, store: zn(e, n) }));
4588
4589
  if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
4589
4590
  const s = { scope: t, store: zn(e, n) };
@@ -4593,13 +4594,13 @@ const kd = () => {
4593
4594
  if (n.scope === e) return n.value;
4594
4595
  const o = { scope: e, value: t() };
4595
4596
  return r(o), o.value;
4596
- }, $d = () => cd(Dd), Kn = "on", _d = "off", Fd = Object.freeze({ kind: "unavailable" }), qd = (e) => {
4597
+ }, Hd = () => pd(qd), Kn = "on", zd = "off", jd = Object.freeze({ kind: "unavailable" }), Vd = (e) => {
4597
4598
  if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
4598
4599
  throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
4599
- }, Bd = (e, t) => {
4600
+ }, Zd = (e, t) => {
4600
4601
  const n = ge(e.peek(t));
4601
4602
  return n === null || n.document.kind === "failure" ? fe(t) : n.document.name;
4602
- }, su = ({
4603
+ }, mu = ({
4603
4604
  data: e,
4604
4605
  config: t,
4605
4606
  storageNamespace: n,
@@ -4613,24 +4614,24 @@ const kd = () => {
4613
4614
  onEditGrant: l,
4614
4615
  draftConverter: d
4615
4616
  }) => {
4616
- ts(n), qd(d);
4617
- const h = ir(r), g = fs(s), v = Pd(h, o), { revalidate: y } = wo(), T = U(() => {
4618
- }), C = nt(t.dataPath), [R] = V(() => {
4619
- const O = dd({ dataPath: C, onScope: (z) => T.current(z) }), N = { documents: ha({ client: O, capacity: Math.max(Nd, t.multiView.maxPanels * 2) }), trees: vd(O) };
4620
- return xt(N, e), ln(n, e.scope), { data: O, ...N, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
4617
+ as(n), Vd(d);
4618
+ const h = ir(r), g = ws(s), v = Bd(h, o), { revalidate: y } = yo(), T = U(() => {
4619
+ }), O = nt(t.dataPath), [R] = V(() => {
4620
+ const C = gd({ dataPath: O, onScope: (z) => T.current(z) }), N = { documents: ba({ client: C, capacity: Math.max(Fd, t.multiView.maxPanels * 2) }), trees: xd(C) };
4621
+ return xt(N, e), ln(n, e.scope), { data: C, ...N, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
4621
4622
  });
4622
4623
  if (R.aligned.pageData !== e || R.aligned.storageNamespace !== n) {
4623
- const O = R.aligned.pageData;
4624
- R.aligned.pageData = e, R.aligned.storageNamespace = n, O !== e && (O.scope !== e.scope ? R.aligned.pendingReader = e : xt(R, e)), ln(n, e.scope);
4624
+ const C = R.aligned.pageData;
4625
+ R.aligned.pageData = e, R.aligned.storageNamespace = n, C !== e && (C.scope !== e.scope ? R.aligned.pendingReader = e : xt(R, e)), ln(n, e.scope);
4625
4626
  }
4626
- const q = Id(Ce(n).treeSettings, e.scope, t.defaultTreeSettings);
4627
+ const q = Ud(Oe(n).treeSettings, e.scope, t.defaultTreeSettings);
4627
4628
  Y(() => {
4628
- const O = R.aligned.pendingReader;
4629
- O !== null && (R.aligned.pendingReader = null, Gn(R), xt(R, O));
4629
+ const C = R.aligned.pendingReader;
4630
+ C !== null && (R.aligned.pendingReader = null, Gn(R), xt(R, C));
4630
4631
  }, [e, R]), Y(() => {
4631
- let O = !1;
4632
+ let C = !1;
4632
4633
  return T.current = (N) => {
4633
- N === e.scope || O || (O = !0, N !== null && (Gn(R), ns(n)), y());
4634
+ N === e.scope || C || (C = !0, N !== null && (Gn(R), is(n)), y());
4634
4635
  }, () => {
4635
4636
  T.current = () => {
4636
4637
  };
@@ -4641,57 +4642,57 @@ const kd = () => {
4641
4642
  D.current = t.settingsCookie;
4642
4643
  }, [t.settingsCookie]);
4643
4644
  const [m] = V(
4644
- () => bd(e.settings, (O) => {
4645
- document.cookie = Mo(D.current, O, window.location.protocol === "https:");
4645
+ () => Td(e.settings, (C) => {
4646
+ document.cookie = Po(D.current, C, window.location.protocol === "https:");
4646
4647
  })
4647
- ), p = Tt(e.scope, $d), x = Tt(e.scope, ud), A = U(v);
4648
+ ), p = Tt(e.scope, Hd), x = Tt(e.scope, wd), A = U(v);
4648
4649
  Y(() => {
4649
4650
  A.current = v;
4650
4651
  }, [v]);
4651
4652
  const I = Tt(
4652
4653
  e.scope,
4653
- () => Ss({
4654
+ () => Os({
4654
4655
  data: R.data,
4655
4656
  conflictLabels: () => ({ ours: A.current.conflictOurs, theirs: A.current.conflictTheirs }),
4656
- onSaveSettled: (O, N) => {
4657
- N.kind === "saved" && R.documents.refresh(O);
4658
- const z = hs(A.current, N, Bd(R.documents, O));
4657
+ onSaveSettled: (C, N) => {
4658
+ N.kind === "saved" && R.documents.refresh(C);
4659
+ const z = bs(A.current, N, Zd(R.documents, C));
4659
4660
  z !== null && p.announce(z);
4660
4661
  },
4661
4662
  sideBySideSetting: {
4662
- read: () => Ot(Ce(n).editPreview) === Kn,
4663
- write: (O) => Rt(Ce(n).editPreview, O ? Kn : _d)
4663
+ read: () => Ct(Oe(n).editPreview) === Kn,
4664
+ write: (C) => Rt(Oe(n).editPreview, C ? Kn : zd)
4664
4665
  },
4665
4666
  editorShareSetting: {
4666
- read: () => Es(Ot(Ce(n).editSplit)),
4667
- write: (O) => Rt(Ce(n).editSplit, String(O))
4667
+ read: () => Cs(Ct(Oe(n).editSplit)),
4668
+ write: (C) => Rt(Oe(n).editSplit, String(C))
4668
4669
  }
4669
4670
  })
4670
- ), _ = X(() => $e(e.notices.catch(() => [])), [e.notices]), b = e.sources.map((O) => O.id).join(`
4671
- `), S = X(() => Co(t, b.split(`
4672
- `)), [t, b]), M = U(u);
4671
+ ), _ = X(() => $e(e.notices.catch(() => [])), [e.notices]), b = e.sources.map((C) => C.id).join(`
4672
+ `), S = X(() => Do(t, b.split(`
4673
+ `)), [t, b]), L = U(u);
4673
4674
  Y(() => {
4674
- M.current = u;
4675
+ L.current = u;
4675
4676
  }, [u]);
4676
- const [L] = V(() => (O, N) => {
4677
- M.current?.(O, N);
4678
- }), P = u === void 0 ? void 0 : L, H = U(d);
4677
+ const [M] = V(() => (C, N) => {
4678
+ L.current?.(C, N);
4679
+ }), P = u === void 0 ? void 0 : M, H = U(d);
4679
4680
  Y(() => {
4680
4681
  H.current = d;
4681
4682
  }, [d]);
4682
4683
  const [K] = V(() => {
4683
- let O = !1;
4684
+ let C = !1;
4684
4685
  return {
4685
4686
  convert: (N, z) => {
4686
4687
  const W = H.current;
4687
- return W === void 0 ? Promise.resolve(Fd) : W.convert(N, z);
4688
+ return W === void 0 ? Promise.resolve(jd) : W.convert(N, z);
4688
4689
  },
4689
4690
  prepare: () => {
4690
4691
  try {
4691
4692
  H.current?.prepare?.();
4692
4693
  } catch (N) {
4693
- if (O) return;
4694
- O = !0, console.error("[markdown-explorer] the draft converter's prepare threw", N);
4694
+ if (C) return;
4695
+ C = !0, console.error("[markdown-explorer] the draft converter's prepare threw", N);
4695
4696
  }
4696
4697
  }
4697
4698
  };
@@ -4720,81 +4721,85 @@ const kd = () => {
4720
4721
  }),
4721
4722
  [S, v, h, g, n, e.scope, e.sources, _, R, m, q, p, x, I, l, w, i, P]
4722
4723
  );
4723
- return /* @__PURE__ */ c(lr, { value: k, children: /* @__PURE__ */ c(Hd, { renderFrame: a, lockDocumentScroll: f }, e.scope) });
4724
- }, Ud = ({ ref: e, theme: t, view: n, children: r }) => {
4725
- const [o] = V(ti);
4724
+ return /* @__PURE__ */ c(lr, { value: k, children: /* @__PURE__ */ c(Gd, { renderFrame: a, lockDocumentScroll: f }, e.scope) });
4725
+ }, Wd = ({ ref: e, theme: t, view: n, children: r }) => {
4726
+ const [o] = V(ii);
4726
4727
  return /* @__PURE__ */ c("div", { ref: e, className: "aqmx-root", "data-aqmx-theme": t, "data-aqmx-view": n, "data-testid": "markdown-explorer", onKeyDownCapture: o.onKeyDownCapture, onKeyUpCapture: o.onKeyUpCapture, onBlurCapture: o.onBlurCapture, children: r });
4727
- }, Hd = ({ renderFrame: e, lockDocumentScroll: t }) => {
4728
+ }, Gd = ({ renderFrame: e, lockDocumentScroll: t }) => {
4728
4729
  const { theme: n, labels: r } = $(), o = $t(), { hash: s } = Xn(), a = ot(), i = U(null);
4729
- Rd(t, i), Y(() => {
4730
+ Nd(t, i), Y(() => {
4730
4731
  o.kind === "redirect" && a(`${o.href}${s}`, "browse");
4731
4732
  }, [o, s, a]);
4732
4733
  const { location: f } = o, u = f.view;
4733
- Md(i, u);
4734
- const l = f.view === "tree" ? /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...Ct }), children: /* @__PURE__ */ c(Ld, { location: f }) }) : f.view === "multi" ? /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...Ct }), children: /* @__PURE__ */ c(Ad, { location: f }) }) : /* @__PURE__ */ c(id, { location: f }), d = /* @__PURE__ */ B(Ud, { ref: i, theme: n, view: u, children: [
4734
+ Id(i, u);
4735
+ const l = f.view === "tree" ? /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...Ot }), children: /* @__PURE__ */ c($d, { location: f }) }) : f.view === "multi" ? /* @__PURE__ */ c(Ie, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...Ot }), children: /* @__PURE__ */ c(_d, { location: f }) }) : /* @__PURE__ */ c(md, { location: f }), d = /* @__PURE__ */ B(Wd, { ref: i, theme: n, view: u, children: [
4735
4736
  l,
4736
- /* @__PURE__ */ c(Us, {}),
4737
- /* @__PURE__ */ c(ld, { holds: !0, testId: "markdown-explorer-announcer" })
4737
+ /* @__PURE__ */ c(Zs, {}),
4738
+ /* @__PURE__ */ c(hd, { holds: !0, testId: "markdown-explorer-announcer" })
4738
4739
  ] });
4739
4740
  return e === void 0 ? d : e({ view: u, children: d });
4740
- }, au = rs({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
4741
+ }, hu = ls({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
4741
4742
  export {
4742
- ss as $,
4743
+ cs as $,
4743
4744
  At as A,
4744
- zc as B,
4745
- ps as C,
4746
- ad as D,
4747
- qc as E,
4748
- As as F,
4749
- Bn as G,
4750
- Hc as H,
4751
- qe as I,
4752
- ru as J,
4753
- ri as K,
4754
- xs as L,
4755
- vr as M,
4756
- oc as N,
4757
- ua as O,
4758
- sd as P,
4759
- Sc as Q,
4760
- la as R,
4761
- Pc as S,
4762
- ia as T,
4763
- $t as U,
4764
- ld as V,
4765
- Je as W,
4766
- os as X,
4767
- un as Y,
4768
- ls as Z,
4769
- ar as _,
4770
- gs as a,
4771
- cn as a0,
4772
- su as a1,
4773
- dn as a2,
4774
- au as a3,
4775
- ws as b,
4776
- ot as c,
4777
- $i as d,
4778
- Ct as e,
4779
- kc as f,
4780
- ta as g,
4781
- vs as h,
4782
- sa as i,
4783
- ea as j,
4784
- de as k,
4785
- aa as l,
4786
- ge as m,
4787
- Js as n,
4788
- Qs as o,
4789
- Re as p,
4790
- Oe as q,
4791
- Ps as r,
4792
- qs as s,
4793
- Uc as t,
4745
+ dr as B,
4746
+ ys as C,
4747
+ fd as D,
4748
+ Vc as E,
4749
+ $s as F,
4750
+ Yc as G,
4751
+ Kc as H,
4752
+ Bn as I,
4753
+ Gc as J,
4754
+ qe as K,
4755
+ cu as L,
4756
+ ci as M,
4757
+ du as N,
4758
+ Ls as O,
4759
+ ud as P,
4760
+ vr as Q,
4761
+ ga as R,
4762
+ Er as S,
4763
+ uu as T,
4764
+ Lc as U,
4765
+ ma as V,
4766
+ Bc as W,
4767
+ fa as X,
4768
+ $t as Y,
4769
+ hd as Z,
4770
+ Je as _,
4771
+ ks as a,
4772
+ un as a0,
4773
+ ms as a1,
4774
+ ar as a2,
4775
+ ds as a3,
4776
+ cn as a4,
4777
+ mu as a5,
4778
+ dn as a6,
4779
+ hu as a7,
4780
+ Es as b,
4781
+ yr as c,
4782
+ ot as d,
4783
+ dc as e,
4784
+ Hi as f,
4785
+ Ot as g,
4786
+ Cc as h,
4787
+ aa as i,
4788
+ Ss as j,
4789
+ da as k,
4790
+ ua as l,
4791
+ sa as m,
4792
+ de as n,
4793
+ ge as o,
4794
+ ra as p,
4795
+ oa as q,
4796
+ qs as r,
4797
+ Re as s,
4798
+ Ce as t,
4794
4799
  $ as u,
4795
- na as v,
4796
- nu as w,
4797
- ou as x,
4798
- dr as y,
4799
- jc as z
4800
+ ia as v,
4801
+ js as w,
4802
+ Wc as x,
4803
+ lu as y,
4804
+ fu as z
4800
4805
  };