@8wave/ai-elements 0.121.0-beta.39 → 0.121.0-beta.40
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/README.md +67 -15
- package/dist/_chunks/{Agent-C3m0UmlL.js → Agent-BuPgJIt4.js} +203 -202
- package/dist/_chunks/Agent-BuPgJIt4.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown--PCkA4Fg.js → PkStreamingMarkdown-D2aqCD0I.js} +953 -927
- package/dist/_chunks/PkStreamingMarkdown-D2aqCD0I.js.map +1 -0
- package/dist/_chunks/{PkToolEditSpreadsheet-DAMWWIVt.js → PkToolEditSpreadsheet-83ZdmGeA.js} +2 -2
- package/dist/_chunks/{PkToolEditSpreadsheet-DAMWWIVt.js.map → PkToolEditSpreadsheet-83ZdmGeA.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestGeolocation-BgsvQb7Q.js → PkToolRequestGeolocation-1cOmCG8P.js} +2 -2
- package/dist/_chunks/{PkToolRequestGeolocation-BgsvQb7Q.js.map → PkToolRequestGeolocation-1cOmCG8P.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-DtuZw7yk.js → PkToolRequestOAuthConnection-CCu3FCyo.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-DtuZw7yk.js.map → PkToolRequestOAuthConnection-CCu3FCyo.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-B163OvqY.js → PkToolShowArtifact-CiYkZkpe.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-B163OvqY.js.map → PkToolShowArtifact-CiYkZkpe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowContactForm-C_ptr7Xs.js → PkToolShowContactForm-D7TEzrYe.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-C_ptr7Xs.js.map → PkToolShowContactForm-D7TEzrYe.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-fburTpQm.js → PkToolShowForm-CSh4Q6sl.js} +5 -5
- package/dist/_chunks/{PkToolShowForm-fburTpQm.js.map → PkToolShowForm-CSh4Q6sl.js.map} +1 -1
- package/dist/_chunks/{PkToolShowImageGallery-ChauJukk.js → PkToolShowImageGallery-CQEaEfYE.js} +2 -2
- package/dist/_chunks/{PkToolShowImageGallery-ChauJukk.js.map → PkToolShowImageGallery-CQEaEfYE.js.map} +1 -1
- package/dist/_chunks/{PkToolShowProductList-B_XZezYw.js → PkToolShowProductList-BCmULLct.js} +2 -2
- package/dist/_chunks/{PkToolShowProductList-B_XZezYw.js.map → PkToolShowProductList-BCmULLct.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-CS4nEuL0.js → PkToolShowSources-R9KWsfTQ.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-CS4nEuL0.js.map → PkToolShowSources-R9KWsfTQ.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-BIe56XdA.js → PkToolShowSuggestedReply-DYZz9aV2.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-BIe56XdA.js.map → PkToolShowSuggestedReply-DYZz9aV2.js.map} +1 -1
- package/dist/_chunks/{PkToolShowVideo-DzU1XJqv.js → PkToolShowVideo-C_9SZtZM.js} +2 -2
- package/dist/_chunks/{PkToolShowVideo-DzU1XJqv.js.map → PkToolShowVideo-C_9SZtZM.js.map} +1 -1
- package/dist/_chunks/{PkToolShowWebPages-BlKe8Arf.js → PkToolShowWebPages-DwRYfle9.js} +2 -2
- package/dist/_chunks/{PkToolShowWebPages-BlKe8Arf.js.map → PkToolShowWebPages-DwRYfle9.js.map} +1 -1
- package/dist/_chunks/{chatImagePolicy-ChSkpiw6.js → chatImagePolicy-CQYTWTkP.js} +2 -2
- package/dist/_chunks/{chatImagePolicy-ChSkpiw6.js.map → chatImagePolicy-CQYTWTkP.js.map} +1 -1
- package/dist/_chunks/{markdown-D3iMlF6T.js → markdown-Br9ROCBT.js} +2 -2
- package/dist/_chunks/{markdown-D3iMlF6T.js.map → markdown-Br9ROCBT.js.map} +1 -1
- package/dist/ai-elements.es.js +4378 -3756
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotEmptyState.js +1 -1
- package/dist-vue/PkChatbotInput.js +1 -1
- package/dist-vue/PkChatbotMessages.js +1 -1
- package/dist-vue/PkChatbotStepPayload.js +1 -1
- package/dist-vue/PkChatbotStepToolDetail.js +1 -1
- package/dist-vue/PkChatbotSteps.js +1 -1
- package/dist-vue/PkChatbotViewChat.js +1 -1
- package/dist-vue/PkChatbotViewConversations.js +1 -1
- package/dist-vue/PkChatbotViewFiles.js +1 -1
- package/dist-vue/PkChatbotViewProfile.js +1 -1
- package/dist-vue/_chunks/{Agent-3IHYHv05.js → Agent-DZb775Ak.js} +193 -192
- package/dist-vue/_chunks/Agent-DZb775Ak.js.map +1 -0
- package/dist-vue/_chunks/{Document-B0A_y6N5.js → Document-E72l_VU6.js} +2 -2
- package/dist-vue/_chunks/{Document-B0A_y6N5.js.map → Document-E72l_VU6.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbot-Bu76hH4F.js → PkChatbot-DIqduIwr.js} +9 -9
- package/dist-vue/_chunks/{PkChatbot-Bu76hH4F.js.map → PkChatbot-DIqduIwr.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotEmptyState-ilPJoYjk.js → PkChatbotEmptyState-Dh7ETVnf.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-ilPJoYjk.js.map → PkChatbotEmptyState-Dh7ETVnf.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-CY0YRGkG.js → PkChatbotInput-BJHtmPR-.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-CY0YRGkG.js.map → PkChatbotInput-BJHtmPR-.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotMessages-DMSActW1.js +968 -0
- package/dist-vue/_chunks/PkChatbotMessages-DMSActW1.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-CiEcIlzW.js → PkChatbotStepPayload-CXdsUMrw.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-CiEcIlzW.js.map → PkChatbotStepPayload-CXdsUMrw.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-VqLkuWi7.js → PkChatbotStepToolDetail-DbpXR7jh.js} +16 -16
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-VqLkuWi7.js.map → PkChatbotStepToolDetail-DbpXR7jh.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-QFFZ0DjH.js +189 -0
- package/dist-vue/_chunks/PkChatbotSteps-QFFZ0DjH.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-t-XkwFbe.js → PkChatbotViewChat-BI_PtT72.js} +300 -298
- package/dist-vue/_chunks/PkChatbotViewChat-BI_PtT72.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewConversations-CgRMohUQ.js → PkChatbotViewConversations-Bg4jSO9a.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewConversations-CgRMohUQ.js.map → PkChatbotViewConversations-Bg4jSO9a.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-DkeysDGW.js → PkChatbotViewFiles-Cwm-JQMF.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-DkeysDGW.js.map → PkChatbotViewFiles-Cwm-JQMF.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-kgqu10ED.js → PkChatbotViewProfile-C_GElIM3.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-kgqu10ED.js.map → PkChatbotViewProfile-C_GElIM3.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-CDlpb5w0.js → PkStreamingMarkdown-DwDs-cGP.js} +3 -3
- package/dist-vue/_chunks/{PkStreamingMarkdown-CDlpb5w0.js.map → PkStreamingMarkdown-DwDs-cGP.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-D0EPgCmp.js → PkToolEditSpreadsheet-B61LtERY.js} +2 -2
- package/dist-vue/_chunks/{PkToolEditSpreadsheet-D0EPgCmp.js.map → PkToolEditSpreadsheet-B61LtERY.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DZnJd1od.js → PkToolRequestGeolocation-DC8hSH0j.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestGeolocation-DZnJd1od.js.map → PkToolRequestGeolocation-DC8hSH0j.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C8MGtBlh.js → PkToolRequestOAuthConnection-BH_-drvw.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-C8MGtBlh.js.map → PkToolRequestOAuthConnection-BH_-drvw.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-CtXB1-vJ.js → PkToolShowArtifact-CjVN96wJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-CtXB1-vJ.js.map → PkToolShowArtifact-CjVN96wJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowContactForm-DlZdfcNw.js → PkToolShowContactForm-CmBLigw8.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-DlZdfcNw.js.map → PkToolShowContactForm-CmBLigw8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-BUUjmUpE.js → PkToolShowDiagram-dKUU5_6F.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-BUUjmUpE.js.map → PkToolShowDiagram-dKUU5_6F.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-DxiiMSCC.js → PkToolShowForm-B6ESvq-5.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-DxiiMSCC.js.map → PkToolShowForm-B6ESvq-5.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowImageGallery-D01aM-9U.js → PkToolShowImageGallery-Daq0IwTH.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowImageGallery-D01aM-9U.js.map → PkToolShowImageGallery-Daq0IwTH.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-BRMF3WJf.js → PkToolShowProductList-Bc3Gzyxy.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-BRMF3WJf.js.map → PkToolShowProductList-Bc3Gzyxy.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-C0_MwX7m.js → PkToolShowSources-BDvRbenn.js} +3 -3
- package/dist-vue/_chunks/{PkToolShowSources-C0_MwX7m.js.map → PkToolShowSources-BDvRbenn.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BcjKYwbk.js → PkToolShowSuggestedReply-Cd6VkzvJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-BcjKYwbk.js.map → PkToolShowSuggestedReply-Cd6VkzvJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowVideo-CjjoQH7j.js → PkToolShowVideo-Bo1gsD97.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowVideo-CjjoQH7j.js.map → PkToolShowVideo-Bo1gsD97.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-B5reGh4g.js → PkToolShowWebPages-DI3sZiqh.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-B5reGh4g.js.map → PkToolShowWebPages-DI3sZiqh.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-DcLpptlt.js → createChatbotApiClient-DUz4dwzY.js} +12 -12
- package/dist-vue/_chunks/{createChatbotApiClient-DcLpptlt.js.map → createChatbotApiClient-DUz4dwzY.js.map} +1 -1
- package/dist-vue/_chunks/{useChatbotStore-BliRphuB.js → useChatbotStore-D7LcpA-6.js} +481 -455
- package/dist-vue/_chunks/useChatbotStore-D7LcpA-6.js.map +1 -0
- package/dist-vue/_chunks/{utils-C7-KrzRE.js → utils-EPX3V3VI.js} +112 -86
- package/dist-vue/_chunks/utils-EPX3V3VI.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +2 -0
- package/dist-vue/apps/web-component/src/components/FloatingChatWidget.ce.d.ts +2 -0
- package/dist-vue/apps/web-component/src/composables/usePageTools.d.ts +1 -0
- package/dist-vue/apps/web-component/src/lib.d.ts +10 -0
- package/dist-vue/apps/web-component/src/pageTools/actions.d.ts +2 -0
- package/dist-vue/apps/web-component/src/pageTools/announcements.d.ts +9 -0
- package/dist-vue/apps/web-component/src/pageTools/index.d.ts +12 -1
- package/dist-vue/apps/web-component/src/pageTools/navigation.d.ts +40 -8
- package/dist-vue/apps/web-component/src/pageTools/snapshot.d.ts +60 -0
- package/dist-vue/composables.js +34 -8
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +145 -125
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +28 -2
- package/dist-vue/packages/components/src/PkEditorPrompt.d.ts +6 -0
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +4 -0
- package/dist-vue/packages/components/src/chat/PkHostCallConfirmCard.d.ts +7 -1
- package/dist-vue/packages/components/src/chat/PkHostCallConfirmDialog.d.ts +4 -0
- package/dist-vue/packages/components/src/chat/PkPageControlBar.d.ts +5 -1
- package/dist-vue/packages/components/src/chat/utils.d.ts +11 -1
- package/dist-vue/packages/composable/src/chatbot/hostTools.d.ts +37 -8
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +8 -2
- package/dist-vue/packages/models/src/schema/PageAccess.d.ts +9 -0
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-C3m0UmlL.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown--PCkA4Fg.js.map +0 -1
- package/dist-vue/_chunks/Agent-3IHYHv05.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-BfKqJ8n_.js +0 -954
- package/dist-vue/_chunks/PkChatbotMessages-BfKqJ8n_.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-CoDtEaL7.js +0 -189
- package/dist-vue/_chunks/PkChatbotSteps-CoDtEaL7.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotViewChat-t-XkwFbe.js.map +0 -1
- package/dist-vue/_chunks/useChatbotStore-BliRphuB.js.map +0 -1
- package/dist-vue/_chunks/utils-C7-KrzRE.js.map +0 -1
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { F as e, I as t, P as n, R as r, Y as i, Z as a, at as o, h as s, k as c, w as l, y as u, yt as d } from "./vue.runtime.esm-bundler-BkvITeKg.js";
|
|
2
2
|
import { r as f } from "./vue-i18n-BoTyYk8j.js";
|
|
3
3
|
import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
|
|
4
|
-
import {
|
|
4
|
+
import { P as m, _ as te, f as ne, g as re, t as ie, u as ae } from "./Agent-BuPgJIt4.js";
|
|
5
5
|
import "./src-Ra4oUpUU.js";
|
|
6
|
-
import { n as
|
|
7
|
-
import { n as
|
|
8
|
-
import { x as
|
|
9
|
-
import { n as
|
|
10
|
-
import { t as
|
|
11
|
-
import { n as
|
|
6
|
+
import { n as h, t as g } from "./text-BHCGblDQ.js";
|
|
7
|
+
import { n as _ } from "./url-validation-9DstIfq2.js";
|
|
8
|
+
import { x as oe } from "./dist-Do_Ac5Yv.js";
|
|
9
|
+
import { n as se } from "./useShortUrlResolver-BGoPo6JO.js";
|
|
10
|
+
import { t as ce } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
11
|
+
import { n as v } from "./chatImagePolicy-CQYTWTkP.js";
|
|
12
12
|
//#region ../../packages/utils/src/citations.ts
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
return e && e.replace(
|
|
13
|
+
var y = /[ \t]*\uE200[^\uE201]*\uE201/g, le = /(?<![ \t])[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, ue = /[\uE200-\uE20F]/g;
|
|
14
|
+
function de(e) {
|
|
15
|
+
return e && e.replace(y, "").replace(le, "").replace(ue, "");
|
|
16
16
|
}
|
|
17
17
|
//#endregion
|
|
18
18
|
//#region ../../packages/utils/src/message.ts
|
|
19
|
-
function
|
|
19
|
+
function fe(e) {
|
|
20
20
|
return e ? e.type === "text" : !1;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function b(e) {
|
|
23
23
|
return e ? e.type.startsWith("tool-") : !1;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
return
|
|
25
|
+
function pe(e) {
|
|
26
|
+
return b(e) ? e.type.slice(5) : "";
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function x(e) {
|
|
29
29
|
return e ? e.type === "file" : !1;
|
|
30
30
|
}
|
|
31
|
-
function
|
|
32
|
-
if (!
|
|
31
|
+
function me(e) {
|
|
32
|
+
if (!x(e)) return;
|
|
33
33
|
let t = e.providerMetadata?.["8bot"]?.media;
|
|
34
34
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
35
35
|
}
|
|
36
|
-
function
|
|
37
|
-
if (!
|
|
36
|
+
function he(e) {
|
|
37
|
+
if (!x(e)) return;
|
|
38
38
|
let t = e.providerMetadata?.["8bot"]?.transcript;
|
|
39
39
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function ge(e, t) {
|
|
42
42
|
return e.map((e) => {
|
|
43
43
|
let n = t.filter((t) => t.messageId === e.id);
|
|
44
44
|
return n.length === 0 ? e : {
|
|
45
45
|
...e,
|
|
46
46
|
parts: e.parts.map((e) => {
|
|
47
|
-
let t = n.find(({ storedFileName: t }) => t ===
|
|
48
|
-
return t &&
|
|
47
|
+
let t = n.find(({ storedFileName: t }) => t === me(e)?.storedFileName);
|
|
48
|
+
return t && x(e) ? {
|
|
49
49
|
...e,
|
|
50
50
|
providerMetadata: {
|
|
51
51
|
...e.providerMetadata,
|
|
@@ -59,50 +59,50 @@ function he(e, t) {
|
|
|
59
59
|
};
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
|
-
function ge(e) {
|
|
63
|
-
return e ? e.type === "reasoning" : !1;
|
|
64
|
-
}
|
|
65
62
|
function _e(e) {
|
|
66
|
-
return e ? e.
|
|
63
|
+
return e ? e.type === "reasoning" : !1;
|
|
67
64
|
}
|
|
68
65
|
function ve(e) {
|
|
66
|
+
return e ? e.parts.some((e) => fe(e)) : !1;
|
|
67
|
+
}
|
|
68
|
+
function ye(e) {
|
|
69
69
|
if (!e) return;
|
|
70
70
|
let t = e.parts;
|
|
71
|
-
if (Array.isArray(t)) return t.find((e) =>
|
|
71
|
+
if (Array.isArray(t)) return t.find((e) => fe(e))?.text;
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
74
|
//#region ../../packages/components/src/chat/utils.ts
|
|
75
|
-
function
|
|
75
|
+
function S(e) {
|
|
76
76
|
let t = [];
|
|
77
77
|
for (let n of e) {
|
|
78
|
-
if (!
|
|
78
|
+
if (!fe(n)) {
|
|
79
79
|
t.push(n);
|
|
80
80
|
continue;
|
|
81
81
|
}
|
|
82
82
|
let e = t[t.length - 1];
|
|
83
|
-
e &&
|
|
83
|
+
e && fe(e) ? t[t.length - 1] = {
|
|
84
84
|
...e,
|
|
85
85
|
text: e.text + n.text
|
|
86
86
|
} : t.push(n);
|
|
87
87
|
}
|
|
88
88
|
return t;
|
|
89
89
|
}
|
|
90
|
-
var
|
|
91
|
-
function
|
|
90
|
+
var be = (e) => b(e) && te(pe(e));
|
|
91
|
+
function xe(e) {
|
|
92
92
|
let t = /* @__PURE__ */ new Map();
|
|
93
|
-
for (let [n, r] of e.entries())
|
|
94
|
-
return e.filter((e, n) => !(
|
|
93
|
+
for (let [n, r] of e.entries()) be(r) && r.state !== "output-error" && !T(r) && t.set(r.type, n);
|
|
94
|
+
return e.filter((e, n) => !(be(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
|
|
95
95
|
}
|
|
96
|
-
var
|
|
97
|
-
function
|
|
98
|
-
let t = e.filter((e) =>
|
|
99
|
-
return t.length > 0 ? [...e.filter((e) => !
|
|
96
|
+
var Se = /* @__PURE__ */ new Set(["tool-editSpreadsheet", "tool-shareDocument"]);
|
|
97
|
+
function Ce(e) {
|
|
98
|
+
let t = e.filter((e) => Se.has(e.type));
|
|
99
|
+
return t.length > 0 ? [...e.filter((e) => !Se.has(e.type)), ...t] : e;
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function we(e, t) {
|
|
102
102
|
let n = e.toolCallId;
|
|
103
|
-
return
|
|
103
|
+
return Se.has(e.type) && n ? `file-${n}` : t;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function C(e) {
|
|
106
106
|
return m(e) ? e : void 0;
|
|
107
107
|
}
|
|
108
108
|
var Te = {
|
|
@@ -125,22 +125,46 @@ var Te = {
|
|
|
125
125
|
page_scroll: {
|
|
126
126
|
icon: "ri:arrow-up-down-line",
|
|
127
127
|
label: "messagePart.pageTool.scroll"
|
|
128
|
+
},
|
|
129
|
+
page_find: {
|
|
130
|
+
icon: "ri:search-line",
|
|
131
|
+
label: "messagePart.pageTool.find"
|
|
132
|
+
},
|
|
133
|
+
page_wait: {
|
|
134
|
+
icon: "ri:time-line",
|
|
135
|
+
label: "messagePart.pageTool.wait"
|
|
136
|
+
},
|
|
137
|
+
page_hover: {
|
|
138
|
+
icon: "ri:cursor-line",
|
|
139
|
+
label: "messagePart.pageTool.hover"
|
|
140
|
+
},
|
|
141
|
+
page_press: {
|
|
142
|
+
icon: "ri:keyboard-line",
|
|
143
|
+
label: "messagePart.pageTool.press"
|
|
144
|
+
},
|
|
145
|
+
page_back: {
|
|
146
|
+
icon: "ri:arrow-go-back-line",
|
|
147
|
+
label: "messagePart.pageTool.back"
|
|
148
|
+
},
|
|
149
|
+
page_navigate: {
|
|
150
|
+
icon: "ri:links-line",
|
|
151
|
+
label: "messagePart.pageTool.navigate"
|
|
128
152
|
}
|
|
129
|
-
}, Ee = {
|
|
153
|
+
}, Ee = Symbol("hostStepTitles"), De = {
|
|
130
154
|
icon: "ri:survey-line",
|
|
131
155
|
label: "messagePart.pageTool.form"
|
|
132
|
-
},
|
|
133
|
-
function w(e) {
|
|
134
|
-
return we(e)?.toolMetadata?.readOnly === !1;
|
|
135
|
-
}
|
|
156
|
+
}, w = (e) => e.toolMetadata?.provider === "page" ? Te[e.toolName] ?? (e.toolName.startsWith("form_") ? De : void 0) : void 0;
|
|
136
157
|
function Oe(e) {
|
|
158
|
+
return C(e)?.toolMetadata?.readOnly === !1;
|
|
159
|
+
}
|
|
160
|
+
function T(e) {
|
|
137
161
|
return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
|
|
138
162
|
}
|
|
139
|
-
var
|
|
140
|
-
function
|
|
163
|
+
var ke = 4e3, E = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
|
|
164
|
+
function Ae(e, t) {
|
|
141
165
|
if (e.length <= t) return e;
|
|
142
166
|
let n = e.length - t, r = n + t / 2, i = (e, t) => e !== -1 && e < r ? e + t : void 0, a = i(e.indexOf("\n\n", n), 2) ?? i(e.indexOf("\n", n), 1) ?? n, o;
|
|
143
|
-
for (let t of e.matchAll(
|
|
167
|
+
for (let t of e.matchAll(E)) {
|
|
144
168
|
if (t.index >= a) break;
|
|
145
169
|
let [, e, n] = t;
|
|
146
170
|
if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
|
|
@@ -151,34 +175,34 @@ function E(e, t) {
|
|
|
151
175
|
}
|
|
152
176
|
return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
|
|
153
177
|
}
|
|
154
|
-
var
|
|
178
|
+
var je = /* @__PURE__ */ new Set([
|
|
155
179
|
"approval-requested",
|
|
156
180
|
"approval-responded",
|
|
157
181
|
"output-denied"
|
|
158
182
|
]);
|
|
159
|
-
function
|
|
160
|
-
return
|
|
161
|
-
}
|
|
162
|
-
var Me = "requestConfirm";
|
|
163
|
-
function Ne(e) {
|
|
164
|
-
return x(e) && e.type === "tool-requestConfirm";
|
|
183
|
+
function Me(e) {
|
|
184
|
+
return b(e) ? je.has(e.state) ? !0 : e.approval != null : !1;
|
|
165
185
|
}
|
|
186
|
+
var Ne = "requestConfirm";
|
|
166
187
|
function Pe(e) {
|
|
167
|
-
return
|
|
188
|
+
return b(e) && e.type === "tool-requestConfirm";
|
|
168
189
|
}
|
|
169
190
|
function Fe(e) {
|
|
170
|
-
|
|
191
|
+
return Me(e) || Pe(e);
|
|
171
192
|
}
|
|
172
193
|
function Ie(e) {
|
|
194
|
+
if (b(e)) return e.approval?.id;
|
|
195
|
+
}
|
|
196
|
+
function Le(e) {
|
|
173
197
|
if (e && "state" in e) return e.state;
|
|
174
198
|
}
|
|
175
|
-
function
|
|
199
|
+
function Re(e = "000000") {
|
|
176
200
|
let t = e.replace("#", "");
|
|
177
201
|
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
178
202
|
let n = parseInt(t.substring(0, 2), 16) / 255, r = parseInt(t.substring(2, 4), 16) / 255, i = parseInt(t.substring(4, 6), 16) / 255, a = (e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
|
|
179
203
|
return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
|
|
180
204
|
}
|
|
181
|
-
function
|
|
205
|
+
function ze(e) {
|
|
182
206
|
let t = e?.trim().replace("#", "") ?? "";
|
|
183
207
|
if (/^[0-9a-f]{3}$/i.test(t) && (t = t.split("").map((e) => e + e).join("")), !/^[0-9a-f]{6}$/i.test(t)) return !1;
|
|
184
208
|
let n = [
|
|
@@ -188,10 +212,10 @@ function Le(e) {
|
|
|
188
212
|
].map((e) => parseInt(t.substring(e, e + 2), 16));
|
|
189
213
|
return Math.max(...n) - Math.min(...n) < 32;
|
|
190
214
|
}
|
|
191
|
-
function
|
|
192
|
-
return e === "white" || e === "black" ? e :
|
|
215
|
+
function Be(e, t) {
|
|
216
|
+
return e === "white" || e === "black" ? e : Re(t);
|
|
193
217
|
}
|
|
194
|
-
function
|
|
218
|
+
function Ve(e, t) {
|
|
195
219
|
if (e) return {
|
|
196
220
|
"--chatbot-main-color": e,
|
|
197
221
|
"--chatbot-contrast-color": t,
|
|
@@ -200,10 +224,10 @@ function ze(e, t) {
|
|
|
200
224
|
"--input-focus-color": "var(--color-brand-graphic)"
|
|
201
225
|
};
|
|
202
226
|
}
|
|
203
|
-
function
|
|
227
|
+
function He(e, t) {
|
|
204
228
|
if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
|
|
205
229
|
}
|
|
206
|
-
function
|
|
230
|
+
function Ue(e) {
|
|
207
231
|
if (e !== void 0) {
|
|
208
232
|
if (typeof e == "string") return e.trim() || void 0;
|
|
209
233
|
try {
|
|
@@ -214,10 +238,10 @@ function Ve(e) {
|
|
|
214
238
|
}
|
|
215
239
|
}
|
|
216
240
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
241
|
+
function We(e) {
|
|
242
|
+
return Ue(e) !== void 0;
|
|
219
243
|
}
|
|
220
|
-
function
|
|
244
|
+
function Ge(e, t) {
|
|
221
245
|
let n = e?.input;
|
|
222
246
|
if (typeof t == "string") {
|
|
223
247
|
let e = n?.question ?? n?.steps?.[0]?.question;
|
|
@@ -229,14 +253,14 @@ function Ue(e, t) {
|
|
|
229
253
|
return i ? `${i} ${n}` : n;
|
|
230
254
|
}).join(". ");
|
|
231
255
|
}
|
|
232
|
-
function
|
|
256
|
+
function Ke(e) {
|
|
233
257
|
return e?.options ? e.options.map((e) => ({
|
|
234
258
|
label: e.label,
|
|
235
259
|
value: e.label,
|
|
236
260
|
description: e.description
|
|
237
261
|
})) : [];
|
|
238
262
|
}
|
|
239
|
-
function
|
|
263
|
+
function qe(e, t) {
|
|
240
264
|
let n = {};
|
|
241
265
|
if (t == null) return n;
|
|
242
266
|
if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
|
|
@@ -252,7 +276,7 @@ function Ge(e, t) {
|
|
|
252
276
|
for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
|
|
253
277
|
return n;
|
|
254
278
|
}
|
|
255
|
-
var
|
|
279
|
+
var Je = re.map((e) => `tool-${e}`), Ye = /* @__PURE__ */ new Set([
|
|
256
280
|
"tool-searchInKnowledgeBase",
|
|
257
281
|
"tool-retrieveRevisedAnswers",
|
|
258
282
|
"tool-expandChunkContext",
|
|
@@ -261,60 +285,60 @@ var Ke = ne.map((e) => `tool-${e}`), qe = /* @__PURE__ */ new Set([
|
|
|
261
285
|
"tool-geocode",
|
|
262
286
|
"tool-recallUserMemory",
|
|
263
287
|
"tool-saveUserMemory",
|
|
264
|
-
...
|
|
288
|
+
...Je
|
|
265
289
|
]);
|
|
266
|
-
function
|
|
267
|
-
return
|
|
290
|
+
function Xe(e) {
|
|
291
|
+
return b(e) && Ye.has(e.type);
|
|
268
292
|
}
|
|
269
|
-
var
|
|
293
|
+
var Ze = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, D = (e, ...t) => {
|
|
270
294
|
for (let n of t) {
|
|
271
295
|
let t = e?.[n];
|
|
272
296
|
if (typeof t == "string" && t.trim()) return t;
|
|
273
297
|
}
|
|
274
298
|
};
|
|
275
|
-
function
|
|
276
|
-
if (!
|
|
277
|
-
let t =
|
|
278
|
-
if (e.type === "tool-searchInKnowledgeBase" ||
|
|
299
|
+
function Qe(e) {
|
|
300
|
+
if (!b(e)) return;
|
|
301
|
+
let t = Ze("input" in e ? e.input : void 0), n = Ze("output" in e ? e.output : void 0);
|
|
302
|
+
if (e.type === "tool-searchInKnowledgeBase" || Je.includes(e.type)) {
|
|
279
303
|
let e = t?.queries;
|
|
280
304
|
if (Array.isArray(e)) {
|
|
281
305
|
let t = e.filter((e) => typeof e == "string" && !!e.trim());
|
|
282
306
|
return t.length ? t.join(" · ") : void 0;
|
|
283
307
|
}
|
|
284
|
-
return
|
|
308
|
+
return D(t, "query", "objective");
|
|
285
309
|
}
|
|
286
|
-
if (e.type === "tool-retrieveRevisedAnswers") return
|
|
287
|
-
if (e.type === "tool-getWeather") return
|
|
288
|
-
if (e.type === "tool-geocode") return
|
|
289
|
-
if (e.type === "tool-expandChunkContext") return
|
|
290
|
-
if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment" || e.type === "tool-sendChatFile" || e.type === "tool-shareDocument") return
|
|
310
|
+
if (e.type === "tool-retrieveRevisedAnswers") return D(t, "query");
|
|
311
|
+
if (e.type === "tool-getWeather") return D(n, "location") ?? D(t, "locationName");
|
|
312
|
+
if (e.type === "tool-geocode") return D(t, "locationName");
|
|
313
|
+
if (e.type === "tool-expandChunkContext") return D(n, "documentName");
|
|
314
|
+
if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment" || e.type === "tool-sendChatFile" || e.type === "tool-shareDocument") return D(n, "name");
|
|
291
315
|
if (e.type === "tool-readSpreadsheet") {
|
|
292
|
-
let e =
|
|
316
|
+
let e = D(t, "sheet"), n = D(t, "range");
|
|
293
317
|
return e && n ? `${e}!${n}` : e;
|
|
294
318
|
}
|
|
295
|
-
if (e.type === "tool-editSpreadsheet") return
|
|
296
|
-
if (e.type === "tool-querySpreadsheet") return
|
|
297
|
-
if (e.type === "tool-recallUserMemory") return
|
|
298
|
-
if (e.type === "tool-saveUserMemory") return
|
|
319
|
+
if (e.type === "tool-editSpreadsheet") return D(n, "filename");
|
|
320
|
+
if (e.type === "tool-querySpreadsheet") return D(n, "file");
|
|
321
|
+
if (e.type === "tool-recallUserMemory") return D(t, "query");
|
|
322
|
+
if (e.type === "tool-saveUserMemory") return D(t, "content", "query");
|
|
299
323
|
}
|
|
300
|
-
function
|
|
301
|
-
let t =
|
|
302
|
-
if (t) return
|
|
303
|
-
if (
|
|
304
|
-
if (
|
|
305
|
-
if (
|
|
324
|
+
function $e(e) {
|
|
325
|
+
let t = C(e);
|
|
326
|
+
if (t) return w(t)?.icon ?? "ri:apps-line";
|
|
327
|
+
if (b(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-scheduleWakeup" ? "ri:alarm-line" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-readEarlierMessages" ? "ri:history-line" : e.type === "tool-readChatAttachment" ? "ri:attachment-line" : e.type === "tool-sendChatFile" ? "ri:send-plane-line" : e.type === "tool-enableTools" ? "ri:toggle-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-shareDocument" ? "ri:file-download-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-requestAccountLink" ? "ri:link" : e.type === "tool-unlinkAccount" ? "ri:link-unlink" : Je.includes(e.type) ? "ri:global-line" : "ri:tools-line";
|
|
328
|
+
if (_e(e)) return "ri:lightbulb-line";
|
|
329
|
+
if (fe(e)) return "ri:double-quotes-r";
|
|
306
330
|
}
|
|
307
|
-
var
|
|
308
|
-
re,
|
|
331
|
+
var et = [
|
|
309
332
|
ie,
|
|
310
|
-
|
|
333
|
+
ae,
|
|
334
|
+
ne
|
|
311
335
|
];
|
|
312
|
-
function
|
|
336
|
+
function tt(e, { t, te: n }) {
|
|
313
337
|
if (n(`agent.tool.${e}`)) return t(`agent.tool.${e}`);
|
|
314
|
-
let r =
|
|
315
|
-
return
|
|
338
|
+
let r = et.find((t) => e.startsWith(t)), i = r ? e.slice(r.length) : e;
|
|
339
|
+
return g(h(i).trim().toLowerCase());
|
|
316
340
|
}
|
|
317
|
-
var
|
|
341
|
+
var nt = {
|
|
318
342
|
custom: (e) => e("messagePart.type.custom"),
|
|
319
343
|
data: (e) => e("messagePart.type.data"),
|
|
320
344
|
file: (e) => e("messagePart.type.file"),
|
|
@@ -324,13 +348,13 @@ var et = {
|
|
|
324
348
|
"step-start": (e) => e("messagePart.type.stepStart"),
|
|
325
349
|
text: (e) => e("messagePart.type.text")
|
|
326
350
|
};
|
|
327
|
-
function
|
|
328
|
-
if (
|
|
329
|
-
if (e.type === "dynamic-tool") return
|
|
330
|
-
let n =
|
|
331
|
-
return n ? n(t.t) :
|
|
351
|
+
function rt(e, t) {
|
|
352
|
+
if (b(e)) return tt(pe(e), t);
|
|
353
|
+
if (e.type === "dynamic-tool") return tt(e.toolName, t);
|
|
354
|
+
let n = nt[e.type.startsWith("data-") ? "data" : e.type];
|
|
355
|
+
return n ? n(t.t) : g(h(e.type));
|
|
332
356
|
}
|
|
333
|
-
function
|
|
357
|
+
function it(e, t) {
|
|
334
358
|
if (!e) return e;
|
|
335
359
|
let n = {
|
|
336
360
|
Intent: t("conversationSummary.intent"),
|
|
@@ -340,42 +364,44 @@ function nt(e, t) {
|
|
|
340
364
|
};
|
|
341
365
|
return e.replace(/\*\*(Intent|Topics covered|Key facts|Open questions)(:?)\*\*/g, (e, t, r) => `**${n[t]}${r}**`);
|
|
342
366
|
}
|
|
343
|
-
function
|
|
344
|
-
let
|
|
345
|
-
if (
|
|
346
|
-
let t =
|
|
347
|
-
|
|
367
|
+
function at(e, t, n) {
|
|
368
|
+
let r = C(t);
|
|
369
|
+
if (r) {
|
|
370
|
+
let t = r.toolCallId ? n?.[r.toolCallId] : void 0;
|
|
371
|
+
if (t) return t;
|
|
372
|
+
let i = w(r);
|
|
373
|
+
return i ? e(i.label) : r.title || r.toolName;
|
|
348
374
|
}
|
|
349
|
-
return
|
|
375
|
+
return b(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-scheduleWakeup" ? e("messagePart.scheduleWakeup") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-readEarlierMessages" ? e("messagePart.readEarlierMessages") : t.type === "tool-readChatAttachment" ? e("messagePart.readChatAttachment") : t.type === "tool-sendChatFile" ? e("messagePart.sendChatFile") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-shareDocument" ? e("messagePart.shareDocument") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : t.type === "tool-requestAccountLink" ? e("messagePart.requestAccountLink") : t.type === "tool-unlinkAccount" ? e("messagePart.unlinkAccount") : Je.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : _e(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
|
|
350
376
|
}
|
|
351
377
|
//#endregion
|
|
352
378
|
//#region ../../node_modules/.pnpm/remend@1.4.0/node_modules/remend/dist/index.js
|
|
353
|
-
var
|
|
379
|
+
var ot = Object.defineProperty, O = Object.defineProperties, st = Object.getOwnPropertyDescriptors, ct = Object.getOwnPropertySymbols, lt = Object.prototype.hasOwnProperty, ut = Object.prototype.propertyIsEnumerable, dt = (e, t, n) => t in e ? ot(e, t, {
|
|
354
380
|
enumerable: !0,
|
|
355
381
|
configurable: !0,
|
|
356
382
|
writable: !0,
|
|
357
383
|
value: n
|
|
358
|
-
}) : e[t] = n,
|
|
359
|
-
for (var n in t ||= {})
|
|
360
|
-
if (
|
|
384
|
+
}) : e[t] = n, ft = (e, t) => {
|
|
385
|
+
for (var n in t ||= {}) lt.call(t, n) && dt(e, n, t[n]);
|
|
386
|
+
if (ct) for (var n of ct(t)) ut.call(t, n) && dt(e, n, t[n]);
|
|
361
387
|
return e;
|
|
362
|
-
},
|
|
388
|
+
}, pt = (e, t) => O(e, st(t)), k = {
|
|
363
389
|
PROSE: 0,
|
|
364
390
|
FENCE_MARKER: 1,
|
|
365
391
|
FENCE_INFO: 2,
|
|
366
392
|
FENCE_BODY: 3,
|
|
367
393
|
CODE_SPAN: 4,
|
|
368
394
|
CODE_SPAN_OPEN: 5
|
|
369
|
-
},
|
|
395
|
+
}, mt = /^(`{3,}|~{3,})(.*)$/, ht = (e) => e !== void 0 && e >= "0" && e <= "9", gt = (e, t) => {
|
|
370
396
|
let n = t;
|
|
371
397
|
if (e[n] === "-" || e[n] === "*" || e[n] === "+") n += 1;
|
|
372
398
|
else {
|
|
373
|
-
for (;
|
|
399
|
+
for (; ht(e[n]) && n - t < 9;) n += 1;
|
|
374
400
|
if (n === t || e[n] !== "." && e[n] !== ")") return -1;
|
|
375
401
|
n += 1;
|
|
376
402
|
}
|
|
377
403
|
return e[n] === " " ? n + 1 : -1;
|
|
378
|
-
},
|
|
404
|
+
}, A = (e, t, n) => {
|
|
379
405
|
let r = 0, i = t, a = !1, o = t;
|
|
380
406
|
for (;;) {
|
|
381
407
|
for (; o < n && e[o] === " ";) o += 1;
|
|
@@ -383,7 +409,7 @@ var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnP
|
|
|
383
409
|
r += 1, o += e[o + 1] === " " ? 2 : 1, i = o, a = !1;
|
|
384
410
|
continue;
|
|
385
411
|
}
|
|
386
|
-
let t = o < n ?
|
|
412
|
+
let t = o < n ? gt(e, o) : -1;
|
|
387
413
|
if (t === -1) return {
|
|
388
414
|
contentStart: o,
|
|
389
415
|
listIndent: a ? o - i : 0,
|
|
@@ -391,7 +417,7 @@ var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnP
|
|
|
391
417
|
};
|
|
392
418
|
o = t, a = !0;
|
|
393
419
|
}
|
|
394
|
-
},
|
|
420
|
+
}, _t = (e, t, n, r) => {
|
|
395
421
|
let i = t;
|
|
396
422
|
for (let t = 0; t < r; t += 1) {
|
|
397
423
|
for (; i < n && e[i] === " ";) i += 1;
|
|
@@ -399,10 +425,10 @@ var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnP
|
|
|
399
425
|
i += 1, e[i] === " " && (i += 1);
|
|
400
426
|
}
|
|
401
427
|
return i;
|
|
402
|
-
},
|
|
428
|
+
}, vt = (e, t, n, r, i) => {
|
|
403
429
|
let a = t + r;
|
|
404
|
-
e.fill(
|
|
405
|
-
},
|
|
430
|
+
e.fill(k.FENCE_MARKER, a, a + i), e.fill(k.FENCE_INFO, a + i, Math.min(n + 1, e.length));
|
|
431
|
+
}, yt = (e, t, n, r) => {
|
|
406
432
|
let i = t;
|
|
407
433
|
for (; i < n && e[i] === " ";) i += 1;
|
|
408
434
|
let a = 0;
|
|
@@ -413,62 +439,62 @@ var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnP
|
|
|
413
439
|
i += 1;
|
|
414
440
|
}
|
|
415
441
|
return !0;
|
|
416
|
-
},
|
|
417
|
-
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a =
|
|
442
|
+
}, bt = (e, t, n, r) => {
|
|
443
|
+
let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = A(e, n, i), o = e.slice(a.contentStart, i).match(mt);
|
|
418
444
|
if (!o) return null;
|
|
419
445
|
let [, s, c] = o, l = s[0];
|
|
420
|
-
return l === "`" && c.includes("`") ? null : (
|
|
446
|
+
return l === "`" && c.includes("`") ? null : (vt(t, n, r, a.contentStart - n, s.length), {
|
|
421
447
|
char: l,
|
|
422
448
|
length: s.length,
|
|
423
449
|
listIndent: a.listIndent,
|
|
424
450
|
quoteDepth: a.quoteDepth
|
|
425
451
|
});
|
|
426
|
-
},
|
|
427
|
-
let i =
|
|
452
|
+
}, xt = (e, t, n, r) => {
|
|
453
|
+
let i = _t(e, t, n, r.quoteDepth);
|
|
428
454
|
if (i === -1 || r.listIndent === 0) return i;
|
|
429
455
|
let a = i;
|
|
430
456
|
for (; a < n && e[a] === " ";) a += 1;
|
|
431
457
|
return a === n || e[a] === "\r" && a + 1 === n || a - i >= r.listIndent ? i : -1;
|
|
432
|
-
},
|
|
458
|
+
}, St = (e, t) => {
|
|
433
459
|
let n = e.length, r = null, i = 0;
|
|
434
460
|
for (; i < n;) {
|
|
435
461
|
let a = e.indexOf("\n", i);
|
|
436
462
|
a === -1 && (a = n);
|
|
437
|
-
let o = r ?
|
|
438
|
-
r && o === -1 && (r = null), r ?
|
|
463
|
+
let o = r ? xt(e, i, a, r) : -1;
|
|
464
|
+
r && o === -1 && (r = null), r ? yt(e, o, a, r) ? (t.fill(k.FENCE_MARKER, i, a), r = null) : t.fill(k.FENCE_BODY, i, Math.min(a + 1, n)) : r = bt(e, t, i, a), i = a + 1;
|
|
439
465
|
}
|
|
440
466
|
return r;
|
|
441
|
-
},
|
|
467
|
+
}, Ct = (e, t) => {
|
|
442
468
|
let n = t + 1;
|
|
443
469
|
for (; n < e.length && e[n] === "`";) n += 1;
|
|
444
470
|
return n;
|
|
445
|
-
},
|
|
471
|
+
}, wt = (e, t) => {
|
|
446
472
|
let n = t + 1;
|
|
447
473
|
for (; n < e.length && (e[n] === " " || e[n] === " " || e[n] === "\r");) n += 1;
|
|
448
474
|
return n < e.length && e[n] === "\n";
|
|
449
|
-
},
|
|
475
|
+
}, Tt = (e, t, n) => {
|
|
450
476
|
let r = n;
|
|
451
477
|
for (;;) {
|
|
452
478
|
let n = e.indexOf("`", r);
|
|
453
479
|
if (n === -1) return -1;
|
|
454
|
-
let i = n > r && e[n - 1] === "\\" && t[n - 1] ===
|
|
455
|
-
if (t[n] ===
|
|
480
|
+
let i = n > r && e[n - 1] === "\\" && t[n - 1] === k.PROSE;
|
|
481
|
+
if (t[n] === k.PROSE && !i) return n;
|
|
456
482
|
r = n + 1;
|
|
457
483
|
}
|
|
458
|
-
},
|
|
484
|
+
}, Et = (e, t) => {
|
|
459
485
|
let n = e.length, r = -1, i = 0, a = 0;
|
|
460
486
|
for (; a < n;) {
|
|
461
487
|
if (r < 0) {
|
|
462
|
-
if (a =
|
|
463
|
-
let n =
|
|
488
|
+
if (a = Tt(e, t, a), a === -1) break;
|
|
489
|
+
let n = Ct(e, a);
|
|
464
490
|
r = a, i = n - a, a = n;
|
|
465
491
|
continue;
|
|
466
492
|
}
|
|
467
|
-
if (t[a] !==
|
|
468
|
-
t.fill(
|
|
493
|
+
if (t[a] !== k.PROSE) {
|
|
494
|
+
t.fill(k.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
|
|
469
495
|
continue;
|
|
470
496
|
}
|
|
471
|
-
if (e[a] === "\n" &&
|
|
497
|
+
if (e[a] === "\n" && wt(e, a)) {
|
|
472
498
|
r = -1, a += 1;
|
|
473
499
|
continue;
|
|
474
500
|
}
|
|
@@ -476,79 +502,79 @@ var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnP
|
|
|
476
502
|
a += 1;
|
|
477
503
|
continue;
|
|
478
504
|
}
|
|
479
|
-
let n =
|
|
480
|
-
n - a === i && (t.fill(
|
|
505
|
+
let n = Ct(e, a);
|
|
506
|
+
n - a === i && (t.fill(k.CODE_SPAN, r, n), r = -1), a = n;
|
|
481
507
|
}
|
|
482
|
-
return r >= 0 ? (t.fill(
|
|
508
|
+
return r >= 0 ? (t.fill(k.CODE_SPAN_OPEN, r, n), {
|
|
483
509
|
start: r,
|
|
484
510
|
runLength: i
|
|
485
511
|
}) : null;
|
|
486
|
-
},
|
|
512
|
+
}, Dt = (e) => {
|
|
487
513
|
let t = new Uint8Array(e.length);
|
|
488
514
|
return {
|
|
489
515
|
text: e,
|
|
490
516
|
regions: t,
|
|
491
|
-
openFence:
|
|
492
|
-
openSpan:
|
|
517
|
+
openFence: St(e, t),
|
|
518
|
+
openSpan: Et(e, t),
|
|
493
519
|
mathMask: null,
|
|
494
520
|
linkUrlMask: null,
|
|
495
521
|
htmlTagMask: null
|
|
496
522
|
};
|
|
497
|
-
},
|
|
498
|
-
if (
|
|
499
|
-
let t =
|
|
500
|
-
return
|
|
501
|
-
},
|
|
502
|
-
|
|
503
|
-
},
|
|
504
|
-
let n =
|
|
505
|
-
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] ===
|
|
523
|
+
}, Ot = null, kt = null, j = (e) => {
|
|
524
|
+
if (kt !== null && e === Ot) return kt;
|
|
525
|
+
let t = Dt(e);
|
|
526
|
+
return Ot = e, kt = t, t;
|
|
527
|
+
}, At = () => {
|
|
528
|
+
Ot = null, kt = null;
|
|
529
|
+
}, jt = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== k.PROSE, Mt = (e, t) => e.regions[t] === k.CODE_SPAN, Nt = (e, t) => {
|
|
530
|
+
let n = j(e), r = t + t, i = 0;
|
|
531
|
+
for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === k.PROSE ? (i += 1, t += 2) : t += 1;
|
|
506
532
|
return i;
|
|
507
|
-
},
|
|
533
|
+
}, Pt = /* @__PURE__ */ new Uint8Array(), Ft = (e) => e === "inlineLatex" || e === "blockLatex", It = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Lt = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", Rt = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), zt = (e, t, n) => {
|
|
508
534
|
let r = e[t + 1];
|
|
509
535
|
if (e[t] === "\\") {
|
|
510
536
|
if (r === "$") return {
|
|
511
537
|
context: n,
|
|
512
538
|
length: 2
|
|
513
539
|
};
|
|
514
|
-
let e =
|
|
540
|
+
let e = It(n, r);
|
|
515
541
|
return e === null ? null : {
|
|
516
542
|
context: e,
|
|
517
543
|
length: 2
|
|
518
544
|
};
|
|
519
545
|
}
|
|
520
|
-
if (e[t] === "$" && !
|
|
546
|
+
if (e[t] === "$" && !Ft(n)) {
|
|
521
547
|
let e = r === "$";
|
|
522
548
|
return {
|
|
523
|
-
context:
|
|
549
|
+
context: Lt(n, e),
|
|
524
550
|
length: e ? 2 : 1
|
|
525
551
|
};
|
|
526
552
|
}
|
|
527
553
|
return null;
|
|
528
|
-
},
|
|
554
|
+
}, Bt = (e) => {
|
|
529
555
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
|
|
530
556
|
for (; o < r;) {
|
|
531
557
|
i[o] = a === "none" ? 0 : 1;
|
|
532
|
-
let e = n[o] ===
|
|
558
|
+
let e = n[o] === k.PROSE ? zt(t, o, a) : null;
|
|
533
559
|
e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
|
|
534
560
|
}
|
|
535
561
|
return i;
|
|
536
|
-
},
|
|
562
|
+
}, Vt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = Rt(e.text) ? Bt(e) : Pt), e.mathMask[t] === 1), Ht = (e, t, n, r) => {
|
|
537
563
|
let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
|
|
538
|
-
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] ===
|
|
564
|
+
for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === k.PROSE && (s = 1), o[e - t] = s;
|
|
539
565
|
let c = !1;
|
|
540
|
-
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] ===
|
|
541
|
-
},
|
|
566
|
+
for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === k.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
|
|
567
|
+
}, Ut = (e) => {
|
|
542
568
|
let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
|
|
543
569
|
for (; i < n;) {
|
|
544
570
|
let a = t.indexOf("\n", i);
|
|
545
|
-
a === -1 && (a = n),
|
|
571
|
+
a === -1 && (a = n), Ht(e, i, a, r), i = a + 1;
|
|
546
572
|
}
|
|
547
573
|
return r;
|
|
548
|
-
},
|
|
574
|
+
}, Wt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? Ut(e) : Pt), e.linkUrlMask[t] === 1), Gt = (e) => {
|
|
549
575
|
let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
|
|
550
576
|
for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
|
|
551
|
-
else if (i[e] = +!!a, n[e] ===
|
|
577
|
+
else if (i[e] = +!!a, n[e] === k.PROSE) {
|
|
552
578
|
if (t[e] === ">") a = !1;
|
|
553
579
|
else if (t[e] === "<") {
|
|
554
580
|
let n = t[e + 1];
|
|
@@ -556,56 +582,56 @@ var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnP
|
|
|
556
582
|
}
|
|
557
583
|
}
|
|
558
584
|
return i;
|
|
559
|
-
},
|
|
585
|
+
}, Kt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Gt(e) : Pt), e.htmlTagMask[t] === 1), M = (e, t) => jt(j(e), t), N = (e, t) => Mt(j(e), t), P = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, qt = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(P, (t, n, r, i) => M(e, i) ? t : `${n}\\>${r}`), F = (e, { delimiter: t, markerLength: n, regex: r }) => {
|
|
560
586
|
let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
|
|
561
587
|
return e.slice(Math.max(0, a - n + 1)).match(r);
|
|
562
|
-
},
|
|
588
|
+
}, Jt = {
|
|
563
589
|
delimiter: "*",
|
|
564
590
|
markerLength: 2,
|
|
565
591
|
regex: /(\*\*)([^*]*\*?)$/
|
|
566
|
-
},
|
|
592
|
+
}, Yt = {
|
|
567
593
|
delimiter: "_",
|
|
568
594
|
markerLength: 2,
|
|
569
595
|
regex: /(__)([^_]*?)$/
|
|
570
|
-
},
|
|
596
|
+
}, Xt = {
|
|
571
597
|
delimiter: "*",
|
|
572
598
|
markerLength: 3,
|
|
573
599
|
regex: /(\*\*\*)([^*]*?)$/
|
|
574
|
-
},
|
|
600
|
+
}, Zt = {
|
|
575
601
|
delimiter: "*",
|
|
576
602
|
markerLength: 1,
|
|
577
603
|
regex: /(\*)([^*]*?)$/
|
|
578
|
-
},
|
|
604
|
+
}, Qt = {
|
|
579
605
|
delimiter: "_",
|
|
580
606
|
markerLength: 1,
|
|
581
607
|
regex: /(_)([^_]*?)$/
|
|
582
|
-
},
|
|
608
|
+
}, $t = {
|
|
583
609
|
delimiter: "~",
|
|
584
610
|
markerLength: 2,
|
|
585
611
|
regex: /(~~)([^~]*?)$/
|
|
586
|
-
},
|
|
612
|
+
}, en = {
|
|
587
613
|
delimiter: "_",
|
|
588
614
|
markerLength: 2,
|
|
589
615
|
regex: /(__)([^_]+)_$/
|
|
590
|
-
},
|
|
616
|
+
}, tn = {
|
|
591
617
|
delimiter: "~",
|
|
592
618
|
markerLength: 2,
|
|
593
619
|
regex: /(~~)([^~]+)~$/
|
|
594
|
-
},
|
|
620
|
+
}, nn = /^[\s_~*`]*$/, rn = /^[\s]*[-*+][\s]+$/, an = /[\p{L}\p{N}_]/u, on = /^\*{4,}$/, I = (e) => {
|
|
595
621
|
if (!e) return !1;
|
|
596
622
|
let t = e.charCodeAt(0);
|
|
597
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
598
|
-
},
|
|
623
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || an.test(e);
|
|
624
|
+
}, sn = (e, t) => {
|
|
599
625
|
let n = 1;
|
|
600
626
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
601
627
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
602
628
|
return -1;
|
|
603
|
-
},
|
|
629
|
+
}, cn = (e, t) => {
|
|
604
630
|
let n = 1;
|
|
605
631
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
606
632
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
607
633
|
return -1;
|
|
608
|
-
},
|
|
634
|
+
}, ln = (e, t) => Vt(j(e), t), un = (e, t, n) => {
|
|
609
635
|
let r = 0;
|
|
610
636
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
611
637
|
r = n + 1;
|
|
@@ -623,184 +649,184 @@ var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnP
|
|
|
623
649
|
break;
|
|
624
650
|
}
|
|
625
651
|
return o >= 3 && !s;
|
|
626
|
-
},
|
|
627
|
-
let i =
|
|
652
|
+
}, dn = (e, t, n, r) => n === "\\" || Vt(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.text.length - 2 ? e.text[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), fn = (e) => e === " " || e === " " || e === "\n", pn = (e, t) => !!(e && t && I(e) && I(t)), mn = (e, t, n, r) => {
|
|
653
|
+
let i = pn(e, t), a = !!t && !fn(t), o = !!e && !fn(e);
|
|
628
654
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
629
655
|
count: !0,
|
|
630
656
|
inWordAsteriskChain: i
|
|
631
657
|
} : { count: !1 };
|
|
632
|
-
},
|
|
633
|
-
let t =
|
|
658
|
+
}, hn = (e) => {
|
|
659
|
+
let t = j(e), n = 0, r = !1, i = e.length;
|
|
634
660
|
for (let a = 0; a < i; a += 1) {
|
|
635
|
-
if (e[a] !== "*" || t.regions[a] !==
|
|
636
|
-
|
|
661
|
+
if (e[a] !== "*" || t.regions[a] !== k.PROSE) {
|
|
662
|
+
I(e[a]) || (r = !1);
|
|
637
663
|
continue;
|
|
638
664
|
}
|
|
639
665
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
640
|
-
if (
|
|
641
|
-
let c =
|
|
666
|
+
if (dn(t, a, o, s)) continue;
|
|
667
|
+
let c = mn(o, s, n, r);
|
|
642
668
|
c.count && (n += 1, r = c.inWordAsteriskChain);
|
|
643
669
|
}
|
|
644
670
|
return n;
|
|
645
|
-
},
|
|
646
|
-
let t =
|
|
671
|
+
}, gn = (e, t, n, r) => !!(n === "\\" || Vt(e, t) || Wt(e, t) || Kt(e, t) || n === "_" || r === "_" || n && r && I(n) && I(r)), _n = (e) => {
|
|
672
|
+
let t = j(e), n = 0, r = e.length;
|
|
647
673
|
for (let i = 0; i < r; i += 1) {
|
|
648
|
-
if (e[i] !== "_" || t.regions[i] !==
|
|
674
|
+
if (e[i] !== "_" || t.regions[i] !== k.PROSE) continue;
|
|
649
675
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
650
|
-
|
|
676
|
+
gn(t, i, a, o) || (n += 1);
|
|
651
677
|
}
|
|
652
678
|
return n;
|
|
653
|
-
},
|
|
654
|
-
let t =
|
|
655
|
-
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] ===
|
|
679
|
+
}, vn = (e) => {
|
|
680
|
+
let t = j(e), n = 0, r = 0;
|
|
681
|
+
for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === k.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
|
|
656
682
|
return r >= 3 && (n += Math.floor(r / 3)), n;
|
|
657
|
-
},
|
|
658
|
-
if (!(
|
|
683
|
+
}, yn = (e) => Nt(e, "*"), bn = (e) => e === "" || e === " " || e === " " || e === "\n", xn = (e, t, n, r, i) => {
|
|
684
|
+
if (!(bn(n) && bn(r))) return !1;
|
|
659
685
|
if (t > i.lineEnd) {
|
|
660
686
|
let n = e.indexOf("\n", t);
|
|
661
|
-
i.lineEnd = n === -1 ? e.length : n, i.result =
|
|
687
|
+
i.lineEnd = n === -1 ? e.length : n, i.result = un(e, t, "_");
|
|
662
688
|
}
|
|
663
689
|
return i.result;
|
|
664
|
-
},
|
|
690
|
+
}, Sn = (e, t, n, r) => {
|
|
665
691
|
let i = e.text, a = t, o = !1;
|
|
666
692
|
a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
|
|
667
693
|
let s = n - a;
|
|
668
694
|
if (s < 2) return !1;
|
|
669
695
|
let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
|
|
670
|
-
return
|
|
671
|
-
},
|
|
672
|
-
let t =
|
|
696
|
+
return I(l) && I(u) || xn(i, a, l, u, r) || Vt(e, a) || Wt(e, a) || Kt(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
|
|
697
|
+
}, Cn = (e) => {
|
|
698
|
+
let t = j(e), n = e.length, r = {
|
|
673
699
|
lineEnd: -1,
|
|
674
700
|
result: !1
|
|
675
701
|
}, i = !1, a = 0;
|
|
676
702
|
for (; a < n;) {
|
|
677
|
-
if (e[a] !== "_" || t.regions[a] !==
|
|
703
|
+
if (e[a] !== "_" || t.regions[a] !== k.PROSE) {
|
|
678
704
|
a += 1;
|
|
679
705
|
continue;
|
|
680
706
|
}
|
|
681
707
|
let o = a, s = a + 1;
|
|
682
|
-
for (; s < n && e[s] === "_" && t.regions[s] ===
|
|
683
|
-
a = s,
|
|
708
|
+
for (; s < n && e[s] === "_" && t.regions[s] === k.PROSE;) s += 1;
|
|
709
|
+
a = s, Sn(t, o, s, r) && (i = !i);
|
|
684
710
|
}
|
|
685
711
|
return i;
|
|
686
|
-
},
|
|
687
|
-
if (!t ||
|
|
712
|
+
}, wn = (e, t, n) => {
|
|
713
|
+
if (!t || nn.test(t)) return !0;
|
|
688
714
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
689
|
-
return
|
|
690
|
-
},
|
|
691
|
-
let t =
|
|
715
|
+
return rn.test(a) && t.includes("\n") ? !0 : un(e, n, "*");
|
|
716
|
+
}, Tn = (e) => {
|
|
717
|
+
let t = F(e, Jt);
|
|
692
718
|
if (!t) return e;
|
|
693
719
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
694
|
-
return
|
|
695
|
-
},
|
|
696
|
-
if (!t ||
|
|
720
|
+
return M(e, r) || N(e, r) || wn(e, n, r) ? e : yn(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
721
|
+
}, En = (e, t, n) => {
|
|
722
|
+
if (!t || nn.test(t)) return !0;
|
|
697
723
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
698
|
-
return
|
|
699
|
-
},
|
|
700
|
-
let t =
|
|
724
|
+
return rn.test(a) && t.includes("\n") ? !0 : un(e, n, "_");
|
|
725
|
+
}, Dn = (e) => {
|
|
726
|
+
let t = F(e, Yt);
|
|
701
727
|
if (!t) {
|
|
702
|
-
let t =
|
|
728
|
+
let t = F(e, en);
|
|
703
729
|
if (t) {
|
|
704
730
|
let n = e.lastIndexOf(t[1]);
|
|
705
|
-
if (!(
|
|
731
|
+
if (!(M(e, n) || N(e, n)) && Cn(e)) return `${e}_`;
|
|
706
732
|
}
|
|
707
733
|
return e;
|
|
708
734
|
}
|
|
709
735
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
710
|
-
return
|
|
711
|
-
},
|
|
736
|
+
return M(e, r) || N(e, r) || En(e, n, r) ? e : Cn(e) ? `${e}__` : e;
|
|
737
|
+
}, On = (e, t) => {
|
|
712
738
|
let { text: n } = e;
|
|
713
|
-
return n[t] === "*" && e.regions[t] ===
|
|
714
|
-
},
|
|
715
|
-
let t =
|
|
739
|
+
return n[t] === "*" && e.regions[t] === k.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !Vt(e, t);
|
|
740
|
+
}, kn = (e) => {
|
|
741
|
+
let t = j(e);
|
|
716
742
|
for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
|
|
717
|
-
if (!
|
|
718
|
-
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r ||
|
|
719
|
-
if (!(a && o) && !(r && i &&
|
|
743
|
+
if (!On(t, n)) continue;
|
|
744
|
+
let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || fn(r), o = !i || fn(i);
|
|
745
|
+
if (!(a && o) && !(r && i && I(r) && I(i)) && !o) return n;
|
|
720
746
|
}
|
|
721
747
|
return -1;
|
|
722
|
-
},
|
|
723
|
-
if (!
|
|
724
|
-
let t =
|
|
725
|
-
if (t === -1 ||
|
|
748
|
+
}, An = (e) => {
|
|
749
|
+
if (!F(e, Zt)) return e;
|
|
750
|
+
let t = kn(e);
|
|
751
|
+
if (t === -1 || M(e, t) || N(e, t)) return e;
|
|
726
752
|
let n = e.substring(t + 1);
|
|
727
|
-
return !n ||
|
|
728
|
-
},
|
|
729
|
-
let t =
|
|
730
|
-
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] ===
|
|
753
|
+
return !n || nn.test(n) ? e : hn(e) % 2 == 1 ? `${e}*` : e;
|
|
754
|
+
}, jn = (e) => {
|
|
755
|
+
let t = j(e);
|
|
756
|
+
for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === k.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !Vt(t, n) && !Wt(t, n)) {
|
|
731
757
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
732
|
-
if (t && r &&
|
|
758
|
+
if (t && r && I(t) && I(r)) continue;
|
|
733
759
|
return n;
|
|
734
760
|
}
|
|
735
761
|
return -1;
|
|
736
|
-
},
|
|
762
|
+
}, Mn = (e) => {
|
|
737
763
|
let t = e.length;
|
|
738
764
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
739
765
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
740
|
-
},
|
|
766
|
+
}, Nn = (e) => {
|
|
741
767
|
if (!e.endsWith("**")) return null;
|
|
742
768
|
let t = e.slice(0, -2);
|
|
743
|
-
if (
|
|
744
|
-
let n = t.indexOf("**"), r =
|
|
769
|
+
if (yn(t) % 2 != 1) return null;
|
|
770
|
+
let n = t.indexOf("**"), r = jn(t);
|
|
745
771
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
746
|
-
},
|
|
747
|
-
if (!
|
|
748
|
-
let t =
|
|
772
|
+
}, Pn = (e) => {
|
|
773
|
+
if (!F(e, Qt)) return e;
|
|
774
|
+
let t = jn(e);
|
|
749
775
|
if (t === -1) return e;
|
|
750
776
|
let n = e.substring(t + 1);
|
|
751
|
-
if (!n ||
|
|
752
|
-
if (
|
|
753
|
-
let t =
|
|
754
|
-
return t === null ?
|
|
777
|
+
if (!n || nn.test(n) || M(e, t) || N(e, t)) return e;
|
|
778
|
+
if (_n(e) % 2 == 1) {
|
|
779
|
+
let t = Nn(e);
|
|
780
|
+
return t === null ? Mn(e) : t;
|
|
755
781
|
}
|
|
756
782
|
return e;
|
|
757
|
-
},
|
|
758
|
-
let t =
|
|
783
|
+
}, Fn = (e) => {
|
|
784
|
+
let t = yn(e), n = hn(e);
|
|
759
785
|
return t % 2 == 0 && n % 2 == 0;
|
|
760
|
-
},
|
|
761
|
-
if (
|
|
762
|
-
let t =
|
|
786
|
+
}, In = (e, t, n) => !t || nn.test(t) || M(e, n) || N(e, n) ? !0 : un(e, n, "*"), Ln = (e) => {
|
|
787
|
+
if (on.test(e)) return e;
|
|
788
|
+
let t = F(e, Xt);
|
|
763
789
|
if (!t) return e;
|
|
764
790
|
let n = t[2];
|
|
765
|
-
return
|
|
766
|
-
},
|
|
791
|
+
return In(e, n, e.lastIndexOf(t[1])) ? e : vn(e) % 2 == 1 ? Fn(e) ? e : `${e}***` : e;
|
|
792
|
+
}, Rn = /<[a-zA-Z/][^>]*$/, zn = /[a-zA-Z/]/, Bn = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Vn = (e, t) => {
|
|
767
793
|
let n = e[t + 1];
|
|
768
|
-
return n !== void 0 &&
|
|
769
|
-
},
|
|
770
|
-
let t = e.match(
|
|
794
|
+
return n !== void 0 && zn.test(n);
|
|
795
|
+
}, Hn = (e) => {
|
|
796
|
+
let t = e.match(Rn);
|
|
771
797
|
if (!t || t.index === void 0) return e;
|
|
772
|
-
let n =
|
|
773
|
-
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" &&
|
|
798
|
+
let n = Bn(e);
|
|
799
|
+
for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && Vn(e, r) && !M(e, r) && !(n && ln(e, r))) return e.substring(0, r).trimEnd();
|
|
774
800
|
return e;
|
|
775
|
-
},
|
|
776
|
-
let t =
|
|
801
|
+
}, Un = (e) => {
|
|
802
|
+
let t = j(e);
|
|
777
803
|
if (t.openFence) return e;
|
|
778
804
|
let n = t.openSpan;
|
|
779
805
|
if (!n) return e;
|
|
780
806
|
let r = e.slice(n.start + n.runLength);
|
|
781
|
-
if (!r ||
|
|
807
|
+
if (!r || nn.test(r)) return e;
|
|
782
808
|
let i = 0, a = e.length - 1;
|
|
783
809
|
for (; a >= 0 && e[a] === "`";) i += 1, --a;
|
|
784
810
|
return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
|
|
785
|
-
},
|
|
786
|
-
let t =
|
|
787
|
-
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] ===
|
|
811
|
+
}, Wn = (e) => Nt(e, "$"), Gn = (e) => {
|
|
812
|
+
let t = j(e), n = 0;
|
|
813
|
+
for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === k.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
|
|
788
814
|
return n;
|
|
789
|
-
},
|
|
815
|
+
}, Kn = (e) => {
|
|
790
816
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
791
817
|
let t = e.indexOf("$$");
|
|
792
818
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
793
819
|
$$` : `${e}$$`;
|
|
794
|
-
},
|
|
820
|
+
}, qn = (e) => Wn(e) % 2 == 0 ? e : Kn(e), Jn = (e) => Gn(e) % 2 == 1 ? `${e}$` : e, Yn = "streamdown:incomplete-image", Xn = (e, t, n) => {
|
|
795
821
|
if (e.substring(t + 2).includes(")")) return null;
|
|
796
|
-
let r =
|
|
797
|
-
if (r === -1 ||
|
|
822
|
+
let r = sn(e, t);
|
|
823
|
+
if (r === -1 || M(e, r)) return null;
|
|
798
824
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
|
|
799
|
-
return i ? `${o} if (e[n] === "[" && !
|
|
825
|
+
return i ? `${o}` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
826
|
+
}, Zn = (e, t) => {
|
|
827
|
+
for (let n = 0; n < t; n++) if (e[n] === "[" && !M(e, n)) {
|
|
802
828
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
803
|
-
let t =
|
|
829
|
+
let t = cn(e, n);
|
|
804
830
|
if (t === -1) return n;
|
|
805
831
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
806
832
|
let r = e.indexOf(")", t + 2);
|
|
@@ -808,69 +834,69 @@ $$` : `${e}$$`;
|
|
|
808
834
|
}
|
|
809
835
|
}
|
|
810
836
|
return t;
|
|
811
|
-
},
|
|
837
|
+
}, Qn = (e, t, n) => {
|
|
812
838
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
813
|
-
if (!e.substring(t + 1).includes("]") ||
|
|
839
|
+
if (!e.substring(t + 1).includes("]") || cn(e, t) === -1) {
|
|
814
840
|
let a = e.substring(0, i);
|
|
815
|
-
if (r) return `${a} return `${a}`;
|
|
816
842
|
if (n === "text-only") {
|
|
817
|
-
let n =
|
|
843
|
+
let n = Zn(e, t);
|
|
818
844
|
return e.substring(0, n) + e.substring(n + 1);
|
|
819
845
|
}
|
|
820
846
|
return `${e}](streamdown:incomplete-link)`;
|
|
821
847
|
}
|
|
822
848
|
return null;
|
|
823
|
-
},
|
|
849
|
+
}, $n = (e, t) => {
|
|
824
850
|
let n = e.lastIndexOf("](");
|
|
825
|
-
if (n !== -1 && !
|
|
826
|
-
let r =
|
|
851
|
+
if (n !== -1 && !M(e, n)) {
|
|
852
|
+
let r = Xn(e, n, t);
|
|
827
853
|
if (r !== null) return r;
|
|
828
854
|
}
|
|
829
|
-
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!
|
|
830
|
-
let r =
|
|
855
|
+
for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!M(e, n)) {
|
|
856
|
+
let r = Qn(e, n, t);
|
|
831
857
|
if (r !== null) return r;
|
|
832
858
|
}
|
|
833
859
|
return e;
|
|
834
|
-
},
|
|
860
|
+
}, er = 32, tr = (e, t = "protocol") => {
|
|
835
861
|
let n = e;
|
|
836
|
-
for (let e = 0; e <
|
|
837
|
-
let e =
|
|
862
|
+
for (let e = 0; e < er; e += 1) {
|
|
863
|
+
let e = $n(n, t);
|
|
838
864
|
if (e.length >= n.length) return e;
|
|
839
865
|
n = e;
|
|
840
866
|
}
|
|
841
867
|
return n;
|
|
842
|
-
},
|
|
868
|
+
}, nr = /^-{1,2}$/, rr = /^[\s]*-{1,2}[\s]+$/, ir = /^={1,2}$/, ar = /^[\s]*={1,2}[\s]+$/, or = (e) => {
|
|
843
869
|
if (!e || typeof e != "string") return e;
|
|
844
870
|
let t = e.lastIndexOf("\n");
|
|
845
871
|
if (t === -1) return e;
|
|
846
872
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
847
|
-
if (
|
|
873
|
+
if (nr.test(i) && !n.match(rr)) {
|
|
848
874
|
let t = r.split("\n").at(-1);
|
|
849
875
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
850
876
|
}
|
|
851
|
-
if (
|
|
877
|
+
if (ir.test(i) && !n.match(ar)) {
|
|
852
878
|
let t = r.split("\n").at(-1);
|
|
853
879
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
854
880
|
}
|
|
855
881
|
return e;
|
|
856
|
-
},
|
|
857
|
-
let t =
|
|
882
|
+
}, sr = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, cr = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(sr, (t, n, r) => M(e, r + n.length) ? t : `${n}\\~`), lr = (e) => Nt(e, "~"), ur = (e) => {
|
|
883
|
+
let t = F(e, $t);
|
|
858
884
|
if (t) {
|
|
859
885
|
let n = t[2];
|
|
860
|
-
if (!n ||
|
|
886
|
+
if (!n || nn.test(n)) return e;
|
|
861
887
|
let r = e.lastIndexOf(t[1]);
|
|
862
|
-
if (
|
|
863
|
-
if (
|
|
888
|
+
if (M(e, r) || N(e, r)) return e;
|
|
889
|
+
if (lr(e) % 2 == 1) return `${e}~~`;
|
|
864
890
|
} else {
|
|
865
|
-
let t =
|
|
891
|
+
let t = F(e, tn);
|
|
866
892
|
if (t) {
|
|
867
893
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
868
|
-
if (
|
|
869
|
-
if (
|
|
894
|
+
if (M(e, n) || N(e, n)) return e;
|
|
895
|
+
if (lr(e) % 2 == 1) return `${e}~`;
|
|
870
896
|
}
|
|
871
897
|
}
|
|
872
898
|
return e;
|
|
873
|
-
},
|
|
899
|
+
}, dr = (e) => e !== !1, fr = (e) => e === !0, L = {
|
|
874
900
|
SINGLE_TILDE: 0,
|
|
875
901
|
COMPARISON_OPERATORS: 5,
|
|
876
902
|
HTML_TAGS: 10,
|
|
@@ -886,44 +912,44 @@ $$` : `${e}$$`;
|
|
|
886
912
|
KATEX: 70,
|
|
887
913
|
INLINE_KATEX: 75,
|
|
888
914
|
DEFAULT: 100
|
|
889
|
-
},
|
|
915
|
+
}, pr = [
|
|
890
916
|
{
|
|
891
917
|
handler: {
|
|
892
918
|
name: "singleTilde",
|
|
893
|
-
handle:
|
|
894
|
-
priority:
|
|
919
|
+
handle: cr,
|
|
920
|
+
priority: L.SINGLE_TILDE
|
|
895
921
|
},
|
|
896
922
|
optionKey: "singleTilde"
|
|
897
923
|
},
|
|
898
924
|
{
|
|
899
925
|
handler: {
|
|
900
926
|
name: "comparisonOperators",
|
|
901
|
-
handle:
|
|
902
|
-
priority:
|
|
927
|
+
handle: qt,
|
|
928
|
+
priority: L.COMPARISON_OPERATORS
|
|
903
929
|
},
|
|
904
930
|
optionKey: "comparisonOperators"
|
|
905
931
|
},
|
|
906
932
|
{
|
|
907
933
|
handler: {
|
|
908
934
|
name: "htmlTags",
|
|
909
|
-
handle:
|
|
910
|
-
priority:
|
|
935
|
+
handle: Hn,
|
|
936
|
+
priority: L.HTML_TAGS
|
|
911
937
|
},
|
|
912
938
|
optionKey: "htmlTags"
|
|
913
939
|
},
|
|
914
940
|
{
|
|
915
941
|
handler: {
|
|
916
942
|
name: "setextHeadings",
|
|
917
|
-
handle:
|
|
918
|
-
priority:
|
|
943
|
+
handle: or,
|
|
944
|
+
priority: L.SETEXT_HEADINGS
|
|
919
945
|
},
|
|
920
946
|
optionKey: "setextHeadings"
|
|
921
947
|
},
|
|
922
948
|
{
|
|
923
949
|
handler: {
|
|
924
950
|
name: "links",
|
|
925
|
-
handle:
|
|
926
|
-
priority:
|
|
951
|
+
handle: tr,
|
|
952
|
+
priority: L.LINKS
|
|
927
953
|
},
|
|
928
954
|
optionKey: "links",
|
|
929
955
|
earlyReturn: (e) => e.endsWith("](streamdown:incomplete-link)") || e.endsWith("](streamdown:incomplete-image)")
|
|
@@ -931,100 +957,100 @@ $$` : `${e}$$`;
|
|
|
931
957
|
{
|
|
932
958
|
handler: {
|
|
933
959
|
name: "boldItalic",
|
|
934
|
-
handle:
|
|
935
|
-
priority:
|
|
960
|
+
handle: Ln,
|
|
961
|
+
priority: L.BOLD_ITALIC
|
|
936
962
|
},
|
|
937
963
|
optionKey: "boldItalic"
|
|
938
964
|
},
|
|
939
965
|
{
|
|
940
966
|
handler: {
|
|
941
967
|
name: "bold",
|
|
942
|
-
handle:
|
|
943
|
-
priority:
|
|
968
|
+
handle: Tn,
|
|
969
|
+
priority: L.BOLD
|
|
944
970
|
},
|
|
945
971
|
optionKey: "bold"
|
|
946
972
|
},
|
|
947
973
|
{
|
|
948
974
|
handler: {
|
|
949
975
|
name: "italicDoubleUnderscore",
|
|
950
|
-
handle:
|
|
951
|
-
priority:
|
|
976
|
+
handle: Dn,
|
|
977
|
+
priority: L.ITALIC_DOUBLE_UNDERSCORE
|
|
952
978
|
},
|
|
953
979
|
optionKey: "italic"
|
|
954
980
|
},
|
|
955
981
|
{
|
|
956
982
|
handler: {
|
|
957
983
|
name: "italicSingleAsterisk",
|
|
958
|
-
handle:
|
|
959
|
-
priority:
|
|
984
|
+
handle: An,
|
|
985
|
+
priority: L.ITALIC_SINGLE_ASTERISK
|
|
960
986
|
},
|
|
961
987
|
optionKey: "italic"
|
|
962
988
|
},
|
|
963
989
|
{
|
|
964
990
|
handler: {
|
|
965
991
|
name: "italicSingleUnderscore",
|
|
966
|
-
handle:
|
|
967
|
-
priority:
|
|
992
|
+
handle: Pn,
|
|
993
|
+
priority: L.ITALIC_SINGLE_UNDERSCORE
|
|
968
994
|
},
|
|
969
995
|
optionKey: "italic"
|
|
970
996
|
},
|
|
971
997
|
{
|
|
972
998
|
handler: {
|
|
973
999
|
name: "inlineCode",
|
|
974
|
-
handle:
|
|
975
|
-
priority:
|
|
1000
|
+
handle: Un,
|
|
1001
|
+
priority: L.INLINE_CODE
|
|
976
1002
|
},
|
|
977
1003
|
optionKey: "inlineCode"
|
|
978
1004
|
},
|
|
979
1005
|
{
|
|
980
1006
|
handler: {
|
|
981
1007
|
name: "strikethrough",
|
|
982
|
-
handle:
|
|
983
|
-
priority:
|
|
1008
|
+
handle: ur,
|
|
1009
|
+
priority: L.STRIKETHROUGH
|
|
984
1010
|
},
|
|
985
1011
|
optionKey: "strikethrough"
|
|
986
1012
|
},
|
|
987
1013
|
{
|
|
988
1014
|
handler: {
|
|
989
1015
|
name: "katex",
|
|
990
|
-
handle:
|
|
991
|
-
priority:
|
|
1016
|
+
handle: qn,
|
|
1017
|
+
priority: L.KATEX
|
|
992
1018
|
},
|
|
993
1019
|
optionKey: "katex"
|
|
994
1020
|
},
|
|
995
1021
|
{
|
|
996
1022
|
handler: {
|
|
997
1023
|
name: "inlineKatex",
|
|
998
|
-
handle:
|
|
999
|
-
priority:
|
|
1024
|
+
handle: Jn,
|
|
1025
|
+
priority: L.INLINE_KATEX
|
|
1000
1026
|
},
|
|
1001
1027
|
optionKey: "inlineKatex"
|
|
1002
1028
|
}
|
|
1003
|
-
],
|
|
1029
|
+
], mr = (e) => {
|
|
1004
1030
|
let t = e?.linkMode ?? "protocol";
|
|
1005
|
-
return
|
|
1006
|
-
handler:
|
|
1031
|
+
return pr.filter(({ handler: t, optionKey: n }) => t.name === "links" ? dr(e?.links) || dr(e?.images) : t.name === "inlineKatex" ? fr(e?.inlineKatex) : dr(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
1032
|
+
handler: pt(ft({}, e), { handle: (e) => tr(e, t) }),
|
|
1007
1033
|
earlyReturn: t === "protocol" ? n : void 0
|
|
1008
1034
|
} : {
|
|
1009
1035
|
handler: e,
|
|
1010
1036
|
earlyReturn: n
|
|
1011
1037
|
});
|
|
1012
|
-
},
|
|
1038
|
+
}, hr = (e, t) => {
|
|
1013
1039
|
if (!e || typeof e != "string") return e;
|
|
1014
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
1015
|
-
handler:
|
|
1040
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = mr(t), i = (t?.handlers ?? []).map((e) => ({
|
|
1041
|
+
handler: pt(ft({}, e), { priority: e.priority ?? L.DEFAULT }),
|
|
1016
1042
|
earlyReturn: void 0
|
|
1017
1043
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
1018
1044
|
try {
|
|
1019
1045
|
for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
|
|
1020
1046
|
return n.endsWith(" ") && !n.endsWith(" ") ? n.slice(0, -1) : n;
|
|
1021
1047
|
} finally {
|
|
1022
|
-
|
|
1048
|
+
At();
|
|
1023
1049
|
}
|
|
1024
1050
|
};
|
|
1025
1051
|
//#endregion
|
|
1026
1052
|
//#region ../../node_modules/.pnpm/marked@18.1.1/node_modules/marked/lib/marked.esm.js
|
|
1027
|
-
function
|
|
1053
|
+
function gr() {
|
|
1028
1054
|
return {
|
|
1029
1055
|
async: !1,
|
|
1030
1056
|
breaks: !1,
|
|
@@ -1038,35 +1064,35 @@ function mr() {
|
|
|
1038
1064
|
walkTokens: null
|
|
1039
1065
|
};
|
|
1040
1066
|
}
|
|
1041
|
-
var
|
|
1042
|
-
function gr(e) {
|
|
1043
|
-
hr = e;
|
|
1044
|
-
}
|
|
1045
|
-
var _r = { exec: () => null };
|
|
1067
|
+
var _r = gr();
|
|
1046
1068
|
function vr(e) {
|
|
1069
|
+
_r = e;
|
|
1070
|
+
}
|
|
1071
|
+
var yr = { exec: () => null };
|
|
1072
|
+
function br(e) {
|
|
1047
1073
|
let t = [];
|
|
1048
1074
|
return (n) => {
|
|
1049
1075
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
1050
1076
|
return i || (i = e(r), t[r] = i), i;
|
|
1051
1077
|
};
|
|
1052
1078
|
}
|
|
1053
|
-
function
|
|
1079
|
+
function R(e, t = "") {
|
|
1054
1080
|
let n = typeof e == "string" ? e : e.source, r = {
|
|
1055
1081
|
replace: (e, t) => {
|
|
1056
1082
|
let i = typeof t == "string" ? t : t.source;
|
|
1057
|
-
return i = i.replace(
|
|
1083
|
+
return i = i.replace(z.caret, "$1"), n = n.replace(e, i), r;
|
|
1058
1084
|
},
|
|
1059
1085
|
getRegex: () => new RegExp(n, t)
|
|
1060
1086
|
};
|
|
1061
1087
|
return r;
|
|
1062
1088
|
}
|
|
1063
|
-
var
|
|
1089
|
+
var xr = ((e = "") => {
|
|
1064
1090
|
try {
|
|
1065
1091
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
1066
1092
|
} catch {
|
|
1067
1093
|
return !1;
|
|
1068
1094
|
}
|
|
1069
|
-
})(),
|
|
1095
|
+
})(), z = {
|
|
1070
1096
|
codeRemoveIndent: /^(?: {0,3}\t| {1,4})/gm,
|
|
1071
1097
|
outputLinkReplace: /\\([\[\]])/g,
|
|
1072
1098
|
indentCodeCompensation: /^(\s+)(?:```)/,
|
|
@@ -1121,134 +1147,134 @@ var yr = ((e = "") => {
|
|
|
1121
1147
|
notSpaceStart: /^\S*/,
|
|
1122
1148
|
endingNewline: /\n$/,
|
|
1123
1149
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
1124
|
-
nextBulletRegex:
|
|
1125
|
-
hrRegex:
|
|
1126
|
-
fencesBeginRegex:
|
|
1127
|
-
headingBeginRegex:
|
|
1128
|
-
htmlBeginRegex:
|
|
1129
|
-
blockquoteBeginRegex:
|
|
1130
|
-
},
|
|
1131
|
-
blockquote:
|
|
1132
|
-
code:
|
|
1133
|
-
def:
|
|
1134
|
-
fences:
|
|
1135
|
-
heading:
|
|
1136
|
-
hr:
|
|
1137
|
-
html:
|
|
1138
|
-
lheading:
|
|
1139
|
-
list:
|
|
1140
|
-
newline:
|
|
1141
|
-
paragraph:
|
|
1142
|
-
table:
|
|
1143
|
-
text:
|
|
1144
|
-
},
|
|
1145
|
-
...
|
|
1146
|
-
lheading:
|
|
1147
|
-
table:
|
|
1148
|
-
paragraph:
|
|
1149
|
-
},
|
|
1150
|
-
...
|
|
1151
|
-
html:
|
|
1150
|
+
nextBulletRegex: br((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
1151
|
+
hrRegex: br((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
1152
|
+
fencesBeginRegex: br((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
1153
|
+
headingBeginRegex: br((e) => RegExp(`^ {0,${e}}#`)),
|
|
1154
|
+
htmlBeginRegex: br((e) => RegExp(`^ {0,${e}}(?:</?(?:${Ir})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
|
|
1155
|
+
blockquoteBeginRegex: br((e) => RegExp(`^ {0,${e}}>`))
|
|
1156
|
+
}, Sr = /^(?:[ \t]*(?:\n|$))+/, Cr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, wr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Tr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Er = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Dr = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Or = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, kr = R(Or).replace(/bull/g, Dr).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), Ar = R(Or).replace(/bull/g, Dr).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}(?:\s|$)/).replace(/hr/g, / {0,3}(?:(?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), jr = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Mr = /^[^\n]+/, Nr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Pr = R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Nr).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Fr = R(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Dr).getRegex(), Ir = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Lr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Rr = R("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Lr).replace("tag", Ir).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), zr = (e) => R(jr).replace("hr", Tr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Ir).getRegex(), Br = zr(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Vr = zr(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Hr = {
|
|
1157
|
+
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Vr).getRegex(),
|
|
1158
|
+
code: Cr,
|
|
1159
|
+
def: Pr,
|
|
1160
|
+
fences: wr,
|
|
1161
|
+
heading: Er,
|
|
1162
|
+
hr: Tr,
|
|
1163
|
+
html: Rr,
|
|
1164
|
+
lheading: kr,
|
|
1165
|
+
list: Fr,
|
|
1166
|
+
newline: Sr,
|
|
1167
|
+
paragraph: Br,
|
|
1168
|
+
table: yr,
|
|
1169
|
+
text: Mr
|
|
1170
|
+
}, Ur = R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Tr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Ir).getRegex(), Wr = {
|
|
1171
|
+
...Hr,
|
|
1172
|
+
lheading: Ar,
|
|
1173
|
+
table: Ur,
|
|
1174
|
+
paragraph: R(jr).replace("hr", Tr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Ur).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Ir).getRegex()
|
|
1175
|
+
}, Gr = {
|
|
1176
|
+
...Hr,
|
|
1177
|
+
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Lr).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
|
|
1152
1178
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
1153
1179
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
1154
|
-
fences:
|
|
1180
|
+
fences: yr,
|
|
1155
1181
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
1156
|
-
paragraph:
|
|
1157
|
-
},
|
|
1158
|
-
_backpedal:
|
|
1159
|
-
anyPunctuation:
|
|
1160
|
-
anyPunctuationOutsideCode:
|
|
1161
|
-
autolink:
|
|
1162
|
-
blockSkip:
|
|
1163
|
-
br:
|
|
1164
|
-
code:
|
|
1165
|
-
del:
|
|
1166
|
-
delLDelim:
|
|
1167
|
-
delRDelim:
|
|
1168
|
-
emStrongLDelim:
|
|
1169
|
-
emStrongRDelimAst:
|
|
1170
|
-
emStrongRDelimUnd: di,
|
|
1171
|
-
escape: Wr,
|
|
1172
|
-
link: Si,
|
|
1173
|
-
nolink: wi,
|
|
1174
|
-
punctuation: Zr,
|
|
1175
|
-
reflink: Ci,
|
|
1176
|
-
reflinkSearch: Di,
|
|
1177
|
-
tag: yi,
|
|
1178
|
-
text: qr,
|
|
1179
|
-
url: _r
|
|
1180
|
-
}, ji = {
|
|
1181
|
-
...Ai,
|
|
1182
|
-
emStrongLDelim: oi,
|
|
1183
|
-
emStrongRDelimAst: ui,
|
|
1182
|
+
paragraph: R(jr).replace("hr", Tr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", kr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
1183
|
+
}, Kr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, qr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Jr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Yr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, Xr = /[\s\p{P}\p{S}]/u, Zr = /[^\s\p{P}\p{S}]/u, Qr = R(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Xr).getRegex(), $r = /[\p{Pi}\p{Ps}"']/u, ei = /(?!~)[\p{P}\p{S}]/u, ti = /(?!~)[\s\p{P}\p{S}]/u, ni = /(?:[^\s\p{P}\p{S}]|~)/u, ri = R(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", xr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ii = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ai = R(ii, "u").replace(/punct/g, B).getRegex(), oi = R(ii, "u").replace(/punct/g, ei).getRegex(), si = R(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, $r).replace(/punct/g, B).getRegex(), ci = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", li = R(ci, "gu").replace(/notPunctSpace/g, Zr).replace(/punctSpace/g, Xr).replace(/punct/g, B).getRegex(), ui = R(ci, "gu").replace(/notPunctSpace/g, ni).replace(/punctSpace/g, ti).replace(/punct/g, ei).getRegex(), di = R("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Zr).replace(/punctSpace/g, Xr).replace(/punct/g, B).getRegex(), fi = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Zr).replace(/punctSpace/g, Xr).replace(/punct/g, B).getRegex(), pi = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Zr).replace(/punctSpace/g, Xr).replace(/punct/g, B).getRegex(), mi = R(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, B).getRegex(), hi = R("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Zr).replace(/punctSpace/g, Xr).replace(/punct/g, B).getRegex(), gi = R(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), _i = R(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, B).getRegex(), vi = R(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), yi = R(Lr).replace("(?:-->|$)", "-->").getRegex(), bi = R("^comment|^</[a-zA-Z][a-zA-Z0-9-]*\\s*>|^<[a-zA-Z][a-zA-Z0-9-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", yi).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), xi = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, Si = R(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", xi).getRegex(), Ci = R(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", Si).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), wi = R(/^!?\[(label)\]\[(ref)\]/).replace("label", Si).replace("ref", Nr).getRegex(), Ti = R(/^!?\[(ref)\](?:\[\])?/).replace("ref", Nr).getRegex(), Ei = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Di = R(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", xi).getRegex(), Oi = R("reflink|nolink(?!\\()", "g").replace("reflink", R(/^!?\[(label)\]\[(ref)\]/).replace("label", Di).replace("ref", Ei).getRegex()).replace("nolink", R(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ei).getRegex()).getRegex(), ki = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Ai = R(/(?:mailto:email|xmpp:email(?:\/[A-Za-z0-9@.]+)?)/).replace(/email/g, /[A-Za-z0-9._+-]+@[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(), ji = {
|
|
1184
|
+
_backpedal: yr,
|
|
1185
|
+
anyPunctuation: gi,
|
|
1186
|
+
anyPunctuationOutsideCode: _i,
|
|
1187
|
+
autolink: vi,
|
|
1188
|
+
blockSkip: ri,
|
|
1189
|
+
br: Jr,
|
|
1190
|
+
code: qr,
|
|
1191
|
+
del: yr,
|
|
1192
|
+
delLDelim: yr,
|
|
1193
|
+
delRDelim: yr,
|
|
1194
|
+
emStrongLDelim: ai,
|
|
1195
|
+
emStrongRDelimAst: li,
|
|
1184
1196
|
emStrongRDelimUnd: fi,
|
|
1185
|
-
|
|
1186
|
-
|
|
1197
|
+
escape: Kr,
|
|
1198
|
+
link: Ci,
|
|
1199
|
+
nolink: Ti,
|
|
1200
|
+
punctuation: Qr,
|
|
1201
|
+
reflink: wi,
|
|
1202
|
+
reflinkSearch: Oi,
|
|
1203
|
+
tag: bi,
|
|
1204
|
+
text: Yr,
|
|
1205
|
+
url: yr
|
|
1187
1206
|
}, Mi = {
|
|
1188
|
-
...
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1207
|
+
...ji,
|
|
1208
|
+
emStrongLDelim: si,
|
|
1209
|
+
emStrongRDelimAst: di,
|
|
1210
|
+
emStrongRDelimUnd: pi,
|
|
1211
|
+
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label", Si).getRegex(),
|
|
1212
|
+
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", Si).getRegex()
|
|
1213
|
+
}, Ni = {
|
|
1214
|
+
...ji,
|
|
1215
|
+
emStrongRDelimAst: ui,
|
|
1216
|
+
emStrongLDelim: oi,
|
|
1217
|
+
delLDelim: mi,
|
|
1218
|
+
delRDelim: hi,
|
|
1219
|
+
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Ai).replace("protocol", ki).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
1194
1220
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
1195
1221
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
1196
|
-
text:
|
|
1197
|
-
}, Ni = {
|
|
1198
|
-
...Mi,
|
|
1199
|
-
br: z(Kr).replace("{2,}", "*").getRegex(),
|
|
1200
|
-
text: z(Mi.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1222
|
+
text: R(/^(?:[^a-zA-Z0-9](?=emailProtocol)|(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9](?=emailProtocol)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))))/).replace("protocol", ki).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
1201
1223
|
}, Pi = {
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1224
|
+
...Ni,
|
|
1225
|
+
br: R(Jr).replace("{2,}", "*").getRegex(),
|
|
1226
|
+
text: R(Ni.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
1205
1227
|
}, Fi = {
|
|
1206
|
-
normal:
|
|
1207
|
-
gfm:
|
|
1208
|
-
|
|
1209
|
-
pedantic: ji
|
|
1228
|
+
normal: Hr,
|
|
1229
|
+
gfm: Wr,
|
|
1230
|
+
pedantic: Gr
|
|
1210
1231
|
}, Ii = {
|
|
1232
|
+
normal: ji,
|
|
1233
|
+
gfm: Ni,
|
|
1234
|
+
breaks: Pi,
|
|
1235
|
+
pedantic: Mi
|
|
1236
|
+
}, Li = {
|
|
1211
1237
|
"&": "&",
|
|
1212
1238
|
"<": "<",
|
|
1213
1239
|
">": ">",
|
|
1214
1240
|
"\"": """,
|
|
1215
1241
|
"'": "'"
|
|
1216
|
-
},
|
|
1242
|
+
}, Ri = (e) => Li[e];
|
|
1217
1243
|
function V(e, t) {
|
|
1218
1244
|
if (t) {
|
|
1219
|
-
if (
|
|
1220
|
-
} else if (
|
|
1245
|
+
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace, Ri);
|
|
1246
|
+
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode, Ri);
|
|
1221
1247
|
return e;
|
|
1222
1248
|
}
|
|
1223
|
-
function
|
|
1224
|
-
return
|
|
1249
|
+
function zi(e) {
|
|
1250
|
+
return z.numericCharacterReference.test(e) ? e.replace(z.numericCharacterReferenceOrAmpersand, (e, t, n) => {
|
|
1225
1251
|
if (t === void 0 && n === void 0) return "&";
|
|
1226
1252
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
1227
1253
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : r === 38 ? "&" : String.fromCodePoint(r);
|
|
1228
1254
|
}) : e;
|
|
1229
1255
|
}
|
|
1230
|
-
function
|
|
1256
|
+
function Bi(e) {
|
|
1231
1257
|
try {
|
|
1232
|
-
e = encodeURI(e).replace(
|
|
1258
|
+
e = encodeURI(e).replace(z.percentDecode, "%");
|
|
1233
1259
|
} catch {
|
|
1234
1260
|
return null;
|
|
1235
1261
|
}
|
|
1236
1262
|
return e;
|
|
1237
1263
|
}
|
|
1238
|
-
function
|
|
1239
|
-
let n = e.replace(
|
|
1264
|
+
function Vi(e, t) {
|
|
1265
|
+
let n = e.replace(z.findPipe, (e, t, n) => {
|
|
1240
1266
|
let r = !1, i = t;
|
|
1241
1267
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
1242
1268
|
return r ? "|" : " |";
|
|
1243
|
-
}).split(
|
|
1269
|
+
}).split(z.splitPipe), r = 0;
|
|
1244
1270
|
if (n[0].trim() || n.shift(), n.length > 0 && !n.at(-1)?.trim() && n.pop(), t) {
|
|
1245
1271
|
if (n.length > t) n.splice(t);
|
|
1246
1272
|
else for (; n.length < t;) n.push("");
|
|
1247
1273
|
}
|
|
1248
|
-
for (; r < n.length; r++) n[r] = n[r].trim().replace(
|
|
1274
|
+
for (; r < n.length; r++) n[r] = n[r].trim().replace(z.slashPipe, "|");
|
|
1249
1275
|
return n;
|
|
1250
1276
|
}
|
|
1251
|
-
function
|
|
1277
|
+
function Hi(e, t, n) {
|
|
1252
1278
|
let r = e.length;
|
|
1253
1279
|
if (r === 0) return "";
|
|
1254
1280
|
let i = 0;
|
|
@@ -1260,15 +1286,15 @@ function Vi(e, t, n) {
|
|
|
1260
1286
|
}
|
|
1261
1287
|
return e.slice(0, r - i);
|
|
1262
1288
|
}
|
|
1263
|
-
function
|
|
1289
|
+
function Ui(e) {
|
|
1264
1290
|
let t = e.split("\n"), n = t.length - 1;
|
|
1265
|
-
for (; n >= 0 &&
|
|
1291
|
+
for (; n >= 0 && z.blankLine.test(t[n]);) n--;
|
|
1266
1292
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
1267
1293
|
}
|
|
1268
|
-
function
|
|
1294
|
+
function Wi(e) {
|
|
1269
1295
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
1270
1296
|
}
|
|
1271
|
-
function
|
|
1297
|
+
function Gi(e, t) {
|
|
1272
1298
|
if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
|
|
1273
1299
|
let n = 0;
|
|
1274
1300
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -1276,7 +1302,7 @@ function Wi(e, t) {
|
|
|
1276
1302
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1277
1303
|
return n > 0 ? -2 : -1;
|
|
1278
1304
|
}
|
|
1279
|
-
function
|
|
1305
|
+
function Ki(e, t = 0) {
|
|
1280
1306
|
let n = t, r = "";
|
|
1281
1307
|
for (let t of e) if (t === " ") {
|
|
1282
1308
|
let e = 4 - n % 4;
|
|
@@ -1284,7 +1310,7 @@ function Gi(e, t = 0) {
|
|
|
1284
1310
|
} else r += t, n++;
|
|
1285
1311
|
return r;
|
|
1286
1312
|
}
|
|
1287
|
-
function
|
|
1313
|
+
function qi(e, t, n, r, i) {
|
|
1288
1314
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!", l = r.state.inLink, u = r.state.linkEmitted, d = r.state.inRawBlock;
|
|
1289
1315
|
r.state.inLink = !0, r.state.linkEmitted = !1;
|
|
1290
1316
|
let f = r.inlineTokens(s), p = r.state.linkEmitted;
|
|
@@ -1304,7 +1330,7 @@ function Ki(e, t, n, r, i) {
|
|
|
1304
1330
|
tokens: f
|
|
1305
1331
|
};
|
|
1306
1332
|
}
|
|
1307
|
-
function
|
|
1333
|
+
function Ji(e, t, n) {
|
|
1308
1334
|
let r = e.match(n.other.indentCodeCompensation);
|
|
1309
1335
|
if (r === null) return t;
|
|
1310
1336
|
let i = r[1];
|
|
@@ -1315,7 +1341,7 @@ function qi(e, t, n) {
|
|
|
1315
1341
|
return e.slice(Math.min(r.length, i.length));
|
|
1316
1342
|
}).join("\n");
|
|
1317
1343
|
}
|
|
1318
|
-
function
|
|
1344
|
+
function Yi(e, t, n, r) {
|
|
1319
1345
|
if (!t.includes("<")) return !1;
|
|
1320
1346
|
for (let i = 0; i < t.length; i++) {
|
|
1321
1347
|
if (t[i] === "\\") {
|
|
@@ -1338,12 +1364,12 @@ function Ji(e, t, n, r) {
|
|
|
1338
1364
|
}
|
|
1339
1365
|
return !1;
|
|
1340
1366
|
}
|
|
1341
|
-
var
|
|
1367
|
+
var Xi = class {
|
|
1342
1368
|
options;
|
|
1343
1369
|
rules;
|
|
1344
1370
|
lexer;
|
|
1345
1371
|
constructor(e) {
|
|
1346
|
-
this.options = e ||
|
|
1372
|
+
this.options = e || _r;
|
|
1347
1373
|
}
|
|
1348
1374
|
space(e) {
|
|
1349
1375
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1355,7 +1381,7 @@ var Yi = class {
|
|
|
1355
1381
|
code(e) {
|
|
1356
1382
|
let t = this.rules.block.code.exec(e);
|
|
1357
1383
|
if (t) {
|
|
1358
|
-
let e = this.options.pedantic ? t[0] :
|
|
1384
|
+
let e = this.options.pedantic ? t[0] : Ui(t[0]);
|
|
1359
1385
|
return {
|
|
1360
1386
|
type: "code",
|
|
1361
1387
|
raw: e,
|
|
@@ -1367,7 +1393,7 @@ var Yi = class {
|
|
|
1367
1393
|
fences(e) {
|
|
1368
1394
|
let t = this.rules.block.fences.exec(e);
|
|
1369
1395
|
if (t) {
|
|
1370
|
-
let e = t[0], n =
|
|
1396
|
+
let e = t[0], n = Ji(e, t[3] || "", this.rules);
|
|
1371
1397
|
return {
|
|
1372
1398
|
type: "code",
|
|
1373
1399
|
raw: e,
|
|
@@ -1381,12 +1407,12 @@ var Yi = class {
|
|
|
1381
1407
|
if (t) {
|
|
1382
1408
|
let e = t[2].trim();
|
|
1383
1409
|
if (this.rules.other.endingHash.test(e)) {
|
|
1384
|
-
let t =
|
|
1410
|
+
let t = Hi(e, "#");
|
|
1385
1411
|
(this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
|
|
1386
1412
|
}
|
|
1387
1413
|
return {
|
|
1388
1414
|
type: "heading",
|
|
1389
|
-
raw:
|
|
1415
|
+
raw: Hi(t[0], "\n"),
|
|
1390
1416
|
depth: t[1].length,
|
|
1391
1417
|
text: e,
|
|
1392
1418
|
tokens: this.lexer.inline(e)
|
|
@@ -1397,13 +1423,13 @@ var Yi = class {
|
|
|
1397
1423
|
let t = this.rules.block.hr.exec(e);
|
|
1398
1424
|
if (t) return {
|
|
1399
1425
|
type: "hr",
|
|
1400
|
-
raw:
|
|
1426
|
+
raw: Hi(t[0], "\n")
|
|
1401
1427
|
};
|
|
1402
1428
|
}
|
|
1403
1429
|
blockquote(e) {
|
|
1404
1430
|
let t = this.rules.block.blockquote.exec(e);
|
|
1405
1431
|
if (t) {
|
|
1406
|
-
let e =
|
|
1432
|
+
let e = Hi(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
1407
1433
|
for (; e.length > 0;) {
|
|
1408
1434
|
let t = !1, a = [], o = 0;
|
|
1409
1435
|
for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -1457,12 +1483,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1457
1483
|
if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1458
1484
|
let l = r();
|
|
1459
1485
|
e = e.substring(t[0].length);
|
|
1460
|
-
let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ?
|
|
1486
|
+
let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ? Ki(u, d) : u.replace(this.rules.other.leadingSpaceTab, (e) => Ki(e, d)), p = e.split("\n", 1)[0], ee = !f.trim(), m = 0;
|
|
1461
1487
|
if (this.options.pedantic ? (m = 2, a = f.trimStart()) : ee ? m = d + 1 : (m = f.search(this.rules.other.nonSpaceChar), m = m > 4 ? 1 : m, a = f.slice(m), m += d), ee && this.rules.other.blankLine.test(p) && (e = e.substring(p.length + 1), i = !0), !i) {
|
|
1462
1488
|
let t = this.rules.other.nextBulletRegex(m), n = this.rules.other.hrRegex(m), r = this.rules.other.fencesBeginRegex(m), i = this.rules.other.headingBeginRegex(m), o = this.rules.other.htmlBeginRegex(m), s = this.rules.other.blockquoteBeginRegex(m);
|
|
1463
1489
|
for (; e;) {
|
|
1464
1490
|
let c = e.split("\n", 1)[0], l;
|
|
1465
|
-
if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) =>
|
|
1491
|
+
if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) => Ki(e)), r.test(p) || i.test(p) || o.test(p) || s.test(p) || t.test(p) || n.test(p)) break;
|
|
1466
1492
|
if (l.search(this.rules.other.nonSpaceChar) >= m || !p.trim()) a += "\n" + l.slice(m);
|
|
1467
1493
|
else {
|
|
1468
1494
|
if (ee || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || r.test(f) || i.test(f) || n.test(f)) break;
|
|
@@ -1471,10 +1497,10 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1471
1497
|
ee = !p.trim(), e = e.substring(c.length + 1), f = l.slice(m);
|
|
1472
1498
|
}
|
|
1473
1499
|
}
|
|
1474
|
-
let
|
|
1475
|
-
o.loose || (c ? o.loose = !0 : this.rules.other.doubleBlankLine.test(
|
|
1500
|
+
let te = n.slice(l, r());
|
|
1501
|
+
o.loose || (c ? o.loose = !0 : this.rules.other.doubleBlankLine.test(te) && (c = !0)), o.items.push({
|
|
1476
1502
|
type: "list_item",
|
|
1477
|
-
raw:
|
|
1503
|
+
raw: te,
|
|
1478
1504
|
task: !!this.options.gfm && this.rules.other.listIsTask.test(a),
|
|
1479
1505
|
loose: !1,
|
|
1480
1506
|
text: a,
|
|
@@ -1523,7 +1549,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1523
1549
|
html(e) {
|
|
1524
1550
|
let t = this.rules.block.html.exec(e);
|
|
1525
1551
|
if (t) {
|
|
1526
|
-
let e =
|
|
1552
|
+
let e = Ui(t[0]);
|
|
1527
1553
|
return {
|
|
1528
1554
|
type: "html",
|
|
1529
1555
|
block: !0,
|
|
@@ -1536,12 +1562,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1536
1562
|
def(e) {
|
|
1537
1563
|
let t = this.rules.block.def.exec(e);
|
|
1538
1564
|
if (t) {
|
|
1539
|
-
if (!this.rules.other.startAngleBracket.test(t[2]) &&
|
|
1540
|
-
let e =
|
|
1565
|
+
if (!this.rules.other.startAngleBracket.test(t[2]) && Gi(t[2], "()") !== -1) return;
|
|
1566
|
+
let e = Wi(t[1]).replace(this.rules.other.multipleSpaceGlobal, " "), n = t[2] ? t[2].replace(this.rules.other.hrefBrackets, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = t[3] ? t[3].substring(1, t[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : t[3];
|
|
1541
1567
|
return {
|
|
1542
1568
|
type: "def",
|
|
1543
1569
|
tag: e,
|
|
1544
|
-
raw:
|
|
1570
|
+
raw: Hi(t[0], "\n"),
|
|
1545
1571
|
href: n,
|
|
1546
1572
|
title: r
|
|
1547
1573
|
};
|
|
@@ -1550,9 +1576,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1550
1576
|
table(e) {
|
|
1551
1577
|
let t = this.rules.block.table.exec(e);
|
|
1552
1578
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1553
|
-
let n =
|
|
1579
|
+
let n = Vi(t[1]), r = t[2].replace(this.rules.other.tableAlignChars, "").split("|"), i = t[3]?.trim() ? t[3].replace(this.rules.other.tableRowBlankLine, "").split("\n") : [], a = {
|
|
1554
1580
|
type: "table",
|
|
1555
|
-
raw:
|
|
1581
|
+
raw: Hi(t[0], "\n"),
|
|
1556
1582
|
header: [],
|
|
1557
1583
|
align: [],
|
|
1558
1584
|
rows: []
|
|
@@ -1565,7 +1591,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1565
1591
|
header: !0,
|
|
1566
1592
|
align: a.align[e]
|
|
1567
1593
|
});
|
|
1568
|
-
for (let e of i) a.rows.push(
|
|
1594
|
+
for (let e of i) a.rows.push(Vi(e, a.header.length).map((e, t) => ({
|
|
1569
1595
|
text: e,
|
|
1570
1596
|
tokens: this.lexer.inline(e),
|
|
1571
1597
|
header: !1,
|
|
@@ -1580,7 +1606,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1580
1606
|
let e = t[1].trim();
|
|
1581
1607
|
return {
|
|
1582
1608
|
type: "heading",
|
|
1583
|
-
raw:
|
|
1609
|
+
raw: Hi(t[0], "\n"),
|
|
1584
1610
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
1585
1611
|
text: e,
|
|
1586
1612
|
tokens: this.lexer.inline(e)
|
|
@@ -1632,14 +1658,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1632
1658
|
let t = this.rules.inline.link.exec(e);
|
|
1633
1659
|
if (t) {
|
|
1634
1660
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
1635
|
-
if (!this.options.pedantic &&
|
|
1661
|
+
if (!this.options.pedantic && Yi(e, t[1], n, this.rules)) return;
|
|
1636
1662
|
let r = t[2].trim();
|
|
1637
1663
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
1638
1664
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
1639
|
-
let e =
|
|
1665
|
+
let e = Hi(r.slice(0, -1), "\\");
|
|
1640
1666
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1641
1667
|
} else {
|
|
1642
|
-
let e =
|
|
1668
|
+
let e = Gi(t[2], "()");
|
|
1643
1669
|
if (e === -2) return;
|
|
1644
1670
|
if (e > -1) {
|
|
1645
1671
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -1651,7 +1677,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1651
1677
|
let e = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1652
1678
|
e && (i = e[1], a = e[3]);
|
|
1653
1679
|
} else a = t[3] ? t[3].slice(1, -1) : "";
|
|
1654
|
-
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)),
|
|
1680
|
+
return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), qi(t, {
|
|
1655
1681
|
href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1656
1682
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1657
1683
|
}, t[0], this.lexer, this.rules);
|
|
@@ -1661,8 +1687,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1661
1687
|
let n;
|
|
1662
1688
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1663
1689
|
let r = n[0].charAt(0) === "!" ? 2 : 1;
|
|
1664
|
-
if (!this.options.pedantic &&
|
|
1665
|
-
let i = t[
|
|
1690
|
+
if (!this.options.pedantic && Yi(e, n[1], r, this.rules)) return;
|
|
1691
|
+
let i = t[Wi((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
|
|
1666
1692
|
if (!i) {
|
|
1667
1693
|
let e = n[0].charAt(0);
|
|
1668
1694
|
return {
|
|
@@ -1671,7 +1697,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1671
1697
|
text: e
|
|
1672
1698
|
};
|
|
1673
1699
|
}
|
|
1674
|
-
return
|
|
1700
|
+
return qi(n, i, n[0], this.lexer, this.rules);
|
|
1675
1701
|
}
|
|
1676
1702
|
}
|
|
1677
1703
|
emStrong(e, t, n = "") {
|
|
@@ -1804,7 +1830,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1804
1830
|
return {
|
|
1805
1831
|
type: "text",
|
|
1806
1832
|
raw: t[0],
|
|
1807
|
-
text: e ? t[0] :
|
|
1833
|
+
text: e ? t[0] : zi(t[0]),
|
|
1808
1834
|
escaped: e
|
|
1809
1835
|
};
|
|
1810
1836
|
}
|
|
@@ -1816,7 +1842,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1816
1842
|
inlineQueue;
|
|
1817
1843
|
tokenizer;
|
|
1818
1844
|
constructor(e) {
|
|
1819
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1845
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || _r, this.options.tokenizer = this.options.tokenizer || new Xi(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1820
1846
|
inLink: !1,
|
|
1821
1847
|
inRawBlock: !1,
|
|
1822
1848
|
linkEmitted: !1,
|
|
@@ -1824,16 +1850,16 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1824
1850
|
top: !0
|
|
1825
1851
|
};
|
|
1826
1852
|
let t = {
|
|
1827
|
-
other:
|
|
1828
|
-
block:
|
|
1829
|
-
inline:
|
|
1853
|
+
other: z,
|
|
1854
|
+
block: Fi.normal,
|
|
1855
|
+
inline: Ii.normal
|
|
1830
1856
|
};
|
|
1831
|
-
this.options.pedantic ? (t.block =
|
|
1857
|
+
this.options.pedantic ? (t.block = Fi.pedantic, t.inline = Ii.pedantic) : this.options.gfm && (t.block = Fi.gfm, t.inline = this.options.breaks ? Ii.breaks : Ii.gfm), this.tokenizer.rules = t;
|
|
1832
1858
|
}
|
|
1833
1859
|
static get rules() {
|
|
1834
1860
|
return {
|
|
1835
|
-
block:
|
|
1836
|
-
inline:
|
|
1861
|
+
block: Fi,
|
|
1862
|
+
inline: Ii
|
|
1837
1863
|
};
|
|
1838
1864
|
}
|
|
1839
1865
|
static lex(t, n) {
|
|
@@ -1843,7 +1869,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1843
1869
|
return new e(n).inlineTokens(t);
|
|
1844
1870
|
}
|
|
1845
1871
|
lex(e) {
|
|
1846
|
-
e = e.replace(
|
|
1872
|
+
e = e.replace(z.carriageReturn, "\n"), this.blockTokens(e, this.tokens);
|
|
1847
1873
|
for (let e = 0; e < this.inlineQueue.length; e++) {
|
|
1848
1874
|
let t = this.inlineQueue[e];
|
|
1849
1875
|
this.inlineTokens(t.src, t.tokens);
|
|
@@ -1851,7 +1877,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1851
1877
|
return this.inlineQueue = [], this.tokens;
|
|
1852
1878
|
}
|
|
1853
1879
|
blockTokens(e, t = [], n = !1) {
|
|
1854
|
-
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(
|
|
1880
|
+
this.tokenizer.lexer = this, this.options.pedantic && (e = e.replace(z.tabCharGlobal, " ").replace(z.spaceLine, ""));
|
|
1855
1881
|
let r = 1 / 0;
|
|
1856
1882
|
for (; e;) {
|
|
1857
1883
|
if (e.length < r) r = e.length;
|
|
@@ -1923,7 +1949,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1923
1949
|
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
|
|
1924
1950
|
for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
1925
1951
|
let e = t[0], n = e.lastIndexOf("[");
|
|
1926
|
-
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links,
|
|
1952
|
+
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Wi(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
|
|
1927
1953
|
}
|
|
1928
1954
|
return !1;
|
|
1929
1955
|
}
|
|
@@ -1942,7 +1968,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1942
1968
|
if (this.tokens.links && e.includes("[")) {
|
|
1943
1969
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
1944
1970
|
let r = n.lastIndexOf("[");
|
|
1945
|
-
if (!Object.hasOwn(this.tokens.links,
|
|
1971
|
+
if (!Object.hasOwn(this.tokens.links, Wi(n.slice(r + 1, -1)))) return n;
|
|
1946
1972
|
if (r > 1 && n.charAt(0) !== "!") {
|
|
1947
1973
|
let i = n.slice(1, r - 1);
|
|
1948
1974
|
if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
|
|
@@ -2002,17 +2028,17 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
2002
2028
|
if (this.options.silent) console.error(t);
|
|
2003
2029
|
else throw Error(t);
|
|
2004
2030
|
}
|
|
2005
|
-
},
|
|
2031
|
+
}, Zi = class {
|
|
2006
2032
|
options;
|
|
2007
2033
|
parser;
|
|
2008
2034
|
constructor(e) {
|
|
2009
|
-
this.options = e ||
|
|
2035
|
+
this.options = e || _r;
|
|
2010
2036
|
}
|
|
2011
2037
|
space(e) {
|
|
2012
2038
|
return "";
|
|
2013
2039
|
}
|
|
2014
2040
|
code({ text: e, lang: t, escaped: n }) {
|
|
2015
|
-
let r = (t || "").match(
|
|
2041
|
+
let r = (t || "").match(z.notSpaceStart)?.[0], i = e ? e.replace(z.endingNewline, "") + "\n" : "";
|
|
2016
2042
|
return r ? "<pre><code class=\"language-" + V(r) + "\">" + (n ? i : V(i, !0)) + "</code></pre>\n" : "<pre><code>" + (n ? i : V(i, !0)) + "</code></pre>\n";
|
|
2017
2043
|
}
|
|
2018
2044
|
blockquote({ tokens: e }) {
|
|
@@ -2092,7 +2118,7 @@ ${e}</tr>
|
|
|
2092
2118
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
2093
2119
|
}
|
|
2094
2120
|
link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
|
|
2095
|
-
let a = i ? V(n, !0) : this.parser.parseInline(r), o =
|
|
2121
|
+
let a = i ? V(n, !0) : this.parser.parseInline(r), o = Bi(e);
|
|
2096
2122
|
if (o === null) return a;
|
|
2097
2123
|
e = V(o, i);
|
|
2098
2124
|
let s = "<a href=\"" + e + "\"";
|
|
@@ -2100,7 +2126,7 @@ ${e}</tr>
|
|
|
2100
2126
|
}
|
|
2101
2127
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
2102
2128
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
2103
|
-
let i =
|
|
2129
|
+
let i = Bi(e);
|
|
2104
2130
|
if (i === null) return V(n);
|
|
2105
2131
|
e = i;
|
|
2106
2132
|
let a = `<img src="${V(e)}" alt="${V(n)}"`;
|
|
@@ -2109,7 +2135,7 @@ ${e}</tr>
|
|
|
2109
2135
|
text(e) {
|
|
2110
2136
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
|
|
2111
2137
|
}
|
|
2112
|
-
},
|
|
2138
|
+
}, Qi = class {
|
|
2113
2139
|
strong({ text: e }) {
|
|
2114
2140
|
return e;
|
|
2115
2141
|
}
|
|
@@ -2145,7 +2171,7 @@ ${e}</tr>
|
|
|
2145
2171
|
renderer;
|
|
2146
2172
|
textRenderer;
|
|
2147
2173
|
constructor(e) {
|
|
2148
|
-
this.options = e ||
|
|
2174
|
+
this.options = e || _r, this.options.renderer = this.options.renderer || new Zi(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Qi();
|
|
2149
2175
|
}
|
|
2150
2176
|
static parse(t, n) {
|
|
2151
2177
|
return new e(n).parse(t);
|
|
@@ -2293,11 +2319,11 @@ ${e}</tr>
|
|
|
2293
2319
|
}
|
|
2294
2320
|
return n;
|
|
2295
2321
|
}
|
|
2296
|
-
},
|
|
2322
|
+
}, $i = class {
|
|
2297
2323
|
options;
|
|
2298
2324
|
block;
|
|
2299
2325
|
constructor(e) {
|
|
2300
|
-
this.options = e ||
|
|
2326
|
+
this.options = e || _r;
|
|
2301
2327
|
}
|
|
2302
2328
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2303
2329
|
"preprocess",
|
|
@@ -2329,44 +2355,44 @@ ${e}</tr>
|
|
|
2329
2355
|
return e ? U.parse : U.parseInline;
|
|
2330
2356
|
}
|
|
2331
2357
|
};
|
|
2332
|
-
function
|
|
2358
|
+
function ea(e, t) {
|
|
2333
2359
|
if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n]);
|
|
2334
2360
|
else e.push(t);
|
|
2335
2361
|
}
|
|
2336
|
-
var
|
|
2337
|
-
defaults =
|
|
2362
|
+
var ta = new class {
|
|
2363
|
+
defaults = gr();
|
|
2338
2364
|
options = this.setOptions;
|
|
2339
2365
|
parse = this.parseMarkdown(!0);
|
|
2340
2366
|
parseInline = this.parseMarkdown(!1);
|
|
2341
2367
|
Parser = U;
|
|
2342
|
-
Renderer =
|
|
2343
|
-
TextRenderer =
|
|
2368
|
+
Renderer = Zi;
|
|
2369
|
+
TextRenderer = Qi;
|
|
2344
2370
|
Lexer = H;
|
|
2345
|
-
Tokenizer =
|
|
2346
|
-
Hooks =
|
|
2371
|
+
Tokenizer = Xi;
|
|
2372
|
+
Hooks = $i;
|
|
2347
2373
|
constructor(...e) {
|
|
2348
2374
|
this.use(...e);
|
|
2349
2375
|
}
|
|
2350
2376
|
walkTokens(e, t) {
|
|
2351
2377
|
let n = [];
|
|
2352
|
-
for (let r of e) switch (
|
|
2378
|
+
for (let r of e) switch (ea(n, t.call(this, r)), r.type) {
|
|
2353
2379
|
case "table": {
|
|
2354
2380
|
let e = r;
|
|
2355
|
-
for (let r of e.header)
|
|
2356
|
-
for (let r of e.rows) for (let e of r)
|
|
2381
|
+
for (let r of e.header) ea(n, this.walkTokens(r.tokens, t));
|
|
2382
|
+
for (let r of e.rows) for (let e of r) ea(n, this.walkTokens(e.tokens, t));
|
|
2357
2383
|
break;
|
|
2358
2384
|
}
|
|
2359
2385
|
case "list": {
|
|
2360
2386
|
let e = r;
|
|
2361
|
-
|
|
2387
|
+
ea(n, this.walkTokens(e.items, t));
|
|
2362
2388
|
break;
|
|
2363
2389
|
}
|
|
2364
2390
|
default: {
|
|
2365
2391
|
let e = r;
|
|
2366
2392
|
this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
|
|
2367
2393
|
let i = e[r].flat(1 / 0);
|
|
2368
|
-
|
|
2369
|
-
}) : e.tokens &&
|
|
2394
|
+
ea(n, this.walkTokens(i, t));
|
|
2395
|
+
}) : e.tokens && ea(n, this.walkTokens(e.tokens, t));
|
|
2370
2396
|
}
|
|
2371
2397
|
}
|
|
2372
2398
|
return n;
|
|
@@ -2394,7 +2420,7 @@ var ea = new class {
|
|
|
2394
2420
|
}
|
|
2395
2421
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
2396
2422
|
}), n.extensions = t), e.renderer) {
|
|
2397
|
-
let t = this.defaults.renderer || new
|
|
2423
|
+
let t = this.defaults.renderer || new Zi(this.defaults);
|
|
2398
2424
|
for (let n in e.renderer) {
|
|
2399
2425
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
2400
2426
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -2407,7 +2433,7 @@ var ea = new class {
|
|
|
2407
2433
|
n.renderer = t;
|
|
2408
2434
|
}
|
|
2409
2435
|
if (e.tokenizer) {
|
|
2410
|
-
let t = this.defaults.tokenizer || new
|
|
2436
|
+
let t = this.defaults.tokenizer || new Xi(this.defaults);
|
|
2411
2437
|
for (let n in e.tokenizer) {
|
|
2412
2438
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
2413
2439
|
if ([
|
|
@@ -2424,13 +2450,13 @@ var ea = new class {
|
|
|
2424
2450
|
n.tokenizer = t;
|
|
2425
2451
|
}
|
|
2426
2452
|
if (e.hooks) {
|
|
2427
|
-
let t = this.defaults.hooks || new
|
|
2453
|
+
let t = this.defaults.hooks || new $i();
|
|
2428
2454
|
for (let n in e.hooks) {
|
|
2429
2455
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
2430
2456
|
if (["options", "block"].includes(n)) continue;
|
|
2431
2457
|
let r = n, i = e.hooks[r], a = t[r];
|
|
2432
|
-
t[r] =
|
|
2433
|
-
if (this.defaults.async &&
|
|
2458
|
+
t[r] = $i.passThroughHooks.has(n) ? (e) => {
|
|
2459
|
+
if (this.defaults.async && $i.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2434
2460
|
let n = await i.call(t, e);
|
|
2435
2461
|
return a.call(t, n);
|
|
2436
2462
|
})();
|
|
@@ -2451,7 +2477,7 @@ var ea = new class {
|
|
|
2451
2477
|
let t = this.defaults.walkTokens, r = e.walkTokens;
|
|
2452
2478
|
n.walkTokens = function(e) {
|
|
2453
2479
|
let n = [];
|
|
2454
|
-
return n.push(r.call(this, e)), t &&
|
|
2480
|
+
return n.push(r.call(this, e)), t && ea(n, t.call(this, e)), n;
|
|
2455
2481
|
};
|
|
2456
2482
|
}
|
|
2457
2483
|
this.defaults = {
|
|
@@ -2510,31 +2536,31 @@ var ea = new class {
|
|
|
2510
2536
|
}
|
|
2511
2537
|
}();
|
|
2512
2538
|
function W(e, t) {
|
|
2513
|
-
return
|
|
2539
|
+
return ta.parse(e, t);
|
|
2514
2540
|
}
|
|
2515
2541
|
W.options = W.setOptions = function(e) {
|
|
2516
|
-
return
|
|
2517
|
-
}, W.getDefaults =
|
|
2518
|
-
function
|
|
2519
|
-
return
|
|
2520
|
-
}
|
|
2521
|
-
W.use =
|
|
2522
|
-
return
|
|
2523
|
-
}, W.parseInline =
|
|
2542
|
+
return ta.setOptions(e), W.defaults = ta.defaults, vr(W.defaults), W;
|
|
2543
|
+
}, W.getDefaults = gr, W.defaults = _r;
|
|
2544
|
+
function na(...e) {
|
|
2545
|
+
return ta.use(...e), W.defaults = ta.defaults, vr(W.defaults), W;
|
|
2546
|
+
}
|
|
2547
|
+
W.use = na, W.walkTokens = function(e, t) {
|
|
2548
|
+
return ta.walkTokens(e, t);
|
|
2549
|
+
}, W.parseInline = ta.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Zi, W.TextRenderer = Qi, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Xi, W.Hooks = $i, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
|
|
2524
2550
|
//#endregion
|
|
2525
2551
|
//#region ../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
|
|
2526
|
-
function
|
|
2552
|
+
function ra(e, t) {
|
|
2527
2553
|
this.v = e, this.k = t;
|
|
2528
2554
|
}
|
|
2529
|
-
function
|
|
2555
|
+
function ia(e, t) {
|
|
2530
2556
|
(t == null || t > e.length) && (t = e.length);
|
|
2531
2557
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2532
2558
|
return r;
|
|
2533
2559
|
}
|
|
2534
|
-
function
|
|
2560
|
+
function aa(e) {
|
|
2535
2561
|
if (Array.isArray(e)) return e;
|
|
2536
2562
|
}
|
|
2537
|
-
function
|
|
2563
|
+
function oa(e, t) {
|
|
2538
2564
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2539
2565
|
if (n != null) {
|
|
2540
2566
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -2555,24 +2581,24 @@ function aa(e, t) {
|
|
|
2555
2581
|
return s;
|
|
2556
2582
|
}
|
|
2557
2583
|
}
|
|
2558
|
-
function
|
|
2584
|
+
function sa() {
|
|
2559
2585
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2560
2586
|
}
|
|
2561
|
-
function sa(e, t) {
|
|
2562
|
-
return ia(e) || aa(e, t) || ca(e, t) || oa();
|
|
2563
|
-
}
|
|
2564
2587
|
function ca(e, t) {
|
|
2588
|
+
return aa(e) || oa(e, t) || la(e, t) || sa();
|
|
2589
|
+
}
|
|
2590
|
+
function la(e, t) {
|
|
2565
2591
|
if (e) {
|
|
2566
|
-
if (typeof e == "string") return
|
|
2592
|
+
if (typeof e == "string") return ia(e, t);
|
|
2567
2593
|
var n = {}.toString.call(e).slice(8, -1);
|
|
2568
|
-
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ?
|
|
2594
|
+
return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ia(e, t) : void 0;
|
|
2569
2595
|
}
|
|
2570
2596
|
}
|
|
2571
|
-
function
|
|
2597
|
+
function ua(e) {
|
|
2572
2598
|
var t, n;
|
|
2573
2599
|
function r(t, n) {
|
|
2574
2600
|
try {
|
|
2575
|
-
var a = e[t](n), o = a.value, s = o instanceof
|
|
2601
|
+
var a = e[t](n), o = a.value, s = o instanceof ra;
|
|
2576
2602
|
Promise.resolve(s ? o.v : o).then(function(n) {
|
|
2577
2603
|
if (s) {
|
|
2578
2604
|
var c = t === "return" && o.k ? t : "next";
|
|
@@ -2606,119 +2632,119 @@ function la(e) {
|
|
|
2606
2632
|
});
|
|
2607
2633
|
}, typeof e.return != "function" && (this.return = void 0);
|
|
2608
2634
|
}
|
|
2609
|
-
|
|
2635
|
+
ua.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
2610
2636
|
return this;
|
|
2611
|
-
},
|
|
2637
|
+
}, ua.prototype.next = function(e) {
|
|
2612
2638
|
return this._invoke("next", e);
|
|
2613
|
-
},
|
|
2639
|
+
}, ua.prototype.throw = function(e) {
|
|
2614
2640
|
return this._invoke("throw", e);
|
|
2615
|
-
},
|
|
2641
|
+
}, ua.prototype.return = function(e) {
|
|
2616
2642
|
return this._invoke("return", e);
|
|
2617
2643
|
};
|
|
2618
|
-
var
|
|
2644
|
+
var da = Object.entries, fa = Object.setPrototypeOf, pa = Object.isFrozen, ma = Object.getPrototypeOf, ha = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, ga = Object.create, _a = typeof Reflect < "u" && Reflect, va = _a.apply, ya = _a.construct;
|
|
2619
2645
|
G ||= function(e) {
|
|
2620
2646
|
return e;
|
|
2621
2647
|
}, K ||= function(e) {
|
|
2622
2648
|
return e;
|
|
2623
|
-
},
|
|
2649
|
+
}, va ||= function(e, t) {
|
|
2624
2650
|
var n = [...arguments].slice(2);
|
|
2625
2651
|
return e.apply(t, n);
|
|
2626
|
-
},
|
|
2652
|
+
}, ya ||= function(e) {
|
|
2627
2653
|
return new e(...[...arguments].slice(1));
|
|
2628
2654
|
};
|
|
2629
|
-
var
|
|
2655
|
+
var ba = Y(Array.prototype.forEach);
|
|
2630
2656
|
Array.prototype.indexOf;
|
|
2631
|
-
var
|
|
2657
|
+
var xa = Y(Array.prototype.lastIndexOf), Sa = Y(Array.prototype.pop), Ca = Y(Array.prototype.push), wa = Y(Array.prototype.slice), Ta = Y(Array.prototype.splice), Ea = Array.isArray, Da = Ha(Set), Oa = Y(Set.prototype.add), ka = Y(Set.prototype.has), Aa = Y(String.prototype.toLowerCase), ja = Y(String.prototype.toString), Ma = Y(String.prototype.match), Na = Y(String.prototype.replace), Pa = Y(String.prototype.indexOf), Fa = Y(String.prototype.trim), Ia = Y(Number.prototype.toString), La = Y(Boolean.prototype.toString), Ra = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), za = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), Ba = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), Va = Ha(TypeError);
|
|
2632
2658
|
function Y(e) {
|
|
2633
2659
|
return function(t) {
|
|
2634
2660
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
2635
2661
|
var n = [...arguments].slice(1);
|
|
2636
|
-
return
|
|
2662
|
+
return va(e, t, n);
|
|
2637
2663
|
};
|
|
2638
2664
|
}
|
|
2639
|
-
function
|
|
2665
|
+
function Ha(e) {
|
|
2640
2666
|
return function() {
|
|
2641
|
-
return
|
|
2667
|
+
return ya(e, [...arguments]);
|
|
2642
2668
|
};
|
|
2643
2669
|
}
|
|
2644
2670
|
function X(e, t) {
|
|
2645
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2646
|
-
if (
|
|
2671
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Aa;
|
|
2672
|
+
if (fa && fa(e, null), !Ea(t)) return e;
|
|
2647
2673
|
let r = t.length;
|
|
2648
2674
|
for (; r--;) {
|
|
2649
2675
|
let i = t[r];
|
|
2650
2676
|
if (typeof i == "string") {
|
|
2651
2677
|
let e = n(i);
|
|
2652
|
-
e !== i && (
|
|
2678
|
+
e !== i && (pa(t) || (t[r] = e), i = e);
|
|
2653
2679
|
}
|
|
2654
2680
|
e[i] = !0;
|
|
2655
2681
|
}
|
|
2656
2682
|
return e;
|
|
2657
2683
|
}
|
|
2658
|
-
function
|
|
2684
|
+
function Ua(e) {
|
|
2659
2685
|
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
2660
2686
|
return e;
|
|
2661
2687
|
}
|
|
2662
2688
|
function Z(e) {
|
|
2663
|
-
let t =
|
|
2664
|
-
for (let r of
|
|
2665
|
-
var n =
|
|
2689
|
+
let t = ga(null);
|
|
2690
|
+
for (let r of da(e)) {
|
|
2691
|
+
var n = ca(r, 2);
|
|
2666
2692
|
let i = n[0], a = n[1];
|
|
2667
|
-
q(e, i) && (t[i] =
|
|
2693
|
+
q(e, i) && (t[i] = Ea(a) ? Ua(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
|
|
2668
2694
|
}
|
|
2669
2695
|
return t;
|
|
2670
2696
|
}
|
|
2671
|
-
function
|
|
2697
|
+
function Wa(e) {
|
|
2672
2698
|
switch (typeof e) {
|
|
2673
2699
|
case "string": return e;
|
|
2674
|
-
case "number": return
|
|
2675
|
-
case "boolean": return
|
|
2676
|
-
case "bigint": return
|
|
2677
|
-
case "symbol": return
|
|
2678
|
-
case "undefined": return
|
|
2700
|
+
case "number": return Ia(e);
|
|
2701
|
+
case "boolean": return La(e);
|
|
2702
|
+
case "bigint": return Ra ? Ra(e) : "0";
|
|
2703
|
+
case "symbol": return za ? za(e) : "Symbol()";
|
|
2704
|
+
case "undefined": return Ba(e);
|
|
2679
2705
|
case "function":
|
|
2680
2706
|
case "object": {
|
|
2681
|
-
if (e === null) return
|
|
2707
|
+
if (e === null) return Ba(e);
|
|
2682
2708
|
let t = e, n = Q(t, "toString");
|
|
2683
2709
|
if (typeof n == "function") {
|
|
2684
2710
|
let e = n(t);
|
|
2685
|
-
return typeof e == "string" ? e :
|
|
2711
|
+
return typeof e == "string" ? e : Ba(e);
|
|
2686
2712
|
}
|
|
2687
|
-
return
|
|
2713
|
+
return Ba(e);
|
|
2688
2714
|
}
|
|
2689
|
-
default: return
|
|
2715
|
+
default: return Ba(e);
|
|
2690
2716
|
}
|
|
2691
2717
|
}
|
|
2692
2718
|
function Q(e, t) {
|
|
2693
2719
|
for (; e !== null;) {
|
|
2694
|
-
let n =
|
|
2720
|
+
let n = ha(e, t);
|
|
2695
2721
|
if (n) {
|
|
2696
2722
|
if (n.get) return Y(n.get);
|
|
2697
2723
|
if (typeof n.value == "function") return Y(n.value);
|
|
2698
2724
|
}
|
|
2699
|
-
e =
|
|
2725
|
+
e = ma(e);
|
|
2700
2726
|
}
|
|
2701
2727
|
function n() {
|
|
2702
2728
|
return null;
|
|
2703
2729
|
}
|
|
2704
2730
|
return n;
|
|
2705
2731
|
}
|
|
2706
|
-
function
|
|
2732
|
+
function Ga(e, t) {
|
|
2707
2733
|
for (; e !== null;) {
|
|
2708
|
-
let n =
|
|
2734
|
+
let n = ha(e, t);
|
|
2709
2735
|
if (n) return n.get ? Y(n.get) : null;
|
|
2710
|
-
e =
|
|
2736
|
+
e = ma(e);
|
|
2711
2737
|
}
|
|
2712
2738
|
return null;
|
|
2713
2739
|
}
|
|
2714
|
-
function
|
|
2740
|
+
function Ka(e) {
|
|
2715
2741
|
try {
|
|
2716
2742
|
return J(e, ""), !0;
|
|
2717
2743
|
} catch {
|
|
2718
2744
|
return !1;
|
|
2719
2745
|
}
|
|
2720
2746
|
}
|
|
2721
|
-
var
|
|
2747
|
+
var qa = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bdi.bdo.big.blink.blockquote.body.br.button.canvas.caption.center.cite.code.col.colgroup.content.data.datalist.dd.decorator.del.details.dfn.dialog.dir.div.dl.dt.element.em.fieldset.figcaption.figure.font.footer.form.h1.h2.h3.h4.h5.h6.head.header.hgroup.hr.html.i.img.input.ins.kbd.label.legend.li.main.map.mark.marquee.menu.menuitem.meter.nav.nobr.ol.optgroup.option.output.p.picture.pre.progress.q.rp.rt.ruby.s.samp.search.section.select.shadow.slot.small.source.spacer.span.strike.strong.style.sub.summary.sup.table.tbody.td.template.textarea.tfoot.th.thead.time.tr.track.tt.u.ul.var.video.wbr".split(".")), Ja = G(/* @__PURE__ */ "svg.a.altglyph.altglyphdef.altglyphitem.animatecolor.animatemotion.animatetransform.circle.clippath.defs.desc.ellipse.enterkeyhint.exportparts.filter.font.g.glyph.glyphref.hkern.image.inputmode.line.lineargradient.marker.mask.metadata.mpath.part.path.pattern.polygon.polyline.radialgradient.rect.stop.style.switch.symbol.text.textpath.title.tref.tspan.view.vkern".split(".")), Ya = G([
|
|
2722
2748
|
"feBlend",
|
|
2723
2749
|
"feColorMatrix",
|
|
2724
2750
|
"feComponentTransfer",
|
|
@@ -2744,7 +2770,7 @@ var Ka = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2744
2770
|
"feSpotLight",
|
|
2745
2771
|
"feTile",
|
|
2746
2772
|
"feTurbulence"
|
|
2747
|
-
]),
|
|
2773
|
+
]), Xa = G([
|
|
2748
2774
|
"animate",
|
|
2749
2775
|
"color-profile",
|
|
2750
2776
|
"cursor",
|
|
@@ -2767,7 +2793,7 @@ var Ka = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2767
2793
|
"solidcolor",
|
|
2768
2794
|
"unknown",
|
|
2769
2795
|
"use"
|
|
2770
|
-
]),
|
|
2796
|
+
]), Za = G(/* @__PURE__ */ "math.menclose.merror.mfenced.mfrac.mglyph.mi.mlabeledtr.mmultiscripts.mn.mo.mover.mpadded.mphantom.mroot.mrow.ms.mspace.msqrt.mstyle.msub.msup.msubsup.mtable.mtd.mtext.mtr.munder.munderover.mprescripts".split(".")), Qa = G([
|
|
2771
2797
|
"maction",
|
|
2772
2798
|
"maligngroup",
|
|
2773
2799
|
"malignmark",
|
|
@@ -2783,13 +2809,13 @@ var Ka = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2783
2809
|
"annotation-xml",
|
|
2784
2810
|
"mprescripts",
|
|
2785
2811
|
"none"
|
|
2786
|
-
]),
|
|
2812
|
+
]), $a = G(["#text"]), eo = G(/* @__PURE__ */ "accept.action.align.alt.autocapitalize.autocomplete.autopictureinpicture.autoplay.background.bgcolor.border.capture.cellpadding.cellspacing.checked.cite.class.clear.color.cols.colspan.command.commandfor.controls.controlslist.coords.crossorigin.datetime.decoding.default.dir.disabled.disablepictureinpicture.disableremoteplayback.download.draggable.enctype.enterkeyhint.exportparts.face.for.headers.height.hidden.high.href.hreflang.id.inert.inputmode.integrity.ismap.kind.label.lang.list.loading.loop.low.max.maxlength.media.method.min.minlength.multiple.muted.name.nonce.noshade.novalidate.nowrap.open.optimum.part.pattern.placeholder.playsinline.popover.popovertarget.popovertargetaction.poster.preload.pubdate.radiogroup.readonly.rel.required.rev.reversed.role.rows.rowspan.spellcheck.scope.selected.shape.size.sizes.slot.span.srclang.start.src.srcset.step.style.summary.tabindex.title.translate.type.usemap.valign.value.width.wrap.xmlns".split(".")), to = G(/* @__PURE__ */ "accent-height.accumulate.additive.alignment-baseline.amplitude.ascent.attributename.attributetype.azimuth.basefrequency.baseline-shift.begin.bias.by.class.clip.clippathunits.clip-path.clip-rule.color.color-interpolation.color-interpolation-filters.color-profile.color-rendering.cx.cy.d.dx.dy.diffuseconstant.direction.display.divisor.dominant-baseline.dur.edgemode.elevation.end.exponent.fill.fill-opacity.fill-rule.filter.filterunits.flood-color.flood-opacity.font-family.font-size.font-size-adjust.font-stretch.font-style.font-variant.font-weight.fx.fy.g1.g2.glyph-name.glyphref.gradientunits.gradienttransform.height.href.id.image-rendering.in.in2.intercept.k.k1.k2.k3.k4.kerning.keypoints.keysplines.keytimes.lang.lengthadjust.letter-spacing.kernelmatrix.kernelunitlength.lighting-color.local.marker-end.marker-mid.marker-start.markerheight.markerunits.markerwidth.maskcontentunits.maskunits.max.mask.mask-type.media.method.mode.min.name.numoctaves.offset.operator.opacity.order.orient.orientation.origin.overflow.paint-order.path.pathlength.patterncontentunits.patterntransform.patternunits.pointer-events.points.preservealpha.preserveaspectratio.primitiveunits.r.rx.ry.radius.refx.refy.repeatcount.repeatdur.restart.result.rotate.scale.seed.shape-rendering.slope.specularconstant.specularexponent.spreadmethod.startoffset.stddeviation.stitchtiles.stop-color.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-linecap.stroke-linejoin.stroke-miterlimit.stroke-opacity.stroke.stroke-width.style.surfacescale.systemlanguage.tabindex.tablevalues.targetx.targety.transform.transform-origin.text-anchor.text-decoration.text-orientation.text-rendering.textlength.type.u1.u2.unicode.values.vector-effect.viewbox.visibility.version.vert-adv-y.vert-origin-x.vert-origin-y.width.word-spacing.wrap.writing-mode.xchannelselector.ychannelselector.x.x1.x2.xmlns.y.y1.y2.z.zoomandpan".split(".")), no = G(/* @__PURE__ */ "accent.accentunder.align.bevelled.close.columnalign.columnlines.columnspacing.columnspan.denomalign.depth.dir.display.displaystyle.encoding.fence.frame.height.href.id.largeop.length.linethickness.lquote.lspace.mathbackground.mathcolor.mathsize.mathvariant.maxsize.minsize.movablelimits.notation.numalign.open.rowalign.rowlines.rowspacing.rowspan.rspace.rquote.scriptlevel.scriptminsize.scriptsizemultiplier.selection.separator.separators.stretchy.subscriptshift.supscriptshift.symmetric.voffset.width.xmlns".split(".")), ro = G([
|
|
2787
2813
|
"xlink:href",
|
|
2788
2814
|
"xml:id",
|
|
2789
2815
|
"xlink:title",
|
|
2790
2816
|
"xml:space",
|
|
2791
2817
|
"xmlns:xlink"
|
|
2792
|
-
]),
|
|
2818
|
+
]), io = K(/{{[\w\W]*|^[\w\W]*}}/g), ao = K(/<%[\w\W]*|^[\w\W]*%>/g), oo = K(/\${[\w\W]*/g), so = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), co = K(/^aria-[\-\w]+$/), lo = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), uo = K(/^(?:\w+script|data):/i), fo = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), po = K(/^html$/i), mo = K(/^[a-z][.\w]*(-[.\w]+)+$/i), ho = K(/<[/\w!]/g), go = K(/<[/\w]/g), _o = K(/<\/no(script|embed|frames)/i), vo = K(/\/>/i), $ = {
|
|
2793
2819
|
element: 1,
|
|
2794
2820
|
attribute: 2,
|
|
2795
2821
|
text: 3,
|
|
@@ -2802,7 +2828,7 @@ var Ka = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2802
2828
|
documentType: 10,
|
|
2803
2829
|
documentFragment: 11,
|
|
2804
2830
|
notation: 12
|
|
2805
|
-
},
|
|
2831
|
+
}, yo = G(X({}, [
|
|
2806
2832
|
"style",
|
|
2807
2833
|
"script",
|
|
2808
2834
|
"xmp",
|
|
@@ -2811,9 +2837,9 @@ var Ka = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2811
2837
|
"noframes",
|
|
2812
2838
|
"plaintext",
|
|
2813
2839
|
"noscript"
|
|
2814
|
-
])),
|
|
2840
|
+
])), bo = function() {
|
|
2815
2841
|
return typeof window > "u" ? null : window;
|
|
2816
|
-
},
|
|
2842
|
+
}, xo = function(e, t) {
|
|
2817
2843
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
2818
2844
|
let n = null, r = "data-tt-policy-suffix";
|
|
2819
2845
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -2830,7 +2856,7 @@ var Ka = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2830
2856
|
} catch {
|
|
2831
2857
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2832
2858
|
}
|
|
2833
|
-
},
|
|
2859
|
+
}, So = function() {
|
|
2834
2860
|
return {
|
|
2835
2861
|
afterSanitizeAttributes: [],
|
|
2836
2862
|
afterSanitizeElements: [],
|
|
@@ -2842,62 +2868,62 @@ var Ka = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2842
2868
|
uponSanitizeElement: [],
|
|
2843
2869
|
uponSanitizeShadowNode: []
|
|
2844
2870
|
};
|
|
2845
|
-
},
|
|
2846
|
-
return q(e, t) &&
|
|
2847
|
-
},
|
|
2871
|
+
}, Co = function(e, t, n, r) {
|
|
2872
|
+
return q(e, t) && Ea(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
|
|
2873
|
+
}, wo = function(e, t, n) {
|
|
2848
2874
|
let r = q(e, t) ? e[t] : void 0;
|
|
2849
2875
|
return r && typeof r == "object" ? Z(r) : n();
|
|
2850
2876
|
};
|
|
2851
|
-
function
|
|
2852
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2877
|
+
function To() {
|
|
2878
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : bo(), t = (e) => To(e);
|
|
2853
2879
|
if (t.version = "3.4.17", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
|
|
2854
2880
|
let n = e.document, r = n, i = r.currentScript;
|
|
2855
2881
|
e.DocumentFragment;
|
|
2856
2882
|
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
|
|
2857
2883
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
2858
|
-
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"),
|
|
2859
|
-
return
|
|
2860
|
-
},
|
|
2861
|
-
return
|
|
2862
|
-
},
|
|
2863
|
-
return
|
|
2884
|
+
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), te = Q(d, "childNodes"), ne = Q(d, "parentNode"), re = Q(d, "shadowRoot"), ie = Q(d, "attributes"), ae = o && o.prototype ? Q(o.prototype, "nodeType") : null, h = o && o.prototype ? Q(o.prototype, "nodeName") : null, g = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, _ = function(e) {
|
|
2885
|
+
return ae ? ae(e) : e.nodeType;
|
|
2886
|
+
}, oe = function(e) {
|
|
2887
|
+
return h ? h(e) : e.nodeName;
|
|
2888
|
+
}, se = Ga(d, "namespaceURI"), ce = function(e) {
|
|
2889
|
+
return se ? se(e) : e.namespaceURI;
|
|
2864
2890
|
};
|
|
2865
2891
|
if (typeof a == "function") {
|
|
2866
2892
|
let e = n.createElement("template");
|
|
2867
2893
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
2868
2894
|
}
|
|
2869
|
-
let
|
|
2870
|
-
if (
|
|
2871
|
-
},
|
|
2872
|
-
|
|
2895
|
+
let v, y = "", le, ue = !1, de = 0, fe = function() {
|
|
2896
|
+
if (de > 0) throw Va("A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the \"DOMPurify and Trusted Types\" section of the README.");
|
|
2897
|
+
}, b = function(e) {
|
|
2898
|
+
fe(), de++;
|
|
2873
2899
|
try {
|
|
2874
|
-
return
|
|
2900
|
+
return v.createHTML(e);
|
|
2875
2901
|
} finally {
|
|
2876
|
-
|
|
2902
|
+
de--;
|
|
2877
2903
|
}
|
|
2878
|
-
},
|
|
2879
|
-
|
|
2904
|
+
}, pe = function(e) {
|
|
2905
|
+
fe(), de++;
|
|
2880
2906
|
try {
|
|
2881
|
-
return
|
|
2907
|
+
return v.createScriptURL(e);
|
|
2882
2908
|
} finally {
|
|
2883
|
-
|
|
2884
|
-
}
|
|
2885
|
-
},
|
|
2886
|
-
return
|
|
2887
|
-
},
|
|
2888
|
-
t.isSupported = typeof
|
|
2889
|
-
let
|
|
2890
|
-
...Ka,
|
|
2909
|
+
de--;
|
|
2910
|
+
}
|
|
2911
|
+
}, x = function() {
|
|
2912
|
+
return ue ||= (le = xo(u, i), !0), le;
|
|
2913
|
+
}, me = n, he = me.implementation, ge = me.createNodeIterator, _e = me.createDocumentFragment, ve = me.getElementsByTagName, ye = r.importNode, S = So();
|
|
2914
|
+
t.isSupported = typeof da == "function" && typeof ne == "function" && he && he.createHTMLDocument !== void 0;
|
|
2915
|
+
let be = io, xe = ao, Se = oo, Ce = so, we = co, C = uo, Te = fo, Ee = mo, De = lo, w = null, Oe = X({}, [
|
|
2891
2916
|
...qa,
|
|
2892
2917
|
...Ja,
|
|
2893
|
-
...
|
|
2894
|
-
...
|
|
2918
|
+
...Ya,
|
|
2919
|
+
...Za,
|
|
2920
|
+
...$a
|
|
2895
2921
|
]), T = null, ke = X({}, [
|
|
2896
|
-
...$a,
|
|
2897
2922
|
...eo,
|
|
2898
2923
|
...to,
|
|
2899
|
-
...no
|
|
2900
|
-
|
|
2924
|
+
...no,
|
|
2925
|
+
...ro
|
|
2926
|
+
]), E = Object.seal(ga(null, {
|
|
2901
2927
|
tagNameCheck: {
|
|
2902
2928
|
writable: !0,
|
|
2903
2929
|
configurable: !1,
|
|
@@ -2916,7 +2942,7 @@ function wo() {
|
|
|
2916
2942
|
enumerable: !0,
|
|
2917
2943
|
value: !1
|
|
2918
2944
|
}
|
|
2919
|
-
})), Ae = null, je = null, Me = Object.seal(
|
|
2945
|
+
})), Ae = null, je = null, Me = Object.seal(ga(null, {
|
|
2920
2946
|
tagCheck: {
|
|
2921
2947
|
writable: !0,
|
|
2922
2948
|
configurable: !1,
|
|
@@ -2929,14 +2955,14 @@ function wo() {
|
|
|
2929
2955
|
enumerable: !0,
|
|
2930
2956
|
value: null
|
|
2931
2957
|
}
|
|
2932
|
-
})), Ne = !0, Pe = !0, Fe = !1, Ie = !0,
|
|
2958
|
+
})), Ne = !0, Pe = !0, Fe = !1, Ie = !0, Le = !1, Re = !0, ze = !1, Be = !1, Ve = null, He = null, Ue = !1, We = !1, Ge = !1, Ke = !1, qe = !0, Je = !1, Ye = "user-content-", Xe = !0, Ze = !1, D = null, Qe = {}, $e = null, et = X({}, /* @__PURE__ */ "annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp".split(".")), tt = null, nt = X({}, [
|
|
2933
2959
|
"audio",
|
|
2934
2960
|
"video",
|
|
2935
2961
|
"img",
|
|
2936
2962
|
"source",
|
|
2937
2963
|
"image",
|
|
2938
2964
|
"track"
|
|
2939
|
-
]),
|
|
2965
|
+
]), rt = null, it = X({}, [
|
|
2940
2966
|
"alt",
|
|
2941
2967
|
"class",
|
|
2942
2968
|
"for",
|
|
@@ -2951,72 +2977,72 @@ function wo() {
|
|
|
2951
2977
|
"value",
|
|
2952
2978
|
"style",
|
|
2953
2979
|
"xmlns"
|
|
2954
|
-
]),
|
|
2955
|
-
it,
|
|
2980
|
+
]), at = "http://www.w3.org/1998/Math/MathML", ot = "http://www.w3.org/2000/svg", O = "http://www.w3.org/1999/xhtml", st = O, ct = !1, lt = null, ut = X({}, [
|
|
2956
2981
|
at,
|
|
2957
|
-
|
|
2958
|
-
|
|
2982
|
+
ot,
|
|
2983
|
+
O
|
|
2984
|
+
], ja), dt = G([
|
|
2959
2985
|
"mi",
|
|
2960
2986
|
"mo",
|
|
2961
2987
|
"mn",
|
|
2962
2988
|
"ms",
|
|
2963
2989
|
"mtext"
|
|
2964
|
-
]),
|
|
2990
|
+
]), ft = X({}, dt), pt = G(["annotation-xml"]), k = X({}, pt), mt = X({}, [
|
|
2965
2991
|
"title",
|
|
2966
2992
|
"style",
|
|
2967
2993
|
"font",
|
|
2968
2994
|
"a",
|
|
2969
2995
|
"script"
|
|
2970
|
-
]),
|
|
2996
|
+
]), ht = null, gt = ["application/xhtml+xml", "text/html"], A = null, _t = null, vt = n.createElement("form"), yt = function(e) {
|
|
2971
2997
|
return e instanceof RegExp || e instanceof Function;
|
|
2972
|
-
},
|
|
2998
|
+
}, bt = function() {
|
|
2973
2999
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2974
|
-
if (
|
|
2975
|
-
(!e || typeof e != "object") && (e = {}), e = Z(e),
|
|
2976
|
-
transform:
|
|
2977
|
-
base:
|
|
2978
|
-
}),
|
|
2979
|
-
transform:
|
|
2980
|
-
base:
|
|
2981
|
-
}),
|
|
2982
|
-
let t =
|
|
2983
|
-
if (E =
|
|
3000
|
+
if (_t && _t === e) return;
|
|
3001
|
+
(!e || typeof e != "object") && (e = {}), e = Z(e), ht = gt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, A = ht === "application/xhtml+xml" ? ja : Aa, w = Co(e, "ALLOWED_TAGS", Oe, { transform: A }), T = Co(e, "ALLOWED_ATTR", ke, { transform: A }), lt = Co(e, "ALLOWED_NAMESPACES", ut, { transform: ja }), rt = Co(e, "ADD_URI_SAFE_ATTR", it, {
|
|
3002
|
+
transform: A,
|
|
3003
|
+
base: it
|
|
3004
|
+
}), tt = Co(e, "ADD_DATA_URI_TAGS", nt, {
|
|
3005
|
+
transform: A,
|
|
3006
|
+
base: nt
|
|
3007
|
+
}), $e = Co(e, "FORBID_CONTENTS", et, { transform: A }), Ae = Co(e, "FORBID_TAGS", Z({}), { transform: A }), je = Co(e, "FORBID_ATTR", Z({}), { transform: A }), Qe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Ne = e.ALLOW_ARIA_ATTR !== !1, Pe = e.ALLOW_DATA_ATTR !== !1, Fe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Ie = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, Le = e.SAFE_FOR_TEMPLATES || !1, Re = e.SAFE_FOR_XML !== !1, ze = e.WHOLE_DOCUMENT || !1, We = e.RETURN_DOM || !1, Ge = e.RETURN_DOM_FRAGMENT || !1, Ke = e.RETURN_TRUSTED_TYPE || !1, Ue = e.FORCE_BODY || !1, qe = e.SANITIZE_DOM !== !1, Je = e.SANITIZE_NAMED_PROPS || !1, Xe = e.KEEP_CONTENT !== !1, Ze = e.IN_PLACE || !1, De = Ka(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : lo, st = typeof e.NAMESPACE == "string" ? e.NAMESPACE : O, ft = wo(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, dt)), k = wo(e, "HTML_INTEGRATION_POINTS", () => X({}, pt));
|
|
3008
|
+
let t = wo(e, "CUSTOM_ELEMENT_HANDLING", () => ga(null));
|
|
3009
|
+
if (E = ga(null), q(t, "tagNameCheck") && yt(t.tagNameCheck) && (E.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && yt(t.attributeNameCheck) && (E.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(E), Le && (Pe = !1), Ge && (We = !0), Qe && (w = X({}, $a), T = ga(null), Qe.html === !0 && (X(w, qa), X(T, eo)), Qe.svg === !0 && (X(w, Ja), X(T, to), X(T, ro)), Qe.svgFilters === !0 && (X(w, Ya), X(T, to), X(T, ro)), Qe.mathMl === !0 && (X(w, Za), X(T, no), X(T, ro))), Me.tagCheck = null, Me.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Me.tagCheck = e.ADD_TAGS : Ea(e.ADD_TAGS) && (w === Oe && (w = Z(w)), X(w, e.ADD_TAGS, A))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Me.attributeCheck = e.ADD_ATTR : Ea(e.ADD_ATTR) && (T === ke && (T = Z(T)), X(T, e.ADD_ATTR, A))), q(e, "ADD_FORBID_CONTENTS") && Ea(e.ADD_FORBID_CONTENTS) && ($e === et && ($e = Z($e)), X($e, e.ADD_FORBID_CONTENTS, A)), Xe && (w["#text"] = !0), ze && X(w, [
|
|
2984
3010
|
"html",
|
|
2985
3011
|
"head",
|
|
2986
3012
|
"body"
|
|
2987
3013
|
]), w.table && (X(w, ["tbody"]), delete Ae.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
2988
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2989
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2990
|
-
let t =
|
|
2991
|
-
|
|
3014
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Va("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
3015
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Va("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
3016
|
+
let t = v;
|
|
3017
|
+
v = e.TRUSTED_TYPES_POLICY;
|
|
2992
3018
|
try {
|
|
2993
|
-
|
|
3019
|
+
y = b("");
|
|
2994
3020
|
} catch (e) {
|
|
2995
|
-
throw
|
|
3021
|
+
throw v = t, e;
|
|
2996
3022
|
}
|
|
2997
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (
|
|
2998
|
-
G && G(e),
|
|
2999
|
-
},
|
|
3000
|
-
...qa,
|
|
3023
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (v = void 0, y = "") : (v === void 0 && (v = x()), v && typeof y == "string" && (y = b("")));
|
|
3024
|
+
G && G(e), _t = e;
|
|
3025
|
+
}, xt = X({}, [
|
|
3001
3026
|
...Ja,
|
|
3002
|
-
...Ya
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
|
|
3006
|
-
return t.namespaceURI === k ? e === "math" : t.namespaceURI === at ? e === "math" && ft[n] : !!xt[e];
|
|
3027
|
+
...Ya,
|
|
3028
|
+
...Xa
|
|
3029
|
+
]), St = X({}, [...Za, ...Qa]), Ct = function(e, t, n) {
|
|
3030
|
+
return t.namespaceURI === O ? e === "svg" : t.namespaceURI === at ? e === "svg" && (n === "annotation-xml" || ft[n]) : !!xt[e];
|
|
3007
3031
|
}, wt = function(e, t, n) {
|
|
3008
|
-
return t.namespaceURI ===
|
|
3009
|
-
}, Tt = function(e) {
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3032
|
+
return t.namespaceURI === O ? e === "math" : t.namespaceURI === ot ? e === "math" && k[n] : !!St[e];
|
|
3033
|
+
}, Tt = function(e, t, n) {
|
|
3034
|
+
return t.namespaceURI === ot && !k[n] || t.namespaceURI === at && !ft[n] ? !1 : !St[e] && (mt[e] || !xt[e]);
|
|
3035
|
+
}, Et = function(e) {
|
|
3036
|
+
let t = ce(e), n = Aa(oe(e)), r = ne(e), i, a;
|
|
3037
|
+
return r && _(r) === $.element ? (i = { namespaceURI: ce(r) }, a = Aa(oe(r))) : (i = { namespaceURI: st }, a = "template"), lt[t] ? t === ot ? Ct(n, i, a) : t === at ? wt(n, i, a) : t === O ? Tt(n, i, a) : !!(ht === "application/xhtml+xml" && lt[t]) : !1;
|
|
3038
|
+
}, Dt = function(e) {
|
|
3039
|
+
Ca(t.removed, { element: e });
|
|
3014
3040
|
try {
|
|
3015
|
-
|
|
3041
|
+
ne(e).removeChild(e);
|
|
3016
3042
|
} catch {
|
|
3017
|
-
if (p(e), !
|
|
3043
|
+
if (p(e), !ne(e)) throw Va("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
3018
3044
|
}
|
|
3019
|
-
},
|
|
3045
|
+
}, Ot = function(e, t, n) {
|
|
3020
3046
|
try {
|
|
3021
3047
|
ee(e, t);
|
|
3022
3048
|
} catch {
|
|
@@ -3024,26 +3050,26 @@ function wo() {
|
|
|
3024
3050
|
e.removeAttribute(n);
|
|
3025
3051
|
} catch {}
|
|
3026
3052
|
}
|
|
3027
|
-
},
|
|
3028
|
-
|
|
3029
|
-
let t =
|
|
3030
|
-
t &&
|
|
3053
|
+
}, kt = function(e) {
|
|
3054
|
+
Mt(e);
|
|
3055
|
+
let t = te(e);
|
|
3056
|
+
t && ba(wa(t), (e) => {
|
|
3031
3057
|
try {
|
|
3032
3058
|
p(e);
|
|
3033
3059
|
} catch {}
|
|
3034
3060
|
});
|
|
3035
|
-
let n =
|
|
3061
|
+
let n = _(e) === $.element ? ie(e) : null;
|
|
3036
3062
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
3037
3063
|
let r = n[t], i = r && r.name;
|
|
3038
|
-
typeof i == "string" &&
|
|
3064
|
+
typeof i == "string" && Ot(e, r, i);
|
|
3039
3065
|
}
|
|
3040
|
-
},
|
|
3066
|
+
}, j = function(e, n, r) {
|
|
3041
3067
|
if (!r) try {
|
|
3042
3068
|
r = n.getAttributeNode(e);
|
|
3043
3069
|
} catch {
|
|
3044
3070
|
r = null;
|
|
3045
3071
|
}
|
|
3046
|
-
|
|
3072
|
+
Ca(t.removed, {
|
|
3047
3073
|
attribute: r || null,
|
|
3048
3074
|
from: n
|
|
3049
3075
|
});
|
|
@@ -3055,156 +3081,156 @@ function wo() {
|
|
|
3055
3081
|
} catch {}
|
|
3056
3082
|
}
|
|
3057
3083
|
if (e === "is") {
|
|
3058
|
-
if (
|
|
3059
|
-
|
|
3084
|
+
if (We || Ge) try {
|
|
3085
|
+
Dt(n);
|
|
3060
3086
|
} catch {}
|
|
3061
3087
|
else try {
|
|
3062
3088
|
n.setAttribute(e, "");
|
|
3063
3089
|
} catch {}
|
|
3064
3090
|
}
|
|
3065
|
-
},
|
|
3066
|
-
let t =
|
|
3091
|
+
}, At = function(e) {
|
|
3092
|
+
let t = ie(e);
|
|
3067
3093
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
3068
3094
|
let r = t[n], i = r && r.name;
|
|
3069
|
-
typeof i != "string" || T[
|
|
3095
|
+
typeof i != "string" || T[A(i)] || Ot(e, r, i);
|
|
3070
3096
|
}
|
|
3071
|
-
},
|
|
3097
|
+
}, jt = function(e, t) {
|
|
3072
3098
|
let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
|
|
3073
3099
|
for (; r.length > 0;) {
|
|
3074
3100
|
let e = r.pop();
|
|
3075
3101
|
if (t(e) === !1) continue;
|
|
3076
|
-
if (n &&
|
|
3077
|
-
let t =
|
|
3078
|
-
|
|
3102
|
+
if (n && _(e) === $.element) {
|
|
3103
|
+
let t = re(e);
|
|
3104
|
+
M(t) && r.push(t);
|
|
3079
3105
|
}
|
|
3080
|
-
let i =
|
|
3106
|
+
let i = te(e);
|
|
3081
3107
|
if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
|
|
3082
3108
|
}
|
|
3083
|
-
},
|
|
3084
|
-
|
|
3085
|
-
|
|
3109
|
+
}, Mt = function(e) {
|
|
3110
|
+
jt(e, (e) => {
|
|
3111
|
+
_(e) === $.element && At(e);
|
|
3086
3112
|
});
|
|
3087
|
-
},
|
|
3113
|
+
}, Nt = function(e) {
|
|
3088
3114
|
let t = [];
|
|
3089
|
-
return
|
|
3115
|
+
return jt(e, (e) => {
|
|
3090
3116
|
t.push(e);
|
|
3091
3117
|
}, !0), t;
|
|
3092
|
-
},
|
|
3093
|
-
let n =
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
}),
|
|
3097
|
-
|
|
3118
|
+
}, Pt = function(e, t) {
|
|
3119
|
+
let n = Da();
|
|
3120
|
+
ba(Nt(e), (e) => {
|
|
3121
|
+
_(e) === $.element && Oa(n, e);
|
|
3122
|
+
}), ba(t, (e) => {
|
|
3123
|
+
_(e) === $.element && !ka(n, e) && At(e);
|
|
3098
3124
|
});
|
|
3099
|
-
},
|
|
3125
|
+
}, Ft = function(e, n) {
|
|
3100
3126
|
let r = !1;
|
|
3101
|
-
return
|
|
3102
|
-
t.element && (r ||= t.element === e,
|
|
3103
|
-
}),
|
|
3104
|
-
},
|
|
3105
|
-
let n =
|
|
3106
|
-
|
|
3127
|
+
return ba(t.removed, (t) => {
|
|
3128
|
+
t.element && (r ||= t.element === e, Mt(t.element));
|
|
3129
|
+
}), Pt(e, n), r;
|
|
3130
|
+
}, It = function(e, t) {
|
|
3131
|
+
let n = D, r = null, i = () => (r || (r = Da(), ba(t, (e) => {
|
|
3132
|
+
Oa(r, e);
|
|
3107
3133
|
})), r);
|
|
3108
3134
|
for (let t = 0;; t++) {
|
|
3109
|
-
let r =
|
|
3110
|
-
if (
|
|
3111
|
-
|
|
3135
|
+
let r = Nt(e), a = [e], o = !1;
|
|
3136
|
+
if (ba(r, (e) => {
|
|
3137
|
+
_(e) === $.documentFragment ? Ca(a, e) : !o && !ka(n, e) && (o = ka(i(), e));
|
|
3112
3138
|
}), !o) return;
|
|
3113
|
-
if (t >= 8) throw
|
|
3114
|
-
|
|
3115
|
-
|
|
3139
|
+
if (t >= 8) throw Va("the tree kept changing during in-place sanitization; refusing to return it");
|
|
3140
|
+
ba(a, (t, n) => {
|
|
3141
|
+
Lt(t, n > 0, e, i());
|
|
3116
3142
|
});
|
|
3117
3143
|
}
|
|
3118
|
-
},
|
|
3119
|
-
let i =
|
|
3120
|
-
for (; a = i.nextNode();)
|
|
3121
|
-
}, It = function(e) {
|
|
3122
|
-
Xe && Da(Xe, e);
|
|
3123
|
-
}, Lt = function(e, t) {
|
|
3124
|
-
return Le ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
3144
|
+
}, Lt = function(e, t, n, r) {
|
|
3145
|
+
let i = Ht(e), a;
|
|
3146
|
+
for (; a = i.nextNode();) ka(r, a) && !ka(D, a) && (t && P(S.uponSanitizeShadowNode, a, null), Zt(a, n), an(a, n), M(a.content) && on(a.content));
|
|
3125
3147
|
}, Rt = function(e) {
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3148
|
+
D && Oa(D, e);
|
|
3149
|
+
}, zt = function(e, t) {
|
|
3150
|
+
return Re ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
3151
|
+
}, Bt = function(e) {
|
|
3152
|
+
Re && jt(e, (e) => {
|
|
3153
|
+
let t = _(e);
|
|
3154
|
+
if (t === $.processingInstruction || t === $.comment && J(go, e.data)) {
|
|
3129
3155
|
try {
|
|
3130
3156
|
p(e);
|
|
3131
3157
|
} catch {}
|
|
3132
3158
|
return !1;
|
|
3133
3159
|
}
|
|
3134
3160
|
if (t === $.element) {
|
|
3135
|
-
let t = e, n =
|
|
3161
|
+
let t = e, n = A(oe(e));
|
|
3136
3162
|
try {
|
|
3137
|
-
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") &&
|
|
3163
|
+
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && zt("for", n) && t.removeAttribute("for");
|
|
3138
3164
|
} catch {}
|
|
3139
3165
|
}
|
|
3140
3166
|
return !0;
|
|
3141
3167
|
});
|
|
3142
|
-
},
|
|
3168
|
+
}, Vt = function(e) {
|
|
3143
3169
|
let t = null, r = null;
|
|
3144
|
-
if (
|
|
3170
|
+
if (Ue) e = "<remove></remove>" + e;
|
|
3145
3171
|
else {
|
|
3146
|
-
let t =
|
|
3172
|
+
let t = Ma(e, /^[\r\n\t ]+/);
|
|
3147
3173
|
r = t && t[0];
|
|
3148
3174
|
}
|
|
3149
|
-
|
|
3150
|
-
let i =
|
|
3151
|
-
if (
|
|
3152
|
-
t = new l().parseFromString(i,
|
|
3175
|
+
ht === "application/xhtml+xml" && st === O && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
3176
|
+
let i = v ? b(e) : e;
|
|
3177
|
+
if (st === O) try {
|
|
3178
|
+
t = new l().parseFromString(i, ht);
|
|
3153
3179
|
} catch {}
|
|
3154
3180
|
if (!t || !t.documentElement) {
|
|
3155
|
-
t =
|
|
3181
|
+
t = he.createDocument(st, "template", null);
|
|
3156
3182
|
try {
|
|
3157
|
-
t.documentElement.innerHTML =
|
|
3183
|
+
t.documentElement.innerHTML = ct ? y : i;
|
|
3158
3184
|
} catch {}
|
|
3159
3185
|
}
|
|
3160
3186
|
let a = t.body || t.documentElement;
|
|
3161
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
3162
|
-
}, Bt = function(e) {
|
|
3163
|
-
let t = _ ? _(e) : e.ownerDocument;
|
|
3164
|
-
return he.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
3165
|
-
}, Vt = function(e) {
|
|
3166
|
-
return e = Ma(e, ye, " "), e = Ma(e, be, " "), e = Ma(e, xe, " "), e;
|
|
3187
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), st === O ? ve.call(t, ze ? "html" : "body")[0] : ze ? t.documentElement : a;
|
|
3167
3188
|
}, Ht = function(e) {
|
|
3168
|
-
|
|
3189
|
+
let t = g ? g(e) : e.ownerDocument;
|
|
3190
|
+
return ge.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
3191
|
+
}, Ut = function(e) {
|
|
3192
|
+
return e = Na(e, be, " "), e = Na(e, xe, " "), e = Na(e, Se, " "), e;
|
|
3193
|
+
}, Wt = function(e) {
|
|
3194
|
+
Gt(e);
|
|
3169
3195
|
let t = e.querySelectorAll?.call(e, "template");
|
|
3170
|
-
t &&
|
|
3171
|
-
|
|
3196
|
+
t && ba(t, (e) => {
|
|
3197
|
+
M(e.content) && Wt(e.content);
|
|
3172
3198
|
});
|
|
3173
|
-
},
|
|
3199
|
+
}, Gt = function(e) {
|
|
3174
3200
|
e.normalize();
|
|
3175
|
-
let t =
|
|
3176
|
-
for (; r;) r.data =
|
|
3177
|
-
},
|
|
3178
|
-
let t =
|
|
3179
|
-
return typeof t != "string" ||
|
|
3180
|
-
},
|
|
3181
|
-
if (!
|
|
3201
|
+
let t = g ? g(e) : e.ownerDocument, n = ge.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
3202
|
+
for (; r;) r.data = Ut(r.data), r = n.nextNode();
|
|
3203
|
+
}, Kt = function(e) {
|
|
3204
|
+
let t = h ? h(e) : null;
|
|
3205
|
+
return typeof t != "string" || A(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ie(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== ae(e) || e.childNodes !== te(e);
|
|
3206
|
+
}, M = function(e) {
|
|
3207
|
+
if (!ae || typeof e != "object" || !e) return !1;
|
|
3182
3208
|
try {
|
|
3183
|
-
return
|
|
3209
|
+
return ae(e) === $.documentFragment;
|
|
3184
3210
|
} catch {
|
|
3185
3211
|
return !1;
|
|
3186
3212
|
}
|
|
3187
|
-
},
|
|
3188
|
-
if (!
|
|
3213
|
+
}, N = function(e) {
|
|
3214
|
+
if (!ae || typeof e != "object" || !e) return !1;
|
|
3189
3215
|
try {
|
|
3190
|
-
return typeof
|
|
3216
|
+
return typeof ae(e) == "number";
|
|
3191
3217
|
} catch {
|
|
3192
3218
|
return !1;
|
|
3193
3219
|
}
|
|
3194
3220
|
};
|
|
3195
|
-
function
|
|
3196
|
-
e.length !== 0 &&
|
|
3197
|
-
e.call(t, n, r,
|
|
3221
|
+
function P(e, n, r) {
|
|
3222
|
+
e.length !== 0 && ba(e, (e) => {
|
|
3223
|
+
e.call(t, n, r, _t);
|
|
3198
3224
|
});
|
|
3199
3225
|
}
|
|
3200
|
-
let
|
|
3201
|
-
return !!(
|
|
3202
|
-
},
|
|
3226
|
+
let qt = function(e, t) {
|
|
3227
|
+
return !!(Re && e.hasChildNodes() && !N(e.firstElementChild) && J(ho, e.textContent) && J(ho, e.innerHTML) || Re && yo[t] && _(e) === $.element && ce(e) === O && (N(e.firstElementChild) || typeof e.textContent == "string" && J(ho, e.textContent)) || e.nodeType === $.processingInstruction || Re && e.nodeType === $.comment && J(go, e.data));
|
|
3228
|
+
}, F = function(e, t) {
|
|
3203
3229
|
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
3204
|
-
},
|
|
3205
|
-
if (!Ae[t] &&
|
|
3206
|
-
if (
|
|
3207
|
-
let t =
|
|
3230
|
+
}, Jt = function(e, t, n) {
|
|
3231
|
+
if (!Ae[t] && en(t) && F(E.tagNameCheck, t)) return !1;
|
|
3232
|
+
if (Xe && !$e[t] && !$e[Aa(t)]) {
|
|
3233
|
+
let t = ne(e), r = te(e);
|
|
3208
3234
|
if (r && t) {
|
|
3209
3235
|
let i = r.length;
|
|
3210
3236
|
for (let a = i - 1; a >= 0; --a) {
|
|
@@ -3213,35 +3239,35 @@ function wo() {
|
|
|
3213
3239
|
}
|
|
3214
3240
|
}
|
|
3215
3241
|
}
|
|
3216
|
-
return
|
|
3217
|
-
},
|
|
3242
|
+
return Dt(e), !0;
|
|
3243
|
+
}, Yt = function(e, t, n, r) {
|
|
3218
3244
|
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
3219
|
-
},
|
|
3220
|
-
return e === t ||
|
|
3221
|
-
},
|
|
3222
|
-
if (
|
|
3223
|
-
if (
|
|
3224
|
-
let r =
|
|
3225
|
-
if (w =
|
|
3245
|
+
}, Xt = function(e, t) {
|
|
3246
|
+
return e === t || ne(e) !== null ? !1 : (Ze && Mt(e), !0);
|
|
3247
|
+
}, Zt = function(e, n) {
|
|
3248
|
+
if (Rt(e), P(S.beforeSanitizeElements, e, null), Xt(e, n)) return !0;
|
|
3249
|
+
if (Kt(e)) return Dt(e), !0;
|
|
3250
|
+
let r = A(oe(e));
|
|
3251
|
+
if (w = Yt(S.uponSanitizeElement, w, Oe, Ve), P(S.uponSanitizeElement, e, {
|
|
3226
3252
|
tagName: r,
|
|
3227
3253
|
allowedTags: w
|
|
3228
|
-
}),
|
|
3229
|
-
if (
|
|
3254
|
+
}), Xt(e, n)) return !0;
|
|
3255
|
+
if (qt(e, r)) return Dt(e), !0;
|
|
3230
3256
|
if (Ae[r] || !(Me.tagCheck instanceof Function && Me.tagCheck(r)) && !w[r]) {
|
|
3231
|
-
let t =
|
|
3232
|
-
return t === !1 && (
|
|
3257
|
+
let t = Jt(e, r, n);
|
|
3258
|
+
return t === !1 && (P(S.afterSanitizeElements, e, null), Xt(e, n)) ? !0 : t;
|
|
3233
3259
|
}
|
|
3234
|
-
if (
|
|
3235
|
-
if (
|
|
3236
|
-
let n =
|
|
3237
|
-
e.textContent !== n && (
|
|
3260
|
+
if (_(e) === $.element && !Et(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(_o, e.innerHTML)) return Dt(e), !0;
|
|
3261
|
+
if (Le && e.nodeType === $.text) {
|
|
3262
|
+
let n = Ut(e.textContent);
|
|
3263
|
+
e.textContent !== n && (Ca(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
3238
3264
|
}
|
|
3239
|
-
return
|
|
3240
|
-
},
|
|
3241
|
-
if (je[t] ||
|
|
3265
|
+
return P(S.afterSanitizeElements, e, null), Xt(e, n);
|
|
3266
|
+
}, Qt = function(e, t, r) {
|
|
3267
|
+
if (je[t] || zt(t, e) || qe && (t === "id" || t === "name") && (r in n || r in vt)) return !1;
|
|
3242
3268
|
let i = T[t] || Me.attributeCheck instanceof Function && Me.attributeCheck(t, e);
|
|
3243
|
-
return Pe && J(
|
|
3244
|
-
},
|
|
3269
|
+
return Pe && J(Ce, t) || Ne && J(we, t) ? !0 : i ? rt[t] || J(De, Na(r, Te, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Pa(r, "data:") === 0 && tt[e] || Fe && !J(C, Na(r, Te, "")) ? !0 : !r : en(e) && F(E.tagNameCheck, e) && F(E.attributeNameCheck, t, e) || t === "is" && E.allowCustomizedBuiltInElements && F(E.tagNameCheck, r);
|
|
3270
|
+
}, $t = X({}, [
|
|
3245
3271
|
"annotation-xml",
|
|
3246
3272
|
"color-profile",
|
|
3247
3273
|
"font-face",
|
|
@@ -3250,47 +3276,47 @@ function wo() {
|
|
|
3250
3276
|
"font-face-src",
|
|
3251
3277
|
"font-face-uri",
|
|
3252
3278
|
"missing-glyph"
|
|
3253
|
-
]),
|
|
3254
|
-
return
|
|
3255
|
-
},
|
|
3256
|
-
if (
|
|
3257
|
-
case "TrustedHTML": return
|
|
3258
|
-
case "TrustedScriptURL": return
|
|
3279
|
+
]), en = function(e) {
|
|
3280
|
+
return !$t[Aa(e)] && J(Ee, e);
|
|
3281
|
+
}, tn = function(e, t, n, r) {
|
|
3282
|
+
if (v && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
3283
|
+
case "TrustedHTML": return b(r);
|
|
3284
|
+
case "TrustedScriptURL": return pe(r);
|
|
3259
3285
|
}
|
|
3260
3286
|
return r;
|
|
3261
|
-
},
|
|
3287
|
+
}, nn = function(e, t, n, r) {
|
|
3262
3288
|
try {
|
|
3263
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !
|
|
3289
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !Kt(e) || (Dt(e), !1);
|
|
3264
3290
|
} catch {
|
|
3265
|
-
return
|
|
3291
|
+
return j(t, e), !1;
|
|
3266
3292
|
}
|
|
3267
|
-
},
|
|
3268
|
-
return
|
|
3269
|
-
},
|
|
3270
|
-
if (
|
|
3293
|
+
}, rn = function(e, t) {
|
|
3294
|
+
return Re && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : Aa(e) === "attributename" && Ma(t, "href") !== null;
|
|
3295
|
+
}, an = function(e, n) {
|
|
3296
|
+
if (P(S.beforeSanitizeAttributes, e, null), Xt(e, n)) return;
|
|
3271
3297
|
let r = e.attributes;
|
|
3272
|
-
if (!r ||
|
|
3273
|
-
T =
|
|
3298
|
+
if (!r || Kt(e)) return;
|
|
3299
|
+
T = Yt(S.uponSanitizeAttribute, T, ke, He);
|
|
3274
3300
|
let i = {
|
|
3275
3301
|
attrName: "",
|
|
3276
3302
|
attrValue: "",
|
|
3277
3303
|
keepAttr: !0,
|
|
3278
3304
|
allowedAttributes: T,
|
|
3279
3305
|
forceKeepAttr: void 0
|
|
3280
|
-
}, a = r.length, o =
|
|
3306
|
+
}, a = r.length, o = A(e.nodeName);
|
|
3281
3307
|
for (; a--;) {
|
|
3282
|
-
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u =
|
|
3283
|
-
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0,
|
|
3284
|
-
}
|
|
3285
|
-
|
|
3286
|
-
},
|
|
3287
|
-
let t = null, n =
|
|
3288
|
-
for (
|
|
3289
|
-
let e =
|
|
3290
|
-
|
|
3291
|
-
}
|
|
3292
|
-
|
|
3293
|
-
},
|
|
3308
|
+
let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = A(s), d = l, f = s === "value" ? d : Fa(d), p = !1;
|
|
3309
|
+
i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, P(S.uponSanitizeAttribute, e, i), f = i.attrValue, Je && (u === "id" || u === "name") && Pa(f, Ye) !== 0 && (j(s, e, n), f = Ye + f, p = !0), rn(s, f) ? j(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Ie && J(vo, f) ? j(s, e, n) : (Le && (f = Ut(f)), Qt(o, u, f) ? (f = tn(o, u, c, f), f !== d && nn(e, s, c, f) && p && Sa(t.removed)) : j(s, e, n)) : j(s, e, n));
|
|
3310
|
+
}
|
|
3311
|
+
P(S.afterSanitizeAttributes, e, null), Xt(e, n);
|
|
3312
|
+
}, on = function(e) {
|
|
3313
|
+
let t = null, n = Ht(e);
|
|
3314
|
+
for (P(S.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (P(S.uponSanitizeShadowNode, t, null), Zt(t, e), an(t, e), M(t.content) && on(t.content), _(t) === $.element) {
|
|
3315
|
+
let e = re(t);
|
|
3316
|
+
M(e) && (I(e), on(e));
|
|
3317
|
+
}
|
|
3318
|
+
Le && Gt(e), P(S.afterSanitizeShadowDOM, e, null);
|
|
3319
|
+
}, I = function(e) {
|
|
3294
3320
|
let t = [{
|
|
3295
3321
|
node: e,
|
|
3296
3322
|
shadow: null
|
|
@@ -3298,27 +3324,27 @@ function wo() {
|
|
|
3298
3324
|
for (; t.length > 0;) {
|
|
3299
3325
|
let e = t.pop();
|
|
3300
3326
|
if (e.shadow) {
|
|
3301
|
-
|
|
3327
|
+
on(e.shadow);
|
|
3302
3328
|
continue;
|
|
3303
3329
|
}
|
|
3304
|
-
let n = e.node, r =
|
|
3330
|
+
let n = e.node, r = _(n) === $.element, i = te(n);
|
|
3305
3331
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
3306
3332
|
node: i[e],
|
|
3307
3333
|
shadow: null
|
|
3308
3334
|
});
|
|
3309
3335
|
if (r) {
|
|
3310
|
-
let e =
|
|
3311
|
-
if (typeof e == "string" &&
|
|
3336
|
+
let e = h ? h(n) : null;
|
|
3337
|
+
if (typeof e == "string" && A(e) === "template") {
|
|
3312
3338
|
let e = n.content;
|
|
3313
|
-
|
|
3339
|
+
M(e) && t.push({
|
|
3314
3340
|
node: e,
|
|
3315
3341
|
shadow: null
|
|
3316
3342
|
});
|
|
3317
3343
|
}
|
|
3318
3344
|
}
|
|
3319
3345
|
if (r) {
|
|
3320
|
-
let e =
|
|
3321
|
-
|
|
3346
|
+
let e = re(n);
|
|
3347
|
+
M(e) && t.push({
|
|
3322
3348
|
node: null,
|
|
3323
3349
|
shadow: e
|
|
3324
3350
|
}, {
|
|
@@ -3330,82 +3356,82 @@ function wo() {
|
|
|
3330
3356
|
};
|
|
3331
3357
|
return t.sanitize = function(e) {
|
|
3332
3358
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3333
|
-
if (
|
|
3359
|
+
if (ct = !e, ct && (e = "<!-->"), typeof e != "string" && !N(e) && (e = Wa(e), typeof e != "string")) throw Va("dirty is not a string, aborting");
|
|
3334
3360
|
if (!t.isSupported) return e;
|
|
3335
|
-
|
|
3336
|
-
let c =
|
|
3361
|
+
Be ? (w = Ve, T = He) : bt(n), (S.uponSanitizeElement.length > 0 || S.uponSanitizeAttribute.length > 0) && (w = Z(w)), S.uponSanitizeAttribute.length > 0 && (T = Z(T)), t.removed = [];
|
|
3362
|
+
let c = Ze && typeof e != "string" && N(e), l = [], u = D;
|
|
3337
3363
|
if (c) {
|
|
3338
|
-
|
|
3339
|
-
let t =
|
|
3364
|
+
Bt(e);
|
|
3365
|
+
let t = oe(e);
|
|
3340
3366
|
if (typeof t == "string") {
|
|
3341
|
-
let n =
|
|
3342
|
-
if (!w[n] || Ae[n]) throw
|
|
3367
|
+
let n = A(t);
|
|
3368
|
+
if (!w[n] || Ae[n]) throw kt(e), Va("root node is forbidden and cannot be sanitized in-place");
|
|
3343
3369
|
}
|
|
3344
|
-
if (
|
|
3345
|
-
l =
|
|
3346
|
-
} else if (
|
|
3370
|
+
if (Kt(e)) throw kt(e), Va("root node is clobbered and cannot be sanitized in-place");
|
|
3371
|
+
l = Nt(e), D = Da();
|
|
3372
|
+
} else if (N(e)) i = Vt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), I(i);
|
|
3347
3373
|
else {
|
|
3348
|
-
if (!
|
|
3349
|
-
if (i =
|
|
3374
|
+
if (!We && !Le && !ze && e.indexOf("<") === -1) return v && Ke ? b(e) : e;
|
|
3375
|
+
if (i = Vt(e), !i) return We ? null : Ke ? y : "";
|
|
3350
3376
|
}
|
|
3351
|
-
i &&
|
|
3377
|
+
i && Ue && Dt(i.firstChild);
|
|
3352
3378
|
let d = c ? e : i;
|
|
3353
3379
|
try {
|
|
3354
|
-
c &&
|
|
3355
|
-
let t =
|
|
3356
|
-
for (; o = t.nextNode();)
|
|
3357
|
-
c &&
|
|
3380
|
+
c && I(e);
|
|
3381
|
+
let t = Ht(d);
|
|
3382
|
+
for (; o = t.nextNode();) Zt(o, d), an(o, d), M(o.content) && on(o.content);
|
|
3383
|
+
c && It(e, l);
|
|
3358
3384
|
} catch (t) {
|
|
3359
|
-
throw c && (
|
|
3385
|
+
throw c && (kt(e), Ft(e, l)), t;
|
|
3360
3386
|
} finally {
|
|
3361
|
-
|
|
3387
|
+
D = u;
|
|
3362
3388
|
}
|
|
3363
3389
|
if (c) {
|
|
3364
|
-
if (
|
|
3365
|
-
return
|
|
3390
|
+
if (Ft(e, l)) throw Va("a node selected for removal could not be safely returned; refusing to sanitize in place");
|
|
3391
|
+
return Le && Wt(e), e;
|
|
3366
3392
|
}
|
|
3367
|
-
if (
|
|
3368
|
-
if (
|
|
3393
|
+
if (We) {
|
|
3394
|
+
if (Le && Wt(i), Ge) for (s = _e.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3369
3395
|
else s = i;
|
|
3370
|
-
return (T.shadowroot || T.shadowrootmode) && (s =
|
|
3396
|
+
return (T.shadowroot || T.shadowrootmode) && (s = ye.call(r, s, !0)), s;
|
|
3371
3397
|
}
|
|
3372
|
-
let f =
|
|
3373
|
-
return
|
|
3398
|
+
let f = ze ? i.outerHTML : i.innerHTML;
|
|
3399
|
+
return ze && w["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(po, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), Le && (f = Ut(f)), v && Ke ? b(f) : f;
|
|
3374
3400
|
}, t.setConfig = function() {
|
|
3375
3401
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3376
|
-
|
|
3402
|
+
bt(e), Be = !0, Ve = w, He = T;
|
|
3377
3403
|
}, t.clearConfig = function() {
|
|
3378
|
-
|
|
3404
|
+
_t = null, Be = !1, Ve = null, He = null, v = le, y = "";
|
|
3379
3405
|
}, t.isValidAttribute = function(e, t, n) {
|
|
3380
|
-
|
|
3381
|
-
let r =
|
|
3382
|
-
return typeof n == "string" && (
|
|
3406
|
+
_t || bt({});
|
|
3407
|
+
let r = A(e), i = A(t);
|
|
3408
|
+
return typeof n == "string" && (rn(t, n) || !Ie && J(vo, n)) ? !1 : Qt(r, i, n);
|
|
3383
3409
|
}, t.addHook = function(e, t) {
|
|
3384
|
-
typeof t == "function" && q(
|
|
3410
|
+
typeof t == "function" && q(S, e) && Ca(S[e], t);
|
|
3385
3411
|
}, t.removeHook = function(e, t) {
|
|
3386
|
-
if (q(
|
|
3412
|
+
if (q(S, e)) {
|
|
3387
3413
|
if (t !== void 0) {
|
|
3388
|
-
let n =
|
|
3389
|
-
return n === -1 ? void 0 :
|
|
3414
|
+
let n = xa(S[e], t);
|
|
3415
|
+
return n === -1 ? void 0 : Ta(S[e], n, 1)[0];
|
|
3390
3416
|
}
|
|
3391
|
-
return
|
|
3417
|
+
return Sa(S[e]);
|
|
3392
3418
|
}
|
|
3393
3419
|
}, t.removeHooks = function(e) {
|
|
3394
|
-
q(
|
|
3420
|
+
q(S, e) && (S[e] = []);
|
|
3395
3421
|
}, t.removeAllHooks = function() {
|
|
3396
|
-
|
|
3422
|
+
S = So();
|
|
3397
3423
|
}, t;
|
|
3398
3424
|
}
|
|
3399
|
-
var
|
|
3425
|
+
var Eo = To();
|
|
3400
3426
|
//#endregion
|
|
3401
3427
|
//#region ../../packages/components/src/chat/markdownHtml.ts
|
|
3402
|
-
function
|
|
3428
|
+
function Do(e) {
|
|
3403
3429
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3404
3430
|
}
|
|
3405
|
-
function
|
|
3431
|
+
function Oo(e, t) {
|
|
3406
3432
|
return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
|
|
3407
3433
|
}
|
|
3408
|
-
var
|
|
3434
|
+
var ko = {
|
|
3409
3435
|
ADD_ATTR: ["target"],
|
|
3410
3436
|
ALLOW_UNKNOWN_PROTOCOLS: !0,
|
|
3411
3437
|
FORBID_TAGS: [
|
|
@@ -3426,21 +3452,21 @@ var Oo = {
|
|
|
3426
3452
|
"background"
|
|
3427
3453
|
]
|
|
3428
3454
|
};
|
|
3429
|
-
|
|
3455
|
+
Eo.addHook("uponSanitizeAttribute", (e, t) => {
|
|
3430
3456
|
t.attrName === "src" && e.nodeName !== "IMG" && (t.keepAttr = !1);
|
|
3431
3457
|
});
|
|
3432
|
-
var
|
|
3433
|
-
function
|
|
3434
|
-
if (!t) return
|
|
3435
|
-
let n =
|
|
3436
|
-
...
|
|
3458
|
+
var Ao = "data-held-src";
|
|
3459
|
+
function jo(e, t) {
|
|
3460
|
+
if (!t) return Eo.sanitize(e, ko);
|
|
3461
|
+
let n = Eo.sanitize(e, {
|
|
3462
|
+
...ko,
|
|
3437
3463
|
RETURN_DOM_FRAGMENT: !0
|
|
3438
3464
|
});
|
|
3439
3465
|
for (let e of Array.from(n.querySelectorAll("img"))) {
|
|
3440
3466
|
let n = e.getAttribute("src") ?? "";
|
|
3441
3467
|
if (t.canLoad(n)) continue;
|
|
3442
3468
|
let r = e.ownerDocument.createElement("button");
|
|
3443
|
-
r.type = "button", r.className = "markdown-held-image", r.setAttribute(
|
|
3469
|
+
r.type = "button", r.className = "markdown-held-image", r.setAttribute(Ao, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
|
|
3444
3470
|
}
|
|
3445
3471
|
let r = n.ownerDocument.createElement("div");
|
|
3446
3472
|
return r.append(n), r.innerHTML;
|
|
@@ -3448,7 +3474,7 @@ function Ao(e, t) {
|
|
|
3448
3474
|
//#endregion
|
|
3449
3475
|
//#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
|
|
3450
3476
|
c(), o();
|
|
3451
|
-
var
|
|
3477
|
+
var Mo = ["innerHTML"], No = 100, Po = /*#__PURE__*/ ce(/* @__PURE__ */ l({
|
|
3452
3478
|
__name: "PkStreamingMarkdown",
|
|
3453
3479
|
props: {
|
|
3454
3480
|
markdown: {
|
|
@@ -3478,14 +3504,14 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3478
3504
|
},
|
|
3479
3505
|
setup(o) {
|
|
3480
3506
|
let c = o, { t: l } = f({ useScope: "global" }), m = null;
|
|
3481
|
-
function
|
|
3507
|
+
function te() {
|
|
3482
3508
|
return m ||= import("./dist-BK6ru3gS.js"), m;
|
|
3483
3509
|
}
|
|
3484
|
-
let
|
|
3485
|
-
function
|
|
3486
|
-
return
|
|
3510
|
+
let ne = null;
|
|
3511
|
+
function re() {
|
|
3512
|
+
return ne ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), ne;
|
|
3487
3513
|
}
|
|
3488
|
-
let
|
|
3514
|
+
let ie = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, ae = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
3489
3515
|
W.use({ extensions: [{
|
|
3490
3516
|
name: "inlineKatex",
|
|
3491
3517
|
level: "inline",
|
|
@@ -3494,7 +3520,7 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3494
3520
|
if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
|
|
3495
3521
|
},
|
|
3496
3522
|
tokenizer(e) {
|
|
3497
|
-
let t = e.match(
|
|
3523
|
+
let t = e.match(ie);
|
|
3498
3524
|
if (t) return {
|
|
3499
3525
|
type: "inlineKatex",
|
|
3500
3526
|
raw: t[0],
|
|
@@ -3503,13 +3529,13 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3503
3529
|
};
|
|
3504
3530
|
},
|
|
3505
3531
|
renderer(e) {
|
|
3506
|
-
return
|
|
3532
|
+
return Oo(e.text, e.displayMode);
|
|
3507
3533
|
}
|
|
3508
3534
|
}, {
|
|
3509
3535
|
name: "blockKatex",
|
|
3510
3536
|
level: "block",
|
|
3511
3537
|
tokenizer(e) {
|
|
3512
|
-
let t = e.match(
|
|
3538
|
+
let t = e.match(ae);
|
|
3513
3539
|
if (t) return {
|
|
3514
3540
|
type: "blockKatex",
|
|
3515
3541
|
raw: t[0],
|
|
@@ -3518,7 +3544,7 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3518
3544
|
};
|
|
3519
3545
|
},
|
|
3520
3546
|
renderer(e) {
|
|
3521
|
-
return
|
|
3547
|
+
return Oo(e.text, e.displayMode) + "\n";
|
|
3522
3548
|
}
|
|
3523
3549
|
}] }), W.use({ extensions: [{
|
|
3524
3550
|
name: "thinking",
|
|
@@ -3539,30 +3565,30 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3539
3565
|
return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
|
|
3540
3566
|
}
|
|
3541
3567
|
}] });
|
|
3542
|
-
let
|
|
3543
|
-
|
|
3568
|
+
let h = new W.Renderer(), g = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), ce = /^(?:javascript|data|vbscript|file):/i, y = !1, le = (e) => g(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
|
|
3569
|
+
h.link = function({ href: e, title: t, text: n, tokens: r }) {
|
|
3544
3570
|
let i = this.parser.parseInline(r), a = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
|
|
3545
|
-
if (!a ||
|
|
3546
|
-
let o =
|
|
3547
|
-
return `<a href="${
|
|
3548
|
-
},
|
|
3549
|
-
|
|
3571
|
+
if (!a || ce.test(a)) return i;
|
|
3572
|
+
let o = y && n === a, s = t || (o ? a : ""), c = s ? ` title="${g(s)}"` : "", l = _(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
|
|
3573
|
+
return `<a href="${g(a)}"${c}${l}>${o ? le(a) : i}</a>`;
|
|
3574
|
+
}, h.table = function(e) {
|
|
3575
|
+
y = !0;
|
|
3550
3576
|
try {
|
|
3551
|
-
let t = e.header.map((e) =>
|
|
3577
|
+
let t = e.header.map((e) => g(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
|
|
3552
3578
|
let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
|
|
3553
3579
|
return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
|
|
3554
3580
|
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
|
|
3555
3581
|
return `<div class="table-wrapper u-table-scroll"><table class="${e.header.length >= 3 && e.rows.length ? "u-table u-table--stack" : "u-table"}" role="table"><thead role="rowgroup">${n(e.header)}</thead>${r}</table></div>\n`;
|
|
3556
3582
|
} finally {
|
|
3557
|
-
|
|
3583
|
+
y = !1;
|
|
3558
3584
|
}
|
|
3559
3585
|
};
|
|
3560
|
-
let
|
|
3561
|
-
|
|
3562
|
-
function
|
|
3586
|
+
let ue = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
|
|
3587
|
+
h.code = ({ text: e }) => ue.test(e) ? `<pre class="mermaid">${Do(e)}</pre>` : `<pre><code>${Do(e)}</code></pre>`;
|
|
3588
|
+
function fe(e) {
|
|
3563
3589
|
return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
|
|
3564
3590
|
}
|
|
3565
|
-
function
|
|
3591
|
+
function b(e) {
|
|
3566
3592
|
let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
|
|
3567
3593
|
for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
|
|
3568
3594
|
return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
|
|
@@ -3574,33 +3600,33 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3574
3600
|
}
|
|
3575
3601
|
}).replace(/\n{3,}/g, "\n\n");
|
|
3576
3602
|
}
|
|
3577
|
-
let
|
|
3578
|
-
|
|
3579
|
-
|
|
3580
|
-
|
|
3581
|
-
|
|
3582
|
-
],
|
|
3583
|
-
let e =
|
|
3584
|
-
return
|
|
3603
|
+
let pe = [
|
|
3604
|
+
de,
|
|
3605
|
+
b,
|
|
3606
|
+
hr,
|
|
3607
|
+
fe
|
|
3608
|
+
], x = i("container"), me = oe(d(c, "markdown"), No), he = s(() => c.tailLength ? Ae(me.value, c.tailLength) : me.value), { resolveText: ge } = se(), _e = ge(he), ve = v(), ye = s(() => {
|
|
3609
|
+
let e = pe.reduce((e, t) => t(e), _e.value);
|
|
3610
|
+
return jo(W.parse(e, {
|
|
3585
3611
|
async: !1,
|
|
3586
3612
|
breaks: !0,
|
|
3587
|
-
renderer:
|
|
3588
|
-
}),
|
|
3589
|
-
canLoad:
|
|
3590
|
-
hostOf:
|
|
3613
|
+
renderer: h
|
|
3614
|
+
}), ve.isGated.value ? {
|
|
3615
|
+
canLoad: ve.canLoad,
|
|
3616
|
+
hostOf: ve.hostOf,
|
|
3591
3617
|
label: (e) => l("label.imageHeld", { host: e })
|
|
3592
3618
|
} : void 0);
|
|
3593
3619
|
});
|
|
3594
|
-
function
|
|
3595
|
-
let t = (e.target?.closest?.(`[${
|
|
3596
|
-
t && (e.preventDefault(), e.stopPropagation(),
|
|
3620
|
+
function S(e) {
|
|
3621
|
+
let t = (e.target?.closest?.(`[${Ao}]`))?.getAttribute(Ao);
|
|
3622
|
+
t && (e.preventDefault(), e.stopPropagation(), ve.release(t));
|
|
3597
3623
|
}
|
|
3598
|
-
async function
|
|
3624
|
+
async function be() {
|
|
3599
3625
|
if (c.loading) return;
|
|
3600
3626
|
await n();
|
|
3601
|
-
let e =
|
|
3627
|
+
let e = x.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
|
|
3602
3628
|
if (!e?.length) return;
|
|
3603
|
-
let { renderMermaidSVG: t, THEMES: r } = await
|
|
3629
|
+
let { renderMermaidSVG: t, THEMES: r } = await te(), i = c.isDark ? r["github-dark"] : r["github-light"];
|
|
3604
3630
|
for (let n of Array.from(e)) {
|
|
3605
3631
|
if (!n.isConnected) continue;
|
|
3606
3632
|
let e = n.textContent?.trim();
|
|
@@ -3610,19 +3636,19 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3610
3636
|
} catch {}
|
|
3611
3637
|
}
|
|
3612
3638
|
}
|
|
3613
|
-
async function
|
|
3639
|
+
async function xe() {
|
|
3614
3640
|
await n();
|
|
3615
|
-
let e =
|
|
3641
|
+
let e = x.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
|
|
3616
3642
|
if (!e?.length) return;
|
|
3617
3643
|
let t = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
|
|
3618
3644
|
for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
|
|
3619
3645
|
}
|
|
3620
|
-
async function
|
|
3646
|
+
async function Se() {
|
|
3621
3647
|
await n();
|
|
3622
|
-
let e =
|
|
3648
|
+
let e = x.value?.querySelectorAll(".katex-pending");
|
|
3623
3649
|
if (!e?.length) return;
|
|
3624
|
-
let t = await
|
|
3625
|
-
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(
|
|
3650
|
+
let t = await re();
|
|
3651
|
+
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(x.value));
|
|
3626
3652
|
for (let n of Array.from(e)) {
|
|
3627
3653
|
if (!n.isConnected) continue;
|
|
3628
3654
|
let e = n.dataset.katex;
|
|
@@ -3636,11 +3662,11 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3636
3662
|
} catch {}
|
|
3637
3663
|
}
|
|
3638
3664
|
}
|
|
3639
|
-
async function
|
|
3665
|
+
async function Ce() {
|
|
3640
3666
|
await n();
|
|
3641
|
-
let e =
|
|
3667
|
+
let e = x.value?.querySelectorAll("pre.mermaid[data-rendered]");
|
|
3642
3668
|
if (!e?.length) return;
|
|
3643
|
-
let { renderMermaidSVG: t, THEMES: r } = await
|
|
3669
|
+
let { renderMermaidSVG: t, THEMES: r } = await te(), i = c.isDark ? r["github-dark"] : r["github-light"];
|
|
3644
3670
|
for (let n of Array.from(e)) {
|
|
3645
3671
|
if (!n.isConnected) continue;
|
|
3646
3672
|
let e = n.dataset.code;
|
|
@@ -3649,7 +3675,7 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3649
3675
|
} catch {}
|
|
3650
3676
|
}
|
|
3651
3677
|
}
|
|
3652
|
-
function
|
|
3678
|
+
function we(e) {
|
|
3653
3679
|
let t = e.target;
|
|
3654
3680
|
if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
|
|
3655
3681
|
t.dataset.broken = "true";
|
|
@@ -3657,11 +3683,11 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3657
3683
|
n.className = "markdown-broken-image", n.textContent = t.alt || l("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
|
|
3658
3684
|
}
|
|
3659
3685
|
t(() => {
|
|
3660
|
-
|
|
3686
|
+
x.value?.addEventListener("error", we, !0);
|
|
3661
3687
|
}), e(() => {
|
|
3662
|
-
|
|
3663
|
-
}), a([
|
|
3664
|
-
let
|
|
3688
|
+
x.value?.removeEventListener("error", we, !0);
|
|
3689
|
+
}), a([ye, () => c.loading], be, { immediate: !0 }), a(() => c.isDark, Ce), a(ye, xe, { immediate: !0 }), a(ye, Se, { immediate: !0 });
|
|
3690
|
+
let C = 0;
|
|
3665
3691
|
function Te(e, t) {
|
|
3666
3692
|
let n = document.createElement("span");
|
|
3667
3693
|
return n.style.cssText = `animation:ft-${c.animation} ${c.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
|
|
@@ -3682,35 +3708,35 @@ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
|
|
|
3682
3708
|
return n;
|
|
3683
3709
|
}
|
|
3684
3710
|
function w() {
|
|
3685
|
-
if (!
|
|
3686
|
-
let e = De(
|
|
3711
|
+
if (!x.value || !c.loading || !c.animation) return;
|
|
3712
|
+
let e = De(x.value), t = 0, n = 0;
|
|
3687
3713
|
for (let r of e) {
|
|
3688
3714
|
let e = r.textContent || "", i = t, a = t + e.length;
|
|
3689
|
-
if (t = a, a <=
|
|
3715
|
+
if (t = a, a <= C) continue;
|
|
3690
3716
|
let o = r.parentNode;
|
|
3691
3717
|
if (!o) continue;
|
|
3692
|
-
if (i >=
|
|
3718
|
+
if (i >= C) {
|
|
3693
3719
|
let t = r.nextSibling;
|
|
3694
3720
|
o.removeChild(r), n = Ee(e, o, t, n);
|
|
3695
3721
|
continue;
|
|
3696
3722
|
}
|
|
3697
|
-
let s =
|
|
3723
|
+
let s = C - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
|
|
3698
3724
|
o.removeChild(c), n = Ee(l, o, u, n);
|
|
3699
3725
|
}
|
|
3700
|
-
|
|
3726
|
+
C = t;
|
|
3701
3727
|
}
|
|
3702
|
-
return a(
|
|
3728
|
+
return a(ye, async () => {
|
|
3703
3729
|
await n(), w();
|
|
3704
3730
|
}, { immediate: !0 }), a(() => c.markdown, (e, t) => {
|
|
3705
|
-
(!e || t && e.length < t.length) && (
|
|
3731
|
+
(!e || t && e.length < t.length) && (C = 0);
|
|
3706
3732
|
}), (e, t) => (r(), u("div", {
|
|
3707
3733
|
ref: "container",
|
|
3708
|
-
onClick:
|
|
3709
|
-
innerHTML:
|
|
3710
|
-
}, null, 8,
|
|
3734
|
+
onClick: S,
|
|
3735
|
+
innerHTML: ye.value
|
|
3736
|
+
}, null, 8, Mo));
|
|
3711
3737
|
}
|
|
3712
3738
|
}), [["styles", [".markdown-held-image{max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-3);font:inherit;font-size:var(--text-12);vertical-align:middle;cursor:pointer;align-items:center;display:inline-flex}.markdown-held-image:hover,.markdown-held-image:focus-visible{background-color:var(--color-surface-2);color:var(--color-word-2)}.markdown-broken-image{align-items:center;gap:var(--spacing-4);max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-4);font-size:var(--text-12);vertical-align:middle;display:inline-flex}@keyframes ft-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes ft-blurIn{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur()}}@keyframes ft-dropIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-slideUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-fadeAndScale{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}"]]]);
|
|
3713
3739
|
//#endregion
|
|
3714
|
-
export {
|
|
3740
|
+
export { Be as A, fe as B, Fe as C, it as D, Pe as E, ye as F, ge as H, pe as I, ve as L, tt as M, me as N, S as O, he as P, x as R, ze as S, T, b as V, Ie as _, Je as a, We as b, we as c, Ke as d, He as f, rt as g, Le as h, ke as i, Ue as j, Ce as k, Ge as l, $e as m, Ne as n, Ve as o, C as p, Ee as r, xe as s, Po as t, qe as u, at as v, Oe as w, Xe as x, Qe as y, _e as z };
|
|
3715
3741
|
|
|
3716
|
-
//# sourceMappingURL=PkStreamingMarkdown
|
|
3742
|
+
//# sourceMappingURL=PkStreamingMarkdown-D2aqCD0I.js.map
|