@aiquants/markdown-explorer 0.10.0 → 0.12.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.
- package/CHANGELOG.md +26 -1
- package/README.md +66 -6
- package/dist/EditSurface-BTAhzvHi.js +509 -0
- package/dist/EditSurface-Dfj6Sxxb.cjs +2 -0
- package/dist/ExplorerSplit-DekOjAUZ.cjs +1 -0
- package/dist/{ExplorerSplit-D0zf7Cr_.js → ExplorerSplit-MPHjw3nW.js} +251 -248
- package/dist/{MultiLayout-Jy9BKofx.js → MultiLayout-DtSW4rEQ.js} +4 -4
- package/dist/{MultiLayout-Bq10p3a3.cjs → MultiLayout-HMzVDYWq.cjs} +1 -1
- package/dist/{NativeScrollBar-Dt6xH5Mb.cjs → NativeScrollBar-B0AkVF3E.cjs} +1 -1
- package/dist/{NativeScrollBar-CyiyL47o.js → NativeScrollBar-CNQr7JY1.js} +1 -1
- package/dist/{TreeLayout-8pRo1ANN.js → TreeLayout-CJO9tOPq.js} +3 -3
- package/dist/{TreeLayout-kVWFEKJD.cjs → TreeLayout-_XQR-9tV.cjs} +1 -1
- package/dist/client/MarkdownExplorer.d.cts +3 -2
- package/dist/client/MarkdownExplorer.d.ts +3 -2
- package/dist/core/contracts.d.cts +17 -0
- package/dist/core/contracts.d.ts +17 -0
- package/dist/core/labels.d.cts +2 -0
- package/dist/core/labels.d.ts +2 -0
- package/dist/core/treeSettings.d.cts +2 -1
- package/dist/core/treeSettings.d.ts +2 -1
- package/dist/dataRoute-CH3yOKR0.cjs +1 -0
- package/dist/dataRoute-Pm_0ue_4.js +279 -0
- package/dist/index-DpIVKG8Y.cjs +13 -0
- package/dist/{index-CfcJEnrC.js → index-o6OpR4ND.js} +967 -907
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/location-BUNWJ4eB.cjs +1 -0
- package/dist/{location-Dc1qNEGm.js → location-DWd6SQhN.js} +123 -112
- package/dist/{merge-D0aGvFKC.cjs → merge-Bs7o3GyP.cjs} +1 -1
- package/dist/{merge-SRCxtHk2.js → merge-DDJaJmMU.js} +1 -1
- package/dist/sanitizePolicy-BfUlXI5E.cjs +1 -0
- package/dist/sanitizePolicy-djLC3fRN.js +96 -0
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +143 -226
- package/dist/server.cjs +1 -1
- package/dist/server.js +548 -540
- package/docs/behavior/dom-hooks.md +2 -2
- package/docs/behavior/localization.md +1 -0
- package/docs/behavior/security.md +2 -0
- package/package.json +3 -3
- package/dist/EditSurface-1Jf0CG-f.js +0 -371
- package/dist/EditSurface-B-l3Do_C.cjs +0 -2
- package/dist/ExplorerSplit-WX8afxrQ.cjs +0 -1
- package/dist/dataRoute-8pyILcjL.cjs +0 -1
- package/dist/dataRoute-Csl1WBDz.js +0 -278
- package/dist/index-sNJrKoGN.cjs +0 -13
- package/dist/location-CRYkEWiC.cjs +0 -1
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as F, jsx as a, Fragment as Ne } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as me, use as
|
|
4
|
-
import { useParams as
|
|
5
|
-
import { f as
|
|
6
|
-
import {
|
|
7
|
-
import { HostedScrollArea as vt, useMarkdownToolbarState as
|
|
8
|
-
import { SOURCE_LINES_ATTRIBUTE as
|
|
9
|
-
import { DEFAULT_CONTENT_ALIGN as
|
|
10
|
-
import { w as
|
|
11
|
-
const bt = Object.freeze(["en", "ja"]),
|
|
2
|
+
import * as E from "react";
|
|
3
|
+
import { createContext as me, use as ne, useMemo as z, useSyncExternalStore as ee, useRef as _, useId as Oe, useLayoutEffect as U, useCallback as P, useEffect as te, Component as Zt, Suspense as ge, lazy as tt, useState as I, useEffectEvent as ie } from "react";
|
|
4
|
+
import { useParams as Tn, useSearchParams as Cn, matchPath as On, useBlocker as An, useNavigate as Ln, Link as Mn, useHref as De, useLocation as Vt, useRevalidator as Nn } from "react-router";
|
|
5
|
+
import { f as Dn, a as Gt, u as $n, G as ke, e as pe, x as Pn, y as Fn, z as ft, B as qn, D as mt, H as _n, w as Bn, I as In } from "./location-DWd6SQhN.js";
|
|
6
|
+
import { F as Ee, i as jn, G as Hn, y as X, x as zn, H as ht, z as He, I as Un, J as Zn, K as Vn, L as Gn, N as Kn, f as Wn, O as pt, v as Xn, P as Yn, Q as Jn, R as Qn, B as er, w as tr, S as nr, T as rr, U as or, u as gt } from "./dataRoute-Pm_0ue_4.js";
|
|
7
|
+
import { HostedScrollArea as vt, useMarkdownToolbarState as lr, MarkdownViewer as Kt } from "@aiquants/markdown";
|
|
8
|
+
import { SOURCE_LINES_ATTRIBUTE as Wt, parseSourceLines as ir } from "@aiquants/markdown/source-lines";
|
|
9
|
+
import { DEFAULT_CONTENT_ALIGN as sr } from "@aiquants/markdown/viewer-settings";
|
|
10
|
+
import { w as Xt, r as Yt, a as ar, b as wt, s as ze, c as cr } from "./storage-BSthKLSG.js";
|
|
11
|
+
const bt = Object.freeze(["en", "ja"]), dr = "en", ur = Object.freeze({
|
|
12
12
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
13
13
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
14
14
|
panelDragStarted: Object.freeze(["title"]),
|
|
15
15
|
panelDragCancelled: Object.freeze(["title"]),
|
|
16
16
|
multiColumnRegion: Object.freeze(["column"])
|
|
17
|
-
}),
|
|
17
|
+
}), fr = /\{(\w+)\}/gu, Jt = {
|
|
18
18
|
explorerRegion: "Explorer",
|
|
19
19
|
sourceLabel: "Source",
|
|
20
20
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -116,6 +116,8 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
116
116
|
sortNative: "Source order",
|
|
117
117
|
sortAscending: "Name A→Z",
|
|
118
118
|
sortDescending: "Name Z→A",
|
|
119
|
+
sortOldest: "Modified old→new",
|
|
120
|
+
sortNewest: "Modified new→old",
|
|
119
121
|
settingFolderPlacement: "Folders",
|
|
120
122
|
folderPlacementMixed: "Mixed",
|
|
121
123
|
folderPlacementFirst: "First",
|
|
@@ -242,7 +244,7 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
242
244
|
multiColumnEmpty: "This column is empty",
|
|
243
245
|
multiColumnRegion: "Column {column}",
|
|
244
246
|
panelDropHere: "Drop the panel here"
|
|
245
|
-
},
|
|
247
|
+
}, mr = {
|
|
246
248
|
explorerRegion: "エクスプローラー",
|
|
247
249
|
sourceLabel: "ソース",
|
|
248
250
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -344,6 +346,8 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
344
346
|
sortNative: "取得順",
|
|
345
347
|
sortAscending: "名前の昇順",
|
|
346
348
|
sortDescending: "名前の降順",
|
|
349
|
+
sortOldest: "更新日時の昇順 (古い順)",
|
|
350
|
+
sortNewest: "更新日時の降順 (新しい順)",
|
|
347
351
|
settingFolderPlacement: "フォルダーの位置",
|
|
348
352
|
folderPlacementMixed: "混ぜる",
|
|
349
353
|
folderPlacementFirst: "先に",
|
|
@@ -470,24 +474,24 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
470
474
|
multiColumnEmpty: "この列は空です",
|
|
471
475
|
multiColumnRegion: "{column} 列目",
|
|
472
476
|
panelDropHere: "ここへパネルをドロップ"
|
|
473
|
-
},
|
|
474
|
-
en: Object.freeze(
|
|
475
|
-
ja: Object.freeze(
|
|
476
|
-
}),
|
|
477
|
-
if (e === void 0) return
|
|
477
|
+
}, hr = Object.freeze({
|
|
478
|
+
en: Object.freeze(Jt),
|
|
479
|
+
ja: Object.freeze(mr)
|
|
480
|
+
}), Qt = Object.freeze(Object.keys(Jt)), pr = new Set(Qt), gr = (e) => pr.has(e), Te = (e) => e === null ? "null" : typeof e == "string" ? JSON.stringify(e.length > 40 ? `${e.slice(0, 40)}…` : e) : typeof e == "function" ? "a function" : Array.isArray(e) ? "an array" : typeof e, en = (e) => {
|
|
481
|
+
if (e === void 0) return dr;
|
|
478
482
|
if (bt.includes(e)) return e;
|
|
479
483
|
throw new RangeError(`[markdown-explorer] locale is the UI language (${bt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Te(e)}`);
|
|
480
484
|
}, Et = (e, t) => {
|
|
481
|
-
const n =
|
|
485
|
+
const n = hr[en(e)];
|
|
482
486
|
if (t === void 0) return n;
|
|
483
487
|
if (t === null || typeof t != "object")
|
|
484
488
|
throw new RangeError(`[markdown-explorer] labels must be an object; got ${Te(t)}`);
|
|
485
|
-
if (
|
|
489
|
+
if (!Dn(t))
|
|
486
490
|
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Te(t)}`);
|
|
487
491
|
const r = t, o = { ...n };
|
|
488
492
|
for (const l of Object.keys(r)) {
|
|
489
|
-
if (!
|
|
490
|
-
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${
|
|
493
|
+
if (!gr(l))
|
|
494
|
+
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${Qt.join(", ")}`);
|
|
491
495
|
const i = r[l];
|
|
492
496
|
if (i === void 0) continue;
|
|
493
497
|
const d = typeof n[l];
|
|
@@ -495,35 +499,35 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
495
499
|
throw new TypeError(`[markdown-explorer] labels.${l} must be a ${d}; got ${Te(i)}`);
|
|
496
500
|
if (typeof i == "string" && i.trim() === "")
|
|
497
501
|
throw new RangeError(`[markdown-explorer] labels.${l} must be a non-blank string`);
|
|
498
|
-
const g =
|
|
502
|
+
const g = ur[l];
|
|
499
503
|
if (typeof i == "string" && g !== void 0) {
|
|
500
|
-
for (const [, f] of i.matchAll(
|
|
504
|
+
for (const [, f] of i.matchAll(fr))
|
|
501
505
|
if (!g.includes(f ?? ""))
|
|
502
506
|
throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(f)}}; it accepts ${g.map((u) => `{${u}}`).join(", ")}`);
|
|
503
507
|
}
|
|
504
508
|
o[l] = i;
|
|
505
509
|
}
|
|
506
510
|
return Object.freeze(o);
|
|
507
|
-
},
|
|
511
|
+
}, vr = (e, t) => {
|
|
508
512
|
if (Object.is(e, t)) return !0;
|
|
509
513
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
510
514
|
const n = e, r = t, o = Object.keys(n), l = Object.keys(r);
|
|
511
515
|
return o.length === l.length && l.every((i) => Object.hasOwn(n, i) && Object.is(n[i], r[i]));
|
|
512
|
-
}, yt = Object.freeze(["light", "dark"]),
|
|
516
|
+
}, yt = Object.freeze(["light", "dark"]), wr = (e) => {
|
|
513
517
|
if (e === void 0) return "light";
|
|
514
518
|
if (yt.includes(e)) return e;
|
|
515
519
|
throw new RangeError(`[markdown-explorer] theme must be ${yt.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
516
|
-
},
|
|
517
|
-
const e =
|
|
520
|
+
}, tn = me(null), D = () => {
|
|
521
|
+
const e = ne(tn);
|
|
518
522
|
if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
|
|
519
523
|
return e;
|
|
520
524
|
}, Ae = (e) => {
|
|
521
525
|
const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
|
|
522
|
-
return
|
|
526
|
+
return ee(t.subscribe, n, n);
|
|
523
527
|
}, nt = () => {
|
|
524
|
-
const { config: e } = D(), t =
|
|
525
|
-
return
|
|
526
|
-
},
|
|
528
|
+
const { config: e } = D(), t = Tn()["*"], [n] = Cn(), r = n.toString();
|
|
529
|
+
return z(() => Gt(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
530
|
+
}, nn = {
|
|
527
531
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
528
532
|
forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
|
|
529
533
|
"not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
|
|
@@ -532,14 +536,14 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
532
536
|
"too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
|
|
533
537
|
unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
|
|
534
538
|
failed: ["failureFailedTitle", "failureFailedBody"]
|
|
535
|
-
}, ae = (e, t) => e[
|
|
536
|
-
const { labels: o } = D(), l = ae(o, e.reason), i = o[
|
|
539
|
+
}, ae = (e, t) => e[nn[t][0]], ve = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
|
|
540
|
+
const { labels: o } = D(), l = ae(o, e.reason), i = o[nn[e.reason][1]], d = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
|
|
537
541
|
return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": d, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
|
|
538
542
|
/* @__PURE__ */ a("p", { className: "aqmx-callout-title", children: l }),
|
|
539
543
|
/* @__PURE__ */ a("p", { className: "aqmx-callout-body", children: i }),
|
|
540
544
|
e.reason === "unauthorized" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
|
|
541
545
|
] });
|
|
542
|
-
},
|
|
546
|
+
}, br = (e, t) => {
|
|
543
547
|
const { phase: n, save: r, dirty: o } = t;
|
|
544
548
|
switch (n.kind) {
|
|
545
549
|
case "opening":
|
|
@@ -563,7 +567,7 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
563
567
|
break;
|
|
564
568
|
}
|
|
565
569
|
return o ? e.draftUnsaved : "";
|
|
566
|
-
},
|
|
570
|
+
}, Er = (e, t, n) => {
|
|
567
571
|
switch (t.kind) {
|
|
568
572
|
case "saved":
|
|
569
573
|
return t.merged ? e.documentSavedMerged(n) : e.documentSaved(n);
|
|
@@ -587,34 +591,34 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
587
591
|
for (const t of [...e]) t();
|
|
588
592
|
}
|
|
589
593
|
};
|
|
590
|
-
},
|
|
591
|
-
`)),
|
|
594
|
+
}, yr = "<<<<<<<", xr = "=======", kr = ">>>>>>>", xt = (e, t) => e === t || e.startsWith(`${t} `), kt = (e) => Sr(e.split(`
|
|
595
|
+
`)), Sr = (e) => {
|
|
592
596
|
const t = [];
|
|
593
597
|
let n = null, r = null, o = 0;
|
|
594
598
|
for (const l of e) {
|
|
595
599
|
o += 1;
|
|
596
600
|
const i = l.charCodeAt(0);
|
|
597
|
-
i !== 60 && i !== 61 && i !== 62 || (xt(l,
|
|
601
|
+
i !== 60 && i !== 61 && i !== 62 || (xt(l, yr) ? (n = o, r = null) : l === xr ? n !== null && r === null ? r = o : n = null : xt(l, kr) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
|
|
598
602
|
}
|
|
599
603
|
return t;
|
|
600
604
|
}, St = (e) => e.includes(`\r
|
|
601
605
|
`) ? `\r
|
|
602
606
|
` : `
|
|
603
607
|
`, Ue = (e) => e.replace(/\r\n?/gu, `
|
|
604
|
-
`),
|
|
608
|
+
`), Rr = (e, t) => t === `
|
|
605
609
|
` ? e : e.replaceAll(`
|
|
606
610
|
`, `\r
|
|
607
|
-
`),
|
|
611
|
+
`), Tr = 3, Ze = Object.freeze({ kind: "idle" }), Cr = ({ data: e, conflictLabels: t, onSaveSettled: n, previewSetting: r }) => {
|
|
608
612
|
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), f = ye();
|
|
609
|
-
let u = null,
|
|
613
|
+
let u = null, h = null;
|
|
610
614
|
const m = (s, c) => {
|
|
611
615
|
s.value = { ...s.value, ...c }, f.emit();
|
|
612
|
-
},
|
|
616
|
+
}, S = (s, c) => o.get(s) === c, A = async (s, c) => {
|
|
613
617
|
c.controller.abort(), c.controller = new AbortController();
|
|
614
|
-
const { signal:
|
|
618
|
+
const { signal: p } = c.controller;
|
|
615
619
|
m(c, { phase: { kind: "opening" } });
|
|
616
|
-
const w = await e.edit(s,
|
|
617
|
-
if (!
|
|
620
|
+
const w = await e.edit(s, p);
|
|
621
|
+
if (!S(s, c) || p.aborted || !("kind" in w)) return;
|
|
618
622
|
if (w.kind === "grant") {
|
|
619
623
|
m(c, { phase: { kind: "grant", href: w.href } });
|
|
620
624
|
return;
|
|
@@ -625,65 +629,65 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
625
629
|
}
|
|
626
630
|
const k = Ue(w.text);
|
|
627
631
|
c.base = { text: k, version: w.version }, c.draft = k, c.ending = St(w.text), m(c, { phase: { kind: "editing" }, history: w.history, dirty: !1, save: Ze, generation: c.value.generation + 1 });
|
|
628
|
-
},
|
|
632
|
+
}, x = (s) => {
|
|
629
633
|
const c = o.get(s);
|
|
630
634
|
c !== void 0 && (c.controller.abort(), o.delete(s), i.delete(s));
|
|
631
|
-
}, T = (s, c,
|
|
632
|
-
s.get(c) ===
|
|
633
|
-
}),
|
|
634
|
-
m(c, { ...w, save:
|
|
635
|
-
},
|
|
635
|
+
}, T = (s, c, p) => (s.set(c, p), () => {
|
|
636
|
+
s.get(c) === p && s.delete(c);
|
|
637
|
+
}), M = (s, c, p, w = {}) => {
|
|
638
|
+
m(c, { ...w, save: p }), n(s, p);
|
|
639
|
+
}, C = async (s) => {
|
|
636
640
|
d.get(s)?.flush();
|
|
637
641
|
const c = o.get(s);
|
|
638
642
|
if (c === void 0 || c.value.phase.kind !== "editing" || c.base === null || c.value.save.kind === "saving") return;
|
|
639
|
-
const
|
|
640
|
-
if (
|
|
641
|
-
|
|
643
|
+
const p = kt(c.draft).length;
|
|
644
|
+
if (p > 0) {
|
|
645
|
+
M(s, c, { kind: "conflicts", count: p });
|
|
642
646
|
return;
|
|
643
647
|
}
|
|
644
648
|
c.controller.abort(), c.controller = new AbortController();
|
|
645
649
|
const { signal: w } = c.controller;
|
|
646
|
-
let k = c.base, L = c.draft,
|
|
650
|
+
let k = c.base, L = c.draft, O = !1;
|
|
647
651
|
m(c, { save: { kind: "saving" } });
|
|
648
|
-
for (let N = 0; N <
|
|
649
|
-
const q = await e.save(s, k.version,
|
|
650
|
-
if (!
|
|
652
|
+
for (let N = 0; N < Tr; N += 1) {
|
|
653
|
+
const q = await e.save(s, k.version, Rr(L, c.ending), w);
|
|
654
|
+
if (!S(s, c) || w.aborted || !("kind" in q)) return;
|
|
651
655
|
if (q.kind === "saved") {
|
|
652
|
-
d.get(s)?.flush(), c.base = { text: L, version: q.version },
|
|
656
|
+
d.get(s)?.flush(), c.base = { text: L, version: q.version }, M(s, c, { kind: "saved", merged: O }, { dirty: c.draft !== L });
|
|
653
657
|
return;
|
|
654
658
|
}
|
|
655
659
|
if (q.kind === "grant") {
|
|
656
|
-
|
|
660
|
+
M(s, c, { kind: "grant", href: q.href });
|
|
657
661
|
return;
|
|
658
662
|
}
|
|
659
663
|
if (q.kind === "failure") {
|
|
660
|
-
|
|
664
|
+
M(s, c, { kind: "failed", failure: q.failure });
|
|
661
665
|
return;
|
|
662
666
|
}
|
|
663
|
-
const { mergeDraft:
|
|
664
|
-
if (!
|
|
665
|
-
const
|
|
666
|
-
|
|
667
|
-
const
|
|
668
|
-
if (k = { text:
|
|
669
|
-
|
|
667
|
+
const { mergeDraft: G } = await import("./merge-DDJaJmMU.js");
|
|
668
|
+
if (!S(s, c) || w.aborted) return;
|
|
669
|
+
const W = d.get(s);
|
|
670
|
+
W?.flush();
|
|
671
|
+
const Q = Ue(q.text), K = G(k.text, c.draft, Q, t());
|
|
672
|
+
if (k = { text: Q, version: q.version }, c.base = k, c.ending = St(q.text), c.draft = K.text, W?.adopt(K.text), K.kind === "conflicts") {
|
|
673
|
+
M(s, c, { kind: "conflicts", count: K.conflicts }, { dirty: !0, generation: c.value.generation + 1 });
|
|
670
674
|
return;
|
|
671
675
|
}
|
|
672
|
-
if (
|
|
673
|
-
|
|
676
|
+
if (O = !0, L = K.text, L === k.text) {
|
|
677
|
+
M(s, c, { kind: "saved", merged: O }, { dirty: !1, generation: c.value.generation + 1 });
|
|
674
678
|
return;
|
|
675
679
|
}
|
|
676
680
|
m(c, { dirty: !0, generation: c.value.generation + 1 });
|
|
677
681
|
}
|
|
678
|
-
|
|
682
|
+
M(s, c, { kind: "failed", failure: { reason: "failed" } });
|
|
679
683
|
};
|
|
680
684
|
return {
|
|
681
685
|
session: (s) => o.get(s)?.value,
|
|
682
686
|
subscribe: f.subscribe,
|
|
683
687
|
start: (s, c) => {
|
|
684
|
-
const
|
|
685
|
-
if (
|
|
686
|
-
m(
|
|
688
|
+
const p = o.get(s);
|
|
689
|
+
if (p !== void 0) {
|
|
690
|
+
m(p, { request: { anchor: c } }), (p.value.phase.kind === "failed" || p.value.phase.kind === "grant") && A(s, p);
|
|
687
691
|
return;
|
|
688
692
|
}
|
|
689
693
|
l.delete(s);
|
|
@@ -695,46 +699,46 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
695
699
|
`,
|
|
696
700
|
controller: new AbortController()
|
|
697
701
|
};
|
|
698
|
-
o.set(s, w),
|
|
702
|
+
o.set(s, w), A(s, w);
|
|
699
703
|
},
|
|
700
704
|
retry: (s) => {
|
|
701
705
|
const c = o.get(s);
|
|
702
|
-
c === void 0 || c.value.phase.kind === "editing" ||
|
|
706
|
+
c === void 0 || c.value.phase.kind === "editing" || A(s, c);
|
|
703
707
|
},
|
|
704
708
|
draft: (s) => {
|
|
705
709
|
const c = o.get(s);
|
|
706
710
|
return c === void 0 || c.base === null ? null : c.draft;
|
|
707
711
|
},
|
|
708
712
|
setDraft: (s, c) => {
|
|
709
|
-
const
|
|
710
|
-
if (
|
|
711
|
-
|
|
712
|
-
const w = {}, k = c !==
|
|
713
|
-
k !==
|
|
714
|
-
const { save: L } =
|
|
713
|
+
const p = o.get(s);
|
|
714
|
+
if (p === void 0 || p.base === null) return;
|
|
715
|
+
p.draft = c;
|
|
716
|
+
const w = {}, k = c !== p.base.text;
|
|
717
|
+
k !== p.value.dirty && (w.dirty = k);
|
|
718
|
+
const { save: L } = p.value;
|
|
715
719
|
if (L.kind === "conflicts") {
|
|
716
|
-
const
|
|
717
|
-
|
|
720
|
+
const O = kt(c).length;
|
|
721
|
+
O === 0 ? w.save = Ze : O !== L.count && (w.save = { kind: "conflicts", count: O });
|
|
718
722
|
}
|
|
719
|
-
(w.dirty !== void 0 || w.save !== void 0) && m(
|
|
723
|
+
(w.dirty !== void 0 || w.save !== void 0) && m(p, w);
|
|
720
724
|
},
|
|
721
725
|
consumeRequest: (s) => {
|
|
722
726
|
const c = o.get(s);
|
|
723
727
|
c !== void 0 && c.value.request !== null && m(c, { request: null });
|
|
724
728
|
},
|
|
725
|
-
save:
|
|
729
|
+
save: C,
|
|
726
730
|
replaceDraft: (s, c) => {
|
|
727
|
-
const
|
|
728
|
-
|
|
731
|
+
const p = d.get(s);
|
|
732
|
+
p?.flush();
|
|
729
733
|
const w = o.get(s);
|
|
730
734
|
if (w === void 0 || w.base === null) return;
|
|
731
735
|
const k = Ue(c);
|
|
732
|
-
w.draft = k,
|
|
736
|
+
w.draft = k, p?.adopt(k), m(w, { dirty: k !== w.base.text, generation: w.value.generation + 1 });
|
|
733
737
|
},
|
|
734
738
|
close: (s) => {
|
|
735
739
|
if (!o.has(s)) return;
|
|
736
|
-
const c = d.get(s),
|
|
737
|
-
|
|
740
|
+
const c = d.get(s), p = c === void 0 ? null : c.returnPoint();
|
|
741
|
+
x(s), p === null ? l.delete(s) : l.set(s, p), f.emit();
|
|
738
742
|
},
|
|
739
743
|
takeReturn: (s) => {
|
|
740
744
|
const c = l.get(s) ?? null;
|
|
@@ -742,7 +746,7 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
742
746
|
},
|
|
743
747
|
dirtyPaths: () => [...o.values()].filter((s) => s.value.dirty).map((s) => s.value.path),
|
|
744
748
|
discard: (s) => {
|
|
745
|
-
for (const c of s)
|
|
749
|
+
for (const c of s) x(c);
|
|
746
750
|
s.length > 0 && f.emit();
|
|
747
751
|
},
|
|
748
752
|
editorState: {
|
|
@@ -768,51 +772,51 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
768
772
|
return s.filter((c) => o.get(c)?.value.dirty === !0);
|
|
769
773
|
},
|
|
770
774
|
askToDiscard: (s) => new Promise((c) => {
|
|
771
|
-
|
|
772
|
-
const
|
|
775
|
+
h?.settle(!1);
|
|
776
|
+
const p = {
|
|
773
777
|
paths: s,
|
|
774
778
|
settle: (w) => {
|
|
775
|
-
if (
|
|
776
|
-
if (
|
|
779
|
+
if (h === p) {
|
|
780
|
+
if (h = null, w) for (const k of s) x(k);
|
|
777
781
|
f.emit(), c(w);
|
|
778
782
|
}
|
|
779
783
|
}
|
|
780
784
|
};
|
|
781
|
-
|
|
785
|
+
h = p, f.emit();
|
|
782
786
|
}),
|
|
783
|
-
discardRequest: () =>
|
|
787
|
+
discardRequest: () => h,
|
|
784
788
|
previewShown: () => (u ??= r.read(), u),
|
|
785
789
|
setPreviewShown: (s) => {
|
|
786
790
|
u !== s && (u = s, r.write(s), f.emit());
|
|
787
791
|
}
|
|
788
792
|
};
|
|
789
|
-
},
|
|
793
|
+
}, rn = (e) => {
|
|
790
794
|
e.preventDefault(), e.stopPropagation();
|
|
791
|
-
},
|
|
792
|
-
const g =
|
|
793
|
-
return
|
|
794
|
-
const
|
|
795
|
-
if (
|
|
796
|
-
if (e && !
|
|
797
|
-
const T =
|
|
798
|
-
u.current = T instanceof HTMLElement ? T : null,
|
|
799
|
-
} else !e &&
|
|
800
|
-
}, [e]), /* @__PURE__ */ a("dialog", { ref: g, className: "aqmx-confirm", "aria-labelledby":
|
|
801
|
-
|
|
802
|
-
}, onClick: (
|
|
803
|
-
|
|
804
|
-
}, onCancel: (
|
|
805
|
-
/* @__PURE__ */ a("p", { id:
|
|
795
|
+
}, on = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: l, onCancel: i, testId: d }) => {
|
|
796
|
+
const g = _(null), f = _(null), u = _(null), h = Oe(), m = Oe();
|
|
797
|
+
return U(() => {
|
|
798
|
+
const x = g.current;
|
|
799
|
+
if (x !== null)
|
|
800
|
+
if (e && !x.open) {
|
|
801
|
+
const T = x.ownerDocument.activeElement;
|
|
802
|
+
u.current = T instanceof HTMLElement ? T : null, x.showModal(), f.current?.focus();
|
|
803
|
+
} else !e && x.open && (x.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
|
|
804
|
+
}, [e]), /* @__PURE__ */ a("dialog", { ref: g, className: "aqmx-confirm", "aria-labelledby": h, "aria-describedby": m, "data-testid": d, onKeyDown: (x) => {
|
|
805
|
+
x.key !== "Escape" || x.defaultPrevented || (rn(x), i());
|
|
806
|
+
}, onClick: (x) => {
|
|
807
|
+
x.target === x.currentTarget && i();
|
|
808
|
+
}, onCancel: (x) => x.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
|
|
809
|
+
/* @__PURE__ */ a("p", { id: h, className: "aqmx-confirm-title", children: t }),
|
|
806
810
|
/* @__PURE__ */ a("p", { id: m, className: "aqmx-confirm-body", children: n }),
|
|
807
811
|
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
808
812
|
/* @__PURE__ */ a("button", { ref: f, type: "button", className: "aqmx-callout-action", "data-testid": `${d}-cancel`, onClick: i, children: o }),
|
|
809
813
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${d}-confirm`, onClick: l, children: r })
|
|
810
814
|
] })
|
|
811
815
|
] }) });
|
|
812
|
-
},
|
|
813
|
-
const n =
|
|
816
|
+
}, Or = (e, t) => {
|
|
817
|
+
const n = On({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
|
|
814
818
|
if (n === null) return /* @__PURE__ */ new Set();
|
|
815
|
-
const { location: r } =
|
|
819
|
+
const { location: r } = Gt(e, n.params["*"], new URLSearchParams(t.search));
|
|
816
820
|
switch (r.view) {
|
|
817
821
|
case "tree":
|
|
818
822
|
return new Set(r.doc === null ? [] : [r.doc]);
|
|
@@ -821,34 +825,34 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
821
825
|
case "multi":
|
|
822
826
|
return new Set(r.docs);
|
|
823
827
|
}
|
|
824
|
-
},
|
|
828
|
+
}, ln = (e) => {
|
|
825
829
|
const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
|
|
826
|
-
return
|
|
827
|
-
},
|
|
828
|
-
},
|
|
830
|
+
return ee(t.subscribe, n, Ar);
|
|
831
|
+
}, sn = () => !1, Ar = () => {
|
|
832
|
+
}, Lr = () => {
|
|
829
833
|
const { edits: e } = D();
|
|
830
|
-
return
|
|
831
|
-
},
|
|
834
|
+
return ee(e.subscribe, e.hasSessions, sn);
|
|
835
|
+
}, Mr = () => {
|
|
832
836
|
const { edits: e } = D();
|
|
833
|
-
return
|
|
834
|
-
},
|
|
835
|
-
const { edits: e, labels: t, config: n } = D(), r =
|
|
836
|
-
({ nextLocation:
|
|
837
|
-
const m =
|
|
838
|
-
return e.flushDrafts(), r.current = e.dirtyPaths().filter((
|
|
837
|
+
return ee(e.subscribe, e.previewShown, sn);
|
|
838
|
+
}, Nr = () => null, Dr = () => {
|
|
839
|
+
const { edits: e, labels: t, config: n } = D(), r = _([]), o = P(
|
|
840
|
+
({ nextLocation: h }) => {
|
|
841
|
+
const m = Or(n, h);
|
|
842
|
+
return e.flushDrafts(), r.current = e.dirtyPaths().filter((S) => !m.has(S)), r.current.length > 0;
|
|
839
843
|
},
|
|
840
844
|
[e, n]
|
|
841
|
-
), l =
|
|
842
|
-
|
|
845
|
+
), l = An(o), i = Lr();
|
|
846
|
+
te(() => {
|
|
843
847
|
if (!i) return;
|
|
844
|
-
const
|
|
848
|
+
const h = (m) => {
|
|
845
849
|
e.flushDrafts(), e.dirtyPaths().length !== 0 && (m.preventDefault(), m.returnValue = !0);
|
|
846
850
|
};
|
|
847
|
-
return window.addEventListener("beforeunload",
|
|
851
|
+
return window.addEventListener("beforeunload", h), () => window.removeEventListener("beforeunload", h);
|
|
848
852
|
}, [i, e]);
|
|
849
|
-
const d =
|
|
853
|
+
const d = ee(e.subscribe, e.discardRequest, Nr), g = l.state === "blocked", u = (g ? r.current : d === null ? [] : d.paths).map((h) => Ee(h)).join(", ");
|
|
850
854
|
return /* @__PURE__ */ a(
|
|
851
|
-
|
|
855
|
+
on,
|
|
852
856
|
{
|
|
853
857
|
open: g || d !== null,
|
|
854
858
|
title: t.unsavedTitle,
|
|
@@ -873,12 +877,12 @@ const bt = Object.freeze(["en", "ja"]), ur = "en", fr = Object.freeze({
|
|
|
873
877
|
}
|
|
874
878
|
);
|
|
875
879
|
};
|
|
876
|
-
function
|
|
880
|
+
function $r({
|
|
877
881
|
title: e,
|
|
878
882
|
titleId: t,
|
|
879
883
|
...n
|
|
880
884
|
}, r) {
|
|
881
|
-
return /* @__PURE__ */
|
|
885
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
882
886
|
xmlns: "http://www.w3.org/2000/svg",
|
|
883
887
|
viewBox: "0 0 20 20",
|
|
884
888
|
fill: "currentColor",
|
|
@@ -886,26 +890,26 @@ function Pr({
|
|
|
886
890
|
"data-slot": "icon",
|
|
887
891
|
ref: r,
|
|
888
892
|
"aria-labelledby": t
|
|
889
|
-
}, n), e ? /* @__PURE__ */
|
|
893
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
890
894
|
id: t
|
|
891
|
-
}, e) : null, /* @__PURE__ */
|
|
895
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
892
896
|
fillRule: "evenodd",
|
|
893
897
|
d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm2.25 8.5a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Zm0 3a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
|
|
894
898
|
clipRule: "evenodd"
|
|
895
899
|
}));
|
|
896
900
|
}
|
|
897
|
-
const
|
|
901
|
+
const Pr = /* @__PURE__ */ E.forwardRef($r);
|
|
898
902
|
let Ve = null;
|
|
899
|
-
const
|
|
903
|
+
const an = () => (Ve ??= import("./EditSurface-BTAhzvHi.js").catch((e) => {
|
|
900
904
|
throw Ve = null, e;
|
|
901
|
-
}), Ve),
|
|
902
|
-
|
|
905
|
+
}), Ve), Fr = () => {
|
|
906
|
+
an().catch(() => {
|
|
903
907
|
});
|
|
904
908
|
}, qr = (e) => {
|
|
905
|
-
const { default: t } =
|
|
909
|
+
const { default: t } = ne(an());
|
|
906
910
|
return /* @__PURE__ */ a(t, { ...e });
|
|
907
911
|
};
|
|
908
|
-
class _r extends
|
|
912
|
+
class _r extends Zt {
|
|
909
913
|
state = { failed: !1 };
|
|
910
914
|
static getDerivedStateFromError() {
|
|
911
915
|
return { failed: !0 };
|
|
@@ -915,7 +919,7 @@ class _r extends Vt {
|
|
|
915
919
|
return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
|
|
916
920
|
}
|
|
917
921
|
}
|
|
918
|
-
const rt = `[${
|
|
922
|
+
const rt = `[${Wt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg', jr = 200, we = (e) => ir(e.getAttribute(Wt)), Hr = (e, t) => {
|
|
919
923
|
for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
|
|
920
924
|
const o = we(r);
|
|
921
925
|
if (o !== null) return { block: r, lines: o, own: !0 };
|
|
@@ -963,7 +967,7 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
963
967
|
if (r === "" || r.length > jr || /[\r\n]/u.test(r)) return null;
|
|
964
968
|
const o = e.ownerDocument.createRange();
|
|
965
969
|
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: zr(o.toString(), r), clientTop: n.getBoundingClientRect().top };
|
|
966
|
-
},
|
|
970
|
+
}, os = (e, t) => {
|
|
967
971
|
const n = e.split(`
|
|
968
972
|
`), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), l = { line: r, column: 0 };
|
|
969
973
|
if (t.word === null) return l;
|
|
@@ -1010,15 +1014,15 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1010
1014
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1011
1015
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
1012
1016
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
1013
|
-
}),
|
|
1014
|
-
const e =
|
|
1017
|
+
}), ls = (e) => ot[e], $e = () => {
|
|
1018
|
+
const e = Ln();
|
|
1015
1019
|
return P(
|
|
1016
1020
|
(t, n) => {
|
|
1017
1021
|
e(t, ot[n]);
|
|
1018
1022
|
},
|
|
1019
1023
|
[e]
|
|
1020
1024
|
);
|
|
1021
|
-
}, Qr = ({ navigation: e, ...t }) => /* @__PURE__ */ a(
|
|
1025
|
+
}, Qr = ({ navigation: e, ...t }) => /* @__PURE__ */ a(Mn, { ...t, ...ot[e] }), cn = (e) => {
|
|
1022
1026
|
const t = e.ownerDocument;
|
|
1023
1027
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
1024
1028
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -1029,10 +1033,10 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1029
1033
|
};
|
|
1030
1034
|
return e.addEventListener("blur", n), !0;
|
|
1031
1035
|
}, eo = (e, t) => {
|
|
1032
|
-
const n =
|
|
1036
|
+
const n = _(null), r = _(null), o = _(null), l = P(() => {
|
|
1033
1037
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
1034
1038
|
}, []);
|
|
1035
|
-
|
|
1039
|
+
te(() => l, [l]);
|
|
1036
1040
|
const i = P(
|
|
1037
1041
|
(f) => {
|
|
1038
1042
|
if (r.current !== f) return;
|
|
@@ -1042,9 +1046,9 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1042
1046
|
return;
|
|
1043
1047
|
}
|
|
1044
1048
|
e.prefetch(f);
|
|
1045
|
-
const
|
|
1046
|
-
if (
|
|
1047
|
-
const m = Promise.allSettled([
|
|
1049
|
+
const h = e.peek(f);
|
|
1050
|
+
if (h?.status !== "pending") return;
|
|
1051
|
+
const m = Promise.allSettled([h.promise]);
|
|
1048
1052
|
o.current = m, m.then(() => {
|
|
1049
1053
|
o.current === m && (o.current = null);
|
|
1050
1054
|
});
|
|
@@ -1055,7 +1059,7 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1055
1059
|
const u = t(f);
|
|
1056
1060
|
u !== r.current && (l(), u !== null && (r.current = u, n.current = window.setTimeout(() => {
|
|
1057
1061
|
n.current = null, i(u);
|
|
1058
|
-
},
|
|
1062
|
+
}, $n)));
|
|
1059
1063
|
},
|
|
1060
1064
|
[l, t, i]
|
|
1061
1065
|
), g = P(
|
|
@@ -1064,7 +1068,7 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1064
1068
|
},
|
|
1065
1069
|
[l, t]
|
|
1066
1070
|
);
|
|
1067
|
-
return
|
|
1071
|
+
return z(
|
|
1068
1072
|
() => ({
|
|
1069
1073
|
onPointerOver: (f) => d(f.target),
|
|
1070
1074
|
onPointerOut: (f) => g(f.relatedTarget),
|
|
@@ -1073,8 +1077,8 @@ const rt = `[${Xt}]`, Br = "[data-aqmd-content]", Ir = 'a[href], button, input,
|
|
|
1073
1077
|
}),
|
|
1074
1078
|
[d, g]
|
|
1075
1079
|
);
|
|
1076
|
-
}, to = tt(() => import("./NativeScrollBar-
|
|
1077
|
-
class no extends
|
|
1080
|
+
}, to = tt(() => import("./NativeScrollBar-CNQr7JY1.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1081
|
+
class no extends Zt {
|
|
1078
1082
|
state = { failed: !1 };
|
|
1079
1083
|
static getDerivedStateFromError() {
|
|
1080
1084
|
return { failed: !0 };
|
|
@@ -1086,7 +1090,7 @@ class no extends Vt {
|
|
|
1086
1090
|
return this.state.failed ? null : this.props.children;
|
|
1087
1091
|
}
|
|
1088
1092
|
}
|
|
1089
|
-
const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children: /* @__PURE__ */ a(ge, { fallback: null, children: /* @__PURE__ */ a(to, { scroller: e, withCircle: t }) }) }),
|
|
1093
|
+
const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children: /* @__PURE__ */ a(ge, { fallback: null, children: /* @__PURE__ */ a(to, { scroller: e, withCircle: t }) }) }), dn = (e) => /* @__PURE__ */ a(ro, { scroller: e, withCircle: !0 }), un = () => {
|
|
1090
1094
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
1091
1095
|
let n = !1;
|
|
1092
1096
|
const r = (o) => {
|
|
@@ -1130,9 +1134,9 @@ const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children:
|
|
|
1130
1134
|
t.status = "rejected", t.reason = n;
|
|
1131
1135
|
}
|
|
1132
1136
|
)), t;
|
|
1133
|
-
},
|
|
1137
|
+
}, fn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Se = (e) => e.status === "fulfilled" ? e.value : void 0, oo = 55e3, Rt = Object.freeze({ status: "deferred" }), Tt = Object.freeze({ status: "refreshed" }), Ge = Object.freeze({ status: "superseded" }), de = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, mn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", lo = ({ client: e, capacity: t }) => {
|
|
1134
1138
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
1135
|
-
const n = /* @__PURE__ */ new Map(), r =
|
|
1139
|
+
const n = /* @__PURE__ */ new Map(), r = un(), o = ye(), l = /* @__PURE__ */ new WeakSet();
|
|
1136
1140
|
let i = 0;
|
|
1137
1141
|
const d = o.emit, g = () => (i += 1, i), f = () => {
|
|
1138
1142
|
if (!(n.size <= t))
|
|
@@ -1142,31 +1146,31 @@ const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children:
|
|
|
1142
1146
|
}
|
|
1143
1147
|
}, u = (s, c) => {
|
|
1144
1148
|
n.delete(s), n.set(s, c);
|
|
1145
|
-
},
|
|
1146
|
-
const w = n.get(s), k = de(w?.snapshot), L =
|
|
1147
|
-
return u(s, N), f(),
|
|
1149
|
+
}, h = (s) => performance.now() - s.validatedAt >= oo, m = (s, c, p) => {
|
|
1150
|
+
const w = n.get(s), k = de(w?.snapshot), L = p || w?.refreshPending === !0, O = be(e.document(s, { refresh: L }).then((q) => ({ status: "loaded", document: q }))), N = { snapshot: { status: "pending", promise: O, previous: k }, validatedAt: performance.now(), opened: c, background: null, refreshPending: !1, seeded: void 0, stamp: g() };
|
|
1151
|
+
return u(s, N), f(), O.then((q) => {
|
|
1148
1152
|
n.get(s) === N && (N.snapshot = q, N.stamp = g(), d());
|
|
1149
1153
|
}), N;
|
|
1150
|
-
},
|
|
1151
|
-
c.background ===
|
|
1152
|
-
},
|
|
1153
|
-
const
|
|
1154
|
-
if (
|
|
1154
|
+
}, S = (s, c, p, w, k, L) => {
|
|
1155
|
+
c.background === p && (c.background = null, !(n.get(s) !== c || c.snapshot !== w) && (k.kind === "failure" && w.document.kind !== "failure" || (c.validatedAt = L, c.stamp = g(), Me(w.document, k) || (c.snapshot = { status: "loaded", document: k }), d())));
|
|
1156
|
+
}, A = async (s, c) => {
|
|
1157
|
+
const p = c.snapshot;
|
|
1158
|
+
if (p.status !== "loaded") return null;
|
|
1155
1159
|
const w = {};
|
|
1156
1160
|
c.background = w;
|
|
1157
1161
|
const k = performance.now(), L = e.document(s, { refresh: c.refreshPending });
|
|
1158
1162
|
c.refreshPending = !1;
|
|
1159
|
-
const
|
|
1160
|
-
return
|
|
1161
|
-
},
|
|
1162
|
-
const { snapshot:
|
|
1163
|
-
return
|
|
1163
|
+
const O = await L, N = c.background === w && n.get(s) === c && c.snapshot === p;
|
|
1164
|
+
return S(s, c, w, p, O, k), N ? O : null;
|
|
1165
|
+
}, x = (s, c) => {
|
|
1166
|
+
const { snapshot: p } = c;
|
|
1167
|
+
return p.status === "pending" ? !1 : p.status === "loaded" && p.document.kind !== "failure" ? (A(s, c), !1) : (p.status === "loaded" && l.add(p), m(s, !0, !1), !0);
|
|
1164
1168
|
}, T = (s) => {
|
|
1165
1169
|
const c = r.hold(s);
|
|
1166
|
-
let
|
|
1170
|
+
let p = !1;
|
|
1167
1171
|
return () => {
|
|
1168
|
-
if (
|
|
1169
|
-
|
|
1172
|
+
if (p) return;
|
|
1173
|
+
p = !0, c();
|
|
1170
1174
|
const w = n.get(s);
|
|
1171
1175
|
w !== void 0 && u(s, w), f();
|
|
1172
1176
|
};
|
|
@@ -1180,12 +1184,12 @@ const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children:
|
|
|
1180
1184
|
c !== void 0 && c.snapshot.status !== "deferred" || (m(s, !1, !1), d());
|
|
1181
1185
|
},
|
|
1182
1186
|
open: (s) => {
|
|
1183
|
-
const c = r.resumes(s),
|
|
1187
|
+
const c = r.resumes(s), p = T(s), w = n.get(s);
|
|
1184
1188
|
if (w === void 0 || w.snapshot.status === "deferred")
|
|
1185
|
-
return m(s, !0, !1), d(),
|
|
1186
|
-
if (u(s, w), c) return
|
|
1189
|
+
return m(s, !0, !1), d(), p;
|
|
1190
|
+
if (u(s, w), c) return p;
|
|
1187
1191
|
const { snapshot: k } = w;
|
|
1188
|
-
return k.status === "pending" ? (w.opened = !0,
|
|
1192
|
+
return k.status === "pending" ? (w.opened = !0, p) : k.document.kind === "failure" ? (w.opened || h(w) ? (l.add(k), m(s, !0, !1), d()) : w.opened = !0, p) : (w.opened = !0, w.background === null && h(w) && A(s, w), p);
|
|
1189
1193
|
},
|
|
1190
1194
|
retain: T,
|
|
1191
1195
|
retry: (s) => {
|
|
@@ -1193,52 +1197,52 @@ const ro = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ a(no, { children:
|
|
|
1193
1197
|
c === void 0 || c.snapshot.status !== "loaded" || c.snapshot.document.kind !== "failure" || (m(s, !0, !1), d());
|
|
1194
1198
|
},
|
|
1195
1199
|
seed: (s, c) => {
|
|
1196
|
-
const
|
|
1200
|
+
const p = performance.now(), w = be(
|
|
1197
1201
|
c.then(
|
|
1198
|
-
(q) => q === null ?
|
|
1199
|
-
() =>
|
|
1202
|
+
(q) => q === null ? Rt : { status: "loaded", document: q },
|
|
1203
|
+
() => Rt
|
|
1200
1204
|
)
|
|
1201
1205
|
), k = n.get(s);
|
|
1202
1206
|
if (k !== void 0 && k.snapshot.status === "loaded") {
|
|
1203
|
-
const q = k.snapshot,
|
|
1204
|
-
k.background =
|
|
1205
|
-
if (
|
|
1206
|
-
|
|
1207
|
+
const q = k.snapshot, G = {};
|
|
1208
|
+
k.background = G, w.then((W) => {
|
|
1209
|
+
if (W.status === "loaded") {
|
|
1210
|
+
S(s, k, G, q, W.document, p);
|
|
1207
1211
|
return;
|
|
1208
1212
|
}
|
|
1209
|
-
k.background ===
|
|
1213
|
+
k.background === G && (k.background = null);
|
|
1210
1214
|
});
|
|
1211
1215
|
return;
|
|
1212
1216
|
}
|
|
1213
|
-
const L = k !== void 0 && k.snapshot.status === "pending" ? k.snapshot.previous : null,
|
|
1217
|
+
const L = k !== void 0 && k.snapshot.status === "pending" ? k.snapshot.previous : null, O = { status: "pending", promise: w, previous: L }, N = { snapshot: O, validatedAt: p, opened: k?.opened === !0, background: null, refreshPending: k?.refreshPending === !0, seeded: O, stamp: g() };
|
|
1214
1218
|
u(s, N), f(), w.then((q) => {
|
|
1215
1219
|
n.get(s) === N && (q.status === "deferred" && r.isHeld(s) ? m(s, N.opened, !1) : (N.snapshot = q, N.stamp = g()), d());
|
|
1216
1220
|
});
|
|
1217
1221
|
},
|
|
1218
1222
|
invalidate: () => {
|
|
1219
1223
|
let s = !1;
|
|
1220
|
-
for (const [c,
|
|
1221
|
-
if (
|
|
1222
|
-
const { snapshot: w } =
|
|
1224
|
+
for (const [c, p] of [...n]) {
|
|
1225
|
+
if (p.validatedAt = Number.NEGATIVE_INFINITY, p.opened = !0, p.refreshPending = !0, !r.isHeld(c)) continue;
|
|
1226
|
+
const { snapshot: w } = p;
|
|
1223
1227
|
if (w.status !== "pending") {
|
|
1224
|
-
|
|
1228
|
+
x(c, p) && (s = !0);
|
|
1225
1229
|
continue;
|
|
1226
1230
|
}
|
|
1227
1231
|
w.promise.then(() => {
|
|
1228
|
-
n.get(c) ===
|
|
1232
|
+
n.get(c) === p && p.refreshPending && r.isHeld(c) && x(c, p) && d();
|
|
1229
1233
|
});
|
|
1230
1234
|
}
|
|
1231
1235
|
s && d();
|
|
1232
1236
|
},
|
|
1233
1237
|
refresh: async (s) => {
|
|
1234
1238
|
const c = n.get(s);
|
|
1235
|
-
if (c !== void 0 &&
|
|
1239
|
+
if (c !== void 0 && mn(c.snapshot)) {
|
|
1236
1240
|
c.refreshPending = !0;
|
|
1237
|
-
const w = await
|
|
1238
|
-
return w === null ? Ge : w.kind === "failure" ? { status: "failed", failure: w.failure } :
|
|
1241
|
+
const w = await A(s, c);
|
|
1242
|
+
return w === null ? Ge : w.kind === "failure" ? { status: "failed", failure: w.failure } : Tt;
|
|
1239
1243
|
}
|
|
1240
|
-
const
|
|
1241
|
-
return d(),
|
|
1244
|
+
const p = m(s, !0, !0);
|
|
1245
|
+
return d(), p.snapshot.status !== "pending" ? Ge : (await p.snapshot.promise, n.get(s) === p ? Tt : Ge);
|
|
1242
1246
|
},
|
|
1243
1247
|
clear: () => {
|
|
1244
1248
|
n.clear();
|
|
@@ -1254,7 +1258,7 @@ function io({
|
|
|
1254
1258
|
titleId: t,
|
|
1255
1259
|
...n
|
|
1256
1260
|
}, r) {
|
|
1257
|
-
return /* @__PURE__ */
|
|
1261
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1258
1262
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1259
1263
|
viewBox: "0 0 20 20",
|
|
1260
1264
|
fill: "currentColor",
|
|
@@ -1262,25 +1266,25 @@ function io({
|
|
|
1262
1266
|
"data-slot": "icon",
|
|
1263
1267
|
ref: r,
|
|
1264
1268
|
"aria-labelledby": t
|
|
1265
|
-
}, n), e ? /* @__PURE__ */
|
|
1269
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1266
1270
|
id: t
|
|
1267
|
-
}, e) : null, /* @__PURE__ */
|
|
1271
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1268
1272
|
fillRule: "evenodd",
|
|
1269
1273
|
d: "M18 5.25a2.25 2.25 0 0 0-2.012-2.238A2.25 2.25 0 0 0 13.75 1h-1.5a2.25 2.25 0 0 0-2.238 2.012c-.875.092-1.6.686-1.884 1.488H11A2.5 2.5 0 0 1 13.5 7v7h2.25A2.25 2.25 0 0 0 18 11.75v-6.5ZM12.25 2.5a.75.75 0 0 0-.75.75v.25h3v-.25a.75.75 0 0 0-.75-.75h-1.5Z",
|
|
1270
1274
|
clipRule: "evenodd"
|
|
1271
|
-
}), /* @__PURE__ */
|
|
1275
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1272
1276
|
fillRule: "evenodd",
|
|
1273
1277
|
d: "M3 6a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H3Zm6.874 4.166a.75.75 0 1 0-1.248-.832l-2.493 3.739-.853-.853a.75.75 0 0 0-1.06 1.06l1.5 1.5a.75.75 0 0 0 1.154-.114l3-4.5Z",
|
|
1274
1278
|
clipRule: "evenodd"
|
|
1275
1279
|
}));
|
|
1276
1280
|
}
|
|
1277
|
-
const so = /* @__PURE__ */
|
|
1281
|
+
const so = /* @__PURE__ */ E.forwardRef(io);
|
|
1278
1282
|
function ao({
|
|
1279
1283
|
title: e,
|
|
1280
1284
|
titleId: t,
|
|
1281
1285
|
...n
|
|
1282
1286
|
}, r) {
|
|
1283
|
-
return /* @__PURE__ */
|
|
1287
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1284
1288
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1285
1289
|
viewBox: "0 0 20 20",
|
|
1286
1290
|
fill: "currentColor",
|
|
@@ -1288,23 +1292,23 @@ function ao({
|
|
|
1288
1292
|
"data-slot": "icon",
|
|
1289
1293
|
ref: r,
|
|
1290
1294
|
"aria-labelledby": t
|
|
1291
|
-
}, n), e ? /* @__PURE__ */
|
|
1295
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1292
1296
|
id: t
|
|
1293
|
-
}, e) : null, /* @__PURE__ */
|
|
1297
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1294
1298
|
fillRule: "evenodd",
|
|
1295
1299
|
d: "M15.988 3.012A2.25 2.25 0 0 1 18 5.25v6.5A2.25 2.25 0 0 1 15.75 14H13.5v-3.379a3 3 0 0 0-.879-2.121l-3.12-3.121a3 3 0 0 0-1.402-.791 2.252 2.252 0 0 1 1.913-1.576A2.25 2.25 0 0 1 12.25 1h1.5a2.25 2.25 0 0 1 2.238 2.012ZM11.5 3.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75v.25h-3v-.25Z",
|
|
1296
1300
|
clipRule: "evenodd"
|
|
1297
|
-
}), /* @__PURE__ */
|
|
1301
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1298
1302
|
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"
|
|
1299
1303
|
}));
|
|
1300
1304
|
}
|
|
1301
|
-
const co = /* @__PURE__ */
|
|
1305
|
+
const co = /* @__PURE__ */ E.forwardRef(ao);
|
|
1302
1306
|
function uo({
|
|
1303
1307
|
title: e,
|
|
1304
1308
|
titleId: t,
|
|
1305
1309
|
...n
|
|
1306
1310
|
}, r) {
|
|
1307
|
-
return /* @__PURE__ */
|
|
1311
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1308
1312
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1309
1313
|
viewBox: "0 0 20 20",
|
|
1310
1314
|
fill: "currentColor",
|
|
@@ -1312,22 +1316,22 @@ function uo({
|
|
|
1312
1316
|
"data-slot": "icon",
|
|
1313
1317
|
ref: r,
|
|
1314
1318
|
"aria-labelledby": t
|
|
1315
|
-
}, n), e ? /* @__PURE__ */
|
|
1319
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1316
1320
|
id: t
|
|
1317
|
-
}, e) : null, /* @__PURE__ */
|
|
1321
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1318
1322
|
fillRule: "evenodd",
|
|
1319
1323
|
d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
1320
1324
|
clipRule: "evenodd"
|
|
1321
1325
|
}));
|
|
1322
1326
|
}
|
|
1323
|
-
const fo = /* @__PURE__ */
|
|
1327
|
+
const fo = /* @__PURE__ */ E.forwardRef(uo), mo = 2e3, Ct = Object.freeze({ outcome: "idle" }), ho = (e) => {
|
|
1324
1328
|
const t = navigator.clipboard;
|
|
1325
1329
|
return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
|
|
1326
1330
|
}, po = ({ text: e }) => {
|
|
1327
|
-
const { announcer: t, labels: n } = D(), [r, o] = I(
|
|
1328
|
-
|
|
1331
|
+
const { announcer: t, labels: n } = D(), [r, o] = I(Ct);
|
|
1332
|
+
te(() => {
|
|
1329
1333
|
if (r.outcome === "idle") return;
|
|
1330
|
-
const g = setTimeout(() => o(
|
|
1334
|
+
const g = setTimeout(() => o(Ct), mo);
|
|
1331
1335
|
return () => clearTimeout(g);
|
|
1332
1336
|
}, [r]);
|
|
1333
1337
|
const l = (g) => {
|
|
@@ -1341,13 +1345,13 @@ const fo = /* @__PURE__ */ b.forwardRef(uo), mo = 2e3, Ot = Object.freeze({ outc
|
|
|
1341
1345
|
return (
|
|
1342
1346
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: d, onClick: i, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ a(so, {}) : r.outcome === "failed" ? /* @__PURE__ */ a(fo, {}) : /* @__PURE__ */ a(co, {}) })
|
|
1343
1347
|
);
|
|
1344
|
-
}, fe = me("fill"), go = Object.freeze({ blockSize: "100%" }), xe = ({ scrollerProps: e, children: t }) =>
|
|
1348
|
+
}, fe = me("fill"), go = Object.freeze({ blockSize: "100%" }), xe = ({ scrollerProps: e, children: t }) => ne(fe) === "content" ? /* @__PURE__ */ a(vt, { scrollerProps: e, children: t }) : /* @__PURE__ */ a(vt, { scrollerProps: { ...e, style: go }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: dn, children: t });
|
|
1345
1349
|
function vo({
|
|
1346
1350
|
title: e,
|
|
1347
1351
|
titleId: t,
|
|
1348
1352
|
...n
|
|
1349
1353
|
}, r) {
|
|
1350
|
-
return /* @__PURE__ */
|
|
1354
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1351
1355
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1352
1356
|
viewBox: "0 0 20 20",
|
|
1353
1357
|
fill: "currentColor",
|
|
@@ -1355,21 +1359,21 @@ function vo({
|
|
|
1355
1359
|
"data-slot": "icon",
|
|
1356
1360
|
ref: r,
|
|
1357
1361
|
"aria-labelledby": t
|
|
1358
|
-
}, n), e ? /* @__PURE__ */
|
|
1362
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1359
1363
|
id: t
|
|
1360
|
-
}, e) : null, /* @__PURE__ */
|
|
1364
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1361
1365
|
d: "M10.75 2.75a.75.75 0 0 0-1.5 0v8.614L6.295 8.235a.75.75 0 1 0-1.09 1.03l4.25 4.5a.75.75 0 0 0 1.09 0l4.25-4.5a.75.75 0 0 0-1.09-1.03l-2.955 3.129V2.75Z"
|
|
1362
|
-
}), /* @__PURE__ */
|
|
1366
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1363
1367
|
d: "M3.5 12.75a.75.75 0 0 0-1.5 0v2.5A2.75 2.75 0 0 0 4.75 18h10.5A2.75 2.75 0 0 0 18 15.25v-2.5a.75.75 0 0 0-1.5 0v2.5c0 .69-.56 1.25-1.25 1.25H4.75c-.69 0-1.25-.56-1.25-1.25v-2.5Z"
|
|
1364
1368
|
}));
|
|
1365
1369
|
}
|
|
1366
|
-
const wo = /* @__PURE__ */
|
|
1370
|
+
const wo = /* @__PURE__ */ E.forwardRef(vo);
|
|
1367
1371
|
function bo({
|
|
1368
1372
|
title: e,
|
|
1369
1373
|
titleId: t,
|
|
1370
1374
|
...n
|
|
1371
1375
|
}, r) {
|
|
1372
|
-
return /* @__PURE__ */
|
|
1376
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1373
1377
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1374
1378
|
viewBox: "0 0 20 20",
|
|
1375
1379
|
fill: "currentColor",
|
|
@@ -1377,19 +1381,19 @@ function bo({
|
|
|
1377
1381
|
"data-slot": "icon",
|
|
1378
1382
|
ref: r,
|
|
1379
1383
|
"aria-labelledby": t
|
|
1380
|
-
}, n), e ? /* @__PURE__ */
|
|
1384
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1381
1385
|
id: t
|
|
1382
|
-
}, e) : null, /* @__PURE__ */
|
|
1386
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1383
1387
|
fillRule: "evenodd",
|
|
1384
1388
|
d: "M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Z",
|
|
1385
1389
|
clipRule: "evenodd"
|
|
1386
|
-
}), /* @__PURE__ */
|
|
1390
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1387
1391
|
fillRule: "evenodd",
|
|
1388
1392
|
d: "M6.194 12.753a.75.75 0 0 0 1.06.053L16.5 4.44v2.81a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.553l-9.056 8.194a.75.75 0 0 0-.053 1.06Z",
|
|
1389
1393
|
clipRule: "evenodd"
|
|
1390
1394
|
}));
|
|
1391
1395
|
}
|
|
1392
|
-
const Eo = /* @__PURE__ */
|
|
1396
|
+
const Eo = /* @__PURE__ */ E.forwardRef(bo), Pe = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
|
|
1393
1397
|
const { labels: l } = D();
|
|
1394
1398
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
|
|
1395
1399
|
/* @__PURE__ */ a("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
|
|
@@ -1404,7 +1408,7 @@ function yo({
|
|
|
1404
1408
|
titleId: t,
|
|
1405
1409
|
...n
|
|
1406
1410
|
}, r) {
|
|
1407
|
-
return /* @__PURE__ */
|
|
1411
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1408
1412
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1409
1413
|
viewBox: "0 0 20 20",
|
|
1410
1414
|
fill: "currentColor",
|
|
@@ -1412,15 +1416,15 @@ function yo({
|
|
|
1412
1416
|
"data-slot": "icon",
|
|
1413
1417
|
ref: r,
|
|
1414
1418
|
"aria-labelledby": t
|
|
1415
|
-
}, n), e ? /* @__PURE__ */
|
|
1419
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1416
1420
|
id: t
|
|
1417
|
-
}, e) : null, /* @__PURE__ */
|
|
1421
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1418
1422
|
fillRule: "evenodd",
|
|
1419
1423
|
d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm4.75 6.75a.75.75 0 0 1 1.5 0v2.546l.943-1.048a.75.75 0 0 1 1.114 1.004l-2.25 2.5a.75.75 0 0 1-1.114 0l-2.25-2.5a.75.75 0 1 1 1.114-1.004l.943 1.048V8.75Z",
|
|
1420
1424
|
clipRule: "evenodd"
|
|
1421
1425
|
}));
|
|
1422
1426
|
}
|
|
1423
|
-
const xo = /* @__PURE__ */
|
|
1427
|
+
const xo = /* @__PURE__ */ E.forwardRef(yo), ko = Object.freeze({ className: "aqmx-document-stage" }), So = ({ document: e }) => {
|
|
1424
1428
|
const { labels: t } = D();
|
|
1425
1429
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
1426
1430
|
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ a(xo, {}) }),
|
|
@@ -1436,29 +1440,29 @@ const xo = /* @__PURE__ */ b.forwardRef(yo), ko = Object.freeze({ className: "aq
|
|
|
1436
1440
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
1437
1441
|
const t = new TextEncoder(), n = e.slice(1).split(To).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
1438
1442
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
1439
|
-
},
|
|
1443
|
+
}, hn = (e) => `#${encodeURIComponent(e)}`, Co = (e) => {
|
|
1440
1444
|
if (e === "#") return !0;
|
|
1441
1445
|
const t = lt(e);
|
|
1442
1446
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
1443
|
-
},
|
|
1447
|
+
}, pn = (e, t) => {
|
|
1444
1448
|
if (t === "") return null;
|
|
1445
1449
|
for (const n of e.querySelectorAll("[id]"))
|
|
1446
1450
|
if (n.id === t) return n;
|
|
1447
1451
|
return null;
|
|
1448
|
-
}, Oo = "http://www.w3.org/1999/xhtml",
|
|
1452
|
+
}, Oo = "http://www.w3.org/1999/xhtml", Ot = (e, t) => {
|
|
1449
1453
|
if (t === "") return null;
|
|
1450
|
-
const n =
|
|
1454
|
+
const n = pn(e, t);
|
|
1451
1455
|
if (n !== null) return n;
|
|
1452
1456
|
for (const r of e.querySelectorAll("a[name]"))
|
|
1453
1457
|
if (r.localName === "a" && r.namespaceURI === Oo && r.getAttribute("name") === t) return r;
|
|
1454
1458
|
return null;
|
|
1455
|
-
},
|
|
1459
|
+
}, gn = (e, t) => {
|
|
1456
1460
|
if (e === null || !t.startsWith("#")) return null;
|
|
1457
|
-
const n =
|
|
1461
|
+
const n = Ot(e, t.slice(1));
|
|
1458
1462
|
if (n !== null) return n;
|
|
1459
1463
|
const r = lt(t);
|
|
1460
|
-
return r === null ? null :
|
|
1461
|
-
},
|
|
1464
|
+
return r === null ? null : Ot(e, r);
|
|
1465
|
+
}, At = (e) => {
|
|
1462
1466
|
const { body: t, documentElement: n } = e.ownerDocument;
|
|
1463
1467
|
if (e === t) {
|
|
1464
1468
|
const o = getComputedStyle(n);
|
|
@@ -1471,10 +1475,10 @@ const xo = /* @__PURE__ */ b.forwardRef(yo), ko = Object.freeze({ className: "aq
|
|
|
1471
1475
|
return o !== "hidden" && o !== "clip";
|
|
1472
1476
|
}, Lo = (e, t) => {
|
|
1473
1477
|
const n = t.closest(Fe), r = n !== null && e.contains(n) ? n : e;
|
|
1474
|
-
if (r.scrollHeight > r.clientHeight &&
|
|
1478
|
+
if (r.scrollHeight > r.clientHeight && At(r)) return r;
|
|
1475
1479
|
const o = e.getBoundingClientRect().height, { documentElement: l, scrollingElement: i } = e.ownerDocument;
|
|
1476
1480
|
for (let d = e.parentElement; d !== null && d !== l; d = d.parentElement)
|
|
1477
|
-
if (
|
|
1481
|
+
if (At(d) && d.scrollHeight > d.clientHeight && d.clientHeight < o) return d;
|
|
1478
1482
|
return i instanceof Element && Ao(e.ownerDocument) && i.scrollHeight > i.clientHeight && i.clientHeight < o ? i : r;
|
|
1479
1483
|
}, Mo = Object.freeze({
|
|
1480
1484
|
scrollerOf: Lo,
|
|
@@ -1500,9 +1504,9 @@ const xo = /* @__PURE__ */ b.forwardRef(yo), ko = Object.freeze({ className: "aq
|
|
|
1500
1504
|
}, $o = (e, t) => {
|
|
1501
1505
|
const n = t.scrollerOf(e, e.querySelector(Fe) ?? e);
|
|
1502
1506
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
1503
|
-
},
|
|
1507
|
+
}, Lt = (e, t, n) => {
|
|
1504
1508
|
if (e === null) return null;
|
|
1505
|
-
const r =
|
|
1509
|
+
const r = gn(e, t);
|
|
1506
1510
|
return r === null ? (Co(t) && $o(e, n), null) : (No(e, r), Do(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
1507
1511
|
};
|
|
1508
1512
|
function Po({
|
|
@@ -1510,7 +1514,7 @@ function Po({
|
|
|
1510
1514
|
titleId: t,
|
|
1511
1515
|
...n
|
|
1512
1516
|
}, r) {
|
|
1513
|
-
return /* @__PURE__ */
|
|
1517
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1514
1518
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1515
1519
|
viewBox: "0 0 20 20",
|
|
1516
1520
|
fill: "currentColor",
|
|
@@ -1518,19 +1522,19 @@ function Po({
|
|
|
1518
1522
|
"data-slot": "icon",
|
|
1519
1523
|
ref: r,
|
|
1520
1524
|
"aria-labelledby": t
|
|
1521
|
-
}, n), e ? /* @__PURE__ */
|
|
1525
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1522
1526
|
id: t
|
|
1523
|
-
}, e) : null, /* @__PURE__ */
|
|
1527
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1524
1528
|
d: "M3.28 2.22a.75.75 0 0 0-1.06 1.06L5.44 6.5H2.75a.75.75 0 0 0 0 1.5h4.5A.75.75 0 0 0 8 7.25v-4.5a.75.75 0 0 0-1.5 0v2.69L3.28 2.22ZM13.5 2.75a.75.75 0 0 0-1.5 0v4.5c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-2.69l3.22-3.22a.75.75 0 0 0-1.06-1.06L13.5 5.44V2.75ZM3.28 17.78l3.22-3.22v2.69a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.69l-3.22 3.22a.75.75 0 1 0 1.06 1.06ZM13.5 14.56l3.22 3.22a.75.75 0 1 0 1.06-1.06l-3.22-3.22h2.69a.75.75 0 0 0 0-1.5h-4.5a.75.75 0 0 0-.75.75v4.5a.75.75 0 0 0 1.5 0v-2.69Z"
|
|
1525
1529
|
}));
|
|
1526
1530
|
}
|
|
1527
|
-
const Fo = /* @__PURE__ */
|
|
1531
|
+
const Fo = /* @__PURE__ */ E.forwardRef(Po);
|
|
1528
1532
|
function qo({
|
|
1529
1533
|
title: e,
|
|
1530
1534
|
titleId: t,
|
|
1531
1535
|
...n
|
|
1532
1536
|
}, r) {
|
|
1533
|
-
return /* @__PURE__ */
|
|
1537
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1534
1538
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1535
1539
|
viewBox: "0 0 20 20",
|
|
1536
1540
|
fill: "currentColor",
|
|
@@ -1538,23 +1542,23 @@ function qo({
|
|
|
1538
1542
|
"data-slot": "icon",
|
|
1539
1543
|
ref: r,
|
|
1540
1544
|
"aria-labelledby": t
|
|
1541
|
-
}, n), e ? /* @__PURE__ */
|
|
1545
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1542
1546
|
id: t
|
|
1543
|
-
}, e) : null, /* @__PURE__ */
|
|
1547
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1544
1548
|
d: "M6.75 8.25a.75.75 0 0 0 0 1.5h4.5a.75.75 0 0 0 0-1.5h-4.5Z"
|
|
1545
|
-
}), /* @__PURE__ */
|
|
1549
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1546
1550
|
fillRule: "evenodd",
|
|
1547
1551
|
d: "M9 2a7 7 0 1 0 4.391 12.452l3.329 3.328a.75.75 0 1 0 1.06-1.06l-3.328-3.329A7 7 0 0 0 9 2ZM3.5 9a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",
|
|
1548
1552
|
clipRule: "evenodd"
|
|
1549
1553
|
}));
|
|
1550
1554
|
}
|
|
1551
|
-
const _o = /* @__PURE__ */
|
|
1555
|
+
const _o = /* @__PURE__ */ E.forwardRef(qo);
|
|
1552
1556
|
function Bo({
|
|
1553
1557
|
title: e,
|
|
1554
1558
|
titleId: t,
|
|
1555
1559
|
...n
|
|
1556
1560
|
}, r) {
|
|
1557
|
-
return /* @__PURE__ */
|
|
1561
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1558
1562
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1559
1563
|
viewBox: "0 0 20 20",
|
|
1560
1564
|
fill: "currentColor",
|
|
@@ -1562,23 +1566,23 @@ function Bo({
|
|
|
1562
1566
|
"data-slot": "icon",
|
|
1563
1567
|
ref: r,
|
|
1564
1568
|
"aria-labelledby": t
|
|
1565
|
-
}, n), e ? /* @__PURE__ */
|
|
1569
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1566
1570
|
id: t
|
|
1567
|
-
}, e) : null, /* @__PURE__ */
|
|
1571
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1568
1572
|
d: "M9 6a.75.75 0 0 1 .75.75v1.5h1.5a.75.75 0 0 1 0 1.5h-1.5v1.5a.75.75 0 0 1-1.5 0v-1.5h-1.5a.75.75 0 0 1 0-1.5h1.5v-1.5A.75.75 0 0 1 9 6Z"
|
|
1569
|
-
}), /* @__PURE__ */
|
|
1573
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
1570
1574
|
fillRule: "evenodd",
|
|
1571
1575
|
d: "M2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Zm7-5.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11Z",
|
|
1572
1576
|
clipRule: "evenodd"
|
|
1573
1577
|
}));
|
|
1574
1578
|
}
|
|
1575
|
-
const Io = /* @__PURE__ */
|
|
1579
|
+
const Io = /* @__PURE__ */ E.forwardRef(Bo);
|
|
1576
1580
|
function jo({
|
|
1577
1581
|
title: e,
|
|
1578
1582
|
titleId: t,
|
|
1579
1583
|
...n
|
|
1580
1584
|
}, r) {
|
|
1581
|
-
return /* @__PURE__ */
|
|
1585
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1582
1586
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1583
1587
|
viewBox: "0 0 20 20",
|
|
1584
1588
|
fill: "currentColor",
|
|
@@ -1586,15 +1590,15 @@ function jo({
|
|
|
1586
1590
|
"data-slot": "icon",
|
|
1587
1591
|
ref: r,
|
|
1588
1592
|
"aria-labelledby": t
|
|
1589
|
-
}, n), e ? /* @__PURE__ */
|
|
1593
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1590
1594
|
id: t
|
|
1591
|
-
}, e) : null, /* @__PURE__ */
|
|
1595
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1592
1596
|
fillRule: "evenodd",
|
|
1593
1597
|
d: "M1 5.25A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25v9.5A2.25 2.25 0 0 1 16.75 17H3.25A2.25 2.25 0 0 1 1 14.75v-9.5Zm1.5 5.81v3.69c0 .414.336.75.75.75h13.5a.75.75 0 0 0 .75-.75v-2.69l-2.22-2.219a.75.75 0 0 0-1.06 0l-1.91 1.909.47.47a.75.75 0 1 1-1.06 1.06L6.53 8.091a.75.75 0 0 0-1.06 0l-2.97 2.97ZM12 7a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",
|
|
1594
1598
|
clipRule: "evenodd"
|
|
1595
1599
|
}));
|
|
1596
1600
|
}
|
|
1597
|
-
const Ho = /* @__PURE__ */
|
|
1601
|
+
const Ho = /* @__PURE__ */ E.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = Object.freeze({ [Je]: "allow" }), zo = `[${Je}="${Qe[Je]}"]`, Uo = () => {
|
|
1598
1602
|
let e = null;
|
|
1599
1603
|
return {
|
|
1600
1604
|
onKeyDownCapture: (t) => {
|
|
@@ -1613,7 +1617,7 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1613
1617
|
t.target === e && (e = null);
|
|
1614
1618
|
}
|
|
1615
1619
|
};
|
|
1616
|
-
}, Ce = Object.freeze([1 / ke ** 2, 1 / ke, 1, ke, ke ** 2]),
|
|
1620
|
+
}, Ce = Object.freeze([1 / ke ** 2, 1 / ke, 1, ke, ke ** 2]), Mt = Object.freeze({ mode: "fit" }), Zo = 1, Vo = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Go = me(null), Ko = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Zo ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Nt = (e, t, n) => {
|
|
1617
1621
|
if (e.mode === "level") {
|
|
1618
1622
|
const o = e.index + n;
|
|
1619
1623
|
return o >= 0 && o < Ce.length ? o : null;
|
|
@@ -1621,43 +1625,43 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1621
1625
|
if (t === null || !Number.isFinite(t) || t <= 0) return null;
|
|
1622
1626
|
const r = n === 1 ? Ce.findIndex((o) => o > t) : Ce.findLastIndex((o) => o < t);
|
|
1623
1627
|
return r === -1 ? null : r;
|
|
1624
|
-
},
|
|
1628
|
+
}, Dt = (e, t, n) => {
|
|
1625
1629
|
if (e.mode === "level") {
|
|
1626
|
-
const o =
|
|
1630
|
+
const o = Nt(e, null, n);
|
|
1627
1631
|
return o === null ? null : { mode: "level", index: o, base: e.base };
|
|
1628
1632
|
}
|
|
1629
1633
|
if (t === null) return null;
|
|
1630
|
-
const r =
|
|
1634
|
+
const r = Nt(e, t.scale, n);
|
|
1631
1635
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
1632
1636
|
}, Wo = (e) => {
|
|
1633
1637
|
const t = Ce[e];
|
|
1634
1638
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
1635
1639
|
return t;
|
|
1636
|
-
},
|
|
1637
|
-
const { labels: t } = D(), n =
|
|
1638
|
-
const { naturalWidth: s, naturalHeight: c } =
|
|
1639
|
-
d((
|
|
1640
|
+
}, $t = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Xo = ({ document: e }) => {
|
|
1641
|
+
const { labels: t } = D(), n = ne(Go), [r] = I(() => n === null ? null : n.read(e.url)), [o, l] = I(r === null ? Mt : r.zoom), [i, d] = I(r === null ? null : r.reported), [g, f] = I(null), u = _(null), h = P((C) => {
|
|
1642
|
+
const { naturalWidth: s, naturalHeight: c } = C;
|
|
1643
|
+
d((p) => $t(p, s, c));
|
|
1640
1644
|
}, []), m = P(
|
|
1641
|
-
(
|
|
1642
|
-
u.current =
|
|
1643
|
-
() =>
|
|
1645
|
+
(C) => {
|
|
1646
|
+
u.current = C, !(C === null || !C.complete) && (C.naturalWidth > 0 || C.naturalHeight > 0 ? h(C) : C.decode().then(
|
|
1647
|
+
() => h(C),
|
|
1644
1648
|
() => {
|
|
1645
1649
|
}
|
|
1646
1650
|
));
|
|
1647
1651
|
},
|
|
1648
|
-
[
|
|
1652
|
+
[h]
|
|
1649
1653
|
);
|
|
1650
|
-
|
|
1654
|
+
te(() => {
|
|
1651
1655
|
n !== null && i !== null && n.save(e.url, { zoom: o, reported: i });
|
|
1652
|
-
}, [n, e.url, o, i]),
|
|
1653
|
-
const
|
|
1654
|
-
if (
|
|
1655
|
-
const s = () => f((
|
|
1656
|
+
}, [n, e.url, o, i]), U(() => {
|
|
1657
|
+
const C = u.current;
|
|
1658
|
+
if (C === null || i === null || o.mode !== "fit") return;
|
|
1659
|
+
const s = () => f((p) => $t(p, C.clientWidth, C.clientHeight));
|
|
1656
1660
|
if (s(), typeof ResizeObserver > "u") return;
|
|
1657
1661
|
const c = new ResizeObserver(s);
|
|
1658
|
-
return c.observe(
|
|
1662
|
+
return c.observe(C), () => c.disconnect();
|
|
1659
1663
|
}, [i, o.mode]);
|
|
1660
|
-
const
|
|
1664
|
+
const S = i === null || g === null ? null : Ko(i, g), A = Dt(o, S, -1), x = Dt(o, S, 1), T = o.mode === "level" ? Wo(o.index) : null, M = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
|
|
1661
1665
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1662
1666
|
/* @__PURE__ */ F(Pe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ a(Ho, {}), children: [
|
|
1663
1667
|
/* @__PURE__ */ a(
|
|
@@ -1667,9 +1671,9 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1667
1671
|
className: "aqmx-icon-button",
|
|
1668
1672
|
"aria-label": t.imageZoomOut,
|
|
1669
1673
|
title: t.imageZoomOut,
|
|
1670
|
-
"aria-disabled":
|
|
1674
|
+
"aria-disabled": A === null,
|
|
1671
1675
|
onClick: () => {
|
|
1672
|
-
|
|
1676
|
+
A !== null && l(A);
|
|
1673
1677
|
},
|
|
1674
1678
|
...Qe,
|
|
1675
1679
|
children: /* @__PURE__ */ a(_o, {})
|
|
@@ -1683,37 +1687,37 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1683
1687
|
className: "aqmx-icon-button",
|
|
1684
1688
|
"aria-label": t.imageZoomIn,
|
|
1685
1689
|
title: t.imageZoomIn,
|
|
1686
|
-
"aria-disabled":
|
|
1690
|
+
"aria-disabled": x === null,
|
|
1687
1691
|
onClick: () => {
|
|
1688
|
-
|
|
1692
|
+
x !== null && l(x);
|
|
1689
1693
|
},
|
|
1690
1694
|
...Qe,
|
|
1691
1695
|
children: /* @__PURE__ */ a(Io, {})
|
|
1692
1696
|
}
|
|
1693
1697
|
),
|
|
1694
|
-
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(
|
|
1698
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(Mt), children: /* @__PURE__ */ a(Fo, {}) })
|
|
1695
1699
|
] }),
|
|
1696
|
-
/* @__PURE__ */ a(xe, { scrollerProps: Vo, children: /* @__PURE__ */ a("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style:
|
|
1700
|
+
/* @__PURE__ */ a(xe, { scrollerProps: Vo, children: /* @__PURE__ */ a("img", { ref: m, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: M, onLoad: (C) => h(C.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1697
1701
|
] });
|
|
1698
|
-
},
|
|
1699
|
-
const e =
|
|
1702
|
+
}, vn = me(null), qe = me(void 0), wn = me(null), _e = () => {
|
|
1703
|
+
const e = ne(vn);
|
|
1700
1704
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1701
1705
|
return e;
|
|
1702
1706
|
}, Yo = () => {
|
|
1703
|
-
const e =
|
|
1707
|
+
const e = ne(wn);
|
|
1704
1708
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1705
1709
|
return e;
|
|
1706
1710
|
}, Be = (e, t, n, r) => t.kind === "panel" ? pe(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? pe(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : pe(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Jo = ({ children: e }) => {
|
|
1707
1711
|
const { config: t } = D(), n = _e(), r = nt(), o = r.kind === "location" ? r.location.source : void 0, l = De(Be(t, n.navigation, o, n.currentPath));
|
|
1708
|
-
return /* @__PURE__ */ a(qe, { value: o, children: /* @__PURE__ */ a(
|
|
1712
|
+
return /* @__PURE__ */ a(qe, { value: o, children: /* @__PURE__ */ a(wn, { value: l, children: e }) });
|
|
1709
1713
|
}, Qo = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', el = (e) => {
|
|
1710
1714
|
const t = e instanceof Element ? e.closest(Qo) : null;
|
|
1711
1715
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1712
1716
|
}, Ie = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, tl = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: i, scope: d, children: g }) => {
|
|
1713
1717
|
const f = De(e);
|
|
1714
|
-
return /* @__PURE__ */ a("a", { ...l, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (
|
|
1715
|
-
if (Ie(
|
|
1716
|
-
if (
|
|
1718
|
+
return /* @__PURE__ */ a("a", { ...l, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (h) => {
|
|
1719
|
+
if (Ie(h)) {
|
|
1720
|
+
if (h.preventDefault(), t === d.currentPath && n !== "") {
|
|
1717
1721
|
d.scrollWithin(n);
|
|
1718
1722
|
return;
|
|
1719
1723
|
}
|
|
@@ -1721,8 +1725,8 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1721
1725
|
}
|
|
1722
1726
|
}, children: g });
|
|
1723
1727
|
}, nl = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
|
|
1724
|
-
const { config: i } = D(), d = _e(), g =
|
|
1725
|
-
return u.kind === "page" ? /* @__PURE__ */ a(Qr, { ...o, to:
|
|
1728
|
+
const { config: i } = D(), d = _e(), g = ne(qe), f = Ro(e), { navigation: u } = d, h = `${Be(i, u, g, t)}${f}`, m = n === !1 ? "false" : void 0;
|
|
1729
|
+
return u.kind === "page" ? /* @__PURE__ */ a(Qr, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": m, children: l }) : /* @__PURE__ */ a(tl, { to: h, docPath: t, fragment: f, exists: m, className: r, attributes: o, onDocumentLink: u.onDocumentLink, scope: d, children: l });
|
|
1726
1730
|
}, rl = ({ className: e, attributes: t, children: n }) => {
|
|
1727
1731
|
const { labels: r } = D();
|
|
1728
1732
|
return (
|
|
@@ -1736,7 +1740,7 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1736
1740
|
] })
|
|
1737
1741
|
);
|
|
1738
1742
|
}, ol = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1739
|
-
const { config: l } = D(), i =
|
|
1743
|
+
const { config: l } = D(), i = ne(qe), d = De(`${Be(l, r.navigation, i, r.currentPath)}${e}`);
|
|
1740
1744
|
return /* @__PURE__ */ a("a", { ...n, href: d, className: t, onClick: (f) => {
|
|
1741
1745
|
Ie(f) && (f.preventDefault(), r.scrollWithin(e));
|
|
1742
1746
|
}, children: o });
|
|
@@ -1747,27 +1751,27 @@ const Ho = /* @__PURE__ */ b.forwardRef(jo), Je = "data-aqmx-key-repeat", Qe = O
|
|
|
1747
1751
|
const d = i.currentTarget;
|
|
1748
1752
|
e === "#" ? o.followEmptyFragment(i.nativeEvent) : d.href === d.ownerDocument.URL && o.followSameUrlJump(e, i.nativeEvent);
|
|
1749
1753
|
}, children: r }) : /* @__PURE__ */ a(ol, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1750
|
-
}, il = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !
|
|
1751
|
-
const { config: e } = D(), t = _e(), n =
|
|
1754
|
+
}, il = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: i }) => t === "doc" ? n === void 0 || !jn(n) ? /* @__PURE__ */ a(rl, { className: o, attributes: l, children: i }) : /* @__PURE__ */ a(nl, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: i }) : e.startsWith("#") ? /* @__PURE__ */ a(ll, { href: e, className: o, attributes: l, children: i }) : /* @__PURE__ */ a("a", { ...l, href: e, className: o, children: i }), sl = () => {
|
|
1755
|
+
const { config: e } = D(), t = _e(), n = ne(qe), r = $e();
|
|
1752
1756
|
return P(
|
|
1753
1757
|
(o, l) => {
|
|
1754
1758
|
if (!Ie(l)) return !0;
|
|
1755
1759
|
l.preventDefault();
|
|
1756
|
-
const i =
|
|
1760
|
+
const i = hn(o.id), { navigation: d } = t;
|
|
1757
1761
|
return d.kind === "panel" || lt(l.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(i), !0) : (r(`${Be(e, d, n, t.currentPath)}${i}`, "follow-link"), !0);
|
|
1758
1762
|
},
|
|
1759
1763
|
[e, t, n, r]
|
|
1760
1764
|
);
|
|
1761
1765
|
}, al = () => {
|
|
1762
1766
|
const e = Yo();
|
|
1763
|
-
return P((t) => `${e}${
|
|
1767
|
+
return P((t) => `${e}${hn(t.id)}`, [e]);
|
|
1764
1768
|
};
|
|
1765
1769
|
function cl({
|
|
1766
1770
|
title: e,
|
|
1767
1771
|
titleId: t,
|
|
1768
1772
|
...n
|
|
1769
1773
|
}, r) {
|
|
1770
|
-
return /* @__PURE__ */
|
|
1774
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1771
1775
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1772
1776
|
viewBox: "0 0 20 20",
|
|
1773
1777
|
fill: "currentColor",
|
|
@@ -1775,19 +1779,19 @@ function cl({
|
|
|
1775
1779
|
"data-slot": "icon",
|
|
1776
1780
|
ref: r,
|
|
1777
1781
|
"aria-labelledby": t
|
|
1778
|
-
}, n), e ? /* @__PURE__ */
|
|
1782
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1779
1783
|
id: t
|
|
1780
|
-
}, e) : null, /* @__PURE__ */
|
|
1784
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1781
1785
|
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"
|
|
1782
1786
|
}));
|
|
1783
1787
|
}
|
|
1784
|
-
const dl = /* @__PURE__ */
|
|
1788
|
+
const dl = /* @__PURE__ */ E.forwardRef(cl);
|
|
1785
1789
|
function ul({
|
|
1786
1790
|
title: e,
|
|
1787
1791
|
titleId: t,
|
|
1788
1792
|
...n
|
|
1789
1793
|
}, r) {
|
|
1790
|
-
return /* @__PURE__ */
|
|
1794
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1791
1795
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1792
1796
|
viewBox: "0 0 20 20",
|
|
1793
1797
|
fill: "currentColor",
|
|
@@ -1795,21 +1799,21 @@ function ul({
|
|
|
1795
1799
|
"data-slot": "icon",
|
|
1796
1800
|
ref: r,
|
|
1797
1801
|
"aria-labelledby": t
|
|
1798
|
-
}, n), e ? /* @__PURE__ */
|
|
1802
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1799
1803
|
id: t
|
|
1800
|
-
}, e) : null, /* @__PURE__ */
|
|
1804
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1801
1805
|
fillRule: "evenodd",
|
|
1802
1806
|
d: "M1 4.75C1 3.784 1.784 3 2.75 3h14.5c.966 0 1.75.784 1.75 1.75v10.515a1.75 1.75 0 0 1-1.75 1.75h-1.5c-.078 0-.155-.005-.23-.015H4.48c-.075.01-.152.015-.23.015h-1.5A1.75 1.75 0 0 1 1 15.265V4.75Zm16.5 7.385V11.01a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25Zm0 2.005a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .108.069.2.165.235h1.585a.25.25 0 0 0 .25-.25v-1.11Zm-15 1.11v-1.11a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.164.235H2.75a.25.25 0 0 1-.25-.25Zm2-4.24v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V11.01a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25Zm13-2.005V7.88a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25ZM4.25 7.63a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V7.88a.25.25 0 0 1 .25-.25h1.5Zm0-3.13a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5Zm11.5 1.625a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5Zm-9 3.125a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
|
|
1803
1807
|
clipRule: "evenodd"
|
|
1804
1808
|
}));
|
|
1805
1809
|
}
|
|
1806
|
-
const fl = /* @__PURE__ */
|
|
1810
|
+
const fl = /* @__PURE__ */ E.forwardRef(ul);
|
|
1807
1811
|
function ml({
|
|
1808
1812
|
title: e,
|
|
1809
1813
|
titleId: t,
|
|
1810
1814
|
...n
|
|
1811
1815
|
}, r) {
|
|
1812
|
-
return /* @__PURE__ */
|
|
1816
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
1813
1817
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1814
1818
|
viewBox: "0 0 20 20",
|
|
1815
1819
|
fill: "currentColor",
|
|
@@ -1817,15 +1821,15 @@ function ml({
|
|
|
1817
1821
|
"data-slot": "icon",
|
|
1818
1822
|
ref: r,
|
|
1819
1823
|
"aria-labelledby": t
|
|
1820
|
-
}, n), e ? /* @__PURE__ */
|
|
1824
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
1821
1825
|
id: t
|
|
1822
|
-
}, e) : null, /* @__PURE__ */
|
|
1826
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
1823
1827
|
fillRule: "evenodd",
|
|
1824
1828
|
d: "M17.721 1.599a.75.75 0 0 1 .279.583v11.29a2.25 2.25 0 0 1-1.774 2.2l-2.041.44a2.216 2.216 0 0 1-.938-4.332l2.662-.577a.75.75 0 0 0 .591-.733V6.112l-8 1.73v7.684a2.25 2.25 0 0 1-1.774 2.2l-2.042.44a2.216 2.216 0 1 1-.935-4.331l2.659-.573A.75.75 0 0 0 7 12.529V4.236a.75.75 0 0 1 .591-.733l9.5-2.054a.75.75 0 0 1 .63.15Z",
|
|
1825
1829
|
clipRule: "evenodd"
|
|
1826
1830
|
}));
|
|
1827
1831
|
}
|
|
1828
|
-
const hl = /* @__PURE__ */
|
|
1832
|
+
const hl = /* @__PURE__ */ E.forwardRef(ml), pl = Object.freeze({ className: "aqmx-document-stage" }), gl = (e) => {
|
|
1829
1833
|
switch (e) {
|
|
1830
1834
|
case "video":
|
|
1831
1835
|
return /* @__PURE__ */ a(fl, {});
|
|
@@ -1893,18 +1897,18 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
1893
1897
|
embeddedVideo: e.viewerEmbeddedVideo,
|
|
1894
1898
|
embeddedPost: e.viewerEmbeddedPost,
|
|
1895
1899
|
embeddedFrame: e.viewerEmbeddedFrame
|
|
1896
|
-
}),
|
|
1900
|
+
}), bn = (e, t, n) => {
|
|
1897
1901
|
if (t !== void 0) return t;
|
|
1898
1902
|
if (n !== void 0) return n;
|
|
1899
1903
|
const [r] = e.documentStyles;
|
|
1900
1904
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
1901
1905
|
return r.name;
|
|
1902
|
-
},
|
|
1906
|
+
}, En = (e, t) => e !== void 0 ? e : t !== void 0 ? t : sr, it = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), El = (e, t, n) => {
|
|
1903
1907
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
1904
1908
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
1905
1909
|
return pe(e, { ...t, overrides: r });
|
|
1906
1910
|
}, st = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: l, intent: i, children: d }) => {
|
|
1907
|
-
const g =
|
|
1911
|
+
const g = ne(fe);
|
|
1908
1912
|
return (
|
|
1909
1913
|
/* @__PURE__ */ F("section", { ref: l, role: "region", "aria-label": n, "aria-busy": o, "data-testid": "markdown-explorer-document", "data-aqmx-document-kind": e, "data-aqmx-document-view": t, "data-aqmx-document-flow": g, className: "aqmx-document", ...i, children: [
|
|
1910
1914
|
r ? /* @__PURE__ */ a("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
|
|
@@ -1914,79 +1918,79 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
1914
1918
|
}, yl = () => {
|
|
1915
1919
|
const { labels: e } = D();
|
|
1916
1920
|
return /* @__PURE__ */ a(st, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ a("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ a("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
|
|
1917
|
-
},
|
|
1921
|
+
}, yn = ({ label: e }) => {
|
|
1918
1922
|
const { labels: t } = D();
|
|
1919
1923
|
return /* @__PURE__ */ F(st, { kind: "loading", label: e, stale: !1, busy: !0, children: [
|
|
1920
1924
|
/* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: it.map((n) => /* @__PURE__ */ a("span", {}, n)) }),
|
|
1921
1925
|
/* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
1922
1926
|
] });
|
|
1923
|
-
},
|
|
1924
|
-
const { reportMathDiagnostics: o, edits: l } = D(), i =
|
|
1925
|
-
|
|
1926
|
-
if (
|
|
1927
|
+
}, Pt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), xl = ({ path: e, document: t, viewer: n, editing: r }) => {
|
|
1928
|
+
const { reportMathDiagnostics: o, edits: l } = D(), i = z(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), d = sl(), g = al(), f = z(() => o === void 0 ? void 0 : (p) => o(e, p), [o, e]), u = _(null), { editable: h, doubleClick: m, region: S, paneScroll: A, stale: x } = r;
|
|
1929
|
+
U(() => {
|
|
1930
|
+
if (h)
|
|
1927
1931
|
return l.bindView(e, {
|
|
1928
1932
|
anchor: () => {
|
|
1929
|
-
const
|
|
1930
|
-
return
|
|
1933
|
+
const p = u.current, w = S(), k = p === null ? null : p.querySelector(Fe);
|
|
1934
|
+
return p === null || w === null || k === null ? null : Vr(p, A.scrollerOf(w, k));
|
|
1931
1935
|
}
|
|
1932
1936
|
});
|
|
1933
|
-
}, [l, e,
|
|
1934
|
-
const T = (
|
|
1935
|
-
const w = u.current, { target: k } =
|
|
1936
|
-
!m || w === null || !(k instanceof Element) || !Ur(k) || (
|
|
1937
|
-
},
|
|
1938
|
-
|
|
1939
|
-
|
|
1937
|
+
}, [l, e, h, S, A]);
|
|
1938
|
+
const T = (p) => {
|
|
1939
|
+
const w = u.current, { target: k } = p;
|
|
1940
|
+
!m || w === null || !(k instanceof Element) || !Ur(k) || (p.stopPropagation(), l.start(e, Zr(k, w, w.ownerDocument.getSelection())));
|
|
1941
|
+
}, M = _(null), C = _(x);
|
|
1942
|
+
U(() => {
|
|
1943
|
+
C.current = x;
|
|
1940
1944
|
});
|
|
1941
|
-
const s = ie((
|
|
1942
|
-
const w = u.current, k =
|
|
1945
|
+
const s = ie((p) => {
|
|
1946
|
+
const w = u.current, k = S(), L = w === null ? null : Yr(w, p.line);
|
|
1943
1947
|
if (k === null || L === null) return !1;
|
|
1944
|
-
const
|
|
1945
|
-
return
|
|
1946
|
-
}), c = ie((
|
|
1947
|
-
const w =
|
|
1948
|
+
const O = A.scrollerOf(k, L);
|
|
1949
|
+
return O.scrollTop += Jr(L, p.line) - p.clientTop, !0;
|
|
1950
|
+
}), c = ie((p) => {
|
|
1951
|
+
const w = S();
|
|
1948
1952
|
if (w === null) return;
|
|
1949
1953
|
const k = () => {
|
|
1950
|
-
for (const
|
|
1951
|
-
|
|
1954
|
+
for (const O of Pt) w.removeEventListener(O, L, !0);
|
|
1955
|
+
M.current?.release === k && (M.current = null);
|
|
1952
1956
|
}, L = () => k();
|
|
1953
|
-
for (const
|
|
1954
|
-
|
|
1957
|
+
for (const O of Pt) w.addEventListener(O, L, { capture: !0, passive: !0 });
|
|
1958
|
+
M.current = { point: p, release: k };
|
|
1955
1959
|
});
|
|
1956
|
-
return
|
|
1957
|
-
const
|
|
1958
|
-
if (
|
|
1960
|
+
return U(() => {
|
|
1961
|
+
const p = l.takeReturn(e);
|
|
1962
|
+
if (p !== null)
|
|
1959
1963
|
return queueMicrotask(() => {
|
|
1960
|
-
s(
|
|
1961
|
-
}), () =>
|
|
1962
|
-
}, [l, e]),
|
|
1963
|
-
const
|
|
1964
|
-
|
|
1965
|
-
}, [t,
|
|
1966
|
-
/* @__PURE__ */ a("div", { ref: u, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ a(
|
|
1967
|
-
},
|
|
1964
|
+
s(p) && C.current && c(p);
|
|
1965
|
+
}), () => M.current?.release();
|
|
1966
|
+
}, [l, e]), U(() => {
|
|
1967
|
+
const p = M.current;
|
|
1968
|
+
p === null || x || (p.release(), s(p.point));
|
|
1969
|
+
}, [t, x]),
|
|
1970
|
+
/* @__PURE__ */ a("div", { ref: u, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ a(Kt, { ...n, onHeadingSelect: d, headingHref: g, onMathDiagnostics: f, parseResult: i, content: null }) });
|
|
1971
|
+
}, xn = ({ document: e, viewer: t }) => {
|
|
1968
1972
|
const { labels: n } = D();
|
|
1969
1973
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
1970
|
-
/* @__PURE__ */ a(Pe, { name: e.name, openUrl:
|
|
1974
|
+
/* @__PURE__ */ a(Pe, { name: e.name, openUrl: Hn(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ a(Pr, {}), children: e.truncated ? null : /* @__PURE__ */ a(po, { text: e.text }) }),
|
|
1971
1975
|
e.truncated ? /* @__PURE__ */ a("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
1972
|
-
/* @__PURE__ */ a("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ a(
|
|
1976
|
+
/* @__PURE__ */ a("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ a(Kt, { ...t, parseResult: null, content: e.text }) })
|
|
1973
1977
|
] });
|
|
1974
1978
|
}, kl = ({ path: e, name: t, viewer: n }) => {
|
|
1975
|
-
const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), g =
|
|
1976
|
-
|
|
1979
|
+
const { data: r, documents: o, announcer: l, labels: i } = D(), d = P(() => o.answerStampOf(e), [o, e]), g = ee(o.subscribe, d, d), [f, u] = I(0), h = z(() => ({ path: e, stamp: g, attempt: f }), [e, g, f]), [m, S] = I(null), A = ie((T) => {
|
|
1980
|
+
S(T), T.kind === "failure" && l.announce(i.documentFailed(t, ae(i, T.failure.reason)));
|
|
1977
1981
|
});
|
|
1978
|
-
|
|
1982
|
+
te(() => {
|
|
1979
1983
|
const T = new AbortController();
|
|
1980
|
-
return r.text(
|
|
1981
|
-
"kind" in
|
|
1984
|
+
return r.text(h.path, T.signal).then((M) => {
|
|
1985
|
+
"kind" in M && A(M);
|
|
1982
1986
|
}), () => T.abort();
|
|
1983
|
-
}, [r,
|
|
1984
|
-
const
|
|
1987
|
+
}, [r, h]);
|
|
1988
|
+
const x = P(() => u((T) => T + 1), []);
|
|
1985
1989
|
return m === null ? /* @__PURE__ */ F(Ne, { children: [
|
|
1986
1990
|
/* @__PURE__ */ a("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: it.map((T) => /* @__PURE__ */ a("span", {}, T)) }),
|
|
1987
1991
|
/* @__PURE__ */ a("p", { className: "aqmx-sr-only", children: i.markupLoading })
|
|
1988
|
-
] }) : m.kind === "failure" ? /* @__PURE__ */ a(xe, { scrollerProps:
|
|
1989
|
-
},
|
|
1992
|
+
] }) : m.kind === "failure" ? /* @__PURE__ */ a(xe, { scrollerProps: kn, children: /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: x, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ a(xn, { document: m, viewer: n });
|
|
1993
|
+
}, kn = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), Sl = Object.freeze({ reason: "failed" }), Rl = (e) => /* @__PURE__ */ a(
|
|
1990
1994
|
_r,
|
|
1991
1995
|
{
|
|
1992
1996
|
fallback: (t) => /* @__PURE__ */ a("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ a(ve, { failure: Sl, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
|
|
@@ -2004,11 +2008,11 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2004
2008
|
const { session: i, layout: d, region: g, paneScroll: f, stale: u } = l;
|
|
2005
2009
|
if (n === "edit" && i !== void 0) return /* @__PURE__ */ a(Rl, { path: e, name: t.name, session: i, layout: d, viewer: r, region: g, paneScroll: f });
|
|
2006
2010
|
if (n === "markup") return /* @__PURE__ */ a(kl, { path: e, name: t.name, viewer: r });
|
|
2007
|
-
const
|
|
2008
|
-
return /* @__PURE__ */ a(xl, { path: e, document: t, viewer: r, editing: { editable:
|
|
2011
|
+
const h = t.edit !== null && t.edit.kind === "inline";
|
|
2012
|
+
return /* @__PURE__ */ a(xl, { path: e, document: t, viewer: r, editing: { editable: h, doubleClick: h && d === "fill", region: g, paneScroll: f, stale: u } });
|
|
2009
2013
|
}
|
|
2010
2014
|
case "text":
|
|
2011
|
-
return /* @__PURE__ */ a(
|
|
2015
|
+
return /* @__PURE__ */ a(xn, { document: t, viewer: r });
|
|
2012
2016
|
case "image":
|
|
2013
2017
|
return /* @__PURE__ */ a(Xo, { document: t });
|
|
2014
2018
|
case "media":
|
|
@@ -2016,23 +2020,23 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2016
2020
|
case "file":
|
|
2017
2021
|
return /* @__PURE__ */ a(So, { document: t });
|
|
2018
2022
|
case "failure":
|
|
2019
|
-
return /* @__PURE__ */ a(xe, { scrollerProps:
|
|
2023
|
+
return /* @__PURE__ */ a(xe, { scrollerProps: kn, children: /* @__PURE__ */ a(ve, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
|
|
2020
2024
|
default: {
|
|
2021
2025
|
const i = t;
|
|
2022
2026
|
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(i)}`);
|
|
2023
2027
|
}
|
|
2024
2028
|
}
|
|
2025
2029
|
}, Cl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', Ol = (e, t, n) => {
|
|
2026
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null :
|
|
2030
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : gn(e, n), r === void 0 ? null : pn(e, r.id), e.querySelector(Fe), e.querySelector(Cl)];
|
|
2027
2031
|
for (const l of o)
|
|
2028
|
-
if (l instanceof HTMLElement &&
|
|
2032
|
+
if (l instanceof HTMLElement && cn(l)) return l;
|
|
2029
2033
|
return null;
|
|
2030
|
-
},
|
|
2034
|
+
}, Ft = (e, t, n) => {
|
|
2031
2035
|
const { activeElement: r, body: o } = e.ownerDocument, l = r === null || r === o;
|
|
2032
|
-
t instanceof HTMLElement && n && (l || e.contains(r)) &&
|
|
2036
|
+
t instanceof HTMLElement && n && (l || e.contains(r)) && cn(t);
|
|
2033
2037
|
}, Al = (e) => {
|
|
2034
|
-
const t =
|
|
2035
|
-
return
|
|
2038
|
+
const t = _(!1);
|
|
2039
|
+
return U(() => {
|
|
2036
2040
|
const n = e.current;
|
|
2037
2041
|
if (n === null) throw new Error("[markdown-explorer] the document region is not mounted");
|
|
2038
2042
|
const r = n.ownerDocument, o = r.defaultView;
|
|
@@ -2047,81 +2051,81 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2047
2051
|
}, f = (m) => {
|
|
2048
2052
|
m.relatedTarget === null && l && (t.current = !1);
|
|
2049
2053
|
}, u = () => {
|
|
2050
|
-
const { activeElement: m, body:
|
|
2051
|
-
m !== null && m !==
|
|
2052
|
-
},
|
|
2054
|
+
const { activeElement: m, body: S } = r;
|
|
2055
|
+
m !== null && m !== S && (t.current = n.contains(m));
|
|
2056
|
+
}, h = () => {
|
|
2053
2057
|
l && !n.contains(r.activeElement) && (t.current = !1);
|
|
2054
2058
|
};
|
|
2055
|
-
return o.addEventListener("pointerdown", d, !0), o.addEventListener("mousedown", d, !0), o.addEventListener("focusin", g, !0), o.addEventListener("blur", u), o.addEventListener("focus",
|
|
2056
|
-
clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", g, !0), o.removeEventListener("blur", u), o.removeEventListener("focus",
|
|
2059
|
+
return o.addEventListener("pointerdown", d, !0), o.addEventListener("mousedown", d, !0), o.addEventListener("focusin", g, !0), o.addEventListener("blur", u), o.addEventListener("focus", h), n.addEventListener("focusout", f), () => {
|
|
2060
|
+
clearTimeout(i), o.removeEventListener("pointerdown", d, !0), o.removeEventListener("mousedown", d, !0), o.removeEventListener("focusin", g, !0), o.removeEventListener("blur", u), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
|
|
2057
2061
|
};
|
|
2058
2062
|
}, [e]), t;
|
|
2059
|
-
}, Ll = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: g, paneScroll: f, announces: u, announceFailure:
|
|
2060
|
-
const { labels:
|
|
2061
|
-
(
|
|
2062
|
-
const
|
|
2063
|
-
|
|
2063
|
+
}, Ll = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: l, regionLabel: i, navigation: d, fragment: g, paneScroll: f, announces: u, announceFailure: h, onDocumentShown: m }) => {
|
|
2064
|
+
const { labels: S, announcer: A, documents: x } = D(), { document: T } = t, M = _(null), C = _(null), s = _(null), c = _(0), p = Al(M), w = _({ path: e, document: T }), k = _(null), L = P(
|
|
2065
|
+
(H) => {
|
|
2066
|
+
const V = M.current, J = Lt(V, H, f);
|
|
2067
|
+
V !== null && J !== null && Ft(V, J, p.current);
|
|
2064
2068
|
},
|
|
2065
|
-
[f,
|
|
2066
|
-
),
|
|
2067
|
-
(
|
|
2068
|
-
const
|
|
2069
|
+
[f, p]
|
|
2070
|
+
), O = P(
|
|
2071
|
+
(H, V) => {
|
|
2072
|
+
const J = c.current;
|
|
2069
2073
|
setTimeout(() => {
|
|
2070
|
-
!
|
|
2074
|
+
!V.defaultPrevented && c.current === J && L(H);
|
|
2071
2075
|
}, 0);
|
|
2072
2076
|
},
|
|
2073
2077
|
[L]
|
|
2074
2078
|
), N = P(
|
|
2075
|
-
(
|
|
2079
|
+
(H) => {
|
|
2076
2080
|
setTimeout(() => {
|
|
2077
|
-
|
|
2081
|
+
H.defaultPrevented || L("#");
|
|
2078
2082
|
}, 0);
|
|
2079
2083
|
},
|
|
2080
2084
|
[L]
|
|
2081
|
-
), q =
|
|
2082
|
-
const
|
|
2083
|
-
if (
|
|
2084
|
-
|
|
2085
|
-
const
|
|
2086
|
-
if (
|
|
2087
|
-
|
|
2085
|
+
), q = z(() => ({ navigation: d, currentPath: e, scrollWithin: L, followSameUrlJump: O, followEmptyFragment: N }), [d, e, L, O, N]), G = P(() => x.retry(e), [x, e]), W = eo(x, el), Q = ln(e), K = Q !== void 0 ? "edit" : n ? "markup" : "rendered", Y = T.kind === "markdown" ? K : void 0, oe = P(() => M.current, []), v = z(() => ({ session: Q, layout: l, region: oe, paneScroll: f, stale: r }), [Q, l, oe, f, r]), b = Y === "edit" ? !1 : r, y = ne(fe), R = Y === "edit" && l === "fill" ? "fill" : y, $ = ie((H, V) => {
|
|
2086
|
+
const J = C.current;
|
|
2087
|
+
if (J !== null && J.path === H && J.snapshot === V) return;
|
|
2088
|
+
C.current = { path: H, snapshot: V };
|
|
2089
|
+
const re = V.document;
|
|
2090
|
+
if (re.kind === "failure") {
|
|
2091
|
+
x.noteFailureShown(V) && h(S.documentFailed(Ee(H), ae(S, re.failure.reason)));
|
|
2088
2092
|
return;
|
|
2089
2093
|
}
|
|
2090
|
-
m?.(
|
|
2094
|
+
m?.(H, re), u && (J === null || J.path !== H || J.snapshot.document.kind === "failure") && A.announce(S.documentShown(re.name));
|
|
2091
2095
|
});
|
|
2092
|
-
|
|
2093
|
-
|
|
2096
|
+
te(() => {
|
|
2097
|
+
$(e, t);
|
|
2094
2098
|
}, [e, t]);
|
|
2095
|
-
const
|
|
2099
|
+
const B = ie(() => {
|
|
2096
2100
|
g.kind === "panel" && g.consume();
|
|
2097
|
-
}), Z = ie((
|
|
2098
|
-
const
|
|
2099
|
-
if (
|
|
2100
|
-
const { activeElement:
|
|
2101
|
-
return
|
|
2102
|
-
}),
|
|
2103
|
-
const
|
|
2104
|
-
|
|
2105
|
-
}), le = ie((
|
|
2106
|
-
return
|
|
2101
|
+
}), Z = ie((H) => {
|
|
2102
|
+
const V = M.current;
|
|
2103
|
+
if (V === null || !p.current) return null;
|
|
2104
|
+
const { activeElement: J, body: re } = V.ownerDocument;
|
|
2105
|
+
return J !== null && J !== re ? null : Ol(V, T, H);
|
|
2106
|
+
}), j = ie((H) => {
|
|
2107
|
+
const V = M.current;
|
|
2108
|
+
V !== null && Ft(V, H, p.current);
|
|
2109
|
+
}), le = ie((H) => f.reveal(H)), ct = ie((H) => Lt(M.current, H, f));
|
|
2110
|
+
return te(() => {
|
|
2107
2111
|
if (r) return;
|
|
2108
|
-
const
|
|
2112
|
+
const H = w.current.path !== e, V = H || w.current.document !== T;
|
|
2109
2113
|
w.current = { path: e, document: T };
|
|
2110
|
-
const
|
|
2114
|
+
const J = k.current !== e;
|
|
2111
2115
|
k.current = e;
|
|
2112
|
-
let
|
|
2113
|
-
g.kind === "page" ? s.current !== g.navigation && (s.current = g.navigation, c.current += 1,
|
|
2116
|
+
let re = null;
|
|
2117
|
+
g.kind === "page" ? s.current !== g.navigation && (s.current = g.navigation, c.current += 1, re = g.fragment) : g.fragment !== null && (re = g.fragment, B());
|
|
2114
2118
|
const dt = () => {
|
|
2115
|
-
const je =
|
|
2116
|
-
if (!
|
|
2117
|
-
je !== null &&
|
|
2119
|
+
const je = re === null ? null : ct(re);
|
|
2120
|
+
if (!V) {
|
|
2121
|
+
je !== null && j(je);
|
|
2118
2122
|
return;
|
|
2119
2123
|
}
|
|
2120
2124
|
const ut = Z(g.fragment);
|
|
2121
|
-
|
|
2125
|
+
H && je === null && ut !== null && le(ut);
|
|
2122
2126
|
};
|
|
2123
|
-
|
|
2124
|
-
}, [g, e, T, r]), /* @__PURE__ */ a(fe, { value:
|
|
2127
|
+
J ? queueMicrotask(dt) : dt();
|
|
2128
|
+
}, [g, e, T, r]), /* @__PURE__ */ a(fe, { value: R, children: /* @__PURE__ */ a(st, { kind: T.kind, view: Y, label: i(e, T), stale: b, busy: b, frameRef: M, intent: W, children: /* @__PURE__ */ a(vn, { value: q, children: /* @__PURE__ */ a(Jo, { children: /* @__PURE__ */ a(Tl, { path: e, document: T, view: K, viewer: o, onRetry: G, editing: v }, e) }) }) }) });
|
|
2125
2129
|
}, at = Object.freeze({ kind: "skeleton" }), Ml = (e, t, n, r, o) => {
|
|
2126
2130
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
2127
2131
|
const l = de(t);
|
|
@@ -2130,29 +2134,29 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2130
2134
|
const i = n === null || n === e ? null : de(r);
|
|
2131
2135
|
return n === null || i === null ? at : { kind: "document", path: n, snapshot: i, stale: !0 };
|
|
2132
2136
|
}, Nl = (e, t) => t.status === "deferred" ? at : { kind: "document", path: e, snapshot: t, stale: !1 }, Dl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
|
|
2133
|
-
const o = t.kind === "streaming" ? Nl(t.path,
|
|
2134
|
-
return o.kind !== "document" ? /* @__PURE__ */ a(
|
|
2135
|
-
},
|
|
2136
|
-
const { config: f, labels: u, theme:
|
|
2137
|
-
|
|
2138
|
-
|
|
2137
|
+
const o = t.kind === "streaming" ? Nl(t.path, ne(t.promise)) : t;
|
|
2138
|
+
return o.kind !== "document" ? /* @__PURE__ */ a(yn, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ a(Ll, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
|
|
2139
|
+
}, Sn = ({ path: e, markup: t, display: n, navigation: r, fragment: o, paneScroll: l, announces: i, announceFailure: d, onDocumentShown: g }) => {
|
|
2140
|
+
const { config: f, labels: u, theme: h, documents: m } = D(), S = lr(), A = _(!1);
|
|
2141
|
+
U(() => {
|
|
2142
|
+
A.current = !0;
|
|
2139
2143
|
}, []);
|
|
2140
|
-
const [
|
|
2141
|
-
|
|
2142
|
-
const k = e === null ? at : Ml(e, c,
|
|
2143
|
-
L !==
|
|
2144
|
-
const
|
|
2145
|
-
|
|
2146
|
-
const N =
|
|
2144
|
+
const [x, T] = I(null), [M, C] = I(t), s = P(() => e === null ? void 0 : m.peek(e), [m, e]), c = ee(m.subscribe, s, s), p = P(() => x === null ? void 0 : m.peek(x), [m, x]), w = ee(m.subscribe, p, p);
|
|
2145
|
+
U(() => e === null ? void 0 : m.open(e), [m, e]), U(() => x === null ? void 0 : m.retain(x), [m, x]);
|
|
2146
|
+
const k = e === null ? at : Ml(e, c, x, w, !A.current), L = e === null ? null : k.kind === "document" && !k.stale ? k.path : x;
|
|
2147
|
+
L !== x && T(L);
|
|
2148
|
+
const O = k.kind !== "document" || k.path === e;
|
|
2149
|
+
O && t !== M && C(t);
|
|
2150
|
+
const N = z(() => bl(u), [u]), q = z(() => [...f.iframeHosts], [f]), G = r.kind === "panel", W = z(
|
|
2147
2151
|
() => ({
|
|
2148
2152
|
labels: N,
|
|
2149
2153
|
emptyMessage: u.documentEmpty,
|
|
2150
|
-
theme:
|
|
2154
|
+
theme: h,
|
|
2151
2155
|
availableStyles: f.documentStyles,
|
|
2152
2156
|
iFrameAllowedDomains: q,
|
|
2153
2157
|
embeds: f.embeds,
|
|
2154
2158
|
linkComponent: il,
|
|
2155
|
-
toolbar:
|
|
2159
|
+
toolbar: S,
|
|
2156
2160
|
style: n.style,
|
|
2157
2161
|
onStyleChange: n.onStyleChange,
|
|
2158
2162
|
align: n.align,
|
|
@@ -2163,19 +2167,19 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2163
2167
|
padding: n.padding,
|
|
2164
2168
|
width: n.width === void 0 ? void 0 : `min(${n.width}, 100%)`,
|
|
2165
2169
|
maxWidth: n.maxWidth === void 0 ? void 0 : `min(${n.maxWidth}, 100%)`,
|
|
2166
|
-
renderScrollBar:
|
|
2170
|
+
renderScrollBar: G ? void 0 : dn
|
|
2167
2171
|
}),
|
|
2168
|
-
[N, u.documentEmpty,
|
|
2169
|
-
),
|
|
2170
|
-
return e === null ? /* @__PURE__ */ a(fe, { value:
|
|
2172
|
+
[N, u.documentEmpty, h, f.documentStyles, q, f.embeds, S, n, G]
|
|
2173
|
+
), Q = P((Y, oe) => G ? oe === null || oe.kind === "failure" ? Ee(Y) : oe.name : u.documentRegion, [G, u.documentRegion]), K = G ? "content" : "fill";
|
|
2174
|
+
return e === null ? /* @__PURE__ */ a(fe, { value: K, children: /* @__PURE__ */ a(yl, {}) }) : /* @__PURE__ */ a(fe, { value: K, children: /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a(yn, { label: Q(e, null) }), children: /* @__PURE__ */ a(
|
|
2171
2175
|
Dl,
|
|
2172
2176
|
{
|
|
2173
2177
|
requestedPath: e,
|
|
2174
2178
|
content: k,
|
|
2175
|
-
markup:
|
|
2176
|
-
viewer:
|
|
2179
|
+
markup: O ? t : M,
|
|
2180
|
+
viewer: W,
|
|
2177
2181
|
editLayout: n.editLayout,
|
|
2178
|
-
regionLabel:
|
|
2182
|
+
regionLabel: Q,
|
|
2179
2183
|
navigation: r,
|
|
2180
2184
|
fragment: o,
|
|
2181
2185
|
paneScroll: l,
|
|
@@ -2185,47 +2189,47 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2185
2189
|
}
|
|
2186
2190
|
) }) });
|
|
2187
2191
|
}, $l = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2188
|
-
const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), g = Ae((L) => L.align), f = $e(), u =
|
|
2192
|
+
const { config: o, viewSettings: l, announcer: i } = D(), d = Ae((L) => L.style), g = Ae((L) => L.align), f = $e(), u = Vt(), h = nt(), { view: m, overrides: S, embed: A } = n, x = P(
|
|
2189
2193
|
(L) => {
|
|
2190
|
-
if (
|
|
2191
|
-
const
|
|
2192
|
-
|
|
2194
|
+
if (h.kind !== "location") return;
|
|
2195
|
+
const O = El(o, h.location, L);
|
|
2196
|
+
O !== null && f(O, "browse");
|
|
2193
2197
|
},
|
|
2194
|
-
[o, f,
|
|
2198
|
+
[o, f, h]
|
|
2195
2199
|
), T = P(
|
|
2196
2200
|
(L) => {
|
|
2197
|
-
l.update({ style: L }),
|
|
2201
|
+
l.update({ style: L }), x("style");
|
|
2198
2202
|
},
|
|
2199
|
-
[l,
|
|
2200
|
-
),
|
|
2203
|
+
[l, x]
|
|
2204
|
+
), M = P(
|
|
2201
2205
|
(L) => {
|
|
2202
|
-
l.update({ align: L }),
|
|
2206
|
+
l.update({ align: L }), x("align");
|
|
2203
2207
|
},
|
|
2204
|
-
[l,
|
|
2205
|
-
),
|
|
2208
|
+
[l, x]
|
|
2209
|
+
), C = bn(o, S.style, d), s = En(S.align, g), c = z(
|
|
2206
2210
|
() => ({
|
|
2207
|
-
style:
|
|
2211
|
+
style: C,
|
|
2208
2212
|
onStyleChange: T,
|
|
2209
2213
|
align: s,
|
|
2210
|
-
onAlignChange:
|
|
2211
|
-
showToc:
|
|
2212
|
-
showStyle:
|
|
2213
|
-
showAlign:
|
|
2214
|
-
padding:
|
|
2215
|
-
width:
|
|
2216
|
-
maxWidth:
|
|
2214
|
+
onAlignChange: M,
|
|
2215
|
+
showToc: A.showToc !== !1,
|
|
2216
|
+
showStyle: A.showStyle !== !1,
|
|
2217
|
+
showAlign: A.showAlign !== !1,
|
|
2218
|
+
padding: A.padding,
|
|
2219
|
+
width: A.width,
|
|
2220
|
+
maxWidth: A.maxWidth,
|
|
2217
2221
|
editLayout: "fill"
|
|
2218
2222
|
}),
|
|
2219
|
-
[
|
|
2220
|
-
),
|
|
2221
|
-
return /* @__PURE__ */ a(
|
|
2223
|
+
[C, T, s, M, A]
|
|
2224
|
+
), p = z(() => ({ kind: "page", view: m, overrides: S, embed: A }), [m, S, A]), w = z(() => ({ kind: "page", fragment: u.hash, navigation: u }), [u]), k = P((L) => i.announce(L), [i]);
|
|
2225
|
+
return /* @__PURE__ */ a(Sn, { path: e, markup: t, display: c, navigation: p, fragment: w, paneScroll: Mo, announces: !0, announceFailure: k, onDocumentShown: r });
|
|
2222
2226
|
}, Pl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => {
|
|
2223
|
-
const { config: o, viewSettings: l } = D(), i = Ae((
|
|
2227
|
+
const { config: o, viewSettings: l } = D(), i = Ae((p) => p.style), d = Ae((p) => p.align), [g, f] = I(() => bn(o, void 0, i)), u = En(void 0, d), h = P((p) => l.update({ align: p }), [l]), { maximized: m, onDocumentLink: S, pendingHash: A, onHashConsumed: x, announceFailure: T, paneScroll: M } = n, C = z(
|
|
2224
2228
|
() => ({
|
|
2225
2229
|
style: g,
|
|
2226
2230
|
onStyleChange: f,
|
|
2227
2231
|
align: u,
|
|
2228
|
-
onAlignChange:
|
|
2232
|
+
onAlignChange: h,
|
|
2229
2233
|
showToc: m,
|
|
2230
2234
|
showStyle: m,
|
|
2231
2235
|
showAlign: m,
|
|
@@ -2234,16 +2238,16 @@ const hl = /* @__PURE__ */ b.forwardRef(ml), pl = Object.freeze({ className: "aq
|
|
|
2234
2238
|
maxWidth: void 0,
|
|
2235
2239
|
editLayout: m ? "fill" : "content"
|
|
2236
2240
|
}),
|
|
2237
|
-
[g, u,
|
|
2238
|
-
), s =
|
|
2239
|
-
return /* @__PURE__ */ a(
|
|
2241
|
+
[g, u, h, m]
|
|
2242
|
+
), s = z(() => ({ kind: "panel", onDocumentLink: S }), [S]), c = z(() => ({ kind: "panel", fragment: A, consume: x }), [A, x]);
|
|
2243
|
+
return /* @__PURE__ */ a(Sn, { path: e, markup: t, display: C, navigation: s, fragment: c, paneScroll: M, announces: !1, announceFailure: T, onDocumentShown: r });
|
|
2240
2244
|
}, Fl = ({ path: e, markup: t, variant: n, onDocumentShown: r }) => n.kind === "page" ? /* @__PURE__ */ a($l, { path: e, markup: t, variant: n, onDocumentShown: r }) : /* @__PURE__ */ a(Pl, { path: e, markup: t, variant: n, onDocumentShown: r });
|
|
2241
2245
|
function ql({
|
|
2242
2246
|
title: e,
|
|
2243
2247
|
titleId: t,
|
|
2244
2248
|
...n
|
|
2245
2249
|
}, r) {
|
|
2246
|
-
return /* @__PURE__ */
|
|
2250
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2247
2251
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2248
2252
|
viewBox: "0 0 24 24",
|
|
2249
2253
|
fill: "currentColor",
|
|
@@ -2251,21 +2255,21 @@ function ql({
|
|
|
2251
2255
|
"data-slot": "icon",
|
|
2252
2256
|
ref: r,
|
|
2253
2257
|
"aria-labelledby": t
|
|
2254
|
-
}, n), e ? /* @__PURE__ */
|
|
2258
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2255
2259
|
id: t
|
|
2256
|
-
}, e) : null, /* @__PURE__ */
|
|
2260
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2257
2261
|
fillRule: "evenodd",
|
|
2258
2262
|
d: "M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",
|
|
2259
2263
|
clipRule: "evenodd"
|
|
2260
2264
|
}));
|
|
2261
2265
|
}
|
|
2262
|
-
const _l = /* @__PURE__ */
|
|
2266
|
+
const _l = /* @__PURE__ */ E.forwardRef(ql);
|
|
2263
2267
|
function Bl({
|
|
2264
2268
|
title: e,
|
|
2265
2269
|
titleId: t,
|
|
2266
2270
|
...n
|
|
2267
2271
|
}, r) {
|
|
2268
|
-
return /* @__PURE__ */
|
|
2272
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2269
2273
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2270
2274
|
viewBox: "0 0 24 24",
|
|
2271
2275
|
fill: "currentColor",
|
|
@@ -2273,21 +2277,21 @@ function Bl({
|
|
|
2273
2277
|
"data-slot": "icon",
|
|
2274
2278
|
ref: r,
|
|
2275
2279
|
"aria-labelledby": t
|
|
2276
|
-
}, n), e ? /* @__PURE__ */
|
|
2280
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2277
2281
|
id: t
|
|
2278
|
-
}, e) : null, /* @__PURE__ */
|
|
2282
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2279
2283
|
fillRule: "evenodd",
|
|
2280
2284
|
d: "M14.447 3.026a.75.75 0 0 1 .527.921l-4.5 16.5a.75.75 0 0 1-1.448-.394l4.5-16.5a.75.75 0 0 1 .921-.527ZM16.72 6.22a.75.75 0 0 1 1.06 0l5.25 5.25a.75.75 0 0 1 0 1.06l-5.25 5.25a.75.75 0 1 1-1.06-1.06L21.44 12l-4.72-4.72a.75.75 0 0 1 0-1.06Zm-9.44 0a.75.75 0 0 1 0 1.06L2.56 12l4.72 4.72a.75.75 0 0 1-1.06 1.06L.97 12.53a.75.75 0 0 1 0-1.06l5.25-5.25a.75.75 0 0 1 1.06 0Z",
|
|
2281
2285
|
clipRule: "evenodd"
|
|
2282
2286
|
}));
|
|
2283
2287
|
}
|
|
2284
|
-
const Il = /* @__PURE__ */
|
|
2288
|
+
const Il = /* @__PURE__ */ E.forwardRef(Bl);
|
|
2285
2289
|
function jl({
|
|
2286
2290
|
title: e,
|
|
2287
2291
|
titleId: t,
|
|
2288
2292
|
...n
|
|
2289
2293
|
}, r) {
|
|
2290
|
-
return /* @__PURE__ */
|
|
2294
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2291
2295
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2292
2296
|
viewBox: "0 0 24 24",
|
|
2293
2297
|
fill: "currentColor",
|
|
@@ -2295,21 +2299,21 @@ function jl({
|
|
|
2295
2299
|
"data-slot": "icon",
|
|
2296
2300
|
ref: r,
|
|
2297
2301
|
"aria-labelledby": t
|
|
2298
|
-
}, n), e ? /* @__PURE__ */
|
|
2302
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2299
2303
|
id: t
|
|
2300
|
-
}, e) : null, /* @__PURE__ */
|
|
2304
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2301
2305
|
fillRule: "evenodd",
|
|
2302
2306
|
d: "M15.75 2.25H21a.75.75 0 0 1 .75.75v5.25a.75.75 0 0 1-1.5 0V4.81L8.03 17.03a.75.75 0 0 1-1.06-1.06L19.19 3.75h-3.44a.75.75 0 0 1 0-1.5Zm-10.5 4.5a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h10.5a1.5 1.5 0 0 0 1.5-1.5V10.5a.75.75 0 0 1 1.5 0v8.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h8.25a.75.75 0 0 1 0 1.5H5.25Z",
|
|
2303
2307
|
clipRule: "evenodd"
|
|
2304
2308
|
}));
|
|
2305
2309
|
}
|
|
2306
|
-
const Hl = /* @__PURE__ */
|
|
2310
|
+
const Hl = /* @__PURE__ */ E.forwardRef(jl);
|
|
2307
2311
|
function zl({
|
|
2308
2312
|
title: e,
|
|
2309
2313
|
titleId: t,
|
|
2310
2314
|
...n
|
|
2311
2315
|
}, r) {
|
|
2312
|
-
return /* @__PURE__ */
|
|
2316
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2313
2317
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2314
2318
|
viewBox: "0 0 24 24",
|
|
2315
2319
|
fill: "currentColor",
|
|
@@ -2317,25 +2321,25 @@ function zl({
|
|
|
2317
2321
|
"data-slot": "icon",
|
|
2318
2322
|
ref: r,
|
|
2319
2323
|
"aria-labelledby": t
|
|
2320
|
-
}, n), e ? /* @__PURE__ */
|
|
2324
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2321
2325
|
id: t
|
|
2322
|
-
}, e) : null, /* @__PURE__ */
|
|
2326
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2323
2327
|
fillRule: "evenodd",
|
|
2324
2328
|
d: "M11.47 13.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 0 0-1.06-1.06L12 11.69 5.03 4.72a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
|
|
2325
2329
|
clipRule: "evenodd"
|
|
2326
|
-
}), /* @__PURE__ */
|
|
2330
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
2327
2331
|
fillRule: "evenodd",
|
|
2328
2332
|
d: "M11.47 19.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 1 0-1.06-1.06L12 17.69l-6.97-6.97a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
|
|
2329
2333
|
clipRule: "evenodd"
|
|
2330
2334
|
}));
|
|
2331
2335
|
}
|
|
2332
|
-
const Ul = /* @__PURE__ */
|
|
2336
|
+
const Ul = /* @__PURE__ */ E.forwardRef(zl);
|
|
2333
2337
|
function Zl({
|
|
2334
2338
|
title: e,
|
|
2335
2339
|
titleId: t,
|
|
2336
2340
|
...n
|
|
2337
2341
|
}, r) {
|
|
2338
|
-
return /* @__PURE__ */
|
|
2342
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2339
2343
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2340
2344
|
viewBox: "0 0 24 24",
|
|
2341
2345
|
fill: "currentColor",
|
|
@@ -2343,21 +2347,21 @@ function Zl({
|
|
|
2343
2347
|
"data-slot": "icon",
|
|
2344
2348
|
ref: r,
|
|
2345
2349
|
"aria-labelledby": t
|
|
2346
|
-
}, n), e ? /* @__PURE__ */
|
|
2350
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2347
2351
|
id: t
|
|
2348
|
-
}, e) : null, /* @__PURE__ */
|
|
2352
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2349
2353
|
fillRule: "evenodd",
|
|
2350
2354
|
d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z",
|
|
2351
2355
|
clipRule: "evenodd"
|
|
2352
2356
|
}));
|
|
2353
2357
|
}
|
|
2354
|
-
const Vl = /* @__PURE__ */
|
|
2358
|
+
const Vl = /* @__PURE__ */ E.forwardRef(Zl);
|
|
2355
2359
|
function Gl({
|
|
2356
2360
|
title: e,
|
|
2357
2361
|
titleId: t,
|
|
2358
2362
|
...n
|
|
2359
2363
|
}, r) {
|
|
2360
|
-
return /* @__PURE__ */
|
|
2364
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2361
2365
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2362
2366
|
viewBox: "0 0 24 24",
|
|
2363
2367
|
fill: "currentColor",
|
|
@@ -2365,23 +2369,23 @@ function Gl({
|
|
|
2365
2369
|
"data-slot": "icon",
|
|
2366
2370
|
ref: r,
|
|
2367
2371
|
"aria-labelledby": t
|
|
2368
|
-
}, n), e ? /* @__PURE__ */
|
|
2372
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2369
2373
|
id: t
|
|
2370
|
-
}, e) : null, /* @__PURE__ */
|
|
2374
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2371
2375
|
fillRule: "evenodd",
|
|
2372
2376
|
d: "M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
|
|
2373
2377
|
clipRule: "evenodd"
|
|
2374
|
-
}), /* @__PURE__ */
|
|
2378
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
2375
2379
|
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"
|
|
2376
2380
|
}));
|
|
2377
2381
|
}
|
|
2378
|
-
const Kl = /* @__PURE__ */
|
|
2382
|
+
const Kl = /* @__PURE__ */ E.forwardRef(Gl);
|
|
2379
2383
|
function Wl({
|
|
2380
2384
|
title: e,
|
|
2381
2385
|
titleId: t,
|
|
2382
2386
|
...n
|
|
2383
2387
|
}, r) {
|
|
2384
|
-
return /* @__PURE__ */
|
|
2388
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2385
2389
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2386
2390
|
viewBox: "0 0 24 24",
|
|
2387
2391
|
fill: "currentColor",
|
|
@@ -2389,23 +2393,23 @@ function Wl({
|
|
|
2389
2393
|
"data-slot": "icon",
|
|
2390
2394
|
ref: r,
|
|
2391
2395
|
"aria-labelledby": t
|
|
2392
|
-
}, n), e ? /* @__PURE__ */
|
|
2396
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2393
2397
|
id: t
|
|
2394
|
-
}, e) : null, /* @__PURE__ */
|
|
2398
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2395
2399
|
d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"
|
|
2396
|
-
}), /* @__PURE__ */
|
|
2400
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
2397
2401
|
fillRule: "evenodd",
|
|
2398
2402
|
d: "M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z",
|
|
2399
2403
|
clipRule: "evenodd"
|
|
2400
2404
|
}));
|
|
2401
2405
|
}
|
|
2402
|
-
const Xl = /* @__PURE__ */
|
|
2406
|
+
const Xl = /* @__PURE__ */ E.forwardRef(Wl);
|
|
2403
2407
|
function Yl({
|
|
2404
2408
|
title: e,
|
|
2405
2409
|
titleId: t,
|
|
2406
2410
|
...n
|
|
2407
2411
|
}, r) {
|
|
2408
|
-
return /* @__PURE__ */
|
|
2412
|
+
return /* @__PURE__ */ E.createElement("svg", Object.assign({
|
|
2409
2413
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2410
2414
|
viewBox: "0 0 24 24",
|
|
2411
2415
|
fill: "currentColor",
|
|
@@ -2413,15 +2417,15 @@ function Yl({
|
|
|
2413
2417
|
"data-slot": "icon",
|
|
2414
2418
|
ref: r,
|
|
2415
2419
|
"aria-labelledby": t
|
|
2416
|
-
}, n), e ? /* @__PURE__ */
|
|
2420
|
+
}, n), e ? /* @__PURE__ */ E.createElement("title", {
|
|
2417
2421
|
id: t
|
|
2418
|
-
}, e) : null, /* @__PURE__ */
|
|
2422
|
+
}, e) : null, /* @__PURE__ */ E.createElement("path", {
|
|
2419
2423
|
d: "M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"
|
|
2420
|
-
}), /* @__PURE__ */
|
|
2424
|
+
}), /* @__PURE__ */ E.createElement("path", {
|
|
2421
2425
|
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"
|
|
2422
2426
|
}));
|
|
2423
2427
|
}
|
|
2424
|
-
const Jl = /* @__PURE__ */
|
|
2428
|
+
const Jl = /* @__PURE__ */ E.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId: n }) => {
|
|
2425
2429
|
const { labels: r, onEditGrant: o } = D(), [l, i] = I(!1), d = () => {
|
|
2426
2430
|
o === void 0 || l || (i(!0), o(e).then((g) => {
|
|
2427
2431
|
g && t();
|
|
@@ -2437,103 +2441,105 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2437
2441
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
|
|
2438
2442
|
] })
|
|
2439
2443
|
] });
|
|
2440
|
-
},
|
|
2444
|
+
}, qt = (e, t, n) => {
|
|
2441
2445
|
const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
|
|
2442
2446
|
return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
|
|
2443
2447
|
}, ei = ({ path: e, documentName: t, open: n, onClose: r }) => {
|
|
2444
|
-
const { data: o, edits: l, labels: i, locale: d, announcer: g } = D(), f =
|
|
2445
|
-
|
|
2446
|
-
const
|
|
2447
|
-
if (
|
|
2448
|
-
if (n && !
|
|
2449
|
-
const N =
|
|
2450
|
-
u.current = N instanceof HTMLElement ? N : null,
|
|
2451
|
-
} else !n &&
|
|
2452
|
-
}, [n]),
|
|
2448
|
+
const { data: o, edits: l, labels: i, locale: d, announcer: g } = D(), f = _(null), u = _(null), h = Oe(), [m, S] = I(null), [A, x] = I(0), [T, M] = I(null), [C, s] = I(null), c = z(() => new Intl.DateTimeFormat(d, { dateStyle: "medium", timeStyle: "short" }), [d]);
|
|
2449
|
+
U(() => {
|
|
2450
|
+
const O = f.current;
|
|
2451
|
+
if (O !== null)
|
|
2452
|
+
if (n && !O.open) {
|
|
2453
|
+
const N = O.ownerDocument.activeElement;
|
|
2454
|
+
u.current = N instanceof HTMLElement ? N : null, M(null), s(null), O.showModal();
|
|
2455
|
+
} else !n && O.open && (O.close(), u.current?.isConnected === !0 && u.current.focus(), u.current = null);
|
|
2456
|
+
}, [n]), te(() => {
|
|
2453
2457
|
if (!n) return;
|
|
2454
|
-
const
|
|
2455
|
-
return
|
|
2456
|
-
"kind" in N &&
|
|
2457
|
-
}), () =>
|
|
2458
|
-
}, [n, o, e,
|
|
2458
|
+
const O = new AbortController();
|
|
2459
|
+
return S(null), o.revisions(e, O.signal).then((N) => {
|
|
2460
|
+
"kind" in N && S(N);
|
|
2461
|
+
}), () => O.abort();
|
|
2462
|
+
}, [n, o, e, A]), te(() => {
|
|
2459
2463
|
if (!n || T === null) return;
|
|
2460
|
-
const
|
|
2461
|
-
return s(null), o.revision(e, T,
|
|
2464
|
+
const O = new AbortController();
|
|
2465
|
+
return s(null), o.revision(e, T, O.signal).then((N) => {
|
|
2462
2466
|
"kind" in N && s(N);
|
|
2463
|
-
}), () =>
|
|
2467
|
+
}), () => O.abort();
|
|
2464
2468
|
}, [n, o, e, T]);
|
|
2465
|
-
const
|
|
2466
|
-
|
|
2467
|
-
}, w = (
|
|
2468
|
-
|
|
2469
|
-
}, k = (
|
|
2470
|
-
|
|
2471
|
-
}, L = m !== null && m.kind === "revisions" ? m.revisions.find((
|
|
2472
|
-
return /* @__PURE__ */ a("dialog", { ref: f, className: "aqmx-confirm aqmx-history", "aria-labelledby":
|
|
2473
|
-
/* @__PURE__ */ a("p", { id:
|
|
2474
|
-
m === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: i.historyLoading }) : m.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: () =>
|
|
2475
|
-
/* @__PURE__ */ a("span", { children:
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
] }) },
|
|
2479
|
-
T === null ? null :
|
|
2480
|
-
/* @__PURE__ */ a("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": L === void 0 ? i.historyTitle(t) :
|
|
2469
|
+
const p = () => {
|
|
2470
|
+
C === null || C.kind !== "revision" || (l.replaceDraft(e, C.text), g.announce(i.historyRestored(t)), r());
|
|
2471
|
+
}, w = (O) => {
|
|
2472
|
+
O.key !== "Escape" || O.defaultPrevented || (rn(O), r());
|
|
2473
|
+
}, k = (O) => {
|
|
2474
|
+
O.target === O.currentTarget && r();
|
|
2475
|
+
}, L = m !== null && m.kind === "revisions" ? m.revisions.find((O) => O.id === T) : void 0;
|
|
2476
|
+
return /* @__PURE__ */ a("dialog", { ref: f, className: "aqmx-confirm aqmx-history", "aria-labelledby": h, "data-testid": "markdown-explorer-history", onKeyDown: w, onClick: k, onCancel: (O) => O.preventDefault(), children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
|
|
2477
|
+
/* @__PURE__ */ a("p", { id: h, className: "aqmx-confirm-title", children: i.historyTitle(t) }),
|
|
2478
|
+
m === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: i.historyLoading }) : m.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: m.failure, alert: !1, onRetry: () => x((O) => O + 1), testId: "markdown-explorer-history-failure" }) : m.revisions.length === 0 ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: i.historyEmpty }) : /* @__PURE__ */ a("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: m.revisions.map((O) => /* @__PURE__ */ a("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": O.id === T, "data-testid": "markdown-explorer-history-entry", onClick: () => M(O.id), children: [
|
|
2479
|
+
/* @__PURE__ */ a("span", { children: qt(O, c, i.historyEntry) }),
|
|
2480
|
+
O.current ? /* @__PURE__ */ a("span", { className: "aqmx-history-mark", children: i.historyCurrent }) : null,
|
|
2481
|
+
O.kept ? /* @__PURE__ */ a("span", { className: "aqmx-history-mark", children: i.historyKept }) : null
|
|
2482
|
+
] }) }, O.id)) }),
|
|
2483
|
+
T === null ? null : C === null ? /* @__PURE__ */ a("p", { className: "aqmx-history-note", children: i.historyLoading }) : C.kind === "failure" ? /* @__PURE__ */ a(ve, { failure: C.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
|
|
2484
|
+
/* @__PURE__ */ a("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": L === void 0 ? i.historyTitle(t) : qt(L, c, i.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ a("pre", { children: C.text }) })
|
|
2481
2485
|
),
|
|
2482
2486
|
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
2483
2487
|
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: i.historyClose }),
|
|
2484
|
-
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "aria-disabled":
|
|
2488
|
+
/* @__PURE__ */ a("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": C === null || C.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: p, children: i.historyRestore })
|
|
2485
2489
|
] })
|
|
2486
2490
|
] }) });
|
|
2487
2491
|
}, ti = (e) => {
|
|
2488
|
-
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o =
|
|
2492
|
+
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), l = de(o)?.document;
|
|
2489
2493
|
return l === void 0 || l.kind === "failure" ? { edit: null, name: Ee(e) } : { edit: l.kind === "markdown" ? l.edit : null, name: l.name };
|
|
2490
2494
|
}, se = (e) => {
|
|
2491
2495
|
e.stopPropagation();
|
|
2492
|
-
}, ni = ({ path: e, documentName: t, iconOnly: n }) => {
|
|
2493
|
-
const { edits:
|
|
2494
|
-
|
|
2495
|
-
() =>
|
|
2496
|
+
}, ni = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r }) => {
|
|
2497
|
+
const { draftConverter: o, edits: l, labels: i } = D(), d = ee(
|
|
2498
|
+
l.subscribe,
|
|
2499
|
+
() => l.session(e) !== void 0,
|
|
2496
2500
|
() => !1
|
|
2497
|
-
), [
|
|
2498
|
-
if (!
|
|
2499
|
-
|
|
2501
|
+
), [g, f] = I(!1), u = () => {
|
|
2502
|
+
if (!d) {
|
|
2503
|
+
l.start(e, l.viewAnchor(e));
|
|
2500
2504
|
return;
|
|
2501
2505
|
}
|
|
2502
|
-
|
|
2503
|
-
},
|
|
2506
|
+
l.flush(e), l.session(e)?.dirty === !0 ? f(!0) : l.close(e);
|
|
2507
|
+
}, h = () => {
|
|
2508
|
+
d || (Fr(), r && l.previewShown() && o?.prepare?.());
|
|
2509
|
+
}, m = n ? i.editDocumentNamed(t) : null;
|
|
2504
2510
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
2505
2511
|
/* @__PURE__ */ F(
|
|
2506
2512
|
"button",
|
|
2507
2513
|
{
|
|
2508
2514
|
type: "button",
|
|
2509
|
-
className:
|
|
2510
|
-
title:
|
|
2511
|
-
"aria-label":
|
|
2512
|
-
"aria-pressed":
|
|
2515
|
+
className: m === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2516
|
+
title: d ? i.closeEditor : m === null ? i.editDocument : m,
|
|
2517
|
+
"aria-label": m === null ? void 0 : m,
|
|
2518
|
+
"aria-pressed": d,
|
|
2513
2519
|
"data-testid": "markdown-explorer-document-edit",
|
|
2514
|
-
onClick:
|
|
2520
|
+
onClick: u,
|
|
2515
2521
|
onDoubleClick: se,
|
|
2516
|
-
onPointerEnter:
|
|
2517
|
-
onFocus:
|
|
2522
|
+
onPointerEnter: h,
|
|
2523
|
+
onFocus: h,
|
|
2518
2524
|
children: [
|
|
2519
2525
|
/* @__PURE__ */ a(Jl, { "aria-hidden": "true" }),
|
|
2520
|
-
|
|
2526
|
+
m === null ? /* @__PURE__ */ a("span", { children: i.editDocumentLabel }) : null
|
|
2521
2527
|
]
|
|
2522
2528
|
}
|
|
2523
2529
|
),
|
|
2524
2530
|
/* @__PURE__ */ a(
|
|
2525
|
-
|
|
2531
|
+
on,
|
|
2526
2532
|
{
|
|
2527
|
-
open:
|
|
2528
|
-
title:
|
|
2529
|
-
body:
|
|
2530
|
-
confirmLabel:
|
|
2531
|
-
cancelLabel:
|
|
2533
|
+
open: g,
|
|
2534
|
+
title: i.unsavedTitle,
|
|
2535
|
+
body: i.unsavedBody(t),
|
|
2536
|
+
confirmLabel: i.unsavedDiscard,
|
|
2537
|
+
cancelLabel: i.unsavedStay,
|
|
2532
2538
|
testId: "markdown-explorer-edit-close-confirm",
|
|
2533
2539
|
onConfirm: () => {
|
|
2534
|
-
|
|
2540
|
+
f(!1), l.close(e);
|
|
2535
2541
|
},
|
|
2536
|
-
onCancel: () =>
|
|
2542
|
+
onCancel: () => f(!1)
|
|
2537
2543
|
}
|
|
2538
2544
|
)
|
|
2539
2545
|
] });
|
|
@@ -2557,34 +2563,50 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2557
2563
|
}
|
|
2558
2564
|
);
|
|
2559
2565
|
}, oi = ({ session: e }) => {
|
|
2560
|
-
const { labels: t } = D(), n =
|
|
2566
|
+
const { labels: t } = D(), n = br(t, e);
|
|
2561
2567
|
return /* @__PURE__ */ a("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
|
|
2562
2568
|
}, li = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2563
|
-
const {
|
|
2569
|
+
const { draftConverter: l, edits: i, labels: d } = D(), g = Mr(), [f, u] = I(!1);
|
|
2564
2570
|
if (r.phase.kind !== "editing") return null;
|
|
2565
|
-
const
|
|
2566
|
-
|
|
2567
|
-
const
|
|
2568
|
-
|
|
2569
|
-
},
|
|
2571
|
+
const h = r.save.kind === "saving", m = h || !r.dirty, S = () => {
|
|
2572
|
+
i.flush(e);
|
|
2573
|
+
const T = i.session(e);
|
|
2574
|
+
T === void 0 || !T.dirty || T.save.kind === "saving" || i.save(e);
|
|
2575
|
+
}, A = (T) => n ? { className: "aqmx-icon-button", "aria-label": T } : { className: "aqmx-icon-button aqmx-labelled-button" }, x = () => {
|
|
2576
|
+
g || l?.prepare?.();
|
|
2577
|
+
};
|
|
2570
2578
|
return /* @__PURE__ */ F(Ne, { children: [
|
|
2571
|
-
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...
|
|
2579
|
+
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...A(d.conflictNext), title: d.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: se, children: [
|
|
2572
2580
|
/* @__PURE__ */ a(Ul, { "aria-hidden": "true" }),
|
|
2573
|
-
n ? null : /* @__PURE__ */ a("span", { children:
|
|
2574
|
-
] }) : null,
|
|
2575
|
-
o ? /* @__PURE__ */ F("button", { type: "button", ...x(i.previewToggle), title: i.previewToggle, "aria-pressed": d, "data-testid": "markdown-explorer-edit-preview-toggle", onClick: () => l.setPreviewShown(!d), onDoubleClick: se, children: [
|
|
2576
|
-
/* @__PURE__ */ a(Xl, { "aria-hidden": "true" }),
|
|
2577
|
-
n ? null : /* @__PURE__ */ a("span", { children: i.previewToggle })
|
|
2581
|
+
n ? null : /* @__PURE__ */ a("span", { children: d.conflictNext })
|
|
2578
2582
|
] }) : null,
|
|
2579
|
-
|
|
2583
|
+
o ? /* @__PURE__ */ F(
|
|
2584
|
+
"button",
|
|
2585
|
+
{
|
|
2586
|
+
type: "button",
|
|
2587
|
+
...A(d.previewToggle),
|
|
2588
|
+
title: d.previewToggle,
|
|
2589
|
+
"aria-pressed": g,
|
|
2590
|
+
"data-testid": "markdown-explorer-edit-preview-toggle",
|
|
2591
|
+
onClick: () => i.setPreviewShown(!g),
|
|
2592
|
+
onDoubleClick: se,
|
|
2593
|
+
onPointerEnter: x,
|
|
2594
|
+
onFocus: x,
|
|
2595
|
+
children: [
|
|
2596
|
+
/* @__PURE__ */ a(Xl, { "aria-hidden": "true" }),
|
|
2597
|
+
n ? null : /* @__PURE__ */ a("span", { children: d.previewToggle })
|
|
2598
|
+
]
|
|
2599
|
+
}
|
|
2600
|
+
) : null,
|
|
2601
|
+
r.history ? /* @__PURE__ */ F("button", { type: "button", ...A(d.historyOpen), title: d.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => u(!0), onDoubleClick: se, children: [
|
|
2580
2602
|
/* @__PURE__ */ a(Vl, { "aria-hidden": "true" }),
|
|
2581
|
-
n ? null : /* @__PURE__ */ a("span", { children:
|
|
2603
|
+
n ? null : /* @__PURE__ */ a("span", { children: d.historyOpen })
|
|
2582
2604
|
] }) : null,
|
|
2583
|
-
/* @__PURE__ */ F("button", { type: "button", ...
|
|
2605
|
+
/* @__PURE__ */ F("button", { type: "button", ...A(d.saveDraft), title: d.saveDraftTooltip, "aria-disabled": m, "aria-busy": h, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: S, onDoubleClick: se, children: [
|
|
2584
2606
|
/* @__PURE__ */ a(Kl, { "aria-hidden": "true" }),
|
|
2585
|
-
n ? null : /* @__PURE__ */ a("span", { children:
|
|
2607
|
+
n ? null : /* @__PURE__ */ a("span", { children: d.saveDraft })
|
|
2586
2608
|
] }),
|
|
2587
|
-
r.history ? /* @__PURE__ */ a(ei, { path: e, documentName: t, open:
|
|
2609
|
+
r.history ? /* @__PURE__ */ a(ei, { path: e, documentName: t, open: f, onClose: () => u(!1) }) : null
|
|
2588
2610
|
] });
|
|
2589
2611
|
}, ii = ({ path: e, session: t }) => {
|
|
2590
2612
|
const { edits: n } = D();
|
|
@@ -2592,45 +2614,45 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2592
2614
|
n.save(e);
|
|
2593
2615
|
}, testId: "markdown-explorer-save-grant" });
|
|
2594
2616
|
}, si = (e) => {
|
|
2595
|
-
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o =
|
|
2617
|
+
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r);
|
|
2596
2618
|
return de(o)?.document.kind === "markdown";
|
|
2597
2619
|
}, ai = (e) => {
|
|
2598
2620
|
const { config: t } = D(), n = $e(), r = P(() => n(pe(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2599
|
-
return
|
|
2621
|
+
return z(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2600
2622
|
}, ci = /* @__PURE__ */ new Set(), di = (e, t) => {
|
|
2601
|
-
const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d =
|
|
2602
|
-
|
|
2603
|
-
const
|
|
2604
|
-
|
|
2605
|
-
|
|
2623
|
+
const { documents: n, announcer: r, labels: o } = D(), l = P(() => n.peek(e), [n, e]), i = P(() => n.peekSeeded(e), [n, e]), d = ee(n.subscribe, l, i), g = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, g, g), [u] = I(() => /* @__PURE__ */ new Set()), [h, m] = I(ci), [S, A] = I(null);
|
|
2624
|
+
S !== null && S.path !== e && A(null);
|
|
2625
|
+
const x = _(null);
|
|
2626
|
+
U(() => (x.current = e, () => {
|
|
2627
|
+
x.current = null;
|
|
2606
2628
|
}), [e]);
|
|
2607
2629
|
const T = P(() => {
|
|
2608
2630
|
const s = e, c = n.peek(s);
|
|
2609
2631
|
if (u.has(s) || c?.status === "pending") return;
|
|
2610
|
-
const
|
|
2611
|
-
u.add(s), m(new Set(u)),
|
|
2632
|
+
const p = t && !mn(c);
|
|
2633
|
+
u.add(s), m(new Set(u)), A(null), (async () => {
|
|
2612
2634
|
try {
|
|
2613
2635
|
const w = await n.refresh(s);
|
|
2614
|
-
if (
|
|
2636
|
+
if (x.current !== s || w.status === "superseded") return;
|
|
2615
2637
|
if (w.status === "failed") {
|
|
2616
|
-
|
|
2638
|
+
A({ path: s, failure: w.failure, stamp: n.answerStampOf(s) }), r.announce(o.documentRefreshFailed(ae(o, w.failure.reason)));
|
|
2617
2639
|
return;
|
|
2618
2640
|
}
|
|
2619
2641
|
const k = de(n.peek(s));
|
|
2620
|
-
if (
|
|
2642
|
+
if (p || k === null || k.document.kind === "failure") return;
|
|
2621
2643
|
r.announce(o.documentRefreshed(k.document.name));
|
|
2622
2644
|
} finally {
|
|
2623
2645
|
u.delete(s), m(new Set(u));
|
|
2624
2646
|
}
|
|
2625
2647
|
})();
|
|
2626
|
-
}, [e, t, u, n, r, o]),
|
|
2627
|
-
return { refreshing:
|
|
2648
|
+
}, [e, t, u, n, r, o]), M = h.has(e), C = S !== null && S.path === e && S.stamp === f ? S.failure : null;
|
|
2649
|
+
return { refreshing: M, unavailable: M || d?.status === "pending", failure: C, refresh: T };
|
|
2628
2650
|
}, ui = Object.freeze({ kind: "page" }), fi = ({ path: e, placement: t, markup: n }) => {
|
|
2629
|
-
const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = di(e, t.kind === "page"), g = si(e), f = ti(e), u =
|
|
2651
|
+
const { labels: r } = D(), { refreshing: o, unavailable: l, failure: i, refresh: d } = di(e, t.kind === "page"), g = si(e), f = ti(e), u = ln(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, m = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, S = t.kind === "panel", A = t.kind === "panel" ? t.documentName : f.name, x = t.kind === "page" || t.maximized;
|
|
2630
2652
|
return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": u === void 0 ? void 0 : "true", children: [
|
|
2631
2653
|
/* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
|
|
2632
2654
|
u === void 0 ? null : /* @__PURE__ */ a(oi, { session: u }),
|
|
2633
|
-
u === void 0 ? null : /* @__PURE__ */ a(li, { path: e, documentName:
|
|
2655
|
+
u === void 0 ? null : /* @__PURE__ */ a(li, { path: e, documentName: A, iconOnly: S, session: u, previewAvailable: x }),
|
|
2634
2656
|
u === void 0 && g ? /* @__PURE__ */ F(
|
|
2635
2657
|
"button",
|
|
2636
2658
|
{
|
|
@@ -2648,14 +2670,14 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2648
2670
|
]
|
|
2649
2671
|
}
|
|
2650
2672
|
) : null,
|
|
2651
|
-
u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ a(ni, { path: e, documentName:
|
|
2673
|
+
u !== void 0 || f.edit?.kind === "inline" ? /* @__PURE__ */ a(ni, { path: e, documentName: A, iconOnly: S, previewAvailable: x }) : f.edit?.kind === "external" ? /* @__PURE__ */ a(ri, { href: f.edit.href, documentName: A, iconOnly: S }) : null,
|
|
2652
2674
|
u === void 0 ? /* @__PURE__ */ F(
|
|
2653
2675
|
"button",
|
|
2654
2676
|
{
|
|
2655
2677
|
type: "button",
|
|
2656
|
-
className:
|
|
2657
|
-
title:
|
|
2658
|
-
"aria-label":
|
|
2678
|
+
className: h === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2679
|
+
title: h === null ? r.refreshDocument : h,
|
|
2680
|
+
"aria-label": h === null ? void 0 : h,
|
|
2659
2681
|
"aria-disabled": l,
|
|
2660
2682
|
"aria-busy": o,
|
|
2661
2683
|
"data-aqmx-busy": o ? "true" : void 0,
|
|
@@ -2664,7 +2686,7 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2664
2686
|
onDoubleClick: se,
|
|
2665
2687
|
children: [
|
|
2666
2688
|
/* @__PURE__ */ a(_l, { "aria-hidden": "true" }),
|
|
2667
|
-
|
|
2689
|
+
h === null ? /* @__PURE__ */ a("span", { children: r.refreshDocumentLabel }) : null
|
|
2668
2690
|
]
|
|
2669
2691
|
}
|
|
2670
2692
|
) : null
|
|
@@ -2673,36 +2695,36 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2673
2695
|
u === void 0 ? null : /* @__PURE__ */ a(ii, { path: e, session: u })
|
|
2674
2696
|
] });
|
|
2675
2697
|
}, mi = ({ location: e }) => {
|
|
2676
|
-
const t = e.doc, n =
|
|
2698
|
+
const t = e.doc, n = z(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = ai(e);
|
|
2677
2699
|
return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", children: [
|
|
2678
2700
|
/* @__PURE__ */ a(fi, { path: t, placement: ui, markup: r }),
|
|
2679
2701
|
/* @__PURE__ */ a(Fl, { path: t, markup: e.markup, variant: n })
|
|
2680
2702
|
] });
|
|
2681
2703
|
}, hi = ({ holds: e, testId: t }) => {
|
|
2682
2704
|
const { labels: n, announcer: r } = D(), o = Oe();
|
|
2683
|
-
|
|
2684
|
-
const l = P(() => r.shownIn(o), [r, o]), i =
|
|
2705
|
+
U(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
2706
|
+
const l = P(() => r.shownIn(o), [r, o]), i = ee(r.subscribe, l, l);
|
|
2685
2707
|
return /* @__PURE__ */ a("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: i.length > 1 ? n.announcementSequence(i) : i[0] });
|
|
2686
2708
|
}, ue = Object.freeze([]), pi = (e) => {
|
|
2687
2709
|
const t = /* @__PURE__ */ new Set();
|
|
2688
2710
|
let n = ue, r = [], o = !1;
|
|
2689
2711
|
const l = [], i = (u) => {
|
|
2690
2712
|
n = u;
|
|
2691
|
-
for (const
|
|
2713
|
+
for (const h of [...t]) h();
|
|
2692
2714
|
}, d = () => l.at(-1)?.region, g = (u) => {
|
|
2693
|
-
const
|
|
2694
|
-
u(), d() !==
|
|
2715
|
+
const h = d();
|
|
2716
|
+
u(), d() !== h && n !== ue && i(ue);
|
|
2695
2717
|
}, f = () => {
|
|
2696
2718
|
o = !1;
|
|
2697
|
-
const u = r.map((
|
|
2719
|
+
const u = r.map((h) => "sentence" in h ? h.sentence : h.list(h.items));
|
|
2698
2720
|
r = [], i(Object.freeze(u));
|
|
2699
2721
|
};
|
|
2700
2722
|
return {
|
|
2701
2723
|
announce: (u) => {
|
|
2702
2724
|
if (typeof u == "string") r.push({ sentence: u });
|
|
2703
2725
|
else {
|
|
2704
|
-
const
|
|
2705
|
-
|
|
2726
|
+
const h = r.find((m) => "list" in m && m.list === u.list);
|
|
2727
|
+
h !== void 0 && "items" in h ? h.items.push(u.item) : r.push({ list: u.list, items: [u.item] });
|
|
2706
2728
|
}
|
|
2707
2729
|
o || (o = !0, n !== ue && i(ue), e.request(f));
|
|
2708
2730
|
},
|
|
@@ -2710,9 +2732,9 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2710
2732
|
t.delete(u);
|
|
2711
2733
|
}),
|
|
2712
2734
|
claim: (u) => {
|
|
2713
|
-
const
|
|
2714
|
-
return g(() => l.push(
|
|
2715
|
-
const m = l.indexOf(
|
|
2735
|
+
const h = { region: u };
|
|
2736
|
+
return g(() => l.push(h)), () => g(() => {
|
|
2737
|
+
const m = l.indexOf(h);
|
|
2716
2738
|
m !== -1 && l.splice(m, 1);
|
|
2717
2739
|
});
|
|
2718
2740
|
},
|
|
@@ -2721,64 +2743,64 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2721
2743
|
}, he = Object.freeze({ status: "cancelled" }), gi = (e) => {
|
|
2722
2744
|
if (e === null || typeof e != "object") return null;
|
|
2723
2745
|
const { failure: t } = e;
|
|
2724
|
-
if (
|
|
2746
|
+
if (Kn(t) !== null) return null;
|
|
2725
2747
|
const { reason: n, code: r } = t;
|
|
2726
|
-
return
|
|
2748
|
+
return Wn(n, r);
|
|
2727
2749
|
}, vi = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
2728
|
-
const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u,
|
|
2729
|
-
let
|
|
2750
|
+
const r = n ?? ((f, u) => globalThis.fetch(f, u)), o = (f, u) => `${e}/${f}?${new URLSearchParams(u).toString()}`, l = async (f, u, h, m) => {
|
|
2751
|
+
let S;
|
|
2730
2752
|
try {
|
|
2731
|
-
|
|
2753
|
+
S = await r(f, { credentials: "same-origin", ...u, headers: { Accept: "application/json", ...u.headers } });
|
|
2732
2754
|
} catch {
|
|
2733
2755
|
return m({ reason: "failed" });
|
|
2734
2756
|
}
|
|
2735
|
-
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2738
|
-
let
|
|
2757
|
+
S.status === 401 && t(null);
|
|
2758
|
+
const A = S.headers.get(zn);
|
|
2759
|
+
A !== null && t(A);
|
|
2760
|
+
let x;
|
|
2739
2761
|
try {
|
|
2740
|
-
|
|
2762
|
+
x = await S.json();
|
|
2741
2763
|
} catch {
|
|
2742
|
-
return m({ reason: ht(
|
|
2764
|
+
return m({ reason: ht(S.status) });
|
|
2743
2765
|
}
|
|
2744
2766
|
let T;
|
|
2745
2767
|
try {
|
|
2746
|
-
T =
|
|
2768
|
+
T = h(x);
|
|
2747
2769
|
} catch {
|
|
2748
2770
|
T = !1;
|
|
2749
2771
|
}
|
|
2750
|
-
if (T) return
|
|
2751
|
-
const
|
|
2752
|
-
return m(
|
|
2753
|
-
}, i = { [gt]:
|
|
2754
|
-
const m = await l(f, u,
|
|
2772
|
+
if (T) return x;
|
|
2773
|
+
const M = gi(x);
|
|
2774
|
+
return m(M !== null ? M : { reason: S.status === 200 ? "failed" : ht(S.status) });
|
|
2775
|
+
}, i = { [gt]: Xn }, d = { [gt]: tr, "Content-Type": `${er}; charset=utf-8` }, g = async (f, u, h) => {
|
|
2776
|
+
const m = await l(f, u, h, (S) => He(S.reason, S.code));
|
|
2755
2777
|
return u.signal.aborted ? he : m;
|
|
2756
2778
|
};
|
|
2757
2779
|
return {
|
|
2758
|
-
tree: (f) => l(o("tree", { [
|
|
2759
|
-
children: async (f, u,
|
|
2760
|
-
const m = await l(o("children", { [
|
|
2761
|
-
return
|
|
2780
|
+
tree: (f) => l(o("tree", { [X.source]: f }), { method: "GET" }, pt, (u) => ({ status: "error", failure: u })),
|
|
2781
|
+
children: async (f, u, h) => {
|
|
2782
|
+
const m = await l(o("children", { [X.source]: f, [X.path]: u }), { method: "GET", signal: h }, Gn, (S) => ({ status: "error", failure: S }));
|
|
2783
|
+
return h.aborted ? he : m;
|
|
2762
2784
|
},
|
|
2763
|
-
ancestors: async (f, u,
|
|
2764
|
-
const m = await l(o("ancestors", { [
|
|
2765
|
-
return
|
|
2785
|
+
ancestors: async (f, u, h) => {
|
|
2786
|
+
const m = await l(o("ancestors", { [X.source]: f, [X.path]: u }), { method: "GET", signal: h }, Vn, (S) => ({ status: "error", failure: S }));
|
|
2787
|
+
return h.aborted ? he : m;
|
|
2766
2788
|
},
|
|
2767
|
-
reveal: async (f, u,
|
|
2768
|
-
const m = await l(o("reveal", { [
|
|
2769
|
-
return
|
|
2789
|
+
reveal: async (f, u, h) => {
|
|
2790
|
+
const m = await l(o("reveal", { [X.source]: f, [X.path]: u }), { method: "GET", signal: h }, Zn, (S) => ({ status: "error", failure: S }));
|
|
2791
|
+
return h.aborted ? he : m;
|
|
2770
2792
|
},
|
|
2771
|
-
document: (f, { refresh: u }) => l(o("document", { [
|
|
2793
|
+
document: (f, { refresh: u }) => l(o("document", { [X.path]: f }), u ? { method: "GET", headers: i } : { method: "GET" }, or, (h) => He(h.reason, h.code)),
|
|
2772
2794
|
text: async (f, u) => {
|
|
2773
|
-
const
|
|
2774
|
-
return u.aborted ? he :
|
|
2795
|
+
const h = await l(o("text", { [X.path]: f }), { method: "GET", signal: u }, Un, (m) => He(m.reason, m.code));
|
|
2796
|
+
return u.aborted ? he : h;
|
|
2775
2797
|
},
|
|
2776
|
-
edit: (f, u) => g(o("edit", { [
|
|
2777
|
-
save: (f, u,
|
|
2778
|
-
preview: (f, u,
|
|
2779
|
-
revisions: (f, u) => g(o("revisions", { [
|
|
2780
|
-
revision: (f, u,
|
|
2781
|
-
refresh: (f) => l(o("refresh", { [
|
|
2798
|
+
edit: (f, u) => g(o("edit", { [X.path]: f }), { method: "GET", signal: u }, rr),
|
|
2799
|
+
save: (f, u, h, m) => g(o("save", { [X.path]: f, [X.base]: u }), { method: "POST", headers: d, body: h, signal: m }, nr),
|
|
2800
|
+
preview: (f, u, h) => g(o("preview", { [X.path]: f }), { method: "POST", headers: d, body: u, signal: h }, Qn),
|
|
2801
|
+
revisions: (f, u) => g(o("revisions", { [X.path]: f }), { method: "GET", signal: u }, Jn),
|
|
2802
|
+
revision: (f, u, h) => g(o("revision", { [X.path]: f, [X.revision]: u }), { method: "GET", signal: h }, Yn),
|
|
2803
|
+
refresh: (f) => l(o("refresh", { [X.source]: f }), { method: "POST", headers: i }, pt, (u) => ({ status: "error", failure: u }))
|
|
2782
2804
|
};
|
|
2783
2805
|
}, wi = () => {
|
|
2784
2806
|
let e = null, t = null;
|
|
@@ -2796,14 +2818,14 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2796
2818
|
}
|
|
2797
2819
|
};
|
|
2798
2820
|
}, bi = (e) => {
|
|
2799
|
-
const t =
|
|
2821
|
+
const t = Yt(e);
|
|
2800
2822
|
if (t === null) return mt;
|
|
2801
2823
|
try {
|
|
2802
|
-
return
|
|
2824
|
+
return _n(JSON.parse(t));
|
|
2803
2825
|
} catch (n) {
|
|
2804
2826
|
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), mt;
|
|
2805
2827
|
}
|
|
2806
|
-
},
|
|
2828
|
+
}, _t = (e, t) => {
|
|
2807
2829
|
let n = null;
|
|
2808
2830
|
const r = () => {
|
|
2809
2831
|
if (n === null) {
|
|
@@ -2819,205 +2841,205 @@ const Jl = /* @__PURE__ */ b.forwardRef(Yl), Ql = ({ href: e, onRetry: t, testId
|
|
|
2819
2841
|
getServerSnapshot: () => t,
|
|
2820
2842
|
subscribe: o.subscribe,
|
|
2821
2843
|
advance: (l) => {
|
|
2822
|
-
const { changes: i, settings: d } = r(), g =
|
|
2823
|
-
return n = { changes: g, settings: ft(t, g) }, o.emit(),
|
|
2844
|
+
const { changes: i, settings: d } = r(), g = Pn(i, l, Fn(d, l)[l], t);
|
|
2845
|
+
return n = { changes: g, settings: ft(t, g) }, o.emit(), Xt(e, qn(g)), n.settings;
|
|
2824
2846
|
}
|
|
2825
2847
|
};
|
|
2826
|
-
}, Ei = Object.freeze({ status: "refreshed" }), yi = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), xi =
|
|
2827
|
-
const t = /* @__PURE__ */ new Map(), n =
|
|
2848
|
+
}, Ei = Object.freeze({ status: "refreshed" }), yi = Object.freeze({ status: "superseded" }), et = Object.freeze({ status: "deferred" }), xi = fn(et), Rn = 4, ki = Rn - 1, Bt = Object.freeze({ status: "loading" }), Si = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), Ri = (e) => {
|
|
2849
|
+
const t = /* @__PURE__ */ new Map(), n = un(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), d = ye(), g = /* @__PURE__ */ new Set();
|
|
2828
2850
|
let f = 0, u = 0;
|
|
2829
|
-
const
|
|
2830
|
-
let
|
|
2831
|
-
const
|
|
2832
|
-
|
|
2833
|
-
}, T = (v) => o.get(v) ?? 0,
|
|
2834
|
-
let
|
|
2835
|
-
return
|
|
2836
|
-
},
|
|
2837
|
-
v.inFlight.delete(
|
|
2851
|
+
const h = { direct: null, bulk: null }, m = /* @__PURE__ */ new Set();
|
|
2852
|
+
let S = !1, A = 0;
|
|
2853
|
+
const x = () => {
|
|
2854
|
+
A += 1, d.emit();
|
|
2855
|
+
}, T = (v) => o.get(v) ?? 0, M = (v) => {
|
|
2856
|
+
let b = i.get(v);
|
|
2857
|
+
return b === void 0 && (b = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, i.set(v, b)), b;
|
|
2858
|
+
}, C = (v, b, y) => {
|
|
2859
|
+
v.inFlight.delete(b), f -= 1, y.lane === "bulk" && (u -= 1);
|
|
2838
2860
|
}, s = (v) => {
|
|
2839
|
-
const
|
|
2840
|
-
if (
|
|
2841
|
-
for (const [
|
|
2842
|
-
|
|
2843
|
-
|
|
2861
|
+
const b = i.get(v);
|
|
2862
|
+
if (b !== void 0) {
|
|
2863
|
+
for (const [y, R] of [...b.inFlight])
|
|
2864
|
+
C(b, y, R), R.controller.abort();
|
|
2865
|
+
b.direct.clear(), b.bulk.clear(), b.unclaimed.clear();
|
|
2844
2866
|
}
|
|
2845
2867
|
}, c = (v) => {
|
|
2846
|
-
const
|
|
2847
|
-
return o.set(v,
|
|
2848
|
-
},
|
|
2849
|
-
const
|
|
2850
|
-
return v.status === "pending" && v.then((
|
|
2851
|
-
|
|
2852
|
-
}),
|
|
2868
|
+
const b = T(v) + 1;
|
|
2869
|
+
return o.set(v, b), s(v), b;
|
|
2870
|
+
}, p = (v, b) => {
|
|
2871
|
+
const y = Se(v), R = { promise: v, opened: b, stale: !1, loadedAt: y?.status === "ok" ? y.loadedAt : null };
|
|
2872
|
+
return v.status === "pending" && v.then(($) => {
|
|
2873
|
+
$.status === "ok" && (R.loadedAt = $.loadedAt);
|
|
2874
|
+
}), R;
|
|
2853
2875
|
}, w = (v) => {
|
|
2854
|
-
let
|
|
2855
|
-
return
|
|
2876
|
+
let b = r.get(v);
|
|
2877
|
+
return b === void 0 && (b = /* @__PURE__ */ new Map(), r.set(v, b)), b;
|
|
2856
2878
|
}, k = (v) => {
|
|
2857
|
-
const
|
|
2858
|
-
for (let
|
|
2859
|
-
const
|
|
2860
|
-
if (!(
|
|
2861
|
-
for (const
|
|
2862
|
-
if ((Z.claims.get(
|
|
2863
|
-
return Z[v].delete(
|
|
2879
|
+
const b = [...i.keys()], y = h[v], R = y === null ? 0 : b.indexOf(y) + 1;
|
|
2880
|
+
for (let $ = 0; $ < b.length; $ += 1) {
|
|
2881
|
+
const B = b[(R + $) % b.length], Z = B === void 0 ? void 0 : i.get(B);
|
|
2882
|
+
if (!(B === void 0 || Z === void 0)) {
|
|
2883
|
+
for (const j of Z[v])
|
|
2884
|
+
if ((Z.claims.get(j) ?? 0) !== 0)
|
|
2885
|
+
return Z[v].delete(j), h[v] = B, { sourceId: B, path: j };
|
|
2864
2886
|
}
|
|
2865
2887
|
}
|
|
2866
2888
|
return null;
|
|
2867
|
-
}, L = (v,
|
|
2868
|
-
const
|
|
2869
|
-
if (
|
|
2870
|
-
|
|
2871
|
-
const
|
|
2872
|
-
if (
|
|
2873
|
-
const
|
|
2874
|
-
for (const le of [...g]) le(
|
|
2889
|
+
}, L = (v, b, y, R) => {
|
|
2890
|
+
const $ = i.get(v);
|
|
2891
|
+
if ($ === void 0 || $.inFlight.get(b) !== y) return;
|
|
2892
|
+
C($, b, y);
|
|
2893
|
+
const B = ($.claims.get(b) ?? 0) > 0, Z = w(v);
|
|
2894
|
+
if (R.status === "ok" ? Z.set(b, { status: "loaded", entries: R.entries }) : R.status === "error" && B ? Z.set(b, { status: "failed", failure: R.failure }) : Z.delete(b), x(), R.status === "error" && B) {
|
|
2895
|
+
const j = { sourceId: v, path: b, failure: R.failure };
|
|
2896
|
+
for (const le of [...g]) le(j);
|
|
2875
2897
|
}
|
|
2876
2898
|
N();
|
|
2877
|
-
},
|
|
2878
|
-
const
|
|
2879
|
-
|
|
2880
|
-
(
|
|
2881
|
-
() => L(v,
|
|
2899
|
+
}, O = (v, b, y) => {
|
|
2900
|
+
const R = { controller: new AbortController(), lane: y };
|
|
2901
|
+
M(v).inFlight.set(b, R), f += 1, y === "bulk" && (u += 1), e.children(v, b, R.controller.signal).then(
|
|
2902
|
+
($) => L(v, b, R, $),
|
|
2903
|
+
() => L(v, b, R, Si)
|
|
2882
2904
|
);
|
|
2883
2905
|
}, N = () => {
|
|
2884
|
-
for (; f <
|
|
2906
|
+
for (; f < Rn; ) {
|
|
2885
2907
|
const v = k("direct");
|
|
2886
2908
|
if (v !== null) {
|
|
2887
|
-
|
|
2909
|
+
O(v.sourceId, v.path, "direct");
|
|
2888
2910
|
continue;
|
|
2889
2911
|
}
|
|
2890
|
-
const
|
|
2891
|
-
if (
|
|
2892
|
-
|
|
2912
|
+
const b = u < ki ? k("bulk") : null;
|
|
2913
|
+
if (b === null) return;
|
|
2914
|
+
O(b.sourceId, b.path, "bulk");
|
|
2893
2915
|
}
|
|
2894
|
-
}, q = (v,
|
|
2895
|
-
if (!(
|
|
2896
|
-
const
|
|
2897
|
-
if (
|
|
2898
|
-
|
|
2916
|
+
}, q = (v, b, y) => {
|
|
2917
|
+
if (!(b.direct.delete(y) || b.bulk.delete(y))) {
|
|
2918
|
+
const $ = b.inFlight.get(y);
|
|
2919
|
+
if ($ === void 0) return !1;
|
|
2920
|
+
C(b, y, $), $.controller.abort();
|
|
2899
2921
|
}
|
|
2900
|
-
return r.get(v)?.delete(
|
|
2901
|
-
},
|
|
2902
|
-
|
|
2922
|
+
return r.get(v)?.delete(y), !0;
|
|
2923
|
+
}, G = () => {
|
|
2924
|
+
S = !1;
|
|
2903
2925
|
let v = !1;
|
|
2904
|
-
for (const
|
|
2905
|
-
const
|
|
2906
|
-
for (const
|
|
2907
|
-
(
|
|
2908
|
-
|
|
2926
|
+
for (const b of m) {
|
|
2927
|
+
const y = M(b);
|
|
2928
|
+
for (const R of y.unclaimed)
|
|
2929
|
+
(y.claims.get(R) ?? 0) === 0 && q(b, y, R) && (v = !0);
|
|
2930
|
+
y.unclaimed.clear();
|
|
2909
2931
|
}
|
|
2910
|
-
m.clear(), v && (
|
|
2911
|
-
},
|
|
2912
|
-
t.set(v,
|
|
2913
|
-
},
|
|
2932
|
+
m.clear(), v && (x(), N());
|
|
2933
|
+
}, W = (v, b) => {
|
|
2934
|
+
t.set(v, p(be(e.tree(v)), b));
|
|
2935
|
+
}, Q = (v, b, y) => {
|
|
2914
2936
|
c(v);
|
|
2915
|
-
const
|
|
2916
|
-
return t.set(v,
|
|
2917
|
-
},
|
|
2918
|
-
if (
|
|
2919
|
-
const
|
|
2920
|
-
if (!(
|
|
2921
|
-
if (Me(
|
|
2922
|
-
|
|
2937
|
+
const R = p(fn(b), y);
|
|
2938
|
+
return t.set(v, R), r.delete(v), x(), N(), R;
|
|
2939
|
+
}, K = (v, b, y, R) => {
|
|
2940
|
+
if (y !== T(v) || t.get(v) !== b) return;
|
|
2941
|
+
const $ = Se(b.promise);
|
|
2942
|
+
if (!(R.status !== "ok" || $?.status !== "ok" || b.loadedAt === null || R.loadedAt <= b.loadedAt)) {
|
|
2943
|
+
if (Me($.entries, R.entries)) {
|
|
2944
|
+
b.loadedAt = R.loadedAt;
|
|
2923
2945
|
return;
|
|
2924
2946
|
}
|
|
2925
|
-
|
|
2947
|
+
Q(v, R, b.opened);
|
|
2926
2948
|
}
|
|
2927
|
-
},
|
|
2928
|
-
const
|
|
2929
|
-
return
|
|
2930
|
-
},
|
|
2931
|
-
|
|
2932
|
-
const
|
|
2933
|
-
e.tree(v).then((
|
|
2949
|
+
}, Y = (v, b) => {
|
|
2950
|
+
const y = t.get(v);
|
|
2951
|
+
return y !== void 0 && Se(y.promise)?.status === b;
|
|
2952
|
+
}, oe = (v, b) => {
|
|
2953
|
+
b.stale = !1;
|
|
2954
|
+
const y = T(v);
|
|
2955
|
+
e.tree(v).then((R) => K(v, b, y, R));
|
|
2934
2956
|
};
|
|
2935
2957
|
return {
|
|
2936
2958
|
read: (v) => t.get(v)?.promise ?? xi,
|
|
2937
2959
|
open: (v) => {
|
|
2938
|
-
const
|
|
2939
|
-
return
|
|
2960
|
+
const b = n.resumes(v), y = n.hold(v), R = t.get(v);
|
|
2961
|
+
return R === void 0 || Y(v, "deferred") ? (W(v, !0), x()) : b || (R.opened && Y(v, "error") ? (W(v, !0), x()) : (R.opened = !0, R.stale && Y(v, "ok") && oe(v, R))), y;
|
|
2940
2962
|
},
|
|
2941
2963
|
retry: (v) => {
|
|
2942
|
-
|
|
2964
|
+
Y(v, "error") && (W(v, !0), x());
|
|
2943
2965
|
},
|
|
2944
|
-
seed: (v,
|
|
2945
|
-
const
|
|
2946
|
-
(
|
|
2966
|
+
seed: (v, b) => {
|
|
2967
|
+
const y = b.then(
|
|
2968
|
+
(B) => B === null ? et : B,
|
|
2947
2969
|
() => et
|
|
2948
|
-
),
|
|
2949
|
-
if (
|
|
2950
|
-
const
|
|
2951
|
-
|
|
2970
|
+
), R = t.get(v);
|
|
2971
|
+
if (R !== void 0 && Y(v, "ok")) {
|
|
2972
|
+
const B = T(v);
|
|
2973
|
+
y.then((Z) => K(v, R, B, Z));
|
|
2952
2974
|
return;
|
|
2953
2975
|
}
|
|
2954
2976
|
c(v);
|
|
2955
|
-
const
|
|
2956
|
-
t.set(v,
|
|
2957
|
-
t.get(v) ===
|
|
2977
|
+
const $ = p(be(y), R?.opened === !0);
|
|
2978
|
+
t.set(v, $), r.delete(v), N(), y.then((B) => {
|
|
2979
|
+
t.get(v) === $ && (B.status === "deferred" && n.isHeld(v) && W(v, $.opened), x());
|
|
2958
2980
|
});
|
|
2959
2981
|
},
|
|
2960
2982
|
refresh: async (v) => {
|
|
2961
|
-
const
|
|
2962
|
-
l.set(v,
|
|
2963
|
-
const
|
|
2964
|
-
if (l.get(v) !==
|
|
2965
|
-
if (
|
|
2966
|
-
const
|
|
2967
|
-
if (!(
|
|
2968
|
-
const
|
|
2969
|
-
if (
|
|
2983
|
+
const b = (l.get(v) ?? 0) + 1;
|
|
2984
|
+
l.set(v, b);
|
|
2985
|
+
const y = await e.refresh(v);
|
|
2986
|
+
if (l.get(v) !== b) return yi;
|
|
2987
|
+
if (y.status === "error") return { status: "failed", failure: y.failure };
|
|
2988
|
+
const R = t.get(v);
|
|
2989
|
+
if (!(R !== void 0 && R.loadedAt !== null && Y(v, "ok") && R.loadedAt > y.loadedAt)) {
|
|
2990
|
+
const B = Q(v, y, !0);
|
|
2991
|
+
if (R !== void 0 && R.promise.status === "pending") {
|
|
2970
2992
|
const Z = T(v);
|
|
2971
|
-
|
|
2993
|
+
R.promise.then((j) => K(v, B, Z, j));
|
|
2972
2994
|
}
|
|
2973
2995
|
}
|
|
2974
|
-
for (const [
|
|
2975
|
-
|
|
2996
|
+
for (const [B, Z] of t)
|
|
2997
|
+
B !== v && Se(Z.promise)?.status === "ok" && (Z.stale = !0);
|
|
2976
2998
|
return Ei;
|
|
2977
2999
|
},
|
|
2978
|
-
children: (v,
|
|
2979
|
-
claimChildren: (v,
|
|
2980
|
-
const
|
|
2981
|
-
let
|
|
2982
|
-
for (const [
|
|
2983
|
-
|
|
2984
|
-
|
|
3000
|
+
children: (v, b) => r.get(v)?.get(b),
|
|
3001
|
+
claimChildren: (v, b) => {
|
|
3002
|
+
const y = M(v), R = w(v);
|
|
3003
|
+
let $ = !1, B = !1;
|
|
3004
|
+
for (const [j, le] of b)
|
|
3005
|
+
y.claims.set(j, (y.claims.get(j) ?? 0) + 1), R.get(j) === void 0 ? (R.set(j, Bt), y[le].add(j), $ = !0, B = !0) : le === "direct" && y.bulk.delete(j) && (y.direct.add(j), B = !0);
|
|
3006
|
+
$ && x(), B && N();
|
|
2985
3007
|
let Z = !1;
|
|
2986
3008
|
return () => {
|
|
2987
3009
|
if (!Z) {
|
|
2988
3010
|
Z = !0;
|
|
2989
|
-
for (const
|
|
2990
|
-
const le = (
|
|
2991
|
-
le > 0 ?
|
|
3011
|
+
for (const j of b.keys()) {
|
|
3012
|
+
const le = (y.claims.get(j) ?? 0) - 1;
|
|
3013
|
+
le > 0 ? y.claims.set(j, le) : (y.claims.delete(j), y.unclaimed.add(j));
|
|
2992
3014
|
}
|
|
2993
|
-
m.add(v), !
|
|
3015
|
+
m.add(v), !S && (S = !0, queueMicrotask(G));
|
|
2994
3016
|
}
|
|
2995
3017
|
};
|
|
2996
3018
|
},
|
|
2997
|
-
retryChildren: (v,
|
|
2998
|
-
const
|
|
2999
|
-
if (
|
|
3000
|
-
const
|
|
3001
|
-
if ((
|
|
3002
|
-
|
|
3019
|
+
retryChildren: (v, b) => {
|
|
3020
|
+
const y = r.get(v);
|
|
3021
|
+
if (y === void 0 || y.get(b)?.status !== "failed") return;
|
|
3022
|
+
const R = M(v);
|
|
3023
|
+
if ((R.claims.get(b) ?? 0) > 0) {
|
|
3024
|
+
y.set(b, Bt), R.direct.add(b), x(), N();
|
|
3003
3025
|
return;
|
|
3004
3026
|
}
|
|
3005
|
-
|
|
3027
|
+
y.delete(b), x();
|
|
3006
3028
|
},
|
|
3007
3029
|
pendingChildren: (v) => {
|
|
3008
|
-
const
|
|
3009
|
-
return
|
|
3030
|
+
const b = i.get(v);
|
|
3031
|
+
return b === void 0 ? 0 : b.direct.size + b.bulk.size + b.inFlight.size;
|
|
3010
3032
|
},
|
|
3011
3033
|
clear: () => {
|
|
3012
3034
|
for (const v of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...i.keys()])) c(v);
|
|
3013
|
-
for (const [v,
|
|
3014
|
-
t.clear(), r.clear(),
|
|
3035
|
+
for (const [v, b] of l) l.set(v, b + 1);
|
|
3036
|
+
t.clear(), r.clear(), x();
|
|
3015
3037
|
},
|
|
3016
3038
|
subscribeChildrenFailures: (v) => (g.add(v), () => {
|
|
3017
3039
|
g.delete(v);
|
|
3018
3040
|
}),
|
|
3019
3041
|
subscribe: d.subscribe,
|
|
3020
|
-
version: () =>
|
|
3042
|
+
version: () => A
|
|
3021
3043
|
};
|
|
3022
3044
|
}, Ti = (e, t) => {
|
|
3023
3045
|
let n = e;
|
|
@@ -3041,18 +3063,18 @@ const Oi = () => {
|
|
|
3041
3063
|
}, Ai = [
|
|
3042
3064
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
3043
3065
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
3044
|
-
],
|
|
3045
|
-
if (!
|
|
3066
|
+
], It = 1, jt = (e) => e.getClientRects().length > 0, Ke = "Give the explorer's container a definite block size (for example height: 100dvh, or a flex column of definite height whose item has flex: 1 and min-height: 0; in a fresh React Router app also html and body at height: 100%) instead of an auto or only a minimum height.", Li = (e) => {
|
|
3067
|
+
if (!jt(e)) return null;
|
|
3046
3068
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
3047
3069
|
if (t.bottom > n + Ci)
|
|
3048
3070
|
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}`;
|
|
3049
|
-
if (t.height <
|
|
3071
|
+
if (t.height < It)
|
|
3050
3072
|
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}`;
|
|
3051
3073
|
for (const { selector: r, name: o } of Ai)
|
|
3052
3074
|
for (const l of e.querySelectorAll(r)) {
|
|
3053
|
-
if (!
|
|
3075
|
+
if (!jt(l)) continue;
|
|
3054
3076
|
const i = l.getBoundingClientRect().height;
|
|
3055
|
-
if (i <
|
|
3077
|
+
if (i < It)
|
|
3056
3078
|
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(i))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ke}`;
|
|
3057
3079
|
}
|
|
3058
3080
|
return null;
|
|
@@ -3067,13 +3089,13 @@ const Oi = () => {
|
|
|
3067
3089
|
r?.disconnect(), window.removeEventListener("resize", n);
|
|
3068
3090
|
};
|
|
3069
3091
|
}, Ni = (e, t) => {
|
|
3070
|
-
|
|
3092
|
+
te(() => e ? Oi() : void 0, [e]), te(() => {
|
|
3071
3093
|
const n = t.current;
|
|
3072
3094
|
if (!(!e || n === null))
|
|
3073
3095
|
return Mi(n);
|
|
3074
3096
|
}, [e, t]);
|
|
3075
|
-
},
|
|
3076
|
-
{ control:
|
|
3097
|
+
}, Ht = '[data-testid="markdown-explorer-view-switch"]', Di = [
|
|
3098
|
+
{ control: Ht, successors: [Ht, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
3077
3099
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
3078
3100
|
], $i = (e) => {
|
|
3079
3101
|
for (const t of Di) {
|
|
@@ -3082,8 +3104,8 @@ const Oi = () => {
|
|
|
3082
3104
|
}
|
|
3083
3105
|
return null;
|
|
3084
3106
|
}, Pi = (e, t) => {
|
|
3085
|
-
const n =
|
|
3086
|
-
|
|
3107
|
+
const n = _(null);
|
|
3108
|
+
te(() => {
|
|
3087
3109
|
const o = (d) => {
|
|
3088
3110
|
const g = e.current;
|
|
3089
3111
|
n.current = g !== null && d instanceof Element && g.contains(d) ? $i(d) : null;
|
|
@@ -3099,8 +3121,8 @@ const Oi = () => {
|
|
|
3099
3121
|
document.removeEventListener("focusin", l), document.removeEventListener("focusout", i);
|
|
3100
3122
|
};
|
|
3101
3123
|
}, [e]);
|
|
3102
|
-
const r =
|
|
3103
|
-
|
|
3124
|
+
const r = _(t);
|
|
3125
|
+
U(() => {
|
|
3104
3126
|
if (r.current === t) return;
|
|
3105
3127
|
r.current = t;
|
|
3106
3128
|
const o = n.current;
|
|
@@ -3111,8 +3133,8 @@ const Oi = () => {
|
|
|
3111
3133
|
const f = e.current;
|
|
3112
3134
|
if (f === null) return !0;
|
|
3113
3135
|
for (const u of o.control.successors)
|
|
3114
|
-
for (const
|
|
3115
|
-
if (
|
|
3136
|
+
for (const h of f.querySelectorAll(u))
|
|
3137
|
+
if (h !== o.element && (h.focus({ preventScroll: !0 }), document.activeElement === h))
|
|
3116
3138
|
return !0;
|
|
3117
3139
|
return !1;
|
|
3118
3140
|
};
|
|
@@ -3124,175 +3146,213 @@ const Oi = () => {
|
|
|
3124
3146
|
});
|
|
3125
3147
|
return d.observe(i, { childList: !0, subtree: !0 }), () => d.disconnect();
|
|
3126
3148
|
}, [t, e]);
|
|
3127
|
-
}, Fi = tt(() => import("./TreeLayout-
|
|
3149
|
+
}, Fi = tt(() => import("./TreeLayout-CJO9tOPq.js").then((e) => ({ default: e.TreeLayout }))), qi = tt(() => import("./MultiLayout-DtSW4rEQ.js").then((e) => ({ default: e.MultiLayout }))), _i = 64, Bi = {
|
|
3128
3150
|
request: (e) => {
|
|
3129
3151
|
requestAnimationFrame(e);
|
|
3130
3152
|
}
|
|
3131
|
-
},
|
|
3153
|
+
}, zt = (e) => {
|
|
3132
3154
|
e.documents.clear(), e.trees.clear();
|
|
3133
3155
|
}, We = (e, t) => {
|
|
3134
3156
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
3135
3157
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
3136
3158
|
}, Ii = (e, t) => {
|
|
3137
3159
|
const [n, r] = I(() => ({ overrides: t, locale: e, labels: Et(e, t) }));
|
|
3138
|
-
if (n.locale === e &&
|
|
3160
|
+
if (n.locale === e && vr(n.overrides, t)) return n.labels;
|
|
3139
3161
|
const o = { overrides: t, locale: e, labels: Et(e, t) };
|
|
3140
3162
|
return r(o), o.labels;
|
|
3141
3163
|
}, ji = (e, t, n) => {
|
|
3142
|
-
const [r, o] = I(() => ({ scope: t, store:
|
|
3164
|
+
const [r, o] = I(() => ({ scope: t, store: _t(e, n) }));
|
|
3143
3165
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
3144
|
-
const l = { scope: t, store:
|
|
3166
|
+
const l = { scope: t, store: _t(e, n) };
|
|
3145
3167
|
return o(l), l.store;
|
|
3146
3168
|
}, Xe = (e, t) => {
|
|
3147
3169
|
const [n, r] = I(() => ({ scope: e, value: t() }));
|
|
3148
3170
|
if (n.scope === e) return n.value;
|
|
3149
3171
|
const o = { scope: e, value: t() };
|
|
3150
3172
|
return r(o), o.value;
|
|
3151
|
-
}, Hi = () => pi(Bi),
|
|
3173
|
+
}, Hi = () => pi(Bi), Ut = "on", zi = "off", Ui = Object.freeze({ kind: "unavailable" }), Zi = (e) => {
|
|
3174
|
+
if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
|
|
3175
|
+
throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
|
|
3176
|
+
}, Vi = (e, t) => {
|
|
3152
3177
|
const n = de(e.peek(t));
|
|
3153
3178
|
return n === null || n.document.kind === "failure" ? Ee(t) : n.document.name;
|
|
3154
|
-
},
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3179
|
+
}, is = ({
|
|
3180
|
+
data: e,
|
|
3181
|
+
config: t,
|
|
3182
|
+
storageNamespace: n,
|
|
3183
|
+
locale: r,
|
|
3184
|
+
labels: o,
|
|
3185
|
+
theme: l,
|
|
3186
|
+
renderFrame: i,
|
|
3187
|
+
renderTreeFailure: d,
|
|
3188
|
+
lockDocumentScroll: g = !1,
|
|
3189
|
+
onMathDiagnostics: f,
|
|
3190
|
+
onEditGrant: u,
|
|
3191
|
+
draftConverter: h
|
|
3192
|
+
}) => {
|
|
3193
|
+
ar(n), Zi(h);
|
|
3194
|
+
const m = en(r), S = wr(l), A = Ii(m, o), { revalidate: x } = Nn(), T = _(() => {
|
|
3195
|
+
}), M = De(t.dataPath), [C] = I(() => {
|
|
3196
|
+
const y = vi({ dataPath: M, onScope: ($) => T.current($) }), R = { documents: lo({ client: y, capacity: Math.max(_i, t.multiView.maxPanels * 2) }), trees: Ri(y) };
|
|
3197
|
+
return We(R, e), wt(n, e.scope), { data: y, ...R, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
3160
3198
|
});
|
|
3161
|
-
if (
|
|
3162
|
-
const
|
|
3163
|
-
|
|
3199
|
+
if (C.aligned.pageData !== e || C.aligned.storageNamespace !== n) {
|
|
3200
|
+
const y = C.aligned.pageData;
|
|
3201
|
+
C.aligned.pageData = e, C.aligned.storageNamespace = n, y !== e && (y.scope !== e.scope ? C.aligned.pendingReader = e : We(C, e)), wt(n, e.scope);
|
|
3164
3202
|
}
|
|
3165
|
-
const
|
|
3166
|
-
|
|
3167
|
-
const
|
|
3168
|
-
|
|
3169
|
-
}, [e,
|
|
3170
|
-
let
|
|
3171
|
-
return
|
|
3172
|
-
|
|
3203
|
+
const s = ji(ze(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
3204
|
+
U(() => {
|
|
3205
|
+
const y = C.aligned.pendingReader;
|
|
3206
|
+
y !== null && (C.aligned.pendingReader = null, zt(C), We(C, y));
|
|
3207
|
+
}, [e, C]), U(() => {
|
|
3208
|
+
let y = !1;
|
|
3209
|
+
return T.current = (R) => {
|
|
3210
|
+
R === e.scope || y || (y = !0, R !== null && (zt(C), cr(n)), x());
|
|
3173
3211
|
}, () => {
|
|
3174
|
-
|
|
3212
|
+
T.current = () => {
|
|
3175
3213
|
};
|
|
3176
3214
|
};
|
|
3177
|
-
}, [e,
|
|
3178
|
-
const
|
|
3179
|
-
|
|
3180
|
-
|
|
3215
|
+
}, [e, x, C, n]);
|
|
3216
|
+
const c = _(t.settingsCookie);
|
|
3217
|
+
U(() => {
|
|
3218
|
+
c.current = t.settingsCookie;
|
|
3181
3219
|
}, [t.settingsCookie]);
|
|
3182
|
-
const [
|
|
3183
|
-
() => Ti(e.settings, (
|
|
3184
|
-
document.cookie =
|
|
3220
|
+
const [p] = I(
|
|
3221
|
+
() => Ti(e.settings, (y) => {
|
|
3222
|
+
document.cookie = In(c.current, y, window.location.protocol === "https:");
|
|
3185
3223
|
})
|
|
3186
|
-
),
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
}, [
|
|
3190
|
-
const
|
|
3224
|
+
), w = Xe(e.scope, Hi), k = Xe(e.scope, wi), L = _(A);
|
|
3225
|
+
U(() => {
|
|
3226
|
+
L.current = A;
|
|
3227
|
+
}, [A]);
|
|
3228
|
+
const O = Xe(
|
|
3191
3229
|
e.scope,
|
|
3192
|
-
() =>
|
|
3193
|
-
data:
|
|
3194
|
-
conflictLabels: () => ({ ours:
|
|
3195
|
-
onSaveSettled: (
|
|
3196
|
-
|
|
3197
|
-
const
|
|
3198
|
-
|
|
3230
|
+
() => Cr({
|
|
3231
|
+
data: C.data,
|
|
3232
|
+
conflictLabels: () => ({ ours: L.current.conflictOurs, theirs: L.current.conflictTheirs }),
|
|
3233
|
+
onSaveSettled: (y, R) => {
|
|
3234
|
+
R.kind === "saved" && C.documents.refresh(y);
|
|
3235
|
+
const $ = Er(L.current, R, Vi(C.documents, y));
|
|
3236
|
+
$ !== null && w.announce($);
|
|
3199
3237
|
},
|
|
3200
3238
|
previewSetting: {
|
|
3201
|
-
read: () =>
|
|
3202
|
-
write: (
|
|
3239
|
+
read: () => Yt(ze(n).editPreview) === Ut,
|
|
3240
|
+
write: (y) => Xt(ze(n).editPreview, y ? Ut : zi)
|
|
3203
3241
|
}
|
|
3204
3242
|
})
|
|
3205
|
-
),
|
|
3206
|
-
`),
|
|
3207
|
-
`)), [t,
|
|
3208
|
-
|
|
3243
|
+
), N = z(() => be(e.notices.catch(() => [])), [e.notices]), q = e.sources.map((y) => y.id).join(`
|
|
3244
|
+
`), G = z(() => Bn(t, q.split(`
|
|
3245
|
+
`)), [t, q]), W = _(f);
|
|
3246
|
+
U(() => {
|
|
3209
3247
|
W.current = f;
|
|
3210
3248
|
}, [f]);
|
|
3211
|
-
const [
|
|
3212
|
-
W.current?.(
|
|
3213
|
-
}),
|
|
3249
|
+
const [Q] = I(() => (y, R) => {
|
|
3250
|
+
W.current?.(y, R);
|
|
3251
|
+
}), K = f === void 0 ? void 0 : Q, Y = _(h);
|
|
3252
|
+
U(() => {
|
|
3253
|
+
Y.current = h;
|
|
3254
|
+
}, [h]);
|
|
3255
|
+
const [oe] = I(() => {
|
|
3256
|
+
let y = !1;
|
|
3257
|
+
return {
|
|
3258
|
+
convert: (R, $) => {
|
|
3259
|
+
const B = Y.current;
|
|
3260
|
+
return B === void 0 ? Promise.resolve(Ui) : B.convert(R, $);
|
|
3261
|
+
},
|
|
3262
|
+
prepare: () => {
|
|
3263
|
+
try {
|
|
3264
|
+
Y.current?.prepare?.();
|
|
3265
|
+
} catch (R) {
|
|
3266
|
+
if (y) return;
|
|
3267
|
+
y = !0, console.error("[markdown-explorer] the draft converter's prepare threw", R);
|
|
3268
|
+
}
|
|
3269
|
+
}
|
|
3270
|
+
};
|
|
3271
|
+
}), v = h === void 0 ? void 0 : oe, b = z(
|
|
3214
3272
|
() => ({
|
|
3215
|
-
config:
|
|
3216
|
-
labels:
|
|
3217
|
-
locale:
|
|
3218
|
-
theme:
|
|
3273
|
+
config: G,
|
|
3274
|
+
labels: A,
|
|
3275
|
+
locale: m,
|
|
3276
|
+
theme: S,
|
|
3219
3277
|
storageNamespace: n,
|
|
3220
3278
|
scope: e.scope,
|
|
3221
3279
|
sources: e.sources,
|
|
3222
|
-
notices:
|
|
3223
|
-
documents:
|
|
3224
|
-
trees:
|
|
3225
|
-
data:
|
|
3226
|
-
viewSettings:
|
|
3227
|
-
treeSettings:
|
|
3228
|
-
announcer:
|
|
3229
|
-
reveals:
|
|
3230
|
-
edits:
|
|
3280
|
+
notices: N,
|
|
3281
|
+
documents: C.documents,
|
|
3282
|
+
trees: C.trees,
|
|
3283
|
+
data: C.data,
|
|
3284
|
+
viewSettings: p,
|
|
3285
|
+
treeSettings: s,
|
|
3286
|
+
announcer: w,
|
|
3287
|
+
reveals: k,
|
|
3288
|
+
edits: O,
|
|
3231
3289
|
onEditGrant: u,
|
|
3290
|
+
draftConverter: v,
|
|
3232
3291
|
renderTreeFailure: d,
|
|
3233
|
-
reportMathDiagnostics:
|
|
3292
|
+
reportMathDiagnostics: K
|
|
3234
3293
|
}),
|
|
3235
|
-
[
|
|
3294
|
+
[G, A, m, S, n, e.scope, e.sources, N, C, p, s, w, k, O, u, v, d, K]
|
|
3236
3295
|
);
|
|
3237
|
-
return /* @__PURE__ */ a(
|
|
3238
|
-
},
|
|
3296
|
+
return /* @__PURE__ */ a(tn, { value: b, children: /* @__PURE__ */ a(Ki, { renderFrame: i, lockDocumentScroll: g }, e.scope) });
|
|
3297
|
+
}, Gi = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
3239
3298
|
const [o] = I(Uo);
|
|
3240
3299
|
return /* @__PURE__ */ a("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 });
|
|
3241
|
-
},
|
|
3242
|
-
const { theme: n, labels: r } = D(), o = nt(), { hash: l } =
|
|
3243
|
-
Ni(t, d),
|
|
3300
|
+
}, Ki = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
3301
|
+
const { theme: n, labels: r } = D(), o = nt(), { hash: l } = Vt(), i = $e(), d = _(null);
|
|
3302
|
+
Ni(t, d), U(() => {
|
|
3244
3303
|
o.kind === "redirect" && i(`${o.href}${l}`, "browse");
|
|
3245
3304
|
}, [o, l, i]);
|
|
3246
3305
|
const { location: g } = o, f = g.view;
|
|
3247
3306
|
Pi(d, f);
|
|
3248
|
-
const u = g.view === "tree" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ a(Fi, { location: g }) }) : g.view === "multi" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ a(qi, { location: g }) }) : /* @__PURE__ */ a(mi, { location: g }),
|
|
3307
|
+
const u = g.view === "tree" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ a(Fi, { location: g }) }) : g.view === "multi" ? /* @__PURE__ */ a(ge, { fallback: /* @__PURE__ */ a("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ a(qi, { location: g }) }) : /* @__PURE__ */ a(mi, { location: g }), h = /* @__PURE__ */ F(Gi, { ref: d, theme: n, view: f, children: [
|
|
3249
3308
|
u,
|
|
3250
|
-
/* @__PURE__ */ a(
|
|
3309
|
+
/* @__PURE__ */ a(Dr, {}),
|
|
3251
3310
|
/* @__PURE__ */ a(hi, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
3252
3311
|
] });
|
|
3253
|
-
return e === void 0 ?
|
|
3254
|
-
},
|
|
3312
|
+
return e === void 0 ? h : e({ view: f, children: h });
|
|
3313
|
+
}, ss = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
|
|
3255
3314
|
export {
|
|
3256
3315
|
Qe as A,
|
|
3257
|
-
|
|
3258
|
-
|
|
3316
|
+
dr as B,
|
|
3317
|
+
yr as C,
|
|
3259
3318
|
fi as D,
|
|
3260
3319
|
Ql as E,
|
|
3261
3320
|
ve as F,
|
|
3262
|
-
|
|
3263
|
-
|
|
3321
|
+
yt as G,
|
|
3322
|
+
Qt as H,
|
|
3264
3323
|
Go as I,
|
|
3265
|
-
|
|
3266
|
-
|
|
3324
|
+
ur as J,
|
|
3325
|
+
bt as K,
|
|
3267
3326
|
ro as L,
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3327
|
+
hr as M,
|
|
3328
|
+
is as N,
|
|
3329
|
+
Et as O,
|
|
3271
3330
|
ui as P,
|
|
3331
|
+
ss as Q,
|
|
3272
3332
|
$e as a,
|
|
3273
3333
|
ai as b,
|
|
3274
3334
|
Fl as c,
|
|
3275
|
-
|
|
3276
|
-
|
|
3335
|
+
xr as d,
|
|
3336
|
+
kr as e,
|
|
3277
3337
|
Gr as f,
|
|
3278
|
-
|
|
3338
|
+
Sr as g,
|
|
3279
3339
|
ae as h,
|
|
3280
3340
|
Yr as i,
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3341
|
+
Jr as j,
|
|
3342
|
+
Mr as k,
|
|
3343
|
+
de as l,
|
|
3344
|
+
rn as m,
|
|
3345
|
+
ye as n,
|
|
3346
|
+
ls as o,
|
|
3347
|
+
os as p,
|
|
3348
|
+
cn as q,
|
|
3349
|
+
_l as r,
|
|
3350
|
+
eo as s,
|
|
3351
|
+
Xl as t,
|
|
3292
3352
|
D as u,
|
|
3293
3353
|
Kr as v,
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3354
|
+
Qr as w,
|
|
3355
|
+
nt as x,
|
|
3356
|
+
hi as y,
|
|
3357
|
+
Ae as z
|
|
3298
3358
|
};
|