@aiquants/markdown-explorer 0.21.0 → 0.23.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 +80 -0
- package/README.md +27 -16
- package/dist/EditSurface-Bk4tdJ99.cjs +6 -0
- package/dist/EditSurface-Dhvw9IDD.js +975 -0
- package/dist/{ExplorerSplit-CdqEKz-I.cjs → ExplorerSplit-BAFiXU-V.cjs} +1 -1
- package/dist/{ExplorerSplit-3WMRDA7G.js → ExplorerSplit-Q5VqUBDE.js} +3 -3
- package/dist/{MultiLayout-BEg1X8Jx.cjs → MultiLayout-Bq_TS3ez.cjs} +1 -1
- package/dist/{MultiLayout-Gf1xT-Le.js → MultiLayout-DlATT7km.js} +22 -22
- package/dist/{NativeScrollBar-idIQsvCv.cjs → NativeScrollBar-A6-qEpz7.cjs} +1 -1
- package/dist/{NativeScrollBar-0cpp2OIu.js → NativeScrollBar-TsIcS3JZ.js} +1 -1
- package/dist/{TreeLayout-DJY_WqzP.cjs → TreeLayout-l-r2pPao.cjs} +1 -1
- package/dist/{TreeLayout-DzZCgMTt.js → TreeLayout-zrSo4MNZ.js} +3 -3
- package/dist/core/contracts.d.cts +7 -0
- package/dist/core/contracts.d.ts +7 -0
- package/dist/core/labels.d.cts +21 -27
- package/dist/core/labels.d.ts +21 -27
- package/dist/{dataRoute-CObbjNxG.js → dataRoute-Diu_7gle.js} +84 -83
- package/dist/dataRoute-vXGZMVB-.cjs +1 -0
- package/dist/index-BNFl3BsO.cjs +13 -0
- package/dist/{index-CJgHGeZs.js → index-Jz6zeO4O.js} +1500 -1529
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +9 -9
- package/dist/{location-B-m9scLf.js → location-8Ho8ZNv_.js} +1 -1
- package/dist/{location-BVEN_Ihk.cjs → location-DN0AI4ir.cjs} +1 -1
- package/dist/{merge-BOcofJN5.js → merge-BzMpSaxx.js} +1 -1
- package/dist/{merge-BVk6pvO_.cjs → merge-DlPkU2Jc.cjs} +1 -1
- package/dist/{sanitizePolicy-BWQtWhsL.js → sanitizePolicy-BvhYIqVO.js} +1 -1
- package/dist/{sanitizePolicy-gEXeavb-.cjs → sanitizePolicy-Du3lFZd-.cjs} +1 -1
- package/dist/sanitizeWorker.cjs +1 -1
- package/dist/sanitizeWorker.js +1 -1
- package/dist/server/ports.d.cts +2 -1
- package/dist/server/ports.d.ts +2 -1
- package/dist/server.cjs +1 -1
- package/dist/server.js +524 -521
- package/dist/{useSplitPersistence-Ba-v64n-.cjs → useSplitPersistence-CR4Oxtaa.cjs} +1 -1
- package/dist/{useSplitPersistence-Cc4tDxB4.js → useSplitPersistence-HfAb8Kzh.js} +1 -1
- package/docs/behavior/dom-hooks.md +3 -3
- package/docs/behavior/layout.md +11 -5
- package/docs/behavior/localization.md +9 -7
- package/docs/behavior/security.md +1 -1
- package/docs/behavior/url-contract.md +2 -2
- package/package.json +5 -5
- package/dist/EditSurface-Bwl4S1vQ.cjs +0 -7
- package/dist/EditSurface-rKoy_ndP.js +0 -880
- package/dist/dataRoute-BONacTPi.cjs +0 -1
- package/dist/index-bMaSoQTe.cjs +0 -13
|
@@ -1,27 +1,25 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { createContext as pe, use as
|
|
4
|
-
import { useParams as
|
|
5
|
-
import { j as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
1
|
+
import { jsxs as F, jsx as c, Fragment as $e } from "react/jsx-runtime";
|
|
2
|
+
import * as S from "react";
|
|
3
|
+
import { createContext as pe, use as ne, useMemo as H, useSyncExternalStore as ee, useRef as q, useLayoutEffect as V, useCallback as P, useId as xe, useEffect as te, Component as an, Suspense as ke, lazy as lt, useState as B, useEffectEvent as le } from "react";
|
|
4
|
+
import { useParams as Un, useSearchParams as Zn, matchPath as Gn, useBlocker as Kn, useNavigate as Wn, Link as Yn, useHref as Fe, useLocation as sn, useRevalidator as Xn } from "react-router";
|
|
5
|
+
import { j as Jn, g as cn, z as Qn, E as dn, a as un, B as er, D as Et, G as tr, H as be, e as ye, I as nr, J as rr, K as yt, L as or, M as St, O as ir, w as lr, Q as ar } from "./location-8Ho8ZNv_.js";
|
|
6
|
+
import { SPREADSHEET_BLOCK_LABEL_PLACEHOLDERS as xt, SPREADSHEET_BLOCK_LABEL_CATALOGS as Ae } from "@aiquants/markdown/code-blocks";
|
|
7
|
+
import { G as se, i as sr, H as cr, z as J, y as dr, I as kt, A as Ue, J as ur, K as fr, L as mr, N as hr, O as pr, f as vr, P as Tt, w as gr, Q as wr, R as br, S as Er, C as yr, x as Sr, T as xr, U as kr, V as Tr, v as Rt } from "./dataRoute-Diu_7gle.js";
|
|
8
|
+
import { HostedScrollArea as Ot, useMarkdownToolbarState as Rr, MarkdownViewer as fn } from "@aiquants/markdown";
|
|
9
|
+
import { SOURCE_LINES_ATTRIBUTE as mn, parseSourceLines as Or } from "@aiquants/markdown/source-lines";
|
|
10
|
+
import { DEFAULT_CONTENT_ALIGN as Cr } from "@aiquants/markdown/viewer-settings";
|
|
11
|
+
import { w as Qe, r as et, a as Mr, b as Ct, s as ge, c as Lr } from "./storage-CmGHg7OA.js";
|
|
12
|
+
import { createShouldRevalidate as Ar } from "@aiquants/route-revalidation";
|
|
13
|
+
const Mt = Object.freeze(["en", "ja"]), Nr = "en", at = (e) => `viewerSpreadsheet${e.charAt(0).toUpperCase()}${e.slice(1)}`, hn = Object.freeze(Object.keys(Ae.en)), pn = (e) => Object.fromEntries(hn.map((t) => [at(t), Ae[e][t].text])), Dr = Object.freeze({
|
|
13
14
|
panelMoved: Object.freeze(["title", "column", "position"]),
|
|
14
15
|
panelMoveUnavailable: Object.freeze(["title", "move"]),
|
|
15
16
|
panelDragStarted: Object.freeze(["title"]),
|
|
16
17
|
panelDragCancelled: Object.freeze(["title"]),
|
|
17
18
|
multiColumnRegion: Object.freeze(["column"]),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
viewerSpreadsheetOptionsError: Object.freeze(["message"]),
|
|
23
|
-
viewerSpreadsheetLoadFailed: Object.freeze(["message"])
|
|
24
|
-
}), Or = /\{(\w+)\}/gu, dn = {
|
|
19
|
+
viewerSvgImageSourceRegion: Object.freeze(["name"]),
|
|
20
|
+
...Object.fromEntries(hn.filter((e) => xt[e].length > 0).map((e) => [at(e), xt[e]]))
|
|
21
|
+
}), Pr = /\{(\w+)\}/gu, vn = {
|
|
22
|
+
...pn("en"),
|
|
25
23
|
explorerRegion: "Explorer",
|
|
26
24
|
sourceLabel: "Source",
|
|
27
25
|
refreshTreeLabel: "Refresh tree",
|
|
@@ -35,6 +33,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
35
33
|
documentRefreshFailed: (e) => `Could not reload the document: ${e}`,
|
|
36
34
|
showMarkupLabel: "Source",
|
|
37
35
|
showMarkup: "Show the document's Markdown as written",
|
|
36
|
+
showSvgMarkup: "Show the image's SVG as written",
|
|
38
37
|
showMarkupNamed: (e) => `Source of ${e}`,
|
|
39
38
|
editDocumentLabel: "Edit",
|
|
40
39
|
editDocument: "Edit the document's Markdown (or double-click the document)",
|
|
@@ -99,6 +98,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
99
98
|
previewRegion: "Preview",
|
|
100
99
|
previewUpdating: "Updating the preview…",
|
|
101
100
|
previewFailed: (e) => `Could not preview: ${e}`,
|
|
101
|
+
previewTablePending: "This table can be edited once the preview shows the draft.",
|
|
102
102
|
expandAll: "Expand all folders",
|
|
103
103
|
collapseAll: "Collapse all folders",
|
|
104
104
|
treeSettings: "Tree settings",
|
|
@@ -250,32 +250,17 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
250
250
|
viewerEmbeddedVideo: "embedded video",
|
|
251
251
|
viewerEmbeddedPost: "embedded post",
|
|
252
252
|
viewerEmbeddedFrame: "Embedded content",
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
viewerSpreadsheetFullscreenDialog: "Spreadsheet (full screen)",
|
|
265
|
-
viewerSpreadsheetSize: "Rows {rows} × columns {cols}",
|
|
266
|
-
viewerSpreadsheetFileName: "spreadsheet.tsv",
|
|
267
|
-
viewerSpreadsheetCopied: "Copied the whole table.",
|
|
268
|
-
viewerSpreadsheetCopyFailed: "Could not copy the table: {reason}",
|
|
269
|
-
viewerSpreadsheetCellAnnouncement: "{cell}, {value}",
|
|
270
|
-
viewerSpreadsheetEmptyCell: "blank",
|
|
271
|
-
viewerSpreadsheetSelectionAnnouncement: "{range} selected",
|
|
272
|
-
viewerSpreadsheetReadOnly: "This table is read-only here.",
|
|
273
|
-
viewerSpreadsheetFormatRefused: "This table keeps text only, so formatting and links are not saved.",
|
|
274
|
-
viewerSpreadsheetFenceRefused: "A cell cannot begin a line with ``` or ~~~ in this table, so the change was not saved.",
|
|
275
|
-
viewerSpreadsheetEditConflict: "The table changed in the editor, so the change was not saved. Try again.",
|
|
276
|
-
viewerSpreadsheetOptionsError: "Invalid spreadsheet options: {message}",
|
|
277
|
-
viewerSpreadsheetLoadFailed: "Could not load the spreadsheet: {message}",
|
|
278
|
-
viewerSpreadsheetRetry: "Retry",
|
|
253
|
+
viewerBlockFailed: "This block could not be shown.",
|
|
254
|
+
viewerSvgImageToolbar: "SVG image",
|
|
255
|
+
viewerSvgImageSource: "Source",
|
|
256
|
+
viewerSvgImageSourceRegion: "Source of {name}",
|
|
257
|
+
viewerSvgImageLoading: "Loading the source…",
|
|
258
|
+
viewerSvgImageFailed: "The source could not be read.",
|
|
259
|
+
viewerSvgImageRetry: "Try again",
|
|
260
|
+
viewerSvgImageTruncated: "Only the beginning of this file is shown.",
|
|
261
|
+
viewerSvgImageCopy: "Copy the source",
|
|
262
|
+
viewerSvgImageCopied: "Copied the source.",
|
|
263
|
+
viewerSvgImageCopyFailed: "Could not copy the source.",
|
|
279
264
|
multiRegion: "Panels",
|
|
280
265
|
multiEmpty: "Select documents in the explorer to open them side by side.",
|
|
281
266
|
panelLimit: (e) => `You can open up to ${String(e)} panels at once.`,
|
|
@@ -308,7 +293,8 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
308
293
|
multiColumnEmpty: "This column is empty",
|
|
309
294
|
multiColumnRegion: "Column {column}",
|
|
310
295
|
panelDropHere: "Drop the panel here"
|
|
311
|
-
},
|
|
296
|
+
}, $r = {
|
|
297
|
+
...pn("ja"),
|
|
312
298
|
explorerRegion: "エクスプローラー",
|
|
313
299
|
sourceLabel: "ソース",
|
|
314
300
|
refreshTreeLabel: "ツリーを更新",
|
|
@@ -322,6 +308,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
322
308
|
documentRefreshFailed: (e) => `文書を読み込み直せませんでした: ${e}`,
|
|
323
309
|
showMarkupLabel: "ソース",
|
|
324
310
|
showMarkup: "文書の Markdown を書いたまま表示",
|
|
311
|
+
showSvgMarkup: "画像の SVG を書いたまま表示",
|
|
325
312
|
showMarkupNamed: (e) => `${e} のソース`,
|
|
326
313
|
editDocumentLabel: "編集",
|
|
327
314
|
editDocument: "文書の Markdown を編集 (文書のダブルクリックでも)",
|
|
@@ -386,6 +373,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
386
373
|
previewRegion: "プレビュー",
|
|
387
374
|
previewUpdating: "プレビューを更新中…",
|
|
388
375
|
previewFailed: (e) => `プレビューできませんでした: ${e}`,
|
|
376
|
+
previewTablePending: "プレビューが下書きを描くと、この表を編集できます。",
|
|
389
377
|
expandAll: "すべてのフォルダーを展開",
|
|
390
378
|
collapseAll: "すべてのフォルダーを折りたたむ",
|
|
391
379
|
treeSettings: "ツリーの設定",
|
|
@@ -537,32 +525,17 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
537
525
|
viewerEmbeddedVideo: "埋め込みの動画",
|
|
538
526
|
viewerEmbeddedPost: "埋め込みの投稿",
|
|
539
527
|
viewerEmbeddedFrame: "埋め込みのコンテンツ",
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
viewerSpreadsheetFullscreenDialog: "表 (全画面)",
|
|
552
|
-
viewerSpreadsheetSize: "{rows} 行 × {cols} 列",
|
|
553
|
-
viewerSpreadsheetFileName: "表.tsv",
|
|
554
|
-
viewerSpreadsheetCopied: "表全体をコピーしました。",
|
|
555
|
-
viewerSpreadsheetCopyFailed: "表をコピーできませんでした: {reason}",
|
|
556
|
-
viewerSpreadsheetCellAnnouncement: "{cell}、{value}",
|
|
557
|
-
viewerSpreadsheetEmptyCell: "空白",
|
|
558
|
-
viewerSpreadsheetSelectionAnnouncement: "{range} を選択",
|
|
559
|
-
viewerSpreadsheetReadOnly: "この表はここでは編集できません。",
|
|
560
|
-
viewerSpreadsheetFormatRefused: "この表は文字だけを保つため、書式とリンクは保存しません。",
|
|
561
|
-
viewerSpreadsheetFenceRefused: "セルの行頭に ``` や ~~~ を置くと表が壊れるため、この変更は保存しませんでした。",
|
|
562
|
-
viewerSpreadsheetEditConflict: "エディタで表が変わっていたため、この変更は保存しませんでした。もう一度お試しください。",
|
|
563
|
-
viewerSpreadsheetOptionsError: "表の指定の誤り: {message}",
|
|
564
|
-
viewerSpreadsheetLoadFailed: "表を読み込めませんでした: {message}",
|
|
565
|
-
viewerSpreadsheetRetry: "再試行",
|
|
528
|
+
viewerBlockFailed: "このブロックを表示できませんでした。",
|
|
529
|
+
viewerSvgImageToolbar: "SVG の画像",
|
|
530
|
+
viewerSvgImageSource: "ソース",
|
|
531
|
+
viewerSvgImageSourceRegion: "{name} のソース",
|
|
532
|
+
viewerSvgImageLoading: "ソースを読み込み中…",
|
|
533
|
+
viewerSvgImageFailed: "ソースを読み込めませんでした。",
|
|
534
|
+
viewerSvgImageRetry: "再試行",
|
|
535
|
+
viewerSvgImageTruncated: "このファイルは先頭だけを表示しています。",
|
|
536
|
+
viewerSvgImageCopy: "ソースをコピー",
|
|
537
|
+
viewerSvgImageCopied: "ソースをコピーしました。",
|
|
538
|
+
viewerSvgImageCopyFailed: "ソースをコピーできませんでした。",
|
|
566
539
|
multiRegion: "パネル",
|
|
567
540
|
multiEmpty: "エクスプローラーで文書を選ぶと、ここに並べて開きます。",
|
|
568
541
|
panelLimit: (e) => `同時に開けるのは ${String(e)} パネルまでです。`,
|
|
@@ -595,60 +568,60 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
595
568
|
multiColumnEmpty: "この列は空です",
|
|
596
569
|
multiColumnRegion: "{column} 列目",
|
|
597
570
|
panelDropHere: "ここへパネルをドロップ"
|
|
598
|
-
},
|
|
599
|
-
en: Object.freeze(
|
|
600
|
-
ja: Object.freeze(
|
|
601
|
-
}),
|
|
602
|
-
if (e === void 0) return
|
|
603
|
-
if (
|
|
604
|
-
throw new RangeError(`[markdown-explorer] locale is the UI language (${
|
|
605
|
-
},
|
|
606
|
-
const n =
|
|
571
|
+
}, Fr = Object.freeze({
|
|
572
|
+
en: Object.freeze(vn),
|
|
573
|
+
ja: Object.freeze($r)
|
|
574
|
+
}), gn = Object.freeze(Object.keys(vn)), Ir = new Set(gn), qr = (e) => Ir.has(e), Me = (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, wn = (e) => {
|
|
575
|
+
if (e === void 0) return Nr;
|
|
576
|
+
if (Mt.includes(e)) return e;
|
|
577
|
+
throw new RangeError(`[markdown-explorer] locale is the UI language (${Mt.map((t) => JSON.stringify(t)).join(" or ")}), not a BCP 47 tag; got ${Me(e)}`);
|
|
578
|
+
}, Lt = (e, t) => {
|
|
579
|
+
const n = Fr[wn(e)];
|
|
607
580
|
if (t === void 0) return n;
|
|
608
581
|
if (t === null || typeof t != "object")
|
|
609
582
|
throw new RangeError(`[markdown-explorer] labels must be an object; got ${Me(t)}`);
|
|
610
|
-
if (!
|
|
583
|
+
if (!Jn(t))
|
|
611
584
|
throw new RangeError(`[markdown-explorer] labels must be a plain object; got ${Me(t)}`);
|
|
612
585
|
const r = t, o = { ...n };
|
|
613
586
|
for (const i of Object.keys(r)) {
|
|
614
|
-
if (!
|
|
615
|
-
throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${
|
|
616
|
-
const
|
|
617
|
-
if (
|
|
587
|
+
if (!qr(i))
|
|
588
|
+
throw new RangeError(`[markdown-explorer] labels.${i} is not a known label key; expected one of ${gn.join(", ")}`);
|
|
589
|
+
const l = r[i];
|
|
590
|
+
if (l === void 0) continue;
|
|
618
591
|
const u = typeof n[i];
|
|
619
|
-
if (typeof
|
|
620
|
-
throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Me(
|
|
621
|
-
if (typeof
|
|
592
|
+
if (typeof l !== u)
|
|
593
|
+
throw new TypeError(`[markdown-explorer] labels.${i} must be a ${u}; got ${Me(l)}`);
|
|
594
|
+
if (typeof l == "string" && l.trim() === "")
|
|
622
595
|
throw new RangeError(`[markdown-explorer] labels.${i} must be a non-blank string`);
|
|
623
|
-
const m =
|
|
624
|
-
if (typeof
|
|
625
|
-
for (const [, f] of
|
|
596
|
+
const m = Dr[i];
|
|
597
|
+
if (typeof l == "string" && m !== void 0) {
|
|
598
|
+
for (const [, f] of l.matchAll(Pr))
|
|
626
599
|
if (!m.includes(f ?? ""))
|
|
627
|
-
throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((
|
|
600
|
+
throw new RangeError(`[markdown-explorer] labels.${i} uses the unknown placeholder {${String(f)}}; it accepts ${m.map((d) => `{${d}}`).join(", ")}`);
|
|
628
601
|
}
|
|
629
|
-
o[i] =
|
|
602
|
+
o[i] = l;
|
|
630
603
|
}
|
|
631
604
|
return Object.freeze(o);
|
|
632
|
-
},
|
|
605
|
+
}, _r = (e, t) => {
|
|
633
606
|
if (Object.is(e, t)) return !0;
|
|
634
607
|
if (e === null || t === null || typeof e != "object" || typeof t != "object") return !1;
|
|
635
608
|
const n = e, r = t, o = Object.keys(n), i = Object.keys(r);
|
|
636
|
-
return o.length === i.length && i.every((
|
|
637
|
-
},
|
|
609
|
+
return o.length === i.length && i.every((l) => Object.hasOwn(n, l) && Object.is(n[l], r[l]));
|
|
610
|
+
}, At = Object.freeze(["light", "dark"]), Br = (e) => {
|
|
638
611
|
if (e === void 0) return "light";
|
|
639
|
-
if (
|
|
640
|
-
throw new RangeError(`[markdown-explorer] theme must be ${
|
|
641
|
-
},
|
|
642
|
-
const e =
|
|
612
|
+
if (At.includes(e)) return e;
|
|
613
|
+
throw new RangeError(`[markdown-explorer] theme must be ${At.map((t) => JSON.stringify(t)).join(" or ")}; got ${typeof e == "string" ? JSON.stringify(e) : typeof e}`);
|
|
614
|
+
}, bn = pe(null), D = () => {
|
|
615
|
+
const e = ne(bn);
|
|
643
616
|
if (e === null) throw new Error("[markdown-explorer] explorer components must be rendered inside <MarkdownExplorer>");
|
|
644
617
|
return e;
|
|
645
|
-
},
|
|
618
|
+
}, Ne = (e) => {
|
|
646
619
|
const { viewSettings: t } = D(), n = () => e(t.getSnapshot());
|
|
647
620
|
return ee(t.subscribe, n, n);
|
|
648
|
-
},
|
|
649
|
-
const { config: e } = D(), t =
|
|
650
|
-
return
|
|
651
|
-
},
|
|
621
|
+
}, st = () => {
|
|
622
|
+
const { config: e } = D(), t = Un()["*"], [n] = Zn(), r = n.toString();
|
|
623
|
+
return H(() => cn(e, t, new URLSearchParams(r)), [e, t, r]);
|
|
624
|
+
}, En = {
|
|
652
625
|
unauthorized: ["failureUnauthorizedTitle", "failureUnauthorizedBody"],
|
|
653
626
|
forbidden: ["failureForbiddenTitle", "failureForbiddenBody"],
|
|
654
627
|
"not-found": ["failureNotFoundTitle", "failureNotFoundBody"],
|
|
@@ -657,14 +630,14 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
657
630
|
"too-large": ["failureTooLargeTitle", "failureTooLargeBody"],
|
|
658
631
|
unsupported: ["failureUnsupportedTitle", "failureUnsupportedBody"],
|
|
659
632
|
failed: ["failureFailedTitle", "failureFailedBody"]
|
|
660
|
-
},
|
|
661
|
-
const { labels: o } = D(), i =
|
|
662
|
-
return /* @__PURE__ */
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
e.reason === "unauthorized" ? /* @__PURE__ */
|
|
633
|
+
}, ae = (e, t) => e[En[t][0]], me = ({ failure: e, alert: t, onRetry: n, testId: r }) => {
|
|
634
|
+
const { labels: o } = D(), i = ae(o, e.reason), l = o[En[e.reason][1]], u = e.reason === "unauthorized" || e.reason === "forbidden" || e.reason === "failed" ? "danger" : "warning";
|
|
635
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-callout", role: t ? "alert" : void 0, "data-aqmx-tone": u, "data-testid": r === null ? void 0 : r, "data-aqmx-failure": r === null ? void 0 : e.reason, children: [
|
|
636
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: i }),
|
|
637
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: l }),
|
|
638
|
+
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
|
|
666
639
|
] });
|
|
667
|
-
},
|
|
640
|
+
}, jr = (e, t) => {
|
|
668
641
|
const { phase: n, save: r, dirty: o } = t;
|
|
669
642
|
switch (n.kind) {
|
|
670
643
|
case "opening":
|
|
@@ -672,7 +645,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
672
645
|
case "grant":
|
|
673
646
|
return e.editGrantTitle;
|
|
674
647
|
case "failed":
|
|
675
|
-
return
|
|
648
|
+
return ae(e, n.failure.reason);
|
|
676
649
|
}
|
|
677
650
|
switch (r.kind) {
|
|
678
651
|
case "draft":
|
|
@@ -684,13 +657,13 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
684
657
|
case "grant":
|
|
685
658
|
return e.editGrantTitle;
|
|
686
659
|
case "failed":
|
|
687
|
-
return e.draftSaveFailed(
|
|
660
|
+
return e.draftSaveFailed(ae(e, r.failure.reason));
|
|
688
661
|
case "saved":
|
|
689
662
|
if (!o) return r.merged ? e.draftSavedMerged : e.draftSaved;
|
|
690
663
|
break;
|
|
691
664
|
}
|
|
692
665
|
return o ? e.draftUnsaved : "";
|
|
693
|
-
},
|
|
666
|
+
}, zr = (e, t, n) => {
|
|
694
667
|
switch (t.kind) {
|
|
695
668
|
case "draft":
|
|
696
669
|
return e.draftNotSaved;
|
|
@@ -701,7 +674,7 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
701
674
|
case "grant":
|
|
702
675
|
return e.editGrantTitle;
|
|
703
676
|
case "failed":
|
|
704
|
-
return e.draftSaveFailed(
|
|
677
|
+
return e.draftSaveFailed(ae(e, t.failure.reason));
|
|
705
678
|
case "idle":
|
|
706
679
|
case "saving":
|
|
707
680
|
return null;
|
|
@@ -716,38 +689,38 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
716
689
|
for (const t of [...e]) t();
|
|
717
690
|
}
|
|
718
691
|
};
|
|
719
|
-
},
|
|
720
|
-
`)),
|
|
692
|
+
}, Vr = "<<<<<<<", Hr = "=======", Ur = ">>>>>>>", Nt = (e, t) => e === t || e.startsWith(`${t} `), Dt = (e) => Zr(e.split(`
|
|
693
|
+
`)), Zr = (e) => {
|
|
721
694
|
const t = [];
|
|
722
695
|
let n = null, r = null, o = 0;
|
|
723
696
|
for (const i of e) {
|
|
724
697
|
o += 1;
|
|
725
|
-
const
|
|
726
|
-
|
|
698
|
+
const l = i.charCodeAt(0);
|
|
699
|
+
l !== 60 && l !== 61 && l !== 62 || (Nt(i, Vr) ? (n = o, r = null) : i === Hr ? n !== null && r === null ? r = o : n = null : Nt(i, Ur) && (n !== null && r !== null && t.push({ start: n, separator: r, end: o }), n = null, r = null));
|
|
727
700
|
}
|
|
728
701
|
return t;
|
|
729
|
-
},
|
|
702
|
+
}, Pt = (e) => e.includes(`\r
|
|
730
703
|
`) ? `\r
|
|
731
704
|
` : `
|
|
732
705
|
`, Ze = (e) => e.replace(/\r\n?/gu, `
|
|
733
|
-
`),
|
|
706
|
+
`), Gr = (e, t) => t === `
|
|
734
707
|
` ? e : e.replaceAll(`
|
|
735
708
|
`, `\r
|
|
736
|
-
`),
|
|
737
|
-
if (e === null || !
|
|
709
|
+
`), Kr = 3, Wr = /^\d+(?:\.\d+)?$/u, Yr = (e) => {
|
|
710
|
+
if (e === null || !Wr.test(e)) return null;
|
|
738
711
|
const t = Number(e);
|
|
739
|
-
return t >=
|
|
740
|
-
},
|
|
741
|
-
const i = /* @__PURE__ */ new Map(),
|
|
742
|
-
let h = null,
|
|
743
|
-
const k = (
|
|
744
|
-
|
|
745
|
-
}, R = (
|
|
712
|
+
return t >= un && t <= dn ? t : null;
|
|
713
|
+
}, Ge = Object.freeze({ kind: "idle" }), $t = Object.freeze({ kind: "draft" }), Xr = ({ data: e, conflictLabels: t, onSaveSettled: n, sideBySideSetting: r, editorShareSetting: o }) => {
|
|
714
|
+
const i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), d = Oe();
|
|
715
|
+
let h = null, v = null, E = null;
|
|
716
|
+
const k = (a, s) => {
|
|
717
|
+
a.value = { ...a.value, ...s }, d.emit();
|
|
718
|
+
}, R = (a, s) => i.get(a) === s, T = async (a, s) => {
|
|
746
719
|
s.controller.abort(), s.controller = new AbortController();
|
|
747
|
-
const { signal:
|
|
720
|
+
const { signal: w } = s.controller;
|
|
748
721
|
k(s, { phase: { kind: "opening" } });
|
|
749
|
-
const O = await e.edit(
|
|
750
|
-
if (!R(
|
|
722
|
+
const O = await e.edit(a, w);
|
|
723
|
+
if (!R(a, s) || w.aborted || !("kind" in O)) return;
|
|
751
724
|
if (O.kind === "grant") {
|
|
752
725
|
k(s, { phase: { kind: "grant", href: O.href } });
|
|
753
726
|
return;
|
|
@@ -756,248 +729,248 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
756
729
|
k(s, { phase: { kind: "failed", failure: O.failure } });
|
|
757
730
|
return;
|
|
758
731
|
}
|
|
759
|
-
const
|
|
760
|
-
s.base = { text:
|
|
761
|
-
},
|
|
762
|
-
const s = i.get(
|
|
763
|
-
s !== void 0 && (s.controller.abort(), i.delete(
|
|
764
|
-
},
|
|
765
|
-
|
|
766
|
-
}), b = (
|
|
767
|
-
k(s, { ...O, save:
|
|
768
|
-
},
|
|
769
|
-
m.get(
|
|
770
|
-
const s = i.get(
|
|
732
|
+
const L = Ze(O.text), A = O.kind === "draft";
|
|
733
|
+
s.base = { text: L, version: A ? null : O.version }, s.draft = L, s.ending = Pt(O.text), k(s, { phase: { kind: "editing" }, history: A ? !1 : O.history, dirty: !1, save: A ? $t : Ge, generation: s.value.generation + 1 });
|
|
734
|
+
}, N = (a) => {
|
|
735
|
+
const s = i.get(a);
|
|
736
|
+
s !== void 0 && (s.controller.abort(), i.delete(a), u.delete(a));
|
|
737
|
+
}, M = (a, s, w) => (a.set(s, w), () => {
|
|
738
|
+
a.get(s) === w && a.delete(s);
|
|
739
|
+
}), b = (a, s, w, O = {}) => {
|
|
740
|
+
k(s, { ...O, save: w }), n(a, w);
|
|
741
|
+
}, g = async (a) => {
|
|
742
|
+
m.get(a)?.flush();
|
|
743
|
+
const s = i.get(a);
|
|
771
744
|
if (s === void 0 || s.value.phase.kind !== "editing" || s.base === null || s.value.save.kind === "saving") return;
|
|
772
|
-
const { version:
|
|
773
|
-
if (
|
|
774
|
-
n(
|
|
745
|
+
const { version: w } = s.base;
|
|
746
|
+
if (w === null) {
|
|
747
|
+
n(a, $t);
|
|
775
748
|
return;
|
|
776
749
|
}
|
|
777
|
-
const O =
|
|
750
|
+
const O = Dt(s.draft).length;
|
|
778
751
|
if (O > 0) {
|
|
779
|
-
b(
|
|
752
|
+
b(a, s, { kind: "conflicts", count: O });
|
|
780
753
|
return;
|
|
781
754
|
}
|
|
782
755
|
s.controller.abort(), s.controller = new AbortController();
|
|
783
|
-
const { signal:
|
|
784
|
-
let
|
|
756
|
+
const { signal: L } = s.controller;
|
|
757
|
+
let A = { text: s.base.text, version: w }, I = s.draft, K = !1;
|
|
785
758
|
k(s, { save: { kind: "saving" } });
|
|
786
|
-
for (let G = 0; G <
|
|
787
|
-
const
|
|
788
|
-
if (!R(
|
|
789
|
-
if (
|
|
790
|
-
m.get(
|
|
759
|
+
for (let G = 0; G < Kr; G += 1) {
|
|
760
|
+
const z = await e.save(a, A.version, Gr(I, s.ending), L);
|
|
761
|
+
if (!R(a, s) || L.aborted || !("kind" in z)) return;
|
|
762
|
+
if (z.kind === "saved") {
|
|
763
|
+
m.get(a)?.flush(), s.base = { text: I, version: z.version }, b(a, s, { kind: "saved", merged: K }, { dirty: s.draft !== I });
|
|
791
764
|
return;
|
|
792
765
|
}
|
|
793
|
-
if (
|
|
794
|
-
b(
|
|
766
|
+
if (z.kind === "grant") {
|
|
767
|
+
b(a, s, { kind: "grant", href: z.href });
|
|
795
768
|
return;
|
|
796
769
|
}
|
|
797
|
-
if (
|
|
798
|
-
b(
|
|
770
|
+
if (z.kind === "failure") {
|
|
771
|
+
b(a, s, { kind: "failed", failure: z.failure });
|
|
799
772
|
return;
|
|
800
773
|
}
|
|
801
|
-
const { mergeDraft:
|
|
802
|
-
if (!R(
|
|
803
|
-
const
|
|
804
|
-
|
|
805
|
-
const
|
|
806
|
-
if (
|
|
807
|
-
b(
|
|
774
|
+
const { mergeDraft: X } = await import("./merge-BzMpSaxx.js");
|
|
775
|
+
if (!R(a, s) || L.aborted) return;
|
|
776
|
+
const j = m.get(a);
|
|
777
|
+
j?.flush();
|
|
778
|
+
const re = Ze(z.text), p = X(A.text, s.draft, re, t());
|
|
779
|
+
if (A = { text: re, version: z.version }, s.base = A, s.ending = Pt(z.text), s.draft = p.text, j?.adopt(p.text), p.kind === "conflicts") {
|
|
780
|
+
b(a, s, { kind: "conflicts", count: p.conflicts }, { dirty: !0, generation: s.value.generation + 1 });
|
|
808
781
|
return;
|
|
809
782
|
}
|
|
810
|
-
if (
|
|
811
|
-
b(
|
|
783
|
+
if (K = !0, I = p.text, I === A.text) {
|
|
784
|
+
b(a, s, { kind: "saved", merged: K }, { dirty: !1, generation: s.value.generation + 1 });
|
|
812
785
|
return;
|
|
813
786
|
}
|
|
814
787
|
k(s, { dirty: !0, generation: s.value.generation + 1 });
|
|
815
788
|
}
|
|
816
|
-
b(
|
|
789
|
+
b(a, s, { kind: "failed", failure: { reason: "failed" } });
|
|
817
790
|
};
|
|
818
791
|
return {
|
|
819
|
-
session: (
|
|
820
|
-
subscribe:
|
|
821
|
-
start: (
|
|
822
|
-
const
|
|
823
|
-
if (
|
|
824
|
-
k(
|
|
792
|
+
session: (a) => i.get(a)?.value,
|
|
793
|
+
subscribe: d.subscribe,
|
|
794
|
+
start: (a, s) => {
|
|
795
|
+
const w = i.get(a);
|
|
796
|
+
if (w !== void 0) {
|
|
797
|
+
k(w, { request: { anchor: s }, view: "editor" }), (w.value.phase.kind === "failed" || w.value.phase.kind === "grant") && T(a, w);
|
|
825
798
|
return;
|
|
826
799
|
}
|
|
827
|
-
|
|
800
|
+
l.delete(a);
|
|
828
801
|
const O = {
|
|
829
|
-
value: { path:
|
|
802
|
+
value: { path: a, phase: { kind: "opening" }, view: "editor", previewPrepared: !1, history: !1, dirty: !1, save: Ge, generation: 0, request: { anchor: s } },
|
|
830
803
|
base: null,
|
|
831
804
|
draft: "",
|
|
832
805
|
ending: `
|
|
833
806
|
`,
|
|
834
807
|
controller: new AbortController()
|
|
835
808
|
};
|
|
836
|
-
i.set(
|
|
809
|
+
i.set(a, O), T(a, O);
|
|
837
810
|
},
|
|
838
|
-
retry: (
|
|
839
|
-
const s = i.get(
|
|
840
|
-
s === void 0 || s.value.phase.kind === "editing" || T(
|
|
811
|
+
retry: (a) => {
|
|
812
|
+
const s = i.get(a);
|
|
813
|
+
s === void 0 || s.value.phase.kind === "editing" || T(a, s);
|
|
841
814
|
},
|
|
842
|
-
draft: (
|
|
843
|
-
const s = i.get(
|
|
815
|
+
draft: (a) => {
|
|
816
|
+
const s = i.get(a);
|
|
844
817
|
return s === void 0 || s.base === null ? null : s.draft;
|
|
845
818
|
},
|
|
846
|
-
setDraft: (
|
|
847
|
-
const
|
|
848
|
-
if (
|
|
849
|
-
|
|
850
|
-
const O = {},
|
|
851
|
-
|
|
852
|
-
const { save:
|
|
853
|
-
if (
|
|
854
|
-
const
|
|
855
|
-
|
|
819
|
+
setDraft: (a, s) => {
|
|
820
|
+
const w = i.get(a);
|
|
821
|
+
if (w === void 0 || w.base === null) return;
|
|
822
|
+
w.draft = s;
|
|
823
|
+
const O = {}, L = s !== w.base.text;
|
|
824
|
+
L !== w.value.dirty && (O.dirty = L);
|
|
825
|
+
const { save: A } = w.value;
|
|
826
|
+
if (A.kind === "conflicts") {
|
|
827
|
+
const I = Dt(s).length;
|
|
828
|
+
I === 0 ? O.save = Ge : I !== A.count && (O.save = { kind: "conflicts", count: I });
|
|
856
829
|
}
|
|
857
|
-
(O.dirty !== void 0 || O.save !== void 0) && k(
|
|
830
|
+
(O.dirty !== void 0 || O.save !== void 0) && k(w, O);
|
|
858
831
|
},
|
|
859
|
-
consumeRequest: (
|
|
860
|
-
const s = i.get(
|
|
832
|
+
consumeRequest: (a) => {
|
|
833
|
+
const s = i.get(a);
|
|
861
834
|
s !== void 0 && s.value.request !== null && k(s, { request: null });
|
|
862
835
|
},
|
|
863
|
-
save:
|
|
864
|
-
replaceDraft: (
|
|
865
|
-
const
|
|
866
|
-
|
|
867
|
-
const O = i.get(
|
|
836
|
+
save: g,
|
|
837
|
+
replaceDraft: (a, s) => {
|
|
838
|
+
const w = m.get(a);
|
|
839
|
+
w?.flush();
|
|
840
|
+
const O = i.get(a);
|
|
868
841
|
if (O === void 0 || O.base === null) return;
|
|
869
|
-
const
|
|
870
|
-
O.draft =
|
|
842
|
+
const L = Ze(s);
|
|
843
|
+
O.draft = L, w?.adopt(L), k(O, { dirty: L !== O.base.text, generation: O.value.generation + 1 });
|
|
871
844
|
},
|
|
872
|
-
close: (
|
|
873
|
-
if (!i.has(
|
|
874
|
-
const s = m.get(
|
|
875
|
-
|
|
845
|
+
close: (a) => {
|
|
846
|
+
if (!i.has(a)) return;
|
|
847
|
+
const s = m.get(a), w = s === void 0 ? null : s.returnPoint();
|
|
848
|
+
N(a), w === null ? l.delete(a) : l.set(a, w), d.emit();
|
|
876
849
|
},
|
|
877
|
-
takeReturn: (
|
|
878
|
-
const s =
|
|
879
|
-
return
|
|
850
|
+
takeReturn: (a) => {
|
|
851
|
+
const s = l.get(a) ?? null;
|
|
852
|
+
return l.delete(a), s;
|
|
880
853
|
},
|
|
881
|
-
dirtyPaths: () => [...i.values()].filter((
|
|
882
|
-
discard: (
|
|
883
|
-
for (const s of
|
|
884
|
-
|
|
854
|
+
dirtyPaths: () => [...i.values()].filter((a) => a.value.dirty).map((a) => a.value.path),
|
|
855
|
+
discard: (a) => {
|
|
856
|
+
for (const s of a) N(s);
|
|
857
|
+
a.length > 0 && d.emit();
|
|
885
858
|
},
|
|
886
859
|
editorState: {
|
|
887
|
-
get: (
|
|
888
|
-
set: (
|
|
889
|
-
i.has(
|
|
860
|
+
get: (a) => u.get(a),
|
|
861
|
+
set: (a, s) => {
|
|
862
|
+
i.has(a) && u.set(a, s);
|
|
890
863
|
}
|
|
891
864
|
},
|
|
892
|
-
bindEditor: (
|
|
893
|
-
bindView: (
|
|
894
|
-
viewAnchor: (
|
|
895
|
-
const s = f.get(
|
|
865
|
+
bindEditor: (a, s) => M(m, a, s),
|
|
866
|
+
bindView: (a, s) => M(f, a, s),
|
|
867
|
+
viewAnchor: (a) => {
|
|
868
|
+
const s = f.get(a);
|
|
896
869
|
return s === void 0 ? null : s.anchor();
|
|
897
870
|
},
|
|
898
|
-
flush: (
|
|
871
|
+
flush: (a) => m.get(a)?.flush(),
|
|
899
872
|
flushDrafts: () => {
|
|
900
|
-
for (const
|
|
873
|
+
for (const a of m.values()) a.flush();
|
|
901
874
|
},
|
|
902
|
-
nextConflict: (
|
|
875
|
+
nextConflict: (a) => m.get(a)?.nextConflict() === !0,
|
|
903
876
|
hasSessions: () => i.size > 0,
|
|
904
|
-
unsavedAmong: (
|
|
877
|
+
unsavedAmong: (a) => {
|
|
905
878
|
for (const s of m.values()) s.flush();
|
|
906
|
-
return
|
|
879
|
+
return a.filter((s) => i.get(s)?.value.dirty === !0);
|
|
907
880
|
},
|
|
908
|
-
askToDiscard: (
|
|
881
|
+
askToDiscard: (a) => new Promise((s) => {
|
|
909
882
|
E?.settle(!1);
|
|
910
|
-
const
|
|
911
|
-
paths:
|
|
883
|
+
const w = {
|
|
884
|
+
paths: a,
|
|
912
885
|
settle: (O) => {
|
|
913
|
-
if (E ===
|
|
914
|
-
if (E = null, O) for (const
|
|
915
|
-
|
|
886
|
+
if (E === w) {
|
|
887
|
+
if (E = null, O) for (const L of a) N(L);
|
|
888
|
+
d.emit(), s(O);
|
|
916
889
|
}
|
|
917
890
|
}
|
|
918
891
|
};
|
|
919
|
-
E =
|
|
892
|
+
E = w, d.emit();
|
|
920
893
|
}),
|
|
921
894
|
discardRequest: () => E,
|
|
922
895
|
sideBySide: () => (h ??= r.read(), h),
|
|
923
|
-
setSideBySide: (
|
|
924
|
-
h !==
|
|
896
|
+
setSideBySide: (a) => {
|
|
897
|
+
h !== a && (h = a, r.write(a), d.emit());
|
|
925
898
|
},
|
|
926
|
-
editorShare: () => (
|
|
927
|
-
setEditorShare: (
|
|
928
|
-
if (!Number.isFinite(
|
|
929
|
-
const s = Math.min(
|
|
930
|
-
|
|
899
|
+
editorShare: () => (v ??= o.read() ?? Qn, v),
|
|
900
|
+
setEditorShare: (a) => {
|
|
901
|
+
if (!Number.isFinite(a)) throw new RangeError(`[markdown-explorer] an editor share must be a finite number; got ${String(a)}`);
|
|
902
|
+
const s = Math.min(dn, Math.max(un, a));
|
|
903
|
+
v !== s && (v = s, o.write(s));
|
|
931
904
|
},
|
|
932
|
-
setView: (
|
|
933
|
-
const
|
|
934
|
-
|
|
905
|
+
setView: (a, s) => {
|
|
906
|
+
const w = i.get(a);
|
|
907
|
+
w === void 0 || w.value.view === s || (m.get(a)?.beforeView(s), k(w, { view: s, previewPrepared: w.value.previewPrepared || s === "preview" }));
|
|
935
908
|
},
|
|
936
|
-
preparePreview: (
|
|
937
|
-
const s = i.get(
|
|
909
|
+
preparePreview: (a) => {
|
|
910
|
+
const s = i.get(a);
|
|
938
911
|
s !== void 0 && !s.value.previewPrepared && k(s, { previewPrepared: !0 });
|
|
939
912
|
}
|
|
940
913
|
};
|
|
941
|
-
},
|
|
914
|
+
}, yn = (e) => {
|
|
942
915
|
e.preventDefault(), e.stopPropagation();
|
|
943
|
-
},
|
|
944
|
-
const t = e.closest(
|
|
916
|
+
}, Jr = (e) => e.endsWith("px") ? Number.parseFloat(e) : Number.NaN, Sn = "data-aqmx-content-pane", tt = Object.freeze({ [Sn]: "" }), Qr = "--aqmx-dialog-left", eo = "--aqmx-dialog-top", to = '[data-testid="markdown-explorer"]', no = (e) => {
|
|
917
|
+
const t = e.closest(to)?.querySelectorAll(`[${Sn}]`), n = t?.item(t.length - 1);
|
|
945
918
|
if (!(n instanceof HTMLElement)) throw new Error("[markdown-explorer] a dialog opened where the explorer marks no content pane");
|
|
946
919
|
return n;
|
|
947
|
-
},
|
|
948
|
-
const t =
|
|
920
|
+
}, ro = (e) => {
|
|
921
|
+
const t = Jr(getComputedStyle(e).marginTop);
|
|
949
922
|
if (Number.isNaN(t)) return null;
|
|
950
|
-
const n =
|
|
951
|
-
return e.style.setProperty(
|
|
952
|
-
},
|
|
953
|
-
const r =
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
}, [t]),
|
|
923
|
+
const n = no(e), r = e.getBoundingClientRect(), o = e.ownerDocument.documentElement, { left: i, top: l } = er(n.getBoundingClientRect(), { width: r.width + 2 * t, height: r.height + 2 * t }, { width: o.clientWidth, height: o.clientHeight });
|
|
924
|
+
return e.style.setProperty(Qr, `${String(i)}px`), e.style.setProperty(eo, `${String(l)}px`), n;
|
|
925
|
+
}, oo = (e) => e.preventDefault(), xn = ({ open: e, onOpen: t, onDismiss: n }) => {
|
|
926
|
+
const r = q(null), o = q(null), i = q(!1), l = q(t);
|
|
927
|
+
V(() => {
|
|
928
|
+
l.current = t;
|
|
929
|
+
}, [t]), V(() => {
|
|
957
930
|
i.current = e;
|
|
958
|
-
const
|
|
959
|
-
if (
|
|
960
|
-
if (e && !
|
|
961
|
-
const h =
|
|
962
|
-
o.current = h instanceof HTMLElement ? h : null,
|
|
963
|
-
} else !e &&
|
|
964
|
-
}, [e]),
|
|
965
|
-
const
|
|
966
|
-
if (!e ||
|
|
931
|
+
const d = r.current;
|
|
932
|
+
if (d !== null)
|
|
933
|
+
if (e && !d.open) {
|
|
934
|
+
const h = d.ownerDocument.activeElement;
|
|
935
|
+
o.current = h instanceof HTMLElement ? h : null, d.showModal(), l.current?.();
|
|
936
|
+
} else !e && d.open && (d.close(), o.current?.isConnected === !0 && o.current.focus(), o.current = null);
|
|
937
|
+
}, [e]), V(() => {
|
|
938
|
+
const d = r.current;
|
|
939
|
+
if (!e || d === null) return;
|
|
967
940
|
const h = new ResizeObserver(() => E());
|
|
968
|
-
let
|
|
941
|
+
let v = null;
|
|
969
942
|
const E = () => {
|
|
970
|
-
const R =
|
|
971
|
-
R === null || R ===
|
|
943
|
+
const R = ro(d);
|
|
944
|
+
R === null || R === v || (v !== null && h.unobserve(v), h.observe(R), v = R);
|
|
972
945
|
};
|
|
973
|
-
E(), h.observe(
|
|
974
|
-
const k =
|
|
975
|
-
return k?.addEventListener("resize", E),
|
|
976
|
-
h.disconnect(), k?.removeEventListener("resize", E),
|
|
946
|
+
E(), h.observe(d);
|
|
947
|
+
const k = d.ownerDocument.defaultView;
|
|
948
|
+
return k?.addEventListener("resize", E), d.ownerDocument.addEventListener("scroll", E, { capture: !0, passive: !0 }), () => {
|
|
949
|
+
h.disconnect(), k?.removeEventListener("resize", E), d.ownerDocument.removeEventListener("scroll", E, { capture: !0 });
|
|
977
950
|
};
|
|
978
951
|
}, [e]);
|
|
979
952
|
const u = P(
|
|
980
|
-
(
|
|
981
|
-
|
|
953
|
+
(d) => {
|
|
954
|
+
d.key !== "Escape" || d.defaultPrevented || (yn(d), n());
|
|
982
955
|
},
|
|
983
956
|
[n]
|
|
984
957
|
), m = P(
|
|
985
|
-
(
|
|
986
|
-
|
|
958
|
+
(d) => {
|
|
959
|
+
d.target === d.currentTarget && n();
|
|
987
960
|
},
|
|
988
961
|
[n]
|
|
989
962
|
), f = P(() => {
|
|
990
963
|
i.current && n();
|
|
991
964
|
}, [n]);
|
|
992
|
-
return { ref: r, onKeyDown: u, onClick: m, onCancel:
|
|
993
|
-
},
|
|
994
|
-
const m =
|
|
995
|
-
return /* @__PURE__ */
|
|
996
|
-
/* @__PURE__ */
|
|
997
|
-
/* @__PURE__ */
|
|
998
|
-
/* @__PURE__ */
|
|
999
|
-
/* @__PURE__ */
|
|
1000
|
-
/* @__PURE__ */
|
|
965
|
+
return { ref: r, onKeyDown: u, onClick: m, onCancel: oo, onClose: f };
|
|
966
|
+
}, kn = ({ open: e, title: t, body: n, confirmLabel: r, cancelLabel: o, onConfirm: i, onCancel: l, testId: u }) => {
|
|
967
|
+
const m = q(null), f = xe(), d = xe(), h = P(() => m.current?.focus(), []), v = xn({ open: e, onOpen: h, onDismiss: l });
|
|
968
|
+
return /* @__PURE__ */ c("dialog", { ...v, className: "aqmx-confirm", "aria-labelledby": f, "aria-describedby": d, "data-testid": u, children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel", children: [
|
|
969
|
+
/* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: t }),
|
|
970
|
+
/* @__PURE__ */ c("p", { id: d, className: "aqmx-confirm-body", children: n }),
|
|
971
|
+
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
972
|
+
/* @__PURE__ */ c("button", { ref: m, type: "button", className: "aqmx-callout-action", "data-testid": `${u}-cancel`, onClick: l, children: o }),
|
|
973
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-aqmx-tone": "danger", "data-testid": `${u}-confirm`, onClick: i, children: r })
|
|
1001
974
|
] })
|
|
1002
975
|
] }) });
|
|
1003
976
|
}, Te = (e) => {
|
|
@@ -1010,31 +983,31 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
1010
983
|
t.status = "rejected", t.reason = n;
|
|
1011
984
|
}
|
|
1012
985
|
)), t;
|
|
1013
|
-
},
|
|
986
|
+
}, Tn = (e) => Object.assign(Promise.resolve(e), { status: "fulfilled", value: e }), Ee = (e) => e.status === "fulfilled" ? e.value : void 0, io = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !1 }), lo = Object.freeze({ readme: Object.freeze({ status: "loading" }), claim: !0 }), ao = (e, t, n) => {
|
|
1014
987
|
const r = /* @__PURE__ */ new Set(), o = [...e].reverse();
|
|
1015
988
|
for (let i = o.pop(); i !== void 0; i = o.pop()) {
|
|
1016
989
|
if (i.type !== "directory" || r.has(i.path)) continue;
|
|
1017
990
|
r.add(i.path);
|
|
1018
|
-
const
|
|
991
|
+
const l = i.lazy === !0 ? n(i.path) : void 0, u = i.lazy === !0 ? l?.status === "loaded" ? l.entries : null : i.children === void 0 ? [] : i.children;
|
|
1019
992
|
if (i.path === t) return u;
|
|
1020
993
|
if (u !== null) for (const m of [...u].reverse()) o.push(m);
|
|
1021
994
|
}
|
|
1022
995
|
return null;
|
|
1023
|
-
},
|
|
996
|
+
}, so = (e, t, n) => {
|
|
1024
997
|
const r = Ee(e.read(t));
|
|
1025
|
-
if (r === void 0 || r.status === "deferred") return
|
|
998
|
+
if (r === void 0 || r.status === "deferred") return io;
|
|
1026
999
|
if (r.status === "error") return { readme: { status: "failed", failure: r.failure, retry: () => e.retry(t) }, claim: !1 };
|
|
1027
|
-
const o =
|
|
1028
|
-
if (o !== null) return { readme: { status: "ok", readme:
|
|
1000
|
+
const o = ao(r.entries, n, (l) => e.children(t, l));
|
|
1001
|
+
if (o !== null) return { readme: { status: "ok", readme: Et(o) }, claim: !1 };
|
|
1029
1002
|
const i = e.children(t, n);
|
|
1030
|
-
return i === void 0 || i.status === "loading" ?
|
|
1031
|
-
},
|
|
1032
|
-
const { readme: r } =
|
|
1003
|
+
return i === void 0 || i.status === "loading" ? lo : i.status === "failed" ? { readme: { status: "failed", failure: i.failure, retry: () => e.retryChildren(t, n) }, claim: !0 } : { readme: { status: "ok", readme: Et(i.entries) }, claim: !0 };
|
|
1004
|
+
}, co = (e, t, n) => {
|
|
1005
|
+
const { readme: r } = so(e, t, n);
|
|
1033
1006
|
return r.status === "ok" ? r.readme : null;
|
|
1034
|
-
},
|
|
1035
|
-
const r =
|
|
1007
|
+
}, uo = (e, t, n) => {
|
|
1008
|
+
const r = Gn({ path: `${e.basePath}/*`, end: !0 }, t.pathname);
|
|
1036
1009
|
if (r === null) return /* @__PURE__ */ new Set();
|
|
1037
|
-
const { location: o } =
|
|
1010
|
+
const { location: o } = cn(e, r.params["*"], new URLSearchParams(t.search));
|
|
1038
1011
|
switch (o.view) {
|
|
1039
1012
|
case "tree": {
|
|
1040
1013
|
const i = o.folder === null ? o.doc : n(o.source, o.folder);
|
|
@@ -1045,24 +1018,24 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
1045
1018
|
case "multi":
|
|
1046
1019
|
return new Set(o.docs);
|
|
1047
1020
|
}
|
|
1048
|
-
},
|
|
1021
|
+
}, Rn = (e) => {
|
|
1049
1022
|
const { edits: t } = D(), n = P(() => t.session(e), [t, e]);
|
|
1050
|
-
return ee(t.subscribe, n,
|
|
1051
|
-
},
|
|
1052
|
-
},
|
|
1023
|
+
return ee(t.subscribe, n, fo);
|
|
1024
|
+
}, On = () => !1, fo = () => {
|
|
1025
|
+
}, mo = () => {
|
|
1053
1026
|
const { edits: e } = D();
|
|
1054
|
-
return ee(e.subscribe, e.hasSessions,
|
|
1055
|
-
},
|
|
1027
|
+
return ee(e.subscribe, e.hasSessions, On);
|
|
1028
|
+
}, ho = () => {
|
|
1056
1029
|
const { edits: e } = D();
|
|
1057
|
-
return ee(e.subscribe, e.sideBySide,
|
|
1058
|
-
},
|
|
1059
|
-
const { edits: e, labels: t, config: n, trees: r } = D(), o =
|
|
1030
|
+
return ee(e.subscribe, e.sideBySide, On);
|
|
1031
|
+
}, po = () => null, vo = () => {
|
|
1032
|
+
const { edits: e, labels: t, config: n, trees: r } = D(), o = q([]), i = P(
|
|
1060
1033
|
({ nextLocation: E }) => {
|
|
1061
|
-
const k =
|
|
1034
|
+
const k = uo(n, E, (R, T) => co(r, R, T));
|
|
1062
1035
|
return e.flushDrafts(), o.current = e.dirtyPaths().filter((R) => !k.has(R)), o.current.length > 0;
|
|
1063
1036
|
},
|
|
1064
1037
|
[e, n, r]
|
|
1065
|
-
),
|
|
1038
|
+
), l = Kn(i), u = mo();
|
|
1066
1039
|
te(() => {
|
|
1067
1040
|
if (!u) return;
|
|
1068
1041
|
const E = (k) => {
|
|
@@ -1070,26 +1043,26 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
1070
1043
|
};
|
|
1071
1044
|
return window.addEventListener("beforeunload", E), () => window.removeEventListener("beforeunload", E);
|
|
1072
1045
|
}, [u, e]);
|
|
1073
|
-
const m = ee(e.subscribe, e.discardRequest,
|
|
1074
|
-
return /* @__PURE__ */
|
|
1075
|
-
|
|
1046
|
+
const m = ee(e.subscribe, e.discardRequest, po), f = l.state === "blocked", d = f ? o.current : m === null ? [] : m.paths, h = d.map((E) => se(E)).join(", "), v = d.length > 0 && d.every((E) => e.session(E)?.save.kind === "draft");
|
|
1047
|
+
return /* @__PURE__ */ c(
|
|
1048
|
+
kn,
|
|
1076
1049
|
{
|
|
1077
1050
|
open: f || m !== null,
|
|
1078
|
-
title:
|
|
1079
|
-
body:
|
|
1051
|
+
title: v ? t.draftDiscardTitle : t.unsavedTitle,
|
|
1052
|
+
body: v ? t.draftDiscardBody(h) : t.unsavedBody(h),
|
|
1080
1053
|
confirmLabel: t.unsavedDiscard,
|
|
1081
1054
|
cancelLabel: t.unsavedStay,
|
|
1082
1055
|
testId: "markdown-explorer-unsaved-guard",
|
|
1083
1056
|
onConfirm: () => {
|
|
1084
|
-
if (
|
|
1085
|
-
e.discard(o.current),
|
|
1057
|
+
if (l.state === "blocked") {
|
|
1058
|
+
e.discard(o.current), l.proceed();
|
|
1086
1059
|
return;
|
|
1087
1060
|
}
|
|
1088
1061
|
m?.settle(!0);
|
|
1089
1062
|
},
|
|
1090
1063
|
onCancel: () => {
|
|
1091
|
-
if (
|
|
1092
|
-
|
|
1064
|
+
if (l.state === "blocked") {
|
|
1065
|
+
l.reset();
|
|
1093
1066
|
return;
|
|
1094
1067
|
}
|
|
1095
1068
|
m?.settle(!1);
|
|
@@ -1097,12 +1070,12 @@ const Tt = Object.freeze(["en", "ja"]), Tr = "en", Rr = Object.freeze({
|
|
|
1097
1070
|
}
|
|
1098
1071
|
);
|
|
1099
1072
|
};
|
|
1100
|
-
function
|
|
1073
|
+
function go({
|
|
1101
1074
|
title: e,
|
|
1102
1075
|
titleId: t,
|
|
1103
1076
|
...n
|
|
1104
1077
|
}, r) {
|
|
1105
|
-
return /* @__PURE__ */
|
|
1078
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1106
1079
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1107
1080
|
viewBox: "0 0 20 20",
|
|
1108
1081
|
fill: "currentColor",
|
|
@@ -1110,26 +1083,26 @@ function co({
|
|
|
1110
1083
|
"data-slot": "icon",
|
|
1111
1084
|
ref: r,
|
|
1112
1085
|
"aria-labelledby": t
|
|
1113
|
-
}, n), e ? /* @__PURE__ */
|
|
1086
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1114
1087
|
id: t
|
|
1115
|
-
}, e) : null, /* @__PURE__ */
|
|
1088
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1116
1089
|
fillRule: "evenodd",
|
|
1117
1090
|
d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm2.25 8.5a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Zm0 3a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
|
|
1118
1091
|
clipRule: "evenodd"
|
|
1119
1092
|
}));
|
|
1120
1093
|
}
|
|
1121
|
-
const
|
|
1122
|
-
let
|
|
1123
|
-
const
|
|
1124
|
-
throw
|
|
1125
|
-
}),
|
|
1126
|
-
|
|
1094
|
+
const wo = /* @__PURE__ */ S.forwardRef(go);
|
|
1095
|
+
let Ke = null;
|
|
1096
|
+
const Cn = () => (Ke ??= import("./EditSurface-Dhvw9IDD.js").catch((e) => {
|
|
1097
|
+
throw Ke = null, e;
|
|
1098
|
+
}), Ke), bo = () => {
|
|
1099
|
+
Cn().catch(() => {
|
|
1127
1100
|
});
|
|
1128
|
-
},
|
|
1129
|
-
const { default: t } =
|
|
1130
|
-
return /* @__PURE__ */
|
|
1101
|
+
}, Eo = (e) => {
|
|
1102
|
+
const { default: t } = ne(Cn());
|
|
1103
|
+
return /* @__PURE__ */ c(t, { ...e });
|
|
1131
1104
|
};
|
|
1132
|
-
class
|
|
1105
|
+
class yo extends an {
|
|
1133
1106
|
state = { failed: !1 };
|
|
1134
1107
|
static getDerivedStateFromError() {
|
|
1135
1108
|
return { failed: !0 };
|
|
@@ -1139,110 +1112,110 @@ class ho extends tn {
|
|
|
1139
1112
|
return this.state.failed ? this.props.fallback(this.retry) : this.props.children;
|
|
1140
1113
|
}
|
|
1141
1114
|
}
|
|
1142
|
-
const
|
|
1115
|
+
const ct = `[${mn}]`, So = "[data-aqmd-content]", xo = 'a[href], button, input, select, textarea, summary, label, [contenteditable], [role="menu"], iframe, video, audio, object, embed, svg, [data-aqmd-spreadsheet-editable], [data-aqmd-spreadsheet-fullscreen], [data-aqmd-svg-image-source]', ko = 200, Re = (e) => Or(e.getAttribute(mn)), To = (e, t) => {
|
|
1143
1116
|
for (let r = e; r !== null && t.contains(r); r = r.parentElement) {
|
|
1144
1117
|
const o = Re(r);
|
|
1145
1118
|
if (o !== null) return { block: r, lines: o, own: !0 };
|
|
1146
1119
|
}
|
|
1147
1120
|
let n = null;
|
|
1148
|
-
for (const r of t.querySelectorAll(
|
|
1121
|
+
for (const r of t.querySelectorAll(ct)) {
|
|
1149
1122
|
if (!(r.compareDocumentPosition(e) & Node.DOCUMENT_POSITION_FOLLOWING)) break;
|
|
1150
1123
|
const o = Re(r);
|
|
1151
1124
|
o !== null && (n = { block: r, lines: o });
|
|
1152
1125
|
}
|
|
1153
1126
|
return n === null ? null : { ...n, own: !1 };
|
|
1154
|
-
},
|
|
1127
|
+
}, Ro = (e, t) => {
|
|
1155
1128
|
let n = 0;
|
|
1156
1129
|
for (let r = e.indexOf(t); r >= 0; r = e.indexOf(t, r + t.length)) n += 1;
|
|
1157
1130
|
return n;
|
|
1158
|
-
},
|
|
1159
|
-
const r =
|
|
1131
|
+
}, Oo = (e) => e.closest(So) !== null && e.closest(xo) === null, Co = (e, t, n) => {
|
|
1132
|
+
const r = To(e, t);
|
|
1160
1133
|
if (r === null) return null;
|
|
1161
1134
|
const { block: o, own: i } = r;
|
|
1162
1135
|
if (!i) {
|
|
1163
1136
|
const u = r.lines.last + 1;
|
|
1164
|
-
return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop:
|
|
1137
|
+
return { lines: { first: u, last: u }, word: null, occurrence: 0, clientTop: De(e) };
|
|
1165
1138
|
}
|
|
1166
|
-
const
|
|
1167
|
-
return
|
|
1168
|
-
},
|
|
1139
|
+
const l = No(o, n);
|
|
1140
|
+
return l === null ? { lines: r.lines, word: null, occurrence: 0, clientTop: De(o) } : { lines: r.lines, word: l.text, occurrence: l.occurrence, clientTop: l.clientTop };
|
|
1141
|
+
}, Mo = (e, t) => {
|
|
1169
1142
|
let n = null, r = null, o = null;
|
|
1170
|
-
for (const
|
|
1171
|
-
const u = Re(
|
|
1143
|
+
for (const l of e.querySelectorAll(ct)) {
|
|
1144
|
+
const u = Re(l);
|
|
1172
1145
|
if (u === null) continue;
|
|
1173
|
-
n ??=
|
|
1174
|
-
const { top: m, bottom: f } =
|
|
1175
|
-
m <= n && n < f ? r = { lines: u, block:
|
|
1146
|
+
n ??= Ao(t, l);
|
|
1147
|
+
const { top: m, bottom: f } = l.getBoundingClientRect();
|
|
1148
|
+
m <= n && n < f ? r = { lines: u, block: l } : o === null && m >= n && (o = { lines: u, block: l });
|
|
1176
1149
|
}
|
|
1177
1150
|
const i = r === null ? o : r;
|
|
1178
|
-
return i === null ? null : { lines: i.lines, word: null, occurrence: 0, clientTop:
|
|
1179
|
-
},
|
|
1151
|
+
return i === null ? null : { lines: i.lines, word: null, occurrence: 0, clientTop: De(i.block) };
|
|
1152
|
+
}, Lo = (e) => e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, Ao = (e, t) => {
|
|
1180
1153
|
const n = Number.parseFloat(getComputedStyle(t).scrollMarginTop);
|
|
1181
|
-
return
|
|
1182
|
-
},
|
|
1154
|
+
return Lo(e) + (Number.isFinite(n) ? n : 0);
|
|
1155
|
+
}, No = (e, t) => {
|
|
1183
1156
|
if (t === null || t.rangeCount === 0) return null;
|
|
1184
1157
|
const n = t.getRangeAt(0);
|
|
1185
1158
|
if (!(e.contains(n.startContainer) && e.contains(n.endContainer))) return null;
|
|
1186
1159
|
const r = n.toString().trim();
|
|
1187
|
-
if (r === "" || r.length >
|
|
1160
|
+
if (r === "" || r.length > ko || /[\r\n]/u.test(r)) return null;
|
|
1188
1161
|
const o = e.ownerDocument.createRange();
|
|
1189
|
-
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence:
|
|
1190
|
-
},
|
|
1162
|
+
return o.setStart(e, 0), o.setEnd(n.startContainer, n.startOffset), { text: r, occurrence: Ro(o.toString(), r), clientTop: n.getBoundingClientRect().top };
|
|
1163
|
+
}, is = (e, t) => {
|
|
1191
1164
|
const n = e.split(`
|
|
1192
1165
|
`), r = Math.min(t.lines.first, n.length), o = Math.min(t.lines.last, n.length), i = { line: r, column: 0 };
|
|
1193
1166
|
if (t.word === null) return i;
|
|
1194
|
-
let
|
|
1167
|
+
let l = 0;
|
|
1195
1168
|
for (let u = r; u <= o; u += 1) {
|
|
1196
1169
|
const m = n[u - 1] ?? "";
|
|
1197
1170
|
for (let f = m.indexOf(t.word); f >= 0; f = m.indexOf(t.word, f + t.word.length)) {
|
|
1198
|
-
if (
|
|
1199
|
-
|
|
1171
|
+
if (l === t.occurrence) return { line: u, column: f };
|
|
1172
|
+
l += 1;
|
|
1200
1173
|
}
|
|
1201
1174
|
}
|
|
1202
|
-
return
|
|
1203
|
-
},
|
|
1175
|
+
return l > 0 ? Do(n, r, o, t.word) ?? i : i;
|
|
1176
|
+
}, Do = (e, t, n, r) => {
|
|
1204
1177
|
for (let o = n; o >= t; o -= 1) {
|
|
1205
1178
|
const i = (e[o - 1] ?? "").lastIndexOf(r);
|
|
1206
1179
|
if (i >= 0) return { line: o, column: i };
|
|
1207
1180
|
}
|
|
1208
1181
|
return null;
|
|
1209
|
-
},
|
|
1182
|
+
}, Po = (e, t) => {
|
|
1210
1183
|
let n = null, r = null;
|
|
1211
|
-
for (const o of e.querySelectorAll(
|
|
1184
|
+
for (const o of e.querySelectorAll(ct)) {
|
|
1212
1185
|
const i = Re(o);
|
|
1213
1186
|
i === null || i.first > t || (i.last >= t ? n = o : (r === null || i.last >= r.last) && (r = { element: o, last: i.last }));
|
|
1214
1187
|
}
|
|
1215
1188
|
return n !== null ? n : r === null ? null : r.element;
|
|
1216
|
-
},
|
|
1217
|
-
const { bottom: n } = e.getBoundingClientRect(), r =
|
|
1189
|
+
}, $o = (e, t) => {
|
|
1190
|
+
const { bottom: n } = e.getBoundingClientRect(), r = De(e), o = Re(e);
|
|
1218
1191
|
if (o === null) return r;
|
|
1219
1192
|
const i = Math.min(Math.max(t - o.first, 0) / (o.last - o.first + 1), 1);
|
|
1220
1193
|
return r + (n - r) * i;
|
|
1221
|
-
},
|
|
1194
|
+
}, De = (e) => {
|
|
1222
1195
|
const t = e.ownerDocument.createTreeWalker(e, NodeFilter.SHOW_TEXT);
|
|
1223
1196
|
for (let n = t.nextNode(); n !== null; n = t.nextNode()) {
|
|
1224
1197
|
const o = (n.textContent ?? "").search(/\S/u);
|
|
1225
1198
|
if (o < 0) continue;
|
|
1226
1199
|
const i = e.ownerDocument.createRange();
|
|
1227
1200
|
i.setStart(n, o), i.setEnd(n, o + 1);
|
|
1228
|
-
const { top:
|
|
1229
|
-
if (u > 0) return
|
|
1201
|
+
const { top: l, height: u } = i.getBoundingClientRect();
|
|
1202
|
+
if (u > 0) return l;
|
|
1230
1203
|
}
|
|
1231
1204
|
return e.getBoundingClientRect().top;
|
|
1232
|
-
},
|
|
1205
|
+
}, dt = Object.freeze({
|
|
1233
1206
|
browse: Object.freeze({ replace: !0, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1234
1207
|
"switch-source": Object.freeze({ replace: !1, preventScrollReset: !0, defaultShouldRevalidate: !1 }),
|
|
1235
1208
|
"switch-view": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 }),
|
|
1236
1209
|
"follow-link": Object.freeze({ replace: !1, preventScrollReset: !1, defaultShouldRevalidate: !1 })
|
|
1237
|
-
}),
|
|
1238
|
-
const e =
|
|
1210
|
+
}), ls = (e) => dt[e], Ie = () => {
|
|
1211
|
+
const e = Wn();
|
|
1239
1212
|
return P(
|
|
1240
1213
|
(t, n) => {
|
|
1241
|
-
e(t,
|
|
1214
|
+
e(t, dt[n]);
|
|
1242
1215
|
},
|
|
1243
1216
|
[e]
|
|
1244
1217
|
);
|
|
1245
|
-
},
|
|
1218
|
+
}, Fo = ({ navigation: e, ...t }) => /* @__PURE__ */ c(Yn, { ...t, ...dt[e] }), Mn = (e) => {
|
|
1246
1219
|
const t = e.ownerDocument;
|
|
1247
1220
|
if (e.focus({ preventScroll: !0 }), t.activeElement === e) return !0;
|
|
1248
1221
|
if (e.hasAttribute("tabindex")) return !1;
|
|
@@ -1252,43 +1225,43 @@ const lt = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1252
1225
|
t.activeElement !== e && (e.removeAttribute("tabindex"), e.removeEventListener("blur", n));
|
|
1253
1226
|
};
|
|
1254
1227
|
return e.addEventListener("blur", n), !0;
|
|
1255
|
-
},
|
|
1256
|
-
const n =
|
|
1228
|
+
}, Io = (e, t) => {
|
|
1229
|
+
const n = q(null), r = q(null), o = q(null), i = P(() => {
|
|
1257
1230
|
n.current !== null && window.clearTimeout(n.current), n.current = null, r.current = null;
|
|
1258
1231
|
}, []);
|
|
1259
1232
|
te(() => i, [i]);
|
|
1260
|
-
const
|
|
1233
|
+
const l = P(
|
|
1261
1234
|
(f) => {
|
|
1262
1235
|
if (r.current !== f) return;
|
|
1263
|
-
const
|
|
1264
|
-
if (
|
|
1265
|
-
|
|
1236
|
+
const d = o.current;
|
|
1237
|
+
if (d !== null) {
|
|
1238
|
+
d.then(() => l(f));
|
|
1266
1239
|
return;
|
|
1267
1240
|
}
|
|
1268
1241
|
e.prefetch(f);
|
|
1269
1242
|
const h = e.peek(f);
|
|
1270
1243
|
if (h?.status !== "pending") return;
|
|
1271
|
-
const
|
|
1272
|
-
o.current =
|
|
1273
|
-
o.current ===
|
|
1244
|
+
const v = Promise.allSettled([h.promise]);
|
|
1245
|
+
o.current = v, v.then(() => {
|
|
1246
|
+
o.current === v && (o.current = null);
|
|
1274
1247
|
});
|
|
1275
1248
|
},
|
|
1276
1249
|
[e]
|
|
1277
1250
|
), u = P(
|
|
1278
1251
|
(f) => {
|
|
1279
|
-
const
|
|
1280
|
-
|
|
1281
|
-
n.current = null,
|
|
1282
|
-
},
|
|
1252
|
+
const d = t(f);
|
|
1253
|
+
d !== r.current && (i(), d !== null && (r.current = d, n.current = window.setTimeout(() => {
|
|
1254
|
+
n.current = null, l(d);
|
|
1255
|
+
}, tr)));
|
|
1283
1256
|
},
|
|
1284
|
-
[i, t,
|
|
1257
|
+
[i, t, l]
|
|
1285
1258
|
), m = P(
|
|
1286
1259
|
(f) => {
|
|
1287
1260
|
t(f) !== r.current && i();
|
|
1288
1261
|
},
|
|
1289
1262
|
[i, t]
|
|
1290
1263
|
);
|
|
1291
|
-
return
|
|
1264
|
+
return H(
|
|
1292
1265
|
() => ({
|
|
1293
1266
|
onPointerOver: (f) => u(f.target),
|
|
1294
1267
|
onPointerOut: (f) => m(f.relatedTarget),
|
|
@@ -1297,8 +1270,8 @@ const lt = `[${sn}]`, po = "[data-aqmd-content]", vo = 'a[href], button, input,
|
|
|
1297
1270
|
}),
|
|
1298
1271
|
[u, m]
|
|
1299
1272
|
);
|
|
1300
|
-
},
|
|
1301
|
-
class
|
|
1273
|
+
}, qo = lt(() => import("./NativeScrollBar-TsIcS3JZ.js").then((e) => ({ default: e.NativeScrollBar })));
|
|
1274
|
+
class _o extends an {
|
|
1302
1275
|
state = { failed: !1 };
|
|
1303
1276
|
static getDerivedStateFromError() {
|
|
1304
1277
|
return { failed: !0 };
|
|
@@ -1310,7 +1283,7 @@ class No extends tn {
|
|
|
1310
1283
|
return this.state.failed ? null : this.props.children;
|
|
1311
1284
|
}
|
|
1312
1285
|
}
|
|
1313
|
-
const
|
|
1286
|
+
const Bo = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ c(_o, { children: /* @__PURE__ */ c(ke, { fallback: null, children: /* @__PURE__ */ c(qo, { scroller: e, withCircle: t }) }) }), Ln = (e) => /* @__PURE__ */ c(Bo, { scroller: e, withCircle: !0 }), An = () => {
|
|
1314
1287
|
const e = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
1315
1288
|
let n = !1;
|
|
1316
1289
|
const r = (o) => {
|
|
@@ -1325,9 +1298,9 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children:
|
|
|
1325
1298
|
return () => {
|
|
1326
1299
|
if (i) return;
|
|
1327
1300
|
i = !0;
|
|
1328
|
-
const
|
|
1329
|
-
if (
|
|
1330
|
-
e.set(o,
|
|
1301
|
+
const l = e.get(o);
|
|
1302
|
+
if (l !== void 0 && l > 1) {
|
|
1303
|
+
e.set(o, l - 1);
|
|
1331
1304
|
return;
|
|
1332
1305
|
}
|
|
1333
1306
|
e.delete(o), r(o);
|
|
@@ -1337,52 +1310,52 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children:
|
|
|
1337
1310
|
resumes: (o) => t.delete(o),
|
|
1338
1311
|
heldKeys: () => [...e.keys()]
|
|
1339
1312
|
};
|
|
1340
|
-
},
|
|
1313
|
+
}, Pe = (e, t) => {
|
|
1341
1314
|
if (Object.is(e, t)) return !0;
|
|
1342
1315
|
if (typeof e != "object" || typeof t != "object" || e === null || t === null) return !1;
|
|
1343
1316
|
if (Array.isArray(e) || Array.isArray(t))
|
|
1344
|
-
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i,
|
|
1317
|
+
return !(Array.isArray(e) && Array.isArray(t)) || e.length !== t.length ? !1 : e.every((i, l) => Pe(i, t[l]));
|
|
1345
1318
|
const n = e, r = t, o = Object.keys(n);
|
|
1346
|
-
return o.length !== Object.keys(r).length ? !1 : o.every((i) => Object.hasOwn(r, i) &&
|
|
1347
|
-
},
|
|
1319
|
+
return o.length !== Object.keys(r).length ? !1 : o.every((i) => Object.hasOwn(r, i) && Pe(n[i], r[i]));
|
|
1320
|
+
}, jo = 55e3, Ft = Object.freeze({ status: "deferred" }), It = Object.freeze({ status: "refreshed" }), We = Object.freeze({ status: "superseded" }), ue = (e) => e === void 0 || e.status === "deferred" ? null : e.status === "loaded" ? e : e.previous, Nn = (e) => e !== void 0 && e.status === "loaded" && e.document.kind !== "failure", zo = ({ client: e, capacity: t }) => {
|
|
1348
1321
|
if (!Number.isInteger(t) || t < 1) throw new RangeError(`[markdown-explorer] the document cache capacity must be a positive integer; got ${String(t)}`);
|
|
1349
|
-
const n = /* @__PURE__ */ new Map(), r =
|
|
1350
|
-
let
|
|
1351
|
-
const u = o.emit, m = () => (
|
|
1322
|
+
const n = /* @__PURE__ */ new Map(), r = An(), o = Oe(), i = /* @__PURE__ */ new WeakSet();
|
|
1323
|
+
let l = 0;
|
|
1324
|
+
const u = o.emit, m = () => (l += 1, l), f = () => {
|
|
1352
1325
|
if (!(n.size <= t))
|
|
1353
1326
|
for (const b of [...n.keys()]) {
|
|
1354
1327
|
if (n.size <= t) return;
|
|
1355
1328
|
r.isHeld(b) || n.delete(b);
|
|
1356
1329
|
}
|
|
1357
|
-
},
|
|
1358
|
-
n.delete(b), n.set(b,
|
|
1359
|
-
}, h = (b) => performance.now() - b.validatedAt >=
|
|
1360
|
-
const s = n.get(b),
|
|
1361
|
-
return
|
|
1362
|
-
n.get(b) ===
|
|
1363
|
-
}),
|
|
1364
|
-
}, E = (b,
|
|
1365
|
-
|
|
1366
|
-
}, k = async (b,
|
|
1367
|
-
const
|
|
1368
|
-
if (
|
|
1330
|
+
}, d = (b, g) => {
|
|
1331
|
+
n.delete(b), n.set(b, g);
|
|
1332
|
+
}, h = (b) => performance.now() - b.validatedAt >= jo, v = (b, g, a) => {
|
|
1333
|
+
const s = n.get(b), w = ue(s?.snapshot), O = a || s?.refreshPending === !0, L = Te(e.document(b, { refresh: O }).then((I) => ({ status: "loaded", document: I }))), A = { snapshot: { status: "pending", promise: L, previous: w }, validatedAt: performance.now(), opened: g, background: null, refreshPending: !1, seeded: void 0, stamp: m() };
|
|
1334
|
+
return d(b, A), f(), L.then((I) => {
|
|
1335
|
+
n.get(b) === A && (A.snapshot = I, A.stamp = m(), u());
|
|
1336
|
+
}), A;
|
|
1337
|
+
}, E = (b, g, a, s, w, O) => {
|
|
1338
|
+
g.background === a && (g.background = null, !(n.get(b) !== g || g.snapshot !== s) && (w.kind === "failure" && s.document.kind !== "failure" || (g.validatedAt = O, g.stamp = m(), Pe(s.document, w) || (g.snapshot = { status: "loaded", document: w }), u())));
|
|
1339
|
+
}, k = async (b, g) => {
|
|
1340
|
+
const a = g.snapshot;
|
|
1341
|
+
if (a.status !== "loaded") return null;
|
|
1369
1342
|
const s = {};
|
|
1370
|
-
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1373
|
-
const
|
|
1374
|
-
return E(b,
|
|
1375
|
-
}, R = (b,
|
|
1376
|
-
const { snapshot:
|
|
1377
|
-
return
|
|
1343
|
+
g.background = s;
|
|
1344
|
+
const w = performance.now(), O = e.document(b, { refresh: g.refreshPending });
|
|
1345
|
+
g.refreshPending = !1;
|
|
1346
|
+
const L = await O, A = g.background === s && n.get(b) === g && g.snapshot === a;
|
|
1347
|
+
return E(b, g, s, a, L, w), A ? L : null;
|
|
1348
|
+
}, R = (b, g) => {
|
|
1349
|
+
const { snapshot: a } = g;
|
|
1350
|
+
return a.status === "pending" ? !1 : a.status === "loaded" && a.document.kind !== "failure" ? (k(b, g), !1) : (a.status === "loaded" && i.add(a), v(b, !0, !1), !0);
|
|
1378
1351
|
}, T = (b) => {
|
|
1379
|
-
const
|
|
1380
|
-
let
|
|
1352
|
+
const g = r.hold(b);
|
|
1353
|
+
let a = !1;
|
|
1381
1354
|
return () => {
|
|
1382
|
-
if (
|
|
1383
|
-
|
|
1355
|
+
if (a) return;
|
|
1356
|
+
a = !0, g();
|
|
1384
1357
|
const s = n.get(b);
|
|
1385
|
-
s !== void 0 &&
|
|
1358
|
+
s !== void 0 && d(b, s), f();
|
|
1386
1359
|
};
|
|
1387
1360
|
};
|
|
1388
1361
|
return {
|
|
@@ -1390,85 +1363,85 @@ const Do = ({ scroller: e, withCircle: t }) => /* @__PURE__ */ d(No, { children:
|
|
|
1390
1363
|
peekSeeded: (b) => n.get(b)?.seeded,
|
|
1391
1364
|
answerStampOf: (b) => n.get(b)?.stamp,
|
|
1392
1365
|
prefetch: (b) => {
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1366
|
+
const g = n.get(b);
|
|
1367
|
+
g !== void 0 && g.snapshot.status !== "deferred" || (v(b, !1, !1), u());
|
|
1395
1368
|
},
|
|
1396
1369
|
open: (b) => {
|
|
1397
|
-
const
|
|
1370
|
+
const g = r.resumes(b), a = T(b), s = n.get(b);
|
|
1398
1371
|
if (s === void 0 || s.snapshot.status === "deferred")
|
|
1399
|
-
return
|
|
1400
|
-
if (
|
|
1401
|
-
const { snapshot:
|
|
1402
|
-
return
|
|
1372
|
+
return v(b, !0, !1), u(), a;
|
|
1373
|
+
if (d(b, s), g) return a;
|
|
1374
|
+
const { snapshot: w } = s;
|
|
1375
|
+
return w.status === "pending" ? (s.opened = !0, a) : w.document.kind === "failure" ? (s.opened || h(s) ? (i.add(w), v(b, !0, !1), u()) : s.opened = !0, a) : (s.opened = !0, s.background === null && h(s) && k(b, s), a);
|
|
1403
1376
|
},
|
|
1404
1377
|
retain: T,
|
|
1405
1378
|
retry: (b) => {
|
|
1406
|
-
const
|
|
1407
|
-
|
|
1379
|
+
const g = n.get(b);
|
|
1380
|
+
g === void 0 || g.snapshot.status !== "loaded" || g.snapshot.document.kind !== "failure" || (v(b, !0, !1), u());
|
|
1408
1381
|
},
|
|
1409
|
-
seed: (b,
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1412
|
-
(
|
|
1413
|
-
() =>
|
|
1382
|
+
seed: (b, g) => {
|
|
1383
|
+
const a = performance.now(), s = Te(
|
|
1384
|
+
g.then(
|
|
1385
|
+
(I) => I === null ? Ft : { status: "loaded", document: I },
|
|
1386
|
+
() => Ft
|
|
1414
1387
|
)
|
|
1415
|
-
),
|
|
1416
|
-
if (
|
|
1417
|
-
const
|
|
1418
|
-
|
|
1388
|
+
), w = n.get(b);
|
|
1389
|
+
if (w !== void 0 && w.snapshot.status === "loaded") {
|
|
1390
|
+
const I = w.snapshot, K = {};
|
|
1391
|
+
w.background = K, s.then((G) => {
|
|
1419
1392
|
if (G.status === "loaded") {
|
|
1420
|
-
E(b,
|
|
1393
|
+
E(b, w, K, I, G.document, a);
|
|
1421
1394
|
return;
|
|
1422
1395
|
}
|
|
1423
|
-
|
|
1396
|
+
w.background === K && (w.background = null);
|
|
1424
1397
|
});
|
|
1425
1398
|
return;
|
|
1426
1399
|
}
|
|
1427
|
-
const O =
|
|
1428
|
-
|
|
1429
|
-
n.get(b) ===
|
|
1400
|
+
const O = w !== void 0 && w.snapshot.status === "pending" ? w.snapshot.previous : null, L = { status: "pending", promise: s, previous: O }, A = { snapshot: L, validatedAt: a, opened: w?.opened === !0, background: null, refreshPending: w?.refreshPending === !0, seeded: L, stamp: m() };
|
|
1401
|
+
d(b, A), f(), s.then((I) => {
|
|
1402
|
+
n.get(b) === A && (I.status === "deferred" && r.isHeld(b) ? v(b, A.opened, !1) : (A.snapshot = I, A.stamp = m()), u());
|
|
1430
1403
|
});
|
|
1431
1404
|
},
|
|
1432
1405
|
invalidate: () => {
|
|
1433
1406
|
let b = !1;
|
|
1434
|
-
for (const [
|
|
1435
|
-
if (
|
|
1436
|
-
const { snapshot: s } =
|
|
1407
|
+
for (const [g, a] of [...n]) {
|
|
1408
|
+
if (a.validatedAt = Number.NEGATIVE_INFINITY, a.opened = !0, a.refreshPending = !0, !r.isHeld(g)) continue;
|
|
1409
|
+
const { snapshot: s } = a;
|
|
1437
1410
|
if (s.status !== "pending") {
|
|
1438
|
-
R(
|
|
1411
|
+
R(g, a) && (b = !0);
|
|
1439
1412
|
continue;
|
|
1440
1413
|
}
|
|
1441
1414
|
s.promise.then(() => {
|
|
1442
|
-
n.get(
|
|
1415
|
+
n.get(g) === a && a.refreshPending && r.isHeld(g) && R(g, a) && u();
|
|
1443
1416
|
});
|
|
1444
1417
|
}
|
|
1445
1418
|
b && u();
|
|
1446
1419
|
},
|
|
1447
1420
|
refresh: async (b) => {
|
|
1448
|
-
const
|
|
1449
|
-
if (
|
|
1450
|
-
|
|
1451
|
-
const s = await k(b,
|
|
1452
|
-
return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } :
|
|
1421
|
+
const g = n.get(b);
|
|
1422
|
+
if (g !== void 0 && Nn(g.snapshot)) {
|
|
1423
|
+
g.refreshPending = !0;
|
|
1424
|
+
const s = await k(b, g);
|
|
1425
|
+
return s === null ? We : s.kind === "failure" ? { status: "failed", failure: s.failure } : It;
|
|
1453
1426
|
}
|
|
1454
|
-
const
|
|
1455
|
-
return u(),
|
|
1427
|
+
const a = v(b, !0, !0);
|
|
1428
|
+
return u(), a.snapshot.status !== "pending" ? We : (await a.snapshot.promise, n.get(b) === a ? It : We);
|
|
1456
1429
|
},
|
|
1457
1430
|
clear: () => {
|
|
1458
1431
|
n.clear();
|
|
1459
|
-
for (const b of r.heldKeys())
|
|
1432
|
+
for (const b of r.heldKeys()) v(b, !0, !1);
|
|
1460
1433
|
u();
|
|
1461
1434
|
},
|
|
1462
1435
|
subscribe: o.subscribe,
|
|
1463
1436
|
noteFailureShown: (b) => i.has(b) ? !1 : (i.add(b), !0)
|
|
1464
1437
|
};
|
|
1465
1438
|
};
|
|
1466
|
-
function
|
|
1439
|
+
function Vo({
|
|
1467
1440
|
title: e,
|
|
1468
1441
|
titleId: t,
|
|
1469
1442
|
...n
|
|
1470
1443
|
}, r) {
|
|
1471
|
-
return /* @__PURE__ */
|
|
1444
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1472
1445
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1473
1446
|
viewBox: "0 0 20 20",
|
|
1474
1447
|
fill: "currentColor",
|
|
@@ -1476,25 +1449,25 @@ function $o({
|
|
|
1476
1449
|
"data-slot": "icon",
|
|
1477
1450
|
ref: r,
|
|
1478
1451
|
"aria-labelledby": t
|
|
1479
|
-
}, n), e ? /* @__PURE__ */
|
|
1452
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1480
1453
|
id: t
|
|
1481
|
-
}, e) : null, /* @__PURE__ */
|
|
1454
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1482
1455
|
fillRule: "evenodd",
|
|
1483
1456
|
d: "M18 5.25a2.25 2.25 0 0 0-2.012-2.238A2.25 2.25 0 0 0 13.75 1h-1.5a2.25 2.25 0 0 0-2.238 2.012c-.875.092-1.6.686-1.884 1.488H11A2.5 2.5 0 0 1 13.5 7v7h2.25A2.25 2.25 0 0 0 18 11.75v-6.5ZM12.25 2.5a.75.75 0 0 0-.75.75v.25h3v-.25a.75.75 0 0 0-.75-.75h-1.5Z",
|
|
1484
1457
|
clipRule: "evenodd"
|
|
1485
|
-
}), /* @__PURE__ */
|
|
1458
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1486
1459
|
fillRule: "evenodd",
|
|
1487
1460
|
d: "M3 6a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1H3Zm6.874 4.166a.75.75 0 1 0-1.248-.832l-2.493 3.739-.853-.853a.75.75 0 0 0-1.06 1.06l1.5 1.5a.75.75 0 0 0 1.154-.114l3-4.5Z",
|
|
1488
1461
|
clipRule: "evenodd"
|
|
1489
1462
|
}));
|
|
1490
1463
|
}
|
|
1491
|
-
const
|
|
1492
|
-
function
|
|
1464
|
+
const Ho = /* @__PURE__ */ S.forwardRef(Vo);
|
|
1465
|
+
function Uo({
|
|
1493
1466
|
title: e,
|
|
1494
1467
|
titleId: t,
|
|
1495
1468
|
...n
|
|
1496
1469
|
}, r) {
|
|
1497
|
-
return /* @__PURE__ */
|
|
1470
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1498
1471
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1499
1472
|
viewBox: "0 0 20 20",
|
|
1500
1473
|
fill: "currentColor",
|
|
@@ -1502,23 +1475,23 @@ function _o({
|
|
|
1502
1475
|
"data-slot": "icon",
|
|
1503
1476
|
ref: r,
|
|
1504
1477
|
"aria-labelledby": t
|
|
1505
|
-
}, n), e ? /* @__PURE__ */
|
|
1478
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1506
1479
|
id: t
|
|
1507
|
-
}, e) : null, /* @__PURE__ */
|
|
1480
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1508
1481
|
fillRule: "evenodd",
|
|
1509
1482
|
d: "M15.988 3.012A2.25 2.25 0 0 1 18 5.25v6.5A2.25 2.25 0 0 1 15.75 14H13.5v-3.379a3 3 0 0 0-.879-2.121l-3.12-3.121a3 3 0 0 0-1.402-.791 2.252 2.252 0 0 1 1.913-1.576A2.25 2.25 0 0 1 12.25 1h1.5a2.25 2.25 0 0 1 2.238 2.012ZM11.5 3.25a.75.75 0 0 1 .75-.75h1.5a.75.75 0 0 1 .75.75v.25h-3v-.25Z",
|
|
1510
1483
|
clipRule: "evenodd"
|
|
1511
|
-
}), /* @__PURE__ */
|
|
1484
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1512
1485
|
d: "M3.5 6A1.5 1.5 0 0 0 2 7.5v9A1.5 1.5 0 0 0 3.5 18h7a1.5 1.5 0 0 0 1.5-1.5v-5.879a1.5 1.5 0 0 0-.44-1.06L8.44 6.439A1.5 1.5 0 0 0 7.378 6H3.5Z"
|
|
1513
1486
|
}));
|
|
1514
1487
|
}
|
|
1515
|
-
const
|
|
1516
|
-
function
|
|
1488
|
+
const Zo = /* @__PURE__ */ S.forwardRef(Uo);
|
|
1489
|
+
function Go({
|
|
1517
1490
|
title: e,
|
|
1518
1491
|
titleId: t,
|
|
1519
1492
|
...n
|
|
1520
1493
|
}, r) {
|
|
1521
|
-
return /* @__PURE__ */
|
|
1494
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1522
1495
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1523
1496
|
viewBox: "0 0 20 20",
|
|
1524
1497
|
fill: "currentColor",
|
|
@@ -1526,42 +1499,42 @@ function Bo({
|
|
|
1526
1499
|
"data-slot": "icon",
|
|
1527
1500
|
ref: r,
|
|
1528
1501
|
"aria-labelledby": t
|
|
1529
|
-
}, n), e ? /* @__PURE__ */
|
|
1502
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1530
1503
|
id: t
|
|
1531
|
-
}, e) : null, /* @__PURE__ */
|
|
1504
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1532
1505
|
fillRule: "evenodd",
|
|
1533
1506
|
d: "M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",
|
|
1534
1507
|
clipRule: "evenodd"
|
|
1535
1508
|
}));
|
|
1536
1509
|
}
|
|
1537
|
-
const
|
|
1510
|
+
const Ko = /* @__PURE__ */ S.forwardRef(Go), Wo = 2e3, qt = Object.freeze({ outcome: "idle" }), Yo = (e) => {
|
|
1538
1511
|
const t = navigator.clipboard;
|
|
1539
1512
|
return t === void 0 ? Promise.reject(new Error("[markdown-explorer] this browser has no asynchronous clipboard")) : t.writeText(e);
|
|
1540
|
-
},
|
|
1541
|
-
const { announcer: t, labels: n } = D(), [r, o] =
|
|
1513
|
+
}, Xo = ({ text: e }) => {
|
|
1514
|
+
const { announcer: t, labels: n } = D(), [r, o] = B(qt);
|
|
1542
1515
|
te(() => {
|
|
1543
1516
|
if (r.outcome === "idle") return;
|
|
1544
|
-
const m = setTimeout(() => o(
|
|
1517
|
+
const m = setTimeout(() => o(qt), Wo);
|
|
1545
1518
|
return () => clearTimeout(m);
|
|
1546
1519
|
}, [r]);
|
|
1547
1520
|
const i = (m) => {
|
|
1548
1521
|
o({ outcome: m }), t.announce(m === "copied" ? n.copiedText : n.copyTextFailed);
|
|
1549
|
-
},
|
|
1550
|
-
|
|
1522
|
+
}, l = () => {
|
|
1523
|
+
Yo(e).then(
|
|
1551
1524
|
() => i("copied"),
|
|
1552
1525
|
() => i("failed")
|
|
1553
1526
|
);
|
|
1554
1527
|
}, u = r.outcome === "copied" ? n.copiedText : r.outcome === "failed" ? n.copyTextFailed : n.copyText;
|
|
1555
1528
|
return (
|
|
1556
|
-
/* @__PURE__ */
|
|
1529
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": n.copyText, title: u, onClick: l, "data-aqmx-copy-outcome": r.outcome, "data-testid": "markdown-explorer-file-copy", children: r.outcome === "copied" ? /* @__PURE__ */ c(Ho, {}) : r.outcome === "failed" ? /* @__PURE__ */ c(Ko, {}) : /* @__PURE__ */ c(Zo, {}) })
|
|
1557
1530
|
);
|
|
1558
|
-
}, he = pe("fill"),
|
|
1559
|
-
function
|
|
1531
|
+
}, he = pe("fill"), Jo = Object.freeze({ blockSize: "100%" }), ve = ({ scrollerProps: e, children: t }) => ne(he) === "content" ? /* @__PURE__ */ c(Ot, { scrollerProps: e, children: t }) : /* @__PURE__ */ c(Ot, { scrollerProps: { ...e, style: Jo }, rowClassName: "aqmx-document-scroll-row", renderScrollBar: Ln, children: t });
|
|
1532
|
+
function Qo({
|
|
1560
1533
|
title: e,
|
|
1561
1534
|
titleId: t,
|
|
1562
1535
|
...n
|
|
1563
1536
|
}, r) {
|
|
1564
|
-
return /* @__PURE__ */
|
|
1537
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1565
1538
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1566
1539
|
viewBox: "0 0 20 20",
|
|
1567
1540
|
fill: "currentColor",
|
|
@@ -1569,21 +1542,21 @@ function Uo({
|
|
|
1569
1542
|
"data-slot": "icon",
|
|
1570
1543
|
ref: r,
|
|
1571
1544
|
"aria-labelledby": t
|
|
1572
|
-
}, n), e ? /* @__PURE__ */
|
|
1545
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1573
1546
|
id: t
|
|
1574
|
-
}, e) : null, /* @__PURE__ */
|
|
1547
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1575
1548
|
d: "M10.75 2.75a.75.75 0 0 0-1.5 0v8.614L6.295 8.235a.75.75 0 1 0-1.09 1.03l4.25 4.5a.75.75 0 0 0 1.09 0l4.25-4.5a.75.75 0 0 0-1.09-1.03l-2.955 3.129V2.75Z"
|
|
1576
|
-
}), /* @__PURE__ */
|
|
1549
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1577
1550
|
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"
|
|
1578
1551
|
}));
|
|
1579
1552
|
}
|
|
1580
|
-
const
|
|
1581
|
-
function
|
|
1553
|
+
const ei = /* @__PURE__ */ S.forwardRef(Qo);
|
|
1554
|
+
function ti({
|
|
1582
1555
|
title: e,
|
|
1583
1556
|
titleId: t,
|
|
1584
1557
|
...n
|
|
1585
1558
|
}, r) {
|
|
1586
|
-
return /* @__PURE__ */
|
|
1559
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1587
1560
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1588
1561
|
viewBox: "0 0 20 20",
|
|
1589
1562
|
fill: "currentColor",
|
|
@@ -1591,34 +1564,34 @@ function Wo({
|
|
|
1591
1564
|
"data-slot": "icon",
|
|
1592
1565
|
ref: r,
|
|
1593
1566
|
"aria-labelledby": t
|
|
1594
|
-
}, n), e ? /* @__PURE__ */
|
|
1567
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1595
1568
|
id: t
|
|
1596
|
-
}, e) : null, /* @__PURE__ */
|
|
1569
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1597
1570
|
fillRule: "evenodd",
|
|
1598
1571
|
d: "M4.25 5.5a.75.75 0 0 0-.75.75v8.5c0 .414.336.75.75.75h8.5a.75.75 0 0 0 .75-.75v-4a.75.75 0 0 1 1.5 0v4A2.25 2.25 0 0 1 12.75 17h-8.5A2.25 2.25 0 0 1 2 14.75v-8.5A2.25 2.25 0 0 1 4.25 4h5a.75.75 0 0 1 0 1.5h-5Z",
|
|
1599
1572
|
clipRule: "evenodd"
|
|
1600
|
-
}), /* @__PURE__ */
|
|
1573
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1601
1574
|
fillRule: "evenodd",
|
|
1602
1575
|
d: "M6.194 12.753a.75.75 0 0 0 1.06.053L16.5 4.44v2.81a.75.75 0 0 0 1.5 0v-4.5a.75.75 0 0 0-.75-.75h-4.5a.75.75 0 0 0 0 1.5h2.553l-9.056 8.194a.75.75 0 0 0-.053 1.06Z",
|
|
1603
1576
|
clipRule: "evenodd"
|
|
1604
1577
|
}));
|
|
1605
1578
|
}
|
|
1606
|
-
const
|
|
1579
|
+
const ni = /* @__PURE__ */ S.forwardRef(ti), qe = ({ name: e, openUrl: t, downloadUrl: n, icon: r, children: o }) => {
|
|
1607
1580
|
const { labels: i } = D();
|
|
1608
|
-
return /* @__PURE__ */
|
|
1609
|
-
/* @__PURE__ */
|
|
1610
|
-
/* @__PURE__ */
|
|
1581
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-document-toolbar", children: [
|
|
1582
|
+
/* @__PURE__ */ c("span", { className: "aqmx-document-file-icon", "aria-hidden": "true", children: r }),
|
|
1583
|
+
/* @__PURE__ */ c("span", { className: "aqmx-document-title", title: e, "data-testid": "markdown-explorer-file-name", children: e }),
|
|
1611
1584
|
o,
|
|
1612
|
-
/* @__PURE__ */
|
|
1613
|
-
/* @__PURE__ */
|
|
1585
|
+
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: t, target: "_blank", rel: "noopener noreferrer", "aria-label": i.openInNewTab, title: i.openInNewTab, "data-testid": "markdown-explorer-file-open", children: /* @__PURE__ */ c(ni, {}) }),
|
|
1586
|
+
/* @__PURE__ */ c("a", { className: "aqmx-icon-button", href: n, download: e, "aria-label": i.download, title: i.download, "data-testid": "markdown-explorer-file-download", children: /* @__PURE__ */ c(ei, {}) })
|
|
1614
1587
|
] });
|
|
1615
1588
|
};
|
|
1616
|
-
function
|
|
1589
|
+
function ri({
|
|
1617
1590
|
title: e,
|
|
1618
1591
|
titleId: t,
|
|
1619
1592
|
...n
|
|
1620
1593
|
}, r) {
|
|
1621
|
-
return /* @__PURE__ */
|
|
1594
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1622
1595
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1623
1596
|
viewBox: "0 0 20 20",
|
|
1624
1597
|
fill: "currentColor",
|
|
@@ -1626,53 +1599,53 @@ function Xo({
|
|
|
1626
1599
|
"data-slot": "icon",
|
|
1627
1600
|
ref: r,
|
|
1628
1601
|
"aria-labelledby": t
|
|
1629
|
-
}, n), e ? /* @__PURE__ */
|
|
1602
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1630
1603
|
id: t
|
|
1631
|
-
}, e) : null, /* @__PURE__ */
|
|
1604
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1632
1605
|
fillRule: "evenodd",
|
|
1633
1606
|
d: "M4.5 2A1.5 1.5 0 0 0 3 3.5v13A1.5 1.5 0 0 0 4.5 18h11a1.5 1.5 0 0 0 1.5-1.5V7.621a1.5 1.5 0 0 0-.44-1.06l-4.12-4.122A1.5 1.5 0 0 0 11.378 2H4.5Zm4.75 6.75a.75.75 0 0 1 1.5 0v2.546l.943-1.048a.75.75 0 0 1 1.114 1.004l-2.25 2.5a.75.75 0 0 1-1.114 0l-2.25-2.5a.75.75 0 1 1 1.114-1.004l.943 1.048V8.75Z",
|
|
1634
1607
|
clipRule: "evenodd"
|
|
1635
1608
|
}));
|
|
1636
1609
|
}
|
|
1637
|
-
const
|
|
1610
|
+
const oi = /* @__PURE__ */ S.forwardRef(ri), ii = Object.freeze({ className: "aqmx-document-stage" }), li = ({ document: e }) => {
|
|
1638
1611
|
const { labels: t } = D();
|
|
1639
|
-
return /* @__PURE__ */
|
|
1640
|
-
/* @__PURE__ */
|
|
1641
|
-
/* @__PURE__ */
|
|
1642
|
-
/* @__PURE__ */
|
|
1643
|
-
/* @__PURE__ */
|
|
1612
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-file-view", children: [
|
|
1613
|
+
/* @__PURE__ */ c(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(oi, {}) }),
|
|
1614
|
+
/* @__PURE__ */ c(ve, { scrollerProps: ii, children: /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-file-not-shown", children: [
|
|
1615
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.fileNotShown }),
|
|
1616
|
+
/* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-file-not-shown-download", children: t.download })
|
|
1644
1617
|
] }) })
|
|
1645
1618
|
] });
|
|
1646
|
-
}, _e = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]",
|
|
1619
|
+
}, _e = "[data-aqmd-scroll-container], [data-aqmx-document-scroller]", ai = (e) => {
|
|
1647
1620
|
const t = e.indexOf("#");
|
|
1648
1621
|
return t === -1 ? "" : e.slice(t);
|
|
1649
|
-
},
|
|
1622
|
+
}, si = /(%[0-9A-Fa-f]{2})/u, ut = (e) => {
|
|
1650
1623
|
if (!e.startsWith("#") || e.length === 1) return null;
|
|
1651
|
-
const t = new TextEncoder(), n = e.slice(1).split(
|
|
1624
|
+
const t = new TextEncoder(), n = e.slice(1).split(si).flatMap((r, o) => o % 2 === 1 ? [Number.parseInt(r.slice(1), 16)] : [...t.encode(r)]);
|
|
1652
1625
|
return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(Uint8Array.from(n));
|
|
1653
|
-
},
|
|
1626
|
+
}, Dn = (e) => `#${encodeURIComponent(e)}`, ci = (e) => {
|
|
1654
1627
|
if (e === "#") return !0;
|
|
1655
|
-
const t =
|
|
1628
|
+
const t = ut(e);
|
|
1656
1629
|
return t !== null && t.replace(/[A-Z]/gu, (n) => n.toLowerCase()) === "top";
|
|
1657
|
-
},
|
|
1630
|
+
}, Pn = (e, t) => {
|
|
1658
1631
|
if (t === "") return null;
|
|
1659
1632
|
for (const n of e.querySelectorAll("[id]"))
|
|
1660
1633
|
if (n.id === t) return n;
|
|
1661
1634
|
return null;
|
|
1662
|
-
},
|
|
1635
|
+
}, di = "http://www.w3.org/1999/xhtml", _t = (e, t) => {
|
|
1663
1636
|
if (t === "") return null;
|
|
1664
|
-
const n =
|
|
1637
|
+
const n = Pn(e, t);
|
|
1665
1638
|
if (n !== null) return n;
|
|
1666
1639
|
for (const r of e.querySelectorAll("a[name]"))
|
|
1667
|
-
if (r.localName === "a" && r.namespaceURI ===
|
|
1640
|
+
if (r.localName === "a" && r.namespaceURI === di && r.getAttribute("name") === t) return r;
|
|
1668
1641
|
return null;
|
|
1669
|
-
},
|
|
1642
|
+
}, $n = (e, t) => {
|
|
1670
1643
|
if (e === null || !t.startsWith("#")) return null;
|
|
1671
|
-
const n =
|
|
1644
|
+
const n = _t(e, t.slice(1));
|
|
1672
1645
|
if (n !== null) return n;
|
|
1673
|
-
const r =
|
|
1674
|
-
return r === null ? null :
|
|
1675
|
-
},
|
|
1646
|
+
const r = ut(t);
|
|
1647
|
+
return r === null ? null : _t(e, r);
|
|
1648
|
+
}, Bt = (e) => {
|
|
1676
1649
|
const { body: t, documentElement: n } = e.ownerDocument;
|
|
1677
1650
|
if (e === t) {
|
|
1678
1651
|
const o = getComputedStyle(n);
|
|
@@ -1680,22 +1653,22 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1680
1653
|
}
|
|
1681
1654
|
const { overflowY: r } = getComputedStyle(e);
|
|
1682
1655
|
return r === "auto" || r === "scroll";
|
|
1683
|
-
},
|
|
1656
|
+
}, ui = (e) => {
|
|
1684
1657
|
const { body: t, documentElement: n } = e, r = getComputedStyle(n), o = r.overflowX === "visible" && r.overflowY === "visible" && t !== null ? getComputedStyle(t).overflowY : r.overflowY;
|
|
1685
1658
|
return o !== "hidden" && o !== "clip";
|
|
1686
|
-
},
|
|
1659
|
+
}, fi = (e, t) => {
|
|
1687
1660
|
const n = t.closest(_e), r = n !== null && e.contains(n) ? n : e;
|
|
1688
|
-
if (r.scrollHeight > r.clientHeight &&
|
|
1689
|
-
const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement:
|
|
1661
|
+
if (r.scrollHeight > r.clientHeight && Bt(r)) return r;
|
|
1662
|
+
const o = e.getBoundingClientRect().height, { documentElement: i, scrollingElement: l } = e.ownerDocument;
|
|
1690
1663
|
for (let u = e.parentElement; u !== null && u !== i; u = u.parentElement)
|
|
1691
|
-
if (
|
|
1692
|
-
return
|
|
1693
|
-
},
|
|
1694
|
-
scrollerOf:
|
|
1664
|
+
if (Bt(u) && u.scrollHeight > u.clientHeight && u.clientHeight < o) return u;
|
|
1665
|
+
return l instanceof Element && ui(e.ownerDocument) && l.scrollHeight > l.clientHeight && l.clientHeight < o ? l : r;
|
|
1666
|
+
}, mi = Object.freeze({
|
|
1667
|
+
scrollerOf: fi,
|
|
1695
1668
|
reveal: (e) => {
|
|
1696
|
-
e.scrollIntoView(
|
|
1669
|
+
e.scrollIntoView(nt);
|
|
1697
1670
|
}
|
|
1698
|
-
}),
|
|
1671
|
+
}), nt = Object.freeze({ block: "nearest", inline: "nearest", behavior: "instant" }), hi = (e, t) => {
|
|
1699
1672
|
for (let n = t; n !== null && n !== e; n = n.parentElement) {
|
|
1700
1673
|
const r = n.parentElement;
|
|
1701
1674
|
if (r instanceof HTMLDetailsElement && n !== r.querySelector(":scope > summary") && (r.open = !0), n.getAttribute("hidden")?.toLowerCase() === "until-found") {
|
|
@@ -1703,28 +1676,28 @@ const Yo = /* @__PURE__ */ y.forwardRef(Xo), Jo = Object.freeze({ className: "aq
|
|
|
1703
1676
|
n.removeAttribute("hidden");
|
|
1704
1677
|
}
|
|
1705
1678
|
}
|
|
1706
|
-
},
|
|
1679
|
+
}, pi = (e, t) => {
|
|
1707
1680
|
if (t.getClientRects().length === 0) return;
|
|
1708
|
-
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r),
|
|
1709
|
-
if (!u && Math.abs(
|
|
1710
|
-
t.scrollIntoView(
|
|
1681
|
+
const n = e === e.ownerDocument.scrollingElement ? 0 : e.getBoundingClientRect().top + e.clientTop, { scrollMarginTop: r, scrollMarginBottom: o } = getComputedStyle(t), i = Number.parseFloat(r), l = t.getBoundingClientRect(), u = l.height + i + Number.parseFloat(o) > e.clientHeight;
|
|
1682
|
+
if (!u && Math.abs(l.top - i - n) < 1) {
|
|
1683
|
+
t.scrollIntoView(nt);
|
|
1711
1684
|
return;
|
|
1712
1685
|
}
|
|
1713
|
-
e.scrollBy({ top: u ?
|
|
1714
|
-
},
|
|
1686
|
+
e.scrollBy({ top: u ? l.top - n - e.clientHeight : l.bottom - n + e.clientHeight, behavior: "instant" }), t.scrollIntoView(nt);
|
|
1687
|
+
}, vi = (e, t) => {
|
|
1715
1688
|
const n = t.scrollerOf(e, e.querySelector(_e) ?? e);
|
|
1716
1689
|
n.getClientRects().length !== 0 && (n.scrollTo({ top: 0, left: 0, behavior: "instant" }), t.reveal(n));
|
|
1717
|
-
},
|
|
1690
|
+
}, jt = (e, t, n) => {
|
|
1718
1691
|
if (e === null) return null;
|
|
1719
|
-
const r =
|
|
1720
|
-
return r === null ? (
|
|
1692
|
+
const r = $n(e, t);
|
|
1693
|
+
return r === null ? (ci(t) && vi(e, n), null) : (hi(e, r), pi(n.scrollerOf(e, r), r), n.reveal(r), r);
|
|
1721
1694
|
};
|
|
1722
|
-
function
|
|
1695
|
+
function gi({
|
|
1723
1696
|
title: e,
|
|
1724
1697
|
titleId: t,
|
|
1725
1698
|
...n
|
|
1726
1699
|
}, r) {
|
|
1727
|
-
return /* @__PURE__ */
|
|
1700
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1728
1701
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1729
1702
|
viewBox: "0 0 20 20",
|
|
1730
1703
|
fill: "currentColor",
|
|
@@ -1732,19 +1705,19 @@ function ci({
|
|
|
1732
1705
|
"data-slot": "icon",
|
|
1733
1706
|
ref: r,
|
|
1734
1707
|
"aria-labelledby": t
|
|
1735
|
-
}, n), e ? /* @__PURE__ */
|
|
1708
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1736
1709
|
id: t
|
|
1737
|
-
}, e) : null, /* @__PURE__ */
|
|
1710
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1738
1711
|
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"
|
|
1739
1712
|
}));
|
|
1740
1713
|
}
|
|
1741
|
-
const
|
|
1742
|
-
function
|
|
1714
|
+
const wi = /* @__PURE__ */ S.forwardRef(gi);
|
|
1715
|
+
function bi({
|
|
1743
1716
|
title: e,
|
|
1744
1717
|
titleId: t,
|
|
1745
1718
|
...n
|
|
1746
1719
|
}, r) {
|
|
1747
|
-
return /* @__PURE__ */
|
|
1720
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1748
1721
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1749
1722
|
viewBox: "0 0 20 20",
|
|
1750
1723
|
fill: "currentColor",
|
|
@@ -1752,23 +1725,23 @@ function fi({
|
|
|
1752
1725
|
"data-slot": "icon",
|
|
1753
1726
|
ref: r,
|
|
1754
1727
|
"aria-labelledby": t
|
|
1755
|
-
}, n), e ? /* @__PURE__ */
|
|
1728
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1756
1729
|
id: t
|
|
1757
|
-
}, e) : null, /* @__PURE__ */
|
|
1730
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1758
1731
|
d: "M6.75 8.25a.75.75 0 0 0 0 1.5h4.5a.75.75 0 0 0 0-1.5h-4.5Z"
|
|
1759
|
-
}), /* @__PURE__ */
|
|
1732
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1760
1733
|
fillRule: "evenodd",
|
|
1761
1734
|
d: "M9 2a7 7 0 1 0 4.391 12.452l3.329 3.328a.75.75 0 1 0 1.06-1.06l-3.328-3.329A7 7 0 0 0 9 2ZM3.5 9a5.5 5.5 0 1 1 11 0 5.5 5.5 0 0 1-11 0Z",
|
|
1762
1735
|
clipRule: "evenodd"
|
|
1763
1736
|
}));
|
|
1764
1737
|
}
|
|
1765
|
-
const
|
|
1766
|
-
function
|
|
1738
|
+
const Ei = /* @__PURE__ */ S.forwardRef(bi);
|
|
1739
|
+
function yi({
|
|
1767
1740
|
title: e,
|
|
1768
1741
|
titleId: t,
|
|
1769
1742
|
...n
|
|
1770
1743
|
}, r) {
|
|
1771
|
-
return /* @__PURE__ */
|
|
1744
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1772
1745
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1773
1746
|
viewBox: "0 0 20 20",
|
|
1774
1747
|
fill: "currentColor",
|
|
@@ -1776,23 +1749,23 @@ function hi({
|
|
|
1776
1749
|
"data-slot": "icon",
|
|
1777
1750
|
ref: r,
|
|
1778
1751
|
"aria-labelledby": t
|
|
1779
|
-
}, n), e ? /* @__PURE__ */
|
|
1752
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1780
1753
|
id: t
|
|
1781
|
-
}, e) : null, /* @__PURE__ */
|
|
1754
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1782
1755
|
d: "M9 6a.75.75 0 0 1 .75.75v1.5h1.5a.75.75 0 0 1 0 1.5h-1.5v1.5a.75.75 0 0 1-1.5 0v-1.5h-1.5a.75.75 0 0 1 0-1.5h1.5v-1.5A.75.75 0 0 1 9 6Z"
|
|
1783
|
-
}), /* @__PURE__ */
|
|
1756
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
1784
1757
|
fillRule: "evenodd",
|
|
1785
1758
|
d: "M2 9a7 7 0 1 1 12.452 4.391l3.328 3.329a.75.75 0 1 1-1.06 1.06l-3.329-3.328A7 7 0 0 1 2 9Zm7-5.5a5.5 5.5 0 1 0 0 11 5.5 5.5 0 0 0 0-11Z",
|
|
1786
1759
|
clipRule: "evenodd"
|
|
1787
1760
|
}));
|
|
1788
1761
|
}
|
|
1789
|
-
const
|
|
1790
|
-
function
|
|
1762
|
+
const Si = /* @__PURE__ */ S.forwardRef(yi);
|
|
1763
|
+
function xi({
|
|
1791
1764
|
title: e,
|
|
1792
1765
|
titleId: t,
|
|
1793
1766
|
...n
|
|
1794
1767
|
}, r) {
|
|
1795
|
-
return /* @__PURE__ */
|
|
1768
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
1796
1769
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1797
1770
|
viewBox: "0 0 20 20",
|
|
1798
1771
|
fill: "currentColor",
|
|
@@ -1800,15 +1773,15 @@ function vi({
|
|
|
1800
1773
|
"data-slot": "icon",
|
|
1801
1774
|
ref: r,
|
|
1802
1775
|
"aria-labelledby": t
|
|
1803
|
-
}, n), e ? /* @__PURE__ */
|
|
1776
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
1804
1777
|
id: t
|
|
1805
|
-
}, e) : null, /* @__PURE__ */
|
|
1778
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
1806
1779
|
fillRule: "evenodd",
|
|
1807
1780
|
d: "M1 5.25A2.25 2.25 0 0 1 3.25 3h13.5A2.25 2.25 0 0 1 19 5.25v9.5A2.25 2.25 0 0 1 16.75 17H3.25A2.25 2.25 0 0 1 1 14.75v-9.5Zm1.5 5.81v3.69c0 .414.336.75.75.75h13.5a.75.75 0 0 0 .75-.75v-2.69l-2.22-2.219a.75.75 0 0 0-1.06 0l-1.91 1.909.47.47a.75.75 0 1 1-1.06 1.06L6.53 8.091a.75.75 0 0 0-1.06 0l-2.97 2.97ZM12 7a1 1 0 1 1-2 0 1 1 0 0 1 2 0Z",
|
|
1808
1781
|
clipRule: "evenodd"
|
|
1809
1782
|
}));
|
|
1810
1783
|
}
|
|
1811
|
-
const
|
|
1784
|
+
const ki = /* @__PURE__ */ S.forwardRef(xi), rt = "data-aqmx-key-repeat", ot = Object.freeze({ [rt]: "allow" }), Ti = `[${rt}="${ot[rt]}"]`, Ri = () => {
|
|
1812
1785
|
let e = null;
|
|
1813
1786
|
return {
|
|
1814
1787
|
onKeyDownCapture: (t) => {
|
|
@@ -1817,7 +1790,7 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1817
1790
|
e = t.target instanceof Element ? t.target : null;
|
|
1818
1791
|
return;
|
|
1819
1792
|
}
|
|
1820
|
-
e !== null && t.target === e && e.closest(
|
|
1793
|
+
e !== null && t.target === e && e.closest(Ti) !== null || (t.preventDefault(), t.stopPropagation());
|
|
1821
1794
|
}
|
|
1822
1795
|
},
|
|
1823
1796
|
onKeyUpCapture: (t) => {
|
|
@@ -1827,41 +1800,41 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1827
1800
|
t.target === e && (e = null);
|
|
1828
1801
|
}
|
|
1829
1802
|
};
|
|
1830
|
-
},
|
|
1803
|
+
}, Le = Object.freeze([1 / be ** 2, 1 / be, 1, be, be ** 2]), zt = Object.freeze({ mode: "fit" }), Oi = 1, Fn = Object.freeze({ className: "aqmx-document-canvas", "data-testid": "markdown-explorer-image-canvas" }), Vt = `[data-testid="${Fn["data-testid"]}"]`, Ci = pe(null), Mi = (e, t) => e.width > 0 && e.height > 0 && t.width - e.width <= Oi ? { base: e, scale: t.width / e.width } : t.width > 0 && t.height > 0 ? { base: t, scale: 1 } : null, Ht = (e, t, n) => {
|
|
1831
1804
|
if (e.mode === "level") {
|
|
1832
1805
|
const o = e.index + n;
|
|
1833
|
-
return o >= 0 && o <
|
|
1806
|
+
return o >= 0 && o < Le.length ? o : null;
|
|
1834
1807
|
}
|
|
1835
1808
|
if (t === null || !Number.isFinite(t) || t <= 0) return null;
|
|
1836
|
-
const r = n === 1 ?
|
|
1809
|
+
const r = n === 1 ? Le.findIndex((o) => o > t) : Le.findLastIndex((o) => o < t);
|
|
1837
1810
|
return r === -1 ? null : r;
|
|
1838
|
-
},
|
|
1811
|
+
}, Ut = (e, t, n) => {
|
|
1839
1812
|
if (e.mode === "level") {
|
|
1840
|
-
const o =
|
|
1813
|
+
const o = Ht(e, null, n);
|
|
1841
1814
|
return o === null ? null : { mode: "level", index: o, base: e.base };
|
|
1842
1815
|
}
|
|
1843
1816
|
if (t === null) return null;
|
|
1844
|
-
const r =
|
|
1817
|
+
const r = Ht(e, t.scale, n);
|
|
1845
1818
|
return r === null ? null : { mode: "level", index: r, base: t.base };
|
|
1846
|
-
},
|
|
1819
|
+
}, Li = (e, t) => {
|
|
1847
1820
|
if (e <= 0 || t <= 0) return 0;
|
|
1848
1821
|
const n = Math.trunc(Math.log(t / e) / Math.log(be));
|
|
1849
1822
|
return n === 0 ? 0 : n;
|
|
1850
|
-
},
|
|
1823
|
+
}, Zt = (e) => {
|
|
1851
1824
|
const t = e[0], n = e[1];
|
|
1852
1825
|
return e.length !== 2 || t === void 0 || n === void 0 ? null : { distance: Math.hypot(n.clientX - t.clientX, n.clientY - t.clientY), middle: { x: (t.clientX + n.clientX) / 2, y: (t.clientY + n.clientY) / 2 } };
|
|
1853
|
-
},
|
|
1854
|
-
const t =
|
|
1826
|
+
}, Ai = (e) => {
|
|
1827
|
+
const t = Le[e];
|
|
1855
1828
|
if (t === void 0) throw new RangeError(`[markdown-explorer] no image zoom step ${String(e)}`);
|
|
1856
1829
|
return t;
|
|
1857
|
-
},
|
|
1858
|
-
const { labels: t } = D(), n =
|
|
1859
|
-
const { naturalWidth:
|
|
1860
|
-
u((
|
|
1861
|
-
}, []),
|
|
1862
|
-
(
|
|
1863
|
-
|
|
1864
|
-
() => h(
|
|
1830
|
+
}, Gt = (e, t, n) => e !== null && e.width === t && e.height === n ? e : { width: t, height: n }, Ni = ({ document: e }) => {
|
|
1831
|
+
const { labels: t } = D(), n = ne(Ci), [r] = B(() => n === null ? null : n.read(e.url)), [o, i] = B(r === null ? zt : r.zoom), [l, u] = B(r === null ? null : r.reported), [m, f] = B(null), d = q(null), h = P((g) => {
|
|
1832
|
+
const { naturalWidth: a, naturalHeight: s } = g;
|
|
1833
|
+
u((w) => Gt(w, a, s));
|
|
1834
|
+
}, []), v = P(
|
|
1835
|
+
(g) => {
|
|
1836
|
+
d.current = g, !(g === null || !g.complete) && (g.naturalWidth > 0 || g.naturalHeight > 0 ? h(g) : g.decode().then(
|
|
1837
|
+
() => h(g),
|
|
1865
1838
|
() => {
|
|
1866
1839
|
}
|
|
1867
1840
|
));
|
|
@@ -1869,52 +1842,52 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1869
1842
|
[h]
|
|
1870
1843
|
);
|
|
1871
1844
|
te(() => {
|
|
1872
|
-
n !== null &&
|
|
1873
|
-
}, [n, e.url, o,
|
|
1874
|
-
const
|
|
1875
|
-
if (
|
|
1876
|
-
const
|
|
1877
|
-
if (
|
|
1878
|
-
const s = new ResizeObserver(
|
|
1879
|
-
return s.observe(
|
|
1880
|
-
}, [
|
|
1881
|
-
const E =
|
|
1882
|
-
|
|
1883
|
-
|
|
1845
|
+
n !== null && l !== null && n.save(e.url, { zoom: o, reported: l });
|
|
1846
|
+
}, [n, e.url, o, l]), V(() => {
|
|
1847
|
+
const g = d.current;
|
|
1848
|
+
if (g === null || l === null || o.mode !== "fit") return;
|
|
1849
|
+
const a = () => f((w) => Gt(w, g.clientWidth, g.clientHeight));
|
|
1850
|
+
if (a(), typeof ResizeObserver > "u") return;
|
|
1851
|
+
const s = new ResizeObserver(a);
|
|
1852
|
+
return s.observe(g), () => s.disconnect();
|
|
1853
|
+
}, [l, o.mode]);
|
|
1854
|
+
const E = l === null || m === null ? null : Mi(l, m), k = Ut(o, E, -1), R = Ut(o, E, 1), T = o.mode === "level" ? Ai(o.index) : null, N = q({ zoomIn: R, zoomOut: k });
|
|
1855
|
+
V(() => {
|
|
1856
|
+
N.current = { zoomIn: R, zoomOut: k };
|
|
1884
1857
|
});
|
|
1885
|
-
const
|
|
1886
|
-
|
|
1887
|
-
const
|
|
1888
|
-
|
|
1858
|
+
const M = q(null);
|
|
1859
|
+
V(() => {
|
|
1860
|
+
const g = M.current, a = d.current?.closest(Vt);
|
|
1861
|
+
M.current = null, !(g === null || a === null || a === void 0) && (a.scrollLeft = g.across * a.scrollWidth - g.x, a.scrollTop = g.down * a.scrollHeight - g.y);
|
|
1889
1862
|
}, [o]), te(() => {
|
|
1890
|
-
const
|
|
1891
|
-
if (
|
|
1892
|
-
let
|
|
1893
|
-
const s = (
|
|
1894
|
-
const
|
|
1895
|
-
|
|
1896
|
-
},
|
|
1897
|
-
const
|
|
1898
|
-
if (
|
|
1899
|
-
|
|
1900
|
-
const
|
|
1901
|
-
if (
|
|
1902
|
-
const
|
|
1863
|
+
const g = d.current?.closest(Vt);
|
|
1864
|
+
if (g == null) return;
|
|
1865
|
+
let a = null;
|
|
1866
|
+
const s = (L) => {
|
|
1867
|
+
const A = Zt(L.touches);
|
|
1868
|
+
a = A === null ? null : { distance: A.distance, steps: 0 };
|
|
1869
|
+
}, w = (L) => {
|
|
1870
|
+
const A = Zt(L.touches);
|
|
1871
|
+
if (a === null || A === null) return;
|
|
1872
|
+
L.preventDefault();
|
|
1873
|
+
const I = Li(a.distance, A.distance);
|
|
1874
|
+
if (I === a.steps) return;
|
|
1875
|
+
const K = I > a.steps ? 1 : -1, G = K === 1 ? N.current.zoomIn : N.current.zoomOut;
|
|
1903
1876
|
if (G === null) return;
|
|
1904
|
-
|
|
1905
|
-
const
|
|
1906
|
-
|
|
1907
|
-
}, O = (
|
|
1908
|
-
|
|
1877
|
+
a.steps += K;
|
|
1878
|
+
const z = g.getBoundingClientRect(), X = A.middle.x - z.left, j = A.middle.y - z.top;
|
|
1879
|
+
M.current = g.scrollWidth > 0 && g.scrollHeight > 0 ? { x: X, y: j, across: (g.scrollLeft + X) / g.scrollWidth, down: (g.scrollTop + j) / g.scrollHeight } : null, i(G);
|
|
1880
|
+
}, O = (L) => {
|
|
1881
|
+
L.touches.length < 2 && (a = null);
|
|
1909
1882
|
};
|
|
1910
|
-
return
|
|
1911
|
-
|
|
1883
|
+
return g.addEventListener("touchstart", s, { passive: !0 }), g.addEventListener("touchmove", w, { passive: !1 }), g.addEventListener("touchend", O, { passive: !0 }), g.addEventListener("touchcancel", O, { passive: !0 }), () => {
|
|
1884
|
+
g.removeEventListener("touchstart", s), g.removeEventListener("touchmove", w), g.removeEventListener("touchend", O), g.removeEventListener("touchcancel", O);
|
|
1912
1885
|
};
|
|
1913
1886
|
}, []);
|
|
1914
1887
|
const b = o.mode === "level" && T !== null ? { width: `${o.base.width * T}px`, height: `${o.base.height * T}px` } : void 0;
|
|
1915
|
-
return /* @__PURE__ */
|
|
1916
|
-
/* @__PURE__ */
|
|
1917
|
-
/* @__PURE__ */
|
|
1888
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-image-view", children: [
|
|
1889
|
+
/* @__PURE__ */ F(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: /* @__PURE__ */ c(ki, {}), children: [
|
|
1890
|
+
/* @__PURE__ */ c(
|
|
1918
1891
|
"button",
|
|
1919
1892
|
{
|
|
1920
1893
|
type: "button",
|
|
@@ -1925,12 +1898,12 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1925
1898
|
onClick: () => {
|
|
1926
1899
|
k !== null && i(k);
|
|
1927
1900
|
},
|
|
1928
|
-
...
|
|
1929
|
-
children: /* @__PURE__ */
|
|
1901
|
+
...ot,
|
|
1902
|
+
children: /* @__PURE__ */ c(Ei, {})
|
|
1930
1903
|
}
|
|
1931
1904
|
),
|
|
1932
|
-
/* @__PURE__ */
|
|
1933
|
-
/* @__PURE__ */
|
|
1905
|
+
/* @__PURE__ */ c("output", { className: "aqmx-document-level", "aria-live": "polite", "data-testid": "markdown-explorer-image-level", children: T === null ? t.imageFitLevel : t.imageZoomLevel(Math.round(T * 100)) }),
|
|
1906
|
+
/* @__PURE__ */ c(
|
|
1934
1907
|
"button",
|
|
1935
1908
|
{
|
|
1936
1909
|
type: "button",
|
|
@@ -1941,87 +1914,91 @@ const wi = /* @__PURE__ */ y.forwardRef(vi), nt = "data-aqmx-key-repeat", rt = O
|
|
|
1941
1914
|
onClick: () => {
|
|
1942
1915
|
R !== null && i(R);
|
|
1943
1916
|
},
|
|
1944
|
-
...
|
|
1945
|
-
children: /* @__PURE__ */
|
|
1917
|
+
...ot,
|
|
1918
|
+
children: /* @__PURE__ */ c(Si, {})
|
|
1946
1919
|
}
|
|
1947
1920
|
),
|
|
1948
|
-
/* @__PURE__ */
|
|
1921
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-icon-button", "aria-label": t.imageFit, title: t.imageFit, "aria-pressed": o.mode === "fit", onClick: () => i(zt), children: /* @__PURE__ */ c(wi, {}) })
|
|
1949
1922
|
] }),
|
|
1950
|
-
/* @__PURE__ */
|
|
1923
|
+
/* @__PURE__ */ c(ve, { scrollerProps: Fn, children: /* @__PURE__ */ c("img", { ref: v, className: "aqmx-document-image", src: e.url, alt: e.name, "data-aqmx-image-mode": o.mode, style: b, onLoad: (g) => h(g.currentTarget), "data-testid": "markdown-explorer-image" }) })
|
|
1951
1924
|
] });
|
|
1952
|
-
},
|
|
1953
|
-
const
|
|
1925
|
+
}, Di = async (e, t, n) => {
|
|
1926
|
+
const r = await e.text(t, n);
|
|
1927
|
+
if (!("kind" in r)) throw n.reason;
|
|
1928
|
+
return r.kind === "text" ? { kind: "text", text: r.text, truncated: r.truncated } : { kind: "failure", retryable: r.failure.reason === "failed" };
|
|
1929
|
+
}, In = pe(null), Be = pe(void 0), qn = pe(null), je = () => {
|
|
1930
|
+
const e = ne(In);
|
|
1954
1931
|
if (e === null) throw new Error("[markdown-explorer] document links must be rendered inside a document pane");
|
|
1955
1932
|
return e;
|
|
1956
|
-
},
|
|
1957
|
-
const e =
|
|
1933
|
+
}, Pi = () => {
|
|
1934
|
+
const e = ne(qn);
|
|
1958
1935
|
if (e === null) throw new Error("[markdown-explorer] table-of-contents entries must be rendered inside a document pane's links");
|
|
1959
1936
|
return e;
|
|
1960
|
-
}, ze = (e, t, n, r) => t.kind === "panel" ?
|
|
1961
|
-
const { config: t } = D(), n =
|
|
1962
|
-
return /* @__PURE__ */
|
|
1963
|
-
},
|
|
1964
|
-
const t = e instanceof Element ? e.closest(
|
|
1937
|
+
}, ze = (e, t, n, r) => t.kind === "panel" ? ye(e, { view: "tree", source: n, doc: r }) : t.view === "single" ? ye(e, { view: "single", source: n, doc: r, overrides: t.overrides, embed: t.embed }) : ye(e, { view: "tree", source: n, doc: r, overrides: t.overrides }), $i = ({ children: e }) => {
|
|
1938
|
+
const { config: t } = D(), n = je(), r = st(), o = r.kind === "location" ? r.location.source : void 0, i = Fe(ze(t, n.navigation, o, n.currentPath));
|
|
1939
|
+
return /* @__PURE__ */ c(Be, { value: o, children: /* @__PURE__ */ c(qn, { value: i, children: e }) });
|
|
1940
|
+
}, Fi = 'a[data-link-kind="doc"][data-doc-path]:not([data-doc-exists="false"])', Ii = (e) => {
|
|
1941
|
+
const t = e instanceof Element ? e.closest(Fi) : null;
|
|
1965
1942
|
return t === null ? null : t.getAttribute("data-doc-path");
|
|
1966
|
-
},
|
|
1943
|
+
}, Ve = (e) => !e.defaultPrevented && e.button === 0 && !e.metaKey && !e.ctrlKey && !e.shiftKey && !e.altKey, qi = ({ to: e, docPath: t, fragment: n, exists: r, className: o, attributes: i, onDocumentLink: l, scope: u, children: m }) => {
|
|
1967
1944
|
const f = Fe(e);
|
|
1968
|
-
return /* @__PURE__ */
|
|
1969
|
-
if (
|
|
1945
|
+
return /* @__PURE__ */ c("a", { ...i, href: f, className: o, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": r, onClick: (h) => {
|
|
1946
|
+
if (Ve(h)) {
|
|
1970
1947
|
if (h.preventDefault(), t === u.currentPath && n !== "") {
|
|
1971
1948
|
u.scrollWithin(n);
|
|
1972
1949
|
return;
|
|
1973
1950
|
}
|
|
1974
|
-
|
|
1951
|
+
l(t, n);
|
|
1975
1952
|
}
|
|
1976
1953
|
}, children: m });
|
|
1977
|
-
},
|
|
1978
|
-
const { config:
|
|
1979
|
-
return
|
|
1980
|
-
},
|
|
1954
|
+
}, _i = ({ href: e, docPath: t, docExists: n, className: r, attributes: o, children: i }) => {
|
|
1955
|
+
const { config: l } = D(), u = je(), m = ne(Be), f = ai(e), { navigation: d } = u, h = `${ze(l, d, m, t)}${f}`, v = n === !1 ? "false" : void 0;
|
|
1956
|
+
return d.kind === "page" ? /* @__PURE__ */ c(Fo, { ...o, to: h, navigation: "follow-link", className: r, "data-link-kind": "doc", "data-doc-path": t, "data-doc-exists": v, children: i }) : /* @__PURE__ */ c(qi, { to: h, docPath: t, fragment: f, exists: v, className: r, attributes: o, onDocumentLink: d.onDocumentLink, scope: u, children: i });
|
|
1957
|
+
}, Bi = ({ className: e, attributes: t, children: n }) => {
|
|
1981
1958
|
const { labels: r } = D();
|
|
1982
1959
|
return (
|
|
1983
|
-
/* @__PURE__ */
|
|
1960
|
+
/* @__PURE__ */ F("a", { ...t, className: e === void 0 ? "aqmx-document-inert-link" : `${e} aqmx-document-inert-link`, title: r.inertLink, "data-link-kind": "doc", "data-doc-exists": "false", children: [
|
|
1984
1961
|
n,
|
|
1985
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ F("span", { className: "aqmx-sr-only", children: [
|
|
1986
1963
|
" (",
|
|
1987
1964
|
r.inertLink,
|
|
1988
1965
|
")"
|
|
1989
1966
|
] })
|
|
1990
1967
|
] })
|
|
1991
1968
|
);
|
|
1992
|
-
},
|
|
1993
|
-
const { config: i } = D(),
|
|
1994
|
-
return /* @__PURE__ */
|
|
1995
|
-
|
|
1969
|
+
}, ji = ({ href: e, className: t, attributes: n, scope: r, children: o }) => {
|
|
1970
|
+
const { config: i } = D(), l = ne(Be), u = Fe(`${ze(i, r.navigation, l, r.currentPath)}${e}`);
|
|
1971
|
+
return /* @__PURE__ */ c("a", { ...n, href: u, className: t, onClick: (f) => {
|
|
1972
|
+
Ve(f) && (f.preventDefault(), r.scrollWithin(e));
|
|
1996
1973
|
}, children: o });
|
|
1997
|
-
},
|
|
1998
|
-
const o =
|
|
1999
|
-
return o.navigation.kind === "page" ? /* @__PURE__ */
|
|
2000
|
-
if (!
|
|
2001
|
-
const u =
|
|
2002
|
-
e === "#" ? o.followEmptyFragment(
|
|
2003
|
-
}, children: r }) : /* @__PURE__ */
|
|
2004
|
-
},
|
|
2005
|
-
const { config: e } = D(), t =
|
|
1974
|
+
}, zi = ({ href: e, className: t, attributes: n, children: r }) => {
|
|
1975
|
+
const o = je();
|
|
1976
|
+
return o.navigation.kind === "page" ? /* @__PURE__ */ c("a", { ...n, href: e, className: t, onClick: (l) => {
|
|
1977
|
+
if (!Ve(l)) return;
|
|
1978
|
+
const u = l.currentTarget;
|
|
1979
|
+
e === "#" ? o.followEmptyFragment(l.nativeEvent) : u.href === u.ownerDocument.URL && o.followSameUrlJump(e, l.nativeEvent);
|
|
1980
|
+
}, children: r }) : /* @__PURE__ */ c(ji, { href: e, className: t, attributes: n, scope: o, children: r });
|
|
1981
|
+
}, Vi = ({ href: e, kind: t, docPath: n, docExists: r, className: o, attributes: i, children: l }) => t === "doc" ? n === void 0 || !sr(n) ? /* @__PURE__ */ c(Bi, { className: o, attributes: i, children: l }) : /* @__PURE__ */ c(_i, { href: e, docPath: n, docExists: r, className: o, attributes: i, children: l }) : e.startsWith("#") ? /* @__PURE__ */ c(zi, { href: e, className: o, attributes: i, children: l }) : /* @__PURE__ */ c("a", { ...i, href: e, className: o, children: l }), Hi = () => {
|
|
1982
|
+
const { config: e } = D(), t = je(), n = ne(Be), r = Ie();
|
|
2006
1983
|
return P(
|
|
2007
1984
|
(o, i) => {
|
|
2008
|
-
if (!
|
|
1985
|
+
if (!Ve(i)) return !0;
|
|
2009
1986
|
i.preventDefault();
|
|
2010
|
-
const
|
|
2011
|
-
return u.kind === "panel" ||
|
|
1987
|
+
const l = Dn(o.id), { navigation: u } = t;
|
|
1988
|
+
return u.kind === "panel" || ut(i.currentTarget.ownerDocument.location.hash) === o.id ? (t.scrollWithin(l), !0) : (r(`${ze(e, u, n, t.currentPath)}${l}`, "follow-link"), !0);
|
|
2012
1989
|
},
|
|
2013
1990
|
[e, t, n, r]
|
|
2014
1991
|
);
|
|
2015
|
-
},
|
|
2016
|
-
const e =
|
|
2017
|
-
return P((t) => `${e}${
|
|
1992
|
+
}, Ui = () => {
|
|
1993
|
+
const e = Pi();
|
|
1994
|
+
return P((t) => `${e}${Dn(t.id)}`, [e]);
|
|
2018
1995
|
};
|
|
2019
|
-
function
|
|
1996
|
+
function Zi({
|
|
2020
1997
|
title: e,
|
|
2021
1998
|
titleId: t,
|
|
2022
1999
|
...n
|
|
2023
2000
|
}, r) {
|
|
2024
|
-
return /* @__PURE__ */
|
|
2001
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2025
2002
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2026
2003
|
viewBox: "0 0 20 20",
|
|
2027
2004
|
fill: "currentColor",
|
|
@@ -2029,19 +2006,19 @@ function _i({
|
|
|
2029
2006
|
"data-slot": "icon",
|
|
2030
2007
|
ref: r,
|
|
2031
2008
|
"aria-labelledby": t
|
|
2032
|
-
}, n), e ? /* @__PURE__ */
|
|
2009
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2033
2010
|
id: t
|
|
2034
|
-
}, e) : null, /* @__PURE__ */
|
|
2011
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2035
2012
|
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"
|
|
2036
2013
|
}));
|
|
2037
2014
|
}
|
|
2038
|
-
const
|
|
2039
|
-
function
|
|
2015
|
+
const Gi = /* @__PURE__ */ S.forwardRef(Zi);
|
|
2016
|
+
function Ki({
|
|
2040
2017
|
title: e,
|
|
2041
2018
|
titleId: t,
|
|
2042
2019
|
...n
|
|
2043
2020
|
}, r) {
|
|
2044
|
-
return /* @__PURE__ */
|
|
2021
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2045
2022
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2046
2023
|
viewBox: "0 0 20 20",
|
|
2047
2024
|
fill: "currentColor",
|
|
@@ -2049,21 +2026,21 @@ function Bi({
|
|
|
2049
2026
|
"data-slot": "icon",
|
|
2050
2027
|
ref: r,
|
|
2051
2028
|
"aria-labelledby": t
|
|
2052
|
-
}, n), e ? /* @__PURE__ */
|
|
2029
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2053
2030
|
id: t
|
|
2054
|
-
}, e) : null, /* @__PURE__ */
|
|
2031
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2055
2032
|
fillRule: "evenodd",
|
|
2056
2033
|
d: "M1 4.75C1 3.784 1.784 3 2.75 3h14.5c.966 0 1.75.784 1.75 1.75v10.515a1.75 1.75 0 0 1-1.75 1.75h-1.5c-.078 0-.155-.005-.23-.015H4.48c-.075.01-.152.015-.23.015h-1.5A1.75 1.75 0 0 1 1 15.265V4.75Zm16.5 7.385V11.01a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25Zm0 2.005a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .108.069.2.165.235h1.585a.25.25 0 0 0 .25-.25v-1.11Zm-15 1.11v-1.11a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.164.235H2.75a.25.25 0 0 1-.25-.25Zm2-4.24v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V11.01a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25Zm13-2.005V7.88a.25.25 0 0 0-.25-.25h-1.5a.25.25 0 0 0-.25.25v1.125c0 .138.112.25.25.25h1.5a.25.25 0 0 0 .25-.25ZM4.25 7.63a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V7.88a.25.25 0 0 1 .25-.25h1.5Zm0-3.13a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5Zm11.5 1.625a.25.25 0 0 1-.25-.25V4.75a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v1.125a.25.25 0 0 1-.25.25h-1.5Zm-9 3.125a.75.75 0 0 0 0 1.5h6.5a.75.75 0 0 0 0-1.5h-6.5Z",
|
|
2057
2034
|
clipRule: "evenodd"
|
|
2058
2035
|
}));
|
|
2059
2036
|
}
|
|
2060
|
-
const
|
|
2061
|
-
function
|
|
2037
|
+
const Wi = /* @__PURE__ */ S.forwardRef(Ki);
|
|
2038
|
+
function Yi({
|
|
2062
2039
|
title: e,
|
|
2063
2040
|
titleId: t,
|
|
2064
2041
|
...n
|
|
2065
2042
|
}, r) {
|
|
2066
|
-
return /* @__PURE__ */
|
|
2043
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2067
2044
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2068
2045
|
viewBox: "0 0 20 20",
|
|
2069
2046
|
fill: "currentColor",
|
|
@@ -2071,59 +2048,73 @@ function ji({
|
|
|
2071
2048
|
"data-slot": "icon",
|
|
2072
2049
|
ref: r,
|
|
2073
2050
|
"aria-labelledby": t
|
|
2074
|
-
}, n), e ? /* @__PURE__ */
|
|
2051
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2075
2052
|
id: t
|
|
2076
|
-
}, e) : null, /* @__PURE__ */
|
|
2053
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2077
2054
|
fillRule: "evenodd",
|
|
2078
2055
|
d: "M17.721 1.599a.75.75 0 0 1 .279.583v11.29a2.25 2.25 0 0 1-1.774 2.2l-2.041.44a2.216 2.216 0 0 1-.938-4.332l2.662-.577a.75.75 0 0 0 .591-.733V6.112l-8 1.73v7.684a2.25 2.25 0 0 1-1.774 2.2l-2.042.44a2.216 2.216 0 1 1-.935-4.331l2.659-.573A.75.75 0 0 0 7 12.529V4.236a.75.75 0 0 1 .591-.733l9.5-2.054a.75.75 0 0 1 .63.15Z",
|
|
2079
2056
|
clipRule: "evenodd"
|
|
2080
2057
|
}));
|
|
2081
2058
|
}
|
|
2082
|
-
const
|
|
2083
|
-
},
|
|
2084
|
-
const { labels: t } = D(), n = ee(
|
|
2085
|
-
return n === null ? null : n ? /* @__PURE__ */
|
|
2086
|
-
/* @__PURE__ */
|
|
2087
|
-
/* @__PURE__ */
|
|
2088
|
-
/* @__PURE__ */
|
|
2089
|
-
/* @__PURE__ */
|
|
2059
|
+
const Xi = /* @__PURE__ */ S.forwardRef(Yi), Ji = Object.freeze({ className: "aqmx-document-stage" }), Qi = () => () => {
|
|
2060
|
+
}, el = () => navigator.pdfViewerEnabled !== !1, tl = () => null, nl = ({ document: e }) => {
|
|
2061
|
+
const { labels: t } = D(), n = ee(Qi, el, tl);
|
|
2062
|
+
return n === null ? null : n ? /* @__PURE__ */ c("iframe", { className: "aqmx-document-frame", src: e.url, title: e.name, "data-testid": "markdown-explorer-media-player" }) : /* @__PURE__ */ F("div", { className: "aqmx-callout", role: "note", "data-testid": "markdown-explorer-pdf-not-shown", children: [
|
|
2063
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: t.pdfNotShown }),
|
|
2064
|
+
/* @__PURE__ */ F("div", { className: "aqmx-callout-actions", children: [
|
|
2065
|
+
/* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, target: "_blank", rel: "noopener noreferrer", "data-testid": "markdown-explorer-pdf-not-shown-open", children: t.openInNewTab }),
|
|
2066
|
+
/* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e.url, download: e.name, "data-testid": "markdown-explorer-pdf-not-shown-download", children: t.download })
|
|
2090
2067
|
] })
|
|
2091
2068
|
] });
|
|
2092
|
-
},
|
|
2069
|
+
}, rl = (e) => {
|
|
2093
2070
|
switch (e) {
|
|
2094
2071
|
case "video":
|
|
2095
|
-
return /* @__PURE__ */
|
|
2072
|
+
return /* @__PURE__ */ c(Wi, {});
|
|
2096
2073
|
case "audio":
|
|
2097
|
-
return /* @__PURE__ */
|
|
2074
|
+
return /* @__PURE__ */ c(Xi, {});
|
|
2098
2075
|
case "pdf":
|
|
2099
|
-
return /* @__PURE__ */
|
|
2076
|
+
return /* @__PURE__ */ c(Gi, {});
|
|
2100
2077
|
default: {
|
|
2101
2078
|
const t = e;
|
|
2102
2079
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(t)}`);
|
|
2103
2080
|
}
|
|
2104
2081
|
}
|
|
2105
|
-
},
|
|
2082
|
+
}, ol = ({ document: e }) => {
|
|
2106
2083
|
const { labels: t } = D();
|
|
2107
2084
|
switch (e.mediaType) {
|
|
2108
2085
|
case "video":
|
|
2109
2086
|
return (
|
|
2110
|
-
/* @__PURE__ */
|
|
2087
|
+
/* @__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 })
|
|
2111
2088
|
);
|
|
2112
2089
|
case "audio":
|
|
2113
2090
|
return (
|
|
2114
|
-
/* @__PURE__ */
|
|
2091
|
+
/* @__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 })
|
|
2115
2092
|
);
|
|
2116
2093
|
case "pdf":
|
|
2117
|
-
return /* @__PURE__ */
|
|
2094
|
+
return /* @__PURE__ */ c(nl, { document: e });
|
|
2118
2095
|
default: {
|
|
2119
2096
|
const n = e.mediaType;
|
|
2120
2097
|
throw new RangeError(`[markdown-explorer] unknown media type ${String(n)}`);
|
|
2121
2098
|
}
|
|
2122
2099
|
}
|
|
2123
|
-
},
|
|
2124
|
-
/* @__PURE__ */
|
|
2125
|
-
/* @__PURE__ */
|
|
2126
|
-
] }),
|
|
2100
|
+
}, il = ({ document: e }) => /* @__PURE__ */ F("div", { className: "aqmx-document-file", "data-testid": "markdown-explorer-media-view", "data-aqmx-media-type": e.mediaType, children: [
|
|
2101
|
+
/* @__PURE__ */ c(qe, { name: e.name, openUrl: e.url, downloadUrl: e.url, icon: rl(e.mediaType) }),
|
|
2102
|
+
/* @__PURE__ */ c(ve, { scrollerProps: Ji, children: /* @__PURE__ */ c(ol, { document: e }) })
|
|
2103
|
+
] }), ft = (e) => e.kind === "markdown" ? "markdown" : e.kind === "image" && e.imageType === "svg" ? "svg" : null, ll = (e) => {
|
|
2104
|
+
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), i = ue(o);
|
|
2105
|
+
return i === null ? null : ft(i.document);
|
|
2106
|
+
}, al = (e) => {
|
|
2107
|
+
const { config: t } = D(), n = Ie(), r = P(() => n(ye(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2108
|
+
return H(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2109
|
+
}, sl = (e, t) => {
|
|
2110
|
+
const n = {};
|
|
2111
|
+
for (const r of Object.keys(Ae[t])) {
|
|
2112
|
+
const o = e[at(r)];
|
|
2113
|
+
o !== Ae[t][r].text && (n[`spreadsheet${r.charAt(0).toUpperCase()}${r.slice(1)}`] = o);
|
|
2114
|
+
}
|
|
2115
|
+
return n;
|
|
2116
|
+
}, cl = (e, t) => ({
|
|
2117
|
+
...sl(e, t),
|
|
2127
2118
|
loading: e.viewerLoading,
|
|
2128
2119
|
errorPrefix: e.viewerErrorPrefix,
|
|
2129
2120
|
styleTitle: e.viewerStyleTitle,
|
|
@@ -2164,309 +2155,294 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2164
2155
|
mermaidPanRight: e.viewerMermaidPanRight,
|
|
2165
2156
|
mermaidDiagram: e.viewerMermaidDiagram,
|
|
2166
2157
|
mermaidRetry: e.viewerMermaidRetry,
|
|
2167
|
-
spreadsheetTable: e.viewerSpreadsheetTable,
|
|
2168
|
-
spreadsheetZoomIn: e.viewerSpreadsheetZoomIn,
|
|
2169
|
-
spreadsheetZoomOut: e.viewerSpreadsheetZoomOut,
|
|
2170
|
-
spreadsheetResetZoom: e.viewerSpreadsheetResetZoom,
|
|
2171
|
-
spreadsheetHighlight: e.viewerSpreadsheetHighlight,
|
|
2172
|
-
spreadsheetCopyAll: e.viewerSpreadsheetCopyAll,
|
|
2173
|
-
spreadsheetSaveTsv: e.viewerSpreadsheetSaveTsv,
|
|
2174
|
-
spreadsheetSaveMenu: e.viewerSpreadsheetSaveMenu,
|
|
2175
|
-
spreadsheetSaveTsvWithBom: e.viewerSpreadsheetSaveTsvWithBom,
|
|
2176
|
-
spreadsheetFullscreen: e.viewerSpreadsheetFullscreen,
|
|
2177
|
-
spreadsheetExitFullscreen: e.viewerSpreadsheetExitFullscreen,
|
|
2178
|
-
spreadsheetFullscreenDialog: e.viewerSpreadsheetFullscreenDialog,
|
|
2179
|
-
spreadsheetSize: e.viewerSpreadsheetSize,
|
|
2180
|
-
spreadsheetFileName: e.viewerSpreadsheetFileName,
|
|
2181
|
-
spreadsheetCopied: e.viewerSpreadsheetCopied,
|
|
2182
|
-
spreadsheetCopyFailed: e.viewerSpreadsheetCopyFailed,
|
|
2183
|
-
spreadsheetCellAnnouncement: e.viewerSpreadsheetCellAnnouncement,
|
|
2184
|
-
spreadsheetEmptyCell: e.viewerSpreadsheetEmptyCell,
|
|
2185
|
-
spreadsheetSelectionAnnouncement: e.viewerSpreadsheetSelectionAnnouncement,
|
|
2186
|
-
spreadsheetReadOnly: e.viewerSpreadsheetReadOnly,
|
|
2187
|
-
spreadsheetFormatRefused: e.viewerSpreadsheetFormatRefused,
|
|
2188
|
-
spreadsheetFenceRefused: e.viewerSpreadsheetFenceRefused,
|
|
2189
|
-
spreadsheetEditConflict: e.viewerSpreadsheetEditConflict,
|
|
2190
|
-
spreadsheetOptionsError: e.viewerSpreadsheetOptionsError,
|
|
2191
|
-
spreadsheetLoadFailed: e.viewerSpreadsheetLoadFailed,
|
|
2192
|
-
spreadsheetRetry: e.viewerSpreadsheetRetry,
|
|
2193
2158
|
embeddedVideo: e.viewerEmbeddedVideo,
|
|
2194
2159
|
embeddedPost: e.viewerEmbeddedPost,
|
|
2195
|
-
embeddedFrame: e.viewerEmbeddedFrame
|
|
2196
|
-
|
|
2160
|
+
embeddedFrame: e.viewerEmbeddedFrame,
|
|
2161
|
+
blockFailed: e.viewerBlockFailed,
|
|
2162
|
+
svgImageToolbar: e.viewerSvgImageToolbar,
|
|
2163
|
+
svgImageSource: e.viewerSvgImageSource,
|
|
2164
|
+
svgImageSourceRegion: e.viewerSvgImageSourceRegion,
|
|
2165
|
+
svgImageLoading: e.viewerSvgImageLoading,
|
|
2166
|
+
svgImageFailed: e.viewerSvgImageFailed,
|
|
2167
|
+
svgImageRetry: e.viewerSvgImageRetry,
|
|
2168
|
+
svgImageTruncated: e.viewerSvgImageTruncated,
|
|
2169
|
+
svgImageCopy: e.viewerSvgImageCopy,
|
|
2170
|
+
svgImageCopied: e.viewerSvgImageCopied,
|
|
2171
|
+
svgImageCopyFailed: e.viewerSvgImageCopyFailed
|
|
2172
|
+
}), _n = (e, t, n) => {
|
|
2197
2173
|
if (t !== void 0) return t;
|
|
2198
2174
|
if (n !== void 0) return n;
|
|
2199
2175
|
const [r] = e.documentStyles;
|
|
2200
2176
|
if (r === void 0) throw new Error("[markdown-explorer] the configuration has no document style");
|
|
2201
2177
|
return r.name;
|
|
2202
|
-
},
|
|
2178
|
+
}, Bn = (e, t) => e !== void 0 ? e : t !== void 0 ? t : Cr, dl = Object.freeze({ kind: "empty" }), mt = Object.freeze(["l1", "l2", "l3", "l4", "l5", "l6", "l7", "l8"]), ul = (e, t, n) => {
|
|
2203
2179
|
if (t.view === "multi" || t.overrides[n] === void 0) return null;
|
|
2204
2180
|
const r = n === "style" ? { align: t.overrides.align } : { style: t.overrides.style };
|
|
2205
|
-
return
|
|
2206
|
-
},
|
|
2207
|
-
const m =
|
|
2181
|
+
return ye(e, { ...t, overrides: r });
|
|
2182
|
+
}, Se = ({ kind: e, view: t, label: n, stale: r, busy: o, frameRef: i, intent: l, children: u }) => {
|
|
2183
|
+
const m = ne(he);
|
|
2208
2184
|
return (
|
|
2209
|
-
/* @__PURE__ */
|
|
2210
|
-
r ? /* @__PURE__ */
|
|
2185
|
+
/* @__PURE__ */ F("section", { ref: i, 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": m, className: "aqmx-document", ...l, children: [
|
|
2186
|
+
r ? /* @__PURE__ */ c("div", { className: "aqmx-progress", "aria-hidden": "true", "data-testid": "markdown-explorer-document-progress" }) : null,
|
|
2211
2187
|
u
|
|
2212
2188
|
] })
|
|
2213
2189
|
);
|
|
2214
|
-
},
|
|
2215
|
-
const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null,
|
|
2190
|
+
}, fl = ({ absence: e, announces: t, announceFailure: n }) => {
|
|
2191
|
+
const { labels: r, announcer: o } = D(), i = e.kind === "no-readme" ? e.folder : null, l = e.kind === "failure" ? e.folder : null, u = e.kind === "failure" ? e.failure : null;
|
|
2216
2192
|
switch (te(() => {
|
|
2217
2193
|
t && i !== null && o.announce(r.folderReadmeMissing(se(i)));
|
|
2218
2194
|
}, [t, i, o, r]), te(() => {
|
|
2219
|
-
|
|
2220
|
-
}, [
|
|
2195
|
+
l !== null && u !== null && n(r.documentFailed(se(l), ae(r, u.reason)));
|
|
2196
|
+
}, [l, u, n, r]), e.kind) {
|
|
2221
2197
|
case "empty":
|
|
2222
|
-
return /* @__PURE__ */
|
|
2198
|
+
return /* @__PURE__ */ c(Se, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-document-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.documentEmpty }) }) });
|
|
2223
2199
|
case "loading":
|
|
2224
|
-
return /* @__PURE__ */
|
|
2200
|
+
return /* @__PURE__ */ c(ht, { label: r.documentRegion });
|
|
2225
2201
|
case "no-readme":
|
|
2226
|
-
return /* @__PURE__ */
|
|
2202
|
+
return /* @__PURE__ */ c(Se, { kind: "empty", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c("div", { className: "aqmx-empty", "data-testid": "markdown-explorer-folder-empty", children: /* @__PURE__ */ c("p", { className: "aqmx-empty-title", children: r.folderReadmeMissing(se(e.folder)) }) }) });
|
|
2227
2203
|
case "failure":
|
|
2228
|
-
return /* @__PURE__ */
|
|
2204
|
+
return /* @__PURE__ */ c(Se, { kind: "failure", label: r.documentRegion, stale: !1, busy: !1, children: /* @__PURE__ */ c(ve, { scrollerProps: pt, children: /* @__PURE__ */ c(me, { failure: e.failure, alert: !1, onRetry: e.onRetry, testId: "markdown-explorer-folder-failure" }) }) });
|
|
2229
2205
|
}
|
|
2230
|
-
},
|
|
2206
|
+
}, ht = ({ label: e }) => {
|
|
2231
2207
|
const { labels: t } = D();
|
|
2232
|
-
return /* @__PURE__ */
|
|
2233
|
-
/* @__PURE__ */
|
|
2234
|
-
/* @__PURE__ */
|
|
2208
|
+
return /* @__PURE__ */ F(Se, { kind: "loading", label: e, stale: !1, busy: !0, children: [
|
|
2209
|
+
/* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-document-skeleton", children: mt.map((n) => /* @__PURE__ */ c("span", {}, n)) }),
|
|
2210
|
+
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: t.documentLoading })
|
|
2235
2211
|
] });
|
|
2236
|
-
},
|
|
2237
|
-
const { reportMathDiagnostics: o, edits: i } = D(),
|
|
2238
|
-
|
|
2212
|
+
}, Kt = Object.freeze(["wheel", "touchstart", "pointerdown", "keydown"]), ml = ({ path: e, document: t, viewer: n, editing: r }) => {
|
|
2213
|
+
const { reportMathDiagnostics: o, edits: i } = D(), l = H(() => ({ htmlContent: t.htmlContent, headings: [...t.headings] }), [t]), u = Hi(), m = Ui(), f = H(() => o === void 0 ? void 0 : (a) => o(e, a), [o, e]), d = q(null), { editable: h, doubleClick: v, region: E, paneScroll: k, stale: R } = r;
|
|
2214
|
+
V(() => {
|
|
2239
2215
|
if (h)
|
|
2240
2216
|
return i.bindView(e, {
|
|
2241
2217
|
anchor: () => {
|
|
2242
|
-
const
|
|
2243
|
-
return
|
|
2218
|
+
const a = d.current, s = E(), w = a === null ? null : a.querySelector(_e);
|
|
2219
|
+
return a === null || s === null || w === null ? null : Mo(a, k.scrollerOf(s, w));
|
|
2244
2220
|
}
|
|
2245
2221
|
});
|
|
2246
2222
|
}, [i, e, h, E, k]);
|
|
2247
|
-
const T = (
|
|
2248
|
-
const s =
|
|
2249
|
-
!
|
|
2250
|
-
},
|
|
2251
|
-
|
|
2252
|
-
|
|
2223
|
+
const T = (a) => {
|
|
2224
|
+
const s = d.current, { target: w } = a;
|
|
2225
|
+
!v || s === null || !(w instanceof Element) || !Oo(w) || (a.stopPropagation(), i.start(e, Co(w, s, s.ownerDocument.getSelection())));
|
|
2226
|
+
}, N = q(null), M = q(R);
|
|
2227
|
+
V(() => {
|
|
2228
|
+
M.current = R;
|
|
2253
2229
|
});
|
|
2254
|
-
const b =
|
|
2255
|
-
const s =
|
|
2256
|
-
if (
|
|
2257
|
-
const
|
|
2258
|
-
return
|
|
2259
|
-
}),
|
|
2230
|
+
const b = le((a) => {
|
|
2231
|
+
const s = d.current, w = E(), O = s === null ? null : Po(s, a.line);
|
|
2232
|
+
if (w === null || O === null) return !1;
|
|
2233
|
+
const L = k.scrollerOf(w, O);
|
|
2234
|
+
return L.scrollTop += $o(O, a.line) - a.clientTop, !0;
|
|
2235
|
+
}), g = le((a) => {
|
|
2260
2236
|
const s = E();
|
|
2261
2237
|
if (s === null) return;
|
|
2262
|
-
const
|
|
2263
|
-
for (const
|
|
2264
|
-
|
|
2265
|
-
}, O = () =>
|
|
2266
|
-
for (const
|
|
2267
|
-
|
|
2238
|
+
const w = () => {
|
|
2239
|
+
for (const L of Kt) s.removeEventListener(L, O, !0);
|
|
2240
|
+
N.current?.release === w && (N.current = null);
|
|
2241
|
+
}, O = () => w();
|
|
2242
|
+
for (const L of Kt) s.addEventListener(L, O, { capture: !0, passive: !0 });
|
|
2243
|
+
N.current = { point: a, release: w };
|
|
2268
2244
|
});
|
|
2269
|
-
return
|
|
2270
|
-
const
|
|
2271
|
-
if (
|
|
2245
|
+
return V(() => {
|
|
2246
|
+
const a = i.takeReturn(e);
|
|
2247
|
+
if (a !== null)
|
|
2272
2248
|
return queueMicrotask(() => {
|
|
2273
|
-
b(
|
|
2274
|
-
}), () =>
|
|
2275
|
-
}, [i, e]),
|
|
2276
|
-
const
|
|
2277
|
-
|
|
2249
|
+
b(a) && M.current && g(a);
|
|
2250
|
+
}), () => N.current?.release();
|
|
2251
|
+
}, [i, e]), V(() => {
|
|
2252
|
+
const a = N.current;
|
|
2253
|
+
a === null || R || (a.release(), b(a.point));
|
|
2278
2254
|
}, [t, R]),
|
|
2279
|
-
/* @__PURE__ */
|
|
2280
|
-
},
|
|
2255
|
+
/* @__PURE__ */ c("div", { ref: d, className: "aqmx-document-viewer", onDoubleClick: T, children: /* @__PURE__ */ c(fn, { ...n, onHeadingSelect: u, headingHref: m, onMathDiagnostics: f, parseResult: l, content: null }) });
|
|
2256
|
+
}, jn = ({ document: e, viewer: t }) => {
|
|
2281
2257
|
const { labels: n } = D();
|
|
2282
|
-
return /* @__PURE__ */ $
|
|
2283
|
-
/* @__PURE__ */
|
|
2284
|
-
e.truncated ? /* @__PURE__ */
|
|
2285
|
-
/* @__PURE__ */
|
|
2258
|
+
return /* @__PURE__ */ F($e, { children: [
|
|
2259
|
+
/* @__PURE__ */ c(qe, { name: e.name, openUrl: cr(e.url), downloadUrl: e.url, icon: /* @__PURE__ */ c(wo, {}), children: e.truncated ? null : /* @__PURE__ */ c(Xo, { text: e.text }) }),
|
|
2260
|
+
e.truncated ? /* @__PURE__ */ c("p", { className: "aqmx-callout aqmx-document-notice", role: "note", "data-testid": "markdown-explorer-text-truncated", children: n.textTruncated }) : null,
|
|
2261
|
+
/* @__PURE__ */ c("div", { className: "aqmx-document-viewer", children: /* @__PURE__ */ c(fn, { ...t, parseResult: null, content: e.text }) })
|
|
2286
2262
|
] });
|
|
2287
|
-
},
|
|
2288
|
-
const { data: r, documents: o, announcer: i, labels:
|
|
2289
|
-
E(T), T.kind === "failure" && i.announce(
|
|
2263
|
+
}, Wt = ({ path: e, name: t, viewer: n }) => {
|
|
2264
|
+
const { data: r, documents: o, announcer: i, labels: l } = D(), u = P(() => o.answerStampOf(e), [o, e]), m = ee(o.subscribe, u, u), [f, d] = B(0), h = H(() => ({ path: e, stamp: m, attempt: f }), [e, m, f]), [v, E] = B(null), k = le((T) => {
|
|
2265
|
+
E(T), T.kind === "failure" && i.announce(l.documentFailed(t, ae(l, T.failure.reason)));
|
|
2290
2266
|
});
|
|
2291
2267
|
te(() => {
|
|
2292
2268
|
const T = new AbortController();
|
|
2293
|
-
return r.text(h.path, T.signal).then((
|
|
2294
|
-
"kind" in
|
|
2269
|
+
return r.text(h.path, T.signal).then((N) => {
|
|
2270
|
+
"kind" in N && k(N);
|
|
2295
2271
|
}), () => T.abort();
|
|
2296
2272
|
}, [r, h]);
|
|
2297
|
-
const R = P(() =>
|
|
2298
|
-
return
|
|
2299
|
-
/* @__PURE__ */
|
|
2300
|
-
/* @__PURE__ */
|
|
2301
|
-
] }) :
|
|
2302
|
-
},
|
|
2303
|
-
|
|
2273
|
+
const R = P(() => d((T) => T + 1), []);
|
|
2274
|
+
return v === null ? /* @__PURE__ */ F($e, { children: [
|
|
2275
|
+
/* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-markup-skeleton", children: mt.map((T) => /* @__PURE__ */ c("span", {}, T)) }),
|
|
2276
|
+
/* @__PURE__ */ c("p", { className: "aqmx-sr-only", children: l.markupLoading })
|
|
2277
|
+
] }) : v.kind === "failure" ? /* @__PURE__ */ c(ve, { scrollerProps: pt, children: /* @__PURE__ */ c(me, { failure: v.failure, alert: !1, onRetry: R, testId: "markdown-explorer-markup-failure" }) }) : /* @__PURE__ */ c(jn, { document: v, viewer: n });
|
|
2278
|
+
}, pt = Object.freeze({ className: "aqmx-document-failure", "data-aqmx-document-scroller": "" }), hl = Object.freeze({ reason: "failed" }), pl = (e) => /* @__PURE__ */ c(
|
|
2279
|
+
yo,
|
|
2304
2280
|
{
|
|
2305
|
-
fallback: (t) => /* @__PURE__ */
|
|
2306
|
-
children: /* @__PURE__ */
|
|
2281
|
+
fallback: (t) => /* @__PURE__ */ c("div", { className: "aqmx-edit-message", children: /* @__PURE__ */ c(me, { failure: hl, alert: !1, onRetry: t, testId: "markdown-explorer-edit-load-failure" }) }),
|
|
2282
|
+
children: /* @__PURE__ */ c(
|
|
2307
2283
|
ke,
|
|
2308
2284
|
{
|
|
2309
|
-
fallback: /* @__PURE__ */
|
|
2310
|
-
children: /* @__PURE__ */
|
|
2285
|
+
fallback: /* @__PURE__ */ c("div", { className: "aqmx-skeleton", "aria-hidden": "true", "data-testid": "markdown-explorer-edit-skeleton", children: mt.map((t) => /* @__PURE__ */ c("span", {}, t)) }),
|
|
2286
|
+
children: /* @__PURE__ */ c(Eo, { ...e })
|
|
2311
2287
|
}
|
|
2312
2288
|
)
|
|
2313
2289
|
}
|
|
2314
|
-
),
|
|
2290
|
+
), vl = ({ path: e, document: t, view: n, viewer: r, onRetry: o, editing: i }) => {
|
|
2315
2291
|
switch (t.kind) {
|
|
2316
2292
|
case "markdown": {
|
|
2317
|
-
const { session:
|
|
2318
|
-
if (n === "edit" &&
|
|
2319
|
-
if (n === "markup") return /* @__PURE__ */
|
|
2293
|
+
const { session: l, layout: u, region: m, paneScroll: f, stale: d } = i;
|
|
2294
|
+
if (n === "edit" && l !== void 0) return /* @__PURE__ */ c(pl, { path: e, name: t.name, session: l, layout: u, viewer: r, region: m, paneScroll: f });
|
|
2295
|
+
if (n === "markup") return /* @__PURE__ */ c(Wt, { path: e, name: t.name, viewer: r });
|
|
2320
2296
|
const h = t.edit !== null && (t.edit.kind === "inline" || t.edit.kind === "draft");
|
|
2321
|
-
return /* @__PURE__ */
|
|
2297
|
+
return /* @__PURE__ */ c(ml, { path: e, document: t, viewer: r, editing: { editable: h, doubleClick: h && u === "fill", region: m, paneScroll: f, stale: d } });
|
|
2322
2298
|
}
|
|
2323
2299
|
case "text":
|
|
2324
|
-
return /* @__PURE__ */
|
|
2300
|
+
return /* @__PURE__ */ c(jn, { document: t, viewer: r });
|
|
2325
2301
|
case "image":
|
|
2326
|
-
return /* @__PURE__ */
|
|
2302
|
+
return n === "markup" && ft(t) === "svg" ? /* @__PURE__ */ c(Wt, { path: e, name: t.name, viewer: r }) : /* @__PURE__ */ c(Ni, { document: t });
|
|
2327
2303
|
case "media":
|
|
2328
|
-
return /* @__PURE__ */
|
|
2304
|
+
return /* @__PURE__ */ c(il, { document: t });
|
|
2329
2305
|
case "file":
|
|
2330
|
-
return /* @__PURE__ */
|
|
2306
|
+
return /* @__PURE__ */ c(li, { document: t });
|
|
2331
2307
|
case "failure":
|
|
2332
|
-
return /* @__PURE__ */
|
|
2308
|
+
return /* @__PURE__ */ c(ve, { scrollerProps: pt, children: /* @__PURE__ */ c(me, { failure: t.failure, alert: !1, onRetry: o, testId: "markdown-explorer-document-failure" }) });
|
|
2333
2309
|
default: {
|
|
2334
|
-
const
|
|
2335
|
-
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(
|
|
2310
|
+
const l = t;
|
|
2311
|
+
throw new RangeError(`[markdown-explorer] unknown document kind in ${JSON.stringify(l)}`);
|
|
2336
2312
|
}
|
|
2337
2313
|
}
|
|
2338
|
-
},
|
|
2339
|
-
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null :
|
|
2314
|
+
}, gl = 'a[href], button:not(:disabled), input:not(:disabled), select:not(:disabled), textarea:not(:disabled), iframe, audio[controls], video[controls], [tabindex]:not([tabindex="-1"])', wl = (e, t, n) => {
|
|
2315
|
+
const [r] = t.kind === "markdown" ? t.headings : [], o = [n === null ? null : $n(e, n), r === void 0 ? null : Pn(e, r.id), e.querySelector(_e), e.querySelector(gl)];
|
|
2340
2316
|
for (const i of o)
|
|
2341
|
-
if (i instanceof HTMLElement &&
|
|
2317
|
+
if (i instanceof HTMLElement && Mn(i)) return i;
|
|
2342
2318
|
return null;
|
|
2343
|
-
},
|
|
2319
|
+
}, Yt = (e, t, n) => {
|
|
2344
2320
|
const { activeElement: r, body: o } = e.ownerDocument, i = r === null || r === o;
|
|
2345
|
-
t instanceof HTMLElement && n && (i || e.contains(r)) &&
|
|
2346
|
-
},
|
|
2347
|
-
const t =
|
|
2348
|
-
return
|
|
2321
|
+
t instanceof HTMLElement && n && (i || e.contains(r)) && Mn(t);
|
|
2322
|
+
}, bl = (e) => {
|
|
2323
|
+
const t = q(!1);
|
|
2324
|
+
return V(() => {
|
|
2349
2325
|
const n = e.current;
|
|
2350
2326
|
if (n === null) throw new Error("[markdown-explorer] the document region is not mounted");
|
|
2351
2327
|
const r = n.ownerDocument, o = r.defaultView;
|
|
2352
2328
|
if (o === null) throw new Error("[markdown-explorer] the document region's document has no window");
|
|
2353
|
-
let i = !1,
|
|
2354
|
-
const u = (
|
|
2355
|
-
i = !(
|
|
2329
|
+
let i = !1, l;
|
|
2330
|
+
const u = (v) => {
|
|
2331
|
+
i = !(v.target instanceof Node && n.contains(v.target)), i && !n.contains(r.activeElement) && (t.current = !1), clearTimeout(l), l = setTimeout(() => {
|
|
2356
2332
|
i = !1;
|
|
2357
2333
|
}, 0);
|
|
2358
|
-
}, m = (
|
|
2359
|
-
t.current =
|
|
2360
|
-
}, f = (
|
|
2361
|
-
|
|
2362
|
-
},
|
|
2363
|
-
const { activeElement:
|
|
2364
|
-
|
|
2334
|
+
}, m = (v) => {
|
|
2335
|
+
t.current = v.target instanceof Node && n.contains(v.target);
|
|
2336
|
+
}, f = (v) => {
|
|
2337
|
+
v.relatedTarget === null && i && (t.current = !1);
|
|
2338
|
+
}, d = () => {
|
|
2339
|
+
const { activeElement: v, body: E } = r;
|
|
2340
|
+
v !== null && v !== E && (t.current = n.contains(v));
|
|
2365
2341
|
}, h = () => {
|
|
2366
2342
|
i && !n.contains(r.activeElement) && (t.current = !1);
|
|
2367
2343
|
};
|
|
2368
|
-
return o.addEventListener("pointerdown", u, !0), o.addEventListener("mousedown", u, !0), o.addEventListener("focusin", m, !0), o.addEventListener("blur",
|
|
2369
|
-
clearTimeout(
|
|
2344
|
+
return o.addEventListener("pointerdown", u, !0), o.addEventListener("mousedown", u, !0), o.addEventListener("focusin", m, !0), o.addEventListener("blur", d), o.addEventListener("focus", h), n.addEventListener("focusout", f), () => {
|
|
2345
|
+
clearTimeout(l), o.removeEventListener("pointerdown", u, !0), o.removeEventListener("mousedown", u, !0), o.removeEventListener("focusin", m, !0), o.removeEventListener("blur", d), o.removeEventListener("focus", h), n.removeEventListener("focusout", f);
|
|
2370
2346
|
};
|
|
2371
2347
|
}, [e]), t;
|
|
2372
|
-
},
|
|
2373
|
-
const { labels: E, announcer: k, documents: R } = D(), { document: T } = t,
|
|
2348
|
+
}, El = ({ path: e, snapshot: t, markup: n, stale: r, viewer: o, editLayout: i, regionLabel: l, navigation: u, fragment: m, paneScroll: f, announces: d, announceFailure: h, onDocumentShown: v }) => {
|
|
2349
|
+
const { labels: E, announcer: k, documents: R } = D(), { document: T } = t, N = q(null), M = q(null), b = q(null), g = q(0), a = bl(N), s = q({ path: e, document: T }), w = q(null), O = P(
|
|
2374
2350
|
(Z) => {
|
|
2375
|
-
const
|
|
2376
|
-
|
|
2351
|
+
const Y = N.current, Q = jt(Y, Z, f);
|
|
2352
|
+
Y !== null && Q !== null && Yt(Y, Q, a.current);
|
|
2377
2353
|
},
|
|
2378
|
-
[f,
|
|
2379
|
-
),
|
|
2380
|
-
(Z,
|
|
2381
|
-
const Q =
|
|
2354
|
+
[f, a]
|
|
2355
|
+
), L = P(
|
|
2356
|
+
(Z, Y) => {
|
|
2357
|
+
const Q = g.current;
|
|
2382
2358
|
setTimeout(() => {
|
|
2383
|
-
!
|
|
2359
|
+
!Y.defaultPrevented && g.current === Q && O(Z);
|
|
2384
2360
|
}, 0);
|
|
2385
2361
|
},
|
|
2386
2362
|
[O]
|
|
2387
|
-
),
|
|
2363
|
+
), A = P(
|
|
2388
2364
|
(Z) => {
|
|
2389
2365
|
setTimeout(() => {
|
|
2390
2366
|
Z.defaultPrevented || O("#");
|
|
2391
2367
|
}, 0);
|
|
2392
2368
|
},
|
|
2393
2369
|
[O]
|
|
2394
|
-
),
|
|
2395
|
-
const Q =
|
|
2396
|
-
if (Q !== null && Q.path === Z && Q.snapshot ===
|
|
2397
|
-
|
|
2398
|
-
const oe =
|
|
2370
|
+
), I = H(() => ({ navigation: u, currentPath: e, scrollWithin: O, followSameUrlJump: L, followEmptyFragment: A }), [u, e, O, L, A]), K = P(() => R.retry(e), [R, e]), G = Io(R, Ii), z = Rn(e), X = z !== void 0 ? "edit" : n ? "markup" : "rendered", j = ft(T) === null ? void 0 : X, re = P(() => N.current, []), p = H(() => ({ session: z, layout: i, region: re, paneScroll: f, stale: r }), [z, i, re, f, r]), y = j === "edit" ? !1 : r, x = ne(he), C = j === "edit" && i === "fill" ? "fill" : x, $ = le((Z, Y) => {
|
|
2371
|
+
const Q = M.current;
|
|
2372
|
+
if (Q !== null && Q.path === Z && Q.snapshot === Y) return;
|
|
2373
|
+
M.current = { path: Z, snapshot: Y };
|
|
2374
|
+
const oe = Y.document;
|
|
2399
2375
|
if (oe.kind === "failure") {
|
|
2400
|
-
R.noteFailureShown(
|
|
2376
|
+
R.noteFailureShown(Y) && h(E.documentFailed(se(Z), ae(E, oe.failure.reason)));
|
|
2401
2377
|
return;
|
|
2402
2378
|
}
|
|
2403
|
-
|
|
2379
|
+
v?.(Z, oe), d && (Q === null || Q.path !== Z || Q.snapshot.document.kind === "failure") && k.announce(E.documentShown(oe.name));
|
|
2404
2380
|
});
|
|
2405
2381
|
te(() => {
|
|
2406
|
-
|
|
2382
|
+
$(e, t);
|
|
2407
2383
|
}, [e, t]);
|
|
2408
|
-
const
|
|
2384
|
+
const _ = le(() => {
|
|
2409
2385
|
m.kind === "panel" && m.consume();
|
|
2410
|
-
}),
|
|
2411
|
-
const
|
|
2412
|
-
if (
|
|
2413
|
-
const { activeElement: Q, body: oe } =
|
|
2414
|
-
return Q !== null && Q !== oe ? null :
|
|
2415
|
-
}),
|
|
2416
|
-
const
|
|
2417
|
-
|
|
2418
|
-
}), ie =
|
|
2386
|
+
}), W = le((Z) => {
|
|
2387
|
+
const Y = N.current;
|
|
2388
|
+
if (Y === null || !a.current) return null;
|
|
2389
|
+
const { activeElement: Q, body: oe } = Y.ownerDocument;
|
|
2390
|
+
return Q !== null && Q !== oe ? null : wl(Y, T, Z);
|
|
2391
|
+
}), U = le((Z) => {
|
|
2392
|
+
const Y = N.current;
|
|
2393
|
+
Y !== null && Yt(Y, Z, a.current);
|
|
2394
|
+
}), ie = le((Z) => f.reveal(Z)), gt = le((Z) => jt(N.current, Z, f));
|
|
2419
2395
|
return te(() => {
|
|
2420
2396
|
if (r) return;
|
|
2421
|
-
const Z = s.current.path !== e,
|
|
2397
|
+
const Z = s.current.path !== e, Y = Z || s.current.document !== T;
|
|
2422
2398
|
s.current = { path: e, document: T };
|
|
2423
|
-
const Q =
|
|
2424
|
-
|
|
2399
|
+
const Q = w.current !== e;
|
|
2400
|
+
w.current = e;
|
|
2425
2401
|
let oe = null;
|
|
2426
|
-
m.kind === "page" ? b.current !== m.navigation && (b.current = m.navigation,
|
|
2427
|
-
const
|
|
2428
|
-
const He = oe === null ? null :
|
|
2429
|
-
if (!
|
|
2430
|
-
He !== null &&
|
|
2402
|
+
m.kind === "page" ? b.current !== m.navigation && (b.current = m.navigation, g.current += 1, oe = m.fragment) : m.fragment !== null && (oe = m.fragment, _());
|
|
2403
|
+
const wt = () => {
|
|
2404
|
+
const He = oe === null ? null : gt(oe);
|
|
2405
|
+
if (!Y) {
|
|
2406
|
+
He !== null && U(He);
|
|
2431
2407
|
return;
|
|
2432
2408
|
}
|
|
2433
|
-
const
|
|
2434
|
-
Z && He === null &&
|
|
2409
|
+
const bt = W(m.fragment);
|
|
2410
|
+
Z && He === null && bt !== null && ie(bt);
|
|
2435
2411
|
};
|
|
2436
|
-
Q ? queueMicrotask(
|
|
2437
|
-
}, [m, e, T, r]), /* @__PURE__ */
|
|
2438
|
-
},
|
|
2412
|
+
Q ? queueMicrotask(wt) : wt();
|
|
2413
|
+
}, [m, e, T, r]), /* @__PURE__ */ c(he, { value: C, children: /* @__PURE__ */ c(Se, { kind: T.kind, view: j, label: l(e, T), stale: y, busy: y, frameRef: N, intent: G, children: /* @__PURE__ */ c(In, { value: I, children: /* @__PURE__ */ c($i, { children: /* @__PURE__ */ c(vl, { path: e, document: T, view: X, viewer: o, onRetry: K, editing: p }, e) }) }) }) });
|
|
2414
|
+
}, vt = Object.freeze({ kind: "skeleton" }), yl = (e, t, n, r, o) => {
|
|
2439
2415
|
if (t?.status === "loaded") return { kind: "document", path: e, snapshot: t, stale: !1 };
|
|
2440
2416
|
const i = ue(t);
|
|
2441
2417
|
if (i !== null) return { kind: "document", path: e, snapshot: i, stale: !0 };
|
|
2442
2418
|
if (o && t?.status === "pending") return { kind: "streaming", path: e, promise: t.promise };
|
|
2443
|
-
const
|
|
2444
|
-
return n === null ||
|
|
2445
|
-
},
|
|
2446
|
-
const o = t.kind === "streaming" ?
|
|
2447
|
-
return o.kind !== "document" ? /* @__PURE__ */
|
|
2448
|
-
},
|
|
2449
|
-
const { config:
|
|
2450
|
-
|
|
2451
|
-
|
|
2419
|
+
const l = n === null || n === e ? null : ue(r);
|
|
2420
|
+
return n === null || l === null ? vt : { kind: "document", path: n, snapshot: l, stale: !0 };
|
|
2421
|
+
}, Sl = (e, t) => t.status === "deferred" ? vt : { kind: "document", path: e, snapshot: t, stale: !1 }, xl = ({ requestedPath: e, content: t, markup: n, ...r }) => {
|
|
2422
|
+
const o = t.kind === "streaming" ? Sl(t.path, ne(t.promise)) : t;
|
|
2423
|
+
return o.kind !== "document" ? /* @__PURE__ */ c(ht, { label: r.regionLabel(e, null) }) : /* @__PURE__ */ c(El, { path: o.path, snapshot: o.snapshot, markup: n, stale: o.stale, ...r });
|
|
2424
|
+
}, zn = ({ path: e, absence: t, markup: n, display: r, navigation: o, fragment: i, paneScroll: l, announces: u, announceFailure: m, onDocumentShown: f }) => {
|
|
2425
|
+
const { config: d, labels: h, locale: v, theme: E, documents: k, data: R } = D(), T = Rr(), N = q(!1);
|
|
2426
|
+
V(() => {
|
|
2427
|
+
N.current = !0;
|
|
2452
2428
|
}, []);
|
|
2453
|
-
const [
|
|
2454
|
-
|
|
2455
|
-
const
|
|
2456
|
-
|
|
2457
|
-
const
|
|
2458
|
-
|
|
2459
|
-
const
|
|
2429
|
+
const [M, b] = B(null), [g, a] = B(n), s = P(() => e === null ? void 0 : k.peek(e), [k, e]), w = ee(k.subscribe, s, s), O = P(() => M === null ? void 0 : k.peek(M), [k, M]), L = ee(k.subscribe, O, O);
|
|
2430
|
+
V(() => e === null ? void 0 : k.open(e), [k, e]), V(() => M === null ? void 0 : k.retain(M), [k, M]);
|
|
2431
|
+
const A = e === null ? vt : yl(e, w, M, L, !N.current), I = e === null ? null : A.kind === "document" && !A.stale ? A.path : M;
|
|
2432
|
+
I !== M && b(I);
|
|
2433
|
+
const K = A.kind !== "document" || A.path === e;
|
|
2434
|
+
K && n !== g && a(n);
|
|
2435
|
+
const G = H(() => cl(h, v), [h, v]), z = H(() => ({ read: (x, C) => Di(R, x, C) }), [R]), X = H(() => [...d.iframeHosts], [d]), j = o.kind === "panel", re = H(
|
|
2460
2436
|
() => ({
|
|
2461
|
-
labels:
|
|
2462
|
-
spreadsheetLocale:
|
|
2437
|
+
labels: G,
|
|
2438
|
+
spreadsheetLocale: v,
|
|
2463
2439
|
emptyMessage: h.documentEmpty,
|
|
2464
2440
|
theme: E,
|
|
2465
|
-
availableStyles:
|
|
2466
|
-
iFrameAllowedDomains:
|
|
2467
|
-
embeds:
|
|
2468
|
-
linkComponent:
|
|
2469
|
-
toolbar:
|
|
2441
|
+
availableStyles: d.documentStyles,
|
|
2442
|
+
iFrameAllowedDomains: X,
|
|
2443
|
+
embeds: d.embeds,
|
|
2444
|
+
linkComponent: Vi,
|
|
2445
|
+
toolbar: T,
|
|
2470
2446
|
style: r.style,
|
|
2471
2447
|
onStyleChange: r.onStyleChange,
|
|
2472
2448
|
align: r.align,
|
|
@@ -2477,51 +2453,52 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2477
2453
|
padding: r.padding,
|
|
2478
2454
|
width: r.width === void 0 ? void 0 : `min(${r.width}, 100%)`,
|
|
2479
2455
|
maxWidth: r.maxWidth === void 0 ? void 0 : `min(${r.maxWidth}, 100%)`,
|
|
2480
|
-
renderScrollBar:
|
|
2456
|
+
renderScrollBar: j ? void 0 : Ln,
|
|
2457
|
+
imageSource: z
|
|
2481
2458
|
}),
|
|
2482
|
-
[
|
|
2483
|
-
),
|
|
2484
|
-
return e === null ? /* @__PURE__ */
|
|
2485
|
-
|
|
2459
|
+
[G, v, h.documentEmpty, E, d.documentStyles, X, d.embeds, T, r, j, z]
|
|
2460
|
+
), p = P((x, C) => j ? C === null || C.kind === "failure" ? se(x) : C.name : h.documentRegion, [j, h.documentRegion]), y = j ? "content" : "fill";
|
|
2461
|
+
return e === null ? /* @__PURE__ */ c(he, { value: y, children: /* @__PURE__ */ c(fl, { absence: t, announces: u, announceFailure: m }) }) : /* @__PURE__ */ c(he, { value: y, children: /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c(ht, { label: p(e, null) }), children: /* @__PURE__ */ c(
|
|
2462
|
+
xl,
|
|
2486
2463
|
{
|
|
2487
2464
|
requestedPath: e,
|
|
2488
|
-
content:
|
|
2489
|
-
markup:
|
|
2490
|
-
viewer:
|
|
2465
|
+
content: A,
|
|
2466
|
+
markup: K ? n : g,
|
|
2467
|
+
viewer: re,
|
|
2491
2468
|
editLayout: r.editLayout,
|
|
2492
|
-
regionLabel:
|
|
2469
|
+
regionLabel: p,
|
|
2493
2470
|
navigation: o,
|
|
2494
2471
|
fragment: i,
|
|
2495
|
-
paneScroll:
|
|
2472
|
+
paneScroll: l,
|
|
2496
2473
|
announces: u,
|
|
2497
2474
|
announceFailure: m,
|
|
2498
2475
|
onDocumentShown: f
|
|
2499
2476
|
}
|
|
2500
2477
|
) }) });
|
|
2501
|
-
},
|
|
2502
|
-
const { config: i, viewSettings:
|
|
2503
|
-
(
|
|
2504
|
-
if (
|
|
2505
|
-
const
|
|
2506
|
-
|
|
2478
|
+
}, kl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
|
|
2479
|
+
const { config: i, viewSettings: l, announcer: u } = D(), m = Ne((L) => L.style), f = Ne((L) => L.align), d = Ie(), h = sn(), v = st(), { view: E, overrides: k, embed: R } = r, T = P(
|
|
2480
|
+
(L) => {
|
|
2481
|
+
if (v.kind !== "location") return;
|
|
2482
|
+
const A = ul(i, v.location, L);
|
|
2483
|
+
A !== null && d(A, "browse");
|
|
2507
2484
|
},
|
|
2508
|
-
[i,
|
|
2509
|
-
),
|
|
2510
|
-
(
|
|
2511
|
-
|
|
2485
|
+
[i, d, v]
|
|
2486
|
+
), N = P(
|
|
2487
|
+
(L) => {
|
|
2488
|
+
l.update({ style: L }), T("style");
|
|
2512
2489
|
},
|
|
2513
|
-
[
|
|
2514
|
-
),
|
|
2515
|
-
(
|
|
2516
|
-
|
|
2490
|
+
[l, T]
|
|
2491
|
+
), M = P(
|
|
2492
|
+
(L) => {
|
|
2493
|
+
l.update({ align: L }), T("align");
|
|
2517
2494
|
},
|
|
2518
|
-
[
|
|
2519
|
-
), b =
|
|
2495
|
+
[l, T]
|
|
2496
|
+
), b = _n(i, k.style, m), g = Bn(k.align, f), a = H(
|
|
2520
2497
|
() => ({
|
|
2521
2498
|
style: b,
|
|
2522
|
-
onStyleChange:
|
|
2523
|
-
align:
|
|
2524
|
-
onAlignChange:
|
|
2499
|
+
onStyleChange: N,
|
|
2500
|
+
align: g,
|
|
2501
|
+
onAlignChange: M,
|
|
2525
2502
|
showToc: R.showToc !== !1,
|
|
2526
2503
|
showStyle: R.showStyle !== !1,
|
|
2527
2504
|
showAlign: R.showAlign !== !1,
|
|
@@ -2530,16 +2507,16 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2530
2507
|
maxWidth: R.maxWidth,
|
|
2531
2508
|
editLayout: "fill"
|
|
2532
2509
|
}),
|
|
2533
|
-
[b,
|
|
2534
|
-
), s =
|
|
2535
|
-
return /* @__PURE__ */
|
|
2536
|
-
},
|
|
2537
|
-
const { config: i, viewSettings:
|
|
2510
|
+
[b, N, g, M, R]
|
|
2511
|
+
), s = H(() => ({ kind: "page", view: E, overrides: k, embed: R }), [E, k, R]), w = H(() => ({ kind: "page", fragment: h.hash, navigation: h }), [h]), O = P((L) => u.announce(L), [u]);
|
|
2512
|
+
return /* @__PURE__ */ c(zn, { path: e, absence: t, markup: n, display: a, navigation: s, fragment: w, paneScroll: mi, announces: !0, announceFailure: O, onDocumentShown: o });
|
|
2513
|
+
}, Tl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => {
|
|
2514
|
+
const { config: i, viewSettings: l } = D(), u = Ne((s) => s.style), m = Ne((s) => s.align), [f, d] = B(() => _n(i, void 0, u)), h = Bn(void 0, m), v = P((s) => l.update({ align: s }), [l]), { maximized: E, onDocumentLink: k, pendingHash: R, onHashConsumed: T, announceFailure: N, paneScroll: M } = r, b = H(
|
|
2538
2515
|
() => ({
|
|
2539
2516
|
style: f,
|
|
2540
|
-
onStyleChange:
|
|
2517
|
+
onStyleChange: d,
|
|
2541
2518
|
align: h,
|
|
2542
|
-
onAlignChange:
|
|
2519
|
+
onAlignChange: v,
|
|
2543
2520
|
showToc: E,
|
|
2544
2521
|
showStyle: E,
|
|
2545
2522
|
showAlign: E,
|
|
@@ -2548,16 +2525,16 @@ const Hi = /* @__PURE__ */ y.forwardRef(ji), Vi = Object.freeze({ className: "aq
|
|
|
2548
2525
|
maxWidth: void 0,
|
|
2549
2526
|
editLayout: E ? "fill" : "content"
|
|
2550
2527
|
}),
|
|
2551
|
-
[f, h,
|
|
2552
|
-
),
|
|
2553
|
-
return /* @__PURE__ */
|
|
2554
|
-
},
|
|
2555
|
-
function
|
|
2528
|
+
[f, h, v, E]
|
|
2529
|
+
), g = H(() => ({ kind: "panel", onDocumentLink: k }), [k]), a = H(() => ({ kind: "panel", fragment: R, consume: T }), [R, T]);
|
|
2530
|
+
return /* @__PURE__ */ c(zn, { path: e, absence: t, markup: n, display: b, navigation: g, fragment: a, paneScroll: M, announces: !1, announceFailure: N, onDocumentShown: o });
|
|
2531
|
+
}, Rl = ({ path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) => r.kind === "page" ? /* @__PURE__ */ c(kl, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o }) : /* @__PURE__ */ c(Tl, { path: e, absence: t, markup: n, variant: r, onDocumentShown: o });
|
|
2532
|
+
function Ol({
|
|
2556
2533
|
title: e,
|
|
2557
2534
|
titleId: t,
|
|
2558
2535
|
...n
|
|
2559
2536
|
}, r) {
|
|
2560
|
-
return /* @__PURE__ */
|
|
2537
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2561
2538
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2562
2539
|
viewBox: "0 0 24 24",
|
|
2563
2540
|
fill: "currentColor",
|
|
@@ -2565,21 +2542,21 @@ function wa({
|
|
|
2565
2542
|
"data-slot": "icon",
|
|
2566
2543
|
ref: r,
|
|
2567
2544
|
"aria-labelledby": t
|
|
2568
|
-
}, n), e ? /* @__PURE__ */
|
|
2545
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2569
2546
|
id: t
|
|
2570
|
-
}, e) : null, /* @__PURE__ */
|
|
2547
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2571
2548
|
fillRule: "evenodd",
|
|
2572
2549
|
d: "M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z",
|
|
2573
2550
|
clipRule: "evenodd"
|
|
2574
2551
|
}));
|
|
2575
2552
|
}
|
|
2576
|
-
const
|
|
2577
|
-
function
|
|
2553
|
+
const Cl = /* @__PURE__ */ S.forwardRef(Ol);
|
|
2554
|
+
function Ml({
|
|
2578
2555
|
title: e,
|
|
2579
2556
|
titleId: t,
|
|
2580
2557
|
...n
|
|
2581
2558
|
}, r) {
|
|
2582
|
-
return /* @__PURE__ */
|
|
2559
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2583
2560
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2584
2561
|
viewBox: "0 0 24 24",
|
|
2585
2562
|
fill: "currentColor",
|
|
@@ -2587,21 +2564,21 @@ function ba({
|
|
|
2587
2564
|
"data-slot": "icon",
|
|
2588
2565
|
ref: r,
|
|
2589
2566
|
"aria-labelledby": t
|
|
2590
|
-
}, n), e ? /* @__PURE__ */
|
|
2567
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2591
2568
|
id: t
|
|
2592
|
-
}, e) : null, /* @__PURE__ */
|
|
2569
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2593
2570
|
fillRule: "evenodd",
|
|
2594
2571
|
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",
|
|
2595
2572
|
clipRule: "evenodd"
|
|
2596
2573
|
}));
|
|
2597
2574
|
}
|
|
2598
|
-
const
|
|
2599
|
-
function
|
|
2575
|
+
const Vn = /* @__PURE__ */ S.forwardRef(Ml);
|
|
2576
|
+
function Ll({
|
|
2600
2577
|
title: e,
|
|
2601
2578
|
titleId: t,
|
|
2602
2579
|
...n
|
|
2603
2580
|
}, r) {
|
|
2604
|
-
return /* @__PURE__ */
|
|
2581
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2605
2582
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2606
2583
|
viewBox: "0 0 24 24",
|
|
2607
2584
|
fill: "currentColor",
|
|
@@ -2609,21 +2586,21 @@ function Ea({
|
|
|
2609
2586
|
"data-slot": "icon",
|
|
2610
2587
|
ref: r,
|
|
2611
2588
|
"aria-labelledby": t
|
|
2612
|
-
}, n), e ? /* @__PURE__ */
|
|
2589
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2613
2590
|
id: t
|
|
2614
|
-
}, e) : null, /* @__PURE__ */
|
|
2591
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2615
2592
|
fillRule: "evenodd",
|
|
2616
2593
|
d: "M15.75 2.25H21a.75.75 0 0 1 .75.75v5.25a.75.75 0 0 1-1.5 0V4.81L8.03 17.03a.75.75 0 0 1-1.06-1.06L19.19 3.75h-3.44a.75.75 0 0 1 0-1.5Zm-10.5 4.5a1.5 1.5 0 0 0-1.5 1.5v10.5a1.5 1.5 0 0 0 1.5 1.5h10.5a1.5 1.5 0 0 0 1.5-1.5V10.5a.75.75 0 0 1 1.5 0v8.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V8.25a3 3 0 0 1 3-3h8.25a.75.75 0 0 1 0 1.5H5.25Z",
|
|
2617
2594
|
clipRule: "evenodd"
|
|
2618
2595
|
}));
|
|
2619
2596
|
}
|
|
2620
|
-
const
|
|
2621
|
-
function
|
|
2597
|
+
const Al = /* @__PURE__ */ S.forwardRef(Ll);
|
|
2598
|
+
function Nl({
|
|
2622
2599
|
title: e,
|
|
2623
2600
|
titleId: t,
|
|
2624
2601
|
...n
|
|
2625
2602
|
}, r) {
|
|
2626
|
-
return /* @__PURE__ */
|
|
2603
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2627
2604
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2628
2605
|
viewBox: "0 0 24 24",
|
|
2629
2606
|
fill: "currentColor",
|
|
@@ -2631,25 +2608,25 @@ function ya({
|
|
|
2631
2608
|
"data-slot": "icon",
|
|
2632
2609
|
ref: r,
|
|
2633
2610
|
"aria-labelledby": t
|
|
2634
|
-
}, n), e ? /* @__PURE__ */
|
|
2611
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2635
2612
|
id: t
|
|
2636
|
-
}, e) : null, /* @__PURE__ */
|
|
2613
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2637
2614
|
fillRule: "evenodd",
|
|
2638
2615
|
d: "M11.47 13.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 0 0-1.06-1.06L12 11.69 5.03 4.72a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
|
|
2639
2616
|
clipRule: "evenodd"
|
|
2640
|
-
}), /* @__PURE__ */
|
|
2617
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
2641
2618
|
fillRule: "evenodd",
|
|
2642
2619
|
d: "M11.47 19.28a.75.75 0 0 0 1.06 0l7.5-7.5a.75.75 0 1 0-1.06-1.06L12 17.69l-6.97-6.97a.75.75 0 0 0-1.06 1.06l7.5 7.5Z",
|
|
2643
2620
|
clipRule: "evenodd"
|
|
2644
2621
|
}));
|
|
2645
2622
|
}
|
|
2646
|
-
const
|
|
2647
|
-
function
|
|
2623
|
+
const Dl = /* @__PURE__ */ S.forwardRef(Nl);
|
|
2624
|
+
function Pl({
|
|
2648
2625
|
title: e,
|
|
2649
2626
|
titleId: t,
|
|
2650
2627
|
...n
|
|
2651
2628
|
}, r) {
|
|
2652
|
-
return /* @__PURE__ */
|
|
2629
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2653
2630
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2654
2631
|
viewBox: "0 0 24 24",
|
|
2655
2632
|
fill: "currentColor",
|
|
@@ -2657,21 +2634,21 @@ function ka({
|
|
|
2657
2634
|
"data-slot": "icon",
|
|
2658
2635
|
ref: r,
|
|
2659
2636
|
"aria-labelledby": t
|
|
2660
|
-
}, n), e ? /* @__PURE__ */
|
|
2637
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2661
2638
|
id: t
|
|
2662
|
-
}, e) : null, /* @__PURE__ */
|
|
2639
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2663
2640
|
fillRule: "evenodd",
|
|
2664
2641
|
d: "M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v6c0 .414.336.75.75.75h4.5a.75.75 0 0 0 0-1.5h-3.75V6Z",
|
|
2665
2642
|
clipRule: "evenodd"
|
|
2666
2643
|
}));
|
|
2667
2644
|
}
|
|
2668
|
-
const
|
|
2669
|
-
function
|
|
2645
|
+
const $l = /* @__PURE__ */ S.forwardRef(Pl);
|
|
2646
|
+
function Fl({
|
|
2670
2647
|
title: e,
|
|
2671
2648
|
titleId: t,
|
|
2672
2649
|
...n
|
|
2673
2650
|
}, r) {
|
|
2674
|
-
return /* @__PURE__ */
|
|
2651
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2675
2652
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2676
2653
|
viewBox: "0 0 24 24",
|
|
2677
2654
|
fill: "currentColor",
|
|
@@ -2679,23 +2656,23 @@ function Ra({
|
|
|
2679
2656
|
"data-slot": "icon",
|
|
2680
2657
|
ref: r,
|
|
2681
2658
|
"aria-labelledby": t
|
|
2682
|
-
}, n), e ? /* @__PURE__ */
|
|
2659
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2683
2660
|
id: t
|
|
2684
|
-
}, e) : null, /* @__PURE__ */
|
|
2661
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2685
2662
|
fillRule: "evenodd",
|
|
2686
2663
|
d: "M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",
|
|
2687
2664
|
clipRule: "evenodd"
|
|
2688
|
-
}), /* @__PURE__ */
|
|
2665
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
2689
2666
|
d: "M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"
|
|
2690
2667
|
}));
|
|
2691
2668
|
}
|
|
2692
|
-
const
|
|
2693
|
-
function
|
|
2669
|
+
const Il = /* @__PURE__ */ S.forwardRef(Fl);
|
|
2670
|
+
function ql({
|
|
2694
2671
|
title: e,
|
|
2695
2672
|
titleId: t,
|
|
2696
2673
|
...n
|
|
2697
2674
|
}, r) {
|
|
2698
|
-
return /* @__PURE__ */
|
|
2675
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2699
2676
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2700
2677
|
viewBox: "0 0 24 24",
|
|
2701
2678
|
fill: "currentColor",
|
|
@@ -2703,23 +2680,23 @@ function Ca({
|
|
|
2703
2680
|
"data-slot": "icon",
|
|
2704
2681
|
ref: r,
|
|
2705
2682
|
"aria-labelledby": t
|
|
2706
|
-
}, n), e ? /* @__PURE__ */
|
|
2683
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2707
2684
|
id: t
|
|
2708
|
-
}, e) : null, /* @__PURE__ */
|
|
2685
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2709
2686
|
d: "M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"
|
|
2710
|
-
}), /* @__PURE__ */
|
|
2687
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
2711
2688
|
fillRule: "evenodd",
|
|
2712
2689
|
d: "M1.323 11.447C2.811 6.976 7.028 3.75 12.001 3.75c4.97 0 9.185 3.223 10.675 7.69.12.362.12.752 0 1.113-1.487 4.471-5.705 7.697-10.677 7.697-4.97 0-9.186-3.223-10.675-7.69a1.762 1.762 0 0 1 0-1.113ZM17.25 12a5.25 5.25 0 1 1-10.5 0 5.25 5.25 0 0 1 10.5 0Z",
|
|
2713
2690
|
clipRule: "evenodd"
|
|
2714
2691
|
}));
|
|
2715
2692
|
}
|
|
2716
|
-
const
|
|
2717
|
-
function
|
|
2693
|
+
const _l = /* @__PURE__ */ S.forwardRef(ql);
|
|
2694
|
+
function Bl({
|
|
2718
2695
|
title: e,
|
|
2719
2696
|
titleId: t,
|
|
2720
2697
|
...n
|
|
2721
2698
|
}, r) {
|
|
2722
|
-
return /* @__PURE__ */
|
|
2699
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2723
2700
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2724
2701
|
viewBox: "0 0 24 24",
|
|
2725
2702
|
fill: "currentColor",
|
|
@@ -2727,21 +2704,21 @@ function Aa({
|
|
|
2727
2704
|
"data-slot": "icon",
|
|
2728
2705
|
ref: r,
|
|
2729
2706
|
"aria-labelledby": t
|
|
2730
|
-
}, n), e ? /* @__PURE__ */
|
|
2707
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2731
2708
|
id: t
|
|
2732
|
-
}, e) : null, /* @__PURE__ */
|
|
2709
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2733
2710
|
d: "M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"
|
|
2734
|
-
}), /* @__PURE__ */
|
|
2711
|
+
}), /* @__PURE__ */ S.createElement("path", {
|
|
2735
2712
|
d: "M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"
|
|
2736
2713
|
}));
|
|
2737
2714
|
}
|
|
2738
|
-
const
|
|
2739
|
-
function
|
|
2715
|
+
const jl = /* @__PURE__ */ S.forwardRef(Bl);
|
|
2716
|
+
function zl({
|
|
2740
2717
|
title: e,
|
|
2741
2718
|
titleId: t,
|
|
2742
2719
|
...n
|
|
2743
2720
|
}, r) {
|
|
2744
|
-
return /* @__PURE__ */
|
|
2721
|
+
return /* @__PURE__ */ S.createElement("svg", Object.assign({
|
|
2745
2722
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2746
2723
|
viewBox: "0 0 24 24",
|
|
2747
2724
|
fill: "currentColor",
|
|
@@ -2749,99 +2726,99 @@ function Na({
|
|
|
2749
2726
|
"data-slot": "icon",
|
|
2750
2727
|
ref: r,
|
|
2751
2728
|
"aria-labelledby": t
|
|
2752
|
-
}, n), e ? /* @__PURE__ */
|
|
2729
|
+
}, n), e ? /* @__PURE__ */ S.createElement("title", {
|
|
2753
2730
|
id: t
|
|
2754
|
-
}, e) : null, /* @__PURE__ */
|
|
2731
|
+
}, e) : null, /* @__PURE__ */ S.createElement("path", {
|
|
2755
2732
|
d: "M15 3.75H9v16.5h6V3.75ZM16.5 20.25h3.375c1.035 0 1.875-.84 1.875-1.875V5.625c0-1.036-.84-1.875-1.875-1.875H16.5v16.5ZM4.125 3.75H7.5v16.5H4.125a1.875 1.875 0 0 1-1.875-1.875V5.625c0-1.036.84-1.875 1.875-1.875Z"
|
|
2756
2733
|
}));
|
|
2757
2734
|
}
|
|
2758
|
-
const
|
|
2759
|
-
const { labels: r, onEditGrant: o } = D(), [i,
|
|
2760
|
-
o === void 0 || i || (
|
|
2735
|
+
const Vl = /* @__PURE__ */ S.forwardRef(zl), Hl = ({ href: e, onRetry: t, testId: n }) => {
|
|
2736
|
+
const { labels: r, onEditGrant: o } = D(), [i, l] = B(!1), u = () => {
|
|
2737
|
+
o === void 0 || i || (l(!0), o(e).then((m) => {
|
|
2761
2738
|
m && t();
|
|
2762
|
-
}).finally(() =>
|
|
2739
|
+
}).finally(() => l(!1)));
|
|
2763
2740
|
};
|
|
2764
|
-
return /* @__PURE__ */
|
|
2765
|
-
/* @__PURE__ */
|
|
2766
|
-
/* @__PURE__ */
|
|
2767
|
-
/* @__PURE__ */
|
|
2768
|
-
o === void 0 ? /* @__PURE__ */
|
|
2769
|
-
/* @__PURE__ */
|
|
2741
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-callout aqmx-edit-grant", "data-testid": n, children: [
|
|
2742
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-title", children: r.editGrantTitle }),
|
|
2743
|
+
/* @__PURE__ */ c("p", { className: "aqmx-callout-body", children: r.editGrantBody }),
|
|
2744
|
+
/* @__PURE__ */ F("div", { className: "aqmx-edit-grant-actions", children: [
|
|
2745
|
+
o === void 0 ? /* @__PURE__ */ c("a", { className: "aqmx-callout-action", href: e, target: "_blank", rel: "noopener", "data-testid": `${n}-open`, children: r.editGrantAction }) : (
|
|
2746
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": i, "data-testid": `${n}-open`, onClick: u, children: r.editGrantAction })
|
|
2770
2747
|
),
|
|
2771
|
-
/* @__PURE__ */
|
|
2748
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": `${n}-retry`, onClick: t, children: r.editGrantRetry })
|
|
2772
2749
|
] })
|
|
2773
2750
|
] });
|
|
2774
|
-
},
|
|
2751
|
+
}, Ul = "Control+E Meta+E", Zl = (e, t, n) => n && t ? "split" : e.view, Xt = (e, t, n, r) => {
|
|
2775
2752
|
if (n === "split") {
|
|
2776
2753
|
e.setSideBySide(!0);
|
|
2777
2754
|
return;
|
|
2778
2755
|
}
|
|
2779
2756
|
e.setView(t, n), r && e.sideBySide() && e.setSideBySide(!1);
|
|
2780
|
-
},
|
|
2757
|
+
}, as = (e) => e === "split" ? null : e, Gl = (e) => e === "preview" ? "editor" : "preview", Kl = (e) => /Mac|iPhone|iPad|iPod/u.test(e), Wl = (e, t) => {
|
|
2781
2758
|
if (e.isComposing || e.altKey || e.shiftKey || (t ? !e.metaKey || e.ctrlKey : !e.ctrlKey || e.metaKey)) return !1;
|
|
2782
2759
|
const n = e.key.toLowerCase();
|
|
2783
2760
|
return n === "e" || e.code === "KeyE" && /^\p{L}$/u.test(n) && !/^[a-z]$/u.test(n);
|
|
2784
|
-
},
|
|
2761
|
+
}, Jt = (e, t, n) => {
|
|
2785
2762
|
const r = e.modifiedAt === null ? Number.NaN : Date.parse(e.modifiedAt);
|
|
2786
2763
|
return n(Number.isNaN(r) ? e.id : t.format(r), e.author === null ? "" : e.author);
|
|
2787
|
-
},
|
|
2788
|
-
const { data: o, edits: i, labels:
|
|
2789
|
-
R(null),
|
|
2790
|
-
}, []),
|
|
2764
|
+
}, Yl = ({ path: e, documentName: t, open: n, onClose: r }) => {
|
|
2765
|
+
const { data: o, edits: i, labels: l, locale: u, announcer: m } = D(), f = xe(), [d, h] = B(null), [v, E] = B(0), [k, R] = B(null), [T, N] = B(null), M = H(() => new Intl.DateTimeFormat(u, { dateStyle: "medium", timeStyle: "short" }), [u]), b = P(() => {
|
|
2766
|
+
R(null), N(null);
|
|
2767
|
+
}, []), g = xn({ open: n, onOpen: b, onDismiss: r });
|
|
2791
2768
|
te(() => {
|
|
2792
2769
|
if (!n) return;
|
|
2793
|
-
const
|
|
2794
|
-
return h(null), o.revisions(e,
|
|
2770
|
+
const w = new AbortController();
|
|
2771
|
+
return h(null), o.revisions(e, w.signal).then((O) => {
|
|
2795
2772
|
"kind" in O && h(O);
|
|
2796
|
-
}), () =>
|
|
2797
|
-
}, [n, o, e,
|
|
2773
|
+
}), () => w.abort();
|
|
2774
|
+
}, [n, o, e, v]), te(() => {
|
|
2798
2775
|
if (!n || k === null) return;
|
|
2799
|
-
const
|
|
2800
|
-
return
|
|
2801
|
-
"kind" in O &&
|
|
2802
|
-
}), () =>
|
|
2776
|
+
const w = new AbortController();
|
|
2777
|
+
return N(null), o.revision(e, k, w.signal).then((O) => {
|
|
2778
|
+
"kind" in O && N(O);
|
|
2779
|
+
}), () => w.abort();
|
|
2803
2780
|
}, [n, o, e, k]);
|
|
2804
|
-
const
|
|
2805
|
-
T === null || T.kind !== "revision" || (i.replaceDraft(e, T.text), m.announce(
|
|
2806
|
-
}, s =
|
|
2807
|
-
return /* @__PURE__ */
|
|
2808
|
-
/* @__PURE__ */
|
|
2809
|
-
|
|
2810
|
-
/* @__PURE__ */
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
] }) },
|
|
2814
|
-
k === null ? null : T === null ? /* @__PURE__ */
|
|
2815
|
-
/* @__PURE__ */
|
|
2781
|
+
const a = () => {
|
|
2782
|
+
T === null || T.kind !== "revision" || (i.replaceDraft(e, T.text), m.announce(l.historyRestored(t)), r());
|
|
2783
|
+
}, s = d !== null && d.kind === "revisions" ? d.revisions.find((w) => w.id === k) : void 0;
|
|
2784
|
+
return /* @__PURE__ */ c("dialog", { ...g, className: "aqmx-confirm aqmx-history", "aria-labelledby": f, "data-testid": "markdown-explorer-history", children: /* @__PURE__ */ F("div", { className: "aqmx-confirm-panel aqmx-history-panel", children: [
|
|
2785
|
+
/* @__PURE__ */ c("p", { id: f, className: "aqmx-confirm-title", children: l.historyTitle(t) }),
|
|
2786
|
+
d === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-loading", children: l.historyLoading }) : d.kind === "failure" ? /* @__PURE__ */ c(me, { failure: d.failure, alert: !1, onRetry: () => E((w) => w + 1), testId: "markdown-explorer-history-failure" }) : d.revisions.length === 0 ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", "data-testid": "markdown-explorer-history-empty", children: l.historyEmpty }) : /* @__PURE__ */ c("ul", { className: "aqmx-history-list", "data-testid": "markdown-explorer-history-list", children: d.revisions.map((w) => /* @__PURE__ */ c("li", { children: /* @__PURE__ */ F("button", { type: "button", className: "aqmx-history-entry", "aria-pressed": w.id === k, "data-testid": "markdown-explorer-history-entry", onClick: () => R(w.id), children: [
|
|
2787
|
+
/* @__PURE__ */ c("span", { children: Jt(w, M, l.historyEntry) }),
|
|
2788
|
+
w.current ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyCurrent }) : null,
|
|
2789
|
+
w.kept ? /* @__PURE__ */ c("span", { className: "aqmx-history-mark", children: l.historyKept }) : null
|
|
2790
|
+
] }) }, w.id)) }),
|
|
2791
|
+
k === null ? null : T === null ? /* @__PURE__ */ c("p", { className: "aqmx-history-note", children: l.historyLoading }) : T.kind === "failure" ? /* @__PURE__ */ c(me, { failure: T.failure, alert: !1, testId: "markdown-explorer-history-revision-failure" }) : (
|
|
2792
|
+
/* @__PURE__ */ c("section", { className: "aqmx-history-text", tabIndex: 0, "aria-label": s === void 0 ? l.historyTitle(t) : Jt(s, M, l.historyEntry), "data-testid": "markdown-explorer-history-text", children: /* @__PURE__ */ c("pre", { children: T.text }) })
|
|
2816
2793
|
),
|
|
2817
|
-
/* @__PURE__ */
|
|
2818
|
-
/* @__PURE__ */
|
|
2819
|
-
/* @__PURE__ */
|
|
2794
|
+
/* @__PURE__ */ F("div", { className: "aqmx-confirm-actions", children: [
|
|
2795
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "data-testid": "markdown-explorer-history-close", onClick: r, children: l.historyClose }),
|
|
2796
|
+
/* @__PURE__ */ c("button", { type: "button", className: "aqmx-callout-action", "aria-disabled": T === null || T.kind !== "revision", "data-testid": "markdown-explorer-history-restore", onClick: a, children: l.historyRestore })
|
|
2820
2797
|
] })
|
|
2821
2798
|
] }) });
|
|
2822
|
-
},
|
|
2799
|
+
}, Xl = (e) => {
|
|
2823
2800
|
const { documents: t } = D(), n = P(() => t.peek(e), [t, e]), r = P(() => t.peekSeeded(e), [t, e]), o = ee(t.subscribe, n, r), i = ue(o)?.document;
|
|
2824
2801
|
return i === void 0 || i.kind === "failure" ? { edit: null, name: se(e) } : { edit: i.kind === "markdown" ? i.edit : null, name: i.name };
|
|
2825
|
-
},
|
|
2802
|
+
}, ce = (e) => {
|
|
2826
2803
|
e.stopPropagation();
|
|
2827
|
-
},
|
|
2828
|
-
const { draftConverter: i, edits:
|
|
2829
|
-
|
|
2830
|
-
() =>
|
|
2804
|
+
}, Jl = ({ path: e, documentName: t, iconOnly: n, previewAvailable: r, draft: o }) => {
|
|
2805
|
+
const { draftConverter: i, edits: l, labels: u } = D(), m = ee(
|
|
2806
|
+
l.subscribe,
|
|
2807
|
+
() => l.session(e) !== void 0,
|
|
2831
2808
|
() => !1
|
|
2832
|
-
), [f,
|
|
2809
|
+
), [f, d] = B(null), h = () => {
|
|
2833
2810
|
if (!m) {
|
|
2834
|
-
|
|
2811
|
+
l.start(e, l.viewAnchor(e));
|
|
2835
2812
|
return;
|
|
2836
2813
|
}
|
|
2837
|
-
|
|
2838
|
-
const R =
|
|
2839
|
-
R?.dirty === !0 ?
|
|
2840
|
-
},
|
|
2841
|
-
m || (
|
|
2814
|
+
l.flush(e);
|
|
2815
|
+
const R = l.session(e);
|
|
2816
|
+
R?.dirty === !0 ? d(R.save.kind === "draft" ? "draft" : "unsaved") : l.close(e);
|
|
2817
|
+
}, v = () => {
|
|
2818
|
+
m || (bo(), r && l.sideBySide() && i?.prepare?.());
|
|
2842
2819
|
}, E = n ? o ? u.editDraftDocumentNamed(t) : u.editDocumentNamed(t) : null, k = o ? u.editDraftDocument : u.editDocument;
|
|
2843
|
-
return /* @__PURE__ */ $
|
|
2844
|
-
/* @__PURE__ */
|
|
2820
|
+
return /* @__PURE__ */ F($e, { children: [
|
|
2821
|
+
/* @__PURE__ */ F(
|
|
2845
2822
|
"button",
|
|
2846
2823
|
{
|
|
2847
2824
|
type: "button",
|
|
@@ -2851,17 +2828,17 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
2851
2828
|
"aria-pressed": m,
|
|
2852
2829
|
"data-testid": "markdown-explorer-document-edit",
|
|
2853
2830
|
onClick: h,
|
|
2854
|
-
onDoubleClick:
|
|
2855
|
-
onPointerEnter:
|
|
2856
|
-
onFocus:
|
|
2831
|
+
onDoubleClick: ce,
|
|
2832
|
+
onPointerEnter: v,
|
|
2833
|
+
onFocus: v,
|
|
2857
2834
|
children: [
|
|
2858
|
-
/* @__PURE__ */
|
|
2859
|
-
E === null ? /* @__PURE__ */
|
|
2835
|
+
/* @__PURE__ */ c(jl, { "aria-hidden": "true" }),
|
|
2836
|
+
E === null ? /* @__PURE__ */ c("span", { children: u.editDocumentLabel }) : null
|
|
2860
2837
|
]
|
|
2861
2838
|
}
|
|
2862
2839
|
),
|
|
2863
|
-
/* @__PURE__ */
|
|
2864
|
-
|
|
2840
|
+
/* @__PURE__ */ c(
|
|
2841
|
+
kn,
|
|
2865
2842
|
{
|
|
2866
2843
|
open: f !== null,
|
|
2867
2844
|
title: f === "draft" ? u.draftDiscardTitle : u.unsavedTitle,
|
|
@@ -2870,15 +2847,15 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
2870
2847
|
cancelLabel: u.unsavedStay,
|
|
2871
2848
|
testId: "markdown-explorer-edit-close-confirm",
|
|
2872
2849
|
onConfirm: () => {
|
|
2873
|
-
|
|
2850
|
+
d(null), l.close(e);
|
|
2874
2851
|
},
|
|
2875
|
-
onCancel: () =>
|
|
2852
|
+
onCancel: () => d(null)
|
|
2876
2853
|
}
|
|
2877
2854
|
)
|
|
2878
2855
|
] });
|
|
2879
|
-
},
|
|
2856
|
+
}, Ql = ({ href: e, documentName: t, iconOnly: n }) => {
|
|
2880
2857
|
const { labels: r } = D(), o = n ? r.editExternallyNamed(t) : null;
|
|
2881
|
-
return /* @__PURE__ */
|
|
2858
|
+
return /* @__PURE__ */ F(
|
|
2882
2859
|
"a",
|
|
2883
2860
|
{
|
|
2884
2861
|
className: o === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
@@ -2888,144 +2865,138 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
2888
2865
|
title: o === null ? r.editExternally : o,
|
|
2889
2866
|
"aria-label": o === null ? void 0 : o,
|
|
2890
2867
|
"data-testid": "markdown-explorer-document-edit-external",
|
|
2891
|
-
onDoubleClick:
|
|
2868
|
+
onDoubleClick: ce,
|
|
2892
2869
|
children: [
|
|
2893
|
-
/* @__PURE__ */
|
|
2894
|
-
o === null ? /* @__PURE__ */
|
|
2870
|
+
/* @__PURE__ */ c(Al, { "aria-hidden": "true" }),
|
|
2871
|
+
o === null ? /* @__PURE__ */ c("span", { children: r.editExternallyLabel }) : null
|
|
2895
2872
|
]
|
|
2896
2873
|
}
|
|
2897
2874
|
);
|
|
2898
|
-
},
|
|
2899
|
-
const { labels: t } = D(), n =
|
|
2900
|
-
return /* @__PURE__ */
|
|
2901
|
-
},
|
|
2902
|
-
const { draftConverter: i, edits:
|
|
2875
|
+
}, ea = ({ session: e }) => {
|
|
2876
|
+
const { labels: t } = D(), n = jr(t, e);
|
|
2877
|
+
return /* @__PURE__ */ c("p", { className: "aqmx-edit-status", title: n === "" ? void 0 : n, "data-testid": "markdown-explorer-edit-status", "data-aqmx-save": e.save.kind, children: n });
|
|
2878
|
+
}, ta = Object.freeze(["editor", "split", "preview"]), na = Object.freeze(["editor", "preview"]), ra = Object.freeze({ editor: Vn, split: Vl, preview: _l }), oa = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2879
|
+
const { draftConverter: i, edits: l, labels: u } = D(), m = ho(), f = Zl(r, m, o), d = o ? ta : na, h = xe(), v = q(/* @__PURE__ */ new Map()), E = {
|
|
2903
2880
|
editor: { label: u.editViewEditor, tooltip: u.editViewEditorTooltip },
|
|
2904
2881
|
split: { label: u.editViewSplit, tooltip: u.editViewSplitTooltip },
|
|
2905
2882
|
preview: { label: u.editViewPreview, tooltip: u.editViewPreviewTooltip }
|
|
2906
2883
|
}, k = () => {
|
|
2907
|
-
|
|
2884
|
+
l.preparePreview(e), i?.prepare?.();
|
|
2908
2885
|
}, R = (T) => {
|
|
2909
|
-
if (!
|
|
2910
|
-
|
|
2911
|
-
const
|
|
2912
|
-
|
|
2886
|
+
if (!Wl(T.nativeEvent, Kl(navigator.platform))) return;
|
|
2887
|
+
yn(T);
|
|
2888
|
+
const N = Gl(f);
|
|
2889
|
+
Xt(l, e, N, o), v.current.get(N)?.focus();
|
|
2913
2890
|
};
|
|
2914
|
-
return /* @__PURE__ */
|
|
2915
|
-
const
|
|
2916
|
-
return /* @__PURE__ */
|
|
2917
|
-
/* @__PURE__ */
|
|
2891
|
+
return /* @__PURE__ */ c("div", { role: "radiogroup", "aria-label": n ? u.editViewNamed(t) : u.editView, className: "aqmx-edit-view", "data-testid": "markdown-explorer-edit-view", onKeyDown: R, children: d.map((T) => {
|
|
2892
|
+
const N = ra[T], { label: M, tooltip: b } = E[T], g = T === "preview" ? k : void 0;
|
|
2893
|
+
return /* @__PURE__ */ F("label", { className: n ? "aqmx-icon-button" : "aqmx-icon-button aqmx-labelled-button", children: [
|
|
2894
|
+
/* @__PURE__ */ c(
|
|
2918
2895
|
"input",
|
|
2919
2896
|
{
|
|
2920
|
-
ref: (
|
|
2921
|
-
|
|
2897
|
+
ref: (a) => {
|
|
2898
|
+
a === null ? v.current.delete(T) : v.current.set(T, a);
|
|
2922
2899
|
},
|
|
2923
2900
|
type: "radio",
|
|
2924
2901
|
name: h,
|
|
2925
2902
|
value: T,
|
|
2926
2903
|
checked: T === f,
|
|
2927
|
-
"aria-label":
|
|
2928
|
-
"aria-keyshortcuts": T === "split" ? void 0 :
|
|
2904
|
+
"aria-label": M,
|
|
2905
|
+
"aria-keyshortcuts": T === "split" ? void 0 : Ul,
|
|
2929
2906
|
title: b,
|
|
2930
2907
|
"data-testid": `markdown-explorer-edit-view-${T}`,
|
|
2931
|
-
onChange: () =>
|
|
2932
|
-
onDoubleClick:
|
|
2933
|
-
onPointerEnter:
|
|
2934
|
-
onFocus:
|
|
2908
|
+
onChange: () => Xt(l, e, T, o),
|
|
2909
|
+
onDoubleClick: ce,
|
|
2910
|
+
onPointerEnter: g,
|
|
2911
|
+
onFocus: g
|
|
2935
2912
|
}
|
|
2936
2913
|
),
|
|
2937
|
-
/* @__PURE__ */
|
|
2938
|
-
n ? null : /* @__PURE__ */
|
|
2914
|
+
/* @__PURE__ */ c(N, { "aria-hidden": "true" }),
|
|
2915
|
+
n ? null : /* @__PURE__ */ c("span", { children: M })
|
|
2939
2916
|
] }, T);
|
|
2940
2917
|
}) });
|
|
2941
|
-
},
|
|
2942
|
-
const { edits: i, labels:
|
|
2918
|
+
}, ia = ({ path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }) => {
|
|
2919
|
+
const { edits: i, labels: l } = D(), [u, m] = B(!1);
|
|
2943
2920
|
if (r.phase.kind !== "editing") return null;
|
|
2944
|
-
const f = r.save.kind === "saving",
|
|
2921
|
+
const f = r.save.kind === "saving", d = f || !r.dirty, h = () => {
|
|
2945
2922
|
i.flush(e);
|
|
2946
2923
|
const E = i.session(e);
|
|
2947
2924
|
E === void 0 || !E.dirty || E.save.kind === "saving" || i.save(e);
|
|
2948
|
-
},
|
|
2949
|
-
return /* @__PURE__ */ $
|
|
2950
|
-
r.save.kind === "conflicts" ? /* @__PURE__ */
|
|
2951
|
-
/* @__PURE__ */
|
|
2952
|
-
n ? null : /* @__PURE__ */
|
|
2925
|
+
}, v = (E) => n ? { className: "aqmx-icon-button", "aria-label": E } : { className: "aqmx-icon-button aqmx-labelled-button" };
|
|
2926
|
+
return /* @__PURE__ */ F($e, { children: [
|
|
2927
|
+
r.save.kind === "conflicts" ? /* @__PURE__ */ F("button", { type: "button", ...v(l.conflictNext), title: l.conflictNext, "data-testid": "markdown-explorer-edit-next-conflict", onClick: () => i.nextConflict(e), onDoubleClick: ce, children: [
|
|
2928
|
+
/* @__PURE__ */ c(Dl, { "aria-hidden": "true" }),
|
|
2929
|
+
n ? null : /* @__PURE__ */ c("span", { children: l.conflictNext })
|
|
2953
2930
|
] }) : null,
|
|
2954
|
-
/* @__PURE__ */
|
|
2955
|
-
r.history ? /* @__PURE__ */
|
|
2956
|
-
/* @__PURE__ */
|
|
2957
|
-
n ? null : /* @__PURE__ */
|
|
2931
|
+
/* @__PURE__ */ c(oa, { path: e, documentName: t, iconOnly: n, session: r, previewAvailable: o }),
|
|
2932
|
+
r.history ? /* @__PURE__ */ F("button", { type: "button", ...v(l.historyOpen), title: l.historyOpen, "aria-haspopup": "dialog", "data-testid": "markdown-explorer-edit-history", onClick: () => m(!0), onDoubleClick: ce, children: [
|
|
2933
|
+
/* @__PURE__ */ c($l, { "aria-hidden": "true" }),
|
|
2934
|
+
n ? null : /* @__PURE__ */ c("span", { children: l.historyOpen })
|
|
2958
2935
|
] }) : null,
|
|
2959
|
-
r.save.kind === "draft" ? null : /* @__PURE__ */
|
|
2960
|
-
/* @__PURE__ */
|
|
2961
|
-
n ? null : /* @__PURE__ */
|
|
2936
|
+
r.save.kind === "draft" ? null : /* @__PURE__ */ F("button", { type: "button", ...v(l.saveDraft), title: l.saveDraftTooltip, "aria-disabled": d, "aria-busy": f, "aria-keyshortcuts": "Control+S Meta+S", "data-testid": "markdown-explorer-edit-save", onClick: h, onDoubleClick: ce, children: [
|
|
2937
|
+
/* @__PURE__ */ c(Il, { "aria-hidden": "true" }),
|
|
2938
|
+
n ? null : /* @__PURE__ */ c("span", { children: l.saveDraft })
|
|
2962
2939
|
] }),
|
|
2963
|
-
r.history ? /* @__PURE__ */
|
|
2940
|
+
r.history ? /* @__PURE__ */ c(Yl, { path: e, documentName: t, open: u, onClose: () => m(!1) }) : null
|
|
2964
2941
|
] });
|
|
2965
|
-
},
|
|
2942
|
+
}, la = ({ path: e, session: t }) => {
|
|
2966
2943
|
const { edits: n } = D();
|
|
2967
|
-
return t.save.kind !== "grant" ? null : /* @__PURE__ */
|
|
2944
|
+
return t.save.kind !== "grant" ? null : /* @__PURE__ */ c(Hl, { href: t.save.href, onRetry: () => {
|
|
2968
2945
|
n.save(e);
|
|
2969
2946
|
}, testId: "markdown-explorer-save-grant" });
|
|
2970
|
-
},
|
|
2971
|
-
const { documents:
|
|
2972
|
-
return ue(o)?.document.kind === "markdown";
|
|
2973
|
-
}, Ja = (e) => {
|
|
2974
|
-
const { config: t } = D(), n = $e(), r = P(() => n(Se(t, { ...e, markup: !e.markup }), "browse"), [t, n, e]);
|
|
2975
|
-
return U(() => ({ shown: e.markup, toggle: r }), [e.markup, r]);
|
|
2976
|
-
}, Qa = /* @__PURE__ */ new Set(), el = (e, t) => {
|
|
2977
|
-
const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), a = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, a), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [c] = z(() => /* @__PURE__ */ new Set()), [h, g] = z(Qa), [E, k] = z(null);
|
|
2947
|
+
}, aa = /* @__PURE__ */ new Set(), sa = (e, t) => {
|
|
2948
|
+
const { documents: n, announcer: r, labels: o } = D(), i = P(() => n.peek(e), [n, e]), l = P(() => n.peekSeeded(e), [n, e]), u = ee(n.subscribe, i, l), m = P(() => n.answerStampOf(e), [n, e]), f = ee(n.subscribe, m, m), [d] = B(() => /* @__PURE__ */ new Set()), [h, v] = B(aa), [E, k] = B(null);
|
|
2978
2949
|
E !== null && E.path !== e && k(null);
|
|
2979
|
-
const R =
|
|
2980
|
-
|
|
2950
|
+
const R = q(null);
|
|
2951
|
+
V(() => (R.current = e, () => {
|
|
2981
2952
|
R.current = null;
|
|
2982
2953
|
}), [e]);
|
|
2983
2954
|
const T = P(() => {
|
|
2984
|
-
const b = e,
|
|
2985
|
-
if (
|
|
2986
|
-
const
|
|
2987
|
-
|
|
2955
|
+
const b = e, g = n.peek(b);
|
|
2956
|
+
if (d.has(b) || g?.status === "pending") return;
|
|
2957
|
+
const a = t && !Nn(g);
|
|
2958
|
+
d.add(b), v(new Set(d)), k(null), (async () => {
|
|
2988
2959
|
try {
|
|
2989
2960
|
const s = await n.refresh(b);
|
|
2990
2961
|
if (R.current !== b || s.status === "superseded") return;
|
|
2991
2962
|
if (s.status === "failed") {
|
|
2992
|
-
k({ path: b, failure: s.failure, stamp: n.answerStampOf(b) }), r.announce(o.documentRefreshFailed(
|
|
2963
|
+
k({ path: b, failure: s.failure, stamp: n.answerStampOf(b) }), r.announce(o.documentRefreshFailed(ae(o, s.failure.reason)));
|
|
2993
2964
|
return;
|
|
2994
2965
|
}
|
|
2995
|
-
const
|
|
2996
|
-
if (
|
|
2997
|
-
r.announce(o.documentRefreshed(
|
|
2966
|
+
const w = ue(n.peek(b));
|
|
2967
|
+
if (a || w === null || w.document.kind === "failure") return;
|
|
2968
|
+
r.announce(o.documentRefreshed(w.document.name));
|
|
2998
2969
|
} finally {
|
|
2999
|
-
|
|
2970
|
+
d.delete(b), v(new Set(d));
|
|
3000
2971
|
}
|
|
3001
2972
|
})();
|
|
3002
|
-
}, [e, t,
|
|
3003
|
-
return { refreshing:
|
|
3004
|
-
},
|
|
3005
|
-
const { labels: r } = D(), { refreshing: o, unavailable: i, failure:
|
|
3006
|
-
return /* @__PURE__ */
|
|
3007
|
-
/* @__PURE__ */
|
|
3008
|
-
|
|
3009
|
-
|
|
3010
|
-
|
|
2973
|
+
}, [e, t, d, n, r, o]), N = h.has(e), M = E !== null && E.path === e && E.stamp === f ? E.failure : null;
|
|
2974
|
+
return { refreshing: N, unavailable: N || u?.status === "pending", failure: M, refresh: T };
|
|
2975
|
+
}, ca = Object.freeze({ kind: "page" }), da = ({ path: e, placement: t, markup: n }) => {
|
|
2976
|
+
const { labels: r } = D(), { refreshing: o, unavailable: i, failure: l, refresh: u } = sa(e, t.kind === "page"), m = ll(e), f = Xl(e), d = Rn(e), h = t.kind === "panel" ? r.refreshDocumentNamed(t.documentName) : null, v = t.kind === "panel" ? r.showMarkupNamed(t.documentName) : null, E = t.kind === "panel", k = t.kind === "panel" ? t.documentName : f.name, R = t.kind === "page" || t.maximized;
|
|
2977
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-document-refresh-bar", "data-testid": "markdown-explorer-document-refresh-bar", "data-aqmx-editing": d === void 0 ? void 0 : "true", children: [
|
|
2978
|
+
/* @__PURE__ */ F("div", { className: "aqmx-document-refresh-row", children: [
|
|
2979
|
+
d === void 0 ? null : /* @__PURE__ */ c(ea, { session: d }),
|
|
2980
|
+
d === void 0 ? null : /* @__PURE__ */ c(ia, { path: e, documentName: k, iconOnly: E, session: d, previewAvailable: R }),
|
|
2981
|
+
d === void 0 && m !== null ? /* @__PURE__ */ F(
|
|
3011
2982
|
"button",
|
|
3012
2983
|
{
|
|
3013
2984
|
type: "button",
|
|
3014
|
-
className:
|
|
3015
|
-
title:
|
|
3016
|
-
"aria-label":
|
|
2985
|
+
className: v === null ? "aqmx-icon-button aqmx-labelled-button" : "aqmx-icon-button",
|
|
2986
|
+
title: v === null ? m === "svg" ? r.showSvgMarkup : r.showMarkup : v,
|
|
2987
|
+
"aria-label": v === null ? void 0 : v,
|
|
3017
2988
|
"aria-pressed": n.shown,
|
|
3018
2989
|
"data-testid": "markdown-explorer-document-markup",
|
|
3019
2990
|
onClick: n.toggle,
|
|
3020
|
-
onDoubleClick:
|
|
2991
|
+
onDoubleClick: ce,
|
|
3021
2992
|
children: [
|
|
3022
|
-
/* @__PURE__ */
|
|
3023
|
-
|
|
2993
|
+
/* @__PURE__ */ c(Vn, { "aria-hidden": "true" }),
|
|
2994
|
+
v === null ? /* @__PURE__ */ c("span", { children: r.showMarkupLabel }) : null
|
|
3024
2995
|
]
|
|
3025
2996
|
}
|
|
3026
2997
|
) : null,
|
|
3027
|
-
|
|
3028
|
-
|
|
2998
|
+
d !== void 0 || f.edit?.kind === "inline" || f.edit?.kind === "draft" ? /* @__PURE__ */ c(Jl, { path: e, documentName: k, iconOnly: E, previewAvailable: R, draft: f.edit?.kind === "draft" }) : f.edit?.kind === "external" ? /* @__PURE__ */ c(Ql, { href: f.edit.href, documentName: k, iconOnly: E }) : null,
|
|
2999
|
+
d === void 0 ? /* @__PURE__ */ F(
|
|
3029
3000
|
"button",
|
|
3030
3001
|
{
|
|
3031
3002
|
type: "button",
|
|
@@ -3037,85 +3008,85 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3037
3008
|
"data-aqmx-busy": o ? "true" : void 0,
|
|
3038
3009
|
"data-testid": "markdown-explorer-document-refresh",
|
|
3039
3010
|
onClick: u,
|
|
3040
|
-
onDoubleClick:
|
|
3011
|
+
onDoubleClick: ce,
|
|
3041
3012
|
children: [
|
|
3042
|
-
/* @__PURE__ */
|
|
3043
|
-
h === null ? /* @__PURE__ */
|
|
3013
|
+
/* @__PURE__ */ c(Cl, { "aria-hidden": "true" }),
|
|
3014
|
+
h === null ? /* @__PURE__ */ c("span", { children: r.refreshDocumentLabel }) : null
|
|
3044
3015
|
]
|
|
3045
3016
|
}
|
|
3046
3017
|
) : null
|
|
3047
3018
|
] }),
|
|
3048
|
-
|
|
3049
|
-
|
|
3019
|
+
d !== void 0 || l === null ? null : /* @__PURE__ */ c("p", { className: "aqmx-document-refresh-failure", "data-testid": "markdown-explorer-document-refresh-failure", "data-aqmx-failure": l.reason, children: r.documentRefreshFailed(ae(r, l.reason)) }),
|
|
3020
|
+
d === void 0 ? null : /* @__PURE__ */ c(la, { path: e, session: d })
|
|
3050
3021
|
] });
|
|
3051
|
-
},
|
|
3052
|
-
const t = e.doc, n =
|
|
3053
|
-
return /* @__PURE__ */
|
|
3054
|
-
/* @__PURE__ */
|
|
3055
|
-
/* @__PURE__ */
|
|
3022
|
+
}, ua = ({ location: e }) => {
|
|
3023
|
+
const t = e.doc, n = H(() => ({ kind: "page", view: "single", overrides: e.overrides, embed: e.embed }), [e.overrides, e.embed]), r = al(e);
|
|
3024
|
+
return /* @__PURE__ */ F("div", { className: "aqmx-single aqmx-document-column", "data-testid": "markdown-explorer-single", ...tt, children: [
|
|
3025
|
+
/* @__PURE__ */ c(da, { path: t, placement: ca, markup: r }),
|
|
3026
|
+
/* @__PURE__ */ c(Rl, { path: t, absence: dl, markup: e.markup, variant: n })
|
|
3056
3027
|
] });
|
|
3057
|
-
},
|
|
3028
|
+
}, fa = ({ holds: e, testId: t }) => {
|
|
3058
3029
|
const { labels: n, announcer: r } = D(), o = xe();
|
|
3059
|
-
|
|
3060
|
-
const i = P(() => r.shownIn(o), [r, o]),
|
|
3061
|
-
return /* @__PURE__ */
|
|
3062
|
-
}, fe = Object.freeze([]),
|
|
3030
|
+
V(() => e ? r.claim(o) : void 0, [e, r, o]);
|
|
3031
|
+
const i = P(() => r.shownIn(o), [r, o]), l = ee(r.subscribe, i, i);
|
|
3032
|
+
return /* @__PURE__ */ c("div", { className: "aqmx-sr-only", role: "status", "aria-live": "polite", "aria-atomic": "true", "data-testid": t, children: l.length > 1 ? n.announcementSequence(l) : l[0] });
|
|
3033
|
+
}, fe = Object.freeze([]), ma = (e) => {
|
|
3063
3034
|
const t = /* @__PURE__ */ new Set();
|
|
3064
3035
|
let n = fe, r = [], o = !1;
|
|
3065
|
-
const i = [],
|
|
3066
|
-
n =
|
|
3036
|
+
const i = [], l = (d) => {
|
|
3037
|
+
n = d;
|
|
3067
3038
|
for (const h of [...t]) h();
|
|
3068
|
-
}, u = () => i.at(-1)?.region, m = (
|
|
3039
|
+
}, u = () => i.at(-1)?.region, m = (d) => {
|
|
3069
3040
|
const h = u();
|
|
3070
|
-
|
|
3041
|
+
d(), u() !== h && n !== fe && l(fe);
|
|
3071
3042
|
}, f = () => {
|
|
3072
3043
|
o = !1;
|
|
3073
|
-
const
|
|
3074
|
-
r = [],
|
|
3044
|
+
const d = r.map((h) => "sentence" in h ? h.sentence : h.list(h.items));
|
|
3045
|
+
r = [], l(Object.freeze(d));
|
|
3075
3046
|
};
|
|
3076
3047
|
return {
|
|
3077
|
-
announce: (
|
|
3078
|
-
if (typeof
|
|
3048
|
+
announce: (d) => {
|
|
3049
|
+
if (typeof d == "string") r.push({ sentence: d });
|
|
3079
3050
|
else {
|
|
3080
|
-
const h = r.find((
|
|
3081
|
-
h !== void 0 && "items" in h ? h.items.push(
|
|
3051
|
+
const h = r.find((v) => "list" in v && v.list === d.list);
|
|
3052
|
+
h !== void 0 && "items" in h ? h.items.push(d.item) : r.push({ list: d.list, items: [d.item] });
|
|
3082
3053
|
}
|
|
3083
|
-
o || (o = !0, n !== fe &&
|
|
3054
|
+
o || (o = !0, n !== fe && l(fe), e.request(f));
|
|
3084
3055
|
},
|
|
3085
|
-
subscribe: (
|
|
3086
|
-
t.delete(
|
|
3056
|
+
subscribe: (d) => (t.add(d), () => {
|
|
3057
|
+
t.delete(d);
|
|
3087
3058
|
}),
|
|
3088
|
-
claim: (
|
|
3089
|
-
const h = { region:
|
|
3059
|
+
claim: (d) => {
|
|
3060
|
+
const h = { region: d };
|
|
3090
3061
|
return m(() => i.push(h)), () => m(() => {
|
|
3091
|
-
const
|
|
3092
|
-
|
|
3062
|
+
const v = i.indexOf(h);
|
|
3063
|
+
v !== -1 && i.splice(v, 1);
|
|
3093
3064
|
});
|
|
3094
3065
|
},
|
|
3095
|
-
shownIn: (
|
|
3066
|
+
shownIn: (d) => u() === d ? n : fe
|
|
3096
3067
|
};
|
|
3097
|
-
},
|
|
3068
|
+
}, we = Object.freeze({ status: "cancelled" }), ha = (e) => {
|
|
3098
3069
|
if (e === null || typeof e != "object") return null;
|
|
3099
3070
|
const { failure: t } = e;
|
|
3100
|
-
if (
|
|
3071
|
+
if (pr(t) !== null) return null;
|
|
3101
3072
|
const { reason: n, code: r } = t;
|
|
3102
|
-
return
|
|
3103
|
-
},
|
|
3104
|
-
const r = n ?? ((f,
|
|
3073
|
+
return vr(n, r);
|
|
3074
|
+
}, pa = ({ dataPath: e, onScope: t, fetch: n }) => {
|
|
3075
|
+
const r = n ?? ((f, d) => globalThis.fetch(f, d)), o = (f, d) => `${e}/${f}?${new URLSearchParams(d).toString()}`, i = async (f, d, h, v) => {
|
|
3105
3076
|
let E;
|
|
3106
3077
|
try {
|
|
3107
|
-
E = await r(f, { credentials: "same-origin", ...
|
|
3078
|
+
E = await r(f, { credentials: "same-origin", ...d, headers: { Accept: "application/json", ...d.headers } });
|
|
3108
3079
|
} catch {
|
|
3109
|
-
return
|
|
3080
|
+
return v({ reason: "failed" });
|
|
3110
3081
|
}
|
|
3111
3082
|
E.status === 401 && t(null);
|
|
3112
|
-
const k = E.headers.get(
|
|
3083
|
+
const k = E.headers.get(dr);
|
|
3113
3084
|
k !== null && t(k);
|
|
3114
3085
|
let R;
|
|
3115
3086
|
try {
|
|
3116
3087
|
R = await E.json();
|
|
3117
3088
|
} catch {
|
|
3118
|
-
return
|
|
3089
|
+
return v({ reason: kt(E.status) });
|
|
3119
3090
|
}
|
|
3120
3091
|
let T;
|
|
3121
3092
|
try {
|
|
@@ -3124,39 +3095,39 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3124
3095
|
T = !1;
|
|
3125
3096
|
}
|
|
3126
3097
|
if (T) return R;
|
|
3127
|
-
const
|
|
3128
|
-
return
|
|
3129
|
-
},
|
|
3130
|
-
const
|
|
3131
|
-
return
|
|
3098
|
+
const N = ha(R);
|
|
3099
|
+
return v(N !== null ? N : { reason: E.status === 200 ? "failed" : kt(E.status) });
|
|
3100
|
+
}, l = { [Rt]: gr }, u = { [Rt]: Sr, "Content-Type": `${yr}; charset=utf-8` }, m = async (f, d, h) => {
|
|
3101
|
+
const v = await i(f, d, h, (E) => Ue(E.reason, E.code));
|
|
3102
|
+
return d.signal.aborted ? we : v;
|
|
3132
3103
|
};
|
|
3133
3104
|
return {
|
|
3134
|
-
tree: (f) => i(o("tree", { [
|
|
3135
|
-
children: async (f,
|
|
3136
|
-
const
|
|
3137
|
-
return h.aborted ?
|
|
3105
|
+
tree: (f) => i(o("tree", { [J.source]: f }), { method: "GET" }, Tt, (d) => ({ status: "error", failure: d })),
|
|
3106
|
+
children: async (f, d, h) => {
|
|
3107
|
+
const v = await i(o("children", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, hr, (E) => ({ status: "error", failure: E }));
|
|
3108
|
+
return h.aborted ? we : v;
|
|
3138
3109
|
},
|
|
3139
|
-
ancestors: async (f,
|
|
3140
|
-
const
|
|
3141
|
-
return h.aborted ?
|
|
3110
|
+
ancestors: async (f, d, h) => {
|
|
3111
|
+
const v = await i(o("ancestors", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, mr, (E) => ({ status: "error", failure: E }));
|
|
3112
|
+
return h.aborted ? we : v;
|
|
3142
3113
|
},
|
|
3143
|
-
reveal: async (f,
|
|
3144
|
-
const
|
|
3145
|
-
return h.aborted ?
|
|
3114
|
+
reveal: async (f, d, h) => {
|
|
3115
|
+
const v = await i(o("reveal", { [J.source]: f, [J.path]: d }), { method: "GET", signal: h }, fr, (E) => ({ status: "error", failure: E }));
|
|
3116
|
+
return h.aborted ? we : v;
|
|
3146
3117
|
},
|
|
3147
|
-
document: (f, { refresh:
|
|
3148
|
-
text: async (f,
|
|
3149
|
-
const h = await i(o("text", { [
|
|
3150
|
-
return
|
|
3118
|
+
document: (f, { refresh: d }) => i(o("document", { [J.path]: f }), d ? { method: "GET", headers: l } : { method: "GET" }, Tr, (h) => Ue(h.reason, h.code)),
|
|
3119
|
+
text: async (f, d) => {
|
|
3120
|
+
const h = await i(o("text", { [J.path]: f }), { method: "GET", signal: d }, ur, (v) => Ue(v.reason, v.code));
|
|
3121
|
+
return d.aborted ? we : h;
|
|
3151
3122
|
},
|
|
3152
|
-
edit: (f,
|
|
3153
|
-
save: (f,
|
|
3154
|
-
preview: (f,
|
|
3155
|
-
revisions: (f,
|
|
3156
|
-
revision: (f,
|
|
3157
|
-
refresh: (f) => i(o("refresh", { [
|
|
3123
|
+
edit: (f, d) => m(o("edit", { [J.path]: f }), { method: "GET", signal: d }, kr),
|
|
3124
|
+
save: (f, d, h, v) => m(o("save", { [J.path]: f, [J.base]: d }), { method: "POST", headers: u, body: h, signal: v }, xr),
|
|
3125
|
+
preview: (f, d, h) => m(o("preview", { [J.path]: f }), { method: "POST", headers: u, body: d, signal: h }, Er),
|
|
3126
|
+
revisions: (f, d) => m(o("revisions", { [J.path]: f }), { method: "GET", signal: d }, br),
|
|
3127
|
+
revision: (f, d, h) => m(o("revision", { [J.path]: f, [J.revision]: d }), { method: "GET", signal: h }, wr),
|
|
3128
|
+
refresh: (f) => i(o("refresh", { [J.source]: f }), { method: "POST", headers: l }, Tt, (d) => ({ status: "error", failure: d }))
|
|
3158
3129
|
};
|
|
3159
|
-
},
|
|
3130
|
+
}, va = () => {
|
|
3160
3131
|
let e = null, t = null;
|
|
3161
3132
|
return {
|
|
3162
3133
|
settle: (n) => {
|
|
@@ -3171,20 +3142,20 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3171
3142
|
return t = null, o;
|
|
3172
3143
|
}
|
|
3173
3144
|
};
|
|
3174
|
-
},
|
|
3175
|
-
const t =
|
|
3176
|
-
if (t === null) return
|
|
3145
|
+
}, ga = (e) => {
|
|
3146
|
+
const t = et(e);
|
|
3147
|
+
if (t === null) return St;
|
|
3177
3148
|
try {
|
|
3178
|
-
return
|
|
3149
|
+
return ir(JSON.parse(t));
|
|
3179
3150
|
} catch (n) {
|
|
3180
|
-
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n),
|
|
3151
|
+
return console.warn(`[markdown-explorer] localStorage key ${JSON.stringify(e)} does not hold JSON; using the default tree settings.`, n), St;
|
|
3181
3152
|
}
|
|
3182
|
-
},
|
|
3153
|
+
}, Qt = (e, t) => {
|
|
3183
3154
|
let n = null;
|
|
3184
3155
|
const r = () => {
|
|
3185
3156
|
if (n === null) {
|
|
3186
|
-
const i =
|
|
3187
|
-
n = { changes: i, settings:
|
|
3157
|
+
const i = ga(e);
|
|
3158
|
+
n = { changes: i, settings: yt(t, i) };
|
|
3188
3159
|
}
|
|
3189
3160
|
return n;
|
|
3190
3161
|
}, o = Oe();
|
|
@@ -3195,198 +3166,198 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3195
3166
|
getServerSnapshot: () => t,
|
|
3196
3167
|
subscribe: o.subscribe,
|
|
3197
3168
|
advance: (i) => {
|
|
3198
|
-
const { changes:
|
|
3199
|
-
return n = { changes: m, settings:
|
|
3169
|
+
const { changes: l, settings: u } = r(), m = nr(l, i, rr(u, i)[i], t);
|
|
3170
|
+
return n = { changes: m, settings: yt(t, m) }, o.emit(), Qe(e, or(m)), n.settings;
|
|
3200
3171
|
}
|
|
3201
3172
|
};
|
|
3202
|
-
},
|
|
3203
|
-
const t = /* @__PURE__ */ new Map(), n =
|
|
3204
|
-
let f = 0,
|
|
3205
|
-
const h = { direct: null, bulk: null },
|
|
3173
|
+
}, wa = Object.freeze({ status: "refreshed" }), ba = Object.freeze({ status: "superseded" }), it = Object.freeze({ status: "deferred" }), Ea = Tn(it), Hn = 4, ya = Hn - 1, en = Object.freeze({ status: "loading" }), Sa = Object.freeze({ status: "error", failure: Object.freeze({ reason: "failed" }) }), xa = (e) => {
|
|
3174
|
+
const t = /* @__PURE__ */ new Map(), n = An(), r = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), u = Oe(), m = /* @__PURE__ */ new Set();
|
|
3175
|
+
let f = 0, d = 0;
|
|
3176
|
+
const h = { direct: null, bulk: null }, v = /* @__PURE__ */ new Set();
|
|
3206
3177
|
let E = !1, k = 0;
|
|
3207
3178
|
const R = () => {
|
|
3208
3179
|
k += 1, u.emit();
|
|
3209
|
-
}, T = (p) => o.get(p) ?? 0,
|
|
3210
|
-
let
|
|
3211
|
-
return
|
|
3212
|
-
},
|
|
3213
|
-
p.inFlight.delete(
|
|
3180
|
+
}, T = (p) => o.get(p) ?? 0, N = (p) => {
|
|
3181
|
+
let y = l.get(p);
|
|
3182
|
+
return y === void 0 && (y = { claims: /* @__PURE__ */ new Map(), unclaimed: /* @__PURE__ */ new Set(), direct: /* @__PURE__ */ new Set(), bulk: /* @__PURE__ */ new Set(), inFlight: /* @__PURE__ */ new Map() }, l.set(p, y)), y;
|
|
3183
|
+
}, M = (p, y, x) => {
|
|
3184
|
+
p.inFlight.delete(y), f -= 1, x.lane === "bulk" && (d -= 1);
|
|
3214
3185
|
}, b = (p) => {
|
|
3215
|
-
const
|
|
3216
|
-
if (
|
|
3217
|
-
for (const [x, C] of [...
|
|
3218
|
-
|
|
3219
|
-
|
|
3186
|
+
const y = l.get(p);
|
|
3187
|
+
if (y !== void 0) {
|
|
3188
|
+
for (const [x, C] of [...y.inFlight])
|
|
3189
|
+
M(y, x, C), C.controller.abort();
|
|
3190
|
+
y.direct.clear(), y.bulk.clear(), y.unclaimed.clear();
|
|
3220
3191
|
}
|
|
3221
|
-
},
|
|
3222
|
-
const
|
|
3223
|
-
return o.set(p,
|
|
3224
|
-
},
|
|
3225
|
-
const x = Ee(p), C = { promise: p, opened:
|
|
3226
|
-
return p.status === "pending" && p.then((
|
|
3227
|
-
|
|
3192
|
+
}, g = (p) => {
|
|
3193
|
+
const y = T(p) + 1;
|
|
3194
|
+
return o.set(p, y), b(p), y;
|
|
3195
|
+
}, a = (p, y) => {
|
|
3196
|
+
const x = Ee(p), C = { promise: p, opened: y, stale: !1, loadedAt: x?.status === "ok" ? x.loadedAt : null };
|
|
3197
|
+
return p.status === "pending" && p.then(($) => {
|
|
3198
|
+
$.status === "ok" && (C.loadedAt = $.loadedAt);
|
|
3228
3199
|
}), C;
|
|
3229
3200
|
}, s = (p) => {
|
|
3230
|
-
let
|
|
3231
|
-
return
|
|
3232
|
-
},
|
|
3233
|
-
const
|
|
3234
|
-
for (let
|
|
3235
|
-
const
|
|
3236
|
-
if (!(
|
|
3237
|
-
for (const
|
|
3238
|
-
if ((
|
|
3239
|
-
return
|
|
3201
|
+
let y = r.get(p);
|
|
3202
|
+
return y === void 0 && (y = /* @__PURE__ */ new Map(), r.set(p, y)), y;
|
|
3203
|
+
}, w = (p) => {
|
|
3204
|
+
const y = [...l.keys()], x = h[p], C = x === null ? 0 : y.indexOf(x) + 1;
|
|
3205
|
+
for (let $ = 0; $ < y.length; $ += 1) {
|
|
3206
|
+
const _ = y[(C + $) % y.length], W = _ === void 0 ? void 0 : l.get(_);
|
|
3207
|
+
if (!(_ === void 0 || W === void 0)) {
|
|
3208
|
+
for (const U of W[p])
|
|
3209
|
+
if ((W.claims.get(U) ?? 0) !== 0)
|
|
3210
|
+
return W[p].delete(U), h[p] = _, { sourceId: _, path: U };
|
|
3240
3211
|
}
|
|
3241
3212
|
}
|
|
3242
3213
|
return null;
|
|
3243
|
-
}, O = (p,
|
|
3244
|
-
const
|
|
3245
|
-
if (
|
|
3246
|
-
|
|
3247
|
-
const
|
|
3248
|
-
if (C.status === "ok" ?
|
|
3249
|
-
const
|
|
3250
|
-
for (const ie of [...m]) ie(
|
|
3214
|
+
}, O = (p, y, x, C) => {
|
|
3215
|
+
const $ = l.get(p);
|
|
3216
|
+
if ($ === void 0 || $.inFlight.get(y) !== x) return;
|
|
3217
|
+
M($, y, x);
|
|
3218
|
+
const _ = ($.claims.get(y) ?? 0) > 0, W = s(p);
|
|
3219
|
+
if (C.status === "ok" ? W.set(y, { status: "loaded", entries: C.entries }) : C.status === "error" && _ ? W.set(y, { status: "failed", failure: C.failure }) : W.delete(y), R(), C.status === "error" && _) {
|
|
3220
|
+
const U = { sourceId: p, path: y, failure: C.failure };
|
|
3221
|
+
for (const ie of [...m]) ie(U);
|
|
3251
3222
|
}
|
|
3252
|
-
|
|
3253
|
-
},
|
|
3223
|
+
A();
|
|
3224
|
+
}, L = (p, y, x) => {
|
|
3254
3225
|
const C = { controller: new AbortController(), lane: x };
|
|
3255
|
-
|
|
3256
|
-
(
|
|
3257
|
-
() => O(p,
|
|
3226
|
+
N(p).inFlight.set(y, C), f += 1, x === "bulk" && (d += 1), e.children(p, y, C.controller.signal).then(
|
|
3227
|
+
($) => O(p, y, C, $),
|
|
3228
|
+
() => O(p, y, C, Sa)
|
|
3258
3229
|
);
|
|
3259
|
-
},
|
|
3260
|
-
for (; f <
|
|
3261
|
-
const p =
|
|
3230
|
+
}, A = () => {
|
|
3231
|
+
for (; f < Hn; ) {
|
|
3232
|
+
const p = w("direct");
|
|
3262
3233
|
if (p !== null) {
|
|
3263
|
-
|
|
3234
|
+
L(p.sourceId, p.path, "direct");
|
|
3264
3235
|
continue;
|
|
3265
3236
|
}
|
|
3266
|
-
const
|
|
3267
|
-
if (
|
|
3268
|
-
|
|
3237
|
+
const y = d < ya ? w("bulk") : null;
|
|
3238
|
+
if (y === null) return;
|
|
3239
|
+
L(y.sourceId, y.path, "bulk");
|
|
3269
3240
|
}
|
|
3270
|
-
},
|
|
3271
|
-
if (!(
|
|
3272
|
-
const
|
|
3273
|
-
if (
|
|
3274
|
-
|
|
3241
|
+
}, I = (p, y, x) => {
|
|
3242
|
+
if (!(y.direct.delete(x) || y.bulk.delete(x))) {
|
|
3243
|
+
const $ = y.inFlight.get(x);
|
|
3244
|
+
if ($ === void 0) return !1;
|
|
3245
|
+
M(y, x, $), $.controller.abort();
|
|
3275
3246
|
}
|
|
3276
3247
|
return r.get(p)?.delete(x), !0;
|
|
3277
|
-
},
|
|
3248
|
+
}, K = () => {
|
|
3278
3249
|
E = !1;
|
|
3279
3250
|
let p = !1;
|
|
3280
|
-
for (const
|
|
3281
|
-
const x =
|
|
3251
|
+
for (const y of v) {
|
|
3252
|
+
const x = N(y);
|
|
3282
3253
|
for (const C of x.unclaimed)
|
|
3283
|
-
(x.claims.get(C) ?? 0) === 0 &&
|
|
3254
|
+
(x.claims.get(C) ?? 0) === 0 && I(y, x, C) && (p = !0);
|
|
3284
3255
|
x.unclaimed.clear();
|
|
3285
3256
|
}
|
|
3286
|
-
|
|
3287
|
-
}, G = (p,
|
|
3288
|
-
t.set(p,
|
|
3289
|
-
},
|
|
3290
|
-
|
|
3291
|
-
const C =
|
|
3292
|
-
return t.set(p, C), r.delete(p), R(),
|
|
3293
|
-
},
|
|
3294
|
-
if (x !== T(p) || t.get(p) !==
|
|
3295
|
-
const
|
|
3296
|
-
if (!(C.status !== "ok" ||
|
|
3297
|
-
if (
|
|
3298
|
-
|
|
3257
|
+
v.clear(), p && (R(), A());
|
|
3258
|
+
}, G = (p, y) => {
|
|
3259
|
+
t.set(p, a(Te(e.tree(p)), y));
|
|
3260
|
+
}, z = (p, y, x) => {
|
|
3261
|
+
g(p);
|
|
3262
|
+
const C = a(Tn(y), x);
|
|
3263
|
+
return t.set(p, C), r.delete(p), R(), A(), C;
|
|
3264
|
+
}, X = (p, y, x, C) => {
|
|
3265
|
+
if (x !== T(p) || t.get(p) !== y) return;
|
|
3266
|
+
const $ = Ee(y.promise);
|
|
3267
|
+
if (!(C.status !== "ok" || $?.status !== "ok" || y.loadedAt === null || C.loadedAt <= y.loadedAt)) {
|
|
3268
|
+
if (Pe($.entries, C.entries)) {
|
|
3269
|
+
y.loadedAt = C.loadedAt;
|
|
3299
3270
|
return;
|
|
3300
3271
|
}
|
|
3301
|
-
|
|
3272
|
+
z(p, C, y.opened);
|
|
3302
3273
|
}
|
|
3303
|
-
},
|
|
3274
|
+
}, j = (p, y) => {
|
|
3304
3275
|
const x = t.get(p);
|
|
3305
|
-
return x !== void 0 && Ee(x.promise)?.status ===
|
|
3306
|
-
},
|
|
3307
|
-
|
|
3276
|
+
return x !== void 0 && Ee(x.promise)?.status === y;
|
|
3277
|
+
}, re = (p, y) => {
|
|
3278
|
+
y.stale = !1;
|
|
3308
3279
|
const x = T(p);
|
|
3309
|
-
e.tree(p).then((C) =>
|
|
3280
|
+
e.tree(p).then((C) => X(p, y, x, C));
|
|
3310
3281
|
};
|
|
3311
3282
|
return {
|
|
3312
|
-
read: (p) => t.get(p)?.promise ??
|
|
3283
|
+
read: (p) => t.get(p)?.promise ?? Ea,
|
|
3313
3284
|
open: (p) => {
|
|
3314
|
-
const
|
|
3315
|
-
return C === void 0 ||
|
|
3285
|
+
const y = n.resumes(p), x = n.hold(p), C = t.get(p);
|
|
3286
|
+
return C === void 0 || j(p, "deferred") ? (G(p, !0), R()) : y || (C.opened && j(p, "error") ? (G(p, !0), R()) : (C.opened = !0, C.stale && j(p, "ok") && re(p, C))), x;
|
|
3316
3287
|
},
|
|
3317
3288
|
retry: (p) => {
|
|
3318
|
-
|
|
3289
|
+
j(p, "error") && (G(p, !0), R());
|
|
3319
3290
|
},
|
|
3320
|
-
seed: (p,
|
|
3321
|
-
const x =
|
|
3322
|
-
(
|
|
3323
|
-
() =>
|
|
3291
|
+
seed: (p, y) => {
|
|
3292
|
+
const x = y.then(
|
|
3293
|
+
(_) => _ === null ? it : _,
|
|
3294
|
+
() => it
|
|
3324
3295
|
), C = t.get(p);
|
|
3325
|
-
if (C !== void 0 &&
|
|
3326
|
-
const
|
|
3327
|
-
x.then((
|
|
3296
|
+
if (C !== void 0 && j(p, "ok")) {
|
|
3297
|
+
const _ = T(p);
|
|
3298
|
+
x.then((W) => X(p, C, _, W));
|
|
3328
3299
|
return;
|
|
3329
3300
|
}
|
|
3330
|
-
|
|
3331
|
-
const
|
|
3332
|
-
t.set(p,
|
|
3333
|
-
t.get(p) ===
|
|
3301
|
+
g(p);
|
|
3302
|
+
const $ = a(Te(x), C?.opened === !0);
|
|
3303
|
+
t.set(p, $), r.delete(p), A(), x.then((_) => {
|
|
3304
|
+
t.get(p) === $ && (_.status === "deferred" && n.isHeld(p) && G(p, $.opened), R());
|
|
3334
3305
|
});
|
|
3335
3306
|
},
|
|
3336
3307
|
refresh: async (p) => {
|
|
3337
|
-
const
|
|
3338
|
-
i.set(p,
|
|
3308
|
+
const y = (i.get(p) ?? 0) + 1;
|
|
3309
|
+
i.set(p, y);
|
|
3339
3310
|
const x = await e.refresh(p);
|
|
3340
|
-
if (i.get(p) !==
|
|
3311
|
+
if (i.get(p) !== y) return ba;
|
|
3341
3312
|
if (x.status === "error") return { status: "failed", failure: x.failure };
|
|
3342
3313
|
const C = t.get(p);
|
|
3343
|
-
if (!(C !== void 0 && C.loadedAt !== null &&
|
|
3344
|
-
const
|
|
3314
|
+
if (!(C !== void 0 && C.loadedAt !== null && j(p, "ok") && C.loadedAt > x.loadedAt)) {
|
|
3315
|
+
const _ = z(p, x, !0);
|
|
3345
3316
|
if (C !== void 0 && C.promise.status === "pending") {
|
|
3346
|
-
const
|
|
3347
|
-
C.promise.then((
|
|
3317
|
+
const W = T(p);
|
|
3318
|
+
C.promise.then((U) => X(p, _, W, U));
|
|
3348
3319
|
}
|
|
3349
3320
|
}
|
|
3350
|
-
for (const [
|
|
3351
|
-
|
|
3352
|
-
return
|
|
3321
|
+
for (const [_, W] of t)
|
|
3322
|
+
_ !== p && Ee(W.promise)?.status === "ok" && (W.stale = !0);
|
|
3323
|
+
return wa;
|
|
3353
3324
|
},
|
|
3354
|
-
children: (p,
|
|
3355
|
-
claimChildren: (p,
|
|
3356
|
-
const x =
|
|
3357
|
-
let
|
|
3358
|
-
for (const [
|
|
3359
|
-
x.claims.set(
|
|
3360
|
-
|
|
3361
|
-
let
|
|
3325
|
+
children: (p, y) => r.get(p)?.get(y),
|
|
3326
|
+
claimChildren: (p, y) => {
|
|
3327
|
+
const x = N(p), C = s(p);
|
|
3328
|
+
let $ = !1, _ = !1;
|
|
3329
|
+
for (const [U, ie] of y)
|
|
3330
|
+
x.claims.set(U, (x.claims.get(U) ?? 0) + 1), C.get(U) === void 0 ? (C.set(U, en), x[ie].add(U), $ = !0, _ = !0) : ie === "direct" && x.bulk.delete(U) && (x.direct.add(U), _ = !0);
|
|
3331
|
+
$ && R(), _ && A();
|
|
3332
|
+
let W = !1;
|
|
3362
3333
|
return () => {
|
|
3363
|
-
if (!
|
|
3364
|
-
|
|
3365
|
-
for (const
|
|
3366
|
-
const ie = (x.claims.get(
|
|
3367
|
-
ie > 0 ? x.claims.set(
|
|
3334
|
+
if (!W) {
|
|
3335
|
+
W = !0;
|
|
3336
|
+
for (const U of y.keys()) {
|
|
3337
|
+
const ie = (x.claims.get(U) ?? 0) - 1;
|
|
3338
|
+
ie > 0 ? x.claims.set(U, ie) : (x.claims.delete(U), x.unclaimed.add(U));
|
|
3368
3339
|
}
|
|
3369
|
-
|
|
3340
|
+
v.add(p), !E && (E = !0, queueMicrotask(K));
|
|
3370
3341
|
}
|
|
3371
3342
|
};
|
|
3372
3343
|
},
|
|
3373
|
-
retryChildren: (p,
|
|
3344
|
+
retryChildren: (p, y) => {
|
|
3374
3345
|
const x = r.get(p);
|
|
3375
|
-
if (x === void 0 || x.get(
|
|
3376
|
-
const C =
|
|
3377
|
-
if ((C.claims.get(
|
|
3378
|
-
x.set(
|
|
3346
|
+
if (x === void 0 || x.get(y)?.status !== "failed") return;
|
|
3347
|
+
const C = N(p);
|
|
3348
|
+
if ((C.claims.get(y) ?? 0) > 0) {
|
|
3349
|
+
x.set(y, en), C.direct.add(y), R(), A();
|
|
3379
3350
|
return;
|
|
3380
3351
|
}
|
|
3381
|
-
x.delete(
|
|
3352
|
+
x.delete(y), R();
|
|
3382
3353
|
},
|
|
3383
3354
|
pendingChildren: (p) => {
|
|
3384
|
-
const
|
|
3385
|
-
return
|
|
3355
|
+
const y = l.get(p);
|
|
3356
|
+
return y === void 0 ? 0 : y.direct.size + y.bulk.size + y.inFlight.size;
|
|
3386
3357
|
},
|
|
3387
3358
|
clear: () => {
|
|
3388
|
-
for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...
|
|
3389
|
-
for (const [p,
|
|
3359
|
+
for (const p of /* @__PURE__ */ new Set([...t.keys(), ...r.keys(), ...o.keys(), ...l.keys()])) g(p);
|
|
3360
|
+
for (const [p, y] of i) i.set(p, y + 1);
|
|
3390
3361
|
t.clear(), r.clear(), R();
|
|
3391
3362
|
},
|
|
3392
3363
|
subscribeChildrenFailures: (p) => (m.add(p), () => {
|
|
@@ -3395,7 +3366,7 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3395
3366
|
subscribe: u.subscribe,
|
|
3396
3367
|
version: () => k
|
|
3397
3368
|
};
|
|
3398
|
-
},
|
|
3369
|
+
}, ka = (e, t) => {
|
|
3399
3370
|
let n = e;
|
|
3400
3371
|
const r = Oe();
|
|
3401
3372
|
return {
|
|
@@ -3405,80 +3376,80 @@ const Da = /* @__PURE__ */ y.forwardRef(Na), Pa = ({ href: e, onRetry: t, testId
|
|
|
3405
3376
|
n = { ...n, ...o }, t(n), r.emit();
|
|
3406
3377
|
}
|
|
3407
3378
|
};
|
|
3408
|
-
},
|
|
3409
|
-
let Ce = 0,
|
|
3410
|
-
const
|
|
3379
|
+
}, Ta = 1;
|
|
3380
|
+
let Ce = 0, de = null;
|
|
3381
|
+
const Ra = () => {
|
|
3411
3382
|
const { documentElement: e, body: t } = document;
|
|
3412
|
-
Ce === 0 && (
|
|
3383
|
+
Ce === 0 && (de = { htmlOverflow: e.style.overflow, bodyOverflow: t.style.overflow, htmlGutter: e.style.scrollbarGutter, bodyGutter: t.style.scrollbarGutter }, e.style.overflow = "hidden", t.style.overflow = "hidden", e.style.scrollbarGutter = "auto", t.style.scrollbarGutter = "auto"), Ce += 1;
|
|
3413
3384
|
let n = !1;
|
|
3414
3385
|
return () => {
|
|
3415
|
-
n || (n = !0, Ce -= 1, !(Ce > 0 ||
|
|
3386
|
+
n || (n = !0, Ce -= 1, !(Ce > 0 || de === null) && (e.style.overflow = de.htmlOverflow, t.style.overflow = de.bodyOverflow, e.style.scrollbarGutter = de.htmlGutter, t.style.scrollbarGutter = de.bodyGutter, de = null));
|
|
3416
3387
|
};
|
|
3417
|
-
},
|
|
3388
|
+
}, Oa = [
|
|
3418
3389
|
{ selector: '[data-aqmx-document-flow="fill"]', name: "document region" },
|
|
3419
3390
|
{ selector: "[data-aqmx-explorer-body]", name: "tree area" }
|
|
3420
|
-
],
|
|
3421
|
-
if (!
|
|
3391
|
+
], tn = 1, Ca = 1e3, nn = (e) => e.getClientRects().length > 0, Ye = "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.", Ma = (e) => {
|
|
3392
|
+
if (!nn(e)) return null;
|
|
3422
3393
|
const t = e.getBoundingClientRect(), n = window.innerHeight;
|
|
3423
|
-
if (t.bottom > n +
|
|
3424
|
-
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. ${
|
|
3425
|
-
if (t.height <
|
|
3426
|
-
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. ${
|
|
3427
|
-
for (const { selector: r, name: o } of
|
|
3394
|
+
if (t.bottom > n + Ta)
|
|
3395
|
+
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. ${Ye}`;
|
|
3396
|
+
if (t.height < tn)
|
|
3397
|
+
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. ${Ye}`;
|
|
3398
|
+
for (const { selector: r, name: o } of Oa)
|
|
3428
3399
|
for (const i of e.querySelectorAll(r)) {
|
|
3429
|
-
if (!
|
|
3430
|
-
const
|
|
3431
|
-
if (
|
|
3432
|
-
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(
|
|
3400
|
+
if (!nn(i)) continue;
|
|
3401
|
+
const l = i.getBoundingClientRect().height;
|
|
3402
|
+
if (l < tn)
|
|
3403
|
+
return `[markdown-explorer] the explorer's ${o} collapsed to ${String(Math.round(l))}px while lockDocumentScroll stops the page from scrolling, so it cannot be read. ${Ye}`;
|
|
3433
3404
|
}
|
|
3434
3405
|
return null;
|
|
3435
|
-
},
|
|
3406
|
+
}, La = (e) => {
|
|
3436
3407
|
let t = !1, n;
|
|
3437
3408
|
const r = () => {
|
|
3438
3409
|
n = void 0;
|
|
3439
|
-
const
|
|
3440
|
-
|
|
3410
|
+
const l = Ma(e);
|
|
3411
|
+
l !== null && (t = !0, console.error(l));
|
|
3441
3412
|
}, o = () => {
|
|
3442
|
-
t || (clearTimeout(n), n = setTimeout(r,
|
|
3413
|
+
t || (clearTimeout(n), n = setTimeout(r, Ca));
|
|
3443
3414
|
}, i = typeof ResizeObserver > "u" ? null : new ResizeObserver(o);
|
|
3444
3415
|
return i?.observe(e), window.addEventListener("resize", o), o(), () => {
|
|
3445
3416
|
clearTimeout(n), i?.disconnect(), window.removeEventListener("resize", o);
|
|
3446
3417
|
};
|
|
3447
|
-
},
|
|
3448
|
-
te(() => e ?
|
|
3418
|
+
}, Aa = (e, t) => {
|
|
3419
|
+
te(() => e ? Ra() : void 0, [e]), te(() => {
|
|
3449
3420
|
const n = t.current;
|
|
3450
3421
|
if (!(!e || n === null))
|
|
3451
|
-
return
|
|
3422
|
+
return La(n);
|
|
3452
3423
|
}, [e, t]);
|
|
3453
|
-
},
|
|
3454
|
-
{ control:
|
|
3424
|
+
}, rn = '[data-testid="markdown-explorer-view-switch"]', Na = [
|
|
3425
|
+
{ control: rn, successors: [rn, '[data-testid="markdown-explorer-sheet-toggle"]'] },
|
|
3455
3426
|
{ control: '[data-testid="markdown-explorer-selection-open"]', successors: ['[data-testid="markdown-explorer-panel-frame"]'] }
|
|
3456
|
-
],
|
|
3457
|
-
for (const t of
|
|
3427
|
+
], Da = (e) => {
|
|
3428
|
+
for (const t of Na) {
|
|
3458
3429
|
const n = e.closest(t.control);
|
|
3459
3430
|
if (n !== null) return { element: n, control: t };
|
|
3460
3431
|
}
|
|
3461
3432
|
return null;
|
|
3462
|
-
},
|
|
3463
|
-
const n =
|
|
3433
|
+
}, Pa = (e, t) => {
|
|
3434
|
+
const n = q(null);
|
|
3464
3435
|
te(() => {
|
|
3465
3436
|
const o = (u) => {
|
|
3466
3437
|
const m = e.current;
|
|
3467
|
-
n.current = m !== null && u instanceof Element && m.contains(u) ?
|
|
3438
|
+
n.current = m !== null && u instanceof Element && m.contains(u) ? Da(u) : null;
|
|
3468
3439
|
}, i = (u) => o(u.target);
|
|
3469
3440
|
o(document.activeElement);
|
|
3470
|
-
const
|
|
3441
|
+
const l = (u) => {
|
|
3471
3442
|
const m = u.target;
|
|
3472
3443
|
u.relatedTarget !== null || !(m instanceof Element) || queueMicrotask(() => {
|
|
3473
3444
|
n.current?.element === m && m.isConnected && document.activeElement !== m && (n.current = null);
|
|
3474
3445
|
});
|
|
3475
3446
|
};
|
|
3476
|
-
return document.addEventListener("focusin", i), document.addEventListener("focusout",
|
|
3477
|
-
document.removeEventListener("focusin", i), document.removeEventListener("focusout",
|
|
3447
|
+
return document.addEventListener("focusin", i), document.addEventListener("focusout", l), () => {
|
|
3448
|
+
document.removeEventListener("focusin", i), document.removeEventListener("focusout", l);
|
|
3478
3449
|
};
|
|
3479
3450
|
}, [e]);
|
|
3480
|
-
const r =
|
|
3481
|
-
|
|
3451
|
+
const r = q(t);
|
|
3452
|
+
V(() => {
|
|
3482
3453
|
if (r.current === t) return;
|
|
3483
3454
|
r.current = t;
|
|
3484
3455
|
const o = n.current;
|
|
@@ -3488,245 +3459,245 @@ const gl = () => {
|
|
|
3488
3459
|
if (m !== null && m !== document.body && m !== o.element) return !0;
|
|
3489
3460
|
const f = e.current;
|
|
3490
3461
|
if (f === null) return !0;
|
|
3491
|
-
for (const
|
|
3492
|
-
for (const h of f.querySelectorAll(
|
|
3462
|
+
for (const d of o.control.successors)
|
|
3463
|
+
for (const h of f.querySelectorAll(d))
|
|
3493
3464
|
if (h !== o.element && (h.focus({ preventScroll: !0 }), document.activeElement === h))
|
|
3494
3465
|
return !0;
|
|
3495
3466
|
return !1;
|
|
3496
3467
|
};
|
|
3497
3468
|
if (i()) return;
|
|
3498
|
-
const
|
|
3499
|
-
if (
|
|
3469
|
+
const l = e.current;
|
|
3470
|
+
if (l === null) return;
|
|
3500
3471
|
const u = new MutationObserver(() => {
|
|
3501
3472
|
i() && u.disconnect();
|
|
3502
3473
|
});
|
|
3503
|
-
return u.observe(
|
|
3474
|
+
return u.observe(l, { childList: !0, subtree: !0 }), () => u.disconnect();
|
|
3504
3475
|
}, [t, e]);
|
|
3505
|
-
},
|
|
3476
|
+
}, $a = lt(() => import("./TreeLayout-zrSo4MNZ.js").then((e) => ({ default: e.TreeLayout }))), Fa = lt(() => import("./MultiLayout-DlATT7km.js").then((e) => ({ default: e.MultiLayout }))), Ia = 64, qa = {
|
|
3506
3477
|
request: (e) => {
|
|
3507
3478
|
requestAnimationFrame(e);
|
|
3508
3479
|
}
|
|
3509
|
-
},
|
|
3480
|
+
}, on = (e) => {
|
|
3510
3481
|
e.documents.clear(), e.trees.clear();
|
|
3511
3482
|
}, Xe = (e, t) => {
|
|
3512
3483
|
t.tree !== null && e.trees.seed(t.tree.sourceId, t.tree.result);
|
|
3513
3484
|
for (const { path: n, document: r } of t.documents) e.documents.seed(n, r);
|
|
3514
|
-
},
|
|
3515
|
-
const [n, r] =
|
|
3516
|
-
if (n.locale === e &&
|
|
3517
|
-
const o = { overrides: t, locale: e, labels:
|
|
3485
|
+
}, _a = (e, t) => {
|
|
3486
|
+
const [n, r] = B(() => ({ overrides: t, locale: e, labels: Lt(e, t) }));
|
|
3487
|
+
if (n.locale === e && _r(n.overrides, t)) return n.labels;
|
|
3488
|
+
const o = { overrides: t, locale: e, labels: Lt(e, t) };
|
|
3518
3489
|
return r(o), o.labels;
|
|
3519
|
-
},
|
|
3520
|
-
const [r, o] =
|
|
3490
|
+
}, Ba = (e, t, n) => {
|
|
3491
|
+
const [r, o] = B(() => ({ scope: t, store: Qt(e, n) }));
|
|
3521
3492
|
if (r.scope === t && r.store.storageKey === e && r.store.defaults === n) return r.store;
|
|
3522
|
-
const i = { scope: t, store:
|
|
3493
|
+
const i = { scope: t, store: Qt(e, n) };
|
|
3523
3494
|
return o(i), i.store;
|
|
3524
|
-
},
|
|
3525
|
-
const [n, r] =
|
|
3495
|
+
}, Je = (e, t) => {
|
|
3496
|
+
const [n, r] = B(() => ({ scope: e, value: t() }));
|
|
3526
3497
|
if (n.scope === e) return n.value;
|
|
3527
3498
|
const o = { scope: e, value: t() };
|
|
3528
3499
|
return r(o), o.value;
|
|
3529
|
-
},
|
|
3500
|
+
}, ja = () => ma(qa), ln = "on", za = "off", Va = Object.freeze({ kind: "unavailable" }), Ha = (e) => {
|
|
3530
3501
|
if (e !== void 0 && (e === null || typeof e != "object" || typeof e.convert != "function"))
|
|
3531
3502
|
throw new TypeError("[markdown-explorer] draftConverter must be an object with a convert function");
|
|
3532
|
-
},
|
|
3503
|
+
}, Ua = (e, t) => {
|
|
3533
3504
|
const n = ue(e.peek(t));
|
|
3534
3505
|
return n === null || n.document.kind === "failure" ? se(t) : n.document.name;
|
|
3535
|
-
},
|
|
3506
|
+
}, ss = ({
|
|
3536
3507
|
data: e,
|
|
3537
3508
|
config: t,
|
|
3538
3509
|
storageNamespace: n,
|
|
3539
3510
|
locale: r,
|
|
3540
3511
|
labels: o,
|
|
3541
3512
|
theme: i,
|
|
3542
|
-
renderFrame:
|
|
3513
|
+
renderFrame: l,
|
|
3543
3514
|
renderTreeFailure: u,
|
|
3544
3515
|
lockDocumentScroll: m = !1,
|
|
3545
3516
|
onMathDiagnostics: f,
|
|
3546
|
-
onEditGrant:
|
|
3517
|
+
onEditGrant: d,
|
|
3547
3518
|
draftConverter: h
|
|
3548
3519
|
}) => {
|
|
3549
|
-
|
|
3550
|
-
const
|
|
3551
|
-
}),
|
|
3552
|
-
const x =
|
|
3553
|
-
return Xe(C, e),
|
|
3520
|
+
Mr(n), Ha(h);
|
|
3521
|
+
const v = wn(r), E = Br(i), k = _a(v, o), { revalidate: R } = Xn(), T = q(() => {
|
|
3522
|
+
}), N = Fe(t.dataPath), [M] = B(() => {
|
|
3523
|
+
const x = pa({ dataPath: N, onScope: ($) => T.current($) }), C = { documents: zo({ client: x, capacity: Math.max(Ia, t.multiView.maxPanels * 2) }), trees: xa(x) };
|
|
3524
|
+
return Xe(C, e), Ct(n, e.scope), { data: x, ...C, aligned: { pageData: e, storageNamespace: n, pendingReader: null } };
|
|
3554
3525
|
});
|
|
3555
|
-
if (
|
|
3556
|
-
const x =
|
|
3557
|
-
|
|
3526
|
+
if (M.aligned.pageData !== e || M.aligned.storageNamespace !== n) {
|
|
3527
|
+
const x = M.aligned.pageData;
|
|
3528
|
+
M.aligned.pageData = e, M.aligned.storageNamespace = n, x !== e && (x.scope !== e.scope ? M.aligned.pendingReader = e : Xe(M, e)), Ct(n, e.scope);
|
|
3558
3529
|
}
|
|
3559
|
-
const b =
|
|
3560
|
-
|
|
3561
|
-
const x =
|
|
3562
|
-
x !== null && (
|
|
3563
|
-
}, [e,
|
|
3530
|
+
const b = Ba(ge(n).treeSettings, e.scope, t.defaultTreeSettings);
|
|
3531
|
+
V(() => {
|
|
3532
|
+
const x = M.aligned.pendingReader;
|
|
3533
|
+
x !== null && (M.aligned.pendingReader = null, on(M), Xe(M, x));
|
|
3534
|
+
}, [e, M]), V(() => {
|
|
3564
3535
|
let x = !1;
|
|
3565
3536
|
return T.current = (C) => {
|
|
3566
|
-
C === e.scope || x || (x = !0, C !== null && (
|
|
3537
|
+
C === e.scope || x || (x = !0, C !== null && (on(M), Lr(n)), R());
|
|
3567
3538
|
}, () => {
|
|
3568
3539
|
T.current = () => {
|
|
3569
3540
|
};
|
|
3570
3541
|
};
|
|
3571
|
-
}, [e, R,
|
|
3572
|
-
const
|
|
3573
|
-
|
|
3574
|
-
|
|
3542
|
+
}, [e, R, M, n]);
|
|
3543
|
+
const g = q(t.settingsCookie);
|
|
3544
|
+
V(() => {
|
|
3545
|
+
g.current = t.settingsCookie;
|
|
3575
3546
|
}, [t.settingsCookie]);
|
|
3576
|
-
const [
|
|
3577
|
-
() =>
|
|
3578
|
-
document.cookie =
|
|
3547
|
+
const [a] = B(
|
|
3548
|
+
() => ka(e.settings, (x) => {
|
|
3549
|
+
document.cookie = ar(g.current, x, window.location.protocol === "https:");
|
|
3579
3550
|
})
|
|
3580
|
-
), s =
|
|
3581
|
-
|
|
3551
|
+
), s = Je(e.scope, ja), w = Je(e.scope, va), O = q(k);
|
|
3552
|
+
V(() => {
|
|
3582
3553
|
O.current = k;
|
|
3583
3554
|
}, [k]);
|
|
3584
|
-
const
|
|
3555
|
+
const L = Je(
|
|
3585
3556
|
e.scope,
|
|
3586
|
-
() =>
|
|
3587
|
-
data:
|
|
3557
|
+
() => Xr({
|
|
3558
|
+
data: M.data,
|
|
3588
3559
|
conflictLabels: () => ({ ours: O.current.conflictOurs, theirs: O.current.conflictTheirs }),
|
|
3589
3560
|
onSaveSettled: (x, C) => {
|
|
3590
|
-
C.kind === "saved" &&
|
|
3591
|
-
const
|
|
3592
|
-
|
|
3561
|
+
C.kind === "saved" && M.documents.refresh(x);
|
|
3562
|
+
const $ = zr(O.current, C, Ua(M.documents, x));
|
|
3563
|
+
$ !== null && s.announce($);
|
|
3593
3564
|
},
|
|
3594
3565
|
sideBySideSetting: {
|
|
3595
|
-
read: () =>
|
|
3596
|
-
write: (x) =>
|
|
3566
|
+
read: () => et(ge(n).editPreview) === ln,
|
|
3567
|
+
write: (x) => Qe(ge(n).editPreview, x ? ln : za)
|
|
3597
3568
|
},
|
|
3598
3569
|
editorShareSetting: {
|
|
3599
|
-
read: () =>
|
|
3600
|
-
write: (x) =>
|
|
3570
|
+
read: () => Yr(et(ge(n).editSplit)),
|
|
3571
|
+
write: (x) => Qe(ge(n).editSplit, String(x))
|
|
3601
3572
|
}
|
|
3602
3573
|
})
|
|
3603
|
-
),
|
|
3604
|
-
`),
|
|
3605
|
-
`)), [t,
|
|
3606
|
-
|
|
3574
|
+
), A = H(() => Te(e.notices.catch(() => [])), [e.notices]), I = e.sources.map((x) => x.id).join(`
|
|
3575
|
+
`), K = H(() => lr(t, I.split(`
|
|
3576
|
+
`)), [t, I]), G = q(f);
|
|
3577
|
+
V(() => {
|
|
3607
3578
|
G.current = f;
|
|
3608
3579
|
}, [f]);
|
|
3609
|
-
const [
|
|
3580
|
+
const [z] = B(() => (x, C) => {
|
|
3610
3581
|
G.current?.(x, C);
|
|
3611
|
-
}),
|
|
3612
|
-
|
|
3613
|
-
|
|
3582
|
+
}), X = f === void 0 ? void 0 : z, j = q(h);
|
|
3583
|
+
V(() => {
|
|
3584
|
+
j.current = h;
|
|
3614
3585
|
}, [h]);
|
|
3615
|
-
const [
|
|
3586
|
+
const [re] = B(() => {
|
|
3616
3587
|
let x = !1;
|
|
3617
3588
|
return {
|
|
3618
|
-
convert: (C,
|
|
3619
|
-
const
|
|
3620
|
-
return
|
|
3589
|
+
convert: (C, $) => {
|
|
3590
|
+
const _ = j.current;
|
|
3591
|
+
return _ === void 0 ? Promise.resolve(Va) : _.convert(C, $);
|
|
3621
3592
|
},
|
|
3622
3593
|
prepare: () => {
|
|
3623
3594
|
try {
|
|
3624
|
-
|
|
3595
|
+
j.current?.prepare?.();
|
|
3625
3596
|
} catch (C) {
|
|
3626
3597
|
if (x) return;
|
|
3627
3598
|
x = !0, console.error("[markdown-explorer] the draft converter's prepare threw", C);
|
|
3628
3599
|
}
|
|
3629
3600
|
}
|
|
3630
3601
|
};
|
|
3631
|
-
}), p = h === void 0 ? void 0 :
|
|
3602
|
+
}), p = h === void 0 ? void 0 : re, y = H(
|
|
3632
3603
|
() => ({
|
|
3633
|
-
config:
|
|
3604
|
+
config: K,
|
|
3634
3605
|
labels: k,
|
|
3635
|
-
locale:
|
|
3606
|
+
locale: v,
|
|
3636
3607
|
theme: E,
|
|
3637
3608
|
storageNamespace: n,
|
|
3638
3609
|
scope: e.scope,
|
|
3639
3610
|
sources: e.sources,
|
|
3640
|
-
notices:
|
|
3641
|
-
documents:
|
|
3642
|
-
trees:
|
|
3643
|
-
data:
|
|
3644
|
-
viewSettings:
|
|
3611
|
+
notices: A,
|
|
3612
|
+
documents: M.documents,
|
|
3613
|
+
trees: M.trees,
|
|
3614
|
+
data: M.data,
|
|
3615
|
+
viewSettings: a,
|
|
3645
3616
|
treeSettings: b,
|
|
3646
3617
|
announcer: s,
|
|
3647
|
-
reveals:
|
|
3648
|
-
edits:
|
|
3649
|
-
onEditGrant:
|
|
3618
|
+
reveals: w,
|
|
3619
|
+
edits: L,
|
|
3620
|
+
onEditGrant: d,
|
|
3650
3621
|
draftConverter: p,
|
|
3651
3622
|
renderTreeFailure: u,
|
|
3652
|
-
reportMathDiagnostics:
|
|
3623
|
+
reportMathDiagnostics: X
|
|
3653
3624
|
}),
|
|
3654
|
-
[
|
|
3625
|
+
[K, k, v, E, n, e.scope, e.sources, A, M, a, b, s, w, L, d, p, u, X]
|
|
3655
3626
|
);
|
|
3656
|
-
return /* @__PURE__ */
|
|
3657
|
-
},
|
|
3658
|
-
const [o] =
|
|
3659
|
-
return /* @__PURE__ */
|
|
3660
|
-
},
|
|
3661
|
-
const { theme: n, labels: r } = D(), o =
|
|
3662
|
-
|
|
3663
|
-
o.kind === "redirect" &&
|
|
3664
|
-
}, [o, i,
|
|
3627
|
+
return /* @__PURE__ */ c(bn, { value: y, children: /* @__PURE__ */ c(Ga, { renderFrame: l, lockDocumentScroll: m }, e.scope) });
|
|
3628
|
+
}, Za = ({ ref: e, theme: t, view: n, children: r }) => {
|
|
3629
|
+
const [o] = B(Ri);
|
|
3630
|
+
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 });
|
|
3631
|
+
}, Ga = ({ renderFrame: e, lockDocumentScroll: t }) => {
|
|
3632
|
+
const { theme: n, labels: r } = D(), o = st(), { hash: i } = sn(), l = Ie(), u = q(null);
|
|
3633
|
+
Aa(t, u), V(() => {
|
|
3634
|
+
o.kind === "redirect" && l(`${o.href}${i}`, "browse");
|
|
3635
|
+
}, [o, i, l]);
|
|
3665
3636
|
const { location: m } = o, f = m.view;
|
|
3666
|
-
|
|
3667
|
-
const
|
|
3668
|
-
|
|
3669
|
-
/* @__PURE__ */
|
|
3670
|
-
/* @__PURE__ */
|
|
3637
|
+
Pa(u, f);
|
|
3638
|
+
const d = m.view === "tree" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-split-fallback", "aria-label": r.explorerRegion, "aria-busy": "true", "data-testid": "markdown-explorer-split-loading", ...tt }), children: /* @__PURE__ */ c($a, { location: m }) }) : m.view === "multi" ? /* @__PURE__ */ c(ke, { fallback: /* @__PURE__ */ c("section", { className: "aqmx-stage-fallback", "aria-label": r.multiRegion, "aria-busy": "true", "data-testid": "markdown-explorer-stage-loading", ...tt }), children: /* @__PURE__ */ c(Fa, { location: m }) }) : /* @__PURE__ */ c(ua, { location: m }), h = /* @__PURE__ */ F(Za, { ref: u, theme: n, view: f, children: [
|
|
3639
|
+
d,
|
|
3640
|
+
/* @__PURE__ */ c(vo, {}),
|
|
3641
|
+
/* @__PURE__ */ c(fa, { holds: !0, testId: "markdown-explorer-announcer" })
|
|
3671
3642
|
] });
|
|
3672
3643
|
return e === void 0 ? h : e({ view: f, children: h });
|
|
3673
|
-
},
|
|
3644
|
+
}, cs = Ar({ submissions: "skip", otherPath: "skip", query: "skip", hashChange: "skip" });
|
|
3674
3645
|
export {
|
|
3675
|
-
|
|
3676
|
-
|
|
3677
|
-
|
|
3678
|
-
|
|
3679
|
-
|
|
3680
|
-
|
|
3681
|
-
|
|
3682
|
-
|
|
3646
|
+
Mt as $,
|
|
3647
|
+
ot as A,
|
|
3648
|
+
Xt as B,
|
|
3649
|
+
Vr as C,
|
|
3650
|
+
da as D,
|
|
3651
|
+
Hl as E,
|
|
3652
|
+
io as F,
|
|
3653
|
+
Gl as G,
|
|
3683
3654
|
Oe as H,
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3694
|
-
|
|
3695
|
-
|
|
3696
|
-
|
|
3697
|
-
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
3702
|
-
|
|
3703
|
-
|
|
3704
|
-
|
|
3705
|
-
|
|
3706
|
-
|
|
3707
|
-
|
|
3708
|
-
|
|
3709
|
-
|
|
3710
|
-
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3655
|
+
ls as I,
|
|
3656
|
+
Ci as J,
|
|
3657
|
+
Jr as K,
|
|
3658
|
+
Mn as L,
|
|
3659
|
+
Bo as M,
|
|
3660
|
+
dl as N,
|
|
3661
|
+
Cl as O,
|
|
3662
|
+
ca as P,
|
|
3663
|
+
Io as Q,
|
|
3664
|
+
_l as R,
|
|
3665
|
+
Fo as S,
|
|
3666
|
+
st as T,
|
|
3667
|
+
fa as U,
|
|
3668
|
+
Ne as V,
|
|
3669
|
+
Nr as W,
|
|
3670
|
+
At as X,
|
|
3671
|
+
Fr as Y,
|
|
3672
|
+
gn as Z,
|
|
3673
|
+
Dr as _,
|
|
3674
|
+
Hr as a,
|
|
3675
|
+
ss as a0,
|
|
3676
|
+
Lt as a1,
|
|
3677
|
+
cs as a2,
|
|
3678
|
+
Ur as b,
|
|
3679
|
+
Ie as c,
|
|
3680
|
+
al as d,
|
|
3681
|
+
tt as e,
|
|
3682
|
+
Rl as f,
|
|
3683
|
+
Lo as g,
|
|
3684
|
+
Zr as h,
|
|
3685
|
+
Po as i,
|
|
3686
|
+
Mo as j,
|
|
3687
|
+
ae as k,
|
|
3688
|
+
$o as l,
|
|
3718
3689
|
ue as m,
|
|
3719
|
-
|
|
3720
|
-
|
|
3690
|
+
Oo as n,
|
|
3691
|
+
Co as o,
|
|
3721
3692
|
me as p,
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3693
|
+
ho as q,
|
|
3694
|
+
so as r,
|
|
3695
|
+
Zl as s,
|
|
3696
|
+
is as t,
|
|
3726
3697
|
D as u,
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3698
|
+
Ao as v,
|
|
3699
|
+
as as w,
|
|
3700
|
+
yn as x,
|
|
3701
|
+
Wl as y,
|
|
3702
|
+
Kl as z
|
|
3732
3703
|
};
|