@aiquants/markdown-explorer 0.16.0 → 0.17.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,21 +1,21 @@
1
1
  import { jsxs as F, jsx as c, Fragment as Pe } from "react/jsx-runtime";
2
2
  import * as y from "react";
3
- import { createContext as pe, use as ne, useMemo as G, useSyncExternalStore as ee, useRef as _, useLayoutEffect as H, useCallback as P, useId as Se, useEffect as te, Component as tn, Suspense as ke, lazy as it, useState as I, useEffectEvent as le } from "react";
4
- import { useParams as _n, useSearchParams as Bn, matchPath as In, useBlocker as zn, useNavigate as jn, Link as Hn, useHref as $e, useLocation as nn, useRevalidator as Vn } from "react-router";
5
- import { j as Un, g as rn, z as Zn, E as on, a as ln, B as Gn, D as gt, G as Wn, H as be, e as ye, I as Kn, J as Xn, K as wt, L as Yn, M as bt, O as Jn, w as Qn, Q as er } from "./location-G7psbmv_.js";
6
- import { F as ae, i as tr, G as nr, y as J, x as rr, H as Et, z as Ve, I as or, J as ir, K as lr, L as sr, N as ar, f as cr, O as yt, v as dr, P as ur, Q as fr, R as mr, B as hr, w as pr, S as vr, T as gr, U as wr, u as xt } from "./dataRoute-CObbjNxG.js";
7
- import { HostedScrollArea as St, useMarkdownToolbarState as br, MarkdownViewer as sn } from "@aiquants/markdown";
8
- import { SOURCE_LINES_ATTRIBUTE as an, parseSourceLines as Er } from "@aiquants/markdown/source-lines";
3
+ import { createContext as pe, use as ne, useMemo as G, useSyncExternalStore as ee, useRef as _, useLayoutEffect as H, useCallback as P, useId as Se, useEffect as te, Component as tn, Suspense as ke, lazy as it, useState as B, useEffectEvent as le } from "react";
4
+ import { useParams as _n, useSearchParams as In, matchPath as Bn, useBlocker as zn, useNavigate as jn, Link as Hn, useHref as $e, useLocation as nn, useRevalidator as Vn } from "react-router";
5
+ import { j as Un, g as rn, z as Zn, E as on, a as ln, B as Gn, D as wt, G as Wn, H as be, e as ye, I as Kn, J as Xn, K as gt, L as Yn, M as bt, O as Jn, w as Qn, Q as er } from "./location-G7psbmv_.js";
6
+ import { F as se, i as tr, G as nr, y as J, x as rr, H as Et, z as Ve, I as or, J as ir, K as lr, L as ar, N as sr, f as cr, O as yt, v as dr, P as ur, Q as fr, R as mr, B as hr, w as pr, S as vr, T as wr, U as gr, u as xt } from "./dataRoute-CObbjNxG.js";
7
+ import { HostedScrollArea as St, useMarkdownToolbarState as br, MarkdownViewer as an } from "@aiquants/markdown";
8
+ import { SOURCE_LINES_ATTRIBUTE as sn, parseSourceLines as Er } from "@aiquants/markdown/source-lines";
9
9
  import { DEFAULT_CONTENT_ALIGN as yr } from "@aiquants/markdown/viewer-settings";
10
- import { w as Je, r as Qe, a as xr, b as kt, s as ge, c as Sr } from "./storage-CmGHg7OA.js";
10
+ import { w as Je, r as Qe, a as xr, b as kt, s as we, c as Sr } from "./storage-CmGHg7OA.js";
11
11
  import { createShouldRevalidate as kr } from "@aiquants/route-revalidation";
12
- const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
12
+ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
13
13
  panelMoved: Object.freeze(["title", "column", "position"]),
14
14
  panelMoveUnavailable: Object.freeze(["title", "move"]),
15
15
  panelDragStarted: Object.freeze(["title"]),
16
16
  panelDragCancelled: Object.freeze(["title"]),
17
17
  multiColumnRegion: Object.freeze(["column"])
18
- }), Or = /\{(\w+)\}/gu, cn = {
18
+ }), Mr = /\{(\w+)\}/gu, cn = {
19
19
  explorerRegion: "Explorer",
20
20
  sourceLabel: "Source",
21
21
  refreshTreeLabel: "Refresh tree",
@@ -221,15 +221,25 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
221
221
  viewerAlignCenter: "Align center",
222
222
  viewerAlignRight: "Align right",
223
223
  viewerMermaidInteractionMode: "Mouse interaction mode",
224
+ viewerMermaidInteractionModeTouch: "Touch interaction mode",
224
225
  viewerMermaidModeNone: "No interaction",
225
226
  viewerMermaidModeZoom: "Zoom only",
226
227
  viewerMermaidModePan: "Pan only (drag)",
227
228
  viewerMermaidModePanShift: "Pan only (Shift+drag)",
228
229
  viewerMermaidModeBoth: "Zoom and pan (drag)",
229
230
  viewerMermaidModeBothShift: "Zoom and pan (Shift+drag)",
231
+ viewerMermaidModeNoneTouch: "No interaction (a finger scrolls the page)",
232
+ viewerMermaidModeZoomTouch: "Zoom only (two fingers)",
233
+ viewerMermaidModePanTouch: "Pan only (one-finger drag while the diagram overflows)",
234
+ viewerMermaidModeBothTouch: "Zoom and pan (two fingers, one finger while the diagram overflows)",
230
235
  viewerMermaidZoomIn: "Zoom In",
231
236
  viewerMermaidZoomOut: "Zoom Out",
232
237
  viewerMermaidResetView: "Reset View",
238
+ viewerMermaidPanUp: "Pan Up",
239
+ viewerMermaidPanDown: "Pan Down",
240
+ viewerMermaidPanLeft: "Pan Left",
241
+ viewerMermaidPanRight: "Pan Right",
242
+ viewerMermaidDiagram: "Diagram (arrow keys pan, + and - zoom, 0 resets)",
233
243
  viewerMermaidRetry: "Try again",
234
244
  viewerEmbeddedVideo: "embedded video",
235
245
  viewerEmbeddedPost: "embedded post",
@@ -265,7 +275,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
265
275
  multiColumnEmpty: "This column is empty",
266
276
  multiColumnRegion: "Column {column}",
267
277
  panelDropHere: "Drop the panel here"
268
- }, Cr = {
278
+ }, Or = {
269
279
  explorerRegion: "エクスプローラー",
270
280
  sourceLabel: "ソース",
271
281
  refreshTreeLabel: "ツリーを更新",
@@ -471,15 +481,25 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
471
481
  viewerAlignCenter: "中央揃え",
472
482
  viewerAlignRight: "右揃え",
473
483
  viewerMermaidInteractionMode: "マウス操作モード",
484
+ viewerMermaidInteractionModeTouch: "タッチ操作モード",
474
485
  viewerMermaidModeNone: "操作なし",
475
486
  viewerMermaidModeZoom: "拡大縮小のみ",
476
487
  viewerMermaidModePan: "移動のみ (左ドラッグ)",
477
488
  viewerMermaidModePanShift: "移動のみ (Shift+ドラッグ)",
478
- viewerMermaidModeBoth: "拡大縮小+移動 (左ドラッグ)",
479
- viewerMermaidModeBothShift: "拡大縮小+移動 (Shift+ドラッグ)",
489
+ viewerMermaidModeBoth: "拡大縮小+移動 (左ドラッグ)",
490
+ viewerMermaidModeBothShift: "拡大縮小+移動 (Shift+ドラッグ)",
491
+ viewerMermaidModeNoneTouch: "操作なし (指はページをスクロール)",
492
+ viewerMermaidModeZoomTouch: "拡大縮小のみ (2 本指)",
493
+ viewerMermaidModePanTouch: "移動のみ (はみ出す図を 1 本指でドラッグ)",
494
+ viewerMermaidModeBothTouch: "拡大縮小+移動 (2 本指・はみ出す図は 1 本指)",
480
495
  viewerMermaidZoomIn: "拡大",
481
496
  viewerMermaidZoomOut: "縮小",
482
497
  viewerMermaidResetView: "表示を元に戻す",
498
+ viewerMermaidPanUp: "上へ移動",
499
+ viewerMermaidPanDown: "下へ移動",
500
+ viewerMermaidPanLeft: "左へ移動",
501
+ viewerMermaidPanRight: "右へ移動",
502
+ viewerMermaidDiagram: "図 (矢印キーで移動、+ と - で拡大縮小、0 で元に戻す)",
483
503
  viewerMermaidRetry: "再試行",
484
504
  viewerEmbeddedVideo: "埋め込みの動画",
485
505
  viewerEmbeddedPost: "埋め込みの投稿",
@@ -515,34 +535,34 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
515
535
  multiColumnEmpty: "この列は空です",
516
536
  multiColumnRegion: "{column} 列目",
517
537
  panelDropHere: "ここへパネルをドロップ"
518
- }, Ar = Object.freeze({
538
+ }, Cr = Object.freeze({
519
539
  en: Object.freeze(cn),
520
- ja: Object.freeze(Cr)
521
- }), dn = Object.freeze(Object.keys(cn)), Lr = new Set(dn), Mr = (e) => Lr.has(e), Ae = (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, un = (e) => {
522
- if (e === void 0) return Rr;
523
- if (Rt.includes(e)) return e;
524
- throw new RangeError(`[markdown-explorer] locale is the UI language (${Rt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Ae(e)}`);
525
- }, Tt = (e, t) => {
526
- const n = Ar[un(e)];
540
+ ja: Object.freeze(Or)
541
+ }), dn = Object.freeze(Object.keys(cn)), Lr = new Set(dn), Ar = (e) => Lr.has(e), Ce = (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, un = (e) => {
542
+ if (e === void 0) return Tr;
543
+ if (Tt.includes(e)) return e;
544
+ throw new RangeError(`[markdown-explorer] locale is the UI language (${Tt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Ce(e)}`);
545
+ }, Rt = (e, t) => {
546
+ const n = Cr[un(e)];
527
547
  if (t === void 0) return n;
528
548
  if (t === null || typeof t != "object")
529
- throw new RangeError(`[markdown-explorer] labels must be an object; got ${Ae(t)}`);
549
+ throw new RangeError(`[markdown-explorer] labels must be an object; got ${Ce(t)}`);
530
550
  if (!Un(t))
531
- throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Ae(t)}`);
551
+ throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Ce(t)}`);
532
552
  const r = t, o = { ...n };
533
553
  for (const i of Object.keys(r)) {
534
- if (!Mr(i))
554
+ if (!Ar(i))
535
555
  throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${dn.join(", ")}`);
536
556
  const l = r[i];
537
557
  if (l === void 0) continue;
538
558
  const u = typeof n[i];
539
559
  if (typeof l !== u)
540
- throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Ae(l)}`);
560
+ throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Ce(l)}`);
541
561
  if (typeof l == "string" && l.trim() === "")
542
562
  throw new RangeError(`[markdown-explorer] labels.${i} must be a non-blank string`);
543
- const m = Tr[i];
563
+ const m = Rr[i];
544
564
  if (typeof l == "string" && m !== void 0) {
545
- for (const [, f] of l.matchAll(Or))
565
+ for (const [, f] of l.matchAll(Mr))
546
566
  if (!m.includes(f ?? ""))
547
567
  throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((d) => `{${d}}`).join(", ")}`);
548
568
  }
@@ -554,19 +574,19 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
554
574
  if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
555
575
  const n = e, r = t, o = Object.keys(n), i = Object.keys(r);
556
576
  return o.length === i.length && i.every((l) => Object.hasOwn(n, l) && Object.is(n[l], r[l]));
