@aiquants/markdown-explorer 0.4.0 → 0.6.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 +31 -0
- package/README.md +30 -4
- package/dist/ExplorerSplit-CN5TvRj6.js +1495 -0
- package/dist/ExplorerSplit-CUIbSLQm.cjs +1 -0
- package/dist/MultiLayout-BDcQSpa6.cjs +1 -0
- package/dist/{MultiLayout-8s7q3-Hm.js → MultiLayout-hPmV-bae.js} +69 -66
- package/dist/{NativeScrollBar-DqkutcGb.cjs → NativeScrollBar-CHEQgaVx.cjs} +1 -1
- package/dist/{NativeScrollBar-D3VDRQqf.js → NativeScrollBar-DYEv2GLV.js} +1 -1
- package/dist/TreeLayout-BDaIyoGT.cjs +1 -0
- package/dist/TreeLayout-CqzxLpoM.js +23 -0
- package/dist/core/contracts.d.cts +23 -7
- package/dist/core/contracts.d.ts +23 -7
- package/dist/core/labels.d.cts +4 -0
- package/dist/core/labels.d.ts +4 -0
- package/dist/dataRoute-CUXlMhUJ.cjs +1 -0
- package/dist/{dataRoute-Dl6xmEFs.js → dataRoute-Ce6EIuu4.js} +69 -63
- package/dist/index-B3nShkkt.cjs +3 -0
- package/dist/{index-Dv9lUZqD.js → index-gJp1iXTc.js} +1020 -916
- package/dist/index.cjs +1 -1
- package/dist/index.js +3 -3
- package/dist/{location-CaNtUswk.js → location-CtM94G0O.js} +1 -1
- package/dist/{location-2QZADLiv.cjs → location-FavgY_gB.cjs} +1 -1
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +1 -1
- package/dist/server/errors.d.cts +1 -1
- package/dist/server/errors.d.ts +1 -1
- package/dist/server/ports.d.cts +1 -0
- package/dist/server/ports.d.ts +1 -0
- package/dist/server.cjs +1 -1
- package/dist/server.js +753 -716
- package/dist/styles/markdown-explorer.css +1 -1
- package/docs/behavior/dom-hooks.md +6 -3
- package/docs/behavior/layout.md +6 -0
- package/docs/behavior/localization.md +4 -1
- package/docs/behavior/security.md +11 -4
- package/docs/behavior/url-contract.md +1 -0
- package/package.json +4 -3
- package/dist/ExplorerSplit-rUVsf5i-.cjs +0 -1
- package/dist/ExplorerSplit-uX2ojZe8.js +0 -1479
- package/dist/MultiLayout-ZK2V9nms.cjs +0 -1
- package/dist/TreeLayout-C7ZNnaOr.js +0 -22
- package/dist/TreeLayout-DkTVgxxb.cjs +0 -1
- package/dist/dataRoute-DYjYBiXF.cjs +0 -1
- package/dist/index-CLe6vRXs.cjs +0 -3
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as c, jsxs as z, Fragment as wt } from "react/jsx-runtime";
|
|
2
2
|
import * as x from "react";
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { useParams as
|
|
5
|
-
import { f as
|
|
6
|
-
import { HostedScrollArea as
|
|
7
|
-
import { i as
|
|
8
|
-
import { DEFAULT_CONTENT_ALIGN as
|
|
9
|
-
import { w as
|
|
10
|
-
const
|
|
3
|
+
import { createContext as oe, use as J, useMemo as H, useSyncExternalStore as Q, useCallback as C, useRef as j, useEffect as ee, Suspense as we, Component as Vt, lazy as De, useState as Z, useLayoutEffect as G, useEffectEvent as ne, useId as Gt } from "react";
|
|
4
|
+
import { useParams as Wt, useSearchParams as Kt, useNavigate as Yt, Link as Xt, useHref as Se, useLocation as vt, useRevalidator as Jt } from "react-router";
|
|
5
|
+
import { f as Qt, a as en, u as tn, G as ue, e as le, x as nn, y as rn, z as Ze, B as on, D as Ue, H as ln, w as sn, I as an } from "./location-CtM94G0O.js";
|
|
6
|
+
import { HostedScrollArea as Ve, useMarkdownToolbarState as cn, MarkdownViewer as bt } from "@aiquants/markdown";
|
|
7
|
+
import { i as dn, v as Et, s as X, q as un, w as Ge, t as We, x as mn, y as fn, z as pn, A as hn, B as gn, f as wn, C as Ke, p as vn, F as bn, o as En } from "./dataRoute-Ce6EIuu4.js";
|
|
8
|
+
import { DEFAULT_CONTENT_ALIGN as Sn } from "@aiquants/markdown/viewer-settings";
|
|
9
|
+
import { w as kn, r as xn, a as yn, b as Ye, s as Rn, c as Tn } from "./storage-DA4ItHzl.js";
|
|
10
|
+
const Xe = Object.freeze(["en", "ja"]), An = "en", Ln = Object.freeze({
|
|
11
11
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
12
12
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
13
13
|
panelDragStarted: Object.freeze(["title"]),
|
|
14
14
|
panelDragCancelled: Object.freeze(["title"]),
|
|
15
15
|
multiColumnRegion: Object.freeze(["column"])
|
|
16
|
-
}),
|
|
16
|
+
}), On = /\{(\w+)\}/gu, St = {
|
|
17
17
|
explorerRegion: "Explorer",
|
|
18
18
|
sourceLabel: "Source",
|
|
19
19
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -25,6 +25,9 @@ const We = Object.freeze(["en", "ja"]), En = "en", Sn = Object.freeze({
|
|
|
25
25
|
refreshDocumentNamed: (e) => `Refresh ${e}`,
|
|
26
26
|
documentRefreshed: (e) => `Reloaded ${e}`,
|
|
27
27
|
documentRefreshFailed: (e) => `Could not reload the document: ${e}`,
|
|
28
|
+
showMarkupLabel: "Source",
|
|
29
|
+
showMarkup: "Show the document's Markdown as written",
|
|
30
|
+
showMarkupNamed: (e) => `Source of ${e}`,
|
|
28
31
|
expandAll: "Expand all folders",
|
|
29
32
|
collapseAll: "Collapse all folders",
|
|
30
33
|
treeSettings: "Tree settings",
|
|
@@ -89,6 +92,7 @@ const We = Object.freeze(["en", "ja"]), En = "en", Sn = Object.freeze({
|
|
|
89
92
|
documentRegion: "Document",
|
|
90
93
|
documentEmpty: "Select a document in the explorer.",
|
|
91
94
|
documentLoading: "Loading the document…",
|
|
95
|
+
markupLoading: "Loading the source…",
|
|
92
96
|
documentShown: (e) => `Showing ${e}`,
|
|
93
97
|
documentFailed: (e, t) => `${e}: ${t}`,
|
|
94
98
|
announcementSequence: (e) => e.map((t) => /[.!?]$/u.test(t) ? t : `${t}.`).join(" "),
|
|
@@ -185,7 +189,7 @@ const We = Object.freeze(["en", "ja"]), En = "en", Sn = Object.freeze({
|
|
|
185
189
|
multiColumnEmpty: "This column is empty",
|
|
186
190
|
multiColumnRegion: "Column {column}",
|
|
187
191
|
panelDropHere: "Drop the panel here"
|
|
188
|
-
},
|
|
192
|
+
}, Mn = {
|
|
189
193
|
explorerRegion: "エクスプローラー",
|
|
190
194
|
sourceLabel: "ソース",
|
|
191
195
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -197,6 +201,9 @@ const We = Object.freeze(["en", "ja"]), En = "en", Sn = Object.freeze({
|
|
|
197
201
|
refreshDocumentNamed: (e) => `${e} を更新`,
|
|
198
202
|
documentRefreshed: (e) => `${e} を読み込み直しました`,
|
|
199
203
|
documentRefreshFailed: (e) => `文書を読み込み直せませんでした: ${e}`,
|
|
204
|
+
showMarkupLabel: "ソース",
|
|
205
|
+
showMarkup: "文書の Markdown を書いたまま表示",
|
|
206
|
+
showMarkupNamed: (e) => `${e} のソース`,
|
|
200
207
|
expandAll: "すべてのフォルダーを展開",
|
|
201
208
|
collapseAll: "すべてのフォルダーを折りたたむ",
|
|
202
209
|
treeSettings: "ツリーの設定",
|
|
@@ -261,6 +268,7 @@ const We = Object.freeze(["en", "ja"]), En = "en", Sn = Object.freeze({
|
|
|
261
268
|
documentRegion: "文書",
|
|
262
269
|
documentEmpty: "エクスプローラーで文書を選んでください。",
|
|
263
270
|
documentLoading: "文書を読み込み中…",
|
|
271
|
+
markupLoading: "ソースを読み込み中…",
|
|
264
272
|
documentShown: (e) => `${e} を表示しています`,
|
|
265
273
|
documentFailed: (e, t) => `${e}: ${t}`,
|
|
266
274
|
announcementSequence: (e) => e.map((t) => /[。!?]$/u.test(t) ? t : `${t}。`).join(""),
|
|
@@ -357,61 +365,61 @@ const We = Object.freeze(["en", "ja"]), En = "en", Sn = Object.freeze({
|
|
|
357
365
|
multiColumnEmpty: "この列は空です",
|
|
358
366
|
multiColumnRegion: "{column} 列目",
|
|
359
367
|
panelDropHere: "ここへパネルをドロップ"
|
|
360
|
-
},
|
|
361
|
-
en: Object.freeze(
|
|
362
|
-
ja: Object.freeze(
|
|
363
|
-
}),
|
|
364
|
-
if (e === void 0) return
|
|
365
|
-
if (
|
|
366
|
-
throw new RangeError(`[markdown-explorer] locale is the UI language (${
|
|
367
|
-
},
|
|
368
|
-
const n =
|
|
368
|
+
}, Cn = Object.freeze({
|
|
369
|
+
en: Object.freeze(St),
|
|
370
|
+
ja: Object.freeze(Mn)
|
|
371
|
+
}), kt = Object.freeze(Object.keys(St)), Nn = new Set(kt), Pn = (e) => Nn.has(e), he = (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, xt = (e) => {
|
|
372
|
+
if (e === void 0) return An;
|
|
373
|
+
if (Xe.includes(e)) return e;
|
|
374
|
+
throw new RangeError(`[markdown-explorer] locale is the UI language (${Xe.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${he(e)}`);
|
|
375
|
+
}, Je = (e, t) => {
|
|
376
|
+
const n = Cn[xt(e)];
|
|
369
377
|
if (t === void 0) return n;
|
|
370
378
|
if (t === null || typeof t != "object")
|
|
371
|
-
throw new RangeError(`[markdown-explorer] labels must be an object; got ${
|
|
372
|
-
if (!
|
|
373
|
-
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${
|
|
379
|
+
throw new RangeError(`[markdown-explorer] labels must be an object; got ${he(t)}`);
|
|
380
|
+
if (!Qt(t))
|
|
381
|
+
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${he(t)}`);
|
|
374
382
|
const r = t, o = { ...n };
|
|
375
383
|
for (const l of Object.keys(r)) {
|
|
376
|
-
if (!
|
|
377
|
-
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${
|
|
384
|
+
if (!Pn(l))
|
|
385
|
+
throw new RangeError(`[markdown-explorer] labels.${l} is not a known label key; expected one of ${kt.join(", ")}`);
|
|
378
386
|
const s = r[l];
|
|
379
387
|
if (s === void 0) continue;
|
|
380
|
-
const
|
|
381
|
-
if (typeof s !==
|
|
382
|
-
throw new TypeError(`[markdown-explorer] labels.${l} must be a ${
|
|
388
|
+
const i = typeof n[l];
|
|
389
|
+
if (typeof s !== i)
|
|
390
|
+
throw new TypeError(`[markdown-explorer] labels.${l} must be a ${i}; got ${he(s)}`);
|
|
383
391
|
if (typeof s == "string" && s.trim() === "")
|
|
384
392
|
throw new RangeError(`[markdown-explorer] labels.${l} must be a non-blank string`);
|
|
385
|
-
const
|
|
386
|
-
if (typeof s == "string" &&
|
|
387
|
-
for (const [,
|
|
388
|
-
if (!
|
|
389
|
-
throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(
|
|
393
|
+
const d = Ln[l];
|
|
394
|
+
if (typeof s == "string" && d !== void 0) {
|
|
395
|
+
for (const [, u] of s.matchAll(On))
|
|
396
|
+
if (!d.includes(u ?? ""))
|
|
397
|
+
throw new RangeError(`[markdown-explorer] labels.${l} uses the unknown placeholder {${String(u)}}; it accepts ${d.map((p) => `{${p}}`).join(", ")}`);
|
|
390
398
|
}
|
|
391
399
|
o[l] = s;
|
|
392
400
|
}
|
|
393
401
|
return Object.freeze(o);
|
|
394
|
-
},
|
|
402
|
+
}, $n = (e, t) => {
|
|
395
403
|
if (Object.is(e, t)) return !0;
|
|
396
404
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
397
405
|
const n = e, r = t, o = Object.keys(n), l = Object.keys(r);
|
|
398
406
|
return o.length === l.length && l.every((s) => Object.hasOwn(n, s) && Object.is(n[s], r[s]));
|
|
399
|
-
},
|
|
407
|
+
}, Qe = Object.freeze(["light", "dark"]), Fn = (e) => {
|
|
400
408
|
if (e === void 0) return "light";
|
|
401
|
-
if (
|
|
402
|
-
throw new RangeError(`[markdown-explorer] theme must be ${
|
|
403
|
-
}, yt =
|
|
404
|
-
const e =
|
|
409
|
+
if (Qe.includes(e)) return e;
|
|
410
|
+
throw new RangeError(`[markdown-explorer] theme must be ${Qe.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
411
|
+
}, yt = oe(null), P = () => {
|
|
412
|
+
const e = J(yt);
|
|
405
413
|
if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
|
|
406
414
|
return e;
|
|
407
|
-
},
|
|
408
|
-
const { viewSettings: t } =
|
|
409
|
-
return
|
|
410
|
-
},
|
|
411
|
-
const { config: e } =
|
|
412
|
-
return H(() =>
|
|
415
|
+
}, ve = (e) => {
|
|
416
|
+
const { viewSettings: t } = P(), n = () => e(t.getSnapshot());
|
|
417
|
+
return Q(t.subscribe, n, n);
|
|
418
|
+
}, qe = () => {
|
|
419
|
+
const { config: e } = P(), t = Wt()["*"], [n] = Kt(), r = n.toString();
|
|
420
|
+
return H(() => en(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
413
421
|
};
|
|
414
|
-
function
|
|
422
|
+
function Dn({
|
|
415
423
|
title: e,
|
|
416
424
|
titleId: t,
|
|
417
425
|
...n
|
|
@@ -432,20 +440,20 @@ function Ln({
|
|
|
432
440
|
clipRule: "evenodd"
|
|
433
441
|
}));
|
|
434
442
|
}
|
|
435
|
-
const
|
|
443
|
+
const qn = /* @__PURE__ */ x.forwardRef(Dn), _e = Object.freeze({
|
|
436
444
|
browse: Object.freeze({ replace: !0, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
437
445
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
438
446
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
439
447
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
440
|
-
}),
|
|
441
|
-
const e =
|
|
442
|
-
return
|
|
448
|
+
}), al = (e) => _e[e], Be = () => {
|
|
449
|
+
const e = Yt();
|
|
450
|
+
return C(
|
|
443
451
|
(t, n) => {
|
|
444
|
-
e(t,
|
|
452
|
+
e(t, _e[n]);
|
|
445
453
|
},
|
|
446
454
|
[e]
|
|
447
455
|
);
|
|
448
|
-
},
|
|
456
|
+
}, _n = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Xt, { ...t, ..._e[e] }), Rt = {
|
|
449
457
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
450
458
|
forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
|
|
451
459
|
"not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
|
|
@@ -454,14 +462,14 @@ const Cn = /* @__PURE__ */ x.forwardRef(Ln), Fe = Object.freeze({
|
|
|
454
462
|
"too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
|
|
455
463
|
unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
|
|
456
464
|
failed: ["failureFailedTitle", "failureFailedBody"]
|
|
457
|
-
},
|
|
458
|
-
const { labels: o } =
|
|
459
|
-
return /* @__PURE__ */
|
|
460
|
-
/* @__PURE__ */
|
|
461
|
-
/* @__PURE__ */
|
|
462
|
-
e.reason === "unauthorized" ? /* @__PURE__ */
|
|
465
|
+
}, ae = (e, t) => e[Rt[t][0]], Tt = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
|
|
466
|
+
const { labels: o } = P(), l = ae(o, e.reason), s = o[Rt[e.reason][1]], i = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
|
|
467
|
+
return /* @__PURE__ */ z("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": i, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
|
|
468
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: l }),
|
|
469
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: s }),
|
|
470
|
+
e.reason === "unauthorized" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: () => window.location.reload(), children: o.reloadPage }) : n !== void 0 && e.reason === "failed" ? /* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", onClick: n, children: o.retry }) : null
|
|
463
471
|
] });
|
|
464
|
-
},
|
|
472
|
+
}, At = (e) => {
|
|
465
473
|
const t = e.ownerDocument;
|
|
466
474
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
467
475
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -471,53 +479,53 @@ const Cn = /* @__PURE__ */ x.forwardRef(Ln), Fe = Object.freeze({
|
|
|
471
479
|
t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
|
|
472
480
|
};
|
|
473
481
|
return e.addEventListener("blur", n), !0;
|
|
474
|
-
},
|
|
475
|
-
const n = j(null), r = j(null), o = j(null), l =
|
|
482
|
+
}, Bn = (e, t) => {
|
|
483
|
+
const n = j(null), r = j(null), o = j(null), l = C(() => {
|
|
476
484
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
477
485
|
}, []);
|
|
478
|
-
|
|
479
|
-
const s =
|
|
480
|
-
(
|
|
481
|
-
if (r.current !==
|
|
482
|
-
const
|
|
483
|
-
if (
|
|
484
|
-
|
|
486
|
+
ee(() => l, [l]);
|
|
487
|
+
const s = C(
|
|
488
|
+
(u) => {
|
|
489
|
+
if (r.current !== u) return;
|
|
490
|
+
const p = o.current;
|
|
491
|
+
if (p !== null) {
|
|
492
|
+
p.then(() => s(u));
|
|
485
493
|
return;
|
|
486
494
|
}
|
|
487
|
-
e.prefetch(
|
|
488
|
-
const
|
|
489
|
-
if (
|
|
490
|
-
const b = Promise.allSettled([
|
|
495
|
+
e.prefetch(u);
|
|
496
|
+
const h = e.peek(u);
|
|
497
|
+
if (h?.status !== "pending") return;
|
|
498
|
+
const b = Promise.allSettled([h.promise]);
|
|
491
499
|
o.current = b, b.then(() => {
|
|
492
500
|
o.current === b && (o.current = null);
|
|
493
501
|
});
|
|
494
502
|
},
|
|
495
503
|
[e]
|
|
496
|
-
),
|
|
497
|
-
(
|
|
498
|
-
const
|
|
499
|
-
|
|
500
|
-
n.current = null, s(
|
|
501
|
-
},
|
|
504
|
+
), i = C(
|
|
505
|
+
(u) => {
|
|
506
|
+
const p = t(u);
|
|
507
|
+
p !== r.current && (l(), p !== null && (r.current = p, n.current = window.setTimeout(() => {
|
|
508
|
+
n.current = null, s(p);
|
|
509
|
+
}, tn)));
|
|
502
510
|
},
|
|
503
511
|
[l, t, s]
|
|
504
|
-
),
|
|
505
|
-
(
|
|
506
|
-
t(
|
|
512
|
+
), d = C(
|
|
513
|
+
(u) => {
|
|
514
|
+
t(u) !== r.current && l();
|
|
507
515
|
},
|
|
508
516
|
[l, t]
|
|
509
517
|
);
|
|
510
518
|
return H(
|
|
511
519
|
() => ({
|
|
512
|
-
onPointerOver: (
|
|
513
|
-
onPointerOut: (
|
|
514
|
-
onFocus: (
|
|
515
|
-
onBlur: (
|
|
520
|
+
onPointerOver: (u) => i(u.target),
|
|
521
|
+
onPointerOut: (u) => d(u.relatedTarget),
|
|
522
|
+
onFocus: (u) => i(u.target),
|
|
523
|
+
onBlur: (u) => d(u.relatedTarget)
|
|
516
524
|
}),
|
|
517
|
-
[
|
|
525
|
+
[i, d]
|
|
518
526
|
);
|
|
519
|
-
},
|
|
520
|
-
class
|
|
527
|
+
}, jn = De(() => import("./NativeScrollBar-DYEv2GLV.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
528
|
+
class zn extends Vt {
|
|
521
529
|
state = { failed: !1 };
|
|
522
530
|
static getDerivedStateFromError() {
|
|
523
531
|
return { failed: !0 };
|
|
@@ -529,7 +537,7 @@ class Dn extends zt {
|
|
|
529
537
|
return this.state.failed ? null : this.props.children;
|
|
530
538
|
}
|
|
531
539
|
}
|
|
532
|
-
const
|
|
540
|
+
const Hn = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(zn, { children: /* @__PURE__ */ c(we, { fallback: null, children: /* @__PURE__ */ c(jn, { scroller: e, withCircle: t }) }) }), Lt = (e) => /* @__PURE__ */ c(Hn, { scroller: e, withCircle: !0 }), ce = () => {
|
|
533
541
|
const e = /* @__PURE__ */ new Set();
|
|
534
542
|
return {
|
|
535
543
|
subscribe: (t) => (e.add(t), () => {
|
|
@@ -539,7 +547,7 @@ const Fn = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(Dn, { children:
|
|
|
539
547
|
for (const t of [...e]) t();
|
|
540
548
|
}
|
|
541
549
|
};
|
|
542
|
-
},
|
|
550
|
+
}, Ot = () => {
|
|
543
551
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
544
552
|
let n = !1;
|
|
545
553
|
const r = (o) => {
|
|
@@ -566,14 +574,14 @@ const Fn = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(Dn, { children:
|
|
|
566
574
|
resumes: (o) => t.delete(o),
|
|
567
575
|
heldKeys: () => [...e.keys()]
|
|
568
576
|
};
|
|
569
|
-
},
|
|
577
|
+
}, be = (e, t) => {
|
|
570
578
|
if (Object.is(e, t)) return !0;
|
|
571
579
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
572
580
|
if (Array.isArray(e) || Array.isArray(t))
|
|
573
|
-
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((l, s) =>
|
|
581
|
+
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((l, s) => be(l, t[s]));
|
|
574
582
|
const n = e, r = t, o = Object.keys(n);
|
|
575
|
-
return o.length !== Object.keys(r).length ? !1 : o.every((l) => Object.hasOwn(r, l) &&
|
|
576
|
-
},
|
|
583
|
+
return o.length !== Object.keys(r).length ? !1 : o.every((l) => Object.hasOwn(r, l) && be(n[l], r[l]));
|
|
584
|
+
}, se = (e) => {
|
|
577
585
|
const t = e;
|
|
578
586
|
return t.status === void 0 && (t.status = "pending", e.then(
|
|
579
587
|
(n) => {
|
|
@@ -583,126 +591,126 @@ const Fn = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(Dn, { children:
|
|
|
583
591
|
t.status = "rejected", t.reason = n;
|
|
584
592
|
}
|
|
585
593
|
)), t;
|
|
586
|
-
},
|
|
594
|
+
}, Mt = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), me = (e) => e.status === "fulfilled" ? e.value : void 0, In = 55e3, et = Object.freeze({ status: "deferred" }), tt = Object.freeze({ status: "refreshed" }), Le = Object.freeze({ status: "superseded" }), ie = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Ct = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", Zn = ({ client: e, capacity: t }) => {
|
|
587
595
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
588
|
-
const n = /* @__PURE__ */ new Map(), r =
|
|
596
|
+
const n = /* @__PURE__ */ new Map(), r = Ot(), o = ce(), l = /* @__PURE__ */ new WeakSet();
|
|
589
597
|
let s = 0;
|
|
590
|
-
const
|
|
598
|
+
const i = o.emit, d = () => (s += 1, s), u = () => {
|
|
591
599
|
if (!(n.size <= t))
|
|
592
|
-
for (const
|
|
600
|
+
for (const m of [...n.keys()]) {
|
|
593
601
|
if (n.size <= t) return;
|
|
594
|
-
r.isHeld(
|
|
602
|
+
r.isHeld(m) || n.delete(m);
|
|
595
603
|
}
|
|
596
|
-
},
|
|
597
|
-
n.delete(
|
|
598
|
-
},
|
|
599
|
-
const E = n.get(
|
|
600
|
-
return m
|
|
601
|
-
n.get(
|
|
602
|
-
}),
|
|
603
|
-
},
|
|
604
|
-
|
|
605
|
-
},
|
|
606
|
-
const S =
|
|
604
|
+
}, p = (m, w) => {
|
|
605
|
+
n.delete(m), n.set(m, w);
|
|
606
|
+
}, h = (m) => performance.now() - m.validatedAt >= In, b = (m, w, S) => {
|
|
607
|
+
const E = n.get(m), R = ie(E?.snapshot), F = S || E?.refreshPending === !0, I = se(e.document(m, { refresh: F }).then((B) => ({ status: "loaded", document: B }))), N = { snapshot: { status: "pending", promise: I, previous: R }, validatedAt: performance.now(), opened: w, background: null, refreshPending: !1, seeded: void 0, stamp: d() };
|
|
608
|
+
return p(m, N), u(), I.then((B) => {
|
|
609
|
+
n.get(m) === N && (N.snapshot = B, N.stamp = d(), i());
|
|
610
|
+
}), N;
|
|
611
|
+
}, T = (m, w, S, E, R, F) => {
|
|
612
|
+
w.background === S && (w.background = null, !(n.get(m) !== w || w.snapshot !== E) && (R.kind === "failure" && E.document.kind !== "failure" || (w.validatedAt = F, w.stamp = d(), be(E.document, R) || (w.snapshot = { status: "loaded", document: R }), i())));
|
|
613
|
+
}, y = async (m, w) => {
|
|
614
|
+
const S = w.snapshot;
|
|
607
615
|
if (S.status !== "loaded") return null;
|
|
608
616
|
const E = {};
|
|
609
|
-
|
|
610
|
-
const
|
|
611
|
-
|
|
612
|
-
const I = await
|
|
613
|
-
return
|
|
614
|
-
},
|
|
615
|
-
const { snapshot: S } =
|
|
616
|
-
return S.status === "pending" ? !1 : S.status === "loaded" && S.document.kind !== "failure" ? (
|
|
617
|
-
},
|
|
618
|
-
const
|
|
617
|
+
w.background = E;
|
|
618
|
+
const R = performance.now(), F = e.document(m, { refresh: w.refreshPending });
|
|
619
|
+
w.refreshPending = !1;
|
|
620
|
+
const I = await F, N = w.background === E && n.get(m) === w && w.snapshot === S;
|
|
621
|
+
return T(m, w, E, S, I, R), N ? I : null;
|
|
622
|
+
}, L = (m, w) => {
|
|
623
|
+
const { snapshot: S } = w;
|
|
624
|
+
return S.status === "pending" ? !1 : S.status === "loaded" && S.document.kind !== "failure" ? (y(m, w), !1) : (S.status === "loaded" && l.add(S), b(m, !0, !1), !0);
|
|
625
|
+
}, k = (m) => {
|
|
626
|
+
const w = r.hold(m);
|
|
619
627
|
let S = !1;
|
|
620
628
|
return () => {
|
|
621
629
|
if (S) return;
|
|
622
|
-
S = !0,
|
|
623
|
-
const E = n.get(
|
|
624
|
-
E !== void 0 && m
|
|
630
|
+
S = !0, w();
|
|
631
|
+
const E = n.get(m);
|
|
632
|
+
E !== void 0 && p(m, E), u();
|
|
625
633
|
};
|
|
626
634
|
};
|
|
627
635
|
return {
|
|
628
|
-
peek: (
|
|
629
|
-
peekSeeded: (
|
|
630
|
-
answerStampOf: (
|
|
631
|
-
prefetch: (
|
|
632
|
-
const
|
|
633
|
-
|
|
636
|
+
peek: (m) => n.get(m)?.snapshot,
|
|
637
|
+
peekSeeded: (m) => n.get(m)?.seeded,
|
|
638
|
+
answerStampOf: (m) => n.get(m)?.stamp,
|
|
639
|
+
prefetch: (m) => {
|
|
640
|
+
const w = n.get(m);
|
|
641
|
+
w !== void 0 && w.snapshot.status !== "deferred" || (b(m, !1, !1), i());
|
|
634
642
|
},
|
|
635
|
-
open: (
|
|
636
|
-
const
|
|
643
|
+
open: (m) => {
|
|
644
|
+
const w = r.resumes(m), S = k(m), E = n.get(m);
|
|
637
645
|
if (E === void 0 || E.snapshot.status === "deferred")
|
|
638
|
-
return b(
|
|
639
|
-
if (m
|
|
640
|
-
const { snapshot:
|
|
641
|
-
return
|
|
646
|
+
return b(m, !0, !1), i(), S;
|
|
647
|
+
if (p(m, E), w) return S;
|
|
648
|
+
const { snapshot: R } = E;
|
|
649
|
+
return R.status === "pending" ? (E.opened = !0, S) : R.document.kind === "failure" ? (E.opened || h(E) ? (l.add(R), b(m, !0, !1), i()) : E.opened = !0, S) : (E.opened = !0, E.background === null && h(E) && y(m, E), S);
|
|
642
650
|
},
|
|
643
|
-
retain:
|
|
644
|
-
retry: (
|
|
645
|
-
const
|
|
646
|
-
|
|
651
|
+
retain: k,
|
|
652
|
+
retry: (m) => {
|
|
653
|
+
const w = n.get(m);
|
|
654
|
+
w === void 0 || w.snapshot.status !== "loaded" || w.snapshot.document.kind !== "failure" || (b(m, !0, !1), i());
|
|
647
655
|
},
|
|
648
|
-
seed: (
|
|
649
|
-
const S = performance.now(), E =
|
|
650
|
-
|
|
651
|
-
(B) => B === null ?
|
|
652
|
-
() =>
|
|
656
|
+
seed: (m, w) => {
|
|
657
|
+
const S = performance.now(), E = se(
|
|
658
|
+
w.then(
|
|
659
|
+
(B) => B === null ? et : { status: "loaded", document: B },
|
|
660
|
+
() => et
|
|
653
661
|
)
|
|
654
|
-
),
|
|
655
|
-
if (
|
|
656
|
-
const B =
|
|
657
|
-
|
|
658
|
-
if (
|
|
659
|
-
|
|
662
|
+
), R = n.get(m);
|
|
663
|
+
if (R !== void 0 && R.snapshot.status === "loaded") {
|
|
664
|
+
const B = R.snapshot, W = {};
|
|
665
|
+
R.background = W, E.then((U) => {
|
|
666
|
+
if (U.status === "loaded") {
|
|
667
|
+
T(m, R, W, B, U.document, S);
|
|
660
668
|
return;
|
|
661
669
|
}
|
|
662
|
-
|
|
670
|
+
R.background === W && (R.background = null);
|
|
663
671
|
});
|
|
664
672
|
return;
|
|
665
673
|
}
|
|
666
|
-
const
|
|
667
|
-
m
|
|
668
|
-
n.get(
|
|
674
|
+
const F = R !== void 0 && R.snapshot.status === "pending" ? R.snapshot.previous : null, I = { status: "pending", promise: E, previous: F }, N = { snapshot: I, validatedAt: S, opened: R?.opened === !0, background: null, refreshPending: R?.refreshPending === !0, seeded: I, stamp: d() };
|
|
675
|
+
p(m, N), u(), E.then((B) => {
|
|
676
|
+
n.get(m) === N && (B.status === "deferred" && r.isHeld(m) ? b(m, N.opened, !1) : (N.snapshot = B, N.stamp = d()), i());
|
|
669
677
|
});
|
|
670
678
|
},
|
|
671
679
|
invalidate: () => {
|
|
672
|
-
let
|
|
673
|
-
for (const [
|
|
674
|
-
if (S.validatedAt = Number.NEGATIVE_INFINITY, S.opened = !0, S.refreshPending = !0, !r.isHeld(
|
|
680
|
+
let m = !1;
|
|
681
|
+
for (const [w, S] of [...n]) {
|
|
682
|
+
if (S.validatedAt = Number.NEGATIVE_INFINITY, S.opened = !0, S.refreshPending = !0, !r.isHeld(w)) continue;
|
|
675
683
|
const { snapshot: E } = S;
|
|
676
684
|
if (E.status !== "pending") {
|
|
677
|
-
|
|
685
|
+
L(w, S) && (m = !0);
|
|
678
686
|
continue;
|
|
679
687
|
}
|
|
680
688
|
E.promise.then(() => {
|
|
681
|
-
n.get(
|
|
689
|
+
n.get(w) === S && S.refreshPending && r.isHeld(w) && L(w, S) && i();
|
|
682
690
|
});
|
|
683
691
|
}
|
|
684
|
-
|
|
692
|
+
m && i();
|
|
685
693
|
},
|
|
686
|
-
refresh: async (
|
|
687
|
-
const
|
|
688
|
-
if (
|
|
689
|
-
|
|
690
|
-
const E = await
|
|
691
|
-
return E === null ?
|
|
694
|
+
refresh: async (m) => {
|
|
695
|
+
const w = n.get(m);
|
|
696
|
+
if (w !== void 0 && Ct(w.snapshot)) {
|
|
697
|
+
w.refreshPending = !0;
|
|
698
|
+
const E = await y(m, w);
|
|
699
|
+
return E === null ? Le : E.kind === "failure" ? { status: "failed", failure: E.failure } : tt;
|
|
692
700
|
}
|
|
693
|
-
const S = b(
|
|
694
|
-
return
|
|
701
|
+
const S = b(m, !0, !0);
|
|
702
|
+
return i(), S.snapshot.status !== "pending" ? Le : (await S.snapshot.promise, n.get(m) === S ? tt : Le);
|
|
695
703
|
},
|
|
696
704
|
clear: () => {
|
|
697
705
|
n.clear();
|
|
698
|
-
for (const
|
|
699
|
-
|
|
706
|
+
for (const m of r.heldKeys()) b(m, !0, !1);
|
|
707
|
+
i();
|
|
700
708
|
},
|
|
701
709
|
subscribe: o.subscribe,
|
|
702
|
-
noteFailureShown: (
|
|
710
|
+
noteFailureShown: (m) => l.has(m) ? !1 : (l.add(m), !0)
|
|
703
711
|
};
|
|
704
|
-
},
|
|
705
|
-
function
|
|
712
|
+
}, Ee = oe("fill"), Un = Object.freeze({ blockSize: "100%" }), de = ({ scrollerProps: e, children: t }) => J(Ee) === "content" ? /* @__PURE__ */ c(Ve, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(Ve, { scrollerProps: { ...e, style: Un }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: Lt, children: t });
|
|
713
|
+
function Vn({
|
|
706
714
|
title: e,
|
|
707
715
|
titleId: t,
|
|
708
716
|
...n
|
|
@@ -723,8 +731,8 @@ function zn({
|
|
|
723
731
|
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"
|
|
724
732
|
}));
|
|
725
733
|
}
|
|
726
|
-
const
|
|
727
|
-
function
|
|
734
|
+
const Gn = /* @__PURE__ */ x.forwardRef(Vn);
|
|
735
|
+
function Wn({
|
|
728
736
|
title: e,
|
|
729
737
|
titleId: t,
|
|
730
738
|
...n
|
|
@@ -749,17 +757,17 @@ function Hn({
|
|
|
749
757
|
clipRule: "evenodd"
|
|
750
758
|
}));
|
|
751
759
|
}
|
|
752
|
-
const
|
|
753
|
-
const { labels: o } =
|
|
754
|
-
return /* @__PURE__ */
|
|
755
|
-
/* @__PURE__ */
|
|
756
|
-
/* @__PURE__ */
|
|
760
|
+
const Kn = /* @__PURE__ */ x.forwardRef(Wn), ke = ({ name: e, url: t, icon: n, children: r }) => {
|
|
761
|
+
const { labels: o } = P();
|
|
762
|
+
return /* @__PURE__ */ z("div", { className: "aqmx-document-toolbar", children: [
|
|
763
|
+
/* @__PURE__ */ c("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: n }),
|
|
764
|
+
/* @__PURE__ */ c("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
|
|
757
765
|
r,
|
|
758
|
-
/* @__PURE__ */
|
|
759
|
-
/* @__PURE__ */
|
|
766
|
+
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": o.openInNewTab, title: o.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(Kn, {}) }),
|
|
767
|
+
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, download: e, "aria-label": o.download, title: o.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(Gn, {}) })
|
|
760
768
|
] });
|
|
761
769
|
};
|
|
762
|
-
function
|
|
770
|
+
function Yn({
|
|
763
771
|
title: e,
|
|
764
772
|
titleId: t,
|
|
765
773
|
...n
|
|
@@ -780,45 +788,45 @@ function Zn({
|
|
|
780
788
|
clipRule: "evenodd"
|
|
781
789
|
}));
|
|
782
790
|
}
|
|
783
|
-
const
|
|
784
|
-
const { labels: t } =
|
|
785
|
-
return /* @__PURE__ */
|
|
786
|
-
/* @__PURE__ */
|
|
787
|
-
/* @__PURE__ */
|
|
788
|
-
/* @__PURE__ */
|
|
789
|
-
/* @__PURE__ */
|
|
791
|
+
const Xn = /* @__PURE__ */ x.forwardRef(Yn), Jn = Object.freeze({ className: "aqmx-document-stage" }), Qn = ({ document: e }) => {
|
|
792
|
+
const { labels: t } = P();
|
|
793
|
+
return /* @__PURE__ */ z("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
794
|
+
/* @__PURE__ */ c(ke, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(Xn, {}) }),
|
|
795
|
+
/* @__PURE__ */ c(de, { scrollerProps: Jn, children: /* @__PURE__ */ z("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
|
|
796
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
|
|
797
|
+
/* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
|
|
790
798
|
] }) })
|
|
791
799
|
] });
|
|
792
|
-
},
|
|
800
|
+
}, je = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", er = (e) => {
|
|
793
801
|
const t = e.indexOf("#");
|
|
794
802
|
return t === -1 ? "" : e.slice(t);
|
|
795
|
-
},
|
|
803
|
+
}, tr = /(%[0-9A-Fa-f]{2})/u, ze = (e) => {
|
|
796
804
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
797
|
-
const t = new TextEncoder(), n = e.slice(1).split(
|
|
805
|
+
const t = new TextEncoder(), n = e.slice(1).split(tr).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
798
806
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
799
|
-
},
|
|
807
|
+
}, Nt = (e) => `#${encodeURIComponent(e)}`, nr = (e) => {
|
|
800
808
|
if (e === "#") return !0;
|
|
801
|
-
const t =
|
|
809
|
+
const t = ze(e);
|
|
802
810
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
803
|
-
},
|
|
811
|
+
}, Pt = (e, t) => {
|
|
804
812
|
if (t === "") return null;
|
|
805
813
|
for (const n of e.querySelectorAll("[id]"))
|
|
806
814
|
if (n.id === t) return n;
|
|
807
815
|
return null;
|
|
808
|
-
},
|
|
816
|
+
}, rr = "http://www.w3.org/1999/xhtml", nt = (e, t) => {
|
|
809
817
|
if (t === "") return null;
|
|
810
|
-
const n =
|
|
818
|
+
const n = Pt(e, t);
|
|
811
819
|
if (n !== null) return n;
|
|
812
820
|
for (const r of e.querySelectorAll("a[name]"))
|
|
813
|
-
if (r.localName === "a" && r.namespaceURI ===
|
|
821
|
+
if (r.localName === "a" && r.namespaceURI === rr && r.getAttribute("name") === t) return r;
|
|
814
822
|
return null;
|
|
815
|
-
},
|
|
823
|
+
}, $t = (e, t) => {
|
|
816
824
|
if (e === null || !t.startsWith("#")) return null;
|
|
817
|
-
const n =
|
|
825
|
+
const n = nt(e, t.slice(1));
|
|
818
826
|
if (n !== null) return n;
|
|
819
|
-
const r =
|
|
820
|
-
return r === null ? null :
|
|
821
|
-
},
|
|
827
|
+
const r = ze(t);
|
|
828
|
+
return r === null ? null : nt(e, r);
|
|
829
|
+
}, rt = (e) => {
|
|
822
830
|
const { body: t, documentElement: n } = e.ownerDocument;
|
|
823
831
|
if (e === t) {
|
|
824
832
|
const o = getComputedStyle(n);
|
|
@@ -826,22 +834,22 @@ const Un = /* @__PURE__ */ x.forwardRef(Zn), Vn = Object.freeze({ className: "aq
|
|
|
826
834
|
}
|
|
827
835
|
const { overflowY: r } = getComputedStyle(e);
|
|
828
836
|
return r === "auto" || r === "scroll";
|
|
829
|
-
},
|
|
837
|
+
}, or = (e) => {
|
|
830
838
|
const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
|
|
831
839
|
return o !== "hidden" && o !== "clip";
|
|
832
|
-
},
|
|
833
|
-
const n = t.closest(
|
|
834
|
-
if (r.scrollHeight > r.clientHeight &&
|
|
840
|
+
}, lr = (e, t) => {
|
|
841
|
+
const n = t.closest(je), r = n !== null && e.contains(n) ? n : e;
|
|
842
|
+
if (r.scrollHeight > r.clientHeight && rt(r)) return r;
|
|
835
843
|
const o = e.getBoundingClientRect().height, { documentElement: l, scrollingElement: s } = e.ownerDocument;
|
|
836
|
-
for (let
|
|
837
|
-
if (
|
|
838
|
-
return s instanceof Element &&
|
|
839
|
-
},
|
|
840
|
-
scrollerOf:
|
|
844
|
+
for (let i = e.parentElement; i !== null && i !== l; i = i.parentElement)
|
|
845
|
+
if (rt(i) && i.scrollHeight > i.clientHeight && i.clientHeight < o) return i;
|
|
846
|
+
return s instanceof Element && or(e.ownerDocument) && s.scrollHeight > s.clientHeight && s.clientHeight < o ? s : r;
|
|
847
|
+
}, sr = Object.freeze({
|
|
848
|
+
scrollerOf: lr,
|
|
841
849
|
reveal: (e) => {
|
|
842
|
-
e.scrollIntoView(
|
|
850
|
+
e.scrollIntoView(Ne);
|
|
843
851
|
}
|
|
844
|
-
}),
|
|
852
|
+
}), Ne = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), ir = (e, t) => {
|
|
845
853
|
for (let n = t; n !== null && n !== e; n = n.parentElement) {
|
|
846
854
|
const r = n.parentElement;
|
|
847
855
|
if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
|
|
@@ -849,23 +857,23 @@ const Un = /* @__PURE__ */ x.forwardRef(Zn), Vn = Object.freeze({ className: "aq
|
|
|
849
857
|
n.removeAttribute("hidden");
|
|
850
858
|
}
|
|
851
859
|
}
|
|
852
|
-
},
|
|
860
|
+
}, ar = (e, t) => {
|
|
853
861
|
if (t.getClientRects().length === 0) return;
|
|
854
|
-
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), l = Number.parseFloat(r), s = t.getBoundingClientRect(),
|
|
855
|
-
if (!
|
|
856
|
-
t.scrollIntoView(
|
|
862
|
+
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), l = Number.parseFloat(r), s = t.getBoundingClientRect(), i = s.height + l + Number.parseFloat(o) > e.clientHeight;
|
|
863
|
+
if (!i && Math.abs(s.top - l - n) < 1) {
|
|
864
|
+
t.scrollIntoView(Ne);
|
|
857
865
|
return;
|
|
858
866
|
}
|
|
859
|
-
e.scrollBy({ top:
|
|
860
|
-
},
|
|
861
|
-
const n = t.scrollerOf(e, e.querySelector(
|
|
867
|
+
e.scrollBy({ top: i ? s.top - n - e.clientHeight : s.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(Ne);
|
|
868
|
+
}, cr = (e, t) => {
|
|
869
|
+
const n = t.scrollerOf(e, e.querySelector(je) ?? e);
|
|
862
870
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
863
|
-
},
|
|
871
|
+
}, ot = (e, t, n) => {
|
|
864
872
|
if (e === null) return null;
|
|
865
|
-
const r =
|
|
866
|
-
return r === null ? (
|
|
873
|
+
const r = $t(e, t);
|
|
874
|
+
return r === null ? (nr(t) && cr(e, n), null) : (ir(e, r), ar(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
867
875
|
};
|
|
868
|
-
function
|
|
876
|
+
function dr({
|
|
869
877
|
title: e,
|
|
870
878
|
titleId: t,
|
|
871
879
|
...n
|
|
@@ -884,8 +892,8 @@ function or({
|
|
|
884
892
|
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"
|
|
885
893
|
}));
|
|
886
894
|
}
|
|
887
|
-
const
|
|
888
|
-
function
|
|
895
|
+
const ur = /* @__PURE__ */ x.forwardRef(dr);
|
|
896
|
+
function mr({
|
|
889
897
|
title: e,
|
|
890
898
|
titleId: t,
|
|
891
899
|
...n
|
|
@@ -908,8 +916,8 @@ function ir({
|
|
|
908
916
|
clipRule: "evenodd"
|
|
909
917
|
}));
|
|
910
918
|
}
|
|
911
|
-
const
|
|
912
|
-
function
|
|
919
|
+
const fr = /* @__PURE__ */ x.forwardRef(mr);
|
|
920
|
+
function pr({
|
|
913
921
|
title: e,
|
|
914
922
|
titleId: t,
|
|
915
923
|
...n
|
|
@@ -932,8 +940,8 @@ function ar({
|
|
|
932
940
|
clipRule: "evenodd"
|
|
933
941
|
}));
|
|
934
942
|
}
|
|
935
|
-
const
|
|
936
|
-
function
|
|
943
|
+
const hr = /* @__PURE__ */ x.forwardRef(pr);
|
|
944
|
+
function gr({
|
|
937
945
|
title: e,
|
|
938
946
|
titleId: t,
|
|
939
947
|
...n
|
|
@@ -954,7 +962,7 @@ function dr({
|
|
|
954
962
|
clipRule: "evenodd"
|
|
955
963
|
}));
|
|
956
964
|
}
|
|
957
|
-
const
|
|
965
|
+
const wr = /* @__PURE__ */ x.forwardRef(gr), Pe = "data-aqmx-key-repeat", $e = Object.freeze({ [Pe]: "allow" }), vr = `[${Pe}="${$e[Pe]}"]`, br = () => {
|
|
958
966
|
let e = null;
|
|
959
967
|
return {
|
|
960
968
|
onKeyDownCapture: (t) => {
|
|
@@ -963,7 +971,7 @@ const ur = /* @__PURE__ */ x.forwardRef(dr), Me = "data-aqmx-key-repeat", Ne = O
|
|
|
963
971
|
e = t.target instanceof Element ? t.target : null;
|
|
964
972
|
return;
|
|
965
973
|
}
|
|
966
|
-
e !== null && t.target === e && e.closest(
|
|
974
|
+
e !== null && t.target === e && e.closest(vr) !== null || (t.preventDefault(), t.stopPropagation());
|
|
967
975
|
}
|
|
968
976
|
},
|
|
969
977
|
onKeyUpCapture: (t) => {
|
|
@@ -973,156 +981,156 @@ const ur = /* @__PURE__ */ x.forwardRef(dr), Me = "data-aqmx-key-repeat", Ne = O
|
|
|
973
981
|
t.target === e && (e = null);
|
|
974
982
|
}
|
|
975
983
|
};
|
|
976
|
-
},
|
|
984
|
+
}, ge = Object.freeze([1 / ue ** 2, 1 / ue, 1, ue, ue ** 2]), lt = Object.freeze({ mode: "fit" }), Er = 1, Sr = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), kr = oe(null), xr = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Er ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, st = (e, t, n) => {
|
|
977
985
|
if (e.mode === "level") {
|
|
978
986
|
const o = e.index + n;
|
|
979
|
-
return o >= 0 && o <
|
|
987
|
+
return o >= 0 && o < ge.length ? o : null;
|
|
980
988
|
}
|
|
981
989
|
if (t === null || !Number.isFinite(t) || t <= 0) return null;
|
|
982
|
-
const r = n === 1 ?
|
|
990
|
+
const r = n === 1 ? ge.findIndex((o) => o > t) : ge.findLastIndex((o) => o < t);
|
|
983
991
|
return r === -1 ? null : r;
|
|
984
|
-
},
|
|
992
|
+
}, it = (e, t, n) => {
|
|
985
993
|
if (e.mode === "level") {
|
|
986
|
-
const o =
|
|
994
|
+
const o = st(e, null, n);
|
|
987
995
|
return o === null ? null : { mode: "level", index: o, base: e.base };
|
|
988
996
|
}
|
|
989
997
|
if (t === null) return null;
|
|
990
|
-
const r =
|
|
998
|
+
const r = st(e, t.scale, n);
|
|
991
999
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
992
|
-
},
|
|
993
|
-
const t =
|
|
1000
|
+
}, yr = (e) => {
|
|
1001
|
+
const t = ge[e];
|
|
994
1002
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
995
1003
|
return t;
|
|
996
|
-
},
|
|
997
|
-
const { labels: t } =
|
|
998
|
-
const { naturalWidth:
|
|
999
|
-
|
|
1000
|
-
}, []), b =
|
|
1004
|
+
}, at = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Rr = ({ document: e }) => {
|
|
1005
|
+
const { labels: t } = P(), n = J(kr), [r] = Z(() => n === null ? null : n.read(e.url)), [o, l] = Z(r === null ? lt : r.zoom), [s, i] = Z(r === null ? null : r.reported), [d, u] = Z(null), p = j(null), h = C((O) => {
|
|
1006
|
+
const { naturalWidth: m, naturalHeight: w } = O;
|
|
1007
|
+
i((S) => at(S, m, w));
|
|
1008
|
+
}, []), b = C(
|
|
1001
1009
|
(O) => {
|
|
1002
|
-
|
|
1003
|
-
() =>
|
|
1010
|
+
p.current = O, !(O === null || !O.complete) && (O.naturalWidth > 0 || O.naturalHeight > 0 ? h(O) : O.decode().then(
|
|
1011
|
+
() => h(O),
|
|
1004
1012
|
() => {
|
|
1005
1013
|
}
|
|
1006
1014
|
));
|
|
1007
1015
|
},
|
|
1008
|
-
[
|
|
1016
|
+
[h]
|
|
1009
1017
|
);
|
|
1010
|
-
|
|
1018
|
+
ee(() => {
|
|
1011
1019
|
n !== null && s !== null && n.save(e.url, { zoom: o, reported: s });
|
|
1012
|
-
}, [n, e.url, o, s]),
|
|
1013
|
-
const O =
|
|
1020
|
+
}, [n, e.url, o, s]), G(() => {
|
|
1021
|
+
const O = p.current;
|
|
1014
1022
|
if (O === null || s === null || o.mode !== "fit") return;
|
|
1015
|
-
const
|
|
1016
|
-
if (
|
|
1017
|
-
const
|
|
1018
|
-
return
|
|
1023
|
+
const m = () => u((S) => at(S, O.clientWidth, O.clientHeight));
|
|
1024
|
+
if (m(), typeof ResizeObserver > "u") return;
|
|
1025
|
+
const w = new ResizeObserver(m);
|
|
1026
|
+
return w.observe(O), () => w.disconnect();
|
|
1019
1027
|
}, [s, o.mode]);
|
|
1020
|
-
const
|
|
1021
|
-
return /* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
1023
|
-
/* @__PURE__ */
|
|
1028
|
+
const T = s === null || d === null ? null : xr(s, d), y = it(o, T, -1), L = it(o, T, 1), k = o.mode === "level" ? yr(o.index) : null, $ = o.mode === "level" && k !== null ? { width: `${o.base.width * k}px`, height: `${o.base.height * k}px` } : void 0;
|
|
1029
|
+
return /* @__PURE__ */ z("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1030
|
+
/* @__PURE__ */ z(ke, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(wr, {}), children: [
|
|
1031
|
+
/* @__PURE__ */ c(
|
|
1024
1032
|
"button",
|
|
1025
1033
|
{
|
|
1026
1034
|
type: "button",
|
|
1027
1035
|
className: "aqmx-icon-button",
|
|
1028
1036
|
"aria-label": t.imageZoomOut,
|
|
1029
1037
|
title: t.imageZoomOut,
|
|
1030
|
-
"aria-disabled":
|
|
1038
|
+
"aria-disabled": y === null,
|
|
1031
1039
|
onClick: () => {
|
|
1032
|
-
|
|
1040
|
+
y !== null && l(y);
|
|
1033
1041
|
},
|
|
1034
|
-
|
|
1035
|
-
children: /* @__PURE__ */
|
|
1042
|
+
...$e,
|
|
1043
|
+
children: /* @__PURE__ */ c(fr, {})
|
|
1036
1044
|
}
|
|
1037
1045
|
),
|
|
1038
|
-
/* @__PURE__ */
|
|
1039
|
-
/* @__PURE__ */
|
|
1046
|
+
/* @__PURE__ */ c("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: k === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(k * 100)) }),
|
|
1047
|
+
/* @__PURE__ */ c(
|
|
1040
1048
|
"button",
|
|
1041
1049
|
{
|
|
1042
1050
|
type: "button",
|
|
1043
1051
|
className: "aqmx-icon-button",
|
|
1044
1052
|
"aria-label": t.imageZoomIn,
|
|
1045
1053
|
title: t.imageZoomIn,
|
|
1046
|
-
"aria-disabled":
|
|
1054
|
+
"aria-disabled": L === null,
|
|
1047
1055
|
onClick: () => {
|
|
1048
|
-
|
|
1056
|
+
L !== null && l(L);
|
|
1049
1057
|
},
|
|
1050
|
-
|
|
1051
|
-
children: /* @__PURE__ */
|
|
1058
|
+
...$e,
|
|
1059
|
+
children: /* @__PURE__ */ c(hr, {})
|
|
1052
1060
|
}
|
|
1053
1061
|
),
|
|
1054
|
-
/* @__PURE__ */
|
|
1062
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => l(lt), children: /* @__PURE__ */ c(ur, {}) })
|
|
1055
1063
|
] }),
|
|
1056
|
-
/* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ c(de, { scrollerProps: Sr, children: /* @__PURE__ */ c("img", { ref: b, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: $, onLoad: (O) => h(O.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1057
1065
|
] });
|
|
1058
|
-
},
|
|
1059
|
-
const e =
|
|
1066
|
+
}, Ft = oe(null), xe = oe(void 0), Dt = oe(null), ye = () => {
|
|
1067
|
+
const e = J(Ft);
|
|
1060
1068
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1061
1069
|
return e;
|
|
1062
|
-
},
|
|
1063
|
-
const e =
|
|
1070
|
+
}, Tr = () => {
|
|
1071
|
+
const e = J(Dt);
|
|
1064
1072
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1065
1073
|
return e;
|
|
1066
|
-
},
|
|
1067
|
-
const { config: t } =
|
|
1068
|
-
return /* @__PURE__ */
|
|
1069
|
-
},
|
|
1070
|
-
const t = e instanceof Element ? e.closest(
|
|
1074
|
+
}, Re = (e, t, n, r) => t.kind === "panel" ? le(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? le(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : le(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), Ar = ({ children: e }) => {
|
|
1075
|
+
const { config: t } = P(), n = ye(), r = qe(), o = r.kind === "location" ? r.location.source : void 0, l = Se(Re(t, n.navigation, o, n.currentPath));
|
|
1076
|
+
return /* @__PURE__ */ c(xe, { value: o, children: /* @__PURE__ */ c(Dt, { value: l, children: e }) });
|
|
1077
|
+
}, Lr = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Or = (e) => {
|
|
1078
|
+
const t = e instanceof Element ? e.closest(Lr) : null;
|
|
1071
1079
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1072
|
-
},
|
|
1073
|
-
const
|
|
1074
|
-
return /* @__PURE__ */
|
|
1075
|
-
if (
|
|
1076
|
-
if (
|
|
1077
|
-
|
|
1080
|
+
}, Te = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, Mr = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: l, onDocumentLink: s, scope: i, children: d }) => {
|
|
1081
|
+
const u = Se(e);
|
|
1082
|
+
return /* @__PURE__ */ c("a", { ...l, href: u, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (h) => {
|
|
1083
|
+
if (Te(h)) {
|
|
1084
|
+
if (h.preventDefault(), t === i.currentPath && n !== "") {
|
|
1085
|
+
i.scrollWithin(n);
|
|
1078
1086
|
return;
|
|
1079
1087
|
}
|
|
1080
1088
|
s(t, n);
|
|
1081
1089
|
}
|
|
1082
|
-
}, children:
|
|
1083
|
-
},
|
|
1084
|
-
const { config: s } =
|
|
1085
|
-
return
|
|
1086
|
-
},
|
|
1087
|
-
const { labels: r } =
|
|
1090
|
+
}, children: d });
|
|
1091
|
+
}, Cr = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: l }) => {
|
|
1092
|
+
const { config: s } = P(), i = ye(), d = J(xe), u = er(e), { navigation: p } = i, h = `${Re(s, p, d, t)}${u}`, b = n === !1 ? "false" : void 0;
|
|
1093
|
+
return p.kind === "page" ? /* @__PURE__ */ c(_n, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": b, children: l }) : /* @__PURE__ */ c(Mr, { to: h, docPath: t, fragment: u, exists: b, className: r, attributes: o, onDocumentLink: p.onDocumentLink, scope: i, children: l });
|
|
1094
|
+
}, Nr = ({ className: e, attributes: t, children: n }) => {
|
|
1095
|
+
const { labels: r } = P();
|
|
1088
1096
|
return (
|
|
1089
|
-
/* @__PURE__ */
|
|
1097
|
+
/* @__PURE__ */ z("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
|
|
1090
1098
|
n,
|
|
1091
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ z("span", { className: "aqmx-sr-only", children: [
|
|
1092
1100
|
" (",
|
|
1093
1101
|
r.inertLink,
|
|
1094
1102
|
")"
|
|
1095
1103
|
] })
|
|
1096
1104
|
] })
|
|
1097
1105
|
);
|
|
1098
|
-
},
|
|
1099
|
-
const { config: l } =
|
|
1100
|
-
return /* @__PURE__ */
|
|
1101
|
-
|
|
1106
|
+
}, Pr = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1107
|
+
const { config: l } = P(), s = J(xe), i = Se(`${Re(l, r.navigation, s, r.currentPath)}${e}`);
|
|
1108
|
+
return /* @__PURE__ */ c("a", { ...n, href: i, className: t, onClick: (u) => {
|
|
1109
|
+
Te(u) && (u.preventDefault(), r.scrollWithin(e));
|
|
1102
1110
|
}, children: o });
|
|
1103
|
-
},
|
|
1104
|
-
const o =
|
|
1105
|
-
return o.navigation.kind === "page" ? /* @__PURE__ */
|
|
1106
|
-
if (!
|
|
1107
|
-
const
|
|
1108
|
-
e === "#" ? o.followEmptyFragment(s.nativeEvent) :
|
|
1109
|
-
}, children: r }) : /* @__PURE__ */
|
|
1110
|
-
},
|
|
1111
|
-
const { config: e } =
|
|
1112
|
-
return
|
|
1111
|
+
}, $r = ({ href: e, className: t, attributes: n, children: r }) => {
|
|
1112
|
+
const o = ye();
|
|
1113
|
+
return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (s) => {
|
|
1114
|
+
if (!Te(s)) return;
|
|
1115
|
+
const i = s.currentTarget;
|
|
1116
|
+
e === "#" ? o.followEmptyFragment(s.nativeEvent) : i.href === i.ownerDocument.URL && o.followSameUrlJump(e, s.nativeEvent);
|
|
1117
|
+
}, children: r }) : /* @__PURE__ */ c(Pr, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1118
|
+
}, Fr = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: l, children: s }) => t === "doc" ? n === void 0 || !dn(n) ? /* @__PURE__ */ c(Nr, { className: o, attributes: l, children: s }) : /* @__PURE__ */ c(Cr, { href: e, docPath: n, docExists: r, className: o, attributes: l, children: s }) : e.startsWith("#") ? /* @__PURE__ */ c($r, { href: e, className: o, attributes: l, children: s }) : /* @__PURE__ */ c("a", { ...l, href: e, className: o, children: s }), Dr = () => {
|
|
1119
|
+
const { config: e } = P(), t = ye(), n = J(xe), r = Be();
|
|
1120
|
+
return C(
|
|
1113
1121
|
(o, l) => {
|
|
1114
|
-
if (!
|
|
1122
|
+
if (!Te(l)) return !0;
|
|
1115
1123
|
l.preventDefault();
|
|
1116
|
-
const s =
|
|
1117
|
-
return
|
|
1124
|
+
const s = Nt(o.id), { navigation: i } = t;
|
|
1125
|
+
return i.kind === "panel" || ze(l.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(s), !0) : (r(`${Re(e, i, n, t.currentPath)}${s}`, "follow-link"), !0);
|
|
1118
1126
|
},
|
|
1119
1127
|
[e, t, n, r]
|
|
1120
1128
|
);
|
|
1121
|
-
},
|
|
1122
|
-
const e =
|
|
1123
|
-
return
|
|
1129
|
+
}, qr = () => {
|
|
1130
|
+
const e = Tr();
|
|
1131
|
+
return C((t) => `${e}${Nt(t.id)}`, [e]);
|
|
1124
1132
|
};
|
|
1125
|
-
function
|
|
1133
|
+
function _r({
|
|
1126
1134
|
title: e,
|
|
1127
1135
|
titleId: t,
|
|
1128
1136
|
...n
|
|
@@ -1141,8 +1149,8 @@ function Nr({
|
|
|
1141
1149
|
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"
|
|
1142
1150
|
}));
|
|
1143
1151
|
}
|
|
1144
|
-
const
|
|
1145
|
-
function
|
|
1152
|
+
const Br = /* @__PURE__ */ x.forwardRef(_r);
|
|
1153
|
+
function jr({
|
|
1146
1154
|
title: e,
|
|
1147
1155
|
titleId: t,
|
|
1148
1156
|
...n
|
|
@@ -1163,8 +1171,8 @@ function $r({
|
|
|
1163
1171
|
clipRule: "evenodd"
|
|
1164
1172
|
}));
|
|
1165
1173
|
}
|
|
1166
|
-
const
|
|
1167
|
-
function
|
|
1174
|
+
const zr = /* @__PURE__ */ x.forwardRef(jr);
|
|
1175
|
+
function Hr({
|
|
1168
1176
|
title: e,
|
|
1169
1177
|
titleId: t,
|
|
1170
1178
|
...n
|
|
@@ -1185,41 +1193,47 @@ function Fr({
|
|
|
1185
1193
|
clipRule: "evenodd"
|
|
1186
1194
|
}));
|
|
1187
1195
|
}
|
|
1188
|
-
const
|
|
1196
|
+
const Ir = /* @__PURE__ */ x.forwardRef(Hr), Zr = Object.freeze({ className: "aqmx-document-stage" }), Ur = (e) => {
|
|
1189
1197
|
switch (e) {
|
|
1190
1198
|
case "video":
|
|
1191
|
-
return /* @__PURE__ */
|
|
1199
|
+
return /* @__PURE__ */ c(zr, {});
|
|
1192
1200
|
case "audio":
|
|
1193
|
-
return /* @__PURE__ */
|
|
1201
|
+
return /* @__PURE__ */ c(Ir, {});
|
|
1194
1202
|
case "pdf":
|
|
1195
|
-
return /* @__PURE__ */
|
|
1203
|
+
return /* @__PURE__ */ c(Br, {});
|
|
1196
1204
|
default: {
|
|
1197
1205
|
const t = e;
|
|
1198
1206
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
|
|
1199
1207
|
}
|
|
1200
1208
|
}
|
|
1201
|
-
},
|
|
1202
|
-
const { labels: t } =
|
|
1209
|
+
}, Vr = ({ document: e }) => {
|
|
1210
|
+
const { labels: t } = P();
|
|
1203
1211
|
switch (e.mediaType) {
|
|
1204
1212
|
case "video":
|
|
1205
1213
|
return (
|
|
1206
|
-
/* @__PURE__ */
|
|
1214
|
+
/* @__PURE__ */ c("video", { className: "aqmx-document-video", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
|
|
1207
1215
|
);
|
|
1208
1216
|
case "audio":
|
|
1209
1217
|
return (
|
|
1210
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ c("audio", { className: "aqmx-document-audio", src: e.url, controls: !0, preload: "metadata", "aria-label": e.name, "data-testid": "markdown-explorer-media-player", children: t.mediaUnsupported })
|
|
1211
1219
|
);
|
|
1212
1220
|
case "pdf":
|
|
1213
|
-
return /* @__PURE__ */
|
|
1221
|
+
return /* @__PURE__ */ c("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" });
|
|
1214
1222
|
default: {
|
|
1215
1223
|
const n = e.mediaType;
|
|
1216
1224
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
|
|
1217
1225
|
}
|
|
1218
1226
|
}
|
|
1219
|
-
},
|
|
1220
|
-
/* @__PURE__ */
|
|
1221
|
-
/* @__PURE__ */
|
|
1222
|
-
] }),
|
|
1227
|
+
}, Gr = ({ document: e }) => /* @__PURE__ */ z("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
|
|
1228
|
+
/* @__PURE__ */ c(ke, { name: e.name, url: e.url, icon: Ur(e.mediaType) }),
|
|
1229
|
+
/* @__PURE__ */ c(de, { scrollerProps: Zr, children: /* @__PURE__ */ c(Vr, { document: e }) })
|
|
1230
|
+
] }), qt = (e) => {
|
|
1231
|
+
const { markupViews: t } = P(), n = C(() => t.isShown(e), [t, e]);
|
|
1232
|
+
return Q(t.subscribe, n, n);
|
|
1233
|
+
}, Wr = (e) => {
|
|
1234
|
+
const { documents: t, markupViews: n } = P(), r = C(() => t.peek(e), [t, e]), o = C(() => t.peekSeeded(e), [t, e]), l = Q(t.subscribe, r, o), s = qt(e), i = C(() => n.toggle(e), [n, e]);
|
|
1235
|
+
return { available: ie(l)?.document.kind === "markdown", shown: s, toggle: i };
|
|
1236
|
+
}, Kr = (e) => ({
|
|
1223
1237
|
loading: e.viewerLoading,
|
|
1224
1238
|
errorPrefix: e.viewerErrorPrefix,
|
|
1225
1239
|
styleTitle: e.viewerStyleTitle,
|
|
@@ -1253,190 +1267,205 @@ const _r = /* @__PURE__ */ x.forwardRef(Fr), qr = Object.freeze({ className: "aq
|
|
|
1253
1267
|
embeddedVideo: e.viewerEmbeddedVideo,
|
|
1254
1268
|
embeddedPost: e.viewerEmbeddedPost,
|
|
1255
1269
|
embeddedFrame: e.viewerEmbeddedFrame
|
|
1256
|
-
}),
|
|
1270
|
+
}), _t = (e, t, n) => {
|
|
1257
1271
|
if (t !== void 0) return t;
|
|
1258
1272
|
if (n !== void 0) return n;
|
|
1259
1273
|
const [r] = e.documentStyles;
|
|
1260
1274
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
1261
1275
|
return r.name;
|
|
1262
|
-
},
|
|
1276
|
+
}, Bt = (e, t) => e !== void 0 ? e : t !== void 0 ? t : Sn, jt = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), Yr = (e, t, n) => {
|
|
1263
1277
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
1264
1278
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
1265
1279
|
return t.view === "single" ? le(e, { view: "single", source: t.source, doc: t.doc, overrides: r, embed: t.embed }) : le(e, { view: "tree", source: t.source, doc: t.doc, overrides: r });
|
|
1266
|
-
},
|
|
1267
|
-
const
|
|
1280
|
+
}, He = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: l, intent: s, children: i }) => {
|
|
1281
|
+
const d = J(Ee);
|
|
1268
1282
|
return (
|
|
1269
|
-
/* @__PURE__ */
|
|
1270
|
-
|
|
1271
|
-
|
|
1283
|
+
/* @__PURE__ */ z("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": d, className: "aqmx-document", ...s, children: [
|
|
1284
|
+
r ? /* @__PURE__ */ c("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
|
|
1285
|
+
i
|
|
1272
1286
|
] })
|
|
1273
1287
|
);
|
|
1274
|
-
},
|
|
1275
|
-
const { labels: e } =
|
|
1276
|
-
return /* @__PURE__ */
|
|
1277
|
-
},
|
|
1278
|
-
const { labels: t } =
|
|
1279
|
-
return /* @__PURE__ */
|
|
1280
|
-
/* @__PURE__ */
|
|
1281
|
-
/* @__PURE__ */
|
|
1288
|
+
}, Xr = () => {
|
|
1289
|
+
const { labels: e } = P();
|
|
1290
|
+
return /* @__PURE__ */ c(He, { kind: "empty", label: e.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: e.documentEmpty }) }) });
|
|
1291
|
+
}, zt = ({ label: e }) => {
|
|
1292
|
+
const { labels: t } = P();
|
|
1293
|
+
return /* @__PURE__ */ z(He, { kind: "loading", label: e, stale: !1, busy: !0, children: [
|
|
1294
|
+
/* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: jt.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
|
|
1295
|
+
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
1282
1296
|
] });
|
|
1283
|
-
},
|
|
1284
|
-
const { reportMathDiagnostics: r } =
|
|
1285
|
-
return /* @__PURE__ */
|
|
1286
|
-
},
|
|
1287
|
-
const { labels: n } =
|
|
1288
|
-
return /* @__PURE__ */
|
|
1289
|
-
/* @__PURE__ */
|
|
1290
|
-
e.truncated ? /* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */
|
|
1297
|
+
}, Jr = ({ path: e, document: t, viewer: n }) => {
|
|
1298
|
+
const { reportMathDiagnostics: r } = P(), o = H(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), l = Dr(), s = qr(), i = H(() => r === void 0 ? void 0 : (d) => r(e, d), [r, e]);
|
|
1299
|
+
return /* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(bt, { ...n, onHeadingSelect: l, headingHref: s, onMathDiagnostics: i, parseResult: o, content: null }) });
|
|
1300
|
+
}, Ht = ({ document: e, viewer: t }) => {
|
|
1301
|
+
const { labels: n } = P();
|
|
1302
|
+
return /* @__PURE__ */ z(wt, { children: [
|
|
1303
|
+
/* @__PURE__ */ c(ke, { name: e.name, url: e.url, icon: /* @__PURE__ */ c(qn, {}) }),
|
|
1304
|
+
e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
1305
|
+
/* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(bt, { ...t, parseResult: null, content: e.text }) })
|
|
1292
1306
|
] });
|
|
1293
|
-
},
|
|
1307
|
+
}, Qr = ({ path: e, name: t, viewer: n }) => {
|
|
1308
|
+
const { data: r, documents: o, announcer: l, labels: s } = P(), i = C(() => o.answerStampOf(e), [o, e]), d = Q(o.subscribe, i, i), [u, p] = Z(0), h = H(() => ({ path: e, stamp: d, attempt: u }), [e, d, u]), [b, T] = Z(null), y = ne((k) => {
|
|
1309
|
+
T(k), k.kind === "failure" && l.announce(s.documentFailed(t, ae(s, k.failure.reason)));
|
|
1310
|
+
});
|
|
1311
|
+
ee(() => {
|
|
1312
|
+
const k = new AbortController();
|
|
1313
|
+
return r.text(h.path, k.signal).then(($) => {
|
|
1314
|
+
"kind" in $ && y($);
|
|
1315
|
+
}), () => k.abort();
|
|
1316
|
+
}, [r, h]);
|
|
1317
|
+
const L = C(() => p((k) => k + 1), []);
|
|
1318
|
+
return b === null ? /* @__PURE__ */ z(wt, { children: [
|
|
1319
|
+
/* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: jt.map((k) => /* @__PURE__ */ c("span", {}, k)) }),
|
|
1320
|
+
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: s.markupLoading })
|
|
1321
|
+
] }) : b.kind === "failure" ? /* @__PURE__ */ c(de, { scrollerProps: It, children: /* @__PURE__ */ c(Tt, { failure: b.failure, alert: !1, onRetry: L, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(Ht, { document: b, viewer: n });
|
|
1322
|
+
}, It = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), eo = ({ path: e, document: t, markup: n, viewer: r, onRetry: o }) => {
|
|
1294
1323
|
switch (t.kind) {
|
|
1295
1324
|
case "markdown":
|
|
1296
|
-
return /* @__PURE__ */
|
|
1325
|
+
return n ? /* @__PURE__ */ c(Qr, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(Jr, { path: e, document: t, viewer: r });
|
|
1297
1326
|
case "text":
|
|
1298
|
-
return /* @__PURE__ */
|
|
1327
|
+
return /* @__PURE__ */ c(Ht, { document: t, viewer: r });
|
|
1299
1328
|
case "image":
|
|
1300
|
-
return /* @__PURE__ */
|
|
1329
|
+
return /* @__PURE__ */ c(Rr, { document: t });
|
|
1301
1330
|
case "media":
|
|
1302
|
-
return /* @__PURE__ */
|
|
1331
|
+
return /* @__PURE__ */ c(Gr, { document: t });
|
|
1303
1332
|
case "file":
|
|
1304
|
-
return /* @__PURE__ */
|
|
1333
|
+
return /* @__PURE__ */ c(Qn, { document: t });
|
|
1305
1334
|
case "failure":
|
|
1306
|
-
return /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ c(de, { scrollerProps: It, children: /* @__PURE__ */ c(Tt, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
|
|
1307
1336
|
default: {
|
|
1308
|
-
const
|
|
1309
|
-
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(
|
|
1337
|
+
const l = t;
|
|
1338
|
+
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(l)}`);
|
|
1310
1339
|
}
|
|
1311
1340
|
}
|
|
1312
|
-
},
|
|
1313
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null :
|
|
1341
|
+
}, to = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', no = (e, t, n) => {
|
|
1342
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : $t(e, n), r === void 0 ? null : Pt(e, r.id), e.querySelector(je), e.querySelector(to)];
|
|
1314
1343
|
for (const l of o)
|
|
1315
|
-
if (l instanceof HTMLElement &&
|
|
1344
|
+
if (l instanceof HTMLElement && At(l)) return l;
|
|
1316
1345
|
return null;
|
|
1317
|
-
},
|
|
1346
|
+
}, ct = (e, t, n) => {
|
|
1318
1347
|
const { activeElement: r, body: o } = e.ownerDocument, l = r === null || r === o;
|
|
1319
|
-
t instanceof HTMLElement && n && (l || e.contains(r)) &&
|
|
1320
|
-
},
|
|
1348
|
+
t instanceof HTMLElement && n && (l || e.contains(r)) && At(t);
|
|
1349
|
+
}, ro = (e) => {
|
|
1321
1350
|
const t = j(!1);
|
|
1322
|
-
return
|
|
1351
|
+
return G(() => {
|
|
1323
1352
|
const n = e.current;
|
|
1324
1353
|
if (n === null) throw new Error("[markdown-explorer] the document region is not mounted");
|
|
1325
1354
|
const r = n.ownerDocument, o = r.defaultView;
|
|
1326
1355
|
if (o === null) throw new Error("[markdown-explorer] the document region's document has no window");
|
|
1327
1356
|
let l = !1, s;
|
|
1328
|
-
const
|
|
1357
|
+
const i = (b) => {
|
|
1329
1358
|
l = !(b.target instanceof Node && n.contains(b.target)), l && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(s), s = setTimeout(() => {
|
|
1330
1359
|
l = !1;
|
|
1331
1360
|
}, 0);
|
|
1332
|
-
},
|
|
1361
|
+
}, d = (b) => {
|
|
1333
1362
|
t.current = b.target instanceof Node && n.contains(b.target);
|
|
1334
|
-
},
|
|
1363
|
+
}, u = (b) => {
|
|
1335
1364
|
b.relatedTarget === null && l && (t.current = !1);
|
|
1336
|
-
},
|
|
1337
|
-
const { activeElement: b, body:
|
|
1338
|
-
b !== null && b !==
|
|
1339
|
-
},
|
|
1365
|
+
}, p = () => {
|
|
1366
|
+
const { activeElement: b, body: T } = r;
|
|
1367
|
+
b !== null && b !== T && (t.current = n.contains(b));
|
|
1368
|
+
}, h = () => {
|
|
1340
1369
|
l && !n.contains(r.activeElement) && (t.current = !1);
|
|
1341
1370
|
};
|
|
1342
|
-
return o.addEventListener("pointerdown",
|
|
1343
|
-
clearTimeout(s), o.removeEventListener("pointerdown",
|
|
1371
|
+
return o.addEventListener("pointerdown", i, !0), o.addEventListener("mousedown", i, !0), o.addEventListener("focusin", d, !0), o.addEventListener("blur", p), o.addEventListener("focus", h), n.addEventListener("focusout", u), () => {
|
|
1372
|
+
clearTimeout(s), o.removeEventListener("pointerdown", i, !0), o.removeEventListener("mousedown", i, !0), o.removeEventListener("focusin", d, !0), o.removeEventListener("blur", p), o.removeEventListener("focus", h), n.removeEventListener("focusout", u);
|
|
1344
1373
|
};
|
|
1345
1374
|
}, [e]), t;
|
|
1346
|
-
},
|
|
1347
|
-
const { labels:
|
|
1348
|
-
(
|
|
1349
|
-
const
|
|
1350
|
-
|
|
1375
|
+
}, oo = ({ path: e, snapshot: t, stale: n, viewer: r, regionLabel: o, navigation: l, fragment: s, paneScroll: i, announces: d, announceFailure: u, onDocumentShown: p }) => {
|
|
1376
|
+
const { labels: h, announcer: b, documents: T } = P(), { document: y } = t, L = j(null), k = j(null), $ = j(null), O = j(0), m = ro(L), w = j({ path: e, document: y }), S = j(null), E = C(
|
|
1377
|
+
(g) => {
|
|
1378
|
+
const v = L.current, A = ot(v, g, i);
|
|
1379
|
+
v !== null && A !== null && ct(v, A, m.current);
|
|
1351
1380
|
},
|
|
1352
|
-
[
|
|
1353
|
-
),
|
|
1354
|
-
(
|
|
1355
|
-
const
|
|
1381
|
+
[i, m]
|
|
1382
|
+
), R = C(
|
|
1383
|
+
(g, v) => {
|
|
1384
|
+
const A = O.current;
|
|
1356
1385
|
setTimeout(() => {
|
|
1357
|
-
!
|
|
1386
|
+
!v.defaultPrevented && O.current === A && E(g);
|
|
1358
1387
|
}, 0);
|
|
1359
1388
|
},
|
|
1360
1389
|
[E]
|
|
1361
|
-
),
|
|
1362
|
-
(
|
|
1390
|
+
), F = C(
|
|
1391
|
+
(g) => {
|
|
1363
1392
|
setTimeout(() => {
|
|
1364
|
-
|
|
1393
|
+
g.defaultPrevented || E("#");
|
|
1365
1394
|
}, 0);
|
|
1366
1395
|
},
|
|
1367
1396
|
[E]
|
|
1368
|
-
), I = H(() => ({ navigation: l, currentPath: e, scrollWithin: E, followSameUrlJump:
|
|
1369
|
-
const
|
|
1370
|
-
if (
|
|
1371
|
-
|
|
1372
|
-
const
|
|
1373
|
-
if (
|
|
1374
|
-
|
|
1397
|
+
), I = H(() => ({ navigation: l, currentPath: e, scrollWithin: E, followSameUrlJump: R, followEmptyFragment: F }), [l, e, E, R, F]), N = C(() => T.retry(e), [T, e]), B = Bn(T, Or), W = qt(e) ? "markup" : "rendered", U = y.kind === "markdown" ? W : void 0, q = ne((g, v) => {
|
|
1398
|
+
const A = k.current;
|
|
1399
|
+
if (A !== null && A.path === g && A.snapshot === v) return;
|
|
1400
|
+
k.current = { path: g, snapshot: v };
|
|
1401
|
+
const M = v.document;
|
|
1402
|
+
if (M.kind === "failure") {
|
|
1403
|
+
T.noteFailureShown(v) && u(h.documentFailed(Et(g), ae(h, M.failure.reason)));
|
|
1375
1404
|
return;
|
|
1376
1405
|
}
|
|
1377
|
-
|
|
1406
|
+
p?.(g, M), d && (A === null || A.path !== g || A.snapshot.document.kind === "failure") && b.announce(h.documentShown(M.name));
|
|
1378
1407
|
});
|
|
1379
|
-
|
|
1380
|
-
|
|
1408
|
+
ee(() => {
|
|
1409
|
+
q(e, t);
|
|
1381
1410
|
}, [e, t]);
|
|
1382
|
-
const
|
|
1411
|
+
const V = ne(() => {
|
|
1383
1412
|
s.kind === "panel" && s.consume();
|
|
1384
|
-
}),
|
|
1385
|
-
const
|
|
1386
|
-
if (
|
|
1387
|
-
const { activeElement:
|
|
1388
|
-
return
|
|
1389
|
-
}),
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1392
|
-
}),
|
|
1393
|
-
return
|
|
1413
|
+
}), K = ne((g) => {
|
|
1414
|
+
const v = L.current;
|
|
1415
|
+
if (v === null || !m.current) return null;
|
|
1416
|
+
const { activeElement: A, body: M } = v.ownerDocument;
|
|
1417
|
+
return A !== null && A !== M ? null : no(v, y, g);
|
|
1418
|
+
}), Ae = ne((g) => {
|
|
1419
|
+
const v = L.current;
|
|
1420
|
+
v !== null && ct(v, g, m.current);
|
|
1421
|
+
}), a = ne((g) => i.reveal(g)), f = ne((g) => ot(L.current, g, i));
|
|
1422
|
+
return ee(() => {
|
|
1394
1423
|
if (n) return;
|
|
1395
|
-
const
|
|
1396
|
-
|
|
1397
|
-
const
|
|
1424
|
+
const g = w.current.path !== e, v = g || w.current.document !== y;
|
|
1425
|
+
w.current = { path: e, document: y };
|
|
1426
|
+
const A = S.current !== e;
|
|
1398
1427
|
S.current = e;
|
|
1399
|
-
let
|
|
1400
|
-
s.kind === "page" ?
|
|
1401
|
-
const
|
|
1402
|
-
const
|
|
1403
|
-
if (!
|
|
1404
|
-
|
|
1428
|
+
let M = null;
|
|
1429
|
+
s.kind === "page" ? $.current !== s.navigation && ($.current = s.navigation, O.current += 1, M = s.fragment) : s.fragment !== null && (M = s.fragment, V());
|
|
1430
|
+
const _ = () => {
|
|
1431
|
+
const D = M === null ? null : f(M);
|
|
1432
|
+
if (!v) {
|
|
1433
|
+
D !== null && Ae(D);
|
|
1405
1434
|
return;
|
|
1406
1435
|
}
|
|
1407
|
-
const
|
|
1408
|
-
|
|
1436
|
+
const Y = K(s.fragment);
|
|
1437
|
+
g && D === null && Y !== null && a(Y);
|
|
1409
1438
|
};
|
|
1410
|
-
|
|
1411
|
-
}, [s, e,
|
|
1412
|
-
},
|
|
1439
|
+
A ? queueMicrotask(_) : _();
|
|
1440
|
+
}, [s, e, y, n]), /* @__PURE__ */ c(He, { kind: y.kind, view: U, label: o(e, y), stale: n, busy: n, frameRef: L, intent: B, children: /* @__PURE__ */ c(Ft, { value: I, children: /* @__PURE__ */ c(Ar, { children: /* @__PURE__ */ c(eo, { path: e, document: y, markup: U === "markup", viewer: r, onRetry: N }, e) }) }) });
|
|
1441
|
+
}, Ie = Object.freeze({ kind: "skeleton" }), lo = (e, t, n, r, o) => {
|
|
1413
1442
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
1414
|
-
const l =
|
|
1443
|
+
const l = ie(t);
|
|
1415
1444
|
if (l !== null) return { kind: "document", path: e, snapshot: l, stale: !0 };
|
|
1416
1445
|
if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
|
|
1417
|
-
const s = n === null || n === e ? null :
|
|
1418
|
-
return n === null || s === null ?
|
|
1419
|
-
},
|
|
1420
|
-
const r = t.kind === "streaming" ?
|
|
1421
|
-
return r.kind !== "document" ? /* @__PURE__ */
|
|
1422
|
-
},
|
|
1423
|
-
const { config:
|
|
1424
|
-
|
|
1425
|
-
|
|
1446
|
+
const s = n === null || n === e ? null : ie(r);
|
|
1447
|
+
return n === null || s === null ? Ie : { kind: "document", path: n, snapshot: s, stale: !0 };
|
|
1448
|
+
}, so = (e, t) => t.status === "deferred" ? Ie : { kind: "document", path: e, snapshot: t, stale: !1 }, io = ({ requestedPath: e, content: t, ...n }) => {
|
|
1449
|
+
const r = t.kind === "streaming" ? so(t.path, J(t.promise)) : t;
|
|
1450
|
+
return r.kind !== "document" ? /* @__PURE__ */ c(zt, { label: n.regionLabel(e, null) }) : /* @__PURE__ */ c(oo, { path: r.path, snapshot: r.snapshot, stale: r.stale, ...n });
|
|
1451
|
+
}, Zt = ({ path: e, display: t, navigation: n, fragment: r, paneScroll: o, announces: l, announceFailure: s, onDocumentShown: i }) => {
|
|
1452
|
+
const { config: d, labels: u, theme: p, documents: h } = P(), b = cn(), T = j(!1);
|
|
1453
|
+
G(() => {
|
|
1454
|
+
T.current = !0;
|
|
1426
1455
|
}, []);
|
|
1427
|
-
const [
|
|
1428
|
-
|
|
1429
|
-
const
|
|
1430
|
-
S !==
|
|
1431
|
-
const E = H(() =>
|
|
1456
|
+
const [y, L] = Z(null), k = C(() => e === null ? void 0 : h.peek(e), [h, e]), $ = Q(h.subscribe, k, k), O = C(() => y === null ? void 0 : h.peek(y), [h, y]), m = Q(h.subscribe, O, O);
|
|
1457
|
+
G(() => e === null ? void 0 : h.open(e), [h, e]), G(() => y === null ? void 0 : h.retain(y), [h, y]);
|
|
1458
|
+
const w = e === null ? Ie : lo(e, $, y, m, !T.current), S = e === null ? null : w.kind === "document" && !w.stale ? w.path : y;
|
|
1459
|
+
S !== y && L(S);
|
|
1460
|
+
const E = H(() => Kr(u), [u]), R = H(() => [...d.iframeHosts], [d]), F = n.kind === "panel", I = H(
|
|
1432
1461
|
() => ({
|
|
1433
1462
|
labels: E,
|
|
1434
|
-
emptyMessage:
|
|
1435
|
-
theme:
|
|
1436
|
-
availableStyles:
|
|
1437
|
-
iFrameAllowedDomains:
|
|
1438
|
-
embeds:
|
|
1439
|
-
linkComponent:
|
|
1463
|
+
emptyMessage: u.documentEmpty,
|
|
1464
|
+
theme: p,
|
|
1465
|
+
availableStyles: d.documentStyles,
|
|
1466
|
+
iFrameAllowedDomains: R,
|
|
1467
|
+
embeds: d.embeds,
|
|
1468
|
+
linkComponent: Fr,
|
|
1440
1469
|
toolbar: b,
|
|
1441
1470
|
style: t.style,
|
|
1442
1471
|
onStyleChange: t.onStyleChange,
|
|
@@ -1448,64 +1477,64 @@ const _r = /* @__PURE__ */ x.forwardRef(Fr), qr = Object.freeze({ className: "aq
|
|
|
1448
1477
|
padding: t.padding,
|
|
1449
1478
|
width: t.width === void 0 ? void 0 : `min(${t.width}, 100%)`,
|
|
1450
1479
|
maxWidth: t.maxWidth === void 0 ? void 0 : `min(${t.maxWidth}, 100%)`,
|
|
1451
|
-
renderScrollBar:
|
|
1480
|
+
renderScrollBar: F ? void 0 : Lt
|
|
1452
1481
|
}),
|
|
1453
|
-
[E,
|
|
1454
|
-
),
|
|
1455
|
-
return e === null ? /* @__PURE__ */
|
|
1456
|
-
},
|
|
1457
|
-
const { config: r, viewSettings: o, announcer: l } =
|
|
1458
|
-
(
|
|
1459
|
-
if (
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1482
|
+
[E, u.documentEmpty, p, d.documentStyles, R, d.embeds, b, t, F]
|
|
1483
|
+
), N = C((W, U) => F ? U === null || U.kind === "failure" ? Et(W) : U.name : u.documentRegion, [F, u.documentRegion]), B = F ? "content" : "fill";
|
|
1484
|
+
return e === null ? /* @__PURE__ */ c(Ee, { value: B, children: /* @__PURE__ */ c(Xr, {}) }) : /* @__PURE__ */ c(Ee, { value: B, children: /* @__PURE__ */ c(we, { fallback: /* @__PURE__ */ c(zt, { label: N(e, null) }), children: /* @__PURE__ */ c(io, { requestedPath: e, content: w, viewer: I, regionLabel: N, navigation: n, fragment: r, paneScroll: o, announces: l, announceFailure: s, onDocumentShown: i }) }) });
|
|
1485
|
+
}, ao = ({ path: e, variant: t, onDocumentShown: n }) => {
|
|
1486
|
+
const { config: r, viewSettings: o, announcer: l } = P(), s = ve((R) => R.style), i = ve((R) => R.align), d = Be(), u = vt(), p = qe(), { view: h, overrides: b, embed: T } = t, y = C(
|
|
1487
|
+
(R) => {
|
|
1488
|
+
if (p.kind !== "location") return;
|
|
1489
|
+
const F = Yr(r, p.location, R);
|
|
1490
|
+
F !== null && d(F, "browse");
|
|
1462
1491
|
},
|
|
1463
|
-
[r,
|
|
1464
|
-
),
|
|
1465
|
-
(
|
|
1466
|
-
o.update({ style:
|
|
1492
|
+
[r, d, p]
|
|
1493
|
+
), L = C(
|
|
1494
|
+
(R) => {
|
|
1495
|
+
o.update({ style: R }), y("style");
|
|
1467
1496
|
},
|
|
1468
|
-
[o,
|
|
1469
|
-
),
|
|
1470
|
-
(
|
|
1471
|
-
o.update({ align:
|
|
1497
|
+
[o, y]
|
|
1498
|
+
), k = C(
|
|
1499
|
+
(R) => {
|
|
1500
|
+
o.update({ align: R }), y("align");
|
|
1472
1501
|
},
|
|
1473
|
-
[o,
|
|
1474
|
-
),
|
|
1502
|
+
[o, y]
|
|
1503
|
+
), $ = _t(r, b.style, s), O = Bt(b.align, i), m = H(
|
|
1475
1504
|
() => ({
|
|
1476
|
-
style:
|
|
1477
|
-
onStyleChange:
|
|
1505
|
+
style: $,
|
|
1506
|
+
onStyleChange: L,
|
|
1478
1507
|
align: O,
|
|
1479
|
-
onAlignChange:
|
|
1480
|
-
showToc:
|
|
1481
|
-
showStyle:
|
|
1482
|
-
showAlign:
|
|
1483
|
-
padding:
|
|
1484
|
-
width:
|
|
1485
|
-
maxWidth:
|
|
1508
|
+
onAlignChange: k,
|
|
1509
|
+
showToc: T.showToc !== !1,
|
|
1510
|
+
showStyle: T.showStyle !== !1,
|
|
1511
|
+
showAlign: T.showAlign !== !1,
|
|
1512
|
+
padding: T.padding,
|
|
1513
|
+
width: T.width,
|
|
1514
|
+
maxWidth: T.maxWidth
|
|
1486
1515
|
}),
|
|
1487
|
-
[
|
|
1488
|
-
),
|
|
1489
|
-
return /* @__PURE__ */
|
|
1490
|
-
},
|
|
1491
|
-
const { config: r, viewSettings: o } =
|
|
1516
|
+
[$, L, O, k, T]
|
|
1517
|
+
), w = H(() => ({ kind: "page", view: h, overrides: b, embed: T }), [h, b, T]), S = H(() => ({ kind: "page", fragment: u.hash, navigation: u }), [u]), E = C((R) => l.announce(R), [l]);
|
|
1518
|
+
return /* @__PURE__ */ c(Zt, { path: e, display: m, navigation: w, fragment: S, paneScroll: sr, announces: !0, announceFailure: E, onDocumentShown: n });
|
|
1519
|
+
}, co = ({ path: e, variant: t, onDocumentShown: n }) => {
|
|
1520
|
+
const { config: r, viewSettings: o } = P(), l = ve((w) => w.style), s = ve((w) => w.align), [i, d] = Z(() => _t(r, void 0, l)), u = Bt(void 0, s), p = C((w) => o.update({ align: w }), [o]), { maximized: h, onDocumentLink: b, pendingHash: T, onHashConsumed: y, announceFailure: L, paneScroll: k } = t, $ = H(
|
|
1492
1521
|
() => ({
|
|
1493
|
-
style:
|
|
1494
|
-
onStyleChange:
|
|
1495
|
-
align:
|
|
1496
|
-
onAlignChange:
|
|
1497
|
-
showToc:
|
|
1498
|
-
showStyle:
|
|
1499
|
-
showAlign:
|
|
1522
|
+
style: i,
|
|
1523
|
+
onStyleChange: d,
|
|
1524
|
+
align: u,
|
|
1525
|
+
onAlignChange: p,
|
|
1526
|
+
showToc: h,
|
|
1527
|
+
showStyle: h,
|
|
1528
|
+
showAlign: h,
|
|
1500
1529
|
padding: void 0,
|
|
1501
1530
|
width: void 0,
|
|
1502
1531
|
maxWidth: void 0
|
|
1503
1532
|
}),
|
|
1504
|
-
[
|
|
1505
|
-
), O = H(() => ({ kind: "panel", onDocumentLink: b }), [b]),
|
|
1506
|
-
return /* @__PURE__ */
|
|
1507
|
-
},
|
|
1508
|
-
function
|
|
1533
|
+
[i, u, p, h]
|
|
1534
|
+
), O = H(() => ({ kind: "panel", onDocumentLink: b }), [b]), m = H(() => ({ kind: "panel", fragment: T, consume: y }), [T, y]);
|
|
1535
|
+
return /* @__PURE__ */ c(Zt, { path: e, display: $, navigation: O, fragment: m, paneScroll: k, announces: !1, announceFailure: L, onDocumentShown: n });
|
|
1536
|
+
}, uo = ({ path: e, variant: t, onDocumentShown: n }) => t.kind === "page" ? /* @__PURE__ */ c(ao, { path: e, variant: t, onDocumentShown: n }) : /* @__PURE__ */ c(co, { path: e, variant: t, onDocumentShown: n });
|
|
1537
|
+
function mo({
|
|
1509
1538
|
title: e,
|
|
1510
1539
|
titleId: t,
|
|
1511
1540
|
...n
|
|
@@ -1526,169 +1555,242 @@ function io({
|
|
|
1526
1555
|
clipRule: "evenodd"
|
|
1527
1556
|
}));
|
|
1528
1557
|
}
|
|
1529
|
-
const
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1558
|
+
const fo = /* @__PURE__ */ x.forwardRef(mo);
|
|
1559
|
+
function po({
|
|
1560
|
+
title: e,
|
|
1561
|
+
titleId: t,
|
|
1562
|
+
...n
|
|
1563
|
+
}, r) {
|
|
1564
|
+
return /* @__PURE__ */ x.createElement("svg", Object.assign({
|
|
1565
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
1566
|
+
viewBox: "0 0 24 24",
|
|
1567
|
+
fill: "currentColor",
|
|
1568
|
+
"aria-hidden": "true",
|
|
1569
|
+
"data-slot": "icon",
|
|
1570
|
+
ref: r,
|
|
1571
|
+
"aria-labelledby": t
|
|
1572
|
+
}, n), e ? /* @__PURE__ */ x.createElement("title", {
|
|
1573
|
+
id: t
|
|
1574
|
+
}, e) : null, /* @__PURE__ */ x.createElement("path", {
|
|
1575
|
+
fillRule: "evenodd",
|
|
1576
|
+
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",
|
|
1577
|
+
clipRule: "evenodd"
|
|
1578
|
+
}));
|
|
1579
|
+
}
|
|
1580
|
+
const ho = /* @__PURE__ */ x.forwardRef(po), go = /* @__PURE__ */ new Set(), wo = (e, t) => {
|
|
1581
|
+
const { documents: n, announcer: r, labels: o } = P(), l = C(() => n.peek(e), [n, e]), s = C(() => n.peekSeeded(e), [n, e]), i = Q(n.subscribe, l, s), d = C(() => n.answerStampOf(e), [n, e]), u = Q(n.subscribe, d, d), [p] = Z(() => /* @__PURE__ */ new Set()), [h, b] = Z(go), [T, y] = Z(null);
|
|
1582
|
+
T !== null && T.path !== e && y(null);
|
|
1583
|
+
const L = j(null);
|
|
1584
|
+
G(() => (L.current = e, () => {
|
|
1585
|
+
L.current = null;
|
|
1535
1586
|
}), [e]);
|
|
1536
|
-
const
|
|
1537
|
-
const
|
|
1538
|
-
if (
|
|
1539
|
-
const S = t && !
|
|
1540
|
-
|
|
1587
|
+
const k = C(() => {
|
|
1588
|
+
const m = e, w = n.peek(m);
|
|
1589
|
+
if (p.has(m) || w?.status === "pending") return;
|
|
1590
|
+
const S = t && !Ct(w);
|
|
1591
|
+
p.add(m), b(new Set(p)), y(null), (async () => {
|
|
1541
1592
|
try {
|
|
1542
|
-
const E = await n.refresh(
|
|
1543
|
-
if (
|
|
1593
|
+
const E = await n.refresh(m);
|
|
1594
|
+
if (L.current !== m || E.status === "superseded") return;
|
|
1544
1595
|
if (E.status === "failed") {
|
|
1545
|
-
|
|
1596
|
+
y({ path: m, failure: E.failure, stamp: n.answerStampOf(m) }), r.announce(o.documentRefreshFailed(ae(o, E.failure.reason)));
|
|
1546
1597
|
return;
|
|
1547
1598
|
}
|
|
1548
|
-
const
|
|
1549
|
-
if (S ||
|
|
1550
|
-
r.announce(o.documentRefreshed(
|
|
1599
|
+
const R = ie(n.peek(m));
|
|
1600
|
+
if (S || R === null || R.document.kind === "failure") return;
|
|
1601
|
+
r.announce(o.documentRefreshed(R.document.name));
|
|
1551
1602
|
} finally {
|
|
1552
|
-
|
|
1603
|
+
p.delete(m), b(new Set(p));
|
|
1553
1604
|
}
|
|
1554
1605
|
})();
|
|
1555
|
-
}, [e, t,
|
|
1556
|
-
return { refreshing:
|
|
1557
|
-
},
|
|
1606
|
+
}, [e, t, p, n, r, o]), $ = h.has(e), O = T !== null && T.path === e && T.stamp === u ? T.failure : null;
|
|
1607
|
+
return { refreshing: $, unavailable: $ || i?.status === "pending", failure: O, refresh: k };
|
|
1608
|
+
}, vo = Object.freeze({ kind: "page" }), dt = (e) => {
|
|
1558
1609
|
e.stopPropagation();
|
|
1559
|
-
},
|
|
1560
|
-
const { labels: n } =
|
|
1561
|
-
return /* @__PURE__ */
|
|
1562
|
-
/* @__PURE__ */
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1610
|
+
}, bo = ({ path: e, placement: t }) => {
|
|
1611
|
+
const { labels: n } = P(), { refreshing: r, unavailable: o, failure: l, refresh: s } = wo(e, t.kind === "page"), i = Wr(e), d = t.kind === "panel" ? n.refreshDocumentNamed(t.documentName) : null, u = t.kind === "panel" ? n.showMarkupNamed(t.documentName) : null;
|
|
1612
|
+
return /* @__PURE__ */ z("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", children: [
|
|
1613
|
+
/* @__PURE__ */ z("div", { className: "aqmx-document-refresh-row", children: [
|
|
1614
|
+
i.available ? /* @__PURE__ */ z(
|
|
1615
|
+
"button",
|
|
1616
|
+
{
|
|
1617
|
+
type: "button",
|
|
1618
|
+
className: u === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
1619
|
+
title: u === null ? n.showMarkup : u,
|
|
1620
|
+
"aria-label": u === null ? void 0 : u,
|
|
1621
|
+
"aria-pressed": i.shown,
|
|
1622
|
+
"data-testid": "markdown-explorer-document-markup",
|
|
1623
|
+
onClick: i.toggle,
|
|
1624
|
+
onDoubleClick: dt,
|
|
1625
|
+
children: [
|
|
1626
|
+
/* @__PURE__ */ c(ho, { "aria-hidden": "true" }),
|
|
1627
|
+
u === null ? /* @__PURE__ */ c("span", { children: n.showMarkupLabel }) : null
|
|
1628
|
+
]
|
|
1629
|
+
}
|
|
1630
|
+
) : null,
|
|
1631
|
+
/* @__PURE__ */ z(
|
|
1632
|
+
"button",
|
|
1633
|
+
{
|
|
1634
|
+
type: "button",
|
|
1635
|
+
className: d === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
1636
|
+
title: d === null ? n.refreshDocument : d,
|
|
1637
|
+
"aria-label": d === null ? void 0 : d,
|
|
1638
|
+
"aria-disabled": o,
|
|
1639
|
+
"aria-busy": r,
|
|
1640
|
+
"data-aqmx-busy": r ? "true" : void 0,
|
|
1641
|
+
"data-testid": "markdown-explorer-document-refresh",
|
|
1642
|
+
onClick: s,
|
|
1643
|
+
onDoubleClick: dt,
|
|
1644
|
+
children: [
|
|
1645
|
+
/* @__PURE__ */ c(fo, { "aria-hidden": "true" }),
|
|
1646
|
+
d === null ? /* @__PURE__ */ c("span", { children: n.refreshDocumentLabel }) : null
|
|
1647
|
+
]
|
|
1648
|
+
}
|
|
1649
|
+
)
|
|
1650
|
+
] }),
|
|
1651
|
+
l === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: n.documentRefreshFailed(ae(n, l.reason)) })
|
|
1582
1652
|
] });
|
|
1583
|
-
},
|
|
1653
|
+
}, Eo = ({ location: e }) => {
|
|
1584
1654
|
const t = e.doc, n = H(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]);
|
|
1585
|
-
return /* @__PURE__ */
|
|
1586
|
-
/* @__PURE__ */
|
|
1587
|
-
/* @__PURE__ */
|
|
1655
|
+
return /* @__PURE__ */ z("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", children: [
|
|
1656
|
+
/* @__PURE__ */ c(bo, { path: t, placement: vo }),
|
|
1657
|
+
/* @__PURE__ */ c(uo, { path: t, variant: n })
|
|
1588
1658
|
] });
|
|
1589
|
-
},
|
|
1590
|
-
const { labels: n, announcer: r } =
|
|
1591
|
-
|
|
1592
|
-
const l =
|
|
1593
|
-
return /* @__PURE__ */
|
|
1594
|
-
},
|
|
1659
|
+
}, So = ({ holds: e, testId: t }) => {
|
|
1660
|
+
const { labels: n, announcer: r } = P(), o = Gt();
|
|
1661
|
+
G(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
1662
|
+
const l = C(() => r.shownIn(o), [r, o]), s = Q(r.subscribe, l, l);
|
|
1663
|
+
return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: s.length > 1 ? n.announcementSequence(s) : s[0] });
|
|
1664
|
+
}, re = Object.freeze([]), ko = (e) => {
|
|
1595
1665
|
const t = /* @__PURE__ */ new Set();
|
|
1596
|
-
let n =
|
|
1597
|
-
const l = [], s = (
|
|
1598
|
-
n =
|
|
1599
|
-
for (const
|
|
1600
|
-
},
|
|
1601
|
-
const
|
|
1602
|
-
|
|
1603
|
-
},
|
|
1666
|
+
let n = re, r = [], o = !1;
|
|
1667
|
+
const l = [], s = (p) => {
|
|
1668
|
+
n = p;
|
|
1669
|
+
for (const h of [...t]) h();
|
|
1670
|
+
}, i = () => l.at(-1)?.region, d = (p) => {
|
|
1671
|
+
const h = i();
|
|
1672
|
+
p(), i() !== h && n !== re && s(re);
|
|
1673
|
+
}, u = () => {
|
|
1604
1674
|
o = !1;
|
|
1605
|
-
const
|
|
1606
|
-
r = [], s(Object.freeze(
|
|
1675
|
+
const p = r.map((h) => "sentence" in h ? h.sentence : h.list(h.items));
|
|
1676
|
+
r = [], s(Object.freeze(p));
|
|
1607
1677
|
};
|
|
1608
1678
|
return {
|
|
1609
|
-
announce: (
|
|
1610
|
-
if (typeof
|
|
1679
|
+
announce: (p) => {
|
|
1680
|
+
if (typeof p == "string") r.push({ sentence: p });
|
|
1611
1681
|
else {
|
|
1612
|
-
const
|
|
1613
|
-
|
|
1682
|
+
const h = r.find((b) => "list" in b && b.list === p.list);
|
|
1683
|
+
h !== void 0 && "items" in h ? h.items.push(p.item) : r.push({ list: p.list, items: [p.item] });
|
|
1614
1684
|
}
|
|
1615
|
-
o || (o = !0, n !==
|
|
1685
|
+
o || (o = !0, n !== re && s(re), e.request(u));
|
|
1616
1686
|
},
|
|
1617
|
-
subscribe: (
|
|
1618
|
-
t.delete(
|
|
1687
|
+
subscribe: (p) => (t.add(p), () => {
|
|
1688
|
+
t.delete(p);
|
|
1619
1689
|
}),
|
|
1620
|
-
claim: (
|
|
1621
|
-
const
|
|
1622
|
-
return
|
|
1623
|
-
const b = l.indexOf(
|
|
1690
|
+
claim: (p) => {
|
|
1691
|
+
const h = { region: p };
|
|
1692
|
+
return d(() => l.push(h)), () => d(() => {
|
|
1693
|
+
const b = l.indexOf(h);
|
|
1624
1694
|
b !== -1 && l.splice(b, 1);
|
|
1625
1695
|
});
|
|
1626
1696
|
},
|
|
1627
|
-
shownIn: (
|
|
1697
|
+
shownIn: (p) => i() === p ? n : re
|
|
1628
1698
|
};
|
|
1629
|
-
},
|
|
1699
|
+
}, fe = Object.freeze({ status: "cancelled" }), xo = (e) => {
|
|
1630
1700
|
if (e === null || typeof e != "object") return null;
|
|
1631
1701
|
const { failure: t } = e;
|
|
1632
|
-
if (
|
|
1702
|
+
if (gn(t) !== null) return null;
|
|
1633
1703
|
const { reason: n, code: r } = t;
|
|
1634
|
-
return
|
|
1635
|
-
},
|
|
1636
|
-
const r = n ?? ((
|
|
1637
|
-
let
|
|
1704
|
+
return wn(n, r);
|
|
1705
|
+
}, yo = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
1706
|
+
const r = n ?? ((i, d) => globalThis.fetch(i, d)), o = (i, d) => `${e}/${i}?${new URLSearchParams(d).toString()}`, l = async (i, d, u, p) => {
|
|
1707
|
+
let h;
|
|
1638
1708
|
try {
|
|
1639
|
-
|
|
1709
|
+
h = await r(i, { credentials: "same-origin", ...d, headers: { Accept: "application/json", ...d.headers } });
|
|
1640
1710
|
} catch {
|
|
1641
|
-
return
|
|
1711
|
+
return p({ reason: "failed" });
|
|
1642
1712
|
}
|
|
1643
|
-
|
|
1644
|
-
const b =
|
|
1713
|
+
h.status === 401 && t(null);
|
|
1714
|
+
const b = h.headers.get(un);
|
|
1645
1715
|
b !== null && t(b);
|
|
1646
|
-
let
|
|
1716
|
+
let T;
|
|
1647
1717
|
try {
|
|
1648
|
-
|
|
1718
|
+
T = await h.json();
|
|
1649
1719
|
} catch {
|
|
1650
|
-
return
|
|
1720
|
+
return p({ reason: Ge(h.status) });
|
|
1651
1721
|
}
|
|
1652
|
-
let
|
|
1722
|
+
let y;
|
|
1653
1723
|
try {
|
|
1654
|
-
|
|
1724
|
+
y = u(T);
|
|
1655
1725
|
} catch {
|
|
1656
|
-
|
|
1726
|
+
y = !1;
|
|
1657
1727
|
}
|
|
1658
|
-
if (
|
|
1659
|
-
const
|
|
1660
|
-
return
|
|
1661
|
-
}, s = { [
|
|
1728
|
+
if (y) return T;
|
|
1729
|
+
const L = xo(T);
|
|
1730
|
+
return p(L !== null ? L : { reason: h.status === 200 ? "failed" : Ge(h.status) });
|
|
1731
|
+
}, s = { [En]: vn };
|
|
1662
1732
|
return {
|
|
1663
|
-
tree: (
|
|
1664
|
-
children: async (
|
|
1665
|
-
const
|
|
1666
|
-
return
|
|
1733
|
+
tree: (i) => l(o("tree", { [X.source]: i }), { method: "GET" }, Ke, (d) => ({ status: "error", failure: d })),
|
|
1734
|
+
children: async (i, d, u) => {
|
|
1735
|
+
const p = await l(o("children", { [X.source]: i, [X.path]: d }), { method: "GET", signal: u }, hn, (h) => ({ status: "error", failure: h }));
|
|
1736
|
+
return u.aborted ? fe : p;
|
|
1667
1737
|
},
|
|
1668
|
-
ancestors: async (
|
|
1669
|
-
const
|
|
1670
|
-
return
|
|
1738
|
+
ancestors: async (i, d, u) => {
|
|
1739
|
+
const p = await l(o("ancestors", { [X.source]: i, [X.path]: d }), { method: "GET", signal: u }, pn, (h) => ({ status: "error", failure: h }));
|
|
1740
|
+
return u.aborted ? fe : p;
|
|
1671
1741
|
},
|
|
1672
|
-
|
|
1673
|
-
|
|
1742
|
+
reveal: async (i, d, u) => {
|
|
1743
|
+
const p = await l(o("reveal", { [X.source]: i, [X.path]: d }), { method: "GET", signal: u }, fn, (h) => ({ status: "error", failure: h }));
|
|
1744
|
+
return u.aborted ? fe : p;
|
|
1745
|
+
},
|
|
1746
|
+
document: (i, { refresh: d }) => l(o("document", { [X.path]: i }), d ? { method: "GET", headers: s } : { method: "GET" }, bn, (u) => We(u.reason, u.code)),
|
|
1747
|
+
text: async (i, d) => {
|
|
1748
|
+
const u = await l(o("text", { [X.path]: i }), { method: "GET", signal: d }, mn, (p) => We(p.reason, p.code));
|
|
1749
|
+
return d.aborted ? fe : u;
|
|
1750
|
+
},
|
|
1751
|
+
refresh: (i) => l(o("refresh", { [X.source]: i }), { method: "POST", headers: s }, Ke, (d) => ({ status: "error", failure: d }))
|
|
1752
|
+
};
|
|
1753
|
+
}, Ro = () => {
|
|
1754
|
+
const e = /* @__PURE__ */ new Set(), t = ce();
|
|
1755
|
+
return {
|
|
1756
|
+
isShown: (n) => e.has(n),
|
|
1757
|
+
toggle: (n) => {
|
|
1758
|
+
e.delete(n) || e.add(n), t.emit();
|
|
1759
|
+
},
|
|
1760
|
+
subscribe: t.subscribe
|
|
1761
|
+
};
|
|
1762
|
+
}, To = () => {
|
|
1763
|
+
let e = null, t = null;
|
|
1764
|
+
return {
|
|
1765
|
+
settle: (n) => {
|
|
1766
|
+
e = n;
|
|
1767
|
+
},
|
|
1768
|
+
mayMove: (n) => e !== n,
|
|
1769
|
+
move: (n, r, o) => {
|
|
1770
|
+
e = r, t = { sourceId: n, path: r, ancestors: o };
|
|
1771
|
+
},
|
|
1772
|
+
take: (n, r) => {
|
|
1773
|
+
const o = t !== null && t.sourceId === n && t.path === r ? t.ancestors : null;
|
|
1774
|
+
return t = null, o;
|
|
1775
|
+
}
|
|
1674
1776
|
};
|
|
1675
|
-
},
|
|
1676
|
-
const t =
|
|
1677
|
-
if (t === null) return
|
|
1777
|
+
}, Ao = (e) => {
|
|
1778
|
+
const t = xn(e);
|
|
1779
|
+
if (t === null) return Ue;
|
|
1678
1780
|
try {
|
|
1679
|
-
return
|
|
1781
|
+
return ln(JSON.parse(t));
|
|
1680
1782
|
} catch (n) {
|
|
1681
|
-
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n),
|
|
1783
|
+
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), Ue;
|
|
1682
1784
|
}
|
|
1683
|
-
},
|
|
1785
|
+
}, ut = (e, t) => {
|
|
1684
1786
|
let n = null;
|
|
1685
1787
|
const r = () => {
|
|
1686
1788
|
if (n === null) {
|
|
1687
|
-
const l =
|
|
1688
|
-
n = { changes: l, settings:
|
|
1789
|
+
const l = Ao(e);
|
|
1790
|
+
n = { changes: l, settings: Ze(t, l) };
|
|
1689
1791
|
}
|
|
1690
1792
|
return n;
|
|
1691
|
-
}, o =
|
|
1793
|
+
}, o = ce();
|
|
1692
1794
|
return {
|
|
1693
1795
|
storageKey: e,
|
|
1694
1796
|
defaults: t,
|
|
@@ -1696,209 +1798,209 @@ const so = /* @__PURE__ */ x.forwardRef(io), ao = /* @__PURE__ */ new Set(), co
|
|
|
1696
1798
|
getServerSnapshot: () => t,
|
|
1697
1799
|
subscribe: o.subscribe,
|
|
1698
1800
|
advance: (l) => {
|
|
1699
|
-
const { changes: s, settings:
|
|
1700
|
-
return n = { changes:
|
|
1801
|
+
const { changes: s, settings: i } = r(), d = nn(s, l, rn(i, l)[l], t);
|
|
1802
|
+
return n = { changes: d, settings: Ze(t, d) }, o.emit(), kn(e, on(d)), n.settings;
|
|
1701
1803
|
}
|
|
1702
1804
|
};
|
|
1703
|
-
},
|
|
1704
|
-
const t = /* @__PURE__ */ new Map(), n =
|
|
1705
|
-
let
|
|
1706
|
-
const
|
|
1707
|
-
let
|
|
1708
|
-
const
|
|
1709
|
-
|
|
1710
|
-
},
|
|
1711
|
-
let
|
|
1712
|
-
return
|
|
1713
|
-
}, O = (
|
|
1714
|
-
|
|
1715
|
-
},
|
|
1716
|
-
const
|
|
1717
|
-
if (
|
|
1718
|
-
for (const [
|
|
1719
|
-
O(
|
|
1720
|
-
|
|
1805
|
+
}, Lo = Object.freeze({ status: "refreshed" }), Oo = Object.freeze({ status: "superseded" }), Fe = Object.freeze({ status: "deferred" }), Mo = Mt(Fe), Ut = 4, Co = Ut - 1, mt = Object.freeze({ status: "loading" }), No = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), Po = (e) => {
|
|
1806
|
+
const t = /* @__PURE__ */ new Map(), n = Ot(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map(), i = ce(), d = /* @__PURE__ */ new Set();
|
|
1807
|
+
let u = 0, p = 0;
|
|
1808
|
+
const h = { direct: null, bulk: null }, b = /* @__PURE__ */ new Set();
|
|
1809
|
+
let T = !1, y = 0;
|
|
1810
|
+
const L = () => {
|
|
1811
|
+
y += 1, i.emit();
|
|
1812
|
+
}, k = (a) => o.get(a) ?? 0, $ = (a) => {
|
|
1813
|
+
let f = s.get(a);
|
|
1814
|
+
return f === void 0 && (f = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, s.set(a, f)), f;
|
|
1815
|
+
}, O = (a, f, g) => {
|
|
1816
|
+
a.inFlight.delete(f), u -= 1, g.lane === "bulk" && (p -= 1);
|
|
1817
|
+
}, m = (a) => {
|
|
1818
|
+
const f = s.get(a);
|
|
1819
|
+
if (f !== void 0) {
|
|
1820
|
+
for (const [g, v] of [...f.inFlight])
|
|
1821
|
+
O(f, g, v), v.controller.abort();
|
|
1822
|
+
f.direct.clear(), f.bulk.clear(), f.unclaimed.clear();
|
|
1721
1823
|
}
|
|
1722
|
-
},
|
|
1723
|
-
const
|
|
1724
|
-
return o.set(
|
|
1725
|
-
}, S = (
|
|
1726
|
-
const
|
|
1727
|
-
return
|
|
1728
|
-
|
|
1824
|
+
}, w = (a) => {
|
|
1825
|
+
const f = k(a) + 1;
|
|
1826
|
+
return o.set(a, f), m(a), f;
|
|
1827
|
+
}, S = (a, f) => {
|
|
1828
|
+
const g = me(a), v = { promise: a, opened: f, stale: !1, loadedAt: g?.status === "ok" ? g.loadedAt : null };
|
|
1829
|
+
return a.status === "pending" && a.then((A) => {
|
|
1830
|
+
A.status === "ok" && (v.loadedAt = A.loadedAt);
|
|
1729
1831
|
}), v;
|
|
1730
|
-
}, E = (
|
|
1731
|
-
let
|
|
1732
|
-
return
|
|
1733
|
-
},
|
|
1734
|
-
const
|
|
1735
|
-
for (let
|
|
1736
|
-
const
|
|
1737
|
-
if (!(
|
|
1738
|
-
for (const
|
|
1739
|
-
if ((
|
|
1740
|
-
return
|
|
1832
|
+
}, E = (a) => {
|
|
1833
|
+
let f = r.get(a);
|
|
1834
|
+
return f === void 0 && (f = /* @__PURE__ */ new Map(), r.set(a, f)), f;
|
|
1835
|
+
}, R = (a) => {
|
|
1836
|
+
const f = [...s.keys()], g = h[a], v = g === null ? 0 : f.indexOf(g) + 1;
|
|
1837
|
+
for (let A = 0; A < f.length; A += 1) {
|
|
1838
|
+
const M = f[(v + A) % f.length], _ = M === void 0 ? void 0 : s.get(M);
|
|
1839
|
+
if (!(M === void 0 || _ === void 0)) {
|
|
1840
|
+
for (const D of _[a])
|
|
1841
|
+
if ((_.claims.get(D) ?? 0) !== 0)
|
|
1842
|
+
return _[a].delete(D), h[a] = M, { sourceId: M, path: D };
|
|
1741
1843
|
}
|
|
1742
1844
|
}
|
|
1743
1845
|
return null;
|
|
1744
|
-
},
|
|
1745
|
-
const
|
|
1746
|
-
if (
|
|
1747
|
-
O(
|
|
1748
|
-
const
|
|
1749
|
-
if (v.status === "ok" ?
|
|
1750
|
-
const
|
|
1751
|
-
for (const
|
|
1846
|
+
}, F = (a, f, g, v) => {
|
|
1847
|
+
const A = s.get(a);
|
|
1848
|
+
if (A === void 0 || A.inFlight.get(f) !== g) return;
|
|
1849
|
+
O(A, f, g);
|
|
1850
|
+
const M = (A.claims.get(f) ?? 0) > 0, _ = E(a);
|
|
1851
|
+
if (v.status === "ok" ? _.set(f, { status: "loaded", entries: v.entries }) : v.status === "error" && M ? _.set(f, { status: "failed", failure: v.failure }) : _.delete(f), L(), v.status === "error" && M) {
|
|
1852
|
+
const D = { sourceId: a, path: f, failure: v.failure };
|
|
1853
|
+
for (const Y of [...d]) Y(D);
|
|
1752
1854
|
}
|
|
1753
|
-
|
|
1754
|
-
}, I = (
|
|
1755
|
-
const v = { controller: new AbortController(), lane:
|
|
1756
|
-
|
|
1757
|
-
(
|
|
1758
|
-
() =>
|
|
1855
|
+
N();
|
|
1856
|
+
}, I = (a, f, g) => {
|
|
1857
|
+
const v = { controller: new AbortController(), lane: g };
|
|
1858
|
+
$(a).inFlight.set(f, v), u += 1, g === "bulk" && (p += 1), e.children(a, f, v.controller.signal).then(
|
|
1859
|
+
(A) => F(a, f, v, A),
|
|
1860
|
+
() => F(a, f, v, No)
|
|
1759
1861
|
);
|
|
1760
|
-
},
|
|
1761
|
-
for (;
|
|
1762
|
-
const
|
|
1763
|
-
if (
|
|
1764
|
-
I(
|
|
1862
|
+
}, N = () => {
|
|
1863
|
+
for (; u < Ut; ) {
|
|
1864
|
+
const a = R("direct");
|
|
1865
|
+
if (a !== null) {
|
|
1866
|
+
I(a.sourceId, a.path, "direct");
|
|
1765
1867
|
continue;
|
|
1766
1868
|
}
|
|
1767
|
-
const
|
|
1768
|
-
if (
|
|
1769
|
-
I(
|
|
1869
|
+
const f = p < Co ? R("bulk") : null;
|
|
1870
|
+
if (f === null) return;
|
|
1871
|
+
I(f.sourceId, f.path, "bulk");
|
|
1770
1872
|
}
|
|
1771
|
-
}, B = (
|
|
1772
|
-
if (!(
|
|
1773
|
-
const
|
|
1774
|
-
if (
|
|
1775
|
-
O(
|
|
1873
|
+
}, B = (a, f, g) => {
|
|
1874
|
+
if (!(f.direct.delete(g) || f.bulk.delete(g))) {
|
|
1875
|
+
const A = f.inFlight.get(g);
|
|
1876
|
+
if (A === void 0) return !1;
|
|
1877
|
+
O(f, g, A), A.controller.abort();
|
|
1776
1878
|
}
|
|
1777
|
-
return r.get(
|
|
1778
|
-
},
|
|
1779
|
-
|
|
1780
|
-
let
|
|
1781
|
-
for (const
|
|
1782
|
-
const
|
|
1783
|
-
for (const v of
|
|
1784
|
-
(
|
|
1785
|
-
|
|
1879
|
+
return r.get(a)?.delete(g), !0;
|
|
1880
|
+
}, W = () => {
|
|
1881
|
+
T = !1;
|
|
1882
|
+
let a = !1;
|
|
1883
|
+
for (const f of b) {
|
|
1884
|
+
const g = $(f);
|
|
1885
|
+
for (const v of g.unclaimed)
|
|
1886
|
+
(g.claims.get(v) ?? 0) === 0 && B(f, g, v) && (a = !0);
|
|
1887
|
+
g.unclaimed.clear();
|
|
1786
1888
|
}
|
|
1787
|
-
b.clear(),
|
|
1788
|
-
},
|
|
1789
|
-
t.set(
|
|
1790
|
-
},
|
|
1791
|
-
|
|
1792
|
-
const v = S(
|
|
1793
|
-
return t.set(
|
|
1794
|
-
},
|
|
1795
|
-
if (
|
|
1796
|
-
const
|
|
1797
|
-
if (!(v.status !== "ok" ||
|
|
1798
|
-
if (
|
|
1799
|
-
|
|
1889
|
+
b.clear(), a && (L(), N());
|
|
1890
|
+
}, U = (a, f) => {
|
|
1891
|
+
t.set(a, S(se(e.tree(a)), f));
|
|
1892
|
+
}, q = (a, f, g) => {
|
|
1893
|
+
w(a);
|
|
1894
|
+
const v = S(Mt(f), g);
|
|
1895
|
+
return t.set(a, v), r.delete(a), L(), N(), v;
|
|
1896
|
+
}, V = (a, f, g, v) => {
|
|
1897
|
+
if (g !== k(a) || t.get(a) !== f) return;
|
|
1898
|
+
const A = me(f.promise);
|
|
1899
|
+
if (!(v.status !== "ok" || A?.status !== "ok" || f.loadedAt === null || v.loadedAt <= f.loadedAt)) {
|
|
1900
|
+
if (be(A.entries, v.entries)) {
|
|
1901
|
+
f.loadedAt = v.loadedAt;
|
|
1800
1902
|
return;
|
|
1801
1903
|
}
|
|
1802
|
-
|
|
1904
|
+
q(a, v, f.opened);
|
|
1803
1905
|
}
|
|
1804
|
-
},
|
|
1805
|
-
const
|
|
1806
|
-
return
|
|
1807
|
-
},
|
|
1808
|
-
|
|
1809
|
-
const
|
|
1810
|
-
e.tree(
|
|
1906
|
+
}, K = (a, f) => {
|
|
1907
|
+
const g = t.get(a);
|
|
1908
|
+
return g !== void 0 && me(g.promise)?.status === f;
|
|
1909
|
+
}, Ae = (a, f) => {
|
|
1910
|
+
f.stale = !1;
|
|
1911
|
+
const g = k(a);
|
|
1912
|
+
e.tree(a).then((v) => V(a, f, g, v));
|
|
1811
1913
|
};
|
|
1812
1914
|
return {
|
|
1813
|
-
read: (
|
|
1814
|
-
open: (
|
|
1815
|
-
const
|
|
1816
|
-
return v === void 0 ||
|
|
1915
|
+
read: (a) => t.get(a)?.promise ?? Mo,
|
|
1916
|
+
open: (a) => {
|
|
1917
|
+
const f = n.resumes(a), g = n.hold(a), v = t.get(a);
|
|
1918
|
+
return v === void 0 || K(a, "deferred") ? (U(a, !0), L()) : f || (v.opened && K(a, "error") ? (U(a, !0), L()) : (v.opened = !0, v.stale && K(a, "ok") && Ae(a, v))), g;
|
|
1817
1919
|
},
|
|
1818
|
-
retry: (
|
|
1819
|
-
|
|
1920
|
+
retry: (a) => {
|
|
1921
|
+
K(a, "error") && (U(a, !0), L());
|
|
1820
1922
|
},
|
|
1821
|
-
seed: (
|
|
1822
|
-
const
|
|
1823
|
-
(
|
|
1824
|
-
() =>
|
|
1825
|
-
), v = t.get(
|
|
1826
|
-
if (v !== void 0 &&
|
|
1827
|
-
const
|
|
1828
|
-
|
|
1923
|
+
seed: (a, f) => {
|
|
1924
|
+
const g = f.then(
|
|
1925
|
+
(M) => M === null ? Fe : M,
|
|
1926
|
+
() => Fe
|
|
1927
|
+
), v = t.get(a);
|
|
1928
|
+
if (v !== void 0 && K(a, "ok")) {
|
|
1929
|
+
const M = k(a);
|
|
1930
|
+
g.then((_) => V(a, v, M, _));
|
|
1829
1931
|
return;
|
|
1830
1932
|
}
|
|
1831
|
-
|
|
1832
|
-
const
|
|
1833
|
-
t.set(
|
|
1834
|
-
t.get(
|
|
1933
|
+
w(a);
|
|
1934
|
+
const A = S(se(g), v?.opened === !0);
|
|
1935
|
+
t.set(a, A), r.delete(a), N(), g.then((M) => {
|
|
1936
|
+
t.get(a) === A && (M.status === "deferred" && n.isHeld(a) && U(a, A.opened), L());
|
|
1835
1937
|
});
|
|
1836
1938
|
},
|
|
1837
|
-
refresh: async (
|
|
1838
|
-
const
|
|
1839
|
-
l.set(
|
|
1840
|
-
const
|
|
1841
|
-
if (l.get(
|
|
1842
|
-
if (
|
|
1843
|
-
const v = t.get(
|
|
1844
|
-
if (!(v !== void 0 && v.loadedAt !== null &&
|
|
1845
|
-
const
|
|
1939
|
+
refresh: async (a) => {
|
|
1940
|
+
const f = (l.get(a) ?? 0) + 1;
|
|
1941
|
+
l.set(a, f);
|
|
1942
|
+
const g = await e.refresh(a);
|
|
1943
|
+
if (l.get(a) !== f) return Oo;
|
|
1944
|
+
if (g.status === "error") return { status: "failed", failure: g.failure };
|
|
1945
|
+
const v = t.get(a);
|
|
1946
|
+
if (!(v !== void 0 && v.loadedAt !== null && K(a, "ok") && v.loadedAt > g.loadedAt)) {
|
|
1947
|
+
const M = q(a, g, !0);
|
|
1846
1948
|
if (v !== void 0 && v.promise.status === "pending") {
|
|
1847
|
-
const
|
|
1848
|
-
v.promise.then((
|
|
1949
|
+
const _ = k(a);
|
|
1950
|
+
v.promise.then((D) => V(a, M, _, D));
|
|
1849
1951
|
}
|
|
1850
1952
|
}
|
|
1851
|
-
for (const [
|
|
1852
|
-
|
|
1853
|
-
return
|
|
1953
|
+
for (const [M, _] of t)
|
|
1954
|
+
M !== a && me(_.promise)?.status === "ok" && (_.stale = !0);
|
|
1955
|
+
return Lo;
|
|
1854
1956
|
},
|
|
1855
|
-
children: (
|
|
1856
|
-
claimChildren: (
|
|
1857
|
-
const
|
|
1858
|
-
let
|
|
1859
|
-
for (const [
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
let
|
|
1957
|
+
children: (a, f) => r.get(a)?.get(f),
|
|
1958
|
+
claimChildren: (a, f) => {
|
|
1959
|
+
const g = $(a), v = E(a);
|
|
1960
|
+
let A = !1, M = !1;
|
|
1961
|
+
for (const [D, Y] of f)
|
|
1962
|
+
g.claims.set(D, (g.claims.get(D) ?? 0) + 1), v.get(D) === void 0 ? (v.set(D, mt), g[Y].add(D), A = !0, M = !0) : Y === "direct" && g.bulk.delete(D) && (g.direct.add(D), M = !0);
|
|
1963
|
+
A && L(), M && N();
|
|
1964
|
+
let _ = !1;
|
|
1863
1965
|
return () => {
|
|
1864
|
-
if (!
|
|
1865
|
-
|
|
1866
|
-
for (const
|
|
1867
|
-
const
|
|
1868
|
-
|
|
1966
|
+
if (!_) {
|
|
1967
|
+
_ = !0;
|
|
1968
|
+
for (const D of f.keys()) {
|
|
1969
|
+
const Y = (g.claims.get(D) ?? 0) - 1;
|
|
1970
|
+
Y > 0 ? g.claims.set(D, Y) : (g.claims.delete(D), g.unclaimed.add(D));
|
|
1869
1971
|
}
|
|
1870
|
-
b.add(
|
|
1972
|
+
b.add(a), !T && (T = !0, queueMicrotask(W));
|
|
1871
1973
|
}
|
|
1872
1974
|
};
|
|
1873
1975
|
},
|
|
1874
|
-
retryChildren: (
|
|
1875
|
-
const
|
|
1876
|
-
if (
|
|
1877
|
-
const v =
|
|
1878
|
-
if ((v.claims.get(
|
|
1879
|
-
|
|
1976
|
+
retryChildren: (a, f) => {
|
|
1977
|
+
const g = r.get(a);
|
|
1978
|
+
if (g === void 0 || g.get(f)?.status !== "failed") return;
|
|
1979
|
+
const v = $(a);
|
|
1980
|
+
if ((v.claims.get(f) ?? 0) > 0) {
|
|
1981
|
+
g.set(f, mt), v.direct.add(f), L(), N();
|
|
1880
1982
|
return;
|
|
1881
1983
|
}
|
|
1882
|
-
|
|
1984
|
+
g.delete(f), L();
|
|
1883
1985
|
},
|
|
1884
|
-
pendingChildren: (
|
|
1885
|
-
const
|
|
1886
|
-
return
|
|
1986
|
+
pendingChildren: (a) => {
|
|
1987
|
+
const f = s.get(a);
|
|
1988
|
+
return f === void 0 ? 0 : f.direct.size + f.bulk.size + f.inFlight.size;
|
|
1887
1989
|
},
|
|
1888
1990
|
clear: () => {
|
|
1889
|
-
for (const
|
|
1890
|
-
for (const [
|
|
1891
|
-
t.clear(), r.clear(),
|
|
1991
|
+
for (const a of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...s.keys()])) w(a);
|
|
1992
|
+
for (const [a, f] of l) l.set(a, f + 1);
|
|
1993
|
+
t.clear(), r.clear(), L();
|
|
1892
1994
|
},
|
|
1893
|
-
subscribeChildrenFailures: (
|
|
1894
|
-
|
|
1995
|
+
subscribeChildrenFailures: (a) => (d.add(a), () => {
|
|
1996
|
+
d.delete(a);
|
|
1895
1997
|
}),
|
|
1896
|
-
subscribe:
|
|
1897
|
-
version: () =>
|
|
1998
|
+
subscribe: i.subscribe,
|
|
1999
|
+
version: () => y
|
|
1898
2000
|
};
|
|
1899
|
-
},
|
|
2001
|
+
}, $o = (e, t) => {
|
|
1900
2002
|
let n = e;
|
|
1901
|
-
const r =
|
|
2003
|
+
const r = ce();
|
|
1902
2004
|
return {
|
|
1903
2005
|
getSnapshot: () => n,
|
|
1904
2006
|
subscribe: r.subscribe,
|
|
@@ -1906,70 +2008,70 @@ const so = /* @__PURE__ */ x.forwardRef(io), ao = /* @__PURE__ */ new Set(), co
|
|
|
1906
2008
|
n = { ...n, ...o }, t(n), r.emit();
|
|
1907
2009
|
}
|
|
1908
2010
|
};
|
|
1909
|
-
},
|
|
1910
|
-
let
|
|
1911
|
-
const
|
|
2011
|
+
}, Fo = 1;
|
|
2012
|
+
let pe = 0, te = null;
|
|
2013
|
+
const Do = () => {
|
|
1912
2014
|
const { documentElement: e, body: t } = document;
|
|
1913
|
-
|
|
2015
|
+
pe === 0 && (te = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), pe += 1;
|
|
1914
2016
|
let n = !1;
|
|
1915
2017
|
return () => {
|
|
1916
|
-
n || (n = !0,
|
|
2018
|
+
n || (n = !0, pe -= 1, !(pe > 0 || te === null) && (e.style.overflow = te.htmlOverflow, t.style.overflow = te.bodyOverflow, e.style.scrollbarGutter = te.htmlGutter, t.style.scrollbarGutter = te.bodyGutter, te = null));
|
|
1917
2019
|
};
|
|
1918
|
-
},
|
|
2020
|
+
}, qo = [
|
|
1919
2021
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
1920
2022
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
1921
|
-
],
|
|
1922
|
-
if (!
|
|
2023
|
+
], ft = 1, pt = (e) => e.getClientRects().length > 0, Oe = "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.", _o = (e) => {
|
|
2024
|
+
if (!pt(e)) return null;
|
|
1923
2025
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
1924
|
-
if (t.bottom > n +
|
|
2026
|
+
if (t.bottom > n + Fo)
|
|
1925
2027
|
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. ${Oe}`;
|
|
1926
|
-
if (t.height <
|
|
2028
|
+
if (t.height < ft)
|
|
1927
2029
|
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. ${Oe}`;
|
|
1928
|
-
for (const { selector: r, name: o } of
|
|
2030
|
+
for (const { selector: r, name: o } of qo)
|
|
1929
2031
|
for (const l of e.querySelectorAll(r)) {
|
|
1930
|
-
if (!
|
|
2032
|
+
if (!pt(l)) continue;
|
|
1931
2033
|
const s = l.getBoundingClientRect().height;
|
|
1932
|
-
if (s <
|
|
2034
|
+
if (s < ft)
|
|
1933
2035
|
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(s))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Oe}`;
|
|
1934
2036
|
}
|
|
1935
2037
|
return null;
|
|
1936
|
-
},
|
|
2038
|
+
}, Bo = (e) => {
|
|
1937
2039
|
let t = !1;
|
|
1938
2040
|
const n = () => {
|
|
1939
2041
|
if (t) return;
|
|
1940
|
-
const o =
|
|
2042
|
+
const o = _o(e);
|
|
1941
2043
|
o !== null && (t = !0, console.error(o));
|
|
1942
2044
|
}, r = typeof ResizeObserver > "u" ? null : new ResizeObserver(n);
|
|
1943
2045
|
return r?.observe(e), window.addEventListener("resize", n), n(), () => {
|
|
1944
2046
|
r?.disconnect(), window.removeEventListener("resize", n);
|
|
1945
2047
|
};
|
|
1946
|
-
},
|
|
1947
|
-
|
|
2048
|
+
}, jo = (e, t) => {
|
|
2049
|
+
ee(() => e ? Do() : void 0, [e]), ee(() => {
|
|
1948
2050
|
const n = t.current;
|
|
1949
2051
|
if (!(!e || n === null))
|
|
1950
|
-
return
|
|
2052
|
+
return Bo(n);
|
|
1951
2053
|
}, [e, t]);
|
|
1952
|
-
},
|
|
1953
|
-
{ control:
|
|
2054
|
+
}, ht = '[data-testid="markdown-explorer-view-switch"]', zo = [
|
|
2055
|
+
{ control: ht, successors: [ht, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
1954
2056
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
1955
|
-
],
|
|
1956
|
-
for (const t of
|
|
2057
|
+
], Ho = (e) => {
|
|
2058
|
+
for (const t of zo) {
|
|
1957
2059
|
const n = e.closest(t.control);
|
|
1958
2060
|
if (n !== null) return { element: n, control: t };
|
|
1959
2061
|
}
|
|
1960
2062
|
return null;
|
|
1961
|
-
},
|
|
2063
|
+
}, Io = (e, t) => {
|
|
1962
2064
|
const n = j(null);
|
|
1963
|
-
|
|
1964
|
-
const o = (
|
|
1965
|
-
const
|
|
1966
|
-
n.current =
|
|
1967
|
-
}, l = (
|
|
2065
|
+
ee(() => {
|
|
2066
|
+
const o = (i) => {
|
|
2067
|
+
const d = e.current;
|
|
2068
|
+
n.current = d !== null && i instanceof Element && d.contains(i) ? Ho(i) : null;
|
|
2069
|
+
}, l = (i) => o(i.target);
|
|
1968
2070
|
o(document.activeElement);
|
|
1969
|
-
const s = (
|
|
1970
|
-
const
|
|
1971
|
-
|
|
1972
|
-
n.current?.element ===
|
|
2071
|
+
const s = (i) => {
|
|
2072
|
+
const d = i.target;
|
|
2073
|
+
i.relatedTarget !== null || !(d instanceof Element) || queueMicrotask(() => {
|
|
2074
|
+
n.current?.element === d && d.isConnected && document.activeElement !== d && (n.current = null);
|
|
1973
2075
|
});
|
|
1974
2076
|
};
|
|
1975
2077
|
return document.addEventListener("focusin", l), document.addEventListener("focusout", s), () => {
|
|
@@ -1977,158 +2079,160 @@ const Ao = () => {
|
|
|
1977
2079
|
};
|
|
1978
2080
|
}, [e]);
|
|
1979
2081
|
const r = j(t);
|
|
1980
|
-
|
|
2082
|
+
G(() => {
|
|
1981
2083
|
if (r.current === t) return;
|
|
1982
2084
|
r.current = t;
|
|
1983
2085
|
const o = n.current;
|
|
1984
2086
|
if (o === null) return;
|
|
1985
2087
|
const l = () => {
|
|
1986
|
-
const
|
|
1987
|
-
if (
|
|
1988
|
-
const
|
|
1989
|
-
if (
|
|
1990
|
-
for (const
|
|
1991
|
-
for (const
|
|
1992
|
-
if (
|
|
2088
|
+
const d = document.activeElement;
|
|
2089
|
+
if (d !== null && d !== document.body && d !== o.element) return !0;
|
|
2090
|
+
const u = e.current;
|
|
2091
|
+
if (u === null) return !0;
|
|
2092
|
+
for (const p of o.control.successors)
|
|
2093
|
+
for (const h of u.querySelectorAll(p))
|
|
2094
|
+
if (h !== o.element && (h.focus({ preventScroll: !0 }), document.activeElement === h))
|
|
1993
2095
|
return !0;
|
|
1994
2096
|
return !1;
|
|
1995
2097
|
};
|
|
1996
2098
|
if (l()) return;
|
|
1997
2099
|
const s = e.current;
|
|
1998
2100
|
if (s === null) return;
|
|
1999
|
-
const
|
|
2000
|
-
l() &&
|
|
2101
|
+
const i = new MutationObserver(() => {
|
|
2102
|
+
l() && i.disconnect();
|
|
2001
2103
|
});
|
|
2002
|
-
return
|
|
2104
|
+
return i.observe(s, { childList: !0, subtree: !0 }), () => i.disconnect();
|
|
2003
2105
|
}, [t, e]);
|
|
2004
|
-
},
|
|
2106
|
+
}, Zo = De(() => import("./TreeLayout-CqzxLpoM.js").then((e) => ({ default: e.TreeLayout }))), Uo = De(() => import("./MultiLayout-hPmV-bae.js").then((e) => ({ default: e.MultiLayout }))), Vo = 64, Go = {
|
|
2005
2107
|
request: (e) => {
|
|
2006
2108
|
requestAnimationFrame(e);
|
|
2007
2109
|
}
|
|
2008
|
-
},
|
|
2110
|
+
}, gt = (e) => {
|
|
2009
2111
|
e.documents.clear(), e.trees.clear();
|
|
2010
|
-
},
|
|
2112
|
+
}, Me = (e, t) => {
|
|
2011
2113
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
2012
2114
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
2013
|
-
},
|
|
2014
|
-
const [n, r] = Z(() => ({ overrides: t, locale: e, labels:
|
|
2015
|
-
if (n.locale === e &&
|
|
2016
|
-
const o = { overrides: t, locale: e, labels:
|
|
2115
|
+
}, Wo = (e, t) => {
|
|
2116
|
+
const [n, r] = Z(() => ({ overrides: t, locale: e, labels: Je(e, t) }));
|
|
2117
|
+
if (n.locale === e && $n(n.overrides, t)) return n.labels;
|
|
2118
|
+
const o = { overrides: t, locale: e, labels: Je(e, t) };
|
|
2017
2119
|
return r(o), o.labels;
|
|
2018
|
-
},
|
|
2019
|
-
const [r, o] = Z(() => ({ scope: t, store:
|
|
2120
|
+
}, Ko = (e, t, n) => {
|
|
2121
|
+
const [r, o] = Z(() => ({ scope: t, store: ut(e, n) }));
|
|
2020
2122
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
2021
|
-
const l = { scope: t, store:
|
|
2123
|
+
const l = { scope: t, store: ut(e, n) };
|
|
2022
2124
|
return o(l), l.store;
|
|
2023
|
-
},
|
|
2024
|
-
const [
|
|
2025
|
-
if (
|
|
2026
|
-
const
|
|
2027
|
-
return
|
|
2028
|
-
},
|
|
2029
|
-
|
|
2030
|
-
const
|
|
2031
|
-
}),
|
|
2032
|
-
const
|
|
2033
|
-
return
|
|
2125
|
+
}, Ce = (e, t) => {
|
|
2126
|
+
const [n, r] = Z(() => ({ scope: e, value: t() }));
|
|
2127
|
+
if (n.scope === e) return n.value;
|
|
2128
|
+
const o = { scope: e, value: t() };
|
|
2129
|
+
return r(o), o.value;
|
|
2130
|
+
}, Yo = () => ko(Go), cl = ({ data: e, config: t, storageNamespace: n, locale: r, labels: o, theme: l, renderFrame: s, renderTreeFailure: i, lockDocumentScroll: d = !1, onMathDiagnostics: u }) => {
|
|
2131
|
+
yn(n);
|
|
2132
|
+
const p = xt(r), h = Fn(l), b = Wo(p, o), { revalidate: T } = Jt(), y = j(() => {
|
|
2133
|
+
}), L = Se(t.dataPath), [k] = Z(() => {
|
|
2134
|
+
const q = yo({ dataPath: L, onScope: (K) => y.current(K) }), V = { documents: Zn({ client: q, capacity: Math.max(Vo, t.multiView.maxPanels * 2) }), trees: Po(q) };
|
|
2135
|
+
return Me(V, e), Ye(n, e.scope), { data: q, ...V, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
2034
2136
|
});
|
|
2035
|
-
if (
|
|
2036
|
-
const
|
|
2037
|
-
|
|
2137
|
+
if (k.aligned.pageData !== e || k.aligned.storageNamespace !== n) {
|
|
2138
|
+
const q = k.aligned.pageData;
|
|
2139
|
+
k.aligned.pageData = e, k.aligned.storageNamespace = n, q !== e && (q.scope !== e.scope ? k.aligned.pendingReader = e : Me(k, e)), Ye(n, e.scope);
|
|
2038
2140
|
}
|
|
2039
|
-
const
|
|
2040
|
-
|
|
2041
|
-
const
|
|
2042
|
-
|
|
2043
|
-
}, [e,
|
|
2044
|
-
let
|
|
2045
|
-
return
|
|
2046
|
-
|
|
2141
|
+
const $ = Ko(Rn(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
2142
|
+
G(() => {
|
|
2143
|
+
const q = k.aligned.pendingReader;
|
|
2144
|
+
q !== null && (k.aligned.pendingReader = null, gt(k), Me(k, q));
|
|
2145
|
+
}, [e, k]), G(() => {
|
|
2146
|
+
let q = !1;
|
|
2147
|
+
return y.current = (V) => {
|
|
2148
|
+
V === e.scope || q || (q = !0, V !== null && (gt(k), Tn(n)), T());
|
|
2047
2149
|
}, () => {
|
|
2048
|
-
|
|
2150
|
+
y.current = () => {
|
|
2049
2151
|
};
|
|
2050
2152
|
};
|
|
2051
|
-
}, [e,
|
|
2153
|
+
}, [e, T, k, n]);
|
|
2052
2154
|
const O = j(t.settingsCookie);
|
|
2053
|
-
|
|
2155
|
+
G(() => {
|
|
2054
2156
|
O.current = t.settingsCookie;
|
|
2055
2157
|
}, [t.settingsCookie]);
|
|
2056
|
-
const [
|
|
2057
|
-
() =>
|
|
2058
|
-
document.cookie =
|
|
2158
|
+
const [m] = Z(
|
|
2159
|
+
() => $o(e.settings, (q) => {
|
|
2160
|
+
document.cookie = an(O.current, q, window.location.protocol === "https:");
|
|
2059
2161
|
})
|
|
2060
|
-
),
|
|
2061
|
-
`),
|
|
2062
|
-
`)), [t,
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
}, [
|
|
2066
|
-
const [
|
|
2067
|
-
|
|
2068
|
-
}),
|
|
2162
|
+
), w = Ce(e.scope, Yo), S = Ce(e.scope, To), E = Ce(e.scope, Ro), R = H(() => se(e.notices.catch(() => [])), [e.notices]), F = e.sources.map((q) => q.id).join(`
|
|
2163
|
+
`), I = H(() => sn(t, F.split(`
|
|
2164
|
+
`)), [t, F]), N = j(u);
|
|
2165
|
+
G(() => {
|
|
2166
|
+
N.current = u;
|
|
2167
|
+
}, [u]);
|
|
2168
|
+
const [B] = Z(() => (q, V) => {
|
|
2169
|
+
N.current?.(q, V);
|
|
2170
|
+
}), W = u === void 0 ? void 0 : B, U = H(
|
|
2069
2171
|
() => ({
|
|
2070
|
-
config:
|
|
2172
|
+
config: I,
|
|
2071
2173
|
labels: b,
|
|
2072
|
-
locale:
|
|
2073
|
-
theme:
|
|
2174
|
+
locale: p,
|
|
2175
|
+
theme: h,
|
|
2074
2176
|
storageNamespace: n,
|
|
2075
2177
|
scope: e.scope,
|
|
2076
2178
|
sources: e.sources,
|
|
2077
|
-
notices:
|
|
2078
|
-
documents:
|
|
2079
|
-
trees:
|
|
2080
|
-
data:
|
|
2081
|
-
viewSettings:
|
|
2082
|
-
treeSettings:
|
|
2083
|
-
announcer:
|
|
2084
|
-
|
|
2085
|
-
|
|
2179
|
+
notices: R,
|
|
2180
|
+
documents: k.documents,
|
|
2181
|
+
trees: k.trees,
|
|
2182
|
+
data: k.data,
|
|
2183
|
+
viewSettings: m,
|
|
2184
|
+
treeSettings: $,
|
|
2185
|
+
announcer: w,
|
|
2186
|
+
reveals: S,
|
|
2187
|
+
markupViews: E,
|
|
2188
|
+
renderTreeFailure: i,
|
|
2189
|
+
reportMathDiagnostics: W
|
|
2086
2190
|
}),
|
|
2087
|
-
[
|
|
2191
|
+
[I, b, p, h, n, e.scope, e.sources, R, k, m, $, w, S, E, i, W]
|
|
2088
2192
|
);
|
|
2089
|
-
return /* @__PURE__ */
|
|
2090
|
-
},
|
|
2091
|
-
const [o] = Z(
|
|
2092
|
-
return /* @__PURE__ */
|
|
2093
|
-
},
|
|
2094
|
-
const { theme: n, labels: r } =
|
|
2095
|
-
|
|
2193
|
+
return /* @__PURE__ */ c(yt, { value: U, children: /* @__PURE__ */ c(Jo, { renderFrame: s, lockDocumentScroll: d }, e.scope) });
|
|
2194
|
+
}, Xo = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
2195
|
+
const [o] = Z(br);
|
|
2196
|
+
return /* @__PURE__ */ c("div", { ref: e, className: "aqmx-root", "data-aqmx-theme": t, "data-aqmx-view": n, "data-testid": "markdown-explorer", onKeyDownCapture: o.onKeyDownCapture, onKeyUpCapture: o.onKeyUpCapture, onBlurCapture: o.onBlurCapture, children: r });
|
|
2197
|
+
}, Jo = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
2198
|
+
const { theme: n, labels: r } = P(), o = qe(), { hash: l } = vt(), s = Be(), i = j(null);
|
|
2199
|
+
jo(t, i), G(() => {
|
|
2096
2200
|
o.kind === "redirect" && s(`${o.href}${l}`, "browse");
|
|
2097
2201
|
}, [o, l, s]);
|
|
2098
|
-
const { location:
|
|
2099
|
-
|
|
2100
|
-
const
|
|
2101
|
-
|
|
2102
|
-
/* @__PURE__ */
|
|
2202
|
+
const { location: d } = o, u = d.view;
|
|
2203
|
+
Io(i, u);
|
|
2204
|
+
const p = d.view === "tree" ? /* @__PURE__ */ c(we, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading" }), children: /* @__PURE__ */ c(Zo, { location: d }) }) : d.view === "multi" ? /* @__PURE__ */ c(we, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading" }), children: /* @__PURE__ */ c(Uo, { location: d }) }) : /* @__PURE__ */ c(Eo, { location: d }), h = /* @__PURE__ */ z(Xo, { ref: i, theme: n, view: u, children: [
|
|
2205
|
+
p,
|
|
2206
|
+
/* @__PURE__ */ c(So, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
2103
2207
|
] });
|
|
2104
|
-
return e === void 0 ?
|
|
2105
|
-
},
|
|
2208
|
+
return e === void 0 ? h : e({ view: u, children: h });
|
|
2209
|
+
}, dl = ({ currentUrl: e, nextUrl: t, formMethod: n, defaultShouldRevalidate: r }) => n === void 0 && e.href === t.href && r;
|
|
2106
2210
|
export {
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2211
|
+
bo as D,
|
|
2212
|
+
_n as E,
|
|
2213
|
+
Tt as F,
|
|
2214
|
+
kr as I,
|
|
2215
|
+
Hn as L,
|
|
2216
|
+
Cn as M,
|
|
2217
|
+
vo as P,
|
|
2218
|
+
Be as a,
|
|
2219
|
+
uo as b,
|
|
2220
|
+
ce as c,
|
|
2221
|
+
fo as d,
|
|
2222
|
+
al as e,
|
|
2223
|
+
At as f,
|
|
2224
|
+
Bn as g,
|
|
2225
|
+
ae as h,
|
|
2226
|
+
qe as i,
|
|
2227
|
+
So as j,
|
|
2228
|
+
ve as k,
|
|
2229
|
+
An as l,
|
|
2230
|
+
Qe as m,
|
|
2231
|
+
kt as n,
|
|
2232
|
+
Ln as o,
|
|
2233
|
+
Xe as p,
|
|
2234
|
+
cl as q,
|
|
2235
|
+
Je as r,
|
|
2236
|
+
dl as s,
|
|
2237
|
+
P as u
|
|
2134
2238
|
};
|