@aiquants/markdown-explorer 0.7.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,20 +1,20 @@
1
1
  import { jsxs as F, jsx as c, Fragment as Ne } from "react/jsx-runtime";
2
2
  import * as y from "react";
3
- import { createContext as me, use as te, useMemo as U, useSyncExternalStore as ee, useRef as B, useId as Oe, useLayoutEffect as V, useCallback as P, useEffect as oe, Component as zt, Suspense as pe, lazy as et, useState as I, useEffectEvent as ie } from "react";
4
- import { useParams as xn, useSearchParams as Rn, matchPath as Tn, useBlocker as Cn, useNavigate as On, Link as An, useHref as De, useLocation as Ut, useRevalidator as Ln } from "react-router";
5
- import { f as Mn, a as Zt, u as Nn, G as Se, e as ge, x as Dn, y as $n, z as ut, B as Pn, D as ft, H as Fn, w as qn, I as _n } from "./location-Q4sgRrUm.js";
6
- import { B as Ee, i as Bn, x as Y, w as In, C as mt, y as He, F as jn, G as Hn, H as zn, I as Un, J as Zn, f as Vn, K as ht, u as Gn, L as Kn, N as Wn, O as Xn, z as Yn, v as Jn, P as Qn, Q as er, R as tr, t as gt } from "./dataRoute-D1vE1wFW.js";
7
- import { HostedScrollArea as pt, useMarkdownToolbarState as nr, MarkdownViewer as Vt } from "@aiquants/markdown";
8
- import { SOURCE_LINES_ATTRIBUTE as Gt, parseSourceLines as rr } from "@aiquants/markdown/source-lines";
9
- import { DEFAULT_CONTENT_ALIGN as or } from "@aiquants/markdown/viewer-settings";
10
- import { w as Kt, r as Wt, a as lr, b as vt, s as ze, c as ir } from "./storage-BSthKLSG.js";
11
- const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
3
+ import { createContext as me, use as ne, useMemo as U, useSyncExternalStore as te, useRef as B, useId as Oe, useLayoutEffect as V, useCallback as P, useEffect as oe, Component as Zt, Suspense as pe, lazy as tt, useState as I, useEffectEvent as ie } from "react";
4
+ import { useParams as Tn, useSearchParams as Cn, matchPath as On, useBlocker as An, useNavigate as Ln, Link as Mn, useHref as De, useLocation as Vt, useRevalidator as Nn } from "react-router";
5
+ import { f as Dn, a as Gt, u as $n, G as Se, e as ge, x as Pn, y as Fn, z as ft, B as qn, D as mt, H as _n, w as Bn, I as In } from "./location-Q4sgRrUm.js";
6
+ import { B as Ee, i as jn, x as Y, w as Hn, C as ht, y as He, F as zn, G as Un, H as Zn, I as Vn, J as Gn, f as Kn, K as gt, u as Wn, L as Xn, N as Yn, O as Jn, z as Qn, v as er, P as tr, Q as nr, R as rr, t as pt } from "./dataRoute-D1vE1wFW.js";
7
+ import { HostedScrollArea as vt, useMarkdownToolbarState as or, MarkdownViewer as Kt } from "@aiquants/markdown";
8
+ import { SOURCE_LINES_ATTRIBUTE as Wt, parseSourceLines as lr } from "@aiquants/markdown/source-lines";
9
+ import { DEFAULT_CONTENT_ALIGN as ir } from "@aiquants/markdown/viewer-settings";
10
+ import { w as Xt, r as Yt, a as sr, b as wt, s as ze, c as ar } from "./storage-BSthKLSG.js";
11
+ const bt = Object.freeze(["en", "ja"]), cr = "en", dr = Object.freeze({
12
12
  panelMoved: Object.freeze(["title", "column", "position"]),
13
13
  panelMoveUnavailable: Object.freeze(["title", "move"]),
14
14
  panelDragStarted: Object.freeze(["title"]),
15
15
  panelDragCancelled: Object.freeze(["title"]),
16
16
  multiColumnRegion: Object.freeze(["column"])
17
- }), cr = /\{(\w+)\}/gu, Xt = {
17
+ }), ur = /\{(\w+)\}/gu, Jt = {
18
18
  explorerRegion: "Explorer",
19
19
  sourceLabel: "Source",
20
20
  refreshTreeLabel: "Refresh tree",
@@ -239,7 +239,7 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
239
239
  multiColumnEmpty: "This column is empty",
240
240
  multiColumnRegion: "Column {column}",
241
241
  panelDropHere: "Drop the panel here"
242
- }, dr = {
242
+ }, fr = {
243
243
  explorerRegion: "エクスプローラー",
244
244
  sourceLabel: "ソース",
245
245
  refreshTreeLabel: "ツリーを更新",
@@ -464,24 +464,24 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
464
464
  multiColumnEmpty: "この列は空です",
465
465
  multiColumnRegion: "{column} 列目",
466
466
  panelDropHere: "ここへパネルをドロップ"
467
- }, ur = Object.freeze({
468
- en: Object.freeze(Xt),
469
- ja: Object.freeze(dr)
470
- }), Yt = Object.freeze(Object.keys(Xt)), fr = new Set(Yt), mr = (e) => fr.has(e), Te = (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, Jt = (e) => {
471
- if (e === void 0) return sr;
472
- if (wt.includes(e)) return e;
473
- throw new RangeError(`[markdown-explorer] locale is the UI language (${wt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Te(e)}`);
474
- }, bt = (e, t) => {
475
- const n = ur[Jt(e)];
467
+ }, mr = Object.freeze({
468
+ en: Object.freeze(Jt),
469
+ ja: Object.freeze(fr)
470
+ }), Qt = Object.freeze(Object.keys(Jt)), hr = new Set(Qt), gr = (e) => hr.has(e), Te = (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, en = (e) => {
471
+ if (e === void 0) return cr;
472
+ if (bt.includes(e)) return e;
473
+ throw new RangeError(`[markdown-explorer] locale is the UI language (${bt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Te(e)}`);
474
+ }, Et = (e, t) => {
475
+ const n = mr[en(e)];
476
476
  if (t === void 0) return n;
477
477
  if (t === null || typeof t != "object")
478
478
  throw new RangeError(`[markdown-explorer] labels must be an object; got ${Te(t)}`);
479
- if (!Mn(t))
479
+ if (!Dn(t))
480
480
  throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Te(t)}`);
481
481
  const r = t, o = { ...n };
482
482
  for (const l of Object.keys(r)) {
483
- if (!mr(l))
484
- throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${Yt.join(", ")}`);
483
+ if (!gr(l))
484
+ throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${Qt.join(", ")}`);
485
485
  const i = r[l];
486
486
  if (i === void 0) continue;
487
487
  const d = typeof n[l];
@@ -489,35 +489,35 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
489
489
  throw new TypeError(`[markdown-explorer] labels.${l} must be a ${d}; got ${Te(i)}`);
490
490
  if (typeof i == "string" && i.trim() === "")
491
491
  throw new RangeError(`[markdown-explorer] labels.${l} must be a non-blank string`);
492
- const v = ar[l];
492
+ const v = dr[l];
493
493
  if (typeof i == "string" && v !== void 0) {
494
- for (const [, f] of i.matchAll(cr))
494
+ for (const [, f] of i.matchAll(ur))
495
495
  if (!v.includes(f ?? ""))
496
496
  throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(f)}}; it accepts ${v.map((u) => `{${u}}`).join(", ")}`);
497
497
  }
498
498
  o[l] = i;
499
499
  }
500
500
  return Object.freeze(o);