557
- }, Ot = Object.freeze(["light", "dark"]), Dr = (e) => {
577
+ }, Mt = Object.freeze(["light", "dark"]), Dr = (e) => {
558
578
  if (e === void 0) return "light";
559
- if (Ot.includes(e)) return e;
560
- throw new RangeError(`[markdown-explorer] theme must be ${Ot.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
579
+ if (Mt.includes(e)) return e;
580
+ throw new RangeError(`[markdown-explorer] theme must be ${Mt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
561
581
  }, fn = pe(null), D = () => {
562
582
  const e = ne(fn);
563
583
  if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
564
584
  return e;
565
- }, Me = (e) => {
585
+ }, Ae = (e) => {
566
586
  const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
567
587
  return ee(t.subscribe, n, n);
568
588
  }, lt = () => {
569
- const { config: e } = D(), t = _n()["*"], [n] = Bn(), r = n.toString();
589
+ const { config: e } = D(), t = _n()["*"], [n] = In(), r = n.toString();
570
590
  return G(() => rn(e, t, new URLSearchParams(r)), [e, t, r]);
571
591
  }, mn = {
572
592
  unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
@@ -577,8 +597,8 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
577
597
  "too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
578
598
  unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
579
599
  failed: ["failureFailedTitle", "failureFailedBody"]
580
- }, se = (e, t) => e[mn[t][0]], me = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
581
- const { labels: o } = D(), i = se(o, e.reason), l = o[mn[e.reason][1]], u = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
600
+ }, ae = (e, t) => e[mn[t][0]], me = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
601
+ const { labels: o } = D(), i = ae(o, e.reason), l = o[mn[e.reason][1]], u = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
582
602
  return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": u, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
583
603
  /* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: i }),
584
604
  /* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: l }),
@@ -592,7 +612,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
592
612
  case "grant":
593
613
  return e.editGrantTitle;
594
614
  case "failed":
595
- return se(e, n.failure.reason);
615
+ return ae(e, n.failure.reason);
596
616
  }
597
617
  switch (r.kind) {
598
618
  case "draft":
@@ -604,7 +624,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
604
624
  case "grant":
605
625
  return e.editGrantTitle;
606
626
  case "failed":
607
- return e.draftSaveFailed(se(e, r.failure.reason));
627
+ return e.draftSaveFailed(ae(e, r.failure.reason));
608
628
  case "saved":
609
629
  if (!o) return r.merged ? e.draftSavedMerged : e.draftSaved;
610
630
  break;
@@ -621,12 +641,12 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
621
641
  case "grant":
622
642
  return e.editGrantTitle;
623
643
  case "failed":
624
- return e.draftSaveFailed(se(e, t.failure.reason));
644
+ return e.draftSaveFailed(ae(e, t.failure.reason));
625
645
  case "idle":
626
646
  case "saving":
627
647
  return null;
628
648
  }
629
- }, Oe = () => {
649
+ }, Me = () => {
630
650
  const e = /* @__PURE__ */ new Set();
631
651
  return {
632
652
  subscribe: (t) => (e.add(t), () => {
@@ -636,226 +656,226 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
636
656
  for (const t of [...e]) t();
637
657
  }
638
658
  };
639
- }, Fr = "<<<<<<<", qr = "=======", _r = ">>>>>>>", Ct = (e, t) => e === t || e.startsWith(`${t} `), At = (e) => Br(e.split(`
640
- `)), Br = (e) => {
659
+ }, Fr = "<<<<<<<", qr = "=======", _r = ">>>>>>>", Ot = (e, t) => e === t || e.startsWith(`${t} `), Ct = (e) => Ir(e.split(`
660
+ `)), Ir = (e) => {
641
661
  const t = [];
642
662
  let n = null, r = null, o = 0;
643
663
  for (const i of e) {
644
664
  o += 1;
645
665
  const l = i.charCodeAt(0);
646
- l !== 60 && l !== 61 && l !== 62 || (Ct(i, Fr) ? (n = o, r = null) : i === qr ? n !== null && r === null ? r = o : n = null : Ct(i, _r) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
666
+ l !== 60 && l !== 61 && l !== 62 || (Ot(i, Fr) ? (n = o, r = null) : i === qr ? n !== null && r === null ? r = o : n = null : Ot(i, _r) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
647
667
  }
648
668
  return t;
649
669
  }, Lt = (e) => e.includes(`\r
650
670
  `) ? `\r
651
671
  ` : `
652
672
  `, Ue = (e) => e.replace(/\r\n?/gu, `
653
- `), Ir = (e, t) => t === `
673
+ `), Br = (e, t) => t === `
654
674
  ` ? e : e.replaceAll(`
655
675
  `, `\r
656
676
  `), zr = 3, jr = /^\d+(?:\.\d+)?$/u, Hr = (e) => {
657
677
  if (e === null || !jr.test(e)) return null;
658
678
  const t = Number(e);
659
679
  return t >= ln && t <= on ? t : null;
660
- }, Ze = Object.freeze({ kind: "idle" }), Mt = Object.freeze({ kind: "draft" }), Vr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
661
- const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), d = Oe();
662
- let h = null, w = null, b = null;
663
- const O = (s, a) => {
664
- s.value = { ...s.value, ...a }, d.emit();
665
- }, T = (s, a) => i.get(s) === a, S = async (s, a) => {
666
- a.controller.abort(), a.controller = new AbortController();
667
- const { signal: g } = a.controller;
668
- O(a, { phase: { kind: "opening" } });
669
- const R = await e.edit(s, g);
670
- if (!T(s, a) || g.aborted || !("kind" in R)) return;
671
- if (R.kind === "grant") {
672
- O(a, { phase: { kind: "grant", href: R.href } });
680
+ }, Ze = Object.freeze({ kind: "idle" }), At = Object.freeze({ kind: "draft" }), Vr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
681
+ const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), d = Me();
682
+ let h = null, g = null, b = null;
683
+ const M = (a, s) => {
684
+ a.value = { ...a.value, ...s }, d.emit();
685
+ }, R = (a, s) => i.get(a) === s, S = async (a, s) => {
686
+ s.controller.abort(), s.controller = new AbortController();
687
+ const { signal: w } = s.controller;
688
+ M(s, { phase: { kind: "opening" } });
689
+ const T = await e.edit(a, w);
690
+ if (!R(a, s) || w.aborted || !("kind" in T)) return;
691
+ if (T.kind === "grant") {
692
+ M(s, { phase: { kind: "grant", href: T.href } });
673
693
  return;
674
694
  }
675
- if (R.kind === "failure") {
676
- O(a, { phase: { kind: "failed", failure: R.failure } });
695
+ if (T.kind === "failure") {
696
+ M(s, { phase: { kind: "failed", failure: T.failure } });
677
697
  return;
678
698
  }
679
- const A = Ue(R.text), N = R.kind === "draft";
680
- a.base = { text: A, version: N ? null : R.version }, a.draft = A, a.ending = Lt(R.text), O(a, { phase: { kind: "editing" }, history: N ? !1 : R.history, dirty: !1, save: N ? Mt : Ze, generation: a.value.generation + 1 });
681
- }, M = (s) => {
682
- const a = i.get(s);
683
- a !== void 0 && (a.controller.abort(), i.delete(s), u.delete(s));
684
- }, L = (s, a, g) => (s.set(a, g), () => {
685
- s.get(a) === g && s.delete(a);
686
- }), E = (s, a, g, R = {}) => {
687
- O(a, { ...R, save: g }), n(s, g);
688
- }, v = async (s) => {
689
- m.get(s)?.flush();
690
- const a = i.get(s);
691
- if (a === void 0 || a.value.phase.kind !== "editing" || a.base === null || a.value.save.kind === "saving") return;
692
- const { version: g } = a.base;
693
- if (g === null) {
694
- n(s, Mt);
699
+ const C = Ue(T.text), N = T.kind === "draft";
700
+ s.base = { text: C, version: N ? null : T.version }, s.draft = C, s.ending = Lt(T.text), M(s, { phase: { kind: "editing" }, history: N ? !1 : T.history, dirty: !1, save: N ? At : Ze, generation: s.value.generation + 1 });
701
+ }, A = (a) => {
702
+ const s = i.get(a);
703
+ s !== void 0 && (s.controller.abort(), i.delete(a), u.delete(a));
704
+ }, L = (a, s, w) => (a.set(s, w), () => {
705
+ a.get(s) === w && a.delete(s);
706
+ }), E = (a, s, w, T = {}) => {
707
+ M(s, { ...T, save: w }), n(a, w);
708
+ }, v = async (a) => {
709
+ m.get(a)?.flush();
710
+ const s = i.get(a);
711
+ if (s === void 0 || s.value.phase.kind !== "editing" || s.base === null || s.value.save.kind === "saving") return;
712
+ const { version: w } = s.base;
713
+ if (w === null) {
714
+ n(a, At);
695
715
  return;
696
716
  }
697
- const R = At(a.draft).length;
698
- if (R > 0) {
699
- E(s, a, { kind: "conflicts", count: R });
717
+ const T = Ct(s.draft).length;
718
+ if (T > 0) {
719
+ E(a, s, { kind: "conflicts", count: T });
700
720
  return;
701
721
  }
702
- a.controller.abort(), a.controller = new AbortController();
703
- const { signal: A } = a.controller;
704
- let N = { text: a.base.text, version: g }, q = a.draft, W = !1;
705
- O(a, { save: { kind: "saving" } });
722
+ s.controller.abort(), s.controller = new AbortController();
723
+ const { signal: C } = s.controller;
724
+ let N = { text: s.base.text, version: w }, q = s.draft, W = !1;
725
+ M(s, { save: { kind: "saving" } });
706
726
  for (let z = 0; z < zr; z += 1) {
707
- const j = await e.save(s, N.version, Ir(q, a.ending), A);
708
- if (!T(s, a) || A.aborted || !("kind" in j)) return;
727
+ const j = await e.save(a, N.version, Br(q, s.ending), C);
728
+ if (!R(a, s) || C.aborted || !("kind" in j)) return;
709
729
  if (j.kind === "saved") {
710
- m.get(s)?.flush(), a.base = { text: q, version: j.version }, E(s, a, { kind: "saved", merged: W }, { dirty: a.draft !== q });
730
+ m.get(a)?.flush(), s.base = { text: q, version: j.version }, E(a, s, { kind: "saved", merged: W }, { dirty: s.draft !== q });
711
731
  return;
712
732
  }
713
733
  if (j.kind === "grant") {
714
- E(s, a, { kind: "grant", href: j.href });
734
+ E(a, s, { kind: "grant", href: j.href });
715
735
  return;
716
736
  }
717
737
  if (j.kind === "failure") {
718
- E(s, a, { kind: "failed", failure: j.failure });
738
+ E(a, s, { kind: "failed", failure: j.failure });
719
739
  return;
720
740
  }
721
- const { mergeDraft: Y } = await import("./merge-BkFru0eg.js");
722
- if (!T(s, a) || A.aborted) return;
723
- const V = m.get(s);
741
+ const { mergeDraft: Y } = await import("./merge-CS3p9BVw.js");
742
+ if (!R(a, s) || C.aborted) return;
743
+ const V = m.get(a);
724
744
  V?.flush();
725
- const re = Ue(j.text), p = Y(N.text, a.draft, re, t());
726
- if (N = { text: re, version: j.version }, a.base = N, a.ending = Lt(j.text), a.draft = p.text, V?.adopt(p.text), p.kind === "conflicts") {
727
- E(s, a, { kind: "conflicts", count: p.conflicts }, { dirty: !0, generation: a.value.generation + 1 });
745
+ const re = Ue(j.text), p = Y(N.text, s.draft, re, t());
746
+ if (N = { text: re, version: j.version }, s.base = N, s.ending = Lt(j.text), s.draft = p.text, V?.adopt(p.text), p.kind === "conflicts") {
747
+ E(a, s, { kind: "conflicts", count: p.conflicts }, { dirty: !0, generation: s.value.generation + 1 });
728
748
  return;
729
749
  }
730
750
  if (W = !0, q = p.text, q === N.text) {
731
- E(s, a, { kind: "saved", merged: W }, { dirty: !1, generation: a.value.generation + 1 });
751
+ E(a, s, { kind: "saved", merged: W }, { dirty: !1, generation: s.value.generation + 1 });
732
752
  return;
733
753
  }
734
- O(a, { dirty: !0, generation: a.value.generation + 1 });
754
+ M(s, { dirty: !0, generation: s.value.generation + 1 });
735
755
  }
736
- E(s, a, { kind: "failed", failure: { reason: "failed" } });
756
+ E(a, s, { kind: "failed", failure: { reason: "failed" } });
737
757
  };
738
758
  return {
739
- session: (s) => i.get(s)?.value,
759
+ session: (a) => i.get(a)?.value,
740
760
  subscribe: d.subscribe,
741
- start: (s, a) => {
742
- const g = i.get(s);
743
- if (g !== void 0) {
744
- O(g, { request: { anchor: a }, view: "editor" }), (g.value.phase.kind === "failed" || g.value.phase.kind === "grant") && S(s, g);
761
+ start: (a, s) => {
762
+ const w = i.get(a);
763
+ if (w !== void 0) {
764
+ M(w, { request: { anchor: s }, view: "editor" }), (w.value.phase.kind === "failed" || w.value.phase.kind === "grant") && S(a, w);
745
765
  return;
746
766
  }
747
- l.delete(s);
748
- const R = {
749
- value: { path: s, phase: { kind: "opening" }, view: "editor", previewPrepared: !1, history: !1, dirty: !1, save: Ze, generation: 0, request: { anchor: a } },
767
+ l.delete(a);
768
+ const T = {
769
+ value: { path: a, phase: { kind: "opening" }, view: "editor", previewPrepared: !1, history: !1, dirty: !1, save: Ze, generation: 0, request: { anchor: s } },
750
770
  base: null,
751
771
  draft: "",
752
772
  ending: `
753
773
  `,
754
774
  controller: new AbortController()
755
775
  };
756
- i.set(s, R), S(s, R);
776
+ i.set(a, T), S(a, T);
757
777
  },
758
- retry: (s) => {
759
- const a = i.get(s);
760
- a === void 0 || a.value.phase.kind === "editing" || S(s, a);
778
+ retry: (a) => {
779
+ const s = i.get(a);
780
+ s === void 0 || s.value.phase.kind === "editing" || S(a, s);
761
781
  },
762
- draft: (s) => {
763
- const a = i.get(s);
764
- return a === void 0 || a.base === null ? null : a.draft;
782
+ draft: (a) => {
783
+ const s = i.get(a);
784
+ return s === void 0 || s.base === null ? null : s.draft;
765
785
  },
766
- setDraft: (s, a) => {
767
- const g = i.get(s);
768
- if (g === void 0 || g.base === null) return;
769
- g.draft = a;
770
- const R = {}, A = a !== g.base.text;
771
- A !== g.value.dirty && (R.dirty = A);
772
- const { save: N } = g.value;
786
+ setDraft: (a, s) => {
787
+ const w = i.get(a);
788
+ if (w === void 0 || w.base === null) return;
789
+ w.draft = s;
790
+ const T = {}, C = s !== w.base.text;
791
+ C !== w.value.dirty && (T.dirty = C);
792
+ const { save: N } = w.value;
773
793
  if (N.kind === "conflicts") {
774
- const q = At(a).length;
775
- q === 0 ? R.save = Ze : q !== N.count && (R.save = { kind: "conflicts", count: q });
794
+ const q = Ct(s).length;
795
+ q === 0 ? T.save = Ze : q !== N.count && (T.save = { kind: "conflicts", count: q });
776
796
  }
777
- (R.dirty !== void 0 || R.save !== void 0) && O(g, R);
797
+ (T.dirty !== void 0 || T.save !== void 0) && M(w, T);
778
798
  },
779
- consumeRequest: (s) => {
780
- const a = i.get(s);
781
- a !== void 0 && a.value.request !== null && O(a, { request: null });
799
+ consumeRequest: (a) => {
800
+ const s = i.get(a);
801
+ s !== void 0 && s.value.request !== null && M(s, { request: null });
782
802
  },
783
803
  save: v,
784
- replaceDraft: (s, a) => {
785
- const g = m.get(s);
786
- g?.flush();
787
- const R = i.get(s);
788
- if (R === void 0 || R.base === null) return;
789
- const A = Ue(a);
790
- R.draft = A, g?.adopt(A), O(R, { dirty: A !== R.base.text, generation: R.value.generation + 1 });
804
+ replaceDraft: (a, s) => {
805
+ const w = m.get(a);
806
+ w?.flush();
807
+ const T = i.get(a);
808
+ if (T === void 0 || T.base === null) return;
809
+ const C = Ue(s);
810
+ T.draft = C, w?.adopt(C), M(T, { dirty: C !== T.base.text, generation: T.value.generation + 1 });
791
811
  },
792
- close: (s) => {
793
- if (!i.has(s)) return;
794
- const a = m.get(s), g = a === void 0 ? null : a.returnPoint();
795
- M(s), g === null ? l.delete(s) : l.set(s, g), d.emit();
812
+ close: (a) => {
813
+ if (!i.has(a)) return;
814
+ const s = m.get(a), w = s === void 0 ? null : s.returnPoint();
815
+ A(a), w === null ? l.delete(a) : l.set(a, w), d.emit();
796
816
  },
797
- takeReturn: (s) => {
798
- const a = l.get(s) ?? null;
799
- return l.delete(s), a;
817
+ takeReturn: (a) => {
818
+ const s = l.get(a) ?? null;
819
+ return l.delete(a), s;
800
820
  },
801
- dirtyPaths: () => [...i.values()].filter((s) => s.value.dirty).map((s) => s.value.path),
802
- discard: (s) => {
803
- for (const a of s) M(a);
804
- s.length > 0 && d.emit();
821
+ dirtyPaths: () => [...i.values()].filter((a) => a.value.dirty).map((a) => a.value.path),
822
+ discard: (a) => {
823
+ for (const s of a) A(s);
824
+ a.length > 0 && d.emit();
805
825
  },
806
826
  editorState: {
807
- get: (s) => u.get(s),
808
- set: (s, a) => {
809
- i.has(s) && u.set(s, a);
827
+ get: (a) => u.get(a),
828
+ set: (a, s) => {
829
+ i.has(a) && u.set(a, s);
810
830
  }
811
831
  },
812
- bindEditor: (s, a) => L(m, s, a),
813
- bindView: (s, a) => L(f, s, a),
814
- viewAnchor: (s) => {
815
- const a = f.get(s);
816
- return a === void 0 ? null : a.anchor();
832
+ bindEditor: (a, s) => L(m, a, s),
833
+ bindView: (a, s) => L(f, a, s),
834
+ viewAnchor: (a) => {
835
+ const s = f.get(a);
836
+ return s === void 0 ? null : s.anchor();
817
837
  },
818
- flush: (s) => m.get(s)?.flush(),
838
+ flush: (a) => m.get(a)?.flush(),
819
839
  flushDrafts: () => {
820
- for (const s of m.values()) s.flush();
840
+ for (const a of m.values()) a.flush();
821
841
  },
822
- nextConflict: (s) => m.get(s)?.nextConflict() === !0,
842
+ nextConflict: (a) => m.get(a)?.nextConflict() === !0,
823
843
  hasSessions: () => i.size > 0,
824
- unsavedAmong: (s) => {
825
- for (const a of m.values()) a.flush();
826
- return s.filter((a) => i.get(a)?.value.dirty === !0);
844
+ unsavedAmong: (a) => {
845
+ for (const s of m.values()) s.flush();
846
+ return a.filter((s) => i.get(s)?.value.dirty === !0);
827
847
  },
828
- askToDiscard: (s) => new Promise((a) => {
848
+ askToDiscard: (a) => new Promise((s) => {
829
849
  b?.settle(!1);
830
- const g = {
831
- paths: s,
832
- settle: (R) => {
833
- if (b === g) {
834
- if (b = null, R) for (const A of s) M(A);
835
- d.emit(), a(R);
850
+ const w = {
851
+ paths: a,
852
+ settle: (T) => {
853
+ if (b === w) {
854
+ if (b = null, T) for (const C of a) A(C);
855
+ d.emit(), s(T);
836
856
  }
837
857
  }
838
858
  };
839
- b = g, d.emit();
859
+ b = w, d.emit();
840
860
  }),
841
861
  discardRequest: () => b,
842
862
  sideBySide: () => (h ??= r.read(), h),
843
- setSideBySide: (s) => {
844
- h !== s && (h = s, r.write(s), d.emit());
863
+ setSideBySide: (a) => {
864
+ h !== a && (h = a, r.write(a), d.emit());
845
865
  },
846
- editorShare: () => (w ??= o.read() ?? Zn, w),
847
- setEditorShare: (s) => {
848
- if (!Number.isFinite(s)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(s)}`);
849
- const a = Math.min(on, Math.max(ln, s));
850
- w !== a && (w = a, o.write(a));
866
+ editorShare: () => (g ??= o.read() ?? Zn, g),
867
+ setEditorShare: (a) => {
868
+ if (!Number.isFinite(a)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(a)}`);
869
+ const s = Math.min(on, Math.max(ln, a));
870
+ g !== s && (g = s, o.write(s));
851
871
  },
852
- setView: (s, a) => {
853
- const g = i.get(s);
854
- g === void 0 || g.value.view === a || (m.get(s)?.beforeView(a), O(g, { view: a, previewPrepared: g.value.previewPrepared || a === "preview" }));
872
+ setView: (a, s) => {
873
+ const w = i.get(a);
874
+ w === void 0 || w.value.view === s || (m.get(a)?.beforeView(s), M(w, { view: s, previewPrepared: w.value.previewPrepared || s === "preview" }));
855
875
  },
856
- preparePreview: (s) => {
857
- const a = i.get(s);
858
- a !== void 0 && !a.value.previewPrepared && O(a, { previewPrepared: !0 });
876
+ preparePreview: (a) => {
877
+ const s = i.get(a);
878
+ s !== void 0 && !s.value.previewPrepared && M(s, { previewPrepared: !0 });
859
879
  }
860
880
  };
861
881
  }, hn = (e) => {
@@ -885,15 +905,15 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
885
905
  const d = r.current;
886
906
  if (!e || d === null) return;
887
907
  const h = new ResizeObserver(() => b());
888
- let w = null;
908
+ let g = null;
889
909
  const b = () => {
890
- const T = Xr(d);
891
- T === null || T === w || (w !== null && h.unobserve(w), h.observe(T), w = T);
910
+ const R = Xr(d);
911
+ R === null || R === g || (g !== null && h.unobserve(g), h.observe(R), g = R);
892
912
  };
893
913
  b(), h.observe(d);
894
- const O = d.ownerDocument.defaultView;
895
- return O?.addEventListener("resize", b), d.ownerDocument.addEventListener("scroll", b, { capture: !0, passive: !0 }), () => {
896
- h.disconnect(), O?.removeEventListener("resize", b), d.ownerDocument.removeEventListener("scroll", b, { capture: !0 });
914
+ const M = d.ownerDocument.defaultView;
915
+ return M?.addEventListener("resize", b), d.ownerDocument.addEventListener("scroll", b, { capture: !0, passive: !0 }), () => {
916
+ h.disconnect(), M?.removeEventListener("resize", b), d.ownerDocument.removeEventListener("scroll", b, { capture: !0 });
897
917
  };
898
918
  }, [e]);
899
919
  const u = P(
@@ -910,9 +930,9 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
910
930
  i.current && n();
911
931
  }, [n]);
912
932
  return { ref: r, onKeyDown: u, onClick: m, onCancel: Yr, onClose: f };
913
- }, gn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel: l, testId: u }) => {
914
- const m = _(null), f = Se(), d = Se(), h = P(() => m.current?.focus(), []), w = vn({ open: e, onOpen: h, onDismiss: l });
915
- return /* @__PURE__ */ c("dialog", { ...w, className: "aqmx-confirm", "aria-labelledby": f, "aria-describedby": d, "data-testid": u, children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
933
+ }, wn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel: l, testId: u }) => {
934
+ const m = _(null), f = Se(), d = Se(), h = P(() => m.current?.focus(), []), g = vn({ open: e, onOpen: h, onDismiss: l });
935
+ return /* @__PURE__ */ c("dialog", { ...g, className: "aqmx-confirm", "aria-labelledby": f, "aria-describedby": d, "data-testid": u, children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
916
936
  /* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: t }),
917
937
  /* @__PURE__ */ c("p", { id: d, className: "aqmx-confirm-body", children: n }),
918
938
  /* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
@@ -920,7 +940,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
920
940
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${u}-confirm`, onClick: i, children: r })
921
941
  ] })
922
942
  ] }) });
923
- }, Re = (e) => {
943
+ }, Te = (e) => {
924
944
  const t = e;
925
945
  return t.status === void 0 && (t.status = "pending", e.then(
926
946
  (n) => {
@@ -930,7 +950,7 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
930
950
  t.status = "rejected", t.reason = n;
931
951
  }
932
952
  )), t;
933
- }, wn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ee = (e) => e.status === "fulfilled" ? e.value : void 0, Jr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), Qr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), eo = (e, t, n) => {
953
+ }, gn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ee = (e) => e.status === "fulfilled" ? e.value : void 0, Jr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), Qr = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), eo = (e, t, n) => {
934
954
  const r = /* @__PURE__ */ new Set(), o = [...e].reverse();
935
955
  for (let i = o.pop(); i !== void 0; i = o.pop()) {
936
956
  if (i.type !== "directory" || r.has(i.path)) continue;
@@ -945,14 +965,14 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
945
965
  if (r === void 0 || r.status === "deferred") return Jr;
946
966
  if (r.status === "error") return { readme: { status: "failed", failure: r.failure, retry: () => e.retry(t) }, claim: !1 };
947
967
  const o = eo(r.entries, n, (l) => e.children(t, l));
948
- if (o !== null) return { readme: { status: "ok", readme: gt(o) }, claim: !1 };
968
+ if (o !== null) return { readme: { status: "ok", readme: wt(o) }, claim: !1 };
949
969
  const i = e.children(t, n);
950
- return i === void 0 || i.status === "loading" ? Qr : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: gt(i.entries) }, claim: !0 };
970
+ return i === void 0 || i.status === "loading" ? Qr : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: wt(i.entries) }, claim: !0 };
951
971
  }, no = (e, t, n) => {
952
972
  const { readme: r } = to(e, t, n);
953
973
  return r.status === "ok" ? r.readme : null;
954
974
  }, ro = (e, t, n) => {
955
- const r = In({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
975
+ const r = Bn({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
956
976
  if (r === null) return /* @__PURE__ */ new Set();
957
977
  const { location: o } = rn(e, r.params["*"], new URLSearchParams(t.search));
958
978
  switch (o.view) {
@@ -975,28 +995,28 @@ const Rt = Object.freeze(["en", "ja"]), Rr = "en", Tr = Object.freeze({
975
995
  }, lo = () => {
976
996
  const { edits: e } = D();
977
997
  return ee(e.subscribe, e.sideBySide, En);
978
- }, so = () => null, ao = () => {
998
+ }, ao = () => null, so = () => {
979
999
  const { edits: e, labels: t, config: n, trees: r } = D(), o = _([]), i = P(
980
1000
  ({ nextLocation: b }) => {
981
- const O = ro(n, b, (T, S) => no(r, T, S));
982
- return e.flushDrafts(), o.current = e.dirtyPaths().filter((T) => !O.has(T)), o.current.length > 0;
1001
+ const M = ro(n, b, (R, S) => no(r, R, S));
1002
+ return e.flushDrafts(), o.current = e.dirtyPaths().filter((R) => !M.has(R)), o.current.length > 0;
983
1003
  },
984
1004
  [e, n, r]
985
1005
  ), l = zn(i), u = io();
986
1006
  te(() => {
987
1007
  if (!u) return;
988
- const b = (O) => {
989
- e.flushDrafts(), e.dirtyPaths().length !== 0 && (O.preventDefault(), O.returnValue = !0);
1008
+ const b = (M) => {
1009
+ e.flushDrafts(), e.dirtyPaths().length !== 0 && (M.preventDefault(), M.returnValue = !0);
990
1010
  };
991
1011
  return window.addEventListener("beforeunload", b), () => window.removeEventListener("beforeunload", b);
992
1012
  }, [u, e]);
993
- const m = ee(e.subscribe, e.discardRequest, so), f = l.state === "blocked", d = f ? o.current : m === null ? [] : m.paths, h = d.map((b) => ae(b)).join(", "), w = d.length > 0 && d.every((b) => e.session(b)?.save.kind === "draft");
1013
+ const m = ee(e.subscribe, e.discardRequest, ao), f = l.state === "blocked", d = f ? o.current : m === null ? [] : m.paths, h = d.map((b) => se(b)).join(", "), g = d.length > 0 && d.every((b) => e.session(b)?.save.kind === "draft");
994
1014
  return /* @__PURE__ */ c(
995
- gn,
1015
+ wn,
996
1016
  {
997
1017
  open: f || m !== null,
998
- title: w ? t.draftDiscardTitle : t.unsavedTitle,
999
- body: w ? t.draftDiscardBody(h) : t.unsavedBody(h),
1018
+ title: g ? t.draftDiscardTitle : t.unsavedTitle,
1019
+ body: g ? t.draftDiscardBody(h) : t.unsavedBody(h),
1000
1020
  confirmLabel: t.unsavedDiscard,
1001
1021
  cancelLabel: t.unsavedStay,
1002
1022
  testId: "markdown-explorer-unsaved-guard",
@@ -1040,7 +1060,7 @@ function co({
1040
1060
  }
1041
1061
  const uo = /* @__PURE__ */ y.forwardRef(co);
1042
1062
  let Ge = null;
1043
- const yn = () => (Ge ??= import("./EditSurface-DGMLY7Gh.js").catch((e) => {
1063
+ const yn = () => (Ge ??= import("./EditSurface-0owpPyLE.js").catch((e) => {
1044
1064
  throw Ge = null, e;
1045
1065
  }), Ge), fo = () => {
1046
1066
  yn().catch(() => {
@@ -1059,15 +1079,15 @@ class ho extends tn {
1059
1079
  return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
1060
1080
  }
1061
1081
  }
1062
- const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', go = 200, Te = (e) => Er(e.getAttribute(an)), wo = (e, t) => {
1082
+ const at = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', wo = 200, Re = (e) => Er(e.getAttribute(sn)), go = (e, t) => {
1063
1083
  for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
1064
- const o = Te(r);
1084
+ const o = Re(r);
1065
1085
  if (o !== null) return { block: r, lines: o, own: !0 };
1066
1086
  }
1067
1087
  let n = null;
1068
- for (const r of t.querySelectorAll(st)) {
1088
+ for (const r of t.querySelectorAll(at)) {
1069
1089
  if (!(r.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING)) break;
1070
- const o = Te(r);
1090
+ const o = Re(r);
1071
1091
  o !== null && (n = { block: r, lines: o });
1072
1092
  }
1073
1093
  return n === null ? null : { ...n, own: !1 };
@@ -1076,19 +1096,19 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
1076
1096
  for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
1077
1097
  return n;
1078
1098
  }, Eo = (e) => e.closest(po) !== null && e.closest(vo) === null, yo = (e, t, n) => {
1079
- const r = wo(e, t);
1099
+ const r = go(e, t);
1080
1100
  if (r === null) return null;
1081
1101
  const { block: o, own: i } = r;
1082
1102
  if (!i) {
1083
1103
  const u = r.lines.last + 1;
1084
1104
  return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop: Ne(e) };
1085
1105
  }
1086
- const l = Ro(o, n);
1106
+ const l = To(o, n);
1087
1107
  return l === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: Ne(o) } : { lines: r.lines, word: l.text, occurrence: l.occurrence, clientTop: l.clientTop };
1088
1108
  }, xo = (e, t) => {
1089
1109
  let n = null, r = null, o = null;
1090
- for (const l of e.querySelectorAll(st)) {
1091
- const u = Te(l);
1110
+ for (const l of e.querySelectorAll(at)) {
1111
+ const u = Re(l);
1092
1112
  if (u === null) continue;
1093
1113
  n ??= ko(t, l);
1094
1114
  const { top: m, bottom: f } = l.getBoundingClientRect();
@@ -1099,15 +1119,15 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
1099
1119
  }, So = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, ko = (e, t) => {
1100
1120
  const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
1101
1121
  return So(e) + (Number.isFinite(n) ? n : 0);
1102
- }, Ro = (e, t) => {
1122
+ }, To = (e, t) => {
1103
1123
  if (t === null || t.rangeCount === 0) return null;
1104
1124
  const n = t.getRangeAt(0);
1105
1125
  if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
1106
1126
  const r = n.toString().trim();
1107
- if (r === "" || r.length > go || /[\r\n]/u.test(r)) return null;
1127
+ if (r === "" || r.length > wo || /[\r\n]/u.test(r)) return null;
1108
1128
  const o = e.ownerDocument.createRange();
1109
1129
  return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: bo(o.toString(), r), clientTop: n.getBoundingClientRect().top };
1110
- }, Ks = (e, t) => {
1130
+ }, Xa = (e, t) => {
1111
1131
  const n = e.split(`
1112
1132
  `), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), i = { line: r, column: 0 };
1113
1133
  if (t.word === null) return i;
@@ -1119,22 +1139,22 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
1119
1139
  l += 1;
1120
1140
  }
1121
1141
  }
1122
- return l > 0 ? To(n, r, o, t.word) ?? i : i;
1123
- }, To = (e, t, n, r) => {
1142
+ return l > 0 ? Ro(n, r, o, t.word) ?? i : i;
1143
+ }, Ro = (e, t, n, r) => {
1124
1144
  for (let o = n; o >= t; o -= 1) {
1125
1145
  const i = (e[o - 1] ?? "").lastIndexOf(r);
1126
1146
  if (i >= 0) return { line: o, column: i };
1127
1147
  }
1128
1148
  return null;
1129
- }, Oo = (e, t) => {
1149
+ }, Mo = (e, t) => {
1130
1150
  let n = null, r = null;
1131
- for (const o of e.querySelectorAll(st)) {
1132
- const i = Te(o);
1151
+ for (const o of e.querySelectorAll(at)) {
1152
+ const i = Re(o);
1133
1153
  i === null || i.first > t || (i.last >= t ? n = o : (r === null || i.last >= r.last) && (r = { element: o, last: i.last }));
1134
1154
  }
1135
1155
  return n !== null ? n : r === null ? null : r.element;
1136
- }, Co = (e, t) => {
1137
- const { bottom: n } = e.getBoundingClientRect(), r = Ne(e), o = Te(e);
1156
+ }, Oo = (e, t) => {
1157
+ const { bottom: n } = e.getBoundingClientRect(), r = Ne(e), o = Re(e);
1138
1158
  if (o === null) return r;
1139
1159
  const i = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
1140
1160
  return r + (n - r) * i;
@@ -1149,20 +1169,20 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
1149
1169
  if (u > 0) return l;
1150
1170
  }
1151
1171
  return e.getBoundingClientRect().top;
1152
- }, at = Object.freeze({
1172
+ }, st = Object.freeze({
1153
1173
  browse: Object.freeze({ replace: !0, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
1154
1174
  "switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
1155
1175
  "switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
1156
1176
  "follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
1157
- }), Xs = (e) => at[e], Fe = () => {
1177
+ }), Ya = (e) => st[e], Fe = () => {
1158
1178
  const e = jn();
1159
1179
  return P(
1160
1180
  (t, n) => {
1161
- e(t, at[n]);
1181
+ e(t, st[n]);
1162
1182
  },
1163
1183
  [e]
1164
1184
  );
1165
- }, Ao = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Hn, { ...t, ...at[e] }), xn = (e) => {
1185
+ }, Co = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Hn, { ...t, ...st[e] }), xn = (e) => {
1166
1186
  const t = e.ownerDocument;
1167
1187
  if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
1168
1188
  if (e.hasAttribute("tabindex")) return !1;
@@ -1188,9 +1208,9 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
1188
1208
  e.prefetch(f);
1189
1209
  const h = e.peek(f);
1190
1210
  if (h?.status !== "pending") return;
1191
- const w = Promise.allSettled([h.promise]);
1192
- o.current = w, w.then(() => {
1193
- o.current === w && (o.current = null);
1211
+ const g = Promise.allSettled([h.promise]);
1212
+ o.current = g, g.then(() => {
1213
+ o.current === g && (o.current = null);
1194
1214
  });
1195
1215
  },
1196
1216
  [e]
@@ -1217,7 +1237,7 @@ const st = `[${an}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
1217
1237
  }),
1218
1238
  [u, m]
1219
1239
  );
1220
- }, Mo = it(() => import("./NativeScrollBar-Dazd542j.js").then((e) => ({ default: e.NativeScrollBar })));
1240
+ }, Ao = it(() => import("./NativeScrollBar-CI9fTvkt.js").then((e) => ({ default: e.NativeScrollBar })));
1221
1241
  class No extends tn {
1222
1242
  state = { failed: !1 };
1223
1243
  static getDerivedStateFromError() {
@@ -1230,7 +1250,7 @@ class No extends tn {
1230
1250
  return this.state.failed ? null : this.props.children;
1231
1251
  }
1232
1252
  }
1233
- const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children: /* @__PURE__ */ c(ke, { fallback: null, children: /* @__PURE__ */ c(Mo, { scroller: e, withCircle: t }) }) }), Sn = (e) => /* @__PURE__ */ c(Do, { scroller: e, withCircle: !0 }), kn = () => {
1253
+ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children: /* @__PURE__ */ c(ke, { fallback: null, children: /* @__PURE__ */ c(Ao, { scroller: e, withCircle: t }) }) }), Sn = (e) => /* @__PURE__ */ c(Do, { scroller: e, withCircle: !0 }), kn = () => {
1234
1254
  const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
1235
1255
  let n = !1;
1236
1256
  const r = (o) => {
@@ -1264,9 +1284,9 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children:
1264
1284
  return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i, l) => De(i, t[l]));
1265
1285
  const n = e, r = t, o = Object.keys(n);
1266
1286
  return o.length !== Object.keys(r).length ? !1 : o.every((i) => Object.hasOwn(r, i) && De(n[i], r[i]));
1267
- }, Po = 55e3, Nt = Object.freeze({ status: "deferred" }), Dt = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Rn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", $o = ({ client: e, capacity: t }) => {
1287
+ }, Po = 55e3, Nt = Object.freeze({ status: "deferred" }), Dt = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Tn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", $o = ({ client: e, capacity: t }) => {
1268
1288
  if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
1269
- const n = /* @__PURE__ */ new Map(), r = kn(), o = Oe(), i = /* @__PURE__ */ new WeakSet();
1289
+ const n = /* @__PURE__ */ new Map(), r = kn(), o = Me(), i = /* @__PURE__ */ new WeakSet();
1270
1290
  let l = 0;
1271
1291
  const u = o.emit, m = () => (l += 1, l), f = () => {
1272
1292
  if (!(n.size <= t))
@@ -1276,33 +1296,33 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children:
1276
1296
  }
1277
1297
  }, d = (E, v) => {
1278
1298
  n.delete(E), n.set(E, v);
1279
- }, h = (E) => performance.now() - E.validatedAt >= Po, w = (E, v, s) => {
1280
- const a = n.get(E), g = ue(a?.snapshot), R = s || a?.refreshPending === !0, A = Re(e.document(E, { refresh: R }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: A, previous: g }, validatedAt: performance.now(), opened: v, background: null, refreshPending: !1, seeded: void 0, stamp: m() };
1281
- return d(E, N), f(), A.then((q) => {
1299
+ }, h = (E) => performance.now() - E.validatedAt >= Po, g = (E, v, a) => {
1300
+ const s = n.get(E), w = ue(s?.snapshot), T = a || s?.refreshPending === !0, C = Te(e.document(E, { refresh: T }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: C, previous: w }, validatedAt: performance.now(), opened: v, background: null, refreshPending: !1, seeded: void 0, stamp: m() };
1301
+ return d(E, N), f(), C.then((q) => {
1282
1302
  n.get(E) === N && (N.snapshot = q, N.stamp = m(), u());
1283
1303
  }), N;
1284
- }, b = (E, v, s, a, g, R) => {
1285
- v.background === s && (v.background = null, !(n.get(E) !== v || v.snapshot !== a) && (g.kind === "failure" && a.document.kind !== "failure" || (v.validatedAt = R, v.stamp = m(), De(a.document, g) || (v.snapshot = { status: "loaded", document: g }), u())));
1286
- }, O = async (E, v) => {
1287
- const s = v.snapshot;
1288
- if (s.status !== "loaded") return null;
1289
- const a = {};
1290
- v.background = a;
1291
- const g = performance.now(), R = e.document(E, { refresh: v.refreshPending });
1304
+ }, b = (E, v, a, s, w, T) => {
1305
+ v.background === a && (v.background = null, !(n.get(E) !== v || v.snapshot !== s) && (w.kind === "failure" && s.document.kind !== "failure" || (v.validatedAt = T, v.stamp = m(), De(s.document, w) || (v.snapshot = { status: "loaded", document: w }), u())));
1306
+ }, M = async (E, v) => {
1307
+ const a = v.snapshot;
1308
+ if (a.status !== "loaded") return null;
1309
+ const s = {};
1310
+ v.background = s;
1311
+ const w = performance.now(), T = e.document(E, { refresh: v.refreshPending });
1292
1312
  v.refreshPending = !1;
1293
- const A = await R, N = v.background === a && n.get(E) === v && v.snapshot === s;
1294
- return b(E, v, a, s, A, g), N ? A : null;
1295
- }, T = (E, v) => {
1296
- const { snapshot: s } = v;
1297
- return s.status === "pending" ? !1 : s.status === "loaded" && s.document.kind !== "failure" ? (O(E, v), !1) : (s.status === "loaded" && i.add(s), w(E, !0, !1), !0);
1313
+ const C = await T, N = v.background === s && n.get(E) === v && v.snapshot === a;
1314
+ return b(E, v, s, a, C, w), N ? C : null;
1315
+ }, R = (E, v) => {
1316
+ const { snapshot: a } = v;
1317
+ return a.status === "pending" ? !1 : a.status === "loaded" && a.document.kind !== "failure" ? (M(E, v), !1) : (a.status === "loaded" && i.add(a), g(E, !0, !1), !0);
1298
1318
  }, S = (E) => {
1299
1319
  const v = r.hold(E);
1300
- let s = !1;
1320
+ let a = !1;
1301
1321
  return () => {
1302
- if (s) return;
1303
- s = !0, v();
1304
- const a = n.get(E);
1305
- a !== void 0 && d(E, a), f();
1322
+ if (a) return;
1323
+ a = !0, v();
1324
+ const s = n.get(E);
1325
+ s !== void 0 && d(E, s), f();
1306
1326
  };
1307
1327
  };
1308
1328
  return {
@@ -1311,72 +1331,72 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(No, { children:
1311
1331
  answerStampOf: (E) => n.get(E)?.stamp,
1312
1332
  prefetch: (E) => {
1313
1333
  const v = n.get(E);
1314
- v !== void 0 && v.snapshot.status !== "deferred" || (w(E, !1, !1), u());
1334
+ v !== void 0 && v.snapshot.status !== "deferred" || (g(E, !1, !1), u());
1315
1335
  },
1316
1336
  open: (E) => {
1317
- const v = r.resumes(E), s = S(E), a = n.get(E);
1318
- if (a === void 0 || a.snapshot.status === "deferred")
1319
- return w(E, !0, !1), u(), s;
1320
- if (d(E, a), v) return s;
1321
- const { snapshot: g } = a;
1322
- return g.status === "pending" ? (a.opened = !0, s) : g.document.kind === "failure" ? (a.opened || h(a) ? (i.add(g), w(E, !0, !1), u()) : a.opened = !0, s) : (a.opened = !0, a.background === null && h(a) && O(E, a), s);
1337
+ const v = r.resumes(E), a = S(E), s = n.get(E);
1338
+ if (s === void 0 || s.snapshot.status === "deferred")
1339
+ return g(E, !0, !1), u(), a;
1340
+ if (d(E, s), v) return a;
1341
+ const { snapshot: w } = s;
1342
+ return w.status === "pending" ? (s.opened = !0, a) : w.document.kind === "failure" ? (s.opened || h(s) ? (i.add(w), g(E, !0, !1), u()) : s.opened = !0, a) : (s.opened = !0, s.background === null && h(s) && M(E, s), a);
1323
1343
  },
1324
1344
  retain: S,
1325
1345
  retry: (E) => {
1326
1346
  const v = n.get(E);
1327
- v === void 0 || v.snapshot.status !== "loaded" || v.snapshot.document.kind !== "failure" || (w(E, !0, !1), u());
1347
+ v === void 0 || v.snapshot.status !== "loaded" || v.snapshot.document.kind !== "failure" || (g(E, !0, !1), u());
1328
1348
  },
1329
1349
  seed: (E, v) => {
1330
- const s = performance.now(), a = Re(
1350
+ const a = performance.now(), s = Te(
1331
1351
  v.then(
1332
1352
  (q) => q === null ? Nt : { status: "loaded", document: q },
1333
1353
  () => Nt
1334
1354
  )
1335
- ), g = n.get(E);
1336
- if (g !== void 0 && g.snapshot.status === "loaded") {
1337
- const q = g.snapshot, W = {};
1338
- g.background = W, a.then((z) => {
1355
+ ), w = n.get(E);
1356
+ if (w !== void 0 && w.snapshot.status === "loaded") {
1357
+ const q = w.snapshot, W = {};
1358
+ w.background = W, s.then((z) => {
1339
1359
  if (z.status === "loaded") {
1340
- b(E, g, W, q, z.document, s);
1360
+ b(E, w, W, q, z.document, a);
1341
1361
  return;
1342
1362
  }
1343
- g.background === W && (g.background = null);
1363
+ w.background === W && (w.background = null);
1344
1364
  });
1345
1365
  return;
1346
1366
  }
1347
- const R = g !== void 0 && g.snapshot.status === "pending" ? g.snapshot.previous : null, A = { status: "pending", promise: a, previous: R }, N = { snapshot: A, validatedAt: s, opened: g?.opened === !0, background: null, refreshPending: g?.refreshPending === !0, seeded: A, stamp: m() };
1348
- d(E, N), f(), a.then((q) => {
1349
- n.get(E) === N && (q.status === "deferred" && r.isHeld(E) ? w(E, N.opened, !1) : (N.snapshot = q, N.stamp = m()), u());
1367
+ const T = w !== void 0 && w.snapshot.status === "pending" ? w.snapshot.previous : null, C = { status: "pending", promise: s, previous: T }, N = { snapshot: C, validatedAt: a, opened: w?.opened === !0, background: null, refreshPending: w?.refreshPending === !0, seeded: C, stamp: m() };
1368
+ d(E, N), f(), s.then((q) => {
1369
+ n.get(E) === N && (q.status === "deferred" && r.isHeld(E) ? g(E, N.opened, !1) : (N.snapshot = q, N.stamp = m()), u());
1350
1370
  });
1351
1371
  },
1352
1372
  invalidate: () => {
1353
1373
  let E = !1;
1354
- for (const [v, s] of [...n]) {
1355
- if (s.validatedAt = Number.NEGATIVE_INFINITY, s.opened = !0, s.refreshPending = !0, !r.isHeld(v)) continue;
1356
- const { snapshot: a } = s;
1357
- if (a.status !== "pending") {
1358
- T(v, s) && (E = !0);
1374
+ for (const [v, a] of [...n]) {
1375
+ if (a.validatedAt = Number.NEGATIVE_INFINITY, a.opened = !0, a.refreshPending = !0, !r.isHeld(v)) continue;
1376
+ const { snapshot: s } = a;
1377
+ if (s.status !== "pending") {
1378
+ R(v, a) && (E = !0);
1359
1379
  continue;
1360
1380
  }
1361
- a.promise.then(() => {
1362
- n.get(v) === s && s.refreshPending && r.isHeld(v) && T(v, s) && u();
1381
+ s.promise.then(() => {
1382
+ n.get(v) === a && a.refreshPending && r.isHeld(v) && R(v, a) && u();
1363
1383
  });
1364
1384
  }
1365
1385
  E && u();
1366
1386
  },
1367
1387
  refresh: async (E) => {
1368
1388
  const v = n.get(E);
1369
- if (v !== void 0 && Rn(v.snapshot)) {
1389
+ if (v !== void 0 && Tn(v.snapshot)) {
1370
1390
  v.refreshPending = !0;
1371
- const a = await O(E, v);
1372
- return a === null ? We : a.kind === "failure" ? { status: "failed", failure: a.failure } : Dt;
1391
+ const s = await M(E, v);
1392
+ return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } : Dt;
1373
1393
  }
1374
- const s = w(E, !0, !0);
1375
- return u(), s.snapshot.status !== "pending" ? We : (await s.snapshot.promise, n.get(E) === s ? Dt : We);
1394
+ const a = g(E, !0, !0);
1395
+ return u(), a.snapshot.status !== "pending" ? We : (await a.snapshot.promise, n.get(E) === a ? Dt : We);
1376
1396
  },
1377
1397
  clear: () => {
1378
1398
  n.clear();
1379
- for (const E of r.heldKeys()) w(E, !0, !1);
1399
+ for (const E of r.heldKeys()) g(E, !0, !1);
1380
1400
  u();
1381
1401
  },
1382
1402
  subscribe: o.subscribe,
@@ -1432,8 +1452,8 @@ function _o({
1432
1452
  d: "M3.5 6A1.5 1.5 0 0 0 2 7.5v9A1.5 1.5 0 0 0 3.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L8.44 6.439A1.5 1.5 0 0 0 7.378 6H3.5Z"
1433
1453
  }));
1434
1454
  }
1435
- const Bo = /* @__PURE__ */ y.forwardRef(_o);
1436
- function Io({
1455
+ const Io = /* @__PURE__ */ y.forwardRef(_o);
1456
+ function Bo({
1437
1457
  title: e,
1438
1458
  titleId: t,
1439
1459
  ...n
@@ -1454,11 +1474,11 @@ function Io({
1454
1474
  clipRule: "evenodd"
1455
1475
  }));
1456
1476
  }
1457
- const zo = /* @__PURE__ */ y.forwardRef(Io), jo = 2e3, Pt = Object.freeze({ outcome: "idle" }), Ho = (e) => {
1477
+ const zo = /* @__PURE__ */ y.forwardRef(Bo), jo = 2e3, Pt = Object.freeze({ outcome: "idle" }), Ho = (e) => {
1458
1478
  const t = navigator.clipboard;
1459
1479
  return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
1460
1480
  }, Vo = ({ text: e }) => {
1461
- const { announcer: t, labels: n } = D(), [r, o] = I(Pt);
1481
+ const { announcer: t, labels: n } = D(), [r, o] = B(Pt);
1462
1482
  te(() => {
1463
1483
  if (r.outcome === "idle") return;
1464
1484
  const m = setTimeout(() => o(Pt), jo);
@@ -1473,7 +1493,7 @@ const zo = /* @__PURE__ */ y.forwardRef(Io), jo = 2e3, Pt = Object.freeze({ outc
1473
1493
  );
1474
1494
  }, u = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
1475
1495
  return (
1476
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: l, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(qo, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(zo, {}) : /* @__PURE__ */ c(Bo, {}) })
1496
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: l, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(qo, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(zo, {}) : /* @__PURE__ */ c(Io, {}) })
1477
1497
  );
1478
1498
  }, he = pe("fill"), Uo = Object.freeze({ blockSize: "100%" }), ve = ({ scrollerProps: e, children: t }) => ne(he) === "content" ? /* @__PURE__ */ c(St, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(St, { scrollerProps: { ...e, style: Uo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: Sn, children: t });
1479
1499
  function Zo({
@@ -1570,23 +1590,23 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
1570
1590
  if (!e.startsWith("#") || e.length === 1) return null;
1571
1591
  const t = new TextEncoder(), n = e.slice(1).split(ti).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
1572
1592
  return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
1573
- }, Tn = (e) => `#${encodeURIComponent(e)}`, ni = (e) => {
1593
+ }, Rn = (e) => `#${encodeURIComponent(e)}`, ni = (e) => {
1574
1594
  if (e === "#") return !0;
1575
1595
  const t = ct(e);
1576
1596
  return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
1577
- }, On = (e, t) => {
1597
+ }, Mn = (e, t) => {
1578
1598
  if (t === "") return null;
1579
1599
  for (const n of e.querySelectorAll("[id]"))
1580
1600
  if (n.id === t) return n;
1581
1601
  return null;
1582
1602
  }, ri = "http://www.w3.org/1999/xhtml", $t = (e, t) => {
1583
1603
  if (t === "") return null;
1584
- const n = On(e, t);
1604
+ const n = Mn(e, t);
1585
1605
  if (n !== null) return n;
1586
1606
  for (const r of e.querySelectorAll("a[name]"))
1587
1607
  if (r.localName === "a" && r.namespaceURI === ri && r.getAttribute("name") === t) return r;
1588
1608
  return null;
1589
- }, Cn = (e, t) => {
1609
+ }, On = (e, t) => {
1590
1610
  if (e === null || !t.startsWith("#")) return null;
1591
1611
  const n = $t(e, t.slice(1));
1592
1612
  if (n !== null) return n;
@@ -1615,7 +1635,7 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
1615
1635
  reveal: (e) => {
1616
1636
  e.scrollIntoView(tt);
1617
1637
  }
1618
- }), tt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), si = (e, t) => {
1638
+ }), tt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), ai = (e, t) => {
1619
1639
  for (let n = t; n !== null && n !== e; n = n.parentElement) {
1620
1640
  const r = n.parentElement;
1621
1641
  if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
@@ -1623,7 +1643,7 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
1623
1643
  n.removeAttribute("hidden");
1624
1644
  }
1625
1645
  }
1626
- }, ai = (e, t) => {
1646
+ }, si = (e, t) => {
1627
1647
  if (t.getClientRects().length === 0) return;
1628
1648
  const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r), l = t.getBoundingClientRect(), u = l.height + i + Number.parseFloat(o) > e.clientHeight;
1629
1649
  if (!u && Math.abs(l.top - i - n) < 1) {
@@ -1636,8 +1656,8 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
1636
1656
  n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
1637
1657
  }, qt = (e, t, n) => {
1638
1658
  if (e === null) return null;
1639
- const r = Cn(e, t);
1640
- return r === null ? (ni(t) && ci(e, n), null) : (si(e, r), ai(n.scrollerOf(e, r), r), n.reveal(r), r);
1659
+ const r = On(e, t);
1660
+ return r === null ? (ni(t) && ci(e, n), null) : (ai(e, r), si(n.scrollerOf(e, r), r), n.reveal(r), r);
1641
1661
  };
1642
1662
  function di({
1643
1663
  title: e,
@@ -1728,7 +1748,7 @@ function vi({
1728
1748
  clipRule: "evenodd"
1729
1749
  }));
1730
1750
  }
1731
- const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = Object.freeze({ [nt]: "allow" }), wi = `[${nt}="${rt[nt]}"]`, bi = () => {
1751
+ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = Object.freeze({ [nt]: "allow" }), gi = `[${nt}="${rt[nt]}"]`, bi = () => {
1732
1752
  let e = null;
1733
1753
  return {
1734
1754
  onKeyDownCapture: (t) => {
@@ -1737,7 +1757,7 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1737
1757
  e = t.target instanceof Element ? t.target : null;
1738
1758
  return;
1739
1759
  }
1740
- e !== null && t.target === e && e.closest(wi) !== null || (t.preventDefault(), t.stopPropagation());
1760
+ e !== null && t.target === e && e.closest(gi) !== null || (t.preventDefault(), t.stopPropagation());
1741
1761
  }
1742
1762
  },
1743
1763
  onKeyUpCapture: (t) => {
@@ -1747,7 +1767,7 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1747
1767
  t.target === e && (e = null);
1748
1768
  }
1749
1769
  };
1750
- }, Le = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), _t = Object.freeze({ mode: "fit" }), Ei = 1, An = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Bt = `[data-testid="${An["data-testid"]}"]`, yi = pe(null), xi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Ei ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, It = (e, t, n) => {
1770
+ }, Le = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), _t = Object.freeze({ mode: "fit" }), Ei = 1, Cn = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), It = `[data-testid="${Cn["data-testid"]}"]`, yi = pe(null), xi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Ei ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Bt = (e, t, n) => {
1751
1771
  if (e.mode === "level") {
1752
1772
  const o = e.index + n;
1753
1773
  return o >= 0 && o < Le.length ? o : null;
@@ -1757,11 +1777,11 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1757
1777
  return r === -1 ? null : r;
1758
1778
  }, zt = (e, t, n) => {
1759
1779
  if (e.mode === "level") {
1760
- const o = It(e, null, n);
1780
+ const o = Bt(e, null, n);
1761
1781
  return o === null ? null : { mode: "level", index: o, base: e.base };
1762
1782
  }
1763
1783
  if (t === null) return null;
1764
- const r = It(e, t.scale, n);
1784
+ const r = Bt(e, t.scale, n);
1765
1785
  return r === null ? null : { mode: "level", index: r, base: t.base };
1766
1786
  }, Si = (e, t) => {
1767
1787
  if (e <= 0 || t <= 0) return 0;
@@ -1774,11 +1794,11 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1774
1794
  const t = Le[e];
1775
1795
  if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
1776
1796
  return t;
1777
- }, Ht = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Ri = ({ document: e }) => {
1778
- const { labels: t } = D(), n = ne(yi), [r] = I(() => n === null ? null : n.read(e.url)), [o, i] = I(r === null ? _t : r.zoom), [l, u] = I(r === null ? null : r.reported), [m, f] = I(null), d = _(null), h = P((v) => {
1779
- const { naturalWidth: s, naturalHeight: a } = v;
1780
- u((g) => Ht(g, s, a));
1781
- }, []), w = P(
1797
+ }, Ht = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Ti = ({ document: e }) => {
1798
+ const { labels: t } = D(), n = ne(yi), [r] = B(() => n === null ? null : n.read(e.url)), [o, i] = B(r === null ? _t : r.zoom), [l, u] = B(r === null ? null : r.reported), [m, f] = B(null), d = _(null), h = P((v) => {
1799
+ const { naturalWidth: a, naturalHeight: s } = v;
1800
+ u((w) => Ht(w, a, s));
1801
+ }, []), g = P(
1782
1802
  (v) => {
1783
1803
  d.current = v, !(v === null || !v.complete) && (v.naturalWidth > 0 || v.naturalHeight > 0 ? h(v) : v.decode().then(
1784
1804
  () => h(v),
@@ -1793,47 +1813,47 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1793
1813
  }, [n, e.url, o, l]), H(() => {
1794
1814
  const v = d.current;
1795
1815
  if (v === null || l === null || o.mode !== "fit") return;
1796
- const s = () => f((g) => Ht(g, v.clientWidth, v.clientHeight));
1797
- if (s(), typeof ResizeObserver > "u") return;
1798
- const a = new ResizeObserver(s);
1799
- return a.observe(v), () => a.disconnect();
1816
+ const a = () => f((w) => Ht(w, v.clientWidth, v.clientHeight));
1817
+ if (a(), typeof ResizeObserver > "u") return;
1818
+ const s = new ResizeObserver(a);
1819
+ return s.observe(v), () => s.disconnect();
1800
1820
  }, [l, o.mode]);
1801
- const b = l === null || m === null ? null : xi(l, m), O = zt(o, b, -1), T = zt(o, b, 1), S = o.mode === "level" ? ki(o.index) : null, M = _({ zoomIn: T, zoomOut: O });
1821
+ const b = l === null || m === null ? null : xi(l, m), M = zt(o, b, -1), R = zt(o, b, 1), S = o.mode === "level" ? ki(o.index) : null, A = _({ zoomIn: R, zoomOut: M });
1802
1822
  H(() => {
1803
- M.current = { zoomIn: T, zoomOut: O };
1823
+ A.current = { zoomIn: R, zoomOut: M };
1804
1824
  });
1805
1825
  const L = _(null);
1806
1826
  H(() => {
1807
- const v = L.current, s = d.current?.closest(Bt);
1808
- L.current = null, !(v === null || s === null || s === void 0) && (s.scrollLeft = v.across * s.scrollWidth - v.x, s.scrollTop = v.down * s.scrollHeight - v.y);
1827
+ const v = L.current, a = d.current?.closest(It);
1828
+ L.current = null, !(v === null || a === null || a === void 0) && (a.scrollLeft = v.across * a.scrollWidth - v.x, a.scrollTop = v.down * a.scrollHeight - v.y);
1809
1829
  }, [o]), te(() => {
1810
- const v = d.current?.closest(Bt);
1830
+ const v = d.current?.closest(It);
1811
1831
  if (v == null) return;
1812
- let s = null;
1813
- const a = (A) => {
1814
- const N = jt(A.touches);
1815
- s = N === null ? null : { distance: N.distance, steps: 0 };
1816
- }, g = (A) => {
1817
- const N = jt(A.touches);
1818
- if (s === null || N === null) return;
1819
- A.preventDefault();
1820
- const q = Si(s.distance, N.distance);
1821
- if (q === s.steps) return;
1822
- const W = q > s.steps ? 1 : -1, z = W === 1 ? M.current.zoomIn : M.current.zoomOut;
1832
+ let a = null;
1833
+ const s = (C) => {
1834
+ const N = jt(C.touches);
1835
+ a = N === null ? null : { distance: N.distance, steps: 0 };
1836
+ }, w = (C) => {
1837
+ const N = jt(C.touches);
1838
+ if (a === null || N === null) return;
1839
+ C.preventDefault();
1840
+ const q = Si(a.distance, N.distance);
1841
+ if (q === a.steps) return;
1842
+ const W = q > a.steps ? 1 : -1, z = W === 1 ? A.current.zoomIn : A.current.zoomOut;
1823
1843
  if (z === null) return;
1824
- s.steps += W;
1844
+ a.steps += W;
1825
1845
  const j = v.getBoundingClientRect(), Y = N.middle.x - j.left, V = N.middle.y - j.top;
1826
1846
  L.current = v.scrollWidth > 0 && v.scrollHeight > 0 ? { x: Y, y: V, across: (v.scrollLeft + Y) / v.scrollWidth, down: (v.scrollTop + V) / v.scrollHeight } : null, i(z);
1827
- }, R = (A) => {
1828
- A.touches.length < 2 && (s = null);
1847
+ }, T = (C) => {
1848
+ C.touches.length < 2 && (a = null);
1829
1849
  };
1830
- return v.addEventListener("touchstart", a, { passive: !0 }), v.addEventListener("touchmove", g, { passive: !1 }), v.addEventListener("touchend", R, { passive: !0 }), v.addEventListener("touchcancel", R, { passive: !0 }), () => {
1831
- v.removeEventListener("touchstart", a), v.removeEventListener("touchmove", g), v.removeEventListener("touchend", R), v.removeEventListener("touchcancel", R);
1850
+ return v.addEventListener("touchstart", s, { passive: !0 }), v.addEventListener("touchmove", w, { passive: !1 }), v.addEventListener("touchend", T, { passive: !0 }), v.addEventListener("touchcancel", T, { passive: !0 }), () => {
1851
+ v.removeEventListener("touchstart", s), v.removeEventListener("touchmove", w), v.removeEventListener("touchend", T), v.removeEventListener("touchcancel", T);
1832
1852
  };
1833
1853
  }, []);
1834
1854
  const E = o.mode === "level" && S !== null ? { width: `${o.base.width * S}px`, height: `${o.base.height * S}px` } : void 0;
1835
1855
  return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
1836
- /* @__PURE__ */ F(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(gi, {}), children: [
1856
+ /* @__PURE__ */ F(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(wi, {}), children: [
1837
1857
  /* @__PURE__ */ c(
1838
1858
  "button",
1839
1859
  {
@@ -1841,9 +1861,9 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1841
1861
  className: "aqmx-icon-button",
1842
1862
  "aria-label": t.imageZoomOut,
1843
1863
  title: t.imageZoomOut,
1844
- "aria-disabled": O === null,
1864
+ "aria-disabled": M === null,
1845
1865
  onClick: () => {
1846
- O !== null && i(O);
1866
+ M !== null && i(M);
1847
1867
  },
1848
1868
  ...rt,
1849
1869
  children: /* @__PURE__ */ c(mi, {})
@@ -1857,9 +1877,9 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1857
1877
  className: "aqmx-icon-button",
1858
1878
  "aria-label": t.imageZoomIn,
1859
1879
  title: t.imageZoomIn,
1860
- "aria-disabled": T === null,
1880
+ "aria-disabled": R === null,
1861
1881
  onClick: () => {
1862
- T !== null && i(T);
1882
+ R !== null && i(R);
1863
1883
  },
1864
1884
  ...rt,
1865
1885
  children: /* @__PURE__ */ c(pi, {})
@@ -1867,21 +1887,21 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1867
1887
  ),
1868
1888
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(_t), children: /* @__PURE__ */ c(ui, {}) })
1869
1889
  ] }),
1870
- /* @__PURE__ */ c(ve, { scrollerProps: An, children: /* @__PURE__ */ c("img", { ref: w, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: E, onLoad: (v) => h(v.currentTarget), "data-testid": "markdown-explorer-image" }) })
1890
+ /* @__PURE__ */ c(ve, { scrollerProps: Cn, children: /* @__PURE__ */ c("img", { ref: g, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: E, onLoad: (v) => h(v.currentTarget), "data-testid": "markdown-explorer-image" }) })
1871
1891
  ] });
1872
- }, Ln = pe(null), Be = pe(void 0), Mn = pe(null), Ie = () => {
1892
+ }, Ln = pe(null), Ie = pe(void 0), An = pe(null), Be = () => {
1873
1893
  const e = ne(Ln);
1874
1894
  if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
1875
1895
  return e;
1876
- }, Ti = () => {
1877
- const e = ne(Mn);
1896
+ }, Ri = () => {
1897
+ const e = ne(An);
1878
1898
  if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
1879
1899
  return e;
1880
- }, ze = (e, t, n, r) => t.kind === "panel" ? ye(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ye(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ye(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Oi = ({ children: e }) => {
1881
- const { config: t } = D(), n = Ie(), r = lt(), o = r.kind === "location" ? r.location.source : void 0, i = $e(ze(t, n.navigation, o, n.currentPath));
1882
- return /* @__PURE__ */ c(Be, { value: o, children: /* @__PURE__ */ c(Mn, { value: i, children: e }) });
1883
- }, Ci = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Ai = (e) => {
1884
- const t = e instanceof Element ? e.closest(Ci) : null;
1900
+ }, ze = (e, t, n, r) => t.kind === "panel" ? ye(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ye(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ye(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Mi = ({ children: e }) => {
1901
+ const { config: t } = D(), n = Be(), r = lt(), o = r.kind === "location" ? r.location.source : void 0, i = $e(ze(t, n.navigation, o, n.currentPath));
1902
+ return /* @__PURE__ */ c(Ie, { value: o, children: /* @__PURE__ */ c(An, { value: i, children: e }) });
1903
+ }, Oi = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Ci = (e) => {
1904
+ const t = e instanceof Element ? e.closest(Oi) : null;
1885
1905
  return t === null ? null : t.getAttribute("data-doc-path");
1886
1906
  }, je = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Li = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: i, onDocumentLink: l, scope: u, children: m }) => {
1887
1907
  const f = $e(e);
@@ -1894,9 +1914,9 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1894
1914
  l(t, n);
1895
1915
  }
1896
1916
  }, children: m });
1897
- }, Mi = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
1898
- const { config: l } = D(), u = Ie(), m = ne(Be), f = ei(e), { navigation: d } = u, h = `${ze(l, d, m, t)}${f}`, w = n === !1 ? "false" : void 0;
1899
- return d.kind === "page" ? /* @__PURE__ */ c(Ao, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": w, children: i }) : /* @__PURE__ */ c(Li, { to: h, docPath: t, fragment: f, exists: w, className: r, attributes: o, onDocumentLink: d.onDocumentLink, scope: u, children: i });
1917
+ }, Ai = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
1918
+ const { config: l } = D(), u = Be(), m = ne(Ie), f = ei(e), { navigation: d } = u, h = `${ze(l, d, m, t)}${f}`, g = n === !1 ? "false" : void 0;
1919
+ return d.kind === "page" ? /* @__PURE__ */ c(Co, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": g, children: i }) : /* @__PURE__ */ c(Li, { to: h, docPath: t, fragment: f, exists: g, className: r, attributes: o, onDocumentLink: d.onDocumentLink, scope: u, children: i });
1900
1920
  }, Ni = ({ className: e, attributes: t, children: n }) => {
1901
1921
  const { labels: r } = D();
1902
1922
  return (
@@ -1910,31 +1930,31 @@ const gi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
1910
1930
  ] })
1911
1931
  );
1912
1932
  }, Di = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
1913
- const { config: i } = D(), l = ne(Be), u = $e(`${ze(i, r.navigation, l, r.currentPath)}${e}`);
1933
+ const { config: i } = D(), l = ne(Ie), u = $e(`${ze(i, r.navigation, l, r.currentPath)}${e}`);
1914
1934
  return /* @__PURE__ */ c("a", { ...n, href: u, className: t, onClick: (f) => {
1915
1935
  je(f) && (f.preventDefault(), r.scrollWithin(e));
1916
1936
  }, children: o });
1917
1937
  }, Pi = ({ href: e, className: t, attributes: n, children: r }) => {
1918
- const o = Ie();
1938
+ const o = Be();
1919
1939
  return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (l) => {
1920
1940
  if (!je(l)) return;
1921
1941
  const u = l.currentTarget;
1922
1942
  e === "#" ? o.followEmptyFragment(l.nativeEvent) : u.href === u.ownerDocument.URL && o.followSameUrlJump(e, l.nativeEvent);
1923
1943
  }, children: r }) : /* @__PURE__ */ c(Di, { href: e, className: t, attributes: n, scope: o, children: r });
1924
- }, $i = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: l }) => t === "doc" ? n === void 0 || !tr(n) ? /* @__PURE__ */ c(Ni, { className: o, attributes: i, children: l }) : /* @__PURE__ */ c(Mi, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: l }) : e.startsWith("#") ? /* @__PURE__ */ c(Pi, { href: e, className: o, attributes: i, children: l }) : /* @__PURE__ */ c("a", { ...i, href: e, className: o, children: l }), Fi = () => {
1925
- const { config: e } = D(), t = Ie(), n = ne(Be), r = Fe();
1944
+ }, $i = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: l }) => t === "doc" ? n === void 0 || !tr(n) ? /* @__PURE__ */ c(Ni, { className: o, attributes: i, children: l }) : /* @__PURE__ */ c(Ai, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: l }) : e.startsWith("#") ? /* @__PURE__ */ c(Pi, { href: e, className: o, attributes: i, children: l }) : /* @__PURE__ */ c("a", { ...i, href: e, className: o, children: l }), Fi = () => {
1945
+ const { config: e } = D(), t = Be(), n = ne(Ie), r = Fe();
1926
1946
  return P(
1927
1947
  (o, i) => {
1928
1948
  if (!je(i)) return !0;
1929
1949
  i.preventDefault();
1930
- const l = Tn(o.id), { navigation: u } = t;
1950
+ const l = Rn(o.id), { navigation: u } = t;
1931
1951
  return u.kind === "panel" || ct(i.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(l), !0) : (r(`${ze(e, u, n, t.currentPath)}${l}`, "follow-link"), !0);
1932
1952
  },
1933
1953
  [e, t, n, r]
1934
1954
  );
1935
1955
  }, qi = () => {
1936
- const e = Ti();
1937
- return P((t) => `${e}${Tn(t.id)}`, [e]);
1956
+ const e = Ri();
1957
+ return P((t) => `${e}${Rn(t.id)}`, [e]);
1938
1958
  };
1939
1959
  function _i({
1940
1960
  title: e,
@@ -1955,8 +1975,8 @@ function _i({
1955
1975
  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"
1956
1976
  }));
1957
1977
  }
1958
- const Bi = /* @__PURE__ */ y.forwardRef(_i);
1959
- function Ii({
1978
+ const Ii = /* @__PURE__ */ y.forwardRef(_i);
1979
+ function Bi({
1960
1980
  title: e,
1961
1981
  titleId: t,
1962
1982
  ...n
@@ -1977,7 +1997,7 @@ function Ii({
1977
1997
  clipRule: "evenodd"
1978
1998
  }));
1979
1999
  }
1980
- const zi = /* @__PURE__ */ y.forwardRef(Ii);
2000
+ const zi = /* @__PURE__ */ y.forwardRef(Bi);
1981
2001
  function ji({
1982
2002
  title: e,
1983
2003
  titleId: t,
@@ -2016,7 +2036,7 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2016
2036
  case "audio":
2017
2037
  return /* @__PURE__ */ c(Hi, {});
2018
2038
  case "pdf":
2019
- return /* @__PURE__ */ c(Bi, {});
2039
+ return /* @__PURE__ */ c(Ii, {});
2020
2040
  default: {
2021
2041
  const t = e;
2022
2042
  throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
@@ -2064,15 +2084,25 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2064
2084
  alignCenter: e.viewerAlignCenter,
2065
2085
  alignRight: e.viewerAlignRight,
2066
2086
  mermaidInteractionMode: e.viewerMermaidInteractionMode,
2087
+ mermaidInteractionModeTouch: e.viewerMermaidInteractionModeTouch,
2067
2088
  mermaidModeNone: e.viewerMermaidModeNone,
2068
2089
  mermaidModeZoom: e.viewerMermaidModeZoom,
2069
2090
  mermaidModePan: e.viewerMermaidModePan,
2070
2091
  mermaidModePanShift: e.viewerMermaidModePanShift,
2071
2092
  mermaidModeBoth: e.viewerMermaidModeBoth,
2072
2093
  mermaidModeBothShift: e.viewerMermaidModeBothShift,
2094
+ mermaidModeNoneTouch: e.viewerMermaidModeNoneTouch,
2095
+ mermaidModeZoomTouch: e.viewerMermaidModeZoomTouch,
2096
+ mermaidModePanTouch: e.viewerMermaidModePanTouch,
2097
+ mermaidModeBothTouch: e.viewerMermaidModeBothTouch,
2073
2098
  mermaidZoomIn: e.viewerMermaidZoomIn,
2074
2099
  mermaidZoomOut: e.viewerMermaidZoomOut,
2075
2100
  mermaidResetView: e.viewerMermaidResetView,
2101
+ mermaidPanUp: e.viewerMermaidPanUp,
2102
+ mermaidPanDown: e.viewerMermaidPanDown,
2103
+ mermaidPanLeft: e.viewerMermaidPanLeft,
2104
+ mermaidPanRight: e.viewerMermaidPanRight,
2105
+ mermaidDiagram: e.viewerMermaidDiagram,
2076
2106
  mermaidRetry: e.viewerMermaidRetry,
2077
2107
  embeddedVideo: e.viewerEmbeddedVideo,
2078
2108
  embeddedPost: e.viewerEmbeddedPost,
@@ -2098,16 +2128,16 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2098
2128
  }, tl = ({ absence: e, announces: t, announceFailure: n }) => {
2099
2129
  const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null, l = e.kind === "failure" ? e.folder : null, u = e.kind === "failure" ? e.failure : null;
2100
2130
  switch (te(() => {
2101
- t && i !== null && o.announce(r.folderReadmeMissing(ae(i)));
2131
+ t && i !== null && o.announce(r.folderReadmeMissing(se(i)));
2102
2132
  }, [t, i, o, r]), te(() => {
2103
- l !== null && u !== null && n(r.documentFailed(ae(l), se(r, u.reason)));
2133
+ l !== null && u !== null && n(r.documentFailed(se(l), ae(r, u.reason)));
2104
2134
  }, [l, u, n, r]), e.kind) {
2105
2135
  case "empty":
2106
2136
  return /* @__PURE__ */ c(xe, { kind: "empty", label: r.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: r.documentEmpty }) }) });
2107
2137
  case "loading":
2108
2138
  return /* @__PURE__ */ c(ut, { label: r.documentRegion });
2109
2139
  case "no-readme":
2110
- return /* @__PURE__ */ c(xe, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(ae(e.folder)) }) }) });
2140
+ return /* @__PURE__ */ c(xe, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(se(e.folder)) }) }) });
2111
2141
  case "failure":
2112
2142
  return /* @__PURE__ */ c(xe, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c(ve, { scrollerProps: ft, children: /* @__PURE__ */ c(me, { failure: e.failure, alert: !1, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) }) });
2113
2143
  }
@@ -2118,71 +2148,71 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2118
2148
  /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: t.documentLoading })
2119
2149
  ] });
2120
2150
  }, Vt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), nl = ({ path: e, document: t, viewer: n, editing: r }) => {
2121
- const { reportMathDiagnostics: o, edits: i } = D(), l = G(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = Fi(), m = qi(), f = G(() => o === void 0 ? void 0 : (s) => o(e, s), [o, e]), d = _(null), { editable: h, doubleClick: w, region: b, paneScroll: O, stale: T } = r;
2151
+ const { reportMathDiagnostics: o, edits: i } = D(), l = G(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = Fi(), m = qi(), f = G(() => o === void 0 ? void 0 : (a) => o(e, a), [o, e]), d = _(null), { editable: h, doubleClick: g, region: b, paneScroll: M, stale: R } = r;
2122
2152
  H(() => {
2123
2153
  if (h)
2124
2154
  return i.bindView(e, {
2125
2155
  anchor: () => {
2126
- const s = d.current, a = b(), g = s === null ? null : s.querySelector(_e);
2127
- return s === null || a === null || g === null ? null : xo(s, O.scrollerOf(a, g));
2156
+ const a = d.current, s = b(), w = a === null ? null : a.querySelector(_e);
2157
+ return a === null || s === null || w === null ? null : xo(a, M.scrollerOf(s, w));
2128
2158
  }
2129
2159
  });
2130
- }, [i, e, h, b, O]);
2131
- const S = (s) => {
2132
- const a = d.current, { target: g } = s;
2133
- !w || a === null || !(g instanceof Element) || !Eo(g) || (s.stopPropagation(), i.start(e, yo(g, a, a.ownerDocument.getSelection())));
2134
- }, M = _(null), L = _(T);
2160
+ }, [i, e, h, b, M]);
2161
+ const S = (a) => {
2162
+ const s = d.current, { target: w } = a;
2163
+ !g || s === null || !(w instanceof Element) || !Eo(w) || (a.stopPropagation(), i.start(e, yo(w, s, s.ownerDocument.getSelection())));
2164
+ }, A = _(null), L = _(R);
2135
2165
  H(() => {
2136
- L.current = T;
2166
+ L.current = R;
2137
2167
  });
2138
- const E = le((s) => {
2139
- const a = d.current, g = b(), R = a === null ? null : Oo(a, s.line);
2140
- if (g === null || R === null) return !1;
2141
- const A = O.scrollerOf(g, R);
2142
- return A.scrollTop += Co(R, s.line) - s.clientTop, !0;
2143
- }), v = le((s) => {
2144
- const a = b();
2145
- if (a === null) return;
2146
- const g = () => {
2147
- for (const A of Vt) a.removeEventListener(A, R, !0);
2148
- M.current?.release === g && (M.current = null);
2149
- }, R = () => g();
2150
- for (const A of Vt) a.addEventListener(A, R, { capture: !0, passive: !0 });
2151
- M.current = { point: s, release: g };
2168
+ const E = le((a) => {
2169
+ const s = d.current, w = b(), T = s === null ? null : Mo(s, a.line);
2170
+ if (w === null || T === null) return !1;
2171
+ const C = M.scrollerOf(w, T);
2172
+ return C.scrollTop += Oo(T, a.line) - a.clientTop, !0;
2173
+ }), v = le((a) => {
2174
+ const s = b();
2175
+ if (s === null) return;
2176
+ const w = () => {
2177
+ for (const C of Vt) s.removeEventListener(C, T, !0);
2178
+ A.current?.release === w && (A.current = null);
2179
+ }, T = () => w();
2180
+ for (const C of Vt) s.addEventListener(C, T, { capture: !0, passive: !0 });
2181
+ A.current = { point: a, release: w };
2152
2182
  });
2153
2183
  return H(() => {
2154
- const s = i.takeReturn(e);
2155
- if (s !== null)
2184
+ const a = i.takeReturn(e);
2185
+ if (a !== null)
2156
2186
  return queueMicrotask(() => {
2157
- E(s) && L.current && v(s);
2158
- }), () => M.current?.release();
2187
+ E(a) && L.current && v(a);
2188
+ }), () => A.current?.release();
2159
2189
  }, [i, e]), H(() => {
2160
- const s = M.current;
2161
- s === null || T || (s.release(), E(s.point));
2162
- }, [t, T]),
2163
- /* @__PURE__ */ c("div", { ref: d, className: "aqmx-document-viewer", onDoubleClick: S, children: /* @__PURE__ */ c(sn, { ...n, onHeadingSelect: u, headingHref: m, onMathDiagnostics: f, parseResult: l, content: null }) });
2190
+ const a = A.current;
2191
+ a === null || R || (a.release(), E(a.point));
2192
+ }, [t, R]),
2193
+ /* @__PURE__ */ c("div", { ref: d, className: "aqmx-document-viewer", onDoubleClick: S, children: /* @__PURE__ */ c(an, { ...n, onHeadingSelect: u, headingHref: m, onMathDiagnostics: f, parseResult: l, content: null }) });
2164
2194
  }, Pn = ({ document: e, viewer: t }) => {
2165
2195
  const { labels: n } = D();
2166
2196
  return /* @__PURE__ */ F(Pe, { children: [
2167
2197
  /* @__PURE__ */ c(qe, { name: e.name, openUrl: nr(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(uo, {}), children: e.truncated ? null : /* @__PURE__ */ c(Vo, { text: e.text }) }),
2168
2198
  e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
2169
- /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(sn, { ...t, parseResult: null, content: e.text }) })
2199
+ /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(an, { ...t, parseResult: null, content: e.text }) })
2170
2200
  ] });