501
- }, hr = (e, t) => {
501
+ }, pr = (e, t) => {
502
502
  if (Object.is(e, t)) return !0;
503
503
  if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
504
504
  const n = e, r = t, o = Object.keys(n), l = Object.keys(r);
505
505
  return o.length === l.length && l.every((i) => Object.hasOwn(n, i) && Object.is(n[i], r[i]));
506
- }, Et = Object.freeze(["light", "dark"]), gr = (e) => {
506
+ }, yt = Object.freeze(["light", "dark"]), vr = (e) => {
507
507
  if (e === void 0) return "light";
508
- if (Et.includes(e)) return e;
509
- throw new RangeError(`[markdown-explorer] theme must be ${Et.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
510
- }, Qt = me(null), D = () => {
511
- const e = te(Qt);
508
+ if (yt.includes(e)) return e;
509
+ throw new RangeError(`[markdown-explorer] theme must be ${yt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
510
+ }, tn = me(null), D = () => {
511
+ const e = ne(tn);
512
512
  if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
513
513
  return e;
514
514
  }, Ae = (e) => {
515
515
  const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
516
- return ee(t.subscribe, n, n);
517
- }, tt = () => {
518
- const { config: e } = D(), t = xn()["*"], [n] = Rn(), r = n.toString();
519
- return U(() => Zt(e, t, new URLSearchParams(r)), [e, t, r]);
520
- }, en = {
516
+ return te(t.subscribe, n, n);
517
+ }, nt = () => {
518
+ const { config: e } = D(), t = Tn()["*"], [n] = Cn(), r = n.toString();
519
+ return U(() => Gt(e, t, new URLSearchParams(r)), [e, t, r]);
520
+ }, nn = {
521
521
  unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
522
522
  forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
523
523
  "not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
@@ -526,14 +526,14 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
526
526
  "too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
527
527
  unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
528
528
  failed: ["failureFailedTitle", "failureFailedBody"]
529
- }, ae = (e, t) => e[en[t][0]], ve = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
530
- const { labels: o } = D(), l = ae(o, e.reason), i = o[en[e.reason][1]], d = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
529
+ }, ae = (e, t) => e[nn[t][0]], ve = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
530
+ const { labels: o } = D(), l = ae(o, e.reason), i = o[nn[e.reason][1]], d = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
531
531
  return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": d, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
532
532
  /* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: l }),
533
533
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: i }),
534
534
  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
535
535
  ] });
536
- }, pr = (e, t) => {
536
+ }, wr = (e, t) => {
537
537
  const { phase: n, save: r, dirty: o } = t;
538
538
  switch (n.kind) {
539
539
  case "opening":
@@ -557,7 +557,7 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
557
557
  break;
558
558
  }
559
559
  return o ? e.draftUnsaved : "";
560
- }, vr = (e, t, n) => {
560
+ }, br = (e, t, n) => {
561
561
  switch (t.kind) {
562
562
  case "saved":
563
563
  return t.merged ? e.documentSavedMerged(n) : e.documentSaved(n);
@@ -581,17 +581,24 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
581
581
  for (const t of [...e]) t();
582
582
  }
583
583
  };
584
- }, wr = "<<<<<<<", br = "=======", Er = ">>>>>>>", yt = (e, t) => e === t || e.startsWith(`${t} `), kt = (e) => yr(e.split(`
585
- `)), yr = (e) => {
584
+ }, Er = "<<<<<<<", yr = "=======", kr = ">>>>>>>", kt = (e, t) => e === t || e.startsWith(`${t} `), St = (e) => Sr(e.split(`
585
+ `)), Sr = (e) => {
586
586
  const t = [];
587
587
  let n = null, r = null, o = 0;
588
588
  for (const l of e) {
589
589
  o += 1;
590
590
  const i = l.charCodeAt(0);
591
- i !== 60 && i !== 61 && i !== 62 || (yt(l, wr) ? (n = o, r = null) : l === br ? n !== null && r === null ? r = o : n = null : yt(l, Er) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
591
+ i !== 60 && i !== 61 && i !== 62 || (kt(l, Er) ? (n = o, r = null) : l === yr ? n !== null && r === null ? r = o : n = null : kt(l, kr) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
592
592
  }
593
593
  return t;
594
- }, kr = 3, Ue = Object.freeze({ kind: "idle" }), Sr = ({ data: e, conflictLabels: t, onSaveSettled: n, previewSetting: r }) => {
594
+ }, xt = (e) => e.includes(`\r
595
+ `) ? `\r
596
+ ` : `
597
+ `, Ue = (e) => e.replace(/\r\n?/gu, `
598
+ `), xr = (e, t) => t === `
599
+ ` ? e : e.replaceAll(`
600
+ `, `\r
601
+ `), Rr = 3, Ze = Object.freeze({ kind: "idle" }), Tr = ({ data: e, conflictLabels: t, onSaveSettled: n, previewSetting: r }) => {
595
602
  const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), f = ye();
596
603
  let u = null, g = null;
597
604
  const m = (s, a) => {
@@ -601,17 +608,17 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
601
608
  const { signal: h } = a.controller;
602
609
  m(a, { phase: { kind: "opening" } });
603
610
  const w = await e.edit(s, h);
604
- if (!(!k(s, a) || h.aborted || !("kind" in w))) {
605
- if (w.kind === "grant") {
606
- m(a, { phase: { kind: "grant", href: w.href } });
607
- return;
608
- }
609
- if (w.kind === "failure") {
610
- m(a, { phase: { kind: "failed", failure: w.failure } });
611
- return;
612
- }
613
- a.base = { text: w.text, version: w.version }, a.draft = w.text, m(a, { phase: { kind: "editing" }, history: w.history, dirty: !1, save: Ue, generation: a.value.generation + 1 });
611
+ if (!k(s, a) || h.aborted || !("kind" in w)) return;
612
+ if (w.kind === "grant") {
613
+ m(a, { phase: { kind: "grant", href: w.href } });
614
+ return;
614
615
  }
616
+ if (w.kind === "failure") {
617
+ m(a, { phase: { kind: "failed", failure: w.failure } });
618
+ return;
619
+ }
620
+ const S = Ue(w.text);
621
+ a.base = { text: S, version: w.version }, a.draft = S, a.ending = xt(w.text), m(a, { phase: { kind: "editing" }, history: w.history, dirty: !1, save: Ze, generation: a.value.generation + 1 });
615
622
  }, E = (s) => {
616
623
  const a = o.get(s);
617
624
  a !== void 0 && (a.controller.abort(), o.delete(s), i.delete(s));
@@ -623,7 +630,7 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
623
630
  d.get(s)?.flush();
624
631
  const a = o.get(s);
625
632
  if (a === void 0 || a.value.phase.kind !== "editing" || a.base === null || a.value.save.kind === "saving") return;
626
- const h = kt(a.draft).length;
633
+ const h = St(a.draft).length;
627
634
  if (h > 0) {
628
635
  x(s, a, { kind: "conflicts", count: h });
629
636
  return;
@@ -632,8 +639,8 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
632
639
  const { signal: w } = a.controller;
633
640
  let S = a.base, L = a.draft, R = !1;
634
641
  m(a, { save: { kind: "saving" } });
635
- for (let N = 0; N < kr; N += 1) {
636
- const q = await e.save(s, S.version, L, w);
642
+ for (let N = 0; N < Rr; N += 1) {
643
+ const q = await e.save(s, S.version, xr(L, a.ending), w);
637
644
  if (!k(s, a) || w.aborted || !("kind" in q)) return;
638
645
  if (q.kind === "saved") {
639
646
  d.get(s)?.flush(), a.base = { text: L, version: q.version }, x(s, a, { kind: "saved", merged: R }, { dirty: a.draft !== L });
@@ -647,12 +654,12 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
647
654
  x(s, a, { kind: "failed", failure: q.failure });
648
655
  return;
649
656
  }
650
- const { mergeDraft: W } = await import("./merge-Bi41vtSe.js");
657
+ const { mergeDraft: W } = await import("./merge-DfI0ro2L.js");
651
658
  if (!k(s, a) || w.aborted) return;
652
659
  const J = d.get(s);
653
660
  J?.flush();
654
- const X = W(S.text, a.draft, q.text, t());
655
- if (S = { text: q.text, version: q.version }, a.base = S, a.draft = X.text, J?.adopt(X.text), X.kind === "conflicts") {
661
+ const ee = Ue(q.text), X = W(S.text, a.draft, ee, t());
662
+ if (S = { text: ee, version: q.version }, a.base = S, a.ending = xt(q.text), a.draft = X.text, J?.adopt(X.text), X.kind === "conflicts") {
656
663
  x(s, a, { kind: "conflicts", count: X.conflicts }, { dirty: !0, generation: a.value.generation + 1 });
657
664
  return;
658
665
  }
@@ -675,9 +682,11 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
675
682
  }
676
683
  l.delete(s);
677
684
  const w = {
678
- value: { path: s, phase: { kind: "opening" }, history: !1, dirty: !1, save: Ue, generation: 0, request: { anchor: a } },
685
+ value: { path: s, phase: { kind: "opening" }, history: !1, dirty: !1, save: Ze, generation: 0, request: { anchor: a } },
679
686
  base: null,
680
687
  draft: "",
688
+ ending: `
689
+ `,
681
690
  controller: new AbortController()
682
691
  };
683
692
  o.set(s, w), O(s, w);
@@ -698,8 +707,8 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
698
707
  S !== h.value.dirty && (w.dirty = S);
699
708
  const { save: L } = h.value;
700
709
  if (L.kind === "conflicts") {
701
- const R = kt(a).length;
702
- R === 0 ? w.save = Ue : R !== L.count && (w.save = { kind: "conflicts", count: R });
710
+ const R = St(a).length;
711
+ R === 0 ? w.save = Ze : R !== L.count && (w.save = { kind: "conflicts", count: R });
703
712
  }
704
713
  (w.dirty !== void 0 || w.save !== void 0) && m(h, w);
705
714
  },
@@ -712,7 +721,9 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
712
721
  const h = d.get(s);
713
722
  h?.flush();
714
723
  const w = o.get(s);
715
- w === void 0 || w.base === null || (w.draft = a, h?.adopt(a), m(w, { dirty: a !== w.base.text, generation: w.value.generation + 1 }));
724
+ if (w === void 0 || w.base === null) return;
725
+ const S = Ue(a);
726
+ w.draft = S, h?.adopt(S), m(w, { dirty: S !== w.base.text, generation: w.value.generation + 1 });
716
727
  },
717
728
  close: (s) => {
718
729
  if (!o.has(s)) return;
@@ -769,9 +780,9 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
769
780
  u !== s && (u = s, r.write(s), f.emit());
770
781
  }
771
782
  };
772
- }, tn = (e) => {
783
+ }, rn = (e) => {
773
784
  e.preventDefault(), e.stopPropagation();
774
- }, nn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: l, onCancel: i, testId: d }) => {
785
+ }, on = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: l, onCancel: i, testId: d }) => {
775
786
  const v = B(null), f = B(null), u = B(null), g = Oe(), m = Oe();
776
787
  return V(() => {
777
788
  const E = v.current;
@@ -781,7 +792,7 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
781
792
  u.current = T instanceof HTMLElement ? T : null, E.showModal(), f.current?.focus();
782
793
  } else !e && E.open && (E.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
783
794
  }, [e]), /* @__PURE__ */ c("dialog", { ref: v, className: "aqmx-confirm", "aria-labelledby": g, "aria-describedby": m, "data-testid": d, onKeyDown: (E) => {
784
- E.key !== "Escape" || E.defaultPrevented || (tn(E), i());
795
+ E.key !== "Escape" || E.defaultPrevented || (rn(E), i());
785
796
  }, onClick: (E) => {
786
797
  E.target === E.currentTarget && i();
787
798
  }, onCancel: (E) => E.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
@@ -792,10 +803,10 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
792
803
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${d}-confirm`, onClick: l, children: r })
793
804
  ] })
794
805
  ] }) });
795
- }, xr = (e, t) => {
796
- const n = Tn({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
806
+ }, Cr = (e, t) => {
807
+ const n = On({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
797
808
  if (n === null) return /* @__PURE__ */ new Set();
798
- const { location: r } = Zt(e, n.params["*"], new URLSearchParams(t.search));
809
+ const { location: r } = Gt(e, n.params["*"], new URLSearchParams(t.search));
799
810
  switch (r.view) {
800
811
  case "tree":
801
812
  return new Set(r.doc === null ? [] : [r.doc]);
@@ -804,24 +815,24 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
804
815
  case "multi":
805
816
  return new Set(r.docs);
806
817
  }
807
- }, rn = (e) => {
818
+ }, ln = (e) => {
808
819
  const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
809
- return ee(t.subscribe, n, Rr);
810
- }, on = () => !1, Rr = () => {
811
- }, Tr = () => {
820
+ return te(t.subscribe, n, Or);
821
+ }, sn = () => !1, Or = () => {
822
+ }, Ar = () => {
812
823
  const { edits: e } = D();
813
- return ee(e.subscribe, e.hasSessions, on);
814
- }, Cr = () => {
824
+ return te(e.subscribe, e.hasSessions, sn);
825
+ }, Lr = () => {
815
826
  const { edits: e } = D();
816
- return ee(e.subscribe, e.previewShown, on);
817
- }, Or = () => null, Ar = () => {
827
+ return te(e.subscribe, e.previewShown, sn);
828
+ }, Mr = () => null, Nr = () => {
818
829
  const { edits: e, labels: t, config: n } = D(), r = B([]), o = P(
819
830
  ({ nextLocation: g }) => {
820
- const m = xr(n, g);
831
+ const m = Cr(n, g);
821
832
  return e.flushDrafts(), r.current = e.dirtyPaths().filter((k) => !m.has(k)), r.current.length > 0;
822
833
  },
823
834
  [e, n]
824
- ), l = Cn(o), i = Tr();
835
+ ), l = An(o), i = Ar();
825
836
  oe(() => {
826
837
  if (!i) return;
827
838
  const g = (m) => {
@@ -829,9 +840,9 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
829
840
  };
830
841
  return window.addEventListener("beforeunload", g), () => window.removeEventListener("beforeunload", g);
831
842
  }, [i, e]);
832
- const d = ee(e.subscribe, e.discardRequest, Or), v = l.state === "blocked", u = (v ? r.current : d === null ? [] : d.paths).map((g) => Ee(g)).join(", ");
843
+ const d = te(e.subscribe, e.discardRequest, Mr), v = l.state === "blocked", u = (v ? r.current : d === null ? [] : d.paths).map((g) => Ee(g)).join(", ");
833
844
  return /* @__PURE__ */ c(
834
- nn,
845
+ on,
835
846
  {
836
847
  open: v || d !== null,
837
848
  title: t.unsavedTitle,
@@ -856,7 +867,7 @@ const wt = Object.freeze(["en", "ja"]), sr = "en", ar = Object.freeze({
856
867
  }
857
868
  );
858
869
  };
859
- function Lr({
870
+ function Dr({
860
871
  title: e,
861
872
  titleId: t,
862
873
  ...n
@@ -877,18 +888,18 @@ function Lr({
877
888
  clipRule: "evenodd"
878
889
  }));
879
890
  }
880
- const Mr = /* @__PURE__ */ y.forwardRef(Lr);
881
- let Ze = null;
882
- const ln = () => (Ze ??= import("./EditSurface-BCB-0vUK.js").catch((e) => {
883
- throw Ze = null, e;
884
- }), Ze), St = () => {
885
- ln().catch(() => {
891
+ const $r = /* @__PURE__ */ y.forwardRef(Dr);
892
+ let Ve = null;
893
+ const an = () => (Ve ??= import("./EditSurface-CaS1O6Nt.js").catch((e) => {
894
+ throw Ve = null, e;
895
+ }), Ve), Rt = () => {
896
+ an().catch(() => {
886
897
  });
887
- }, Nr = (e) => {
888
- const { default: t } = te(ln());
898
+ }, Pr = (e) => {
899
+ const { default: t } = ne(an());
889
900
  return /* @__PURE__ */ c(t, { ...e });
890
901
  };
891
- class Dr extends zt {
902
+ class Fr extends Zt {
892
903
  state = { failed: !1 };
893
904
  static getDerivedStateFromError() {
894
905
  return { failed: !0 };
@@ -898,55 +909,55 @@ class Dr extends zt {
898
909
  return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
899
910
  }
900
911
  }
901
- const nt = `[${Gt}]`, $r = "[data-aqmd-content]", Pr = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', Fr = 200, we = (e) => rr(e.getAttribute(Gt)), qr = (e, t) => {
912
+ const rt = `[${Wt}]`, qr = "[data-aqmd-content]", _r = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', Br = 200, we = (e) => lr(e.getAttribute(Wt)), Ir = (e, t) => {
902
913
  for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
903
914
  const o = we(r);
904
915
  if (o !== null) return { block: r, lines: o, own: !0 };
905
916
  }
906
917
  let n = null;
907
- for (const r of t.querySelectorAll(nt)) {
918
+ for (const r of t.querySelectorAll(rt)) {
908
919
  if (!(r.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING)) break;
909
920
  const o = we(r);
910
921
  o !== null && (n = { block: r, lines: o });
911
922
  }
912
923
  return n === null ? null : { ...n, own: !1 };
913
- }, _r = (e, t) => {
924
+ }, jr = (e, t) => {
914
925
  let n = 0;
915
926
  for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
916
927
  return n;
917
- }, Br = (e) => e.closest($r) !== null && e.closest(Pr) === null, Ir = (e, t, n) => {
918
- const r = qr(e, t);
928
+ }, Hr = (e) => e.closest(qr) !== null && e.closest(_r) === null, zr = (e, t, n) => {
929
+ const r = Ir(e, t);
919
930
  if (r === null) return null;
920
931
  const { block: o, own: l } = r;
921
932
  if (!l) {
922
933
  const d = r.lines.last + 1;
923
934
  return { lines: { first: d, last: d }, word: null, occurrence: 0, clientTop: Le(e) };
924
935
  }
925
- const i = Ur(o, n);
936
+ const i = Gr(o, n);
926
937
  return i === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Le(o) } : { lines: r.lines, word: i.text, occurrence: i.occurrence, clientTop: i.clientTop };
927
- }, jr = (e, t) => {
938
+ }, Ur = (e, t) => {
928
939
  let n = null, r = null, o = null;
929
- for (const i of e.querySelectorAll(nt)) {
940
+ for (const i of e.querySelectorAll(rt)) {
930
941
  const d = we(i);
931
942
  if (d === null) continue;
932
- n ??= zr(t, i);
943
+ n ??= Vr(t, i);
933
944
  const { top: v, bottom: f } = i.getBoundingClientRect();
934
945
  v <= n && n < f ? r = { lines: d, block: i } : o === null && v >= n && (o = { lines: d, block: i });
935
946
  }
936
947
  const l = r === null ? o : r;
937
948
  return l === null ? null : { lines: l.lines, word: null, occurrence: 0, clientTop: Le(l.block) };
938
- }, Hr = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, zr = (e, t) => {
949
+ }, Zr = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, Vr = (e, t) => {
939
950
  const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
940
- return Hr(e) + (Number.isFinite(n) ? n : 0);
941
- }, Ur = (e, t) => {
951
+ return Zr(e) + (Number.isFinite(n) ? n : 0);
952
+ }, Gr = (e, t) => {
942
953
  if (t === null || t.rangeCount === 0) return null;
943
954
  const n = t.getRangeAt(0);
944
955
  if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
945
956
  const r = n.toString().trim();
946
- if (r === "" || r.length > Fr || /[\r\n]/u.test(r)) return null;
957
+ if (r === "" || r.length > Br || /[\r\n]/u.test(r)) return null;
947
958
  const o = e.ownerDocument.createRange();
948
- return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: _r(o.toString(), r), clientTop: n.getBoundingClientRect().top };
949
- }, Hi = (e, t) => {
959
+ return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: jr(o.toString(), r), clientTop: n.getBoundingClientRect().top };
960
+ }, Zi = (e, t) => {
950
961
  const n = e.split(`
951
962
  `), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), l = { line: r, column: 0 };
952
963
  if (t.word === null) return l;
@@ -958,21 +969,21 @@ const nt = `[${Gt}]`, $r = "[data-aqmd-content]", Pr = 'a[href], button, input,
958
969
  i += 1;
959
970
  }
960
971
  }
961
- return i > 0 ? Zr(n, r, o, t.word) ?? l : l;
962
- }, Zr = (e, t, n, r) => {
972
+ return i > 0 ? Kr(n, r, o, t.word) ?? l : l;
973
+ }, Kr = (e, t, n, r) => {
963
974
  for (let o = n; o >= t; o -= 1) {
964
975
  const l = (e[o - 1] ?? "").lastIndexOf(r);
965
976
  if (l >= 0) return { line: o, column: l };
966
977
  }
967
978
  return null;
968
- }, Vr = (e, t) => {
979
+ }, Wr = (e, t) => {
969
980
  let n = null, r = null;
970
- for (const o of e.querySelectorAll(nt)) {
981
+ for (const o of e.querySelectorAll(rt)) {
971
982
  const l = we(o);
972
983
  l === null || l.first > t || (l.last >= t ? n = o : (r === null || l.last >= r.last) && (r = { element: o, last: l.last }));
973
984
  }
974
985
  return n !== null ? n : r === null ? null : r.element;
975
- }, Gr = (e, t) => {
986
+ }, Xr = (e, t) => {
976
987
  const { bottom: n } = e.getBoundingClientRect(), r = Le(e), o = we(e);
977
988
  if (o === null) return r;
978
989
  const l = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
@@ -988,20 +999,20 @@ const nt = `[${Gt}]`, $r = "[data-aqmd-content]", Pr = 'a[href], button, input,
988
999
  if (d > 0) return i;
989
1000
  }
990
1001
  return e.getBoundingClientRect().top;
991
- }, rt = Object.freeze({
1002
+ }, ot = Object.freeze({
992
1003
  browse: Object.freeze({ replace: !0, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
993
1004
  "switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
994
1005
  "switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
995
1006
  "follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
996
- }), zi = (e) => rt[e], $e = () => {
997
- const e = On();
1007
+ }), Vi = (e) => ot[e], $e = () => {
1008
+ const e = Ln();
998
1009
  return P(
999
1010
  (t, n) => {
1000
- e(t, rt[n]);
1011
+ e(t, ot[n]);
1001
1012
  },
1002
1013
  [e]
1003
1014
  );
1004
- }, Kr = ({ navigation: e, ...t }) => /* @__PURE__ */ c(An, { ...t, ...rt[e] }), sn = (e) => {
1015
+ }, Yr = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Mn, { ...t, ...ot[e] }), cn = (e) => {
1005
1016
  const t = e.ownerDocument;
1006
1017
  if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
1007
1018
  if (e.hasAttribute("tabindex")) return !1;
@@ -1011,7 +1022,7 @@ const nt = `[${Gt}]`, $r = "[data-aqmd-content]", Pr = 'a[href], button, input,
1011
1022
  t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
1012
1023
  };
1013
1024
  return e.addEventListener("blur", n), !0;
1014
- }, Wr = (e, t) => {
1025
+ }, Jr = (e, t) => {
1015
1026
  const n = B(null), r = B(null), o = B(null), l = P(() => {
1016
1027
  n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
1017
1028
  }, []);
@@ -1038,7 +1049,7 @@ const nt = `[${Gt}]`, $r = "[data-aqmd-content]", Pr = 'a[href], button, input,
1038
1049
  const u = t(f);
1039
1050
  u !== r.current && (l(), u !== null && (r.current = u, n.current = window.setTimeout(() => {
1040
1051
  n.current = null, i(u);
1041
- }, Nn)));
1052
+ }, $n)));
1042
1053
  },
1043
1054
  [l, t, i]
1044
1055
  ), v = P(
@@ -1056,8 +1067,8 @@ const nt = `[${Gt}]`, $r = "[data-aqmd-content]", Pr = 'a[href], button, input,
1056
1067
  }),
1057
1068
  [d, v]
1058
1069
  );
1059
- }, Xr = et(() => import("./NativeScrollBar-EXOKhHP4.js").then((e) => ({ default: e.NativeScrollBar })));
1060
- class Yr extends zt {
1070
+ }, Qr = tt(() => import("./NativeScrollBar-CiVlg2ob.js").then((e) => ({ default: e.NativeScrollBar })));
1071
+ class eo extends Zt {
1061
1072
  state = { failed: !1 };
1062
1073
  static getDerivedStateFromError() {
1063
1074
  return { failed: !0 };
@@ -1069,7 +1080,7 @@ class Yr extends zt {
1069
1080
  return this.state.failed ? null : this.props.children;
1070
1081
  }
1071
1082
  }
1072
- const Jr = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(Yr, { children: /* @__PURE__ */ c(pe, { fallback: null, children: /* @__PURE__ */ c(Xr, { scroller: e, withCircle: t }) }) }), an = (e) => /* @__PURE__ */ c(Jr, { scroller: e, withCircle: !0 }), cn = () => {
1083
+ const to = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(eo, { children: /* @__PURE__ */ c(pe, { fallback: null, children: /* @__PURE__ */ c(Qr, { scroller: e, withCircle: t }) }) }), dn = (e) => /* @__PURE__ */ c(to, { scroller: e, withCircle: !0 }), un = () => {
1073
1084
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
1074
1085
  let n = !1;
1075
1086
  const r = (o) => {
@@ -1113,9 +1124,9 @@ const Jr = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(Yr, { children:
1113
1124
  t.status = "rejected", t.reason = n;
1114
1125
  }
1115
1126
  )), t;
1116
- }, dn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), xe = (e) => e.status === "fulfilled" ? e.value : void 0, Qr = 55e3, xt = Object.freeze({ status: "deferred" }), Rt = Object.freeze({ status: "refreshed" }), Ve = Object.freeze({ status: "superseded" }), de = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, un = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", eo = ({ client: e, capacity: t }) => {
1127
+ }, fn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), xe = (e) => e.status === "fulfilled" ? e.value : void 0, no = 55e3, Tt = Object.freeze({ status: "deferred" }), Ct = Object.freeze({ status: "refreshed" }), Ge = Object.freeze({ status: "superseded" }), de = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, mn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", ro = ({ client: e, capacity: t }) => {
1117
1128
  if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
1118
- const n = /* @__PURE__ */ new Map(), r = cn(), o = ye(), l = /* @__PURE__ */ new WeakSet();
1129
+ const n = /* @__PURE__ */ new Map(), r = un(), o = ye(), l = /* @__PURE__ */ new WeakSet();
1119
1130
  let i = 0;
1120
1131
  const d = o.emit, v = () => (i += 1, i), f = () => {
1121
1132
  if (!(n.size <= t))
@@ -1125,7 +1136,7 @@ const Jr = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(Yr, { children:
1125
1136
  }
1126
1137
  }, u = (s, a) => {
1127
1138
  n.delete(s), n.set(s, a);
1128
- }, g = (s) => performance.now() - s.validatedAt >= Qr, m = (s, a, h) => {
1139
+ }, g = (s) => performance.now() - s.validatedAt >= no, m = (s, a, h) => {
1129
1140
  const w = n.get(s), S = de(w?.snapshot), L = h || w?.refreshPending === !0, R = be(e.document(s, { refresh: L }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: R, previous: S }, validatedAt: performance.now(), opened: a, background: null, refreshPending: !1, seeded: void 0, stamp: v() };
1130
1141
  return u(s, N), f(), R.then((q) => {
1131
1142
  n.get(s) === N && (N.snapshot = q, N.stamp = v(), d());
@@ -1178,8 +1189,8 @@ const Jr = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(Yr, { children:
1178
1189
  seed: (s, a) => {
1179
1190
  const h = performance.now(), w = be(
1180
1191
  a.then(
1181
- (q) => q === null ? xt : { status: "loaded", document: q },
1182
- () => xt
1192
+ (q) => q === null ? Tt : { status: "loaded", document: q },
1193
+ () => Tt
1183
1194
  )
1184
1195
  ), S = n.get(s);
1185
1196
  if (S !== void 0 && S.snapshot.status === "loaded") {
@@ -1215,13 +1226,13 @@ const Jr = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(Yr, { children:
1215
1226
  },
1216
1227
  refresh: async (s) => {
1217
1228
  const a = n.get(s);
1218
- if (a !== void 0 && un(a.snapshot)) {
1229
+ if (a !== void 0 && mn(a.snapshot)) {
1219
1230
  a.refreshPending = !0;
1220
1231
  const w = await O(s, a);
1221
- return w === null ? Ve : w.kind === "failure" ? { status: "failed", failure: w.failure } : Rt;
1232
+ return w === null ? Ge : w.kind === "failure" ? { status: "failed", failure: w.failure } : Ct;
1222
1233
  }
1223
1234
  const h = m(s, !0, !0);
1224
- return d(), h.snapshot.status !== "pending" ? Ve : (await h.snapshot.promise, n.get(s) === h ? Rt : Ve);
1235
+ return d(), h.snapshot.status !== "pending" ? Ge : (await h.snapshot.promise, n.get(s) === h ? Ct : Ge);
1225
1236
  },
1226
1237
  clear: () => {
1227
1238
  n.clear();
@@ -1231,8 +1242,8 @@ const Jr = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(Yr, { children:
1231
1242
  subscribe: o.subscribe,
1232
1243
  noteFailureShown: (s) => l.has(s) ? !1 : (l.add(s), !0)
1233
1244
  };
1234
- }, fe = me("fill"), to = Object.freeze({ blockSize: "100%" }), ke = ({ scrollerProps: e, children: t }) => te(fe) === "content" ? /* @__PURE__ */ c(pt, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(pt, { scrollerProps: { ...e, style: to }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: an, children: t });
1235
- function no({
1245
+ }, fe = me("fill"), oo = Object.freeze({ blockSize: "100%" }), ke = ({ scrollerProps: e, children: t }) => ne(fe) === "content" ? /* @__PURE__ */ c(vt, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(vt, { scrollerProps: { ...e, style: oo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: dn, children: t });
1246
+ function lo({
1236
1247
  title: e,
1237
1248
  titleId: t,
1238
1249
  ...n
@@ -1253,8 +1264,8 @@ function no({
1253
1264
  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"
1254
1265
  }));
1255
1266
  }
1256
- const ro = /* @__PURE__ */ y.forwardRef(no);
1257
- function oo({
1267
+ const io = /* @__PURE__ */ y.forwardRef(lo);
1268
+ function so({
1258
1269
  title: e,
1259
1270
  titleId: t,
1260
1271
  ...n
@@ -1279,17 +1290,17 @@ function oo({
1279
1290
  clipRule: "evenodd"
1280
1291
  }));
1281
1292
  }
1282
- const lo = /* @__PURE__ */ y.forwardRef(oo), Pe = ({ name: e, url: t, icon: n, children: r }) => {
1293
+ const ao = /* @__PURE__ */ y.forwardRef(so), Pe = ({ name: e, url: t, icon: n, children: r }) => {
1283
1294
  const { labels: o } = D();
1284
1295
  return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
1285
1296
  /* @__PURE__ */ c("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: n }),
1286
1297
  /* @__PURE__ */ c("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
1287
1298
  r,
1288
- /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": o.openInNewTab, title: o.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(lo, {}) }),
1289
- /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, download: e, "aria-label": o.download, title: o.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(ro, {}) })
1299
+ /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": o.openInNewTab, title: o.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(ao, {}) }),
1300
+ /* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, download: e, "aria-label": o.download, title: o.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(io, {}) })
1290
1301
  ] });
1291
1302
  };
1292
- function io({
1303
+ function co({
1293
1304
  title: e,
1294
1305
  titleId: t,
1295
1306
  ...n
@@ -1310,45 +1321,45 @@ function io({
1310
1321
  clipRule: "evenodd"
1311
1322
  }));
1312
1323
  }
1313
- const so = /* @__PURE__ */ y.forwardRef(io), ao = Object.freeze({ className: "aqmx-document-stage" }), co = ({ document: e }) => {
1324
+ const uo = /* @__PURE__ */ y.forwardRef(co), fo = Object.freeze({ className: "aqmx-document-stage" }), mo = ({ document: e }) => {
1314
1325
  const { labels: t } = D();
1315
1326
  return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
1316
- /* @__PURE__ */ c(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(so, {}) }),
1317
- /* @__PURE__ */ c(ke, { scrollerProps: ao, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1327
+ /* @__PURE__ */ c(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(uo, {}) }),
1328
+ /* @__PURE__ */ c(ke, { scrollerProps: fo, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
1318
1329
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
1319
1330
  /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
1320
1331
  ] }) })
1321
1332
  ] });
1322
- }, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", uo = (e) => {
1333
+ }, Fe = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", ho = (e) => {
1323
1334
  const t = e.indexOf("#");
1324
1335
  return t === -1 ? "" : e.slice(t);
1325
- }, fo = /(%[0-9A-Fa-f]{2})/u, ot = (e) => {
1336
+ }, go = /(%[0-9A-Fa-f]{2})/u, lt = (e) => {
1326
1337
  if (!e.startsWith("#") || e.length === 1) return null;
1327
- const t = new TextEncoder(), n = e.slice(1).split(fo).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1338
+ const t = new TextEncoder(), n = e.slice(1).split(go).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1328
1339
  return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
1329
- }, fn = (e) => `#${encodeURIComponent(e)}`, mo = (e) => {
1340
+ }, hn = (e) => `#${encodeURIComponent(e)}`, po = (e) => {
1330
1341
  if (e === "#") return !0;
1331
- const t = ot(e);
1342
+ const t = lt(e);
1332
1343
  return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
1333
- }, mn = (e, t) => {
1344
+ }, gn = (e, t) => {
1334
1345
  if (t === "") return null;
1335
1346
  for (const n of e.querySelectorAll("[id]"))
1336
1347
  if (n.id === t) return n;
1337
1348
  return null;
1338
- }, ho = "http://www.w3.org/1999/xhtml", Tt = (e, t) => {
1349
+ }, vo = "http://www.w3.org/1999/xhtml", Ot = (e, t) => {
1339
1350
  if (t === "") return null;
1340
- const n = mn(e, t);
1351
+ const n = gn(e, t);
1341
1352
  if (n !== null) return n;
1342
1353
  for (const r of e.querySelectorAll("a[name]"))
1343
- if (r.localName === "a" && r.namespaceURI === ho && r.getAttribute("name") === t) return r;
1354
+ if (r.localName === "a" && r.namespaceURI === vo && r.getAttribute("name") === t) return r;
1344
1355
  return null;
1345
- }, hn = (e, t) => {
1356
+ }, pn = (e, t) => {
1346
1357
  if (e === null || !t.startsWith("#")) return null;
1347
- const n = Tt(e, t.slice(1));
1358
+ const n = Ot(e, t.slice(1));
1348
1359
  if (n !== null) return n;
1349
- const r = ot(t);
1350
- return r === null ? null : Tt(e, r);
1351
- }, Ct = (e) => {
1360
+ const r = lt(t);
1361
+ return r === null ? null : Ot(e, r);
1362
+ }, At = (e) => {
1352
1363
  const { body: t, documentElement: n } = e.ownerDocument;
1353
1364
  if (e === t) {
1354
1365
  const o = getComputedStyle(n);
@@ -1356,22 +1367,22 @@ const so = /* @__PURE__ */ y.forwardRef(io), ao = Object.freeze({ className: "aq
1356
1367
  }
1357
1368
  const { overflowY: r } = getComputedStyle(e);
1358
1369
  return r === "auto" || r === "scroll";
1359
- }, go = (e) => {
1370
+ }, wo = (e) => {
1360
1371
  const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
1361
1372
  return o !== "hidden" && o !== "clip";
1362
- }, po = (e, t) => {
1373
+ }, bo = (e, t) => {
1363
1374
  const n = t.closest(Fe), r = n !== null && e.contains(n) ? n : e;
1364
- if (r.scrollHeight > r.clientHeight && Ct(r)) return r;
1375
+ if (r.scrollHeight > r.clientHeight && At(r)) return r;
1365
1376
  const o = e.getBoundingClientRect().height, { documentElement: l, scrollingElement: i } = e.ownerDocument;
1366
1377
  for (let d = e.parentElement; d !== null && d !== l; d = d.parentElement)
1367
- if (Ct(d) && d.scrollHeight > d.clientHeight && d.clientHeight < o) return d;
1368
- return i instanceof Element && go(e.ownerDocument) && i.scrollHeight > i.clientHeight && i.clientHeight < o ? i : r;
1369
- }, vo = Object.freeze({
1370
- scrollerOf: po,
1378
+ if (At(d) && d.scrollHeight > d.clientHeight && d.clientHeight < o) return d;
1379
+ return i instanceof Element && wo(e.ownerDocument) && i.scrollHeight > i.clientHeight && i.clientHeight < o ? i : r;
1380
+ }, Eo = Object.freeze({
1381
+ scrollerOf: bo,
1371
1382
  reveal: (e) => {
1372
- e.scrollIntoView(Xe);
1383
+ e.scrollIntoView(Ye);
1373
1384
  }
1374
- }), Xe = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), wo = (e, t) => {
1385
+ }), Ye = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), yo = (e, t) => {
1375
1386
  for (let n = t; n !== null && n !== e; n = n.parentElement) {
1376
1387
  const r = n.parentElement;
1377
1388
  if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
@@ -1379,23 +1390,23 @@ const so = /* @__PURE__ */ y.forwardRef(io), ao = Object.freeze({ className: "aq
1379
1390
  n.removeAttribute("hidden");
1380
1391
  }
1381
1392
  }
1382
- }, bo = (e, t) => {
1393
+ }, ko = (e, t) => {
1383
1394
  if (t.getClientRects().length === 0) return;
1384
1395
  const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), l = Number.parseFloat(r), i = t.getBoundingClientRect(), d = i.height + l + Number.parseFloat(o) > e.clientHeight;
1385
1396
  if (!d && Math.abs(i.top - l - n) < 1) {
1386
- t.scrollIntoView(Xe);
1397
+ t.scrollIntoView(Ye);
1387
1398
  return;
1388
1399
  }
1389
- e.scrollBy({ top: d ? i.top - n - e.clientHeight : i.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Xe);
1390
- }, Eo = (e, t) => {
1400
+ e.scrollBy({ top: d ? i.top - n - e.clientHeight : i.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Ye);
1401
+ }, So = (e, t) => {
1391
1402
  const n = t.scrollerOf(e, e.querySelector(Fe) ?? e);
1392
1403
  n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
1393
- }, Ot = (e, t, n) => {
1404
+ }, Lt = (e, t, n) => {
1394
1405
  if (e === null) return null;
1395
- const r = hn(e, t);
1396
- return r === null ? (mo(t) && Eo(e, n), null) : (wo(e, r), bo(n.scrollerOf(e, r), r), n.reveal(r), r);
1406
+ const r = pn(e, t);
1407
+ return r === null ? (po(t) && So(e, n), null) : (yo(e, r), ko(n.scrollerOf(e, r), r), n.reveal(r), r);
1397
1408
  };
1398
- function yo({
1409
+ function xo({
1399
1410
  title: e,
1400
1411
  titleId: t,
1401
1412
  ...n
@@ -1414,8 +1425,8 @@ function yo({
1414
1425
  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"
1415
1426
  }));
1416
1427
  }
1417
- const ko = /* @__PURE__ */ y.forwardRef(yo);
1418
- function So({
1428
+ const Ro = /* @__PURE__ */ y.forwardRef(xo);
1429
+ function To({
1419
1430
  title: e,
1420
1431
  titleId: t,
1421
1432
  ...n
@@ -1438,8 +1449,8 @@ function So({
1438
1449
  clipRule: "evenodd"
1439
1450
  }));
1440
1451
  }
1441
- const xo = /* @__PURE__ */ y.forwardRef(So);
1442
- function Ro({
1452
+ const Co = /* @__PURE__ */ y.forwardRef(To);
1453
+ function Oo({
1443
1454
  title: e,
1444
1455
  titleId: t,
1445
1456
  ...n
@@ -1462,8 +1473,8 @@ function Ro({
1462
1473
  clipRule: "evenodd"
1463
1474
  }));
1464
1475
  }
1465
- const To = /* @__PURE__ */ y.forwardRef(Ro);
1466
- function Co({
1476
+ const Ao = /* @__PURE__ */ y.forwardRef(Oo);
1477
+ function Lo({
1467
1478
  title: e,
1468
1479
  titleId: t,
1469
1480
  ...n
@@ -1484,7 +1495,7 @@ function Co({
1484
1495
  clipRule: "evenodd"
1485
1496
  }));
1486
1497
  }
1487
- const Oo = /* @__PURE__ */ y.forwardRef(Co), Ye = "data-aqmx-key-repeat", Je = Object.freeze({ [Ye]: "allow" }), Ao = `[${Ye}="${Je[Ye]}"]`, Lo = () => {
1498
+ const Mo = /* @__PURE__ */ y.forwardRef(Lo), Je = "data-aqmx-key-repeat", Qe = Object.freeze({ [Je]: "allow" }), No = `[${Je}="${Qe[Je]}"]`, Do = () => {
1488
1499
  let e = null;
1489
1500
  return {
1490
1501
  onKeyDownCapture: (t) => {
@@ -1493,7 +1504,7 @@ const Oo = /* @__PURE__ */ y.forwardRef(Co), Ye = "data-aqmx-key-repeat", Je = O
1493
1504
  e = t.target instanceof Element ? t.target : null;
1494
1505
  return;
1495
1506
  }
1496
- e !== null && t.target === e && e.closest(Ao) !== null || (t.preventDefault(), t.stopPropagation());
1507
+ e !== null && t.target === e && e.closest(No) !== null || (t.preventDefault(), t.stopPropagation());
1497
1508
  }
1498
1509
  },
1499
1510
  onKeyUpCapture: (t) => {
@@ -1503,7 +1514,7 @@ const Oo = /* @__PURE__ */ y.forwardRef(Co), Ye = "data-aqmx-key-repeat", Je = O
1503
1514
  t.target === e && (e = null);
1504
1515
  }
1505
1516
  };
1506
- }, Ce = Object.freeze([1 / Se ** 2, 1 / Se, 1, Se, Se ** 2]), At = Object.freeze({ mode: "fit" }), Mo = 1, No = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Do = me(null), $o = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Mo ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Lt = (e, t, n) => {
1517
+ }, Ce = Object.freeze([1 / Se ** 2, 1 / Se, 1, Se, Se ** 2]), Mt = Object.freeze({ mode: "fit" }), $o = 1, Po = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Fo = me(null), qo = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= $o ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Nt = (e, t, n) => {
1507
1518
  if (e.mode === "level") {
1508
1519
  const o = e.index + n;
1509
1520
  return o >= 0 && o < Ce.length ? o : null;
@@ -1511,22 +1522,22 @@ const Oo = /* @__PURE__ */ y.forwardRef(Co), Ye = "data-aqmx-key-repeat", Je = O
1511
1522
  if (t === null || !Number.isFinite(t) || t <= 0) return null;
1512
1523
  const r = n === 1 ? Ce.findIndex((o) => o > t) : Ce.findLastIndex((o) => o < t);
1513
1524
  return r === -1 ? null : r;
1514
- }, Mt = (e, t, n) => {
1525
+ }, Dt = (e, t, n) => {
1515
1526
  if (e.mode === "level") {
1516
- const o = Lt(e, null, n);
1527
+ const o = Nt(e, null, n);
1517
1528
  return o === null ? null : { mode: "level", index: o, base: e.base };
1518
1529
  }
1519
1530
  if (t === null) return null;
1520
- const r = Lt(e, t.scale, n);
1531
+ const r = Nt(e, t.scale, n);
1521
1532
  return r === null ? null : { mode: "level", index: r, base: t.base };
1522
- }, Po = (e) => {
1533
+ }, _o = (e) => {
1523
1534
  const t = Ce[e];
1524
1535
  if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
1525
1536
  return t;
1526
- }, Nt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Fo = ({ document: e }) => {
1527
- const { labels: t } = D(), n = te(Do), [r] = I(() => n === null ? null : n.read(e.url)), [o, l] = I(r === null ? At : r.zoom), [i, d] = I(r === null ? null : r.reported), [v, f] = I(null), u = B(null), g = P((M) => {
1537
+ }, $t = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Bo = ({ document: e }) => {
1538
+ const { labels: t } = D(), n = ne(Fo), [r] = I(() => n === null ? null : n.read(e.url)), [o, l] = I(r === null ? Mt : r.zoom), [i, d] = I(r === null ? null : r.reported), [v, f] = I(null), u = B(null), g = P((M) => {
1528
1539
  const { naturalWidth: s, naturalHeight: a } = M;
1529
- d((h) => Nt(h, s, a));
1540
+ d((h) => $t(h, s, a));
1530
1541
  }, []), m = P(
1531
1542
  (M) => {
1532
1543
  u.current = M, !(M === null || !M.complete) && (M.naturalWidth > 0 || M.naturalHeight > 0 ? g(M) : M.decode().then(
@@ -1542,14 +1553,14 @@ const Oo = /* @__PURE__ */ y.forwardRef(Co), Ye = "data-aqmx-key-repeat", Je = O
1542
1553
  }, [n, e.url, o, i]), V(() => {
1543
1554
  const M = u.current;
1544
1555
  if (M === null || i === null || o.mode !== "fit") return;
1545
- const s = () => f((h) => Nt(h, M.clientWidth, M.clientHeight));
1556
+ const s = () => f((h) => $t(h, M.clientWidth, M.clientHeight));
1546
1557
  if (s(), typeof ResizeObserver > "u") return;
1547
1558
  const a = new ResizeObserver(s);
1548
1559
  return a.observe(M), () => a.disconnect();
1549
1560
  }, [i, o.mode]);
1550
- const k = i === null || v === null ? null : $o(i, v), O = Mt(o, k, -1), E = Mt(o, k, 1), T = o.mode === "level" ? Po(o.index) : null, x = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
1561
+ const k = i === null || v === null ? null : qo(i, v), O = Dt(o, k, -1), E = Dt(o, k, 1), T = o.mode === "level" ? _o(o.index) : null, x = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
1551
1562
  return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
1552
- /* @__PURE__ */ F(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(Oo, {}), children: [
1563
+ /* @__PURE__ */ F(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(Mo, {}), children: [
1553
1564
  /* @__PURE__ */ c(
1554
1565
  "button",
1555
1566
  {
@@ -1561,8 +1572,8 @@ const Oo = /* @__PURE__ */ y.forwardRef(Co), Ye = "data-aqmx-key-repeat", Je = O
1561
1572
  onClick: () => {
1562
1573
  O !== null && l(O);
1563
1574
  },
1564
- ...Je,
1565
- children: /* @__PURE__ */ c(xo, {})
1575
+ ...Qe,
1576
+ children: /* @__PURE__ */ c(Co, {})
1566
1577
  }
1567
1578
  ),
1568
1579
  /* @__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)) }),
@@ -1577,29 +1588,29 @@ const Oo = /* @__PURE__ */ y.forwardRef(Co), Ye = "data-aqmx-key-repeat", Je = O
1577
1588
  onClick: () => {
1578
1589
  E !== null && l(E);
1579
1590
  },
1580
- ...Je,
1581
- children: /* @__PURE__ */ c(To, {})
1591
+ ...Qe,
1592
+ children: /* @__PURE__ */ c(Ao, {})
1582
1593
  }
1583
1594
  ),
1584
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(At), children: /* @__PURE__ */ c(ko, {}) })
1595
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(Mt), children: /* @__PURE__ */ c(Ro, {}) })
1585
1596
  ] }),
1586
- /* @__PURE__ */ c(ke, { scrollerProps: No, children: /* @__PURE__ */ c("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: x, onLoad: (M) => g(M.currentTarget), "data-testid": "markdown-explorer-image" }) })
1597
+ /* @__PURE__ */ c(ke, { scrollerProps: Po, children: /* @__PURE__ */ c("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: x, onLoad: (M) => g(M.currentTarget), "data-testid": "markdown-explorer-image" }) })
1587
1598
  ] });
1588
- }, gn = me(null), qe = me(void 0), pn = me(null), _e = () => {
1589
- const e = te(gn);
1599
+ }, vn = me(null), qe = me(void 0), wn = me(null), _e = () => {
1600
+ const e = ne(vn);
1590
1601
  if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
1591
1602
  return e;
1592
- }, qo = () => {
1593
- const e = te(pn);
1603
+ }, Io = () => {
1604
+ const e = ne(wn);
1594
1605
  if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
1595
1606
  return e;
1596
- }, Be = (e, t, n, r) => t.kind === "panel" ? ge(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ge(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ge(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), _o = ({ children: e }) => {
1597
- const { config: t } = D(), n = _e(), r = tt(), o = r.kind === "location" ? r.location.source : void 0, l = De(Be(t, n.navigation, o, n.currentPath));
1598
- return /* @__PURE__ */ c(qe, { value: o, children: /* @__PURE__ */ c(pn, { value: l, children: e }) });
1599
- }, Bo = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Io = (e) => {
1600
- const t = e instanceof Element ? e.closest(Bo) : null;
1607
+ }, Be = (e, t, n, r) => t.kind === "panel" ? ge(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ge(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ge(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), jo = ({ children: e }) => {
1608
+ const { config: t } = D(), n = _e(), r = nt(), o = r.kind === "location" ? r.location.source : void 0, l = De(Be(t, n.navigation, o, n.currentPath));
1609
+ return /* @__PURE__ */ c(qe, { value: o, children: /* @__PURE__ */ c(wn, { value: l, children: e }) });
1610
+ }, Ho = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', zo = (e) => {
1611
+ const t = e instanceof Element ? e.closest(Ho) : null;
1601
1612
  return t === null ? null : t.getAttribute("data-doc-path");
1602
- }, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, jo = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: i, scope: d, children: v }) => {
1613
+ }, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Uo = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: i, scope: d, children: v }) => {
1603
1614
  const f = De(e);
1604
1615
  return /* @__PURE__ */ c("a", { ...l, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (g) => {
1605
1616
  if (Ie(g)) {
@@ -1610,10 +1621,10 @@ const Oo = /* @__PURE__ */ y.forwardRef(Co), Ye = "data-aqmx-key-repeat", Je = O
1610
1621
  i(t, n);
1611
1622
  }
1612
1623
  }, children: v });
1613
- }, Ho = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
1614
- const { config: i } = D(), d = _e(), v = te(qe), f = uo(e), { navigation: u } = d, g = `${Be(i, u, v, t)}${f}`, m = n === !1 ? "false" : void 0;
1615
- return u.kind === "page" ? /* @__PURE__ */ c(Kr, { ...o, to: g, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": m, children: l }) : /* @__PURE__ */ c(jo, { to: g, docPath: t, fragment: f, exists: m, className: r, attributes: o, onDocumentLink: u.onDocumentLink, scope: d, children: l });
1616
- }, zo = ({ className: e, attributes: t, children: n }) => {
1624
+ }, Zo = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
1625
+ const { config: i } = D(), d = _e(), v = ne(qe), f = ho(e), { navigation: u } = d, g = `${Be(i, u, v, t)}${f}`, m = n === !1 ? "false" : void 0;
1626
+ return u.kind === "page" ? /* @__PURE__ */ c(Yr, { ...o, to: g, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": m, children: l }) : /* @__PURE__ */ c(Uo, { to: g, docPath: t, fragment: f, exists: m, className: r, attributes: o, onDocumentLink: u.onDocumentLink, scope: d, children: l });
1627
+ }, Vo = ({ className: e, attributes: t, children: n }) => {
1617
1628
  const { labels: r } = D();
1618
1629
  return (
1619
1630
  /* @__PURE__ */ F("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: [
@@ -1625,34 +1636,34 @@ const Oo = /* @__PURE__ */ y.forwardRef(Co), Ye = "data-aqmx-key-repeat", Je = O
1625
1636
  ] })
1626
1637
  ] })
1627
1638
  );
1628
- }, Uo = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
1629
- const { config: l } = D(), i = te(qe), d = De(`${Be(l, r.navigation, i, r.currentPath)}${e}`);
1639
+ }, Go = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
1640
+ const { config: l } = D(), i = ne(qe), d = De(`${Be(l, r.navigation, i, r.currentPath)}${e}`);
1630
1641
  return /* @__PURE__ */ c("a", { ...n, href: d, className: t, onClick: (f) => {
1631
1642
  Ie(f) && (f.preventDefault(), r.scrollWithin(e));
1632
1643
  }, children: o });
1633
- }, Zo = ({ href: e, className: t, attributes: n, children: r }) => {
1644
+ }, Ko = ({ href: e, className: t, attributes: n, children: r }) => {
1634
1645
  const o = _e();
1635
1646
  return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (i) => {
1636
1647
  if (!Ie(i)) return;
1637
1648
  const d = i.currentTarget;
1638
1649
  e === "#" ? o.followEmptyFragment(i.nativeEvent) : d.href === d.ownerDocument.URL && o.followSameUrlJump(e, i.nativeEvent);
1639
- }, children: r }) : /* @__PURE__ */ c(Uo, { href: e, className: t, attributes: n, scope: o, children: r });
1640
- }, Vo = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !Bn(n) ? /* @__PURE__ */ c(zo, { className: o, attributes: l, children: i }) : /* @__PURE__ */ c(Ho, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: i }) : e.startsWith("#") ? /* @__PURE__ */ c(Zo, { href: e, className: o, attributes: l, children: i }) : /* @__PURE__ */ c("a", { ...l, href: e, className: o, children: i }), Go = () => {
1641
- const { config: e } = D(), t = _e(), n = te(qe), r = $e();
1650
+ }, children: r }) : /* @__PURE__ */ c(Go, { href: e, className: t, attributes: n, scope: o, children: r });
1651
+ }, Wo = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !jn(n) ? /* @__PURE__ */ c(Vo, { className: o, attributes: l, children: i }) : /* @__PURE__ */ c(Zo, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: i }) : e.startsWith("#") ? /* @__PURE__ */ c(Ko, { href: e, className: o, attributes: l, children: i }) : /* @__PURE__ */ c("a", { ...l, href: e, className: o, children: i }), Xo = () => {
1652
+ const { config: e } = D(), t = _e(), n = ne(qe), r = $e();
1642
1653
  return P(
1643
1654
  (o, l) => {
1644
1655
  if (!Ie(l)) return !0;
1645
1656
  l.preventDefault();
1646
- const i = fn(o.id), { navigation: d } = t;
1647
- return d.kind === "panel" || ot(l.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(i), !0) : (r(`${Be(e, d, n, t.currentPath)}${i}`, "follow-link"), !0);
1657
+ const i = hn(o.id), { navigation: d } = t;
1658
+ return d.kind === "panel" || lt(l.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(i), !0) : (r(`${Be(e, d, n, t.currentPath)}${i}`, "follow-link"), !0);
1648
1659
  },
1649
1660
  [e, t, n, r]
1650
1661
  );
1651
- }, Ko = () => {
1652
- const e = qo();
1653
- return P((t) => `${e}${fn(t.id)}`, [e]);
1662
+ }, Yo = () => {
1663
+ const e = Io();
1664
+ return P((t) => `${e}${hn(t.id)}`, [e]);
1654
1665
  };
1655
- function Wo({
1666
+ function Jo({
1656
1667
  title: e,
1657
1668
  titleId: t,
1658
1669
  ...n
@@ -1671,8 +1682,8 @@ function Wo({
1671
1682
  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"
1672
1683
  }));
1673
1684
  }
1674
- const Xo = /* @__PURE__ */ y.forwardRef(Wo);
1675
- function Yo({
1685
+ const Qo = /* @__PURE__ */ y.forwardRef(Jo);
1686
+ function el({
1676
1687
  title: e,
1677
1688
  titleId: t,
1678
1689
  ...n
@@ -1693,8 +1704,8 @@ function Yo({
1693
1704
  clipRule: "evenodd"
1694
1705
  }));
1695
1706
  }
1696
- const Jo = /* @__PURE__ */ y.forwardRef(Yo);
1697
- function Qo({
1707
+ const tl = /* @__PURE__ */ y.forwardRef(el);
1708
+ function nl({
1698
1709
  title: e,
1699
1710
  titleId: t,
1700
1711
  ...n
@@ -1715,20 +1726,20 @@ function Qo({
1715
1726
  clipRule: "evenodd"
1716
1727
  }));
1717
1728
  }
1718
- const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aqmx-document-stage" }), nl = (e) => {
1729
+ const rl = /* @__PURE__ */ y.forwardRef(nl), ol = Object.freeze({ className: "aqmx-document-stage" }), ll = (e) => {
1719
1730
  switch (e) {
1720
1731
  case "video":
1721
- return /* @__PURE__ */ c(Jo, {});
1732
+ return /* @__PURE__ */ c(tl, {});
1722
1733
  case "audio":
1723
- return /* @__PURE__ */ c(el, {});
1734
+ return /* @__PURE__ */ c(rl, {});
1724
1735
  case "pdf":
1725
- return /* @__PURE__ */ c(Xo, {});
1736
+ return /* @__PURE__ */ c(Qo, {});
1726
1737
  default: {
1727
1738
  const t = e;
1728
1739
  throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
1729
1740
  }
1730
1741
  }
1731
- }, rl = ({ document: e }) => {
1742
+ }, il = ({ document: e }) => {
1732
1743
  const { labels: t } = D();
1733
1744
  switch (e.mediaType) {
1734
1745
  case "video":
@@ -1746,10 +1757,10 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
1746
1757
  throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
1747
1758
  }
1748
1759
  }
1749
- }, ol = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
1750
- /* @__PURE__ */ c(Pe, { name: e.name, url: e.url, icon: nl(e.mediaType) }),
1751
- /* @__PURE__ */ c(ke, { scrollerProps: tl, children: /* @__PURE__ */ c(rl, { document: e }) })
1752
- ] }), ll = (e) => ({
1760
+ }, sl = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
1761
+ /* @__PURE__ */ c(Pe, { name: e.name, url: e.url, icon: ll(e.mediaType) }),
1762
+ /* @__PURE__ */ c(ke, { scrollerProps: ol, children: /* @__PURE__ */ c(il, { document: e }) })
1763
+ ] }), al = (e) => ({
1753
1764
  loading: e.viewerLoading,
1754
1765
  errorPrefix: e.viewerErrorPrefix,
1755
1766
  styleTitle: e.viewerStyleTitle,
@@ -1783,64 +1794,64 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
1783
1794
  embeddedVideo: e.viewerEmbeddedVideo,
1784
1795
  embeddedPost: e.viewerEmbeddedPost,
1785
1796
  embeddedFrame: e.viewerEmbeddedFrame
1786
- }), vn = (e, t, n) => {
1797
+ }), bn = (e, t, n) => {
1787
1798
  if (t !== void 0) return t;
1788
1799
  if (n !== void 0) return n;
1789
1800
  const [r] = e.documentStyles;
1790
1801
  if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
1791
1802
  return r.name;
1792
- }, wn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : or, lt = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), il = (e, t, n) => {
1803
+ }, En = (e, t) => e !== void 0 ? e : t !== void 0 ? t : ir, it = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), cl = (e, t, n) => {
1793
1804
  if (t.view === "multi" || t.overrides[n] === void 0) return null;
1794
1805
  const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
1795
1806
  return ge(e, { ...t, overrides: r });
1796
- }, it = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: l, intent: i, children: d }) => {
1797
- const v = te(fe);
1807
+ }, st = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: l, intent: i, children: d }) => {
1808
+ const v = ne(fe);
1798
1809
  return (
1799
1810
  /* @__PURE__ */ F("section", { ref: l, role: "region", "aria-label": n, "aria-busy": o, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-view": t, "data-aqmx-document-flow": v, className: "aqmx-document", ...i, children: [
1800
1811
  r ? /* @__PURE__ */ c("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
1801
1812
  d
1802
1813
  ] })
1803
1814
  );
1804
- }, sl = () => {
1815
+ }, dl = () => {
1805
1816
  const { labels: e } = D();
1806
- return /* @__PURE__ */ c(it, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
1807
- }, bn = ({ label: e }) => {
1817
+ return /* @__PURE__ */ c(st, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
1818
+ }, yn = ({ label: e }) => {
1808
1819
  const { labels: t } = D();
1809
- return /* @__PURE__ */ F(it, { kind: "loading", label: e, stale: !1, busy: !0, children: [
1810
- /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: lt.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
1820
+ return /* @__PURE__ */ F(st, { kind: "loading", label: e, stale: !1, busy: !0, children: [
1821
+ /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: it.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
1811
1822
  /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: t.documentLoading })
1812
1823
  ] });
1813
- }, Dt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), al = ({ path: e, document: t, viewer: n, editing: r }) => {
1814
- const { reportMathDiagnostics: o, edits: l } = D(), i = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d = Go(), v = Ko(), f = U(() => o === void 0 ? void 0 : (h) => o(e, h), [o, e]), u = B(null), { editable: g, doubleClick: m, region: k, paneScroll: O, stale: E } = r;
1824
+ }, Pt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), ul = ({ path: e, document: t, viewer: n, editing: r }) => {
1825
+ const { reportMathDiagnostics: o, edits: l } = D(), i = U(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d = Xo(), v = Yo(), f = U(() => o === void 0 ? void 0 : (h) => o(e, h), [o, e]), u = B(null), { editable: g, doubleClick: m, region: k, paneScroll: O, stale: E } = r;
1815
1826
  V(() => {
1816
1827
  if (g)
1817
1828
  return l.bindView(e, {
1818
1829
  anchor: () => {
1819
1830
  const h = u.current, w = k(), S = h === null ? null : h.querySelector(Fe);
1820
- return h === null || w === null || S === null ? null : jr(h, O.scrollerOf(w, S));
1831
+ return h === null || w === null || S === null ? null : Ur(h, O.scrollerOf(w, S));
1821
1832
  }
1822
1833
  });
1823
1834
  }, [l, e, g, k, O]);
1824
1835
  const T = (h) => {
1825
1836
  const w = u.current, { target: S } = h;
1826
- !m || w === null || !(S instanceof Element) || !Br(S) || (h.stopPropagation(), l.start(e, Ir(S, w, w.ownerDocument.getSelection())));
1837
+ !m || w === null || !(S instanceof Element) || !Hr(S) || (h.stopPropagation(), l.start(e, zr(S, w, w.ownerDocument.getSelection())));
1827
1838
  }, x = B(null), M = B(E);
1828
1839
  V(() => {
1829
1840
  M.current = E;
1830
1841
  });
1831
1842
  const s = ie((h) => {
1832
- const w = u.current, S = k(), L = w === null ? null : Vr(w, h.line);
1843
+ const w = u.current, S = k(), L = w === null ? null : Wr(w, h.line);
1833
1844
  if (S === null || L === null) return !1;
1834
1845
  const R = O.scrollerOf(S, L);
1835
- return R.scrollTop += Gr(L, h.line) - h.clientTop, !0;
1846
+ return R.scrollTop += Xr(L, h.line) - h.clientTop, !0;
1836
1847
  }), a = ie((h) => {
1837
1848
  const w = k();
1838
1849
  if (w === null) return;
1839
1850
  const S = () => {
1840
- for (const R of Dt) w.removeEventListener(R, L, !0);
1851
+ for (const R of Pt) w.removeEventListener(R, L, !0);
1841
1852
  x.current?.release === S && (x.current = null);
1842
1853
  }, L = () => S();
1843
- for (const R of Dt) w.addEventListener(R, L, { capture: !0, passive: !0 });
1854
+ for (const R of Pt) w.addEventListener(R, L, { capture: !0, passive: !0 });
1844
1855
  x.current = { point: h, release: S };
1845
1856
  });
1846
1857
  return V(() => {
@@ -1853,16 +1864,16 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
1853
1864
  const h = x.current;
1854
1865
  h === null || E || (h.release(), s(h.point));
1855
1866
  }, [t, E]),
1856
- /* @__PURE__ */ c("div", { ref: u, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ c(Vt, { ...n, onHeadingSelect: d, headingHref: v, onMathDiagnostics: f, parseResult: i, content: null }) });
1857
- }, En = ({ document: e, viewer: t }) => {
1867
+ /* @__PURE__ */ c("div", { ref: u, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ c(Kt, { ...n, onHeadingSelect: d, headingHref: v, onMathDiagnostics: f, parseResult: i, content: null }) });
1868
+ }, kn = ({ document: e, viewer: t }) => {
1858
1869
  const { labels: n } = D();
1859
1870
  return /* @__PURE__ */ F(Ne, { children: [
1860
- /* @__PURE__ */ c(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(Mr, {}) }),
1871
+ /* @__PURE__ */ c(Pe, { name: e.name, url: e.url, icon: /* @__PURE__ */ c($r, {}) }),
1861
1872
  e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
1862
- /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(Vt, { ...t, parseResult: null, content: e.text }) })
1873
+ /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(Kt, { ...t, parseResult: null, content: e.text }) })
1863
1874
  ] });