2171
2201
  }, rl = ({ path: e, name: t, viewer: n }) => {
2172
- const { data: r, documents: o, announcer: i, labels: l } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, d] = I(0), h = G(() => ({ path: e, stamp: m, attempt: f }), [e, m, f]), [w, b] = I(null), O = le((S) => {
2173
- b(S), S.kind === "failure" && i.announce(l.documentFailed(t, se(l, S.failure.reason)));
2202
+ const { data: r, documents: o, announcer: i, labels: l } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, d] = B(0), h = G(() => ({ path: e, stamp: m, attempt: f }), [e, m, f]), [g, b] = B(null), M = le((S) => {
2203
+ b(S), S.kind === "failure" && i.announce(l.documentFailed(t, ae(l, S.failure.reason)));
2174
2204
  });
2175
2205
  te(() => {
2176
2206
  const S = new AbortController();
2177
- return r.text(h.path, S.signal).then((M) => {
2178
- "kind" in M && O(M);
2207
+ return r.text(h.path, S.signal).then((A) => {
2208
+ "kind" in A && M(A);
2179
2209
  }), () => S.abort();
2180
2210
  }, [r, h]);
2181
- const T = P(() => d((S) => S + 1), []);
2182
- return w === null ? /* @__PURE__ */ F(Pe, { children: [
2211
+ const R = P(() => d((S) => S + 1), []);
2212
+ return g === null ? /* @__PURE__ */ F(Pe, { children: [
2183
2213
  /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: dt.map((S) => /* @__PURE__ */ c("span", {}, S)) }),
2184
2214
  /* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: l.markupLoading })
2185
- ] }) : w.kind === "failure" ? /* @__PURE__ */ c(ve, { scrollerProps: ft, children: /* @__PURE__ */ c(me, { failure: w.failure, alert: !1, onRetry: T, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(Pn, { document: w, viewer: n });
2215
+ ] }) : g.kind === "failure" ? /* @__PURE__ */ c(ve, { scrollerProps: ft, children: /* @__PURE__ */ c(me, { failure: g.failure, alert: !1, onRetry: R, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(Pn, { document: g, viewer: n });
2186
2216
  }, ft = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), ol = Object.freeze({ reason: "failed" }), il = (e) => /* @__PURE__ */ c(
2187
2217
  ho,
2188
2218
  {
@@ -2207,7 +2237,7 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2207
2237
  case "text":
2208
2238
  return /* @__PURE__ */ c(Pn, { document: t, viewer: r });
2209
2239
  case "image":
2210
- return /* @__PURE__ */ c(Ri, { document: t });
2240
+ return /* @__PURE__ */ c(Ti, { document: t });
2211
2241
  case "media":
2212
2242
  return /* @__PURE__ */ c(Yi, { document: t });
2213
2243
  case "file":
@@ -2219,8 +2249,8 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2219
2249
  throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(l)}`);
2220
2250
  }
2221
2251
  }
2222
- }, sl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', al = (e, t, n) => {
2223
- const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : Cn(e, n), r === void 0 ? null : On(e, r.id), e.querySelector(_e), e.querySelector(sl)];
2252
+ }, al = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', sl = (e, t, n) => {
2253
+ const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : On(e, n), r === void 0 ? null : Mn(e, r.id), e.querySelector(_e), e.querySelector(al)];
2224
2254
  for (const i of o)
2225
2255
  if (i instanceof HTMLElement && xn(i)) return i;
2226
2256
  return null;
@@ -2235,17 +2265,17 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2235
2265
  const r = n.ownerDocument, o = r.defaultView;
2236
2266
  if (o === null) throw new Error("[markdown-explorer] the document region's document has no window");
2237
2267
  let i = !1, l;
2238
- const u = (w) => {
2239
- i = !(w.target instanceof Node && n.contains(w.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(l), l = setTimeout(() => {
2268
+ const u = (g) => {
2269
+ i = !(g.target instanceof Node && n.contains(g.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(l), l = setTimeout(() => {
2240
2270
  i = !1;
2241
2271
  }, 0);
2242
- }, m = (w) => {
2243
- t.current = w.target instanceof Node && n.contains(w.target);
2244
- }, f = (w) => {
2245
- w.relatedTarget === null && i && (t.current = !1);
2272
+ }, m = (g) => {
2273
+ t.current = g.target instanceof Node && n.contains(g.target);
2274
+ }, f = (g) => {
2275
+ g.relatedTarget === null && i && (t.current = !1);
2246
2276
  }, d = () => {
2247
- const { activeElement: w, body: b } = r;
2248
- w !== null && w !== b && (t.current = n.contains(w));
2277
+ const { activeElement: g, body: b } = r;
2278
+ g !== null && g !== b && (t.current = n.contains(g));
2249
2279
  }, h = () => {
2250
2280
  i && !n.contains(r.activeElement) && (t.current = !1);
2251
2281
  };
@@ -2253,61 +2283,61 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2253
2283
  clearTimeout(l), o.removeEventListener("pointerdown", u, !0), o.removeEventListener("mousedown", u, !0), o.removeEventListener("focusin", m, !0), o.removeEventListener("blur", d), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
2254
2284
  };
2255
2285
  }, [e]), t;
2256
- }, dl = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: l, navigation: u, fragment: m, paneScroll: f, announces: d, announceFailure: h, onDocumentShown: w }) => {
2257
- const { labels: b, announcer: O, documents: T } = D(), { document: S } = t, M = _(null), L = _(null), E = _(null), v = _(0), s = cl(M), a = _({ path: e, document: S }), g = _(null), R = P(
2286
+ }, dl = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: l, navigation: u, fragment: m, paneScroll: f, announces: d, announceFailure: h, onDocumentShown: g }) => {
2287
+ const { labels: b, announcer: M, documents: R } = D(), { document: S } = t, A = _(null), L = _(null), E = _(null), v = _(0), a = cl(A), s = _({ path: e, document: S }), w = _(null), T = P(
2258
2288
  (Z) => {
2259
- const X = M.current, Q = qt(X, Z, f);
2260
- X !== null && Q !== null && Ut(X, Q, s.current);
2289
+ const X = A.current, Q = qt(X, Z, f);
2290
+ X !== null && Q !== null && Ut(X, Q, a.current);
2261
2291
  },
2262
- [f, s]
2263
- ), A = P(
2292
+ [f, a]
2293
+ ), C = P(
2264
2294
  (Z, X) => {
2265
2295
  const Q = v.current;
2266
2296
  setTimeout(() => {
2267
- !X.defaultPrevented && v.current === Q && R(Z);
2297
+ !X.defaultPrevented && v.current === Q && T(Z);
2268
2298
  }, 0);
2269
2299
  },
2270
- [R]
2300
+ [T]
2271
2301
  ), N = P(
2272
2302
  (Z) => {
2273
2303
  setTimeout(() => {
2274
- Z.defaultPrevented || R("#");
2304
+ Z.defaultPrevented || T("#");
2275
2305
  }, 0);
2276
2306
  },
2277
- [R]
2278
- ), q = G(() => ({ navigation: u, currentPath: e, scrollWithin: R, followSameUrlJump: A, followEmptyFragment: N }), [u, e, R, A, N]), W = P(() => T.retry(e), [T, e]), z = Lo(T, Ai), j = bn(e), Y = j !== void 0 ? "edit" : n ? "markup" : "rendered", V = S.kind === "markdown" ? Y : void 0, re = P(() => M.current, []), p = G(() => ({ session: j, layout: i, region: re, paneScroll: f, stale: r }), [j, i, re, f, r]), x = V === "edit" ? !1 : r, k = ne(he), C = V === "edit" && i === "fill" ? "fill" : k, $ = le((Z, X) => {
2307
+ [T]
2308
+ ), q = G(() => ({ navigation: u, currentPath: e, scrollWithin: T, followSameUrlJump: C, followEmptyFragment: N }), [u, e, T, C, N]), W = P(() => R.retry(e), [R, e]), z = Lo(R, Ci), j = bn(e), Y = j !== void 0 ? "edit" : n ? "markup" : "rendered", V = S.kind === "markdown" ? Y : void 0, re = P(() => A.current, []), p = G(() => ({ session: j, layout: i, region: re, paneScroll: f, stale: r }), [j, i, re, f, r]), x = V === "edit" ? !1 : r, k = ne(he), O = V === "edit" && i === "fill" ? "fill" : k, $ = le((Z, X) => {
2279
2309
  const Q = L.current;
2280
2310
  if (Q !== null && Q.path === Z && Q.snapshot === X) return;
2281
2311
  L.current = { path: Z, snapshot: X };
2282
2312
  const oe = X.document;
2283
2313
  if (oe.kind === "failure") {
2284
- T.noteFailureShown(X) && h(b.documentFailed(ae(Z), se(b, oe.failure.reason)));
2314
+ R.noteFailureShown(X) && h(b.documentFailed(se(Z), ae(b, oe.failure.reason)));
2285
2315
  return;
2286
2316
  }
2287
- w?.(Z, oe), d && (Q === null || Q.path !== Z || Q.snapshot.document.kind === "failure") && O.announce(b.documentShown(oe.name));
2317
+ g?.(Z, oe), d && (Q === null || Q.path !== Z || Q.snapshot.document.kind === "failure") && M.announce(b.documentShown(oe.name));
2288
2318
  });
2289
2319
  te(() => {
2290
2320
  $(e, t);
2291
2321
  }, [e, t]);
2292
- const B = le(() => {
2322
+ const I = le(() => {
2293
2323
  m.kind === "panel" && m.consume();
2294
2324
  }), K = le((Z) => {
2295
- const X = M.current;
2296
- if (X === null || !s.current) return null;
2325
+ const X = A.current;
2326
+ if (X === null || !a.current) return null;
2297
2327
  const { activeElement: Q, body: oe } = X.ownerDocument;
2298
- return Q !== null && Q !== oe ? null : al(X, S, Z);
2328
+ return Q !== null && Q !== oe ? null : sl(X, S, Z);
2299
2329
  }), U = le((Z) => {
2300
- const X = M.current;
2301
- X !== null && Ut(X, Z, s.current);
2302
- }), ie = le((Z) => f.reveal(Z)), ht = le((Z) => qt(M.current, Z, f));
2330
+ const X = A.current;
2331
+ X !== null && Ut(X, Z, a.current);
2332
+ }), ie = le((Z) => f.reveal(Z)), ht = le((Z) => qt(A.current, Z, f));
2303
2333
  return te(() => {
2304
2334
  if (r) return;
2305
- const Z = a.current.path !== e, X = Z || a.current.document !== S;
2306
- a.current = { path: e, document: S };
2307
- const Q = g.current !== e;
2308
- g.current = e;
2335
+ const Z = s.current.path !== e, X = Z || s.current.document !== S;
2336
+ s.current = { path: e, document: S };
2337
+ const Q = w.current !== e;
2338
+ w.current = e;
2309
2339
  let oe = null;
2310
- m.kind === "page" ? E.current !== m.navigation && (E.current = m.navigation, v.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment, B());
2340
+ m.kind === "page" ? E.current !== m.navigation && (E.current = m.navigation, v.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment, I());
2311
2341
  const pt = () => {
2312
2342
  const He = oe === null ? null : ht(oe);
2313
2343
  if (!X) {
@@ -2318,7 +2348,7 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2318
2348
  Z && He === null && vt !== null && ie(vt);
2319
2349
  };
2320
2350
  Q ? queueMicrotask(pt) : pt();
2321
- }, [m, e, S, r]), /* @__PURE__ */ c(he, { value: C, children: /* @__PURE__ */ c(xe, { kind: S.kind, view: V, label: l(e, S), stale: x, busy: x, frameRef: M, intent: z, children: /* @__PURE__ */ c(Ln, { value: q, children: /* @__PURE__ */ c(Oi, { children: /* @__PURE__ */ c(ll, { path: e, document: S, view: Y, viewer: o, onRetry: W, editing: p }, e) }) }) }) });
2351
+ }, [m, e, S, r]), /* @__PURE__ */ c(he, { value: O, children: /* @__PURE__ */ c(xe, { kind: S.kind, view: V, label: l(e, S), stale: x, busy: x, frameRef: A, intent: z, children: /* @__PURE__ */ c(Ln, { value: q, children: /* @__PURE__ */ c(Mi, { children: /* @__PURE__ */ c(ll, { path: e, document: S, view: Y, viewer: o, onRetry: W, editing: p }, e) }) }) }) });
2322
2352
  }, mt = Object.freeze({ kind: "skeleton" }), ul = (e, t, n, r, o) => {
2323
2353
  if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
2324
2354
  const i = ue(t);
@@ -2330,26 +2360,26 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2330
2360
  const o = t.kind === "streaming" ? fl(t.path, ne(t.promise)) : t;
2331
2361
  return o.kind !== "document" ? /* @__PURE__ */ c(ut, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(dl, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
2332
2362
  }, $n = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: i, paneScroll: l, announces: u, announceFailure: m, onDocumentShown: f }) => {
2333
- const { config: d, labels: h, theme: w, documents: b } = D(), O = br(), T = _(!1);
2363
+ const { config: d, labels: h, theme: g, documents: b } = D(), M = br(), R = _(!1);
2334
2364
  H(() => {
2335
- T.current = !0;
2365
+ R.current = !0;
2336
2366
  }, []);
2337
- const [S, M] = I(null), [L, E] = I(n), v = P(() => e === null ? void 0 : b.peek(e), [b, e]), s = ee(b.subscribe, v, v), a = P(() => S === null ? void 0 : b.peek(S), [b, S]), g = ee(b.subscribe, a, a);
2367
+ const [S, A] = B(null), [L, E] = B(n), v = P(() => e === null ? void 0 : b.peek(e), [b, e]), a = ee(b.subscribe, v, v), s = P(() => S === null ? void 0 : b.peek(S), [b, S]), w = ee(b.subscribe, s, s);
2338
2368
  H(() => e === null ? void 0 : b.open(e), [b, e]), H(() => S === null ? void 0 : b.retain(S), [b, S]);
2339
- const R = e === null ? mt : ul(e, s, S, g, !T.current), A = e === null ? null : R.kind === "document" && !R.stale ? R.path : S;
2340
- A !== S && M(A);
2341
- const N = R.kind !== "document" || R.path === e;
2369
+ const T = e === null ? mt : ul(e, a, S, w, !R.current), C = e === null ? null : T.kind === "document" && !T.stale ? T.path : S;
2370
+ C !== S && A(C);
2371
+ const N = T.kind !== "document" || T.path === e;
2342
2372
  N && n !== L && E(n);
2343
2373
  const q = G(() => Ji(h), [h]), W = G(() => [...d.iframeHosts], [d]), z = o.kind === "panel", j = G(
2344
2374
  () => ({
2345
2375
  labels: q,
2346
2376
  emptyMessage: h.documentEmpty,
2347
- theme: w,
2377
+ theme: g,
2348
2378
  availableStyles: d.documentStyles,
2349
2379
  iFrameAllowedDomains: W,
2350
2380
  embeds: d.embeds,
2351
2381
  linkComponent: $i,
2352
- toolbar: O,
2382
+ toolbar: M,
2353
2383
  style: r.style,
2354
2384
  onStyleChange: r.onStyleChange,
2355
2385
  align: r.align,
@@ -2362,13 +2392,13 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2362
2392
  maxWidth: r.maxWidth === void 0 ? void 0 : `min(${r.maxWidth}, 100%)`,
2363
2393
  renderScrollBar: z ? void 0 : Sn
2364
2394
  }),
2365
- [q, h.documentEmpty, w, d.documentStyles, W, d.embeds, O, r, z]
2366
- ), Y = P((re, p) => z ? p === null || p.kind === "failure" ? ae(re) : p.name : h.documentRegion, [z, h.documentRegion]), V = z ? "content" : "fill";
2395
+ [q, h.documentEmpty, g, d.documentStyles, W, d.embeds, M, r, z]
2396
+ ), Y = P((re, p) => z ? p === null || p.kind === "failure" ? se(re) : p.name : h.documentRegion, [z, h.documentRegion]), V = z ? "content" : "fill";
2367
2397
  return e === null ? /* @__PURE__ */ c(he, { value: V, children: /* @__PURE__ */ c(tl, { absence: t, announces: u, announceFailure: m }) }) : /* @__PURE__ */ c(he, { value: V, children: /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c(ut, { label: Y(e, null) }), children: /* @__PURE__ */ c(
2368
2398
  ml,
2369
2399
  {
2370
2400
  requestedPath: e,
2371
- content: R,
2401
+ content: T,
2372
2402
  markup: N ? n : L,
2373
2403
  viewer: j,
2374
2404
  editLayout: r.editLayout,
@@ -2382,47 +2412,47 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2382
2412
  }
2383
2413
  ) }) });
2384
2414
  }, hl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
2385
- const { config: i, viewSettings: l, announcer: u } = D(), m = Me((A) => A.style), f = Me((A) => A.align), d = Fe(), h = nn(), w = lt(), { view: b, overrides: O, embed: T } = r, S = P(
2386
- (A) => {
2387
- if (w.kind !== "location") return;
2388
- const N = el(i, w.location, A);
2415
+ const { config: i, viewSettings: l, announcer: u } = D(), m = Ae((C) => C.style), f = Ae((C) => C.align), d = Fe(), h = nn(), g = lt(), { view: b, overrides: M, embed: R } = r, S = P(
2416
+ (C) => {
2417
+ if (g.kind !== "location") return;
2418
+ const N = el(i, g.location, C);
2389
2419
  N !== null && d(N, "browse");
2390
2420
  },
2391
- [i, d, w]
2392
- ), M = P(
2393
- (A) => {
2394
- l.update({ style: A }), S("style");
2421
+ [i, d, g]
2422
+ ), A = P(
2423
+ (C) => {
2424
+ l.update({ style: C }), S("style");
2395
2425
  },
2396
2426
  [l, S]
2397
2427
  ), L = P(
2398
- (A) => {
2399
- l.update({ align: A }), S("align");
2428
+ (C) => {
2429
+ l.update({ align: C }), S("align");
2400
2430
  },
2401
2431
  [l, S]
2402
- ), E = Nn(i, O.style, m), v = Dn(O.align, f), s = G(
2432
+ ), E = Nn(i, M.style, m), v = Dn(M.align, f), a = G(
2403
2433
  () => ({
2404
2434
  style: E,
2405
- onStyleChange: M,
2435
+ onStyleChange: A,
2406
2436
  align: v,
2407
2437
  onAlignChange: L,
2408
- showToc: T.showToc !== !1,
2409
- showStyle: T.showStyle !== !1,
2410
- showAlign: T.showAlign !== !1,
2411
- padding: T.padding,
2412
- width: T.width,
2413
- maxWidth: T.maxWidth,
2438
+ showToc: R.showToc !== !1,
2439
+ showStyle: R.showStyle !== !1,
2440
+ showAlign: R.showAlign !== !1,
2441
+ padding: R.padding,
2442
+ width: R.width,
2443
+ maxWidth: R.maxWidth,
2414
2444
  editLayout: "fill"
2415
2445
  }),
2416
- [E, M, v, L, T]
2417
- ), a = G(() => ({ kind: "page", view: b, overrides: O, embed: T }), [b, O, T]), g = G(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), R = P((A) => u.announce(A), [u]);
2418
- return /* @__PURE__ */ c($n, { path: e, absence: t, markup: n, display: s, navigation: a, fragment: g, paneScroll: li, announces: !0, announceFailure: R, onDocumentShown: o });
2446
+ [E, A, v, L, R]
2447
+ ), s = G(() => ({ kind: "page", view: b, overrides: M, embed: R }), [b, M, R]), w = G(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), T = P((C) => u.announce(C), [u]);
2448
+ return /* @__PURE__ */ c($n, { path: e, absence: t, markup: n, display: a, navigation: s, fragment: w, paneScroll: li, announces: !0, announceFailure: T, onDocumentShown: o });
2419
2449
  }, pl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
2420
- const { config: i, viewSettings: l } = D(), u = Me((a) => a.style), m = Me((a) => a.align), [f, d] = I(() => Nn(i, void 0, u)), h = Dn(void 0, m), w = P((a) => l.update({ align: a }), [l]), { maximized: b, onDocumentLink: O, pendingHash: T, onHashConsumed: S, announceFailure: M, paneScroll: L } = r, E = G(
2450
+ const { config: i, viewSettings: l } = D(), u = Ae((s) => s.style), m = Ae((s) => s.align), [f, d] = B(() => Nn(i, void 0, u)), h = Dn(void 0, m), g = P((s) => l.update({ align: s }), [l]), { maximized: b, onDocumentLink: M, pendingHash: R, onHashConsumed: S, announceFailure: A, paneScroll: L } = r, E = G(
2421
2451
  () => ({
2422
2452
  style: f,
2423
2453
  onStyleChange: d,
2424
2454
  align: h,
2425
- onAlignChange: w,
2455
+ onAlignChange: g,
2426
2456
  showToc: b,
2427
2457
  showStyle: b,
2428
2458
  showAlign: b,
@@ -2431,11 +2461,11 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
2431
2461
  maxWidth: void 0,
2432
2462
  editLayout: b ? "fill" : "content"
2433
2463
  }),
2434
- [f, h, w, b]
2435
- ), v = G(() => ({ kind: "panel", onDocumentLink: O }), [O]), s = G(() => ({ kind: "panel", fragment: T, consume: S }), [T, S]);
2436
- return /* @__PURE__ */ c($n, { path: e, absence: t, markup: n, display: E, navigation: v, fragment: s, paneScroll: L, announces: !1, announceFailure: M, onDocumentShown: o });
2464
+ [f, h, g, b]
2465
+ ), v = G(() => ({ kind: "panel", onDocumentLink: M }), [M]), a = G(() => ({ kind: "panel", fragment: R, consume: S }), [R, S]);
2466
+ return /* @__PURE__ */ c($n, { path: e, absence: t, markup: n, display: E, navigation: v, fragment: a, paneScroll: L, announces: !1, announceFailure: A, onDocumentShown: o });
2437
2467
  }, vl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ c(hl, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ c(pl, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
2438
- function gl({
2468
+ function wl({
2439
2469
  title: e,
2440
2470
  titleId: t,
2441
2471
  ...n
@@ -2456,7 +2486,7 @@ function gl({
2456
2486
  clipRule: "evenodd"
2457
2487
  }));
2458
2488
  }
2459
- const wl = /* @__PURE__ */ y.forwardRef(gl);
2489
+ const gl = /* @__PURE__ */ y.forwardRef(wl);
2460
2490
  function bl({
2461
2491
  title: e,
2462
2492
  titleId: t,
@@ -2548,8 +2578,8 @@ function kl({
2548
2578
  clipRule: "evenodd"
2549
2579
  }));
2550
2580
  }
2551
- const Rl = /* @__PURE__ */ y.forwardRef(kl);
2552
- function Tl({
2581
+ const Tl = /* @__PURE__ */ y.forwardRef(kl);
2582
+ function Rl({
2553
2583
  title: e,
2554
2584
  titleId: t,
2555
2585
  ...n
@@ -2572,8 +2602,8 @@ function Tl({
2572
2602
  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"
2573
2603
  }));
2574
2604
  }
2575
- const Ol = /* @__PURE__ */ y.forwardRef(Tl);
2576
- function Cl({
2605
+ const Ml = /* @__PURE__ */ y.forwardRef(Rl);
2606
+ function Ol({
2577
2607
  title: e,
2578
2608
  titleId: t,
2579
2609
  ...n
@@ -2596,7 +2626,7 @@ function Cl({
2596
2626
  clipRule: "evenodd"
2597
2627
  }));
2598
2628
  }
2599
- const Al = /* @__PURE__ */ y.forwardRef(Cl);
2629
+ const Cl = /* @__PURE__ */ y.forwardRef(Ol);
2600
2630
  function Ll({
2601
2631
  title: e,
2602
2632
  titleId: t,
@@ -2618,7 +2648,7 @@ function Ll({
2618
2648
  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"
2619
2649
  }));
2620
2650
  }
2621
- const Ml = /* @__PURE__ */ y.forwardRef(Ll);
2651
+ const Al = /* @__PURE__ */ y.forwardRef(Ll);
2622
2652
  function Nl({
2623
2653
  title: e,
2624
2654
  titleId: t,
@@ -2639,7 +2669,7 @@ function Nl({
2639
2669
  }));
2640
2670
  }
2641
2671
  const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId: n }) => {
2642
- const { labels: r, onEditGrant: o } = D(), [i, l] = I(!1), u = () => {
2672
+ const { labels: r, onEditGrant: o } = D(), [i, l] = B(!1), u = () => {
2643
2673
  o === void 0 || i || (l(!0), o(e).then((m) => {
2644
2674
  m && t();
2645
2675
  }).finally(() => l(!1)));
@@ -2660,51 +2690,51 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
2660
2690
  return;
2661
2691
  }
2662
2692
  e.setView(t, n), r && e.sideBySide() && e.setSideBySide(!1);
2663
- }, Ys = (e) => e === "split" ? null : e, ql = (e) => e === "preview" ? "editor" : "preview", _l = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Bl = (e, t) => {
2693
+ }, Ja = (e) => e === "split" ? null : e, ql = (e) => e === "preview" ? "editor" : "preview", _l = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Il = (e, t) => {
2664
2694
  if (e.isComposing || e.altKey || e.shiftKey || (t ? !e.metaKey || e.ctrlKey : !e.ctrlKey || e.metaKey)) return !1;
2665
2695
  const n = e.key.toLowerCase();
2666
2696
  return n === "e" || e.code === "KeyE" && /^\p{L}$/u.test(n) && !/^[a-z]$/u.test(n);
2667
2697
  }, Gt = (e, t, n) => {
2668
2698
  const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
2669
2699
  return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
2670
- }, Il = ({ path: e, documentName: t, open: n, onClose: r }) => {
2671
- const { data: o, edits: i, labels: l, locale: u, announcer: m } = D(), f = Se(), [d, h] = I(null), [w, b] = I(0), [O, T] = I(null), [S, M] = I(null), L = G(() => new Intl.DateTimeFormat(u, { dateStyle: "medium", timeStyle: "short" }), [u]), E = P(() => {
2672
- T(null), M(null);
2700
+ }, Bl = ({ path: e, documentName: t, open: n, onClose: r }) => {
2701
+ const { data: o, edits: i, labels: l, locale: u, announcer: m } = D(), f = Se(), [d, h] = B(null), [g, b] = B(0), [M, R] = B(null), [S, A] = B(null), L = G(() => new Intl.DateTimeFormat(u, { dateStyle: "medium", timeStyle: "short" }), [u]), E = P(() => {
2702
+ R(null), A(null);
2673
2703
  }, []), v = vn({ open: n, onOpen: E, onDismiss: r });
2674
2704
  te(() => {
2675
2705
  if (!n) return;
2676
- const g = new AbortController();
2677
- return h(null), o.revisions(e, g.signal).then((R) => {
2678
- "kind" in R && h(R);
2679
- }), () => g.abort();
2680
- }, [n, o, e, w]), te(() => {
2681
- if (!n || O === null) return;
2682
- const g = new AbortController();
2683
- return M(null), o.revision(e, O, g.signal).then((R) => {
2684
- "kind" in R && M(R);
2685
- }), () => g.abort();
2686
- }, [n, o, e, O]);
2687
- const s = () => {
2706
+ const w = new AbortController();
2707
+ return h(null), o.revisions(e, w.signal).then((T) => {
2708
+ "kind" in T && h(T);
2709
+ }), () => w.abort();
2710
+ }, [n, o, e, g]), te(() => {
2711
+ if (!n || M === null) return;
2712
+ const w = new AbortController();
2713
+ return A(null), o.revision(e, M, w.signal).then((T) => {
2714
+ "kind" in T && A(T);
2715
+ }), () => w.abort();
2716
+ }, [n, o, e, M]);
2717
+ const a = () => {
2688
2718
  S === null || S.kind !== "revision" || (i.replaceDraft(e, S.text), m.announce(l.historyRestored(t)), r());
2689
- }, a = d !== null && d.kind === "revisions" ? d.revisions.find((g) => g.id === O) : void 0;
2719
+ }, s = d !== null && d.kind === "revisions" ? d.revisions.find((w) => w.id === M) : void 0;
2690
2720
  return /* @__PURE__ */ c("dialog", { ...v, className: "aqmx-confirm aqmx-history", "aria-labelledby": f, "data-testid": "markdown-explorer-history", children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
2691
2721
  /* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: l.historyTitle(t) }),
2692
- d === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: l.historyLoading }) : d.kind === "failure" ? /* @__PURE__ */ c(me, { failure: d.failure, alert: !1, onRetry: () => b((g) => g + 1), testId: "markdown-explorer-history-failure" }) : d.revisions.length === 0 ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: l.historyEmpty }) : /* @__PURE__ */ c("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: d.revisions.map((g) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": g.id === O, "data-testid": "markdown-explorer-history-entry", onClick: () => T(g.id), children: [
2693
- /* @__PURE__ */ c("span", { children: Gt(g, L, l.historyEntry) }),
2694
- g.current ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyCurrent }) : null,
2695
- g.kept ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyKept }) : null
2696
- ] }) }, g.id)) }),
2697
- O === null ? null : S === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", children: l.historyLoading }) : S.kind === "failure" ? /* @__PURE__ */ c(me, { failure: S.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
2698
- /* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": a === void 0 ? l.historyTitle(t) : Gt(a, L, l.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: S.text }) })
2722
+ d === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: l.historyLoading }) : d.kind === "failure" ? /* @__PURE__ */ c(me, { failure: d.failure, alert: !1, onRetry: () => b((w) => w + 1), testId: "markdown-explorer-history-failure" }) : d.revisions.length === 0 ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: l.historyEmpty }) : /* @__PURE__ */ c("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: d.revisions.map((w) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": w.id === M, "data-testid": "markdown-explorer-history-entry", onClick: () => R(w.id), children: [
2723
+ /* @__PURE__ */ c("span", { children: Gt(w, L, l.historyEntry) }),
2724
+ w.current ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyCurrent }) : null,
2725
+ w.kept ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyKept }) : null
2726
+ ] }) }, w.id)) }),
2727
+ M === null ? null : S === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", children: l.historyLoading }) : S.kind === "failure" ? /* @__PURE__ */ c(me, { failure: S.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
2728
+ /* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": s === void 0 ? l.historyTitle(t) : Gt(s, L, l.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: S.text }) })
2699
2729
  ),
2700
2730
  /* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
2701
2731
  /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: l.historyClose }),
2702
- /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": S === null || S.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: s, children: l.historyRestore })
2732
+ /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": S === null || S.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: a, children: l.historyRestore })
2703
2733
  ] })
2704
2734
  ] }) });
2705
2735
  }, zl = (e) => {
2706
2736
  const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), i = ue(o)?.document;
2707
- return i === void 0 || i.kind === "failure" ? { edit: null, name: ae(e) } : { edit: i.kind === "markdown" ? i.edit : null, name: i.name };
2737
+ return i === void 0 || i.kind === "failure" ? { edit: null, name: se(e) } : { edit: i.kind === "markdown" ? i.edit : null, name: i.name };
2708
2738
  }, ce = (e) => {
2709
2739
  e.stopPropagation();
2710
2740
  }, jl = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
@@ -2712,39 +2742,39 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
2712
2742
  l.subscribe,
2713
2743
  () => l.session(e) !== void 0,
2714
2744
  () => !1
2715
- ), [f, d] = I(null), h = () => {
2745
+ ), [f, d] = B(null), h = () => {
2716
2746
  if (!m) {
2717
2747
  l.start(e, l.viewAnchor(e));
2718
2748
  return;
2719
2749
  }
2720
2750
  l.flush(e);
2721
- const T = l.session(e);
2722
- T?.dirty === !0 ? d(T.save.kind === "draft" ? "draft" : "unsaved") : l.close(e);
2723
- }, w = () => {
2751
+ const R = l.session(e);
2752
+ R?.dirty === !0 ? d(R.save.kind === "draft" ? "draft" : "unsaved") : l.close(e);
2753
+ }, g = () => {
2724
2754
  m || (fo(), r && l.sideBySide() && i?.prepare?.());
2725
- }, b = n ? o ? u.editDraftDocumentNamed(t) : u.editDocumentNamed(t) : null, O = o ? u.editDraftDocument : u.editDocument;
2755
+ }, b = n ? o ? u.editDraftDocumentNamed(t) : u.editDocumentNamed(t) : null, M = o ? u.editDraftDocument : u.editDocument;
2726
2756
  return /* @__PURE__ */ F(Pe, { children: [
2727
2757
  /* @__PURE__ */ F(
2728
2758
  "button",
2729
2759
  {
2730
2760
  type: "button",
2731
2761
  className: b === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
2732
- title: m ? u.closeEditor : b === null ? O : b,
2762
+ title: m ? u.closeEditor : b === null ? M : b,
2733
2763
  "aria-label": b === null ? void 0 : b,
2734
2764
  "aria-pressed": m,
2735
2765
  "data-testid": "markdown-explorer-document-edit",
2736
2766
  onClick: h,
2737
2767
  onDoubleClick: ce,
2738
- onPointerEnter: w,
2739
- onFocus: w,
2768
+ onPointerEnter: g,
2769
+ onFocus: g,
2740
2770
  children: [
2741
- /* @__PURE__ */ c(Ml, { "aria-hidden": "true" }),
2771
+ /* @__PURE__ */ c(Al, { "aria-hidden": "true" }),
2742
2772
  b === null ? /* @__PURE__ */ c("span", { children: u.editDocumentLabel }) : null
2743
2773
  ]
2744
2774
  }
2745
2775
  ),
2746
2776
  /* @__PURE__ */ c(
2747
- gn,
2777
+ wn,
2748
2778
  {
2749
2779
  open: f !== null,
2750
2780
  title: f === "draft" ? u.draftDiscardTitle : u.unsavedTitle,
@@ -2781,27 +2811,27 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
2781
2811
  }, Vl = ({ session: e }) => {
2782
2812
  const { labels: t } = D(), n = Pr(t, e);
2783
2813
  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 });
2784
- }, Ul = Object.freeze(["editor", "split", "preview"]), Zl = Object.freeze(["editor", "preview"]), Gl = Object.freeze({ editor: Fn, split: Dl, preview: Al }), Wl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2785
- const { draftConverter: i, edits: l, labels: u } = D(), m = lo(), f = Fl(r, m, o), d = o ? Ul : Zl, h = Se(), w = _(/* @__PURE__ */ new Map()), b = {
2814
+ }, Ul = Object.freeze(["editor", "split", "preview"]), Zl = Object.freeze(["editor", "preview"]), Gl = Object.freeze({ editor: Fn, split: Dl, preview: Cl }), Wl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2815
+ const { draftConverter: i, edits: l, labels: u } = D(), m = lo(), f = Fl(r, m, o), d = o ? Ul : Zl, h = Se(), g = _(/* @__PURE__ */ new Map()), b = {
2786
2816
  editor: { label: u.editViewEditor, tooltip: u.editViewEditorTooltip },
2787
2817
  split: { label: u.editViewSplit, tooltip: u.editViewSplitTooltip },
2788
2818
  preview: { label: u.editViewPreview, tooltip: u.editViewPreviewTooltip }
2789
- }, O = () => {
2819
+ }, M = () => {
2790
2820
  l.preparePreview(e), i?.prepare?.();
2791
- }, T = (S) => {
2792
- if (!Bl(S.nativeEvent, _l(navigator.platform))) return;
2821
+ }, R = (S) => {
2822
+ if (!Il(S.nativeEvent, _l(navigator.platform))) return;
2793
2823
  hn(S);
2794
- const M = ql(f);
2795
- Zt(l, e, M, o), w.current.get(M)?.focus();
2824
+ const A = ql(f);
2825
+ Zt(l, e, A, o), g.current.get(A)?.focus();
2796
2826
  };
2797
- return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: T, children: d.map((S) => {
2798
- const M = Gl[S], { label: L, tooltip: E } = b[S], v = S === "preview" ? O : void 0;
2827
+ return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: R, children: d.map((S) => {
2828
+ const A = Gl[S], { label: L, tooltip: E } = b[S], v = S === "preview" ? M : void 0;
2799
2829
  return /* @__PURE__ */ F("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
2800
2830
  /* @__PURE__ */ c(
2801
2831
  "input",
2802
2832
  {
2803
- ref: (s) => {
2804
- s === null ? w.current.delete(S) : w.current.set(S, s);
2833
+ ref: (a) => {
2834
+ a === null ? g.current.delete(S) : g.current.set(S, a);
2805
2835
  },
2806
2836
  type: "radio",
2807
2837
  name: h,
@@ -2817,33 +2847,33 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
2817
2847
  onFocus: v
2818
2848
  }
2819
2849
  ),
2820
- /* @__PURE__ */ c(M, { "aria-hidden": "true" }),
2850
+ /* @__PURE__ */ c(A, { "aria-hidden": "true" }),
2821
2851
  n ? null : /* @__PURE__ */ c("span", { children: L })
2822
2852
  ] }, S);
2823
2853
  }) });
2824
2854
  }, Kl = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
2825
- const { edits: i, labels: l } = D(), [u, m] = I(!1);
2855
+ const { edits: i, labels: l } = D(), [u, m] = B(!1);
2826
2856
  if (r.phase.kind !== "editing") return null;
2827
2857
  const f = r.save.kind === "saving", d = f || !r.dirty, h = () => {
2828
2858
  i.flush(e);
2829
2859
  const b = i.session(e);
2830
2860
  b === void 0 || !b.dirty || b.save.kind === "saving" || i.save(e);
2831
- }, w = (b) => n ? { className: "aqmx-icon-button", "aria-label": b } : { className: "aqmx-icon-button aqmx-labelled-button" };
2861
+ }, g = (b) => n ? { className: "aqmx-icon-button", "aria-label": b } : { className: "aqmx-icon-button aqmx-labelled-button" };
2832
2862
  return /* @__PURE__ */ F(Pe, { children: [
2833
- r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...w(l.conflictNext), title: l.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: ce, children: [
2863
+ r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...g(l.conflictNext), title: l.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: ce, children: [
2834
2864
  /* @__PURE__ */ c(Sl, { "aria-hidden": "true" }),
2835
2865
  n ? null : /* @__PURE__ */ c("span", { children: l.conflictNext })
2836
2866
  ] }) : null,
2837
2867
  /* @__PURE__ */ c(Wl, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
2838
- r.history ? /* @__PURE__ */ F("button", { type: "button", ...w(l.historyOpen), title: l.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => m(!0), onDoubleClick: ce, children: [
2839
- /* @__PURE__ */ c(Rl, { "aria-hidden": "true" }),
2868
+ r.history ? /* @__PURE__ */ F("button", { type: "button", ...g(l.historyOpen), title: l.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => m(!0), onDoubleClick: ce, children: [
2869
+ /* @__PURE__ */ c(Tl, { "aria-hidden": "true" }),
2840
2870
  n ? null : /* @__PURE__ */ c("span", { children: l.historyOpen })
2841
2871
  ] }) : null,
2842
- r.save.kind === "draft" ? null : /* @__PURE__ */ F("button", { type: "button", ...w(l.saveDraft), title: l.saveDraftTooltip, "aria-disabled": d, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: h, onDoubleClick: ce, children: [
2843
- /* @__PURE__ */ c(Ol, { "aria-hidden": "true" }),
2872
+ r.save.kind === "draft" ? null : /* @__PURE__ */ F("button", { type: "button", ...g(l.saveDraft), title: l.saveDraftTooltip, "aria-disabled": d, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: h, onDoubleClick: ce, children: [
2873
+ /* @__PURE__ */ c(Ml, { "aria-hidden": "true" }),
2844
2874
  n ? null : /* @__PURE__ */ c("span", { children: l.saveDraft })
2845
2875
  ] }),
2846
- r.history ? /* @__PURE__ */ c(Il, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
2876
+ r.history ? /* @__PURE__ */ c(Bl, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
2847
2877
  ] });
2848
2878
  }, Xl = ({ path: e, session: t }) => {
2849
2879
  const { edits: n } = D();
@@ -2856,58 +2886,58 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
2856
2886
  }, Jl = (e) => {
2857
2887
  const { config: t } = D(), n = Fe(), r = P(() => n(ye(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
2858
2888
  return G(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
2859
- }, Ql = /* @__PURE__ */ new Set(), es = (e, t) => {
2860
- const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), l = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, l), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [d] = I(() => /* @__PURE__ */ new Set()), [h, w] = I(Ql), [b, O] = I(null);
2861
- b !== null && b.path !== e && O(null);
2862
- const T = _(null);
2863
- H(() => (T.current = e, () => {
2864
- T.current = null;
2889
+ }, Ql = /* @__PURE__ */ new Set(), ea = (e, t) => {
2890
+ const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), l = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, l), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [d] = B(() => /* @__PURE__ */ new Set()), [h, g] = B(Ql), [b, M] = B(null);
2891
+ b !== null && b.path !== e && M(null);
2892
+ const R = _(null);
2893
+ H(() => (R.current = e, () => {
2894
+ R.current = null;
2865
2895
  }), [e]);
2866
2896
  const S = P(() => {
2867
2897
  const E = e, v = n.peek(E);
2868
2898
  if (d.has(E) || v?.status === "pending") return;
2869
- const s = t && !Rn(v);
2870
- d.add(E), w(new Set(d)), O(null), (async () => {
2899
+ const a = t && !Tn(v);
2900
+ d.add(E), g(new Set(d)), M(null), (async () => {
2871
2901
  try {
2872
- const a = await n.refresh(E);
2873
- if (T.current !== E || a.status === "superseded") return;
2874
- if (a.status === "failed") {
2875
- O({ path: E, failure: a.failure, stamp: n.answerStampOf(E) }), r.announce(o.documentRefreshFailed(se(o, a.failure.reason)));
2902
+ const s = await n.refresh(E);
2903
+ if (R.current !== E || s.status === "superseded") return;
2904
+ if (s.status === "failed") {
2905
+ M({ path: E, failure: s.failure, stamp: n.answerStampOf(E) }), r.announce(o.documentRefreshFailed(ae(o, s.failure.reason)));
2876
2906
  return;
2877
2907
  }
2878
- const g = ue(n.peek(E));
2879
- if (s || g === null || g.document.kind === "failure") return;
2880
- r.announce(o.documentRefreshed(g.document.name));
2908
+ const w = ue(n.peek(E));
2909
+ if (a || w === null || w.document.kind === "failure") return;
2910
+ r.announce(o.documentRefreshed(w.document.name));
2881
2911
  } finally {
2882
- d.delete(E), w(new Set(d));
2912
+ d.delete(E), g(new Set(d));
2883
2913
  }
2884
2914
  })();
2885
- }, [e, t, d, n, r, o]), M = h.has(e), L = b !== null && b.path === e && b.stamp === f ? b.failure : null;
2886
- return { refreshing: M, unavailable: M || u?.status === "pending", failure: L, refresh: S };
2887
- }, ts = Object.freeze({ kind: "page" }), ns = ({ path: e, placement: t, markup: n }) => {
2888
- const { labels: r } = D(), { refreshing: o, unavailable: i, failure: l, refresh: u } = es(e, t.kind === "page"), m = Yl(e), f = zl(e), d = bn(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, w = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, b = t.kind === "panel", O = t.kind === "panel" ? t.documentName : f.name, T = t.kind === "page" || t.maximized;
2915
+ }, [e, t, d, n, r, o]), A = h.has(e), L = b !== null && b.path === e && b.stamp === f ? b.failure : null;
2916
+ return { refreshing: A, unavailable: A || u?.status === "pending", failure: L, refresh: S };
2917
+ }, ta = Object.freeze({ kind: "page" }), na = ({ path: e, placement: t, markup: n }) => {
2918
+ const { labels: r } = D(), { refreshing: o, unavailable: i, failure: l, refresh: u } = ea(e, t.kind === "page"), m = Yl(e), f = zl(e), d = bn(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, g = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, b = t.kind === "panel", M = t.kind === "panel" ? t.documentName : f.name, R = t.kind === "page" || t.maximized;
2889
2919
  return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": d === void 0 ? void 0 : "true", children: [
2890
2920
  /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
2891
2921
  d === void 0 ? null : /* @__PURE__ */ c(Vl, { session: d }),
2892
- d === void 0 ? null : /* @__PURE__ */ c(Kl, { path: e, documentName: O, iconOnly: b, session: d, previewAvailable: T }),
2922
+ d === void 0 ? null : /* @__PURE__ */ c(Kl, { path: e, documentName: M, iconOnly: b, session: d, previewAvailable: R }),
2893
2923
  d === void 0 && m ? /* @__PURE__ */ F(
2894
2924
  "button",
2895
2925
  {
2896
2926
  type: "button",
2897
- className: w === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
2898
- title: w === null ? r.showMarkup : w,
2899
- "aria-label": w === null ? void 0 : w,
2927
+ className: g === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
2928
+ title: g === null ? r.showMarkup : g,
2929
+ "aria-label": g === null ? void 0 : g,
2900
2930
  "aria-pressed": n.shown,
2901
2931
  "data-testid": "markdown-explorer-document-markup",
2902
2932
  onClick: n.toggle,
2903
2933
  onDoubleClick: ce,
2904
2934
  children: [
2905
2935
  /* @__PURE__ */ c(Fn, { "aria-hidden": "true" }),
2906
- w === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
2936
+ g === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
2907
2937
  ]
2908
2938
  }
2909
2939
  ) : null,
2910
- d !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ c(jl, { path: e, documentName: O, iconOnly: b, previewAvailable: T, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(Hl, { href: f.edit.href, documentName: O, iconOnly: b }) : null,
2940
+ d !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ c(jl, { path: e, documentName: M, iconOnly: b, previewAvailable: R, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(Hl, { href: f.edit.href, documentName: M, iconOnly: b }) : null,
2911
2941
  d === void 0 ? /* @__PURE__ */ F(
2912
2942
  "button",
2913
2943
  {
@@ -2922,27 +2952,27 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
2922
2952
  onClick: u,
2923
2953
  onDoubleClick: ce,
2924
2954
  children: [
2925
- /* @__PURE__ */ c(wl, { "aria-hidden": "true" }),
2955
+ /* @__PURE__ */ c(gl, { "aria-hidden": "true" }),
2926
2956
  h === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
2927
2957
  ]
2928
2958
  }
2929
2959
  ) : null
2930
2960
  ] }),
2931
- d !== void 0 || l === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: r.documentRefreshFailed(se(r, l.reason)) }),
2961
+ d !== void 0 || l === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: r.documentRefreshFailed(ae(r, l.reason)) }),
2932
2962
  d === void 0 ? null : /* @__PURE__ */ c(Xl, { path: e, session: d })
2933
2963
  ] });
2934
- }, rs = ({ location: e }) => {
2964
+ }, ra = ({ location: e }) => {
2935
2965
  const t = e.doc, n = G(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = Jl(e);
2936
2966
  return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...et, children: [
2937
- /* @__PURE__ */ c(ns, { path: t, placement: ts, markup: r }),
2967
+ /* @__PURE__ */ c(na, { path: t, placement: ta, markup: r }),
2938
2968
  /* @__PURE__ */ c(vl, { path: t, absence: Qi, markup: e.markup, variant: n })
2939
2969
  ] });
2940
- }, os = ({ holds: e, testId: t }) => {
2970
+ }, oa = ({ holds: e, testId: t }) => {
2941
2971
  const { labels: n, announcer: r } = D(), o = Se();
2942
2972
  H(() => e ? r.claim(o) : void 0, [e, r, o]);
2943
2973
  const i = P(() => r.shownIn(o), [r, o]), l = ee(r.subscribe, i, i);
2944
2974
  return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: l.length > 1 ? n.announcementSequence(l) : l[0] });
2945
- }, fe = Object.freeze([]), is = (e) => {
2975
+ }, fe = Object.freeze([]), ia = (e) => {
2946
2976
  const t = /* @__PURE__ */ new Set();
2947
2977
  let n = fe, r = [], o = !1;
2948
2978
  const i = [], l = (d) => {
@@ -2960,7 +2990,7 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
2960
2990
  announce: (d) => {
2961
2991
  if (typeof d == "string") r.push({ sentence: d });
2962
2992
  else {
2963
- const h = r.find((w) => "list" in w && w.list === d.list);
2993
+ const h = r.find((g) => "list" in g && g.list === d.list);
2964
2994
  h !== void 0 && "items" in h ? h.items.push(d.item) : r.push({ list: d.list, items: [d.item] });
2965
2995
  }
2966
2996
  o || (o = !0, n !== fe && l(fe), e.request(f));
@@ -2971,75 +3001,75 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
2971
3001
  claim: (d) => {
2972
3002
  const h = { region: d };
2973
3003
  return m(() => i.push(h)), () => m(() => {
2974
- const w = i.indexOf(h);
2975
- w !== -1 && i.splice(w, 1);
3004
+ const g = i.indexOf(h);
3005
+ g !== -1 && i.splice(g, 1);
2976
3006
  });
2977
3007
  },
2978
3008
  shownIn: (d) => u() === d ? n : fe
2979
3009
  };
2980
- }, we = Object.freeze({ status: "cancelled" }), ls = (e) => {
3010
+ }, ge = Object.freeze({ status: "cancelled" }), la = (e) => {
2981
3011
  if (e === null || typeof e != "object") return null;
2982
3012
  const { failure: t } = e;
2983
- if (ar(t) !== null) return null;
3013
+ if (sr(t) !== null) return null;
2984
3014
  const { reason: n, code: r } = t;
2985
3015
  return cr(n, r);
2986
- }, ss = ({ dataPath: e, onScope: t, fetch: n }) => {
2987
- const r = n ?? ((f, d) => globalThis.fetch(f, d)), o = (f, d) => `${e}/${f}?${new URLSearchParams(d).toString()}`, i = async (f, d, h, w) => {
3016
+ }, aa = ({ dataPath: e, onScope: t, fetch: n }) => {
3017
+ const r = n ?? ((f, d) => globalThis.fetch(f, d)), o = (f, d) => `${e}/${f}?${new URLSearchParams(d).toString()}`, i = async (f, d, h, g) => {
2988
3018
  let b;
2989
3019
  try {
2990
3020
  b = await r(f, { credentials: "same-origin", ...d, headers: { Accept: "application/json", ...d.headers } });
2991
3021
  } catch {
2992
- return w({ reason: "failed" });
3022
+ return g({ reason: "failed" });
2993
3023
  }
2994
3024
  b.status === 401 && t(null);
2995
- const O = b.headers.get(rr);
2996
- O !== null && t(O);
2997
- let T;
3025
+ const M = b.headers.get(rr);
3026
+ M !== null && t(M);
3027
+ let R;
2998
3028
  try {
2999
- T = await b.json();
3029
+ R = await b.json();
3000
3030
  } catch {
3001
- return w({ reason: Et(b.status) });
3031
+ return g({ reason: Et(b.status) });
3002
3032
  }
3003
3033
  let S;
3004
3034
  try {
3005
- S = h(T);
3035
+ S = h(R);
3006
3036
  } catch {
3007
3037
  S = !1;
3008
3038
  }
3009
- if (S) return T;
3010
- const M = ls(T);
3011
- return w(M !== null ? M : { reason: b.status === 200 ? "failed" : Et(b.status) });
3039
+ if (S) return R;
3040
+ const A = la(R);
3041
+ return g(A !== null ? A : { reason: b.status === 200 ? "failed" : Et(b.status) });
3012
3042
  }, l = { [xt]: dr }, u = { [xt]: pr, "Content-Type": `${hr}; charset=utf-8` }, m = async (f, d, h) => {
3013
- const w = await i(f, d, h, (b) => Ve(b.reason, b.code));
3014
- return d.signal.aborted ? we : w;
3043
+ const g = await i(f, d, h, (b) => Ve(b.reason, b.code));
3044
+ return d.signal.aborted ? ge : g;
3015
3045
  };
3016
3046
  return {
3017
3047
  tree: (f) => i(o("tree", { [J.source]: f }), { method: "GET" }, yt, (d) => ({ status: "error", failure: d })),
3018
3048
  children: async (f, d, h) => {
3019
- const w = await i(o("children", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, sr, (b) => ({ status: "error", failure: b }));
3020
- return h.aborted ? we : w;
3049
+ const g = await i(o("children", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, ar, (b) => ({ status: "error", failure: b }));
3050
+ return h.aborted ? ge : g;
3021
3051
  },
3022
3052
  ancestors: async (f, d, h) => {
3023
- const w = await i(o("ancestors", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, lr, (b) => ({ status: "error", failure: b }));
3024
- return h.aborted ? we : w;
3053
+ const g = await i(o("ancestors", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, lr, (b) => ({ status: "error", failure: b }));
3054
+ return h.aborted ? ge : g;
3025
3055
  },
3026
3056
  reveal: async (f, d, h) => {
3027
- const w = await i(o("reveal", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, ir, (b) => ({ status: "error", failure: b }));
3028
- return h.aborted ? we : w;
3057
+ const g = await i(o("reveal", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, ir, (b) => ({ status: "error", failure: b }));
3058
+ return h.aborted ? ge : g;
3029
3059
  },
3030
- document: (f, { refresh: d }) => i(o("document", { [J.path]: f }), d ? { method: "GET", headers: l } : { method: "GET" }, wr, (h) => Ve(h.reason, h.code)),
3060
+ document: (f, { refresh: d }) => i(o("document", { [J.path]: f }), d ? { method: "GET", headers: l } : { method: "GET" }, gr, (h) => Ve(h.reason, h.code)),
3031
3061
  text: async (f, d) => {
3032
- const h = await i(o("text", { [J.path]: f }), { method: "GET", signal: d }, or, (w) => Ve(w.reason, w.code));
3033
- return d.aborted ? we : h;
3062
+ const h = await i(o("text", { [J.path]: f }), { method: "GET", signal: d }, or, (g) => Ve(g.reason, g.code));
3063
+ return d.aborted ? ge : h;
3034
3064
  },
3035
- edit: (f, d) => m(o("edit", { [J.path]: f }), { method: "GET", signal: d }, gr),
3036
- save: (f, d, h, w) => m(o("save", { [J.path]: f, [J.base]: d }), { method: "POST", headers: u, body: h, signal: w }, vr),
3065
+ edit: (f, d) => m(o("edit", { [J.path]: f }), { method: "GET", signal: d }, wr),
3066
+ save: (f, d, h, g) => m(o("save", { [J.path]: f, [J.base]: d }), { method: "POST", headers: u, body: h, signal: g }, vr),
3037
3067
  preview: (f, d, h) => m(o("preview", { [J.path]: f }), { method: "POST", headers: u, body: d, signal: h }, mr),
3038
3068
  revisions: (f, d) => m(o("revisions", { [J.path]: f }), { method: "GET", signal: d }, fr),
3039
3069
  revision: (f, d, h) => m(o("revision", { [J.path]: f, [J.revision]: d }), { method: "GET", signal: h }, ur),
3040
3070
  refresh: (f) => i(o("refresh", { [J.source]: f }), { method: "POST", headers: l }, yt, (d) => ({ status: "error", failure: d }))
3041
3071
  };
3042
- }, as = () => {
3072
+ }, sa = () => {
3043
3073
  let e = null, t = null;
3044
3074
  return {
3045
3075
  settle: (n) => {
@@ -3054,7 +3084,7 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
3054
3084
  return t = null, o;
3055
3085
  }
3056
3086
  };
3057
- }, cs = (e) => {
3087
+ }, ca = (e) => {
3058
3088
  const t = Qe(e);
3059
3089
  if (t === null) return bt;
3060
3090
  try {
@@ -3066,11 +3096,11 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
3066
3096
  let n = null;
3067
3097
  const r = () => {
3068
3098
  if (n === null) {
3069
- const i = cs(e);
3070
- n = { changes: i, settings: wt(t, i) };
3099
+ const i = ca(e);
3100
+ n = { changes: i, settings: gt(t, i) };
3071
3101
  }
3072
3102
  return n;
3073
- }, o = Oe();
3103
+ }, o = Me();
3074
3104
  return {
3075
3105
  storageKey: e,
3076
3106
  defaults: t,
@@ -3079,17 +3109,17 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
3079
3109
  subscribe: o.subscribe,
3080
3110
  advance: (i) => {
3081
3111
  const { changes: l, settings: u } = r(), m = Kn(l, i, Xn(u, i)[i], t);
3082
- return n = { changes: m, settings: wt(t, m) }, o.emit(), Je(e, Yn(m)), n.settings;
3112
+ return n = { changes: m, settings: gt(t, m) }, o.emit(), Je(e, Yn(m)), n.settings;
3083
3113
  }
3084
3114
  };
3085
- }, ds = Object.freeze({ status: "refreshed" }), us = Object.freeze({ status: "superseded" }), ot = Object.freeze({ status: "deferred" }), fs = wn(ot), qn = 4, ms = qn - 1, Kt = Object.freeze({ status: "loading" }), hs = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), ps = (e) => {
3086
- const t = /* @__PURE__ */ new Map(), n = kn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = Oe(), m = /* @__PURE__ */ new Set();
3115
+ }, da = Object.freeze({ status: "refreshed" }), ua = Object.freeze({ status: "superseded" }), ot = Object.freeze({ status: "deferred" }), fa = gn(ot), qn = 4, ma = qn - 1, Kt = Object.freeze({ status: "loading" }), ha = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), pa = (e) => {
3116
+ const t = /* @__PURE__ */ new Map(), n = kn(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = Me(), m = /* @__PURE__ */ new Set();
3087
3117
  let f = 0, d = 0;
3088
- const h = { direct: null, bulk: null }, w = /* @__PURE__ */ new Set();
3089
- let b = !1, O = 0;
3090
- const T = () => {
3091
- O += 1, u.emit();
3092
- }, S = (p) => o.get(p) ?? 0, M = (p) => {
3118
+ const h = { direct: null, bulk: null }, g = /* @__PURE__ */ new Set();
3119
+ let b = !1, M = 0;
3120
+ const R = () => {
3121
+ M += 1, u.emit();
3122
+ }, S = (p) => o.get(p) ?? 0, A = (p) => {
3093
3123
  let x = l.get(p);
3094
3124
  return x === void 0 && (x = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, l.set(p, x)), x;
3095
3125
  }, L = (p, x, k) => {
@@ -3097,58 +3127,58 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
3097
3127
  }, E = (p) => {
3098
3128
  const x = l.get(p);
3099
3129
  if (x !== void 0) {
3100
- for (const [k, C] of [...x.inFlight])
3101
- L(x, k, C), C.controller.abort();
3130
+ for (const [k, O] of [...x.inFlight])
3131
+ L(x, k, O), O.controller.abort();
3102
3132
  x.direct.clear(), x.bulk.clear(), x.unclaimed.clear();
3103
3133
  }
3104
3134
  }, v = (p) => {
3105
3135
  const x = S(p) + 1;
3106
3136
  return o.set(p, x), E(p), x;
3107
- }, s = (p, x) => {
3108
- const k = Ee(p), C = { promise: p, opened: x, stale: !1, loadedAt: k?.status === "ok" ? k.loadedAt : null };
3137
+ }, a = (p, x) => {
3138
+ const k = Ee(p), O = { promise: p, opened: x, stale: !1, loadedAt: k?.status === "ok" ? k.loadedAt : null };
3109
3139
  return p.status === "pending" && p.then(($) => {
3110
- $.status === "ok" && (C.loadedAt = $.loadedAt);
3111
- }), C;
3112
- }, a = (p) => {
3140
+ $.status === "ok" && (O.loadedAt = $.loadedAt);
3141
+ }), O;
3142
+ }, s = (p) => {
3113
3143
  let x = r.get(p);
3114
3144
  return x === void 0 && (x = /* @__PURE__ */ new Map(), r.set(p, x)), x;
3115
- }, g = (p) => {
3116
- const x = [...l.keys()], k = h[p], C = k === null ? 0 : x.indexOf(k) + 1;
3145
+ }, w = (p) => {
3146
+ const x = [...l.keys()], k = h[p], O = k === null ? 0 : x.indexOf(k) + 1;
3117
3147
  for (let $ = 0; $ < x.length; $ += 1) {
3118
- const B = x[(C + $) % x.length], K = B === void 0 ? void 0 : l.get(B);
3119
- if (!(B === void 0 || K === void 0)) {
3148
+ const I = x[(O + $) % x.length], K = I === void 0 ? void 0 : l.get(I);
3149
+ if (!(I === void 0 || K === void 0)) {
3120
3150
  for (const U of K[p])
3121
3151
  if ((K.claims.get(U) ?? 0) !== 0)
3122
- return K[p].delete(U), h[p] = B, { sourceId: B, path: U };
3152
+ return K[p].delete(U), h[p] = I, { sourceId: I, path: U };
3123
3153
  }
3124
3154
  }
3125
3155
  return null;
3126
- }, R = (p, x, k, C) => {
3156
+ }, T = (p, x, k, O) => {
3127
3157
  const $ = l.get(p);
3128
3158
  if ($ === void 0 || $.inFlight.get(x) !== k) return;
3129
3159
  L($, x, k);
3130
- const B = ($.claims.get(x) ?? 0) > 0, K = a(p);
3131
- if (C.status === "ok" ? K.set(x, { status: "loaded", entries: C.entries }) : C.status === "error" && B ? K.set(x, { status: "failed", failure: C.failure }) : K.delete(x), T(), C.status === "error" && B) {
3132
- const U = { sourceId: p, path: x, failure: C.failure };
3160
+ const I = ($.claims.get(x) ?? 0) > 0, K = s(p);
3161
+ if (O.status === "ok" ? K.set(x, { status: "loaded", entries: O.entries }) : O.status === "error" && I ? K.set(x, { status: "failed", failure: O.failure }) : K.delete(x), R(), O.status === "error" && I) {
3162
+ const U = { sourceId: p, path: x, failure: O.failure };
3133
3163
  for (const ie of [...m]) ie(U);
3134
3164
  }
3135
3165
  N();
3136
- }, A = (p, x, k) => {
3137
- const C = { controller: new AbortController(), lane: k };
3138
- M(p).inFlight.set(x, C), f += 1, k === "bulk" && (d += 1), e.children(p, x, C.controller.signal).then(
3139
- ($) => R(p, x, C, $),
3140
- () => R(p, x, C, hs)
3166
+ }, C = (p, x, k) => {
3167
+ const O = { controller: new AbortController(), lane: k };
3168
+ A(p).inFlight.set(x, O), f += 1, k === "bulk" && (d += 1), e.children(p, x, O.controller.signal).then(
3169
+ ($) => T(p, x, O, $),
3170
+ () => T(p, x, O, ha)
3141
3171
  );
3142
3172
  }, N = () => {
3143
3173
  for (; f < qn; ) {
3144
- const p = g("direct");
3174
+ const p = w("direct");
3145
3175
  if (p !== null) {
3146
- A(p.sourceId, p.path, "direct");
3176
+ C(p.sourceId, p.path, "direct");
3147
3177
  continue;
3148
3178
  }
3149
- const x = d < ms ? g("bulk") : null;
3179
+ const x = d < ma ? w("bulk") : null;
3150
3180
  if (x === null) return;
3151
- A(x.sourceId, x.path, "bulk");
3181
+ C(x.sourceId, x.path, "bulk");
3152
3182
  }
3153
3183
  }, q = (p, x, k) => {
3154
3184
  if (!(x.direct.delete(k) || x.bulk.delete(k))) {
@@ -3160,28 +3190,28 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
3160
3190
  }, W = () => {
3161
3191
  b = !1;
3162
3192
  let p = !1;
3163
- for (const x of w) {
3164
- const k = M(x);
3165
- for (const C of k.unclaimed)
3166
- (k.claims.get(C) ?? 0) === 0 && q(x, k, C) && (p = !0);
3193
+ for (const x of g) {
3194
+ const k = A(x);
3195
+ for (const O of k.unclaimed)
3196
+ (k.claims.get(O) ?? 0) === 0 && q(x, k, O) && (p = !0);
3167
3197
  k.unclaimed.clear();
3168
3198
  }
3169
- w.clear(), p && (T(), N());
3199
+ g.clear(), p && (R(), N());
3170
3200
  }, z = (p, x) => {
3171
- t.set(p, s(Re(e.tree(p)), x));
3201
+ t.set(p, a(Te(e.tree(p)), x));
3172
3202
  }, j = (p, x, k) => {
3173
3203
  v(p);
3174
- const C = s(wn(x), k);
3175
- return t.set(p, C), r.delete(p), T(), N(), C;
3176
- }, Y = (p, x, k, C) => {
3204
+ const O = a(gn(x), k);
3205
+ return t.set(p, O), r.delete(p), R(), N(), O;
3206
+ }, Y = (p, x, k, O) => {
3177
3207
  if (k !== S(p) || t.get(p) !== x) return;
3178
3208
  const $ = Ee(x.promise);
3179
- if (!(C.status !== "ok" || $?.status !== "ok" || x.loadedAt === null || C.loadedAt <= x.loadedAt)) {
3180
- if (De($.entries, C.entries)) {
3181
- x.loadedAt = C.loadedAt;
3209
+ if (!(O.status !== "ok" || $?.status !== "ok" || x.loadedAt === null || O.loadedAt <= x.loadedAt)) {
3210
+ if (De($.entries, O.entries)) {
3211
+ x.loadedAt = O.loadedAt;
3182
3212
  return;
3183
3213
  }
3184
- j(p, C, x.opened);
3214
+ j(p, O, x.opened);
3185
3215
  }
3186
3216
  }, V = (p, x) => {
3187
3217
  const k = t.get(p);
@@ -3189,58 +3219,58 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
3189
3219
  }, re = (p, x) => {
3190
3220
  x.stale = !1;
3191
3221
  const k = S(p);
3192
- e.tree(p).then((C) => Y(p, x, k, C));
3222
+ e.tree(p).then((O) => Y(p, x, k, O));
3193
3223
  };
3194
3224
  return {
3195
- read: (p) => t.get(p)?.promise ?? fs,
3225
+ read: (p) => t.get(p)?.promise ?? fa,
3196
3226
  open: (p) => {
3197
- const x = n.resumes(p), k = n.hold(p), C = t.get(p);
3198
- return C === void 0 || V(p, "deferred") ? (z(p, !0), T()) : x || (C.opened && V(p, "error") ? (z(p, !0), T()) : (C.opened = !0, C.stale && V(p, "ok") && re(p, C))), k;
3227
+ const x = n.resumes(p), k = n.hold(p), O = t.get(p);
3228
+ return O === void 0 || V(p, "deferred") ? (z(p, !0), R()) : x || (O.opened && V(p, "error") ? (z(p, !0), R()) : (O.opened = !0, O.stale && V(p, "ok") && re(p, O))), k;
3199
3229
  },
3200
3230
  retry: (p) => {
3201
- V(p, "error") && (z(p, !0), T());
3231
+ V(p, "error") && (z(p, !0), R());
3202
3232
  },
3203
3233
  seed: (p, x) => {
3204
3234
  const k = x.then(
3205
- (B) => B === null ? ot : B,
3235
+ (I) => I === null ? ot : I,
3206
3236
  () => ot
3207
- ), C = t.get(p);
3208
- if (C !== void 0 && V(p, "ok")) {
3209
- const B = S(p);
3210
- k.then((K) => Y(p, C, B, K));
3237
+ ), O = t.get(p);
3238
+ if (O !== void 0 && V(p, "ok")) {
3239
+ const I = S(p);
3240
+ k.then((K) => Y(p, O, I, K));
3211
3241
  return;
3212
3242
  }
3213
3243
  v(p);
3214
- const $ = s(Re(k), C?.opened === !0);
3215
- t.set(p, $), r.delete(p), N(), k.then((B) => {
3216
- t.get(p) === $ && (B.status === "deferred" && n.isHeld(p) && z(p, $.opened), T());
3244
+ const $ = a(Te(k), O?.opened === !0);
3245
+ t.set(p, $), r.delete(p), N(), k.then((I) => {
3246
+ t.get(p) === $ && (I.status === "deferred" && n.isHeld(p) && z(p, $.opened), R());
3217
3247
  });
3218
3248
  },
3219
3249
  refresh: async (p) => {
3220
3250
  const x = (i.get(p) ?? 0) + 1;
3221
3251
  i.set(p, x);
3222
3252
  const k = await e.refresh(p);
3223
- if (i.get(p) !== x) return us;
3253
+ if (i.get(p) !== x) return ua;
3224
3254
  if (k.status === "error") return { status: "failed", failure: k.failure };
3225
- const C = t.get(p);
3226
- if (!(C !== void 0 && C.loadedAt !== null && V(p, "ok") && C.loadedAt > k.loadedAt)) {
3227
- const B = j(p, k, !0);
3228
- if (C !== void 0 && C.promise.status === "pending") {
3255
+ const O = t.get(p);
3256
+ if (!(O !== void 0 && O.loadedAt !== null && V(p, "ok") && O.loadedAt > k.loadedAt)) {
3257
+ const I = j(p, k, !0);
3258
+ if (O !== void 0 && O.promise.status === "pending") {
3229
3259
  const K = S(p);
3230
- C.promise.then((U) => Y(p, B, K, U));
3260
+ O.promise.then((U) => Y(p, I, K, U));
3231
3261
  }
3232
3262
  }
3233
- for (const [B, K] of t)
3234
- B !== p && Ee(K.promise)?.status === "ok" && (K.stale = !0);
3235
- return ds;
3263
+ for (const [I, K] of t)
3264
+ I !== p && Ee(K.promise)?.status === "ok" && (K.stale = !0);
3265
+ return da;
3236
3266
  },
3237
3267
  children: (p, x) => r.get(p)?.get(x),
3238
3268
  claimChildren: (p, x) => {
3239
- const k = M(p), C = a(p);
3240
- let $ = !1, B = !1;
3269
+ const k = A(p), O = s(p);
3270
+ let $ = !1, I = !1;
3241
3271
  for (const [U, ie] of x)
3242
- k.claims.set(U, (k.claims.get(U) ?? 0) + 1), C.get(U) === void 0 ? (C.set(U, Kt), k[ie].add(U), $ = !0, B = !0) : ie === "direct" && k.bulk.delete(U) && (k.direct.add(U), B = !0);
3243
- $ && T(), B && N();
3272
+ k.claims.set(U, (k.claims.get(U) ?? 0) + 1), O.get(U) === void 0 ? (O.set(U, Kt), k[ie].add(U), $ = !0, I = !0) : ie === "direct" && k.bulk.delete(U) && (k.direct.add(U), I = !0);
3273
+ $ && R(), I && N();
3244
3274
  let K = !1;
3245
3275
  return () => {
3246
3276
  if (!K) {
@@ -3249,19 +3279,19 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
3249
3279
  const ie = (k.claims.get(U) ?? 0) - 1;
3250
3280
  ie > 0 ? k.claims.set(U, ie) : (k.claims.delete(U), k.unclaimed.add(U));
3251
3281
  }
3252
- w.add(p), !b && (b = !0, queueMicrotask(W));
3282
+ g.add(p), !b && (b = !0, queueMicrotask(W));
3253
3283
  }
3254
3284
  };
3255
3285
  },
3256
3286
  retryChildren: (p, x) => {
3257
3287
  const k = r.get(p);
3258
3288
  if (k === void 0 || k.get(x)?.status !== "failed") return;
3259
- const C = M(p);
3260
- if ((C.claims.get(x) ?? 0) > 0) {
3261
- k.set(x, Kt), C.direct.add(x), T(), N();
3289
+ const O = A(p);
3290
+ if ((O.claims.get(x) ?? 0) > 0) {
3291
+ k.set(x, Kt), O.direct.add(x), R(), N();
3262
3292
  return;
3263
3293
  }
3264
- k.delete(x), T();
3294
+ k.delete(x), R();
3265
3295
  },
3266
3296
  pendingChildren: (p) => {
3267
3297
  const x = l.get(p);
@@ -3270,17 +3300,17 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
3270
3300
  clear: () => {
3271
3301
  for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...l.keys()])) v(p);
3272
3302
  for (const [p, x] of i) i.set(p, x + 1);
3273
- t.clear(), r.clear(), T();
3303
+ t.clear(), r.clear(), R();
3274
3304
  },
3275
3305
  subscribeChildrenFailures: (p) => (m.add(p), () => {
3276
3306
  m.delete(p);
3277
3307
  }),
3278
3308
  subscribe: u.subscribe,
3279
- version: () => O
3309
+ version: () => M
3280
3310
  };
3281
- }, vs = (e, t) => {
3311
+ }, va = (e, t) => {
3282
3312
  let n = e;
3283
- const r = Oe();
3313
+ const r = Me();
3284
3314
  return {
3285
3315
  getSnapshot: () => n,
3286
3316
  subscribe: r.subscribe,
@@ -3288,26 +3318,26 @@ const Dl = /* @__PURE__ */ y.forwardRef(Nl), Pl = ({ href: e, onRetry: t, testId
3288
3318
  n = { ...n, ...o }, t(n), r.emit();
3289
3319
  }
3290
3320
  };
3291
- }, gs = 1;
3292
- let Ce = 0, de = null;
3293
- const ws = () => {
3321
+ }, wa = 1;
3322
+ let Oe = 0, de = null;
3323
+ const ga = () => {
3294
3324
  const { documentElement: e, body: t } = document;
3295
- Ce === 0 && (de = { 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"), Ce += 1;
3325
+ Oe === 0 && (de = { 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"), Oe += 1;
3296
3326
  let n = !1;
3297
3327
  return () => {
3298
- n || (n = !0, Ce -= 1, !(Ce > 0 || de === null) && (e.style.overflow = de.htmlOverflow, t.style.overflow = de.bodyOverflow, e.style.scrollbarGutter = de.htmlGutter, t.style.scrollbarGutter = de.bodyGutter, de = null));
3328
+ n || (n = !0, Oe -= 1, !(Oe > 0 || de === null) && (e.style.overflow = de.htmlOverflow, t.style.overflow = de.bodyOverflow, e.style.scrollbarGutter = de.htmlGutter, t.style.scrollbarGutter = de.bodyGutter, de = null));
3299
3329
  };
3300
- }, bs = [
3330
+ }, ba = [
3301
3331
  { selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
3302
3332
  { selector: "[data-aqmx-explorer-body]", name: "tree area" }
3303
- ], Xt = 1, Yt = (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.", Es = (e) => {
3333
+ ], Xt = 1, Ea = 1e3, Yt = (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.", ya = (e) => {
3304
3334
  if (!Yt(e)) return null;
3305
3335
  const t = e.getBoundingClientRect(), n = window.innerHeight;
3306
- if (t.bottom > n + gs)
3336
+ if (t.bottom > n + wa)
3307
3337
  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}`;
3308
3338
  if (t.height < Xt)
3309
3339
  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}`;
3310
- for (const { selector: r, name: o } of bs)
3340
+ for (const { selector: r, name: o } of ba)
3311
3341
  for (const i of e.querySelectorAll(r)) {
3312
3342
  if (!Yt(i)) continue;
3313
3343
  const l = i.getBoundingClientRect().height;
@@ -3315,37 +3345,39 @@ const ws = () => {
3315
3345
  return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(l))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
3316
3346
  }
3317
3347
  return null;
3318
- }, ys = (e) => {
3319
- let t = !1;
3320
- const n = () => {
3321
- if (t) return;
3322
- const o = Es(e);
3323
- o !== null && (t = !0, console.error(o));
3324
- }, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(n);
3325
- return r?.observe(e), window.addEventListener("resize", n), n(), () => {
3326
- r?.disconnect(), window.removeEventListener("resize", n);
3348
+ }, xa = (e) => {
3349
+ let t = !1, n;
3350
+ const r = () => {
3351
+ n = void 0;
3352
+ const l = ya(e);
3353
+ l !== null && (t = !0, console.error(l));
3354
+ }, o = () => {
3355
+ t || (clearTimeout(n), n = setTimeout(r, Ea));
3356
+ }, i = typeof ResizeObserver > "u" ? null : new ResizeObserver(o);
3357
+ return i?.observe(e), window.addEventListener("resize", o), o(), () => {
3358
+ clearTimeout(n), i?.disconnect(), window.removeEventListener("resize", o);
3327
3359
  };
3328
- }, xs = (e, t) => {
3329
- te(() => e ? ws() : void 0, [e]), te(() => {
3360
+ }, Sa = (e, t) => {
3361
+ te(() => e ? ga() : void 0, [e]), te(() => {
3330
3362
  const n = t.current;
3331
3363
  if (!(!e || n === null))
3332
- return ys(n);
3364
+ return xa(n);
3333
3365
  }, [e, t]);
3334
- }, Jt = '[data-testid="markdown-explorer-view-switch"]', Ss = [
3366
+ }, Jt = '[data-testid="markdown-explorer-view-switch"]', ka = [
3335
3367
  { control: Jt, successors: [Jt, '[data-testid="markdown-explorer-sheet-toggle"]'] },
3336
3368
  { control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
3337
- ], ks = (e) => {
3338
- for (const t of Ss) {
3369
+ ], Ta = (e) => {
3370
+ for (const t of ka) {
3339
3371
  const n = e.closest(t.control);
3340
3372
  if (n !== null) return { element: n, control: t };
3341
3373
  }
3342
3374
  return null;
3343
- }, Rs = (e, t) => {
3375
+ }, Ra = (e, t) => {
3344
3376
  const n = _(null);
3345
3377
  te(() => {
3346
3378
  const o = (u) => {
3347
3379
  const m = e.current;
3348
- n.current = m !== null && u instanceof Element && m.contains(u) ? ks(u) : null;
3380
+ n.current = m !== null && u instanceof Element && m.contains(u) ? Ta(u) : null;
3349
3381
  }, i = (u) => o(u.target);
3350
3382
  o(document.activeElement);
3351
3383
  const l = (u) => {
@@ -3383,7 +3415,7 @@ const ws = () => {
3383
3415
  });
3384
3416
  return u.observe(l, { childList: !0, subtree: !0 }), () => u.disconnect();
3385
3417
  }, [t, e]);
3386
- }, Ts = it(() => import("./TreeLayout-CXX-rFO6.js").then((e) => ({ default: e.TreeLayout }))), Os = it(() => import("./MultiLayout-DYy66vcO.js").then((e) => ({ default: e.MultiLayout }))), Cs = 64, As = {
3418
+ }, Ma = it(() => import("./TreeLayout-eFQmzpNj.js").then((e) => ({ default: e.TreeLayout }))), Oa = it(() => import("./MultiLayout-Dy3DD_09.js").then((e) => ({ default: e.MultiLayout }))), Ca = 64, La = {
3387
3419
  request: (e) => {
3388
3420
  requestAnimationFrame(e);
3389
3421
  }
@@ -3392,28 +3424,28 @@ const ws = () => {
3392
3424
  }, Xe = (e, t) => {
3393
3425
  t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
3394
3426
  for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
3395
- }, Ls = (e, t) => {
3396
- const [n, r] = I(() => ({ overrides: t, locale: e, labels: Tt(e, t) }));
3427
+ }, Aa = (e, t) => {
3428
+ const [n, r] = B(() => ({ overrides: t, locale: e, labels: Rt(e, t) }));
3397
3429
  if (n.locale === e && Nr(n.overrides, t)) return n.labels;
3398
- const o = { overrides: t, locale: e, labels: Tt(e, t) };
3430
+ const o = { overrides: t, locale: e, labels: Rt(e, t) };
3399
3431
  return r(o), o.labels;
3400
- }, Ms = (e, t, n) => {
3401
- const [r, o] = I(() => ({ scope: t, store: Wt(e, n) }));
3432
+ }, Na = (e, t, n) => {
3433
+ const [r, o] = B(() => ({ scope: t, store: Wt(e, n) }));
3402
3434
  if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
3403
3435
  const i = { scope: t, store: Wt(e, n) };
3404
3436
  return o(i), i.store;
3405
3437
  }, Ye = (e, t) => {
3406
- const [n, r] = I(() => ({ scope: e, value: t() }));
3438
+ const [n, r] = B(() => ({ scope: e, value: t() }));
3407
3439
  if (n.scope === e) return n.value;
3408
3440
  const o = { scope: e, value: t() };
3409
3441
  return r(o), o.value;
3410
- }, Ns = () => is(As), en = "on", Ds = "off", Ps = Object.freeze({ kind: "unavailable" }), $s = (e) => {
3442
+ }, Da = () => ia(La), en = "on", Pa = "off", $a = Object.freeze({ kind: "unavailable" }), Fa = (e) => {
3411
3443
  if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
3412
3444
  throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
3413
- }, Fs = (e, t) => {
3445
+ }, qa = (e, t) => {
3414
3446
  const n = ue(e.peek(t));
3415
- return n === null || n.document.kind === "failure" ? ae(t) : n.document.name;
3416
- }, Js = ({
3447
+ return n === null || n.document.kind === "failure" ? se(t) : n.document.name;
3448
+ }, Qa = ({
3417
3449
  data: e,
3418
3450
  config: t,
3419
3451
  storageNamespace: n,
@@ -3427,93 +3459,93 @@ const ws = () => {
3427
3459
  onEditGrant: d,
3428
3460
  draftConverter: h
3429
3461
  }) => {
3430
- xr(n), $s(h);
3431
- const w = un(r), b = Dr(i), O = Ls(w, o), { revalidate: T } = Vn(), S = _(() => {
3432
- }), M = $e(t.dataPath), [L] = I(() => {
3433
- const k = ss({ dataPath: M, onScope: ($) => S.current($) }), C = { documents: $o({ client: k, capacity: Math.max(Cs, t.multiView.maxPanels * 2) }), trees: ps(k) };
3434
- return Xe(C, e), kt(n, e.scope), { data: k, ...C, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
3462
+ xr(n), Fa(h);
3463
+ const g = un(r), b = Dr(i), M = Aa(g, o), { revalidate: R } = Vn(), S = _(() => {
3464
+ }), A = $e(t.dataPath), [L] = B(() => {
3465
+ const k = aa({ dataPath: A, onScope: ($) => S.current($) }), O = { documents: $o({ client: k, capacity: Math.max(Ca, t.multiView.maxPanels * 2) }), trees: pa(k) };
3466
+ return Xe(O, e), kt(n, e.scope), { data: k, ...O, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
3435
3467
  });
3436
3468
  if (L.aligned.pageData !== e || L.aligned.storageNamespace !== n) {
3437
3469
  const k = L.aligned.pageData;
3438
3470
  L.aligned.pageData = e, L.aligned.storageNamespace = n, k !== e && (k.scope !== e.scope ? L.aligned.pendingReader = e : Xe(L, e)), kt(n, e.scope);
3439
3471
  }
3440
- const E = Ms(ge(n).treeSettings, e.scope, t.defaultTreeSettings);
3472
+ const E = Na(we(n).treeSettings, e.scope, t.defaultTreeSettings);
3441
3473
  H(() => {
3442
3474
  const k = L.aligned.pendingReader;
3443
3475
  k !== null && (L.aligned.pendingReader = null, Qt(L), Xe(L, k));
3444
3476
  }, [e, L]), H(() => {
3445
3477
  let k = !1;
3446
- return S.current = (C) => {
3447
- C === e.scope || k || (k = !0, C !== null && (Qt(L), Sr(n)), T());
3478
+ return S.current = (O) => {
3479
+ O === e.scope || k || (k = !0, O !== null && (Qt(L), Sr(n)), R());
3448
3480
  }, () => {
3449
3481
  S.current = () => {
3450
3482
  };
3451
3483
  };
3452
- }, [e, T, L, n]);
3484
+ }, [e, R, L, n]);
3453
3485
  const v = _(t.settingsCookie);
3454
3486
  H(() => {
3455
3487
  v.current = t.settingsCookie;
3456
3488
  }, [t.settingsCookie]);
3457
- const [s] = I(
3458
- () => vs(e.settings, (k) => {
3489
+ const [a] = B(
3490
+ () => va(e.settings, (k) => {
3459
3491
  document.cookie = er(v.current, k, window.location.protocol === "https:");
3460
3492
  })
3461
- ), a = Ye(e.scope, Ns), g = Ye(e.scope, as), R = _(O);
3493
+ ), s = Ye(e.scope, Da), w = Ye(e.scope, sa), T = _(M);
3462
3494
  H(() => {
3463
- R.current = O;
3464
- }, [O]);
3465
- const A = Ye(
3495
+ T.current = M;
3496
+ }, [M]);
3497
+ const C = Ye(
3466
3498
  e.scope,
3467
3499
  () => Vr({
3468
3500
  data: L.data,
3469
- conflictLabels: () => ({ ours: R.current.conflictOurs, theirs: R.current.conflictTheirs }),
3470
- onSaveSettled: (k, C) => {
3471
- C.kind === "saved" && L.documents.refresh(k);
3472
- const $ = $r(R.current, C, Fs(L.documents, k));
3473
- $ !== null && a.announce($);
3501
+ conflictLabels: () => ({ ours: T.current.conflictOurs, theirs: T.current.conflictTheirs }),
3502
+ onSaveSettled: (k, O) => {
3503
+ O.kind === "saved" && L.documents.refresh(k);
3504
+ const $ = $r(T.current, O, qa(L.documents, k));
3505
+ $ !== null && s.announce($);
3474
3506
  },
3475
3507
  sideBySideSetting: {
3476
- read: () => Qe(ge(n).editPreview) === en,
3477
- write: (k) => Je(ge(n).editPreview, k ? en : Ds)
3508
+ read: () => Qe(we(n).editPreview) === en,
3509
+ write: (k) => Je(we(n).editPreview, k ? en : Pa)
3478
3510
  },
3479
3511
  editorShareSetting: {
3480
- read: () => Hr(Qe(ge(n).editSplit)),
3481
- write: (k) => Je(ge(n).editSplit, String(k))
3512
+ read: () => Hr(Qe(we(n).editSplit)),
3513
+ write: (k) => Je(we(n).editSplit, String(k))
3482
3514
  }
3483
3515
  })
3484
- ), N = G(() => Re(e.notices.catch(() => [])), [e.notices]), q = e.sources.map((k) => k.id).join(`
3516
+ ), N = G(() => Te(e.notices.catch(() => [])), [e.notices]), q = e.sources.map((k) => k.id).join(`
3485
3517
  `), W = G(() => Qn(t, q.split(`
3486
3518
  `)), [t, q]), z = _(f);
3487
3519
  H(() => {
3488
3520
  z.current = f;
3489
3521
  }, [f]);
3490
- const [j] = I(() => (k, C) => {
3491
- z.current?.(k, C);
3522
+ const [j] = B(() => (k, O) => {
3523
+ z.current?.(k, O);
3492
3524
  }), Y = f === void 0 ? void 0 : j, V = _(h);
3493
3525
  H(() => {
3494
3526
  V.current = h;
3495
3527
  }, [h]);
3496
- const [re] = I(() => {
3528
+ const [re] = B(() => {
3497
3529
  let k = !1;
3498
3530
  return {
3499
- convert: (C, $) => {
3500
- const B = V.current;
3501
- return B === void 0 ? Promise.resolve(Ps) : B.convert(C, $);
3531
+ convert: (O, $) => {
3532
+ const I = V.current;
3533
+ return I === void 0 ? Promise.resolve($a) : I.convert(O, $);
3502
3534
  },
3503
3535
  prepare: () => {
3504
3536
  try {
3505
3537
  V.current?.prepare?.();
3506
- } catch (C) {
3538
+ } catch (O) {
3507
3539
  if (k) return;
3508
- k = !0, console.error("[markdown-explorer] the draft converter's prepare threw", C);
3540
+ k = !0, console.error("[markdown-explorer] the draft converter's prepare threw", O);
3509
3541
  }
3510
3542
  }
3511
3543
  };
3512
3544
  }), p = h === void 0 ? void 0 : re, x = G(
3513
3545
  () => ({
3514
3546
  config: W,
3515
- labels: O,
3516
- locale: w,
3547
+ labels: M,
3548
+ locale: g,
3517
3549
  theme: b,
3518
3550
  storageNamespace: n,
3519
3551
  scope: e.scope,
@@ -3522,80 +3554,80 @@ const ws = () => {
3522
3554
  documents: L.documents,
3523
3555
  trees: L.trees,
3524
3556
  data: L.data,
3525
- viewSettings: s,
3557
+ viewSettings: a,
3526
3558
  treeSettings: E,
3527
- announcer: a,
3528
- reveals: g,
3529
- edits: A,
3559
+ announcer: s,
3560
+ reveals: w,
3561
+ edits: C,
3530
3562
  onEditGrant: d,
3531
3563
  draftConverter: p,
3532
3564
  renderTreeFailure: u,
3533
3565
  reportMathDiagnostics: Y
3534
3566
  }),
3535
- [W, O, w, b, n, e.scope, e.sources, N, L, s, E, a, g, A, d, p, u, Y]
3567
+ [W, M, g, b, n, e.scope, e.sources, N, L, a, E, s, w, C, d, p, u, Y]
3536
3568
  );
3537
- return /* @__PURE__ */ c(fn, { value: x, children: /* @__PURE__ */ c(_s, { renderFrame: l, lockDocumentScroll: m }, e.scope) });
3538
- }, qs = ({ ref: e, theme: t, view: n, children: r }) => {
3539
- const [o] = I(bi);
3569
+ return /* @__PURE__ */ c(fn, { value: x, children: /* @__PURE__ */ c(Ia, { renderFrame: l, lockDocumentScroll: m }, e.scope) });
3570
+ }, _a = ({ ref: e, theme: t, view: n, children: r }) => {
3571
+ const [o] = B(bi);
3540
3572
  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 });
3541
- }, _s = ({ renderFrame: e, lockDocumentScroll: t }) => {
3573
+ }, Ia = ({ renderFrame: e, lockDocumentScroll: t }) => {
3542
3574
  const { theme: n, labels: r } = D(), o = lt(), { hash: i } = nn(), l = Fe(), u = _(null);
3543
- xs(t, u), H(() => {
3575
+ Sa(t, u), H(() => {
3544
3576
  o.kind === "redirect" && l(`${o.href}${i}`, "browse");
3545
3577
  }, [o, i, l]);
3546
3578
  const { location: m } = o, f = m.view;
3547
- Rs(u, f);
3548
- const d = m.view === "tree" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...et }), children: /* @__PURE__ */ c(Ts, { location: m }) }) : m.view === "multi" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...et }), children: /* @__PURE__ */ c(Os, { location: m }) }) : /* @__PURE__ */ c(rs, { location: m }), h = /* @__PURE__ */ F(qs, { ref: u, theme: n, view: f, children: [
3579
+ Ra(u, f);
3580
+ const d = m.view === "tree" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...et }), children: /* @__PURE__ */ c(Ma, { location: m }) }) : m.view === "multi" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...et }), children: /* @__PURE__ */ c(Oa, { location: m }) }) : /* @__PURE__ */ c(ra, { location: m }), h = /* @__PURE__ */ F(_a, { ref: u, theme: n, view: f, children: [
3549
3581
  d,
3550
- /* @__PURE__ */ c(ao, {}),
3551
- /* @__PURE__ */ c(os, { holds: !0, testId: "markdown-explorer-announcer" })
3582
+ /* @__PURE__ */ c(so, {}),
3583
+ /* @__PURE__ */ c(oa, { holds: !0, testId: "markdown-explorer-announcer" })
3552
3584
  ] });
3553
3585
  return e === void 0 ? h : e({ view: f, children: h });
3554
- }, Qs = kr({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
3586
+ }, es = kr({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
3555
3587
  export {
3556
- Rt as $,
3588
+ Tt as $,
3557
3589
  rt as A,
3558
3590
  Zt as B,
3559
3591
  Fr as C,
3560
- ns as D,
3592
+ na as D,
3561
3593
  Pl as E,
3562
3594
  Jr as F,
3563
3595
  ql as G,
3564
- Oe as H,
3565
- Xs as I,
3596
+ Me as H,
3597
+ Ya as I,
3566
3598
  yi as J,
3567
3599
  Ur as K,
3568
3600
  xn as L,
3569
3601
  Do as M,
3570
3602
  Qi as N,
3571
- wl as O,
3572
- ts as P,
3603
+ gl as O,
3604
+ ta as P,
3573
3605
  Lo as Q,
3574
- Al as R,
3575
- Ao as S,
3606
+ Cl as R,
3607
+ Co as S,
3576
3608
  lt as T,
3577
- os as U,
3578
- Me as V,
3579
- Rr as W,
3580
- Ot as X,
3581
- Ar as Y,
3609
+ oa as U,
3610
+ Ae as V,
3611
+ Tr as W,
3612
+ Mt as X,
3613
+ Cr as Y,
3582
3614
  dn as Z,
3583
- Tr as _,
3615
+ Rr as _,
3584
3616
  qr as a,
3585
- Js as a0,
3586
- Tt as a1,
3587
- Qs as a2,
3617
+ Qa as a0,
3618
+ Rt as a1,
3619
+ es as a2,
3588
3620
  _r as b,
3589
3621
  Fe as c,
3590
3622
  Jl as d,
3591
3623
  et as e,
3592
3624
  vl as f,
3593
3625
  So as g,
3594
- Br as h,
3595
- Oo as i,
3626
+ Ir as h,
3627
+ Mo as i,
3596
3628
  xo as j,
3597
- se as k,
3598
- Co as l,
3629
+ ae as k,
3630
+ Oo as l,
3599
3631
  ue as m,
3600
3632
  Eo as n,
3601
3633
  yo as o,
@@ -3603,11 +3635,11 @@ export {
3603
3635
  lo as q,
3604
3636
  to as r,
3605
3637
  Fl as s,
3606
- Ks as t,
3638
+ Xa as t,
3607
3639
  D as u,
3608
3640
  ko as v,
3609
- Ys as w,
3641
+ Ja as w,
3610
3642
  hn as x,
3611
- Bl as y,
3643
+ Il as y,
3612
3644
  _l as z
3613
3645
  };