1864
- }, cl = ({ path: e, name: t, viewer: n }) => {
1865
- const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), v = ee(o.subscribe, d, d), [f, u] = I(0), g = U(() => ({ path: e, stamp: v, attempt: f }), [e, v, f]), [m, k] = I(null), O = ie((T) => {
1875
+ }, fl = ({ path: e, name: t, viewer: n }) => {
1876
+ const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), v = te(o.subscribe, d, d), [f, u] = I(0), g = U(() => ({ path: e, stamp: v, attempt: f }), [e, v, f]), [m, k] = I(null), O = ie((T) => {
1866
1877
  k(T), T.kind === "failure" && l.announce(i.documentFailed(t, ae(i, T.failure.reason)));
1867
1878
  });
1868
1879
  oe(() => {
@@ -1873,54 +1884,54 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
1873
1884
  }, [r, g]);
1874
1885
  const E = P(() => u((T) => T + 1), []);
1875
1886
  return m === null ? /* @__PURE__ */ F(Ne, { children: [
1876
- /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: lt.map((T) => /* @__PURE__ */ c("span", {}, T)) }),
1887
+ /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: it.map((T) => /* @__PURE__ */ c("span", {}, T)) }),
1877
1888
  /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: i.markupLoading })
1878
- ] }) : m.kind === "failure" ? /* @__PURE__ */ c(ke, { scrollerProps: yn, children: /* @__PURE__ */ c(ve, { failure: m.failure, alert: !1, onRetry: E, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(En, { document: m, viewer: n });
1879
- }, yn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), dl = Object.freeze({ reason: "failed" }), ul = (e) => /* @__PURE__ */ c(
1880
- Dr,
1889
+ ] }) : m.kind === "failure" ? /* @__PURE__ */ c(ke, { scrollerProps: Sn, children: /* @__PURE__ */ c(ve, { failure: m.failure, alert: !1, onRetry: E, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(kn, { document: m, viewer: n });
1890
+ }, Sn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), ml = Object.freeze({ reason: "failed" }), hl = (e) => /* @__PURE__ */ c(
1891
+ Fr,
1881
1892
  {
1882
- fallback: (t) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(ve, { failure: dl, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
1893
+ fallback: (t) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(ve, { failure: ml, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
1883
1894
  children: /* @__PURE__ */ c(
1884
1895
  pe,
1885
1896
  {
1886
- fallback: /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: lt.map((t) => /* @__PURE__ */ c("span", {}, t)) }),
1887
- children: /* @__PURE__ */ c(Nr, { ...e })
1897
+ fallback: /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: it.map((t) => /* @__PURE__ */ c("span", {}, t)) }),
1898
+ children: /* @__PURE__ */ c(Pr, { ...e })
1888
1899
  }
1889
1900
  )
1890
1901
  }
1891
- ), fl = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: l }) => {
1902
+ ), gl = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: l }) => {
1892
1903
  switch (t.kind) {
1893
1904
  case "markdown": {
1894
1905
  const { session: i, layout: d, region: v, paneScroll: f, stale: u } = l;
1895
- if (n === "edit" && i !== void 0) return /* @__PURE__ */ c(ul, { path: e, name: t.name, session: i, layout: d, viewer: r, region: v, paneScroll: f });
1896
- if (n === "markup") return /* @__PURE__ */ c(cl, { path: e, name: t.name, viewer: r });
1906
+ if (n === "edit" && i !== void 0) return /* @__PURE__ */ c(hl, { path: e, name: t.name, session: i, layout: d, viewer: r, region: v, paneScroll: f });
1907
+ if (n === "markup") return /* @__PURE__ */ c(fl, { path: e, name: t.name, viewer: r });
1897
1908
  const g = t.edit !== null && t.edit.kind === "inline";
1898
- return /* @__PURE__ */ c(al, { path: e, document: t, viewer: r, editing: { editable: g, doubleClick: g && d === "fill", region: v, paneScroll: f, stale: u } });
1909
+ return /* @__PURE__ */ c(ul, { path: e, document: t, viewer: r, editing: { editable: g, doubleClick: g && d === "fill", region: v, paneScroll: f, stale: u } });
1899
1910
  }
1900
1911
  case "text":
1901
- return /* @__PURE__ */ c(En, { document: t, viewer: r });
1912
+ return /* @__PURE__ */ c(kn, { document: t, viewer: r });
1902
1913
  case "image":
1903
- return /* @__PURE__ */ c(Fo, { document: t });
1914
+ return /* @__PURE__ */ c(Bo, { document: t });
1904
1915
  case "media":
1905
- return /* @__PURE__ */ c(ol, { document: t });
1916
+ return /* @__PURE__ */ c(sl, { document: t });
1906
1917
  case "file":
1907
- return /* @__PURE__ */ c(co, { document: t });
1918
+ return /* @__PURE__ */ c(mo, { document: t });
1908
1919
  case "failure":
1909
- return /* @__PURE__ */ c(ke, { scrollerProps: yn, children: /* @__PURE__ */ c(ve, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
1920
+ return /* @__PURE__ */ c(ke, { scrollerProps: Sn, children: /* @__PURE__ */ c(ve, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
1910
1921
  default: {
1911
1922
  const i = t;
1912
1923
  throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(i)}`);
1913
1924
  }
1914
1925
  }
1915
- }, ml = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', hl = (e, t, n) => {
1916
- const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : hn(e, n), r === void 0 ? null : mn(e, r.id), e.querySelector(Fe), e.querySelector(ml)];
1926
+ }, pl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', vl = (e, t, n) => {
1927
+ const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : pn(e, n), r === void 0 ? null : gn(e, r.id), e.querySelector(Fe), e.querySelector(pl)];
1917
1928
  for (const l of o)
1918
- if (l instanceof HTMLElement && sn(l)) return l;
1929
+ if (l instanceof HTMLElement && cn(l)) return l;
1919
1930
  return null;
1920
- }, $t = (e, t, n) => {
1931
+ }, Ft = (e, t, n) => {
1921
1932
  const { activeElement: r, body: o } = e.ownerDocument, l = r === null || r === o;
1922
- t instanceof HTMLElement && n && (l || e.contains(r)) && sn(t);
1923
- }, gl = (e) => {
1933
+ t instanceof HTMLElement && n && (l || e.contains(r)) && cn(t);
1934
+ }, wl = (e) => {
1924
1935
  const t = B(!1);
1925
1936
  return V(() => {
1926
1937
  const n = e.current;
@@ -1946,11 +1957,11 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
1946
1957
  clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", v, !0), o.removeEventListener("blur", u), o.removeEventListener("focus", g), n.removeEventListener("focusout", f);
1947
1958
  };
1948
1959
  }, [e]), t;
1949
- }, pl = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: v, paneScroll: f, announces: u, announceFailure: g, onDocumentShown: m }) => {
1950
- const { labels: k, announcer: O, documents: E } = D(), { document: T } = t, x = B(null), M = B(null), s = B(null), a = B(0), h = gl(x), w = B({ path: e, document: T }), S = B(null), L = P(
1960
+ }, bl = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: v, paneScroll: f, announces: u, announceFailure: g, onDocumentShown: m }) => {
1961
+ const { labels: k, announcer: O, documents: E } = D(), { document: T } = t, x = B(null), M = B(null), s = B(null), a = B(0), h = wl(x), w = B({ path: e, document: T }), S = B(null), L = P(
1951
1962
  (z) => {
1952
- const K = x.current, Q = Ot(K, z, f);
1953
- K !== null && Q !== null && $t(K, Q, h.current);
1963
+ const K = x.current, Q = Lt(K, z, f);
1964
+ K !== null && Q !== null && Ft(K, Q, h.current);
1954
1965
  },
1955
1966
  [f, h]
1956
1967
  ), R = P(
@@ -1968,7 +1979,7 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
1968
1979
  }, 0);
1969
1980
  },
1970
1981
  [L]
1971
- ), q = U(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: R, followEmptyFragment: N }), [d, e, L, R, N]), W = P(() => E.retry(e), [E, e]), J = Wr(E, Io), X = rn(e), ne = X !== void 0 ? "edit" : n ? "markup" : "rendered", $ = T.kind === "markdown" ? ne : void 0, G = P(() => x.current, []), p = U(() => ({ session: X, layout: l, region: G, paneScroll: f, stale: r }), [X, l, G, f, r]), b = $ === "edit" ? !1 : r, C = te(fe), A = $ === "edit" && l === "fill" ? "fill" : C, _ = ie((z, K) => {
1982
+ ), q = U(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: R, followEmptyFragment: N }), [d, e, L, R, N]), W = P(() => E.retry(e), [E, e]), J = Jr(E, zo), ee = ln(e), X = ee !== void 0 ? "edit" : n ? "markup" : "rendered", $ = T.kind === "markdown" ? X : void 0, G = P(() => x.current, []), p = U(() => ({ session: ee, layout: l, region: G, paneScroll: f, stale: r }), [ee, l, G, f, r]), b = $ === "edit" ? !1 : r, C = ne(fe), A = $ === "edit" && l === "fill" ? "fill" : C, _ = ie((z, K) => {
1972
1983
  const Q = M.current;
1973
1984
  if (Q !== null && Q.path === z && Q.snapshot === K) return;
1974
1985
  M.current = { path: z, snapshot: K };
@@ -1988,11 +1999,11 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
1988
1999
  const K = x.current;
1989
2000
  if (K === null || !h.current) return null;
1990
2001
  const { activeElement: Q, body: re } = K.ownerDocument;
1991
- return Q !== null && Q !== re ? null : hl(K, T, z);
2002
+ return Q !== null && Q !== re ? null : vl(K, T, z);
1992
2003
  }), H = ie((z) => {
1993
2004
  const K = x.current;
1994
- K !== null && $t(K, z, h.current);
1995
- }), le = ie((z) => f.reveal(z)), at = ie((z) => Ot(x.current, z, f));
2005
+ K !== null && Ft(K, z, h.current);
2006
+ }), le = ie((z) => f.reveal(z)), ct = ie((z) => Lt(x.current, z, f));
1996
2007
  return oe(() => {
1997
2008
  if (r) return;
1998
2009
  const z = w.current.path !== e, K = z || w.current.document !== T;
@@ -2001,39 +2012,39 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
2001
2012
  S.current = e;
2002
2013
  let re = null;
2003
2014
  v.kind === "page" ? s.current !== v.navigation && (s.current = v.navigation, a.current += 1, re = v.fragment) : v.fragment !== null && (re = v.fragment, j());
2004
- const ct = () => {
2005
- const je = re === null ? null : at(re);
2015
+ const dt = () => {
2016
+ const je = re === null ? null : ct(re);
2006
2017
  if (!K) {
2007
2018
  je !== null && H(je);
2008
2019
  return;
2009
2020
  }
2010
- const dt = Z(v.fragment);
2011
- z && je === null && dt !== null && le(dt);
2021
+ const ut = Z(v.fragment);
2022
+ z && je === null && ut !== null && le(ut);
2012
2023
  };
2013
- Q ? queueMicrotask(ct) : ct();
2014
- }, [v, e, T, r]), /* @__PURE__ */ c(fe, { value: A, children: /* @__PURE__ */ c(it, { kind: T.kind, view: $, label: i(e, T), stale: b, busy: b, frameRef: x, intent: J, children: /* @__PURE__ */ c(gn, { value: q, children: /* @__PURE__ */ c(_o, { children: /* @__PURE__ */ c(fl, { path: e, document: T, view: ne, viewer: o, onRetry: W, editing: p }, e) }) }) }) });
2015
- }, st = Object.freeze({ kind: "skeleton" }), vl = (e, t, n, r, o) => {
2024
+ Q ? queueMicrotask(dt) : dt();
2025
+ }, [v, e, T, r]), /* @__PURE__ */ c(fe, { value: A, children: /* @__PURE__ */ c(st, { kind: T.kind, view: $, label: i(e, T), stale: b, busy: b, frameRef: x, intent: J, children: /* @__PURE__ */ c(vn, { value: q, children: /* @__PURE__ */ c(jo, { children: /* @__PURE__ */ c(gl, { path: e, document: T, view: X, viewer: o, onRetry: W, editing: p }, e) }) }) }) });
2026
+ }, at = Object.freeze({ kind: "skeleton" }), El = (e, t, n, r, o) => {
2016
2027
  if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
2017
2028
  const l = de(t);
2018
2029
  if (l !== null) return { kind: "document", path: e, snapshot: l, stale: !0 };
2019
2030
  if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
2020
2031
  const i = n === null || n === e ? null : de(r);
2021
- return n === null || i === null ? st : { kind: "document", path: n, snapshot: i, stale: !0 };
2022
- }, wl = (e, t) => t.status === "deferred" ? st : { kind: "document", path: e, snapshot: t, stale: !1 }, bl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
2023
- const o = t.kind === "streaming" ? wl(t.path, te(t.promise)) : t;
2024
- return o.kind !== "document" ? /* @__PURE__ */ c(bn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(pl, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
2025
- }, kn = ({ path: e, markup: t, display: n, navigation: r, fragment: o, paneScroll: l, announces: i, announceFailure: d, onDocumentShown: v }) => {
2026
- const { config: f, labels: u, theme: g, documents: m } = D(), k = nr(), O = B(!1);
2032
+ return n === null || i === null ? at : { kind: "document", path: n, snapshot: i, stale: !0 };
2033
+ }, yl = (e, t) => t.status === "deferred" ? at : { kind: "document", path: e, snapshot: t, stale: !1 }, kl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
2034
+ const o = t.kind === "streaming" ? yl(t.path, ne(t.promise)) : t;
2035
+ return o.kind !== "document" ? /* @__PURE__ */ c(yn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(bl, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
2036
+ }, xn = ({ path: e, markup: t, display: n, navigation: r, fragment: o, paneScroll: l, announces: i, announceFailure: d, onDocumentShown: v }) => {
2037
+ const { config: f, labels: u, theme: g, documents: m } = D(), k = or(), O = B(!1);
2027
2038
  V(() => {
2028
2039
  O.current = !0;
2029
2040
  }, []);
2030
- const [E, T] = I(null), [x, M] = I(t), s = P(() => e === null ? void 0 : m.peek(e), [m, e]), a = ee(m.subscribe, s, s), h = P(() => E === null ? void 0 : m.peek(E), [m, E]), w = ee(m.subscribe, h, h);
2041
+ const [E, T] = I(null), [x, M] = I(t), s = P(() => e === null ? void 0 : m.peek(e), [m, e]), a = te(m.subscribe, s, s), h = P(() => E === null ? void 0 : m.peek(E), [m, E]), w = te(m.subscribe, h, h);
2031
2042
  V(() => e === null ? void 0 : m.open(e), [m, e]), V(() => E === null ? void 0 : m.retain(E), [m, E]);
2032
- const S = e === null ? st : vl(e, a, E, w, !O.current), L = e === null ? null : S.kind === "document" && !S.stale ? S.path : E;
2043
+ const S = e === null ? at : El(e, a, E, w, !O.current), L = e === null ? null : S.kind === "document" && !S.stale ? S.path : E;
2033
2044
  L !== E && T(L);
2034
2045
  const R = S.kind !== "document" || S.path === e;
2035
2046
  R && t !== x && M(t);
2036
- const N = U(() => ll(u), [u]), q = U(() => [...f.iframeHosts], [f]), W = r.kind === "panel", J = U(
2047
+ const N = U(() => al(u), [u]), q = U(() => [...f.iframeHosts], [f]), W = r.kind === "panel", J = U(
2037
2048
  () => ({
2038
2049
  labels: N,
2039
2050
  emptyMessage: u.documentEmpty,
@@ -2041,7 +2052,7 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
2041
2052
  availableStyles: f.documentStyles,
2042
2053
  iFrameAllowedDomains: q,
2043
2054
  embeds: f.embeds,
2044
- linkComponent: Vo,
2055
+ linkComponent: Wo,
2045
2056
  toolbar: k,
2046
2057
  style: n.style,
2047
2058
  onStyleChange: n.onStyleChange,
@@ -2053,19 +2064,19 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
2053
2064
  padding: n.padding,
2054
2065
  width: n.width === void 0 ? void 0 : `min(${n.width}, 100%)`,
2055
2066
  maxWidth: n.maxWidth === void 0 ? void 0 : `min(${n.maxWidth}, 100%)`,
2056
- renderScrollBar: W ? void 0 : an
2067
+ renderScrollBar: W ? void 0 : dn
2057
2068
  }),
2058
2069
  [N, u.documentEmpty, g, f.documentStyles, q, f.embeds, k, n, W]
2059
- ), X = P(($, G) => W ? G === null || G.kind === "failure" ? Ee($) : G.name : u.documentRegion, [W, u.documentRegion]), ne = W ? "content" : "fill";
2060
- return e === null ? /* @__PURE__ */ c(fe, { value: ne, children: /* @__PURE__ */ c(sl, {}) }) : /* @__PURE__ */ c(fe, { value: ne, children: /* @__PURE__ */ c(pe, { fallback: /* @__PURE__ */ c(bn, { label: X(e, null) }), children: /* @__PURE__ */ c(
2061
- bl,
2070
+ ), ee = P(($, G) => W ? G === null || G.kind === "failure" ? Ee($) : G.name : u.documentRegion, [W, u.documentRegion]), X = W ? "content" : "fill";
2071
+ return e === null ? /* @__PURE__ */ c(fe, { value: X, children: /* @__PURE__ */ c(dl, {}) }) : /* @__PURE__ */ c(fe, { value: X, children: /* @__PURE__ */ c(pe, { fallback: /* @__PURE__ */ c(yn, { label: ee(e, null) }), children: /* @__PURE__ */ c(
2072
+ kl,
2062
2073
  {
2063
2074
  requestedPath: e,
2064
2075
  content: S,
2065
2076
  markup: R ? t : x,
2066
2077
  viewer: J,
2067
2078
  editLayout: n.editLayout,
2068
- regionLabel: X,
2079
+ regionLabel: ee,
2069
2080
  navigation: r,
2070
2081
  fragment: o,
2071
2082
  paneScroll: l,
@@ -2074,11 +2085,11 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
2074
2085
  onDocumentShown: v
2075
2086
  }
2076
2087
  ) }) });
2077
- }, El = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
2078
- const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), v = Ae((L) => L.align), f = $e(), u = Ut(), g = tt(), { view: m, overrides: k, embed: O } = n, E = P(
2088
+ }, Sl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
2089
+ const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), v = Ae((L) => L.align), f = $e(), u = Vt(), g = nt(), { view: m, overrides: k, embed: O } = n, E = P(
2079
2090
  (L) => {
2080
2091
  if (g.kind !== "location") return;
2081
- const R = il(o, g.location, L);
2092
+ const R = cl(o, g.location, L);
2082
2093
  R !== null && f(R, "browse");
2083
2094
  },
2084
2095
  [o, f, g]
@@ -2092,7 +2103,7 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
2092
2103
  l.update({ align: L }), E("align");
2093
2104
  },
2094
2105
  [l, E]
2095
- ), M = vn(o, k.style, d), s = wn(k.align, v), a = U(
2106
+ ), M = bn(o, k.style, d), s = En(k.align, v), a = U(
2096
2107
  () => ({
2097
2108
  style: M,
2098
2109
  onStyleChange: T,
@@ -2108,9 +2119,9 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
2108
2119
  }),
2109
2120
  [M, T, s, x, O]
2110
2121
  ), h = U(() => ({ kind: "page", view: m, overrides: k, embed: O }), [m, k, O]), w = U(() => ({ kind: "page", fragment: u.hash, navigation: u }), [u]), S = P((L) => i.announce(L), [i]);
2111
- return /* @__PURE__ */ c(kn, { path: e, markup: t, display: a, navigation: h, fragment: w, paneScroll: vo, announces: !0, announceFailure: S, onDocumentShown: r });
2112
- }, yl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
2113
- const { config: o, viewSettings: l } = D(), i = Ae((h) => h.style), d = Ae((h) => h.align), [v, f] = I(() => vn(o, void 0, i)), u = wn(void 0, d), g = P((h) => l.update({ align: h }), [l]), { maximized: m, onDocumentLink: k, pendingHash: O, onHashConsumed: E, announceFailure: T, paneScroll: x } = n, M = U(
2122
+ return /* @__PURE__ */ c(xn, { path: e, markup: t, display: a, navigation: h, fragment: w, paneScroll: Eo, announces: !0, announceFailure: S, onDocumentShown: r });
2123
+ }, xl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
2124
+ const { config: o, viewSettings: l } = D(), i = Ae((h) => h.style), d = Ae((h) => h.align), [v, f] = I(() => bn(o, void 0, i)), u = En(void 0, d), g = P((h) => l.update({ align: h }), [l]), { maximized: m, onDocumentLink: k, pendingHash: O, onHashConsumed: E, announceFailure: T, paneScroll: x } = n, M = U(
2114
2125
  () => ({
2115
2126
  style: v,
2116
2127
  onStyleChange: f,
@@ -2126,9 +2137,9 @@ const el = /* @__PURE__ */ y.forwardRef(Qo), tl = Object.freeze({ className: "aq
2126
2137
  }),
2127
2138
  [v, u, g, m]
2128
2139
  ), s = U(() => ({ kind: "panel", onDocumentLink: k }), [k]), a = U(() => ({ kind: "panel", fragment: O, consume: E }), [O, E]);
2129
- return /* @__PURE__ */ c(kn, { path: e, markup: t, display: M, navigation: s, fragment: a, paneScroll: x, announces: !1, announceFailure: T, onDocumentShown: r });
2130
- }, kl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => n.kind === "page" ? /* @__PURE__ */ c(El, { path: e, markup: t, variant: n, onDocumentShown: r }) : /* @__PURE__ */ c(yl, { path: e, markup: t, variant: n, onDocumentShown: r });
2131
- function Sl({
2140
+ return /* @__PURE__ */ c(xn, { path: e, markup: t, display: M, navigation: s, fragment: a, paneScroll: x, announces: !1, announceFailure: T, onDocumentShown: r });
2141
+ }, Rl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => n.kind === "page" ? /* @__PURE__ */ c(Sl, { path: e, markup: t, variant: n, onDocumentShown: r }) : /* @__PURE__ */ c(xl, { path: e, markup: t, variant: n, onDocumentShown: r });
2142
+ function Tl({
2132
2143
  title: e,
2133
2144
  titleId: t,
2134
2145
  ...n
@@ -2149,8 +2160,8 @@ function Sl({
2149
2160
  clipRule: "evenodd"
2150
2161
  }));
2151
2162
  }
2152
- const xl = /* @__PURE__ */ y.forwardRef(Sl);
2153
- function Rl({
2163
+ const Cl = /* @__PURE__ */ y.forwardRef(Tl);
2164
+ function Ol({
2154
2165
  title: e,
2155
2166
  titleId: t,
2156
2167
  ...n
@@ -2171,8 +2182,8 @@ function Rl({
2171
2182
  clipRule: "evenodd"
2172
2183
  }));
2173
2184
  }
2174
- const Tl = /* @__PURE__ */ y.forwardRef(Rl);
2175
- function Cl({
2185
+ const Al = /* @__PURE__ */ y.forwardRef(Ol);
2186
+ function Ll({
2176
2187
  title: e,
2177
2188
  titleId: t,
2178
2189
  ...n
@@ -2193,8 +2204,8 @@ function Cl({
2193
2204
  clipRule: "evenodd"
2194
2205
  }));
2195
2206
  }
2196
- const Ol = /* @__PURE__ */ y.forwardRef(Cl);
2197
- function Al({
2207
+ const Ml = /* @__PURE__ */ y.forwardRef(Ll);
2208
+ function Nl({
2198
2209
  title: e,
2199
2210
  titleId: t,
2200
2211
  ...n
@@ -2219,8 +2230,8 @@ function Al({
2219
2230
  clipRule: "evenodd"
2220
2231
  }));
2221
2232
  }
2222
- const Ll = /* @__PURE__ */ y.forwardRef(Al);
2223
- function Ml({
2233
+ const Dl = /* @__PURE__ */ y.forwardRef(Nl);
2234
+ function $l({
2224
2235
  title: e,
2225
2236
  titleId: t,
2226
2237
  ...n
@@ -2241,8 +2252,8 @@ function Ml({
2241
2252
  clipRule: "evenodd"
2242
2253
  }));
2243
2254
  }
2244
- const Nl = /* @__PURE__ */ y.forwardRef(Ml);
2245
- function Dl({
2255
+ const Pl = /* @__PURE__ */ y.forwardRef($l);
2256
+ function Fl({
2246
2257
  title: e,
2247
2258
  titleId: t,
2248
2259
  ...n
@@ -2265,8 +2276,8 @@ function Dl({
2265
2276
  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"
2266
2277
  }));
2267
2278
  }
2268
- const $l = /* @__PURE__ */ y.forwardRef(Dl);
2269
- function Pl({
2279
+ const ql = /* @__PURE__ */ y.forwardRef(Fl);
2280
+ function _l({
2270
2281
  title: e,
2271
2282
  titleId: t,
2272
2283
  ...n
@@ -2289,8 +2300,8 @@ function Pl({
2289
2300
  clipRule: "evenodd"
2290
2301
  }));
2291
2302
  }
2292
- const Fl = /* @__PURE__ */ y.forwardRef(Pl);
2293
- function ql({
2303
+ const Bl = /* @__PURE__ */ y.forwardRef(_l);
2304
+ function Il({
2294
2305
  title: e,
2295
2306
  titleId: t,
2296
2307
  ...n
@@ -2311,7 +2322,7 @@ function ql({
2311
2322
  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"
2312
2323
  }));
2313
2324
  }
2314
- const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId: n }) => {
2325
+ const jl = /* @__PURE__ */ y.forwardRef(Il), Hl = ({ href: e, onRetry: t, testId: n }) => {
2315
2326
  const { labels: r, onEditGrant: o } = D(), [l, i] = I(!1), d = () => {
2316
2327
  o === void 0 || l || (i(!0), o(e).then((v) => {
2317
2328
  v && t();
@@ -2327,10 +2338,10 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2327
2338
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
2328
2339
  ] })
2329
2340
  ] });
2330
- }, Pt = (e, t, n) => {
2341
+ }, qt = (e, t, n) => {
2331
2342
  const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
2332
2343
  return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
2333
- }, Il = ({ path: e, documentName: t, open: n, onClose: r }) => {
2344
+ }, zl = ({ path: e, documentName: t, open: n, onClose: r }) => {
2334
2345
  const { data: o, edits: l, labels: i, locale: d, announcer: v } = D(), f = B(null), u = B(null), g = Oe(), [m, k] = I(null), [O, E] = I(0), [T, x] = I(null), [M, s] = I(null), a = U(() => new Intl.DateTimeFormat(d, { dateStyle: "medium", timeStyle: "short" }), [d]);
2335
2346
  V(() => {
2336
2347
  const R = f.current;
@@ -2355,32 +2366,32 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2355
2366
  const h = () => {
2356
2367
  M === null || M.kind !== "revision" || (l.replaceDraft(e, M.text), v.announce(i.historyRestored(t)), r());
2357
2368
  }, w = (R) => {
2358
- R.key !== "Escape" || R.defaultPrevented || (tn(R), r());
2369
+ R.key !== "Escape" || R.defaultPrevented || (rn(R), r());
2359
2370
  }, S = (R) => {
2360
2371
  R.target === R.currentTarget && r();
2361
2372
  }, L = m !== null && m.kind === "revisions" ? m.revisions.find((R) => R.id === T) : void 0;
2362
2373
  return /* @__PURE__ */ c("dialog", { ref: f, className: "aqmx-confirm aqmx-history", "aria-labelledby": g, "data-testid": "markdown-explorer-history", onKeyDown: w, onClick: S, onCancel: (R) => R.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
2363
2374
  /* @__PURE__ */ c("p", { id: g, className: "aqmx-confirm-title", children: i.historyTitle(t) }),
2364
2375
  m === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: i.historyLoading }) : m.kind === "failure" ? /* @__PURE__ */ c(ve, { failure: m.failure, alert: !1, onRetry: () => E((R) => R + 1), testId: "markdown-explorer-history-failure" }) : m.revisions.length === 0 ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: i.historyEmpty }) : /* @__PURE__ */ c("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: m.revisions.map((R) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": R.id === T, "data-testid": "markdown-explorer-history-entry", onClick: () => x(R.id), children: [
2365
- /* @__PURE__ */ c("span", { children: Pt(R, a, i.historyEntry) }),
2376
+ /* @__PURE__ */ c("span", { children: qt(R, a, i.historyEntry) }),
2366
2377
  R.current ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: i.historyCurrent }) : null,
2367
2378
  R.kept ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: i.historyKept }) : null
2368
2379
  ] }) }, R.id)) }),
2369
2380
  T === null ? null : M === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", children: i.historyLoading }) : M.kind === "failure" ? /* @__PURE__ */ c(ve, { failure: M.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
2370
- /* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": L === void 0 ? i.historyTitle(t) : Pt(L, a, i.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: M.text }) })
2381
+ /* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": L === void 0 ? i.historyTitle(t) : qt(L, a, i.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: M.text }) })
2371
2382
  ),
2372
2383
  /* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
2373
2384
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: i.historyClose }),
2374
2385
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": M === null || M.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: h, children: i.historyRestore })
2375
2386
  ] })
2376
2387
  ] }) });
2377
- }, jl = (e) => {
2378
- const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), l = de(o)?.document;
2388
+ }, Ul = (e) => {
2389
+ const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = te(t.subscribe, n, r), l = de(o)?.document;
2379
2390
  return l === void 0 || l.kind === "failure" ? { edit: null, name: Ee(e) } : { edit: l.kind === "markdown" ? l.edit : null, name: l.name };
2380
2391
  }, se = (e) => {
2381
2392
  e.stopPropagation();
2382
- }, Hl = ({ path: e, documentName: t, iconOnly: n }) => {
2383
- const { edits: r, labels: o } = D(), l = ee(
2393
+ }, Zl = ({ path: e, documentName: t, iconOnly: n }) => {
2394
+ const { edits: r, labels: o } = D(), l = te(
2384
2395
  r.subscribe,
2385
2396
  () => r.session(e) !== void 0,
2386
2397
  () => !1
@@ -2403,16 +2414,16 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2403
2414
  "data-testid": "markdown-explorer-document-edit",
2404
2415
  onClick: v,
2405
2416
  onDoubleClick: se,
2406
- onPointerEnter: St,
2407
- onFocus: St,
2417
+ onPointerEnter: Rt,
2418
+ onFocus: Rt,
2408
2419
  children: [
2409
- /* @__PURE__ */ c(_l, { "aria-hidden": "true" }),
2420
+ /* @__PURE__ */ c(jl, { "aria-hidden": "true" }),
2410
2421
  f === null ? /* @__PURE__ */ c("span", { children: o.editDocumentLabel }) : null
2411
2422
  ]
2412
2423
  }
2413
2424
  ),
2414
2425
  /* @__PURE__ */ c(
2415
- nn,
2426
+ on,
2416
2427
  {
2417
2428
  open: i,
2418
2429
  title: o.unsavedTitle,
@@ -2427,7 +2438,7 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2427
2438
  }
2428
2439
  )
2429
2440
  ] });
2430
- }, zl = ({ href: e, documentName: t, iconOnly: n }) => {
2441
+ }, Vl = ({ href: e, documentName: t, iconOnly: n }) => {
2431
2442
  const { labels: r } = D(), o = n ? r.editExternallyNamed(t) : null;
2432
2443
  return /* @__PURE__ */ F(
2433
2444
  "a",
@@ -2441,16 +2452,16 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2441
2452
  "data-testid": "markdown-explorer-document-edit-external",
2442
2453
  onDoubleClick: se,
2443
2454
  children: [
2444
- /* @__PURE__ */ c(Ol, { "aria-hidden": "true" }),
2455
+ /* @__PURE__ */ c(Ml, { "aria-hidden": "true" }),
2445
2456
  o === null ? /* @__PURE__ */ c("span", { children: r.editExternallyLabel }) : null
2446
2457
  ]
2447
2458
  }
2448
2459
  );
2449
- }, Ul = ({ session: e }) => {
2450
- const { labels: t } = D(), n = pr(t, e);
2460
+ }, Gl = ({ session: e }) => {
2461
+ const { labels: t } = D(), n = wr(t, e);
2451
2462
  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 });
2452
- }, Zl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2453
- const { edits: l, labels: i } = D(), d = Cr(), [v, f] = I(!1);
2463
+ }, Kl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2464
+ const { edits: l, labels: i } = D(), d = Lr(), [v, f] = I(!1);
2454
2465
  if (r.phase.kind !== "editing") return null;
2455
2466
  const u = r.save.kind === "saving", g = u || !r.dirty, m = () => {
2456
2467
  l.flush(e);
@@ -2459,36 +2470,36 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2459
2470
  }, k = (O) => n ? { className: "aqmx-icon-button", "aria-label": O } : { className: "aqmx-icon-button aqmx-labelled-button" };
2460
2471
  return /* @__PURE__ */ F(Ne, { children: [
2461
2472
  r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...k(i.conflictNext), title: i.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => l.nextConflict(e), onDoubleClick: se, children: [
2462
- /* @__PURE__ */ c(Ll, { "aria-hidden": "true" }),
2473
+ /* @__PURE__ */ c(Dl, { "aria-hidden": "true" }),
2463
2474
  n ? null : /* @__PURE__ */ c("span", { children: i.conflictNext })
2464
2475
  ] }) : null,
2465
2476
  o ? /* @__PURE__ */ F("button", { type: "button", ...k(i.previewToggle), title: i.previewToggle, "aria-pressed": d, "data-testid": "markdown-explorer-edit-preview-toggle", onClick: () => l.setPreviewShown(!d), onDoubleClick: se, children: [
2466
- /* @__PURE__ */ c(Fl, { "aria-hidden": "true" }),
2477
+ /* @__PURE__ */ c(Bl, { "aria-hidden": "true" }),
2467
2478
  n ? null : /* @__PURE__ */ c("span", { children: i.previewToggle })
2468
2479
  ] }) : null,
2469
2480
  r.history ? /* @__PURE__ */ F("button", { type: "button", ...k(i.historyOpen), title: i.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => f(!0), onDoubleClick: se, children: [
2470
- /* @__PURE__ */ c(Nl, { "aria-hidden": "true" }),
2481
+ /* @__PURE__ */ c(Pl, { "aria-hidden": "true" }),
2471
2482
  n ? null : /* @__PURE__ */ c("span", { children: i.historyOpen })
2472
2483
  ] }) : null,
2473
2484
  /* @__PURE__ */ F("button", { type: "button", ...k(i.saveDraft), title: i.saveDraftTooltip, "aria-disabled": g, "aria-busy": u, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: m, onDoubleClick: se, children: [
2474
- /* @__PURE__ */ c($l, { "aria-hidden": "true" }),
2485
+ /* @__PURE__ */ c(ql, { "aria-hidden": "true" }),
2475
2486
  n ? null : /* @__PURE__ */ c("span", { children: i.saveDraft })
2476
2487
  ] }),
2477
- r.history ? /* @__PURE__ */ c(Il, { path: e, documentName: t, open: v, onClose: () => f(!1) }) : null
2488
+ r.history ? /* @__PURE__ */ c(zl, { path: e, documentName: t, open: v, onClose: () => f(!1) }) : null
2478
2489
  ] });
2479
- }, Vl = ({ path: e, session: t }) => {
2490
+ }, Wl = ({ path: e, session: t }) => {
2480
2491
  const { edits: n } = D();
2481
- return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(Bl, { href: t.save.href, onRetry: () => {
2492
+ return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(Hl, { href: t.save.href, onRetry: () => {
2482
2493
  n.save(e);
2483
2494
  }, testId: "markdown-explorer-save-grant" });
2484
- }, Gl = (e) => {
2485
- const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r);
2495
+ }, Xl = (e) => {
2496
+ const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = te(t.subscribe, n, r);
2486
2497
  return de(o)?.document.kind === "markdown";
2487
- }, Kl = (e) => {
2498
+ }, Yl = (e) => {
2488
2499
  const { config: t } = D(), n = $e(), r = P(() => n(ge(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
2489
2500
  return U(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
2490
- }, Wl = /* @__PURE__ */ new Set(), Xl = (e, t) => {
2491
- const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = ee(n.subscribe, l, i), v = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, v, v), [u] = I(() => /* @__PURE__ */ new Set()), [g, m] = I(Wl), [k, O] = I(null);
2501
+ }, Jl = /* @__PURE__ */ new Set(), Ql = (e, t) => {
2502
+ const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = te(n.subscribe, l, i), v = P(() => n.answerStampOf(e), [n, e]), f = te(n.subscribe, v, v), [u] = I(() => /* @__PURE__ */ new Set()), [g, m] = I(Jl), [k, O] = I(null);
2492
2503
  k !== null && k.path !== e && O(null);
2493
2504
  const E = B(null);
2494
2505
  V(() => (E.current = e, () => {
@@ -2497,7 +2508,7 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2497
2508
  const T = P(() => {
2498
2509
  const s = e, a = n.peek(s);
2499
2510
  if (u.has(s) || a?.status === "pending") return;
2500
- const h = t && !un(a);
2511
+ const h = t && !mn(a);
2501
2512
  u.add(s), m(new Set(u)), O(null), (async () => {
2502
2513
  try {
2503
2514
  const w = await n.refresh(s);
@@ -2515,12 +2526,12 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2515
2526
  })();
2516
2527
  }, [e, t, u, n, r, o]), x = g.has(e), M = k !== null && k.path === e && k.stamp === f ? k.failure : null;
2517
2528
  return { refreshing: x, unavailable: x || d?.status === "pending", failure: M, refresh: T };
2518
- }, Yl = Object.freeze({ kind: "page" }), Jl = ({ path: e, placement: t, markup: n }) => {
2519
- const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = Xl(e, t.kind === "page"), v = Gl(e), f = jl(e), u = rn(e), g = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, m = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, k = t.kind === "panel", O = t.kind === "panel" ? t.documentName : f.name, E = t.kind === "page" || t.maximized;
2529
+ }, ei = Object.freeze({ kind: "page" }), ti = ({ path: e, placement: t, markup: n }) => {
2530
+ const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = Ql(e, t.kind === "page"), v = Xl(e), f = Ul(e), u = ln(e), g = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, m = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, k = t.kind === "panel", O = t.kind === "panel" ? t.documentName : f.name, E = t.kind === "page" || t.maximized;
2520
2531
  return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": u === void 0 ? void 0 : "true", children: [
2521
2532
  /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
2522
- u === void 0 ? null : /* @__PURE__ */ c(Ul, { session: u }),
2523
- u === void 0 ? null : /* @__PURE__ */ c(Zl, { path: e, documentName: O, iconOnly: k, session: u, previewAvailable: E }),
2533
+ u === void 0 ? null : /* @__PURE__ */ c(Gl, { session: u }),
2534
+ u === void 0 ? null : /* @__PURE__ */ c(Kl, { path: e, documentName: O, iconOnly: k, session: u, previewAvailable: E }),
2524
2535
  u === void 0 && v ? /* @__PURE__ */ F(
2525
2536
  "button",
2526
2537
  {
@@ -2533,12 +2544,12 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2533
2544
  onClick: n.toggle,
2534
2545
  onDoubleClick: se,
2535
2546
  children: [
2536
- /* @__PURE__ */ c(Tl, { "aria-hidden": "true" }),
2547
+ /* @__PURE__ */ c(Al, { "aria-hidden": "true" }),
2537
2548
  m === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
2538
2549
  ]
2539
2550
  }
2540
2551
  ) : null,
2541
- u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ c(Hl, { path: e, documentName: O, iconOnly: k }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(zl, { href: f.edit.href, documentName: O, iconOnly: k }) : null,
2552
+ u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ c(Zl, { path: e, documentName: O, iconOnly: k }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(Vl, { href: f.edit.href, documentName: O, iconOnly: k }) : null,
2542
2553
  u === void 0 ? /* @__PURE__ */ F(
2543
2554
  "button",
2544
2555
  {
@@ -2553,27 +2564,27 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2553
2564
  onClick: d,
2554
2565
  onDoubleClick: se,
2555
2566
  children: [
2556
- /* @__PURE__ */ c(xl, { "aria-hidden": "true" }),
2567
+ /* @__PURE__ */ c(Cl, { "aria-hidden": "true" }),
2557
2568
  g === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
2558
2569
  ]
2559
2570
  }
2560
2571
  ) : null
2561
2572
  ] }),
2562
2573
  u !== void 0 || i === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": i.reason, children: r.documentRefreshFailed(ae(r, i.reason)) }),
2563
- u === void 0 ? null : /* @__PURE__ */ c(Vl, { path: e, session: u })
2574
+ u === void 0 ? null : /* @__PURE__ */ c(Wl, { path: e, session: u })
2564
2575
  ] });
2565
- }, Ql = ({ location: e }) => {
2566
- const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Kl(e);
2576
+ }, ni = ({ location: e }) => {
2577
+ const t = e.doc, n = U(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Yl(e);
2567
2578
  return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", children: [
2568
- /* @__PURE__ */ c(Jl, { path: t, placement: Yl, markup: r }),
2569
- /* @__PURE__ */ c(kl, { path: t, markup: e.markup, variant: n })
2579
+ /* @__PURE__ */ c(ti, { path: t, placement: ei, markup: r }),
2580
+ /* @__PURE__ */ c(Rl, { path: t, markup: e.markup, variant: n })
2570
2581
  ] });
2571
- }, ei = ({ holds: e, testId: t }) => {
2582
+ }, ri = ({ holds: e, testId: t }) => {
2572
2583
  const { labels: n, announcer: r } = D(), o = Oe();
2573
2584
  V(() => e ? r.claim(o) : void 0, [e, r, o]);
2574
- const l = P(() => r.shownIn(o), [r, o]), i = ee(r.subscribe, l, l);
2585
+ const l = P(() => r.shownIn(o), [r, o]), i = te(r.subscribe, l, l);
2575
2586
  return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: i.length > 1 ? n.announcementSequence(i) : i[0] });
2576
- }, ue = Object.freeze([]), ti = (e) => {
2587
+ }, ue = Object.freeze([]), oi = (e) => {
2577
2588
  const t = /* @__PURE__ */ new Set();
2578
2589
  let n = ue, r = [], o = !1;
2579
2590
  const l = [], i = (u) => {
@@ -2608,13 +2619,13 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2608
2619
  },
2609
2620
  shownIn: (u) => d() === u ? n : ue
2610
2621
  };
2611
- }, he = Object.freeze({ status: "cancelled" }), ni = (e) => {
2622
+ }, he = Object.freeze({ status: "cancelled" }), li = (e) => {
2612
2623
  if (e === null || typeof e != "object") return null;
2613
2624
  const { failure: t } = e;
2614
- if (Zn(t) !== null) return null;
2625
+ if (Gn(t) !== null) return null;
2615
2626
  const { reason: n, code: r } = t;
2616
- return Vn(n, r);
2617
- }, ri = ({ dataPath: e, onScope: t, fetch: n }) => {
2627
+ return Kn(n, r);
2628
+ }, ii = ({ dataPath: e, onScope: t, fetch: n }) => {
2618
2629
  const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u, g, m) => {
2619
2630
  let k;
2620
2631
  try {
@@ -2623,13 +2634,13 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2623
2634
  return m({ reason: "failed" });
2624
2635
  }
2625
2636
  k.status === 401 && t(null);
2626
- const O = k.headers.get(In);
2637
+ const O = k.headers.get(Hn);
2627
2638
  O !== null && t(O);
2628
2639
  let E;
2629
2640
  try {
2630
2641
  E = await k.json();
2631
2642
  } catch {
2632
- return m({ reason: mt(k.status) });
2643
+ return m({ reason: ht(k.status) });
2633
2644
  }
2634
2645
  let T;
2635
2646
  try {
@@ -2638,39 +2649,39 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2638
2649
  T = !1;
2639
2650
  }
2640
2651
  if (T) return E;
2641
- const x = ni(E);
2642
- return m(x !== null ? x : { reason: k.status === 200 ? "failed" : mt(k.status) });
2643
- }, i = { [gt]: Gn }, d = { [gt]: Jn, "Content-Type": `${Yn}; charset=utf-8` }, v = async (f, u, g) => {
2652
+ const x = li(E);
2653
+ return m(x !== null ? x : { reason: k.status === 200 ? "failed" : ht(k.status) });
2654
+ }, i = { [pt]: Wn }, d = { [pt]: er, "Content-Type": `${Qn}; charset=utf-8` }, v = async (f, u, g) => {
2644
2655
  const m = await l(f, u, g, (k) => He(k.reason, k.code));
2645
2656
  return u.signal.aborted ? he : m;
2646
2657
  };
2647
2658
  return {
2648
- tree: (f) => l(o("tree", { [Y.source]: f }), { method: "GET" }, ht, (u) => ({ status: "error", failure: u })),
2659
+ tree: (f) => l(o("tree", { [Y.source]: f }), { method: "GET" }, gt, (u) => ({ status: "error", failure: u })),
2649
2660
  children: async (f, u, g) => {
2650
- const m = await l(o("children", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: g }, Un, (k) => ({ status: "error", failure: k }));
2661
+ const m = await l(o("children", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: g }, Vn, (k) => ({ status: "error", failure: k }));
2651
2662
  return g.aborted ? he : m;
2652
2663
  },
2653
2664
  ancestors: async (f, u, g) => {
2654
- const m = await l(o("ancestors", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: g }, zn, (k) => ({ status: "error", failure: k }));
2665
+ const m = await l(o("ancestors", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: g }, Zn, (k) => ({ status: "error", failure: k }));
2655
2666
  return g.aborted ? he : m;
2656
2667
  },
2657
2668
  reveal: async (f, u, g) => {
2658
- const m = await l(o("reveal", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: g }, Hn, (k) => ({ status: "error", failure: k }));
2669
+ const m = await l(o("reveal", { [Y.source]: f, [Y.path]: u }), { method: "GET", signal: g }, Un, (k) => ({ status: "error", failure: k }));
2659
2670
  return g.aborted ? he : m;
2660
2671
  },
2661
- document: (f, { refresh: u }) => l(o("document", { [Y.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" }, tr, (g) => He(g.reason, g.code)),
2672
+ document: (f, { refresh: u }) => l(o("document", { [Y.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" }, rr, (g) => He(g.reason, g.code)),
2662
2673
  text: async (f, u) => {
2663
- const g = await l(o("text", { [Y.path]: f }), { method: "GET", signal: u }, jn, (m) => He(m.reason, m.code));
2674
+ const g = await l(o("text", { [Y.path]: f }), { method: "GET", signal: u }, zn, (m) => He(m.reason, m.code));
2664
2675
  return u.aborted ? he : g;
2665
2676
  },
2666
- edit: (f, u) => v(o("edit", { [Y.path]: f }), { method: "GET", signal: u }, er),
2667
- save: (f, u, g, m) => v(o("save", { [Y.path]: f, [Y.base]: u }), { method: "POST", headers: d, body: g, signal: m }, Qn),
2668
- preview: (f, u, g) => v(o("preview", { [Y.path]: f }), { method: "POST", headers: d, body: u, signal: g }, Xn),
2669
- revisions: (f, u) => v(o("revisions", { [Y.path]: f }), { method: "GET", signal: u }, Wn),
2670
- revision: (f, u, g) => v(o("revision", { [Y.path]: f, [Y.revision]: u }), { method: "GET", signal: g }, Kn),
2671
- refresh: (f) => l(o("refresh", { [Y.source]: f }), { method: "POST", headers: i }, ht, (u) => ({ status: "error", failure: u }))
2677
+ edit: (f, u) => v(o("edit", { [Y.path]: f }), { method: "GET", signal: u }, nr),
2678
+ save: (f, u, g, m) => v(o("save", { [Y.path]: f, [Y.base]: u }), { method: "POST", headers: d, body: g, signal: m }, tr),
2679
+ preview: (f, u, g) => v(o("preview", { [Y.path]: f }), { method: "POST", headers: d, body: u, signal: g }, Jn),
2680
+ revisions: (f, u) => v(o("revisions", { [Y.path]: f }), { method: "GET", signal: u }, Yn),
2681
+ revision: (f, u, g) => v(o("revision", { [Y.path]: f, [Y.revision]: u }), { method: "GET", signal: g }, Xn),
2682
+ refresh: (f) => l(o("refresh", { [Y.source]: f }), { method: "POST", headers: i }, gt, (u) => ({ status: "error", failure: u }))
2672
2683
  };
2673
- }, oi = () => {
2684
+ }, si = () => {
2674
2685
  let e = null, t = null;
2675
2686
  return {
2676
2687
  settle: (n) => {
@@ -2685,20 +2696,20 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2685
2696
  return t = null, o;
2686
2697
  }
2687
2698
  };
2688
- }, li = (e) => {
2689
- const t = Wt(e);
2690
- if (t === null) return ft;
2699
+ }, ai = (e) => {
2700
+ const t = Yt(e);
2701
+ if (t === null) return mt;
2691
2702
  try {
2692
- return Fn(JSON.parse(t));
2703
+ return _n(JSON.parse(t));
2693
2704
  } catch (n) {
2694
- return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), ft;
2705
+ return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), mt;
2695
2706
  }
2696
- }, Ft = (e, t) => {
2707
+ }, _t = (e, t) => {
2697
2708
  let n = null;
2698
2709
  const r = () => {
2699
2710
  if (n === null) {
2700
- const l = li(e);
2701
- n = { changes: l, settings: ut(t, l) };
2711
+ const l = ai(e);
2712
+ n = { changes: l, settings: ft(t, l) };
2702
2713
  }
2703
2714
  return n;
2704
2715
  }, o = ye();
@@ -2709,12 +2720,12 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2709
2720
  getServerSnapshot: () => t,
2710
2721
  subscribe: o.subscribe,
2711
2722
  advance: (l) => {
2712
- const { changes: i, settings: d } = r(), v = Dn(i, l, $n(d, l)[l], t);
2713
- return n = { changes: v, settings: ut(t, v) }, o.emit(), Kt(e, Pn(v)), n.settings;
2723
+ const { changes: i, settings: d } = r(), v = Pn(i, l, Fn(d, l)[l], t);
2724
+ return n = { changes: v, settings: ft(t, v) }, o.emit(), Xt(e, qn(v)), n.settings;
2714
2725
  }
2715
2726
  };
2716
- }, ii = Object.freeze({ status: "refreshed" }), si = Object.freeze({ status: "superseded" }), Qe = Object.freeze({ status: "deferred" }), ai = dn(Qe), Sn = 4, ci = Sn - 1, qt = Object.freeze({ status: "loading" }), di = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), ui = (e) => {
2717
- const t = /* @__PURE__ */ new Map(), n = cn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = ye(), v = /* @__PURE__ */ new Set();
2727
+ }, ci = Object.freeze({ status: "refreshed" }), di = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), ui = fn(et), Rn = 4, fi = Rn - 1, Bt = Object.freeze({ status: "loading" }), mi = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), hi = (e) => {
2728
+ const t = /* @__PURE__ */ new Map(), n = un(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = ye(), v = /* @__PURE__ */ new Set();
2718
2729
  let f = 0, u = 0;
2719
2730
  const g = { direct: null, bulk: null }, m = /* @__PURE__ */ new Set();
2720
2731
  let k = !1, O = 0;
@@ -2768,16 +2779,16 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2768
2779
  const A = { controller: new AbortController(), lane: C };
2769
2780
  x(p).inFlight.set(b, A), f += 1, C === "bulk" && (u += 1), e.children(p, b, A.controller.signal).then(
2770
2781
  (_) => L(p, b, A, _),
2771
- () => L(p, b, A, di)
2782
+ () => L(p, b, A, mi)
2772
2783
  );
2773
2784
  }, N = () => {
2774
- for (; f < Sn; ) {
2785
+ for (; f < Rn; ) {
2775
2786
  const p = S("direct");
2776
2787
  if (p !== null) {
2777
2788
  R(p.sourceId, p.path, "direct");
2778
2789
  continue;
2779
2790
  }
2780
- const b = u < ci ? S("bulk") : null;
2791
+ const b = u < fi ? S("bulk") : null;
2781
2792
  if (b === null) return;
2782
2793
  R(b.sourceId, b.path, "bulk");
2783
2794
  }
@@ -2800,11 +2811,11 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2800
2811
  m.clear(), p && (E(), N());
2801
2812
  }, J = (p, b) => {
2802
2813
  t.set(p, h(be(e.tree(p)), b));
2803
- }, X = (p, b, C) => {
2814
+ }, ee = (p, b, C) => {
2804
2815
  a(p);
2805
- const A = h(dn(b), C);
2816
+ const A = h(fn(b), C);
2806
2817
  return t.set(p, A), r.delete(p), E(), N(), A;
2807
- }, ne = (p, b, C, A) => {
2818
+ }, X = (p, b, C, A) => {
2808
2819
  if (C !== T(p) || t.get(p) !== b) return;
2809
2820
  const _ = xe(b.promise);
2810
2821
  if (!(A.status !== "ok" || _?.status !== "ok" || b.loadedAt === null || A.loadedAt <= b.loadedAt)) {
@@ -2812,7 +2823,7 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2812
2823
  b.loadedAt = A.loadedAt;
2813
2824
  return;
2814
2825
  }
2815
- X(p, A, b.opened);
2826
+ ee(p, A, b.opened);
2816
2827
  }
2817
2828
  }, $ = (p, b) => {
2818
2829
  const C = t.get(p);
@@ -2820,10 +2831,10 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2820
2831
  }, G = (p, b) => {
2821
2832
  b.stale = !1;
2822
2833
  const C = T(p);
2823
- e.tree(p).then((A) => ne(p, b, C, A));
2834
+ e.tree(p).then((A) => X(p, b, C, A));
2824
2835
  };
2825
2836
  return {
2826
- read: (p) => t.get(p)?.promise ?? ai,
2837
+ read: (p) => t.get(p)?.promise ?? ui,
2827
2838
  open: (p) => {
2828
2839
  const b = n.resumes(p), C = n.hold(p), A = t.get(p);
2829
2840
  return A === void 0 || $(p, "deferred") ? (J(p, !0), E()) : b || (A.opened && $(p, "error") ? (J(p, !0), E()) : (A.opened = !0, A.stale && $(p, "ok") && G(p, A))), C;
@@ -2833,12 +2844,12 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2833
2844
  },
2834
2845
  seed: (p, b) => {
2835
2846
  const C = b.then(
2836
- (j) => j === null ? Qe : j,
2837
- () => Qe
2847
+ (j) => j === null ? et : j,
2848
+ () => et
2838
2849
  ), A = t.get(p);
2839
2850
  if (A !== void 0 && $(p, "ok")) {
2840
2851
  const j = T(p);
2841
- C.then((Z) => ne(p, A, j, Z));
2852
+ C.then((Z) => X(p, A, j, Z));
2842
2853
  return;
2843
2854
  }
2844
2855
  a(p);
@@ -2851,26 +2862,26 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2851
2862
  const b = (l.get(p) ?? 0) + 1;
2852
2863
  l.set(p, b);
2853
2864
  const C = await e.refresh(p);
2854
- if (l.get(p) !== b) return si;
2865
+ if (l.get(p) !== b) return di;
2855
2866
  if (C.status === "error") return { status: "failed", failure: C.failure };
2856
2867
  const A = t.get(p);
2857
2868
  if (!(A !== void 0 && A.loadedAt !== null && $(p, "ok") && A.loadedAt > C.loadedAt)) {
2858
- const j = X(p, C, !0);
2869
+ const j = ee(p, C, !0);
2859
2870
  if (A !== void 0 && A.promise.status === "pending") {
2860
2871
  const Z = T(p);
2861
- A.promise.then((H) => ne(p, j, Z, H));
2872
+ A.promise.then((H) => X(p, j, Z, H));
2862
2873
  }
2863
2874
  }
2864
2875
  for (const [j, Z] of t)
2865
2876
  j !== p && xe(Z.promise)?.status === "ok" && (Z.stale = !0);
2866
- return ii;
2877
+ return ci;
2867
2878
  },
2868
2879
  children: (p, b) => r.get(p)?.get(b),
2869
2880
  claimChildren: (p, b) => {
2870
2881
  const C = x(p), A = w(p);
2871
2882
  let _ = !1, j = !1;
2872
2883
  for (const [H, le] of b)
2873
- C.claims.set(H, (C.claims.get(H) ?? 0) + 1), A.get(H) === void 0 ? (A.set(H, qt), C[le].add(H), _ = !0, j = !0) : le === "direct" && C.bulk.delete(H) && (C.direct.add(H), j = !0);
2884
+ C.claims.set(H, (C.claims.get(H) ?? 0) + 1), A.get(H) === void 0 ? (A.set(H, Bt), C[le].add(H), _ = !0, j = !0) : le === "direct" && C.bulk.delete(H) && (C.direct.add(H), j = !0);
2874
2885
  _ && E(), j && N();
2875
2886
  let Z = !1;
2876
2887
  return () => {
@@ -2889,7 +2900,7 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2889
2900
  if (C === void 0 || C.get(b)?.status !== "failed") return;
2890
2901
  const A = x(p);
2891
2902
  if ((A.claims.get(b) ?? 0) > 0) {
2892
- C.set(b, qt), A.direct.add(b), E(), N();
2903
+ C.set(b, Bt), A.direct.add(b), E(), N();
2893
2904
  return;
2894
2905
  }
2895
2906
  C.delete(b), E();
@@ -2909,7 +2920,7 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2909
2920
  subscribe: d.subscribe,
2910
2921
  version: () => O
2911
2922
  };
2912
- }, fi = (e, t) => {
2923
+ }, gi = (e, t) => {
2913
2924
  let n = e;
2914
2925
  const r = ye();
2915
2926
  return {
@@ -2919,64 +2930,64 @@ const _l = /* @__PURE__ */ y.forwardRef(ql), Bl = ({ href: e, onRetry: t, testId
2919
2930
  n = { ...n, ...o }, t(n), r.emit();
2920
2931
  }
2921
2932
  };
2922
- }, mi = 1;
2933
+ }, pi = 1;
2923
2934
  let Re = 0, ce = null;
2924
- const hi = () => {
2935
+ const vi = () => {
2925
2936
  const { documentElement: e, body: t } = document;
2926
2937
  Re === 0 && (ce = { 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"), Re += 1;
2927
2938
  let n = !1;
2928
2939
  return () => {
2929
2940
  n || (n = !0, Re -= 1, !(Re > 0 || ce === null) && (e.style.overflow = ce.htmlOverflow, t.style.overflow = ce.bodyOverflow, e.style.scrollbarGutter = ce.htmlGutter, t.style.scrollbarGutter = ce.bodyGutter, ce = null));
2930
2941
  };
2931
- }, gi = [
2942
+ }, wi = [
2932
2943
  { selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
2933
2944
  { selector: "[data-aqmx-explorer-body]", name: "tree area" }
2934
- ], _t = 1, Bt = (e) => e.getClientRects().length > 0, Ge = "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.", pi = (e) => {
2935
- if (!Bt(e)) return null;
2945
+ ], It = 1, jt = (e) => e.getClientRects().length > 0, Ke = "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.", bi = (e) => {
2946
+ if (!jt(e)) return null;
2936
2947
  const t = e.getBoundingClientRect(), n = window.innerHeight;
2937
- if (t.bottom > n + mi)
2938
- 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. ${Ge}`;
2939
- if (t.height < _t)
2940
- 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. ${Ge}`;
2941
- for (const { selector: r, name: o } of gi)
2948
+ if (t.bottom > n + pi)
2949
+ 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. ${Ke}`;
2950
+ if (t.height < It)
2951
+ 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. ${Ke}`;
2952
+ for (const { selector: r, name: o } of wi)
2942
2953
  for (const l of e.querySelectorAll(r)) {
2943
- if (!Bt(l)) continue;
2954
+ if (!jt(l)) continue;
2944
2955
  const i = l.getBoundingClientRect().height;
2945
- if (i < _t)
2946
- return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(i))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ge}`;
2956
+ if (i < It)
2957
+ return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(i))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
2947
2958
  }
2948
2959
  return null;
2949
- }, vi = (e) => {
2960
+ }, Ei = (e) => {
2950
2961
  let t = !1;
2951
2962
  const n = () => {
2952
2963
  if (t) return;
2953
- const o = pi(e);
2964
+ const o = bi(e);
2954
2965
  o !== null && (t = !0, console.error(o));
2955
2966
  }, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(n);
2956
2967
  return r?.observe(e), window.addEventListener("resize", n), n(), () => {
2957
2968
  r?.disconnect(), window.removeEventListener("resize", n);
2958
2969
  };
2959
- }, wi = (e, t) => {
2960
- oe(() => e ? hi() : void 0, [e]), oe(() => {
2970
+ }, yi = (e, t) => {
2971
+ oe(() => e ? vi() : void 0, [e]), oe(() => {
2961
2972
  const n = t.current;
2962
2973
  if (!(!e || n === null))
2963
- return vi(n);
2974
+ return Ei(n);
2964
2975
  }, [e, t]);
2965
- }, It = '[data-testid="markdown-explorer-view-switch"]', bi = [
2966
- { control: It, successors: [It, '[data-testid="markdown-explorer-sheet-toggle"]'] },
2976
+ }, Ht = '[data-testid="markdown-explorer-view-switch"]', ki = [
2977
+ { control: Ht, successors: [Ht, '[data-testid="markdown-explorer-sheet-toggle"]'] },
2967
2978
  { control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
2968
- ], Ei = (e) => {
2969
- for (const t of bi) {
2979
+ ], Si = (e) => {
2980
+ for (const t of ki) {
2970
2981
  const n = e.closest(t.control);
2971
2982
  if (n !== null) return { element: n, control: t };
2972
2983
  }
2973
2984
  return null;
2974
- }, yi = (e, t) => {
2985
+ }, xi = (e, t) => {
2975
2986
  const n = B(null);
2976
2987
  oe(() => {
2977
2988
  const o = (d) => {
2978
2989
  const v = e.current;
2979
- n.current = v !== null && d instanceof Element && v.contains(d) ? Ei(d) : null;
2990
+ n.current = v !== null && d instanceof Element && v.contains(d) ? Si(d) : null;
2980
2991
  }, l = (d) => o(d.target);
2981
2992
  o(document.activeElement);
2982
2993
  const i = (d) => {
@@ -3014,52 +3025,52 @@ const hi = () => {
3014
3025
  });
3015
3026
  return d.observe(i, { childList: !0, subtree: !0 }), () => d.disconnect();
3016
3027
  }, [t, e]);
3017
- }, ki = et(() => import("./TreeLayout-hn2bfU22.js").then((e) => ({ default: e.TreeLayout }))), Si = et(() => import("./MultiLayout-BD2LiwOe.js").then((e) => ({ default: e.MultiLayout }))), xi = 64, Ri = {
3028
+ }, Ri = tt(() => import("./TreeLayout-bk-Ziybl.js").then((e) => ({ default: e.TreeLayout }))), Ti = tt(() => import("./MultiLayout-DBpUTcCQ.js").then((e) => ({ default: e.MultiLayout }))), Ci = 64, Oi = {
3018
3029
  request: (e) => {
3019
3030
  requestAnimationFrame(e);
3020
3031
  }
3021
- }, jt = (e) => {
3032
+ }, zt = (e) => {
3022
3033
  e.documents.clear(), e.trees.clear();
3023
- }, Ke = (e, t) => {
3034
+ }, We = (e, t) => {
3024
3035
  t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
3025
3036
  for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
3026
- }, Ti = (e, t) => {
3027
- const [n, r] = I(() => ({ overrides: t, locale: e, labels: bt(e, t) }));
3028
- if (n.locale === e && hr(n.overrides, t)) return n.labels;
3029
- const o = { overrides: t, locale: e, labels: bt(e, t) };
3037
+ }, Ai = (e, t) => {
3038
+ const [n, r] = I(() => ({ overrides: t, locale: e, labels: Et(e, t) }));
3039
+ if (n.locale === e && pr(n.overrides, t)) return n.labels;
3040
+ const o = { overrides: t, locale: e, labels: Et(e, t) };
3030
3041
  return r(o), o.labels;
3031
- }, Ci = (e, t, n) => {
3032
- const [r, o] = I(() => ({ scope: t, store: Ft(e, n) }));
3042
+ }, Li = (e, t, n) => {
3043
+ const [r, o] = I(() => ({ scope: t, store: _t(e, n) }));
3033
3044
  if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
3034
- const l = { scope: t, store: Ft(e, n) };
3045
+ const l = { scope: t, store: _t(e, n) };
3035
3046
  return o(l), l.store;
3036
- }, We = (e, t) => {
3047
+ }, Xe = (e, t) => {
3037
3048
  const [n, r] = I(() => ({ scope: e, value: t() }));
3038
3049
  if (n.scope === e) return n.value;
3039
3050
  const o = { scope: e, value: t() };
3040
3051
  return r(o), o.value;
3041
- }, Oi = () => ti(Ri), Ht = "on", Ai = "off", Li = (e, t) => {
3052
+ }, Mi = () => oi(Oi), Ut = "on", Ni = "off", Di = (e, t) => {
3042
3053
  const n = de(e.peek(t));
3043
3054
  return n === null || n.document.kind === "failure" ? Ee(t) : n.document.name;
3044
- }, Ui = ({ data: e, config: t, storageNamespace: n, locale: r, labels: o, theme: l, renderFrame: i, renderTreeFailure: d, lockDocumentScroll: v = !1, onMathDiagnostics: f, onEditGrant: u }) => {
3045
- lr(n);
3046
- const g = Jt(r), m = gr(l), k = Ti(g, o), { revalidate: O } = Ln(), E = B(() => {
3055
+ }, Gi = ({ data: e, config: t, storageNamespace: n, locale: r, labels: o, theme: l, renderFrame: i, renderTreeFailure: d, lockDocumentScroll: v = !1, onMathDiagnostics: f, onEditGrant: u }) => {
3056
+ sr(n);
3057
+ const g = en(r), m = vr(l), k = Ai(g, o), { revalidate: O } = Nn(), E = B(() => {
3047
3058
  }), T = De(t.dataPath), [x] = I(() => {
3048
- const $ = ri({ dataPath: T, onScope: (p) => E.current(p) }), G = { documents: eo({ client: $, capacity: Math.max(xi, t.multiView.maxPanels * 2) }), trees: ui($) };
3049
- return Ke(G, e), vt(n, e.scope), { data: $, ...G, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
3059
+ const $ = ii({ dataPath: T, onScope: (p) => E.current(p) }), G = { documents: ro({ client: $, capacity: Math.max(Ci, t.multiView.maxPanels * 2) }), trees: hi($) };
3060
+ return We(G, e), wt(n, e.scope), { data: $, ...G, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
3050
3061
  });
3051
3062
  if (x.aligned.pageData !== e || x.aligned.storageNamespace !== n) {
3052
3063
  const $ = x.aligned.pageData;
3053
- x.aligned.pageData = e, x.aligned.storageNamespace = n, $ !== e && ($.scope !== e.scope ? x.aligned.pendingReader = e : Ke(x, e)), vt(n, e.scope);
3064
+ x.aligned.pageData = e, x.aligned.storageNamespace = n, $ !== e && ($.scope !== e.scope ? x.aligned.pendingReader = e : We(x, e)), wt(n, e.scope);
3054
3065
  }
3055
- const M = Ci(ze(n).treeSettings, e.scope, t.defaultTreeSettings);
3066
+ const M = Li(ze(n).treeSettings, e.scope, t.defaultTreeSettings);
3056
3067
  V(() => {
3057
3068
  const $ = x.aligned.pendingReader;
3058
- $ !== null && (x.aligned.pendingReader = null, jt(x), Ke(x, $));
3069
+ $ !== null && (x.aligned.pendingReader = null, zt(x), We(x, $));
3059
3070
  }, [e, x]), V(() => {
3060
3071
  let $ = !1;
3061
3072
  return E.current = (G) => {
3062
- G === e.scope || $ || ($ = !0, G !== null && (jt(x), ir(n)), O());
3073
+ G === e.scope || $ || ($ = !0, G !== null && (zt(x), ar(n)), O());
3063
3074
  }, () => {
3064
3075
  E.current = () => {
3065
3076
  };
@@ -3070,37 +3081,37 @@ const hi = () => {
3070
3081
  s.current = t.settingsCookie;
3071
3082
  }, [t.settingsCookie]);
3072
3083
  const [a] = I(
3073
- () => fi(e.settings, ($) => {
3074
- document.cookie = _n(s.current, $, window.location.protocol === "https:");
3084
+ () => gi(e.settings, ($) => {
3085
+ document.cookie = In(s.current, $, window.location.protocol === "https:");
3075
3086
  })
3076
- ), h = We(e.scope, Oi), w = We(e.scope, oi), S = B(k);
3087
+ ), h = Xe(e.scope, Mi), w = Xe(e.scope, si), S = B(k);
3077
3088
  V(() => {
3078
3089
  S.current = k;
3079
3090
  }, [k]);
3080
- const L = We(
3091
+ const L = Xe(
3081
3092
  e.scope,
3082
- () => Sr({
3093
+ () => Tr({
3083
3094
  data: x.data,
3084
3095
  conflictLabels: () => ({ ours: S.current.conflictOurs, theirs: S.current.conflictTheirs }),
3085
3096
  onSaveSettled: ($, G) => {
3086
3097
  G.kind === "saved" && x.documents.refresh($);
3087
- const p = vr(S.current, G, Li(x.documents, $));
3098
+ const p = br(S.current, G, Di(x.documents, $));
3088
3099
  p !== null && h.announce(p);
3089
3100
  },
3090
3101
  previewSetting: {
3091
- read: () => Wt(ze(n).editPreview) === Ht,
3092
- write: ($) => Kt(ze(n).editPreview, $ ? Ht : Ai)
3102
+ read: () => Yt(ze(n).editPreview) === Ut,
3103
+ write: ($) => Xt(ze(n).editPreview, $ ? Ut : Ni)
3093
3104
  }
3094
3105
  })
3095
3106
  ), R = U(() => be(e.notices.catch(() => [])), [e.notices]), N = e.sources.map(($) => $.id).join(`
3096
- `), q = U(() => qn(t, N.split(`
3107
+ `), q = U(() => Bn(t, N.split(`
3097
3108
  `)), [t, N]), W = B(f);
3098
3109
  V(() => {
3099
3110
  W.current = f;
3100
3111
  }, [f]);
3101
3112
  const [J] = I(() => ($, G) => {
3102
3113
  W.current?.($, G);
3103
- }), X = f === void 0 ? void 0 : J, ne = U(
3114
+ }), ee = f === void 0 ? void 0 : J, X = U(
3104
3115
  () => ({
3105
3116
  config: q,
3106
3117
  labels: k,
@@ -3120,69 +3131,69 @@ const hi = () => {
3120
3131
  edits: L,
3121
3132
  onEditGrant: u,
3122
3133
  renderTreeFailure: d,
3123
- reportMathDiagnostics: X
3134
+ reportMathDiagnostics: ee
3124
3135
  }),
3125
- [q, k, g, m, n, e.scope, e.sources, R, x, a, M, h, w, L, u, d, X]
3136
+ [q, k, g, m, n, e.scope, e.sources, R, x, a, M, h, w, L, u, d, ee]
3126
3137
  );
3127
- return /* @__PURE__ */ c(Qt, { value: ne, children: /* @__PURE__ */ c(Ni, { renderFrame: i, lockDocumentScroll: v }, e.scope) });
3128
- }, Mi = ({ ref: e, theme: t, view: n, children: r }) => {
3129
- const [o] = I(Lo);
3138
+ return /* @__PURE__ */ c(tn, { value: X, children: /* @__PURE__ */ c(Pi, { renderFrame: i, lockDocumentScroll: v }, e.scope) });
3139
+ }, $i = ({ ref: e, theme: t, view: n, children: r }) => {
3140
+ const [o] = I(Do);
3130
3141
  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 });
3131
- }, Ni = ({ renderFrame: e, lockDocumentScroll: t }) => {
3132
- const { theme: n, labels: r } = D(), o = tt(), { hash: l } = Ut(), i = $e(), d = B(null);
3133
- wi(t, d), V(() => {
3142
+ }, Pi = ({ renderFrame: e, lockDocumentScroll: t }) => {
3143
+ const { theme: n, labels: r } = D(), o = nt(), { hash: l } = Vt(), i = $e(), d = B(null);
3144
+ yi(t, d), V(() => {
3134
3145
  o.kind === "redirect" && i(`${o.href}${l}`, "browse");
3135
3146
  }, [o, l, i]);
3136
3147
  const { location: v } = o, f = v.view;
3137
- yi(d, f);
3138
- const u = v.view === "tree" ? /* @__PURE__ */ c(pe, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ c(ki, { location: v }) }) : v.view === "multi" ? /* @__PURE__ */ c(pe, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ c(Si, { location: v }) }) : /* @__PURE__ */ c(Ql, { location: v }), g = /* @__PURE__ */ F(Mi, { ref: d, theme: n, view: f, children: [
3148
+ xi(d, f);
3149
+ const u = v.view === "tree" ? /* @__PURE__ */ c(pe, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ c(Ri, { location: v }) }) : v.view === "multi" ? /* @__PURE__ */ c(pe, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ c(Ti, { location: v }) }) : /* @__PURE__ */ c(ni, { location: v }), g = /* @__PURE__ */ F($i, { ref: d, theme: n, view: f, children: [
3139
3150
  u,
3140
- /* @__PURE__ */ c(Ar, {}),
3141
- /* @__PURE__ */ c(ei, { holds: !0, testId: "markdown-explorer-announcer" })
3151
+ /* @__PURE__ */ c(Nr, {}),
3152
+ /* @__PURE__ */ c(ri, { holds: !0, testId: "markdown-explorer-announcer" })
3142
3153
  ] });
3143
3154
  return e === void 0 ? g : e({ view: f, children: g });
3144
- }, Zi = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
3155
+ }, Ki = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
3145
3156
  export {
3146
- Je as A,
3147
- Et as B,
3148
- wr as C,
3149
- Jl as D,
3150
- Bl as E,
3157
+ Qe as A,
3158
+ yt as B,
3159
+ Er as C,
3160
+ ti as D,
3161
+ Hl as E,
3151
3162
  ve as F,
3152
- Yt as G,
3153
- ar as H,
3154
- Do as I,
3155
- wt as J,
3156
- Ui as K,
3157
- Jr as L,
3158
- ur as M,
3159
- bt as N,
3160
- Zi as O,
3161
- Yl as P,
3163
+ Qt as G,
3164
+ dr as H,
3165
+ Fo as I,
3166
+ bt as J,
3167
+ Gi as K,
3168
+ to as L,
3169
+ mr as M,
3170
+ Et as N,
3171
+ Ki as O,
3172
+ ei as P,
3162
3173
  $e as a,
3163
- Kl as b,
3164
- kl as c,
3165
- br as d,
3166
- Er as e,
3167
- Hr as f,
3168
- yr as g,
3174
+ Yl as b,
3175
+ Rl as c,
3176
+ yr as d,
3177
+ kr as e,
3178
+ Zr as f,
3179
+ Sr as g,
3169
3180
  ae as h,
3170
- Vr as i,
3171
- Cr as j,
3172
- tn as k,
3173
- Gr as l,
3181
+ Wr as i,
3182
+ Lr as j,
3183
+ rn as k,
3184
+ Xr as l,
3174
3185
  ye as m,
3175
- zi as n,
3176
- sn as o,
3177
- Hi as p,
3178
- xl as q,
3179
- Wr as r,
3180
- Fl as s,
3181
- Kr as t,
3186
+ Vi as n,
3187
+ cn as o,
3188
+ Zi as p,
3189
+ Cl as q,
3190
+ Jr as r,
3191
+ Bl as s,
3192
+ Yr as t,
3182
3193
  D as u,
3183
- zr as v,
3184
- tt as w,
3185
- ei as x,
3194
+ Vr as v,
3195
+ nt as w,
3196
+ ri as x,
3186
3197
  Ae as y,
3187
- sr as z
3198
+ cr as z
3188
3199
  };