@8wave/ai-elements 0.114.0-beta.30 → 0.114.0-beta.7
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/dist/_chunks/Agent-DTLrWpzX.js +460 -0
- package/dist/_chunks/Agent-DTLrWpzX.js.map +1 -0
- package/dist/_chunks/Media-Cft7Pwrh.js +108 -0
- package/dist/_chunks/Media-Cft7Pwrh.js.map +1 -0
- package/dist/_chunks/{PkStreamingMarkdown-ZD0SROu1.js → PkStreamingMarkdown-C1sANAr5.js} +672 -688
- package/dist/_chunks/PkStreamingMarkdown-C1sANAr5.js.map +1 -0
- package/dist/_chunks/{PkToolRequestGeolocation-OF1PWhMw.js → PkToolRequestGeolocation-BbxYKt-9.js} +2 -2
- package/{dist-vue/_chunks/PkToolRequestGeolocation-BOVbaCzQ.js.map → dist/_chunks/PkToolRequestGeolocation-BbxYKt-9.js.map} +1 -1
- package/dist/_chunks/{PkToolRequestOAuthConnection-ChGMAKV7.js → PkToolRequestOAuthConnection-CTp2w60F.js} +2 -2
- package/dist/_chunks/{PkToolRequestOAuthConnection-ChGMAKV7.js.map → PkToolRequestOAuthConnection-CTp2w60F.js.map} +1 -1
- package/dist/_chunks/{PkToolShowArtifact-LEfO5zfg.js → PkToolShowArtifact-BfTjxGOT.js} +2 -2
- package/dist/_chunks/{PkToolShowArtifact-LEfO5zfg.js.map → PkToolShowArtifact-BfTjxGOT.js.map} +1 -1
- package/dist/_chunks/PkToolShowComparison-BJ7QBXtf.js +60 -0
- package/dist/_chunks/PkToolShowComparison-BJ7QBXtf.js.map +1 -0
- package/dist/_chunks/{PkToolShowContactForm-BO3JQfts.js → PkToolShowContactForm-PFpY9dIp.js} +2 -2
- package/dist/_chunks/{PkToolShowContactForm-BO3JQfts.js.map → PkToolShowContactForm-PFpY9dIp.js.map} +1 -1
- package/dist/_chunks/{PkToolShowForm-KW8MOL-j.js → PkToolShowForm-CMtSN0oX.js} +5 -5
- package/dist/_chunks/{PkToolShowForm-KW8MOL-j.js.map → PkToolShowForm-CMtSN0oX.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSources-Bfx-Th_j.js → PkToolShowSources-C6cu66Ts.js} +3 -3
- package/dist/_chunks/{PkToolShowSources-Bfx-Th_j.js.map → PkToolShowSources-C6cu66Ts.js.map} +1 -1
- package/dist/_chunks/{PkToolShowSuggestedReply-Dl4x_nEJ.js → PkToolShowSuggestedReply-CFO8wV1b.js} +2 -2
- package/dist/_chunks/{PkToolShowSuggestedReply-Dl4x_nEJ.js.map → PkToolShowSuggestedReply-CFO8wV1b.js.map} +1 -1
- package/dist/_chunks/{markdown-BL7WANiX.js → markdown-BRD-hDrH.js} +12 -19
- package/dist/_chunks/markdown-BRD-hDrH.js.map +1 -0
- package/dist/ai-elements.es.js +2767 -3035
- package/dist/ai-elements.es.js.map +1 -1
- package/dist-vue/PkChatbot.js +1 -1
- package/dist-vue/PkChatbotAuth.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-tbKw8Mdt.js → Agent-BNlmK-uJ.js} +2 -2
- package/dist-vue/_chunks/{Agent-tbKw8Mdt.js.map → Agent-BNlmK-uJ.js.map} +1 -1
- package/dist-vue/_chunks/{Document-nCWwJC2h.js → Document-2X01-F4Z.js} +11 -18
- package/dist-vue/_chunks/Document-2X01-F4Z.js.map +1 -0
- package/dist-vue/_chunks/Media-_HfFLHGD.js.map +1 -1
- package/dist-vue/_chunks/{PkChatbot-CXQzBuxy.js → PkChatbot-HRayDr2d.js} +8 -8
- package/dist-vue/_chunks/{PkChatbot-CXQzBuxy.js.map → PkChatbot-HRayDr2d.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js +349 -0
- package/dist-vue/_chunks/PkChatbotAuth-Bi508F1u.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotEmptyState-9mWiPd4B.js → PkChatbotEmptyState-CPOcfoRC.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotEmptyState-9mWiPd4B.js.map → PkChatbotEmptyState-CPOcfoRC.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotInput-BzaCyeFp.js → PkChatbotInput-pLJQIu7v.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotInput-BzaCyeFp.js.map → PkChatbotInput-pLJQIu7v.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotMessages-KH5RE8Dk.js → PkChatbotMessages-GZStJbx_.js} +256 -258
- package/dist-vue/_chunks/PkChatbotMessages-GZStJbx_.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotStepPayload-C36nXLW7.js → PkChatbotStepPayload-DU0W-eUp.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotStepPayload-C36nXLW7.js.map → PkChatbotStepPayload-DU0W-eUp.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CBX-AQXv.js → PkChatbotStepToolDetail-etlBryOg.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotStepToolDetail-CBX-AQXv.js.map → PkChatbotStepToolDetail-etlBryOg.js.map} +1 -1
- package/dist-vue/_chunks/PkChatbotSteps-Cl4pVtPJ.js +190 -0
- package/dist-vue/_chunks/PkChatbotSteps-Cl4pVtPJ.js.map +1 -0
- package/dist-vue/_chunks/{PkChatbotViewChat-D5sfTMCW.js → PkChatbotViewChat-DIfBWFoG.js} +7 -7
- package/dist-vue/_chunks/{PkChatbotViewChat-D5sfTMCW.js.map → PkChatbotViewChat-DIfBWFoG.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewConversations-CHpN4vhm.js → PkChatbotViewConversations-BCdolW0R.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewConversations-CHpN4vhm.js.map → PkChatbotViewConversations-BCdolW0R.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewFiles-Bk9-K6Hw.js → PkChatbotViewFiles-Cudao8ew.js} +3 -3
- package/dist-vue/_chunks/{PkChatbotViewFiles-Bk9-K6Hw.js.map → PkChatbotViewFiles-Cudao8ew.js.map} +1 -1
- package/dist-vue/_chunks/{PkChatbotViewProfile-CosaHA-g.js → PkChatbotViewProfile-DDsKOkcC.js} +2 -2
- package/dist-vue/_chunks/{PkChatbotViewProfile-CosaHA-g.js.map → PkChatbotViewProfile-DDsKOkcC.js.map} +1 -1
- package/dist-vue/_chunks/{PkStreamingMarkdown-BN7waklD.js → PkStreamingMarkdown-BloMJaIW.js} +205 -214
- package/dist-vue/_chunks/{PkStreamingMarkdown-BN7waklD.js.map → PkStreamingMarkdown-BloMJaIW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestGeolocation-BOVbaCzQ.js → PkToolRequestGeolocation-9vfYNaQo.js} +2 -2
- package/{dist/_chunks/PkToolRequestGeolocation-OF1PWhMw.js.map → dist-vue/_chunks/PkToolRequestGeolocation-9vfYNaQo.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DMvCGPuX.js → PkToolRequestOAuthConnection-BorR5NmZ.js} +2 -2
- package/dist-vue/_chunks/{PkToolRequestOAuthConnection-DMvCGPuX.js.map → PkToolRequestOAuthConnection-BorR5NmZ.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowArtifact-DrE_mK1z.js → PkToolShowArtifact-BuMY7GNj.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowArtifact-DrE_mK1z.js.map → PkToolShowArtifact-BuMY7GNj.js.map} +1 -1
- package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js +61 -0
- package/dist-vue/_chunks/PkToolShowComparison-BLn4pkno.js.map +1 -0
- package/dist-vue/_chunks/{PkToolShowContactForm-BBTbrgt4.js → PkToolShowContactForm-0OQRqT8m.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowContactForm-BBTbrgt4.js.map → PkToolShowContactForm-0OQRqT8m.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowDiagram-CztnTdq2.js → PkToolShowDiagram-BGL27iHG.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowDiagram-CztnTdq2.js.map → PkToolShowDiagram-BGL27iHG.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowEmail-C30K5kJA.js → PkToolShowEmail-BJJpS69F.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowEmail-C30K5kJA.js.map → PkToolShowEmail-BJJpS69F.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowForm-C9N_SSm8.js → PkToolShowForm-DDcPpOZ8.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowForm-C9N_SSm8.js.map → PkToolShowForm-DDcPpOZ8.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowMessage-DvkCRERv.js → PkToolShowMessage-BFGynf3p.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowMessage-DvkCRERv.js.map → PkToolShowMessage-BFGynf3p.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowProductList-cfjg3CmV.js → PkToolShowProductList-6t1Ir5CW.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowProductList-cfjg3CmV.js.map → PkToolShowProductList-6t1Ir5CW.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSources-CyR2GTiE.js → PkToolShowSources-cOF0ZxOj.js} +4 -4
- package/dist-vue/_chunks/{PkToolShowSources-CyR2GTiE.js.map → PkToolShowSources-cOF0ZxOj.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-qAWdCUhr.js → PkToolShowSuggestedReply-DA4NEjHB.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowSuggestedReply-qAWdCUhr.js.map → PkToolShowSuggestedReply-DA4NEjHB.js.map} +1 -1
- package/dist-vue/_chunks/{PkToolShowWebPages-CkQ2NhRj.js → PkToolShowWebPages-OgaT1vYJ.js} +2 -2
- package/dist-vue/_chunks/{PkToolShowWebPages-CkQ2NhRj.js.map → PkToolShowWebPages-OgaT1vYJ.js.map} +1 -1
- package/dist-vue/_chunks/{PkUrl-BsD4Vby6.js → PkUrl-Cd69XP5z.js} +2 -2
- package/dist-vue/_chunks/{PkUrl-BsD4Vby6.js.map → PkUrl-Cd69XP5z.js.map} +1 -1
- package/dist-vue/_chunks/{createChatbotApiClient-BlWs282E.js → createChatbotApiClient-CaVLm5W9.js} +168 -137
- package/dist-vue/_chunks/createChatbotApiClient-CaVLm5W9.js.map +1 -0
- package/dist-vue/_chunks/{useChatbotStore-CMo47fnS.js → useChatbotStore-BwrBZJCq.js} +3 -3
- package/dist-vue/_chunks/{useChatbotStore-CMo47fnS.js.map → useChatbotStore-BwrBZJCq.js.map} +1 -1
- package/dist-vue/_chunks/utils-h4C7rRcu.js +177 -0
- package/dist-vue/_chunks/utils-h4C7rRcu.js.map +1 -0
- package/dist-vue/api.js +1 -1
- package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +4 -4
- package/dist-vue/apps/web-component/src/composables/useChatbotAuth.d.ts +8 -54
- package/dist-vue/apps/web-component/src/composables/useChatbotAuthForm.d.ts +0 -14
- package/dist-vue/composables.js +112 -436
- package/dist-vue/composables.js.map +1 -1
- package/dist-vue/index.js +3235 -3359
- package/dist-vue/index.js.map +1 -1
- package/dist-vue/locales.js +0 -42
- package/dist-vue/packages/ability/src/index.d.ts +14 -10
- package/dist-vue/packages/auth/src/social-redirect-plugin.d.ts +12 -18
- package/dist-vue/packages/components/src/chat/PkChatbotAuth.d.ts +0 -19
- package/dist-vue/packages/components/src/chat/PkChatbotMessages.d.ts +4 -8
- package/dist-vue/packages/components/src/chat/PkChatbotSteps.d.ts +0 -1
- package/dist-vue/packages/components/src/chat/utils.d.ts +0 -9
- package/dist-vue/packages/components/src/index.d.ts +1 -2
- package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +0 -60
- package/dist-vue/packages/models/src/schema/Chat.d.ts +0 -42
- package/dist-vue/packages/models/src/schema/Document.d.ts +0 -17
- package/dist-vue/packages/models/src/schema/DocumentFolder.d.ts +0 -10
- package/dist-vue/packages/models/src/schema/DocumentSyncSource.d.ts +1 -71
- package/dist-vue/packages/models/src/schema/Media.d.ts +1 -0
- package/dist-vue/packages/models/src/schema/Member.d.ts +0 -3
- package/dist-vue/packages/models/src/schema/Notification.d.ts +0 -6
- package/dist-vue/packages/models/src/schema/Organization.d.ts +0 -1
- package/dist-vue/packages/models/src/schema/User.d.ts +0 -1
- package/dist-vue/style.css +1 -1
- package/package.json +1 -1
- package/dist/_chunks/Agent-DK76k05_.js +0 -566
- package/dist/_chunks/Agent-DK76k05_.js.map +0 -1
- package/dist/_chunks/PkStreamingMarkdown-ZD0SROu1.js.map +0 -1
- package/dist/_chunks/PkToolShowComparison-8d6fAhRp.js +0 -72
- package/dist/_chunks/PkToolShowComparison-8d6fAhRp.js.map +0 -1
- package/dist/_chunks/markdown-BL7WANiX.js.map +0 -1
- package/dist-vue/_chunks/Document-nCWwJC2h.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js +0 -421
- package/dist-vue/_chunks/PkChatbotAuth-jzoNJkmH.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotMessages-KH5RE8Dk.js.map +0 -1
- package/dist-vue/_chunks/PkChatbotSteps-356rnZG5.js +0 -191
- package/dist-vue/_chunks/PkChatbotSteps-356rnZG5.js.map +0 -1
- package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js +0 -72
- package/dist-vue/_chunks/PkToolShowComparison-DQs3E6-k.js.map +0 -1
- package/dist-vue/_chunks/createChatbotApiClient-BlWs282E.js.map +0 -1
- package/dist-vue/_chunks/utils--8iNpBr_.js +0 -184
- package/dist-vue/_chunks/utils--8iNpBr_.js.map +0 -1
- package/dist-vue/packages/auth/src/additional-fields.d.ts +0 -48
- package/dist-vue/packages/auth/src/passkey-policy-client-plugin.d.ts +0 -31
- package/dist-vue/packages/auth/src/passkey-policy-plugin.d.ts +0 -22
- package/dist-vue/packages/auth/src/two-factor-policy-client-plugin.d.ts +0 -60
- package/dist-vue/packages/auth/src/two-factor-policy-plugin.d.ts +0 -65
- package/dist-vue/packages/components/src/PkQrCode.d.ts +0 -14
- package/dist-vue/packages/components/src/chat/PkTurnEvaluation.d.ts +0 -8
|
@@ -1,75 +1,68 @@
|
|
|
1
1
|
import { C as e, F as t, J as n, L as r, N as i, O as a, P as o, X as s, _t as c, it as l, m as u, v as d } from "./vue.runtime.esm-bundler-CIT_Sbqw.js";
|
|
2
2
|
import { r as f } from "./vue-i18n-BdMHu4Kd.js";
|
|
3
3
|
import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
|
|
4
|
-
import { c as te } from "./Agent-DK76k05_.js";
|
|
5
4
|
import "./src-BQHP1-Xs.js";
|
|
6
|
-
import { n as
|
|
7
|
-
import { v as
|
|
8
|
-
import { n as
|
|
9
|
-
import { t as
|
|
5
|
+
import { n as te } from "./url-validation-uLMZ5-AU.js";
|
|
6
|
+
import { v as ne } from "./dist-QdjZA6MJ.js";
|
|
7
|
+
import { n as re } from "./useShortUrlResolver-DuDol0Oq.js";
|
|
8
|
+
import { t as ie } from "./_plugin-vue_export-helper-B3ysoDQm.js";
|
|
10
9
|
//#region ../../packages/utils/src/citations.ts
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
return e && e.replace(
|
|
10
|
+
var ae = /[ \t]*\uE200[^\uE201]*\uE201/g, m = /[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, h = /[\uE200-\uE20F]/g;
|
|
11
|
+
function oe(e) {
|
|
12
|
+
return e && e.replace(ae, "").replace(m, "").replace(h, "");
|
|
14
13
|
}
|
|
15
14
|
//#endregion
|
|
16
15
|
//#region ../../packages/utils/src/message.ts
|
|
17
|
-
function
|
|
16
|
+
function g(e) {
|
|
18
17
|
return e ? e.type === "text" : !1;
|
|
19
18
|
}
|
|
20
|
-
function
|
|
19
|
+
function _(e) {
|
|
21
20
|
return e ? e.type.startsWith("tool-") : !1;
|
|
22
21
|
}
|
|
23
|
-
function
|
|
24
|
-
return
|
|
22
|
+
function v(e) {
|
|
23
|
+
return _(e) ? e.type.slice(5) : "";
|
|
25
24
|
}
|
|
26
|
-
function
|
|
25
|
+
function y(e) {
|
|
27
26
|
return e ? e.type === "file" : !1;
|
|
28
27
|
}
|
|
29
|
-
function
|
|
30
|
-
if (!
|
|
28
|
+
function se(e) {
|
|
29
|
+
if (!y(e)) return;
|
|
31
30
|
let t = e.providerMetadata?.["8bot"]?.media;
|
|
32
31
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
33
32
|
}
|
|
34
|
-
function
|
|
33
|
+
function ce(e) {
|
|
35
34
|
return e ? e.type === "reasoning" : !1;
|
|
36
35
|
}
|
|
37
|
-
function
|
|
36
|
+
function le(e) {
|
|
38
37
|
if (!e) return;
|
|
39
38
|
let t = e.parts;
|
|
40
|
-
if (Array.isArray(t)) return t.find((e) =>
|
|
39
|
+
if (Array.isArray(t)) return t.find((e) => g(e))?.text;
|
|
41
40
|
}
|
|
42
41
|
//#endregion
|
|
43
42
|
//#region ../../packages/components/src/chat/utils.ts
|
|
44
|
-
function
|
|
43
|
+
function ue(e) {
|
|
45
44
|
let t = [];
|
|
46
45
|
for (let n of e) {
|
|
47
|
-
if (!
|
|
46
|
+
if (!g(n)) {
|
|
48
47
|
t.push(n);
|
|
49
48
|
continue;
|
|
50
49
|
}
|
|
51
50
|
let e = t[t.length - 1];
|
|
52
|
-
e &&
|
|
51
|
+
e && g(e) ? t[t.length - 1] = {
|
|
53
52
|
...e,
|
|
54
53
|
text: e.text + n.text
|
|
55
54
|
} : t.push(n);
|
|
56
55
|
}
|
|
57
56
|
return t;
|
|
58
57
|
}
|
|
59
|
-
|
|
60
|
-
function me(e) {
|
|
61
|
-
let t = /* @__PURE__ */ new Map();
|
|
62
|
-
for (let [n, r] of e.entries()) pe(r) && r.state !== "output-error" && !y(r) && t.set(r.type, n);
|
|
63
|
-
return e.filter((e, n) => !(pe(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
|
|
64
|
-
}
|
|
65
|
-
function y(e) {
|
|
58
|
+
function de(e) {
|
|
66
59
|
return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
|
|
67
60
|
}
|
|
68
|
-
var
|
|
69
|
-
function
|
|
61
|
+
var b = 4e3, fe = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
|
|
62
|
+
function pe(e, t) {
|
|
70
63
|
if (e.length <= t) return e;
|
|
71
64
|
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;
|
|
72
|
-
for (let t of e.matchAll(
|
|
65
|
+
for (let t of e.matchAll(fe)) {
|
|
73
66
|
if (t.index >= a) break;
|
|
74
67
|
let [, e, n] = t;
|
|
75
68
|
if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
|
|
@@ -80,40 +73,40 @@ function _e(e, t) {
|
|
|
80
73
|
}
|
|
81
74
|
return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
|
|
82
75
|
}
|
|
83
|
-
var
|
|
76
|
+
var me = /* @__PURE__ */ new Set([
|
|
84
77
|
"approval-requested",
|
|
85
78
|
"approval-responded",
|
|
86
79
|
"output-denied"
|
|
87
80
|
]);
|
|
88
|
-
function
|
|
89
|
-
return
|
|
81
|
+
function he(e) {
|
|
82
|
+
return _(e) ? me.has(e.state) ? !0 : e.approval != null : !1;
|
|
90
83
|
}
|
|
91
|
-
var
|
|
92
|
-
function
|
|
93
|
-
return
|
|
84
|
+
var ge = "requestConfirm";
|
|
85
|
+
function _e(e) {
|
|
86
|
+
return _(e) && e.type === "tool-requestConfirm";
|
|
94
87
|
}
|
|
95
|
-
function
|
|
96
|
-
return
|
|
88
|
+
function ve(e) {
|
|
89
|
+
return he(e) || _e(e);
|
|
97
90
|
}
|
|
98
|
-
function
|
|
99
|
-
if (
|
|
91
|
+
function x(e) {
|
|
92
|
+
if (_(e)) return e.approval?.id;
|
|
100
93
|
}
|
|
101
|
-
function
|
|
94
|
+
function ye(e) {
|
|
102
95
|
if (e && "state" in e) return e.state;
|
|
103
96
|
}
|
|
104
|
-
function
|
|
97
|
+
function be(e = "000000") {
|
|
105
98
|
let t = e.replace("#", "");
|
|
106
99
|
t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
|
|
107
100
|
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;
|
|
108
101
|
return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
|
|
109
102
|
}
|
|
110
|
-
function
|
|
111
|
-
return e === "white" || e === "black" ? e :
|
|
103
|
+
function xe(e, t) {
|
|
104
|
+
return e === "white" || e === "black" ? e : be(t);
|
|
112
105
|
}
|
|
113
|
-
function
|
|
106
|
+
function Se(e, t) {
|
|
114
107
|
if (!(t === void 0 || t < 50)) return e(t / 1e3, "seconds");
|
|
115
108
|
}
|
|
116
|
-
function
|
|
109
|
+
function Ce(e) {
|
|
117
110
|
if (e !== void 0) {
|
|
118
111
|
if (typeof e == "string") return e.trim() || void 0;
|
|
119
112
|
try {
|
|
@@ -124,10 +117,10 @@ function De(e) {
|
|
|
124
117
|
}
|
|
125
118
|
}
|
|
126
119
|
}
|
|
127
|
-
function
|
|
128
|
-
return
|
|
120
|
+
function we(e) {
|
|
121
|
+
return Ce(e) !== void 0;
|
|
129
122
|
}
|
|
130
|
-
function
|
|
123
|
+
function Te(e, t) {
|
|
131
124
|
let n = e?.input;
|
|
132
125
|
if (typeof t == "string") {
|
|
133
126
|
let e = n?.question ?? n?.steps?.[0]?.question;
|
|
@@ -139,14 +132,14 @@ function x(e, t) {
|
|
|
139
132
|
return i ? `${i} ${n}` : n;
|
|
140
133
|
}).join(". ");
|
|
141
134
|
}
|
|
142
|
-
function
|
|
135
|
+
function Ee(e) {
|
|
143
136
|
return e?.options ? e.options.map((e) => ({
|
|
144
137
|
label: e.label,
|
|
145
138
|
value: e.label,
|
|
146
139
|
description: e.description
|
|
147
140
|
})) : [];
|
|
148
141
|
}
|
|
149
|
-
function
|
|
142
|
+
function De(e, t) {
|
|
150
143
|
let n = {};
|
|
151
144
|
if (t == null) return n;
|
|
152
145
|
if (typeof t == "string") return e.length === 1 && (n[0] = t), n;
|
|
@@ -162,12 +155,12 @@ function S(e, t) {
|
|
|
162
155
|
for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
|
|
163
156
|
return n;
|
|
164
157
|
}
|
|
165
|
-
var
|
|
158
|
+
var S = [
|
|
166
159
|
"tool-perplexity_search",
|
|
167
160
|
"tool-parallel_search",
|
|
168
161
|
"tool-web_search",
|
|
169
162
|
"tool-google_search"
|
|
170
|
-
],
|
|
163
|
+
], Oe = /* @__PURE__ */ new Set([
|
|
171
164
|
"tool-searchInKnowledgeBase",
|
|
172
165
|
"tool-retrieveRevisedAnswers",
|
|
173
166
|
"tool-expandChunkContext",
|
|
@@ -176,21 +169,21 @@ var Ae = [
|
|
|
176
169
|
"tool-geocode",
|
|
177
170
|
"tool-recallUserMemory",
|
|
178
171
|
"tool-saveUserMemory",
|
|
179
|
-
...
|
|
172
|
+
...S
|
|
180
173
|
]);
|
|
181
|
-
function
|
|
182
|
-
return
|
|
174
|
+
function C(e) {
|
|
175
|
+
return _(e) && Oe.has(e.type);
|
|
183
176
|
}
|
|
184
|
-
var
|
|
177
|
+
var ke = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, w = (e, ...t) => {
|
|
185
178
|
for (let n of t) {
|
|
186
179
|
let t = e?.[n];
|
|
187
180
|
if (typeof t == "string" && t.trim()) return t;
|
|
188
181
|
}
|
|
189
182
|
};
|
|
190
|
-
function
|
|
191
|
-
if (!
|
|
192
|
-
let t =
|
|
193
|
-
if (e.type === "tool-searchInKnowledgeBase" ||
|
|
183
|
+
function Ae(e) {
|
|
184
|
+
if (!_(e)) return;
|
|
185
|
+
let t = ke("input" in e ? e.input : void 0), n = ke("output" in e ? e.output : void 0);
|
|
186
|
+
if (e.type === "tool-searchInKnowledgeBase" || S.includes(e.type)) {
|
|
194
187
|
let e = t?.queries;
|
|
195
188
|
if (Array.isArray(e)) {
|
|
196
189
|
let t = e.filter((e) => typeof e == "string" && !!e.trim());
|
|
@@ -206,26 +199,26 @@ function Ne(e) {
|
|
|
206
199
|
if (e.type === "tool-recallUserMemory") return w(t, "query");
|
|
207
200
|
if (e.type === "tool-saveUserMemory") return w(t, "content", "query");
|
|
208
201
|
}
|
|
209
|
-
function
|
|
210
|
-
if (
|
|
211
|
-
if (
|
|
212
|
-
if (
|
|
202
|
+
function je(e) {
|
|
203
|
+
if (_(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-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-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-perplexity_search" || e.type === "tool-parallel_search" || e.type === "tool-web_search" || e.type === "tool-google_search" ? "ri:global-line" : "ri:tools-line";
|
|
204
|
+
if (ce(e)) return "ri:lightbulb-line";
|
|
205
|
+
if (g(e)) return "ri:double-quotes-r";
|
|
213
206
|
}
|
|
214
|
-
function
|
|
215
|
-
return
|
|
207
|
+
function T(e, t) {
|
|
208
|
+
return _(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : 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-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") : S.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : ce(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
|
|
216
209
|
}
|
|
217
210
|
//#endregion
|
|
218
211
|
//#region ../../node_modules/.pnpm/remend@1.3.1/node_modules/remend/dist/index.js
|
|
219
|
-
var
|
|
212
|
+
var Me = Object.defineProperty, Ne = Object.defineProperties, Pe = Object.getOwnPropertyDescriptors, Fe = Object.getOwnPropertySymbols, E = Object.prototype.hasOwnProperty, Ie = Object.prototype.propertyIsEnumerable, D = (e, t, n) => t in e ? Me(e, t, {
|
|
220
213
|
enumerable: !0,
|
|
221
214
|
configurable: !0,
|
|
222
215
|
writable: !0,
|
|
223
216
|
value: n
|
|
224
|
-
}) : e[t] = n,
|
|
225
|
-
for (var n in t ||= {})
|
|
226
|
-
if (
|
|
217
|
+
}) : e[t] = n, Le = (e, t) => {
|
|
218
|
+
for (var n in t ||= {}) E.call(t, n) && D(e, n, t[n]);
|
|
219
|
+
if (Fe) for (var n of Fe(t)) Ie.call(t, n) && D(e, n, t[n]);
|
|
227
220
|
return e;
|
|
228
|
-
},
|
|
221
|
+
}, Re = (e, t) => Ne(e, Pe(t)), ze = (e) => {
|
|
229
222
|
let t = new Uint8Array(e.length + 1), n = !1, r = !1, i = 0;
|
|
230
223
|
for (; i < e.length;) {
|
|
231
224
|
if (e[i] === "\\" && i + 1 < e.length && e[i + 1] === "`") {
|
|
@@ -243,26 +236,26 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
243
236
|
!r && e[i] === "`" && (n = !n), t[i + 1] = n || r ? 1 : 0, i += 1;
|
|
244
237
|
}
|
|
245
238
|
return t;
|
|
246
|
-
},
|
|
247
|
-
let n =
|
|
239
|
+
}, Be = null, O = (e, t) => {
|
|
240
|
+
let n = Be;
|
|
248
241
|
return (n === null || n.text !== e) && (n = {
|
|
249
242
|
text: e,
|
|
250
|
-
lookup:
|
|
251
|
-
},
|
|
252
|
-
},
|
|
243
|
+
lookup: ze(e)
|
|
244
|
+
}, Be = n), n.lookup[Math.min(t, e.length)] === 1;
|
|
245
|
+
}, Ve = (e, t) => {
|
|
253
246
|
let n = e.substring(t, t + 3) === "```", r = t > 0 && e.substring(t - 1, t + 2) === "```", i = t > 1 && e.substring(t - 2, t + 1) === "```";
|
|
254
247
|
return n || r || i;
|
|
255
|
-
},
|
|
248
|
+
}, He = (e) => {
|
|
256
249
|
let t = 0;
|
|
257
250
|
for (let n = 0; n < e.length; n += 1) {
|
|
258
251
|
if (e[n] === "\\" && n + 1 < e.length && e[n + 1] === "`") {
|
|
259
252
|
n += 1;
|
|
260
253
|
continue;
|
|
261
254
|
}
|
|
262
|
-
e[n] === "`" && !
|
|
255
|
+
e[n] === "`" && !Ve(e, n) && (t += 1);
|
|
263
256
|
}
|
|
264
257
|
return t;
|
|
265
|
-
},
|
|
258
|
+
}, k = (e, t) => {
|
|
266
259
|
let n = !1, r = !1, i = -1;
|
|
267
260
|
for (let a = 0; a < e.length; a += 1) {
|
|
268
261
|
if (e[a] === "\\" && a + 1 < e.length && e[a + 1] === "`") {
|
|
@@ -281,21 +274,21 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
281
274
|
}
|
|
282
275
|
}
|
|
283
276
|
return !1;
|
|
284
|
-
},
|
|
277
|
+
}, Ue = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, We = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ue, (t, n, r, i) => O(e, i) ? t : `${n}\\>${r}`), Ge = /(\*\*)([^*]*\*?)$/, Ke = /(__)([^_]*?)$/, qe = /(\*\*\*)([^*]*?)$/, Je = /(\*)([^*]*?)$/, Ye = /(_)([^_]*?)$/, Xe = /(`)([^`]*?)$/, Ze = /(~~)([^~]*?)$/, A = /^[\s_~*`]*$/, Qe = /^[\s]*[-*+][\s]+$/, $e = /[\p{L}\p{N}_]/u, et = /^```[^`\n]*```?$/, j = /^\*{4,}$/, tt = /(__)([^_]+)_$/, nt = /(~~)([^~]+)~$/, rt = /~~/g, M = (e) => {
|
|
285
278
|
if (!e) return !1;
|
|
286
279
|
let t = e.charCodeAt(0);
|
|
287
|
-
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 ||
|
|
288
|
-
},
|
|
280
|
+
return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || $e.test(e);
|
|
281
|
+
}, it = (e, t) => {
|
|
289
282
|
let n = 1;
|
|
290
283
|
for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
|
|
291
284
|
else if (e[r] === "[" && (--n, n === 0)) return r;
|
|
292
285
|
return -1;
|
|
293
|
-
},
|
|
286
|
+
}, at = (e, t) => {
|
|
294
287
|
let n = 1;
|
|
295
288
|
for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
|
|
296
289
|
else if (e[r] === "]" && (--n, n === 0)) return r;
|
|
297
290
|
return -1;
|
|
298
|
-
},
|
|
291
|
+
}, ot = (e) => e === "inlineLatex" || e === "blockLatex", st = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, ct = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", N = (e, t) => {
|
|
299
292
|
let n = "none";
|
|
300
293
|
for (let r = 0; r < e.length && r < t; r += 1) {
|
|
301
294
|
if (e[r] === "\\" && e[r + 1] === "$") {
|
|
@@ -303,32 +296,32 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
303
296
|
continue;
|
|
304
297
|
}
|
|
305
298
|
if (e[r] === "\\") {
|
|
306
|
-
let t =
|
|
299
|
+
let t = st(n, e[r + 1]);
|
|
307
300
|
if (t !== null) {
|
|
308
301
|
n = t, r += 1;
|
|
309
302
|
continue;
|
|
310
303
|
}
|
|
311
304
|
}
|
|
312
|
-
if (e[r] === "$" && !
|
|
305
|
+
if (e[r] === "$" && !ot(n)) {
|
|
313
306
|
let t = e[r + 1] === "$";
|
|
314
|
-
n =
|
|
307
|
+
n = ct(n, t), t && (r += 1);
|
|
315
308
|
}
|
|
316
309
|
}
|
|
317
310
|
return n !== "none";
|
|
318
|
-
},
|
|
311
|
+
}, lt = (e, t) => {
|
|
319
312
|
for (let n = t; n < e.length; n += 1) {
|
|
320
313
|
if (e[n] === ")") return !0;
|
|
321
314
|
if (e[n] === "\n") return !1;
|
|
322
315
|
}
|
|
323
316
|
return !1;
|
|
324
|
-
},
|
|
317
|
+
}, P = (e, t) => {
|
|
325
318
|
for (let n = t - 1; n >= 0; --n) {
|
|
326
319
|
if (e[n] === ")") return !1;
|
|
327
|
-
if (e[n] === "(") return n > 0 && e[n - 1] === "]" &&
|
|
320
|
+
if (e[n] === "(") return n > 0 && e[n - 1] === "]" && lt(e, t);
|
|
328
321
|
if (e[n] === "\n") return !1;
|
|
329
322
|
}
|
|
330
323
|
return !1;
|
|
331
|
-
},
|
|
324
|
+
}, ut = (e, t) => {
|
|
332
325
|
for (let n = t - 1; n >= 0; --n) {
|
|
333
326
|
if (e[n] === ">") return !1;
|
|
334
327
|
if (e[n] === "<") {
|
|
@@ -338,7 +331,7 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
338
331
|
if (e[n] === "\n") return !1;
|
|
339
332
|
}
|
|
340
333
|
return !1;
|
|
341
|
-
},
|
|
334
|
+
}, dt = (e, t, n) => {
|
|
342
335
|
let r = 0;
|
|
343
336
|
for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
|
|
344
337
|
r = n + 1;
|
|
@@ -356,13 +349,13 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
356
349
|
break;
|
|
357
350
|
}
|
|
358
351
|
return o >= 3 && !s;
|
|
359
|
-
},
|
|
360
|
-
let i =
|
|
352
|
+
}, ft = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), pt = (e, t, n, r) => n === "\\" || ft(e) && N(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.length - 2 ? e[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), mt = (e) => e === " " || e === " " || e === "\n", ht = (e, t) => !!(e && t && M(e) && M(t)), gt = (e, t, n, r) => {
|
|
353
|
+
let i = ht(e, t), a = !!t && !mt(t), o = !!e && !mt(e);
|
|
361
354
|
return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
|
|
362
355
|
count: !0,
|
|
363
356
|
inWordAsteriskChain: i
|
|
364
357
|
} : { count: !1 };
|
|
365
|
-
},
|
|
358
|
+
}, _t = (e) => {
|
|
366
359
|
let t = 0, n = !1, r = !1, i = e.length;
|
|
367
360
|
for (let a = 0; a < i; a += 1) {
|
|
368
361
|
if (e[a] === "`" && a + 2 < i && e[a + 1] === "`" && e[a + 2] === "`") {
|
|
@@ -371,16 +364,16 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
371
364
|
}
|
|
372
365
|
if (n) continue;
|
|
373
366
|
if (e[a] !== "*") {
|
|
374
|
-
|
|
367
|
+
M(e[a]) || (r = !1);
|
|
375
368
|
continue;
|
|
376
369
|
}
|
|
377
370
|
let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
|
|
378
|
-
if (
|
|
379
|
-
let c =
|
|
371
|
+
if (pt(e, a, o, s)) continue;
|
|
372
|
+
let c = gt(o, s, t, r);
|
|
380
373
|
c.count && (t += 1, r = c.inWordAsteriskChain);
|
|
381
374
|
}
|
|
382
375
|
return t;
|
|
383
|
-
},
|
|
376
|
+
}, vt = (e, t, n, r) => !!(n === "\\" || ft(e) && N(e, t) || P(e, t) || ut(e, t) || n === "_" || r === "_" || n && r && M(n) && M(r)), yt = (e) => {
|
|
384
377
|
let t = 0, n = !1, r = e.length;
|
|
385
378
|
for (let i = 0; i < r; i += 1) {
|
|
386
379
|
if (e[i] === "`" && i + 2 < r && e[i + 1] === "`" && e[i + 2] === "`") {
|
|
@@ -389,7 +382,7 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
389
382
|
}
|
|
390
383
|
if (n || e[i] !== "_") continue;
|
|
391
384
|
let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
|
|
392
|
-
|
|
385
|
+
vt(e, i, a, o) || (t += 1);
|
|
393
386
|
}
|
|
394
387
|
return t;
|
|
395
388
|
}, F = (e) => {
|
|
@@ -402,7 +395,7 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
402
395
|
r || (e[i] === "*" ? n += 1 : (n >= 3 && (t += Math.floor(n / 3)), n = 0));
|
|
403
396
|
}
|
|
404
397
|
return n >= 3 && (t += Math.floor(n / 3)), t;
|
|
405
|
-
},
|
|
398
|
+
}, bt = (e) => {
|
|
406
399
|
let t = 0, n = !1;
|
|
407
400
|
for (let r = 0; r < e.length; r += 1) {
|
|
408
401
|
if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
|
|
@@ -412,7 +405,7 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
412
405
|
n || e[r] === "*" && r + 1 < e.length && e[r + 1] === "*" && (t += 1, r += 1);
|
|
413
406
|
}
|
|
414
407
|
return t;
|
|
415
|
-
},
|
|
408
|
+
}, xt = (e) => {
|
|
416
409
|
let t = 0, n = !1;
|
|
417
410
|
for (let r = 0; r < e.length; r += 1) {
|
|
418
411
|
if (e[r] === "`" && r + 2 < e.length && e[r + 1] === "`" && e[r + 2] === "`") {
|
|
@@ -422,32 +415,32 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
422
415
|
n || e[r] === "_" && r + 1 < e.length && e[r + 1] === "_" && (t += 1, r += 1);
|
|
423
416
|
}
|
|
424
417
|
return t;
|
|
425
|
-
},
|
|
426
|
-
if (!t ||
|
|
418
|
+
}, St = (e, t, n) => {
|
|
419
|
+
if (!t || A.test(t)) return !0;
|
|
427
420
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
428
|
-
return
|
|
429
|
-
},
|
|
430
|
-
let t = e.match(
|
|
421
|
+
return Qe.test(a) && t.includes("\n") ? !0 : dt(e, n, "*");
|
|
422
|
+
}, Ct = (e) => {
|
|
423
|
+
let t = e.match(Ge);
|
|
431
424
|
if (!t) return e;
|
|
432
425
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
433
|
-
return
|
|
434
|
-
},
|
|
435
|
-
if (!t ||
|
|
426
|
+
return O(e, r) || k(e, r) || St(e, n, r) ? e : bt(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
|
|
427
|
+
}, wt = (e, t, n) => {
|
|
428
|
+
if (!t || A.test(t)) return !0;
|
|
436
429
|
let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
|
|
437
|
-
return
|
|
438
|
-
},
|
|
439
|
-
let t = e.match(
|
|
430
|
+
return Qe.test(a) && t.includes("\n") ? !0 : dt(e, n, "_");
|
|
431
|
+
}, Tt = (e) => {
|
|
432
|
+
let t = e.match(Ke);
|
|
440
433
|
if (!t) {
|
|
441
|
-
let t = e.match(
|
|
434
|
+
let t = e.match(tt);
|
|
442
435
|
if (t) {
|
|
443
436
|
let n = e.lastIndexOf(t[1]);
|
|
444
|
-
if (!(
|
|
437
|
+
if (!(O(e, n) || k(e, n)) && xt(e) % 2 == 1) return `${e}_`;
|
|
445
438
|
}
|
|
446
439
|
return e;
|
|
447
440
|
}
|
|
448
441
|
let n = t[2], r = e.lastIndexOf(t[1]);
|
|
449
|
-
return
|
|
450
|
-
},
|
|
442
|
+
return O(e, r) || k(e, r) || wt(e, n, r) ? e : xt(e) % 2 == 1 ? `${e}__` : e;
|
|
443
|
+
}, Et = (e) => {
|
|
451
444
|
let t = !1;
|
|
452
445
|
for (let n = 0; n < e.length; n += 1) {
|
|
453
446
|
if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
|
|
@@ -455,110 +448,110 @@ var Ie = Object.defineProperty, T = Object.defineProperties, Le = Object.getOwnP
|
|
|
455
448
|
continue;
|
|
456
449
|
}
|
|
457
450
|
if (!t && e[n] === "*" && e[n - 1] !== "*" && e[n + 1] !== "*" && e[n - 1] !== "\\" && !N(e, n)) {
|
|
458
|
-
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "", i = !t ||
|
|
459
|
-
if (i && a || t && r &&
|
|
451
|
+
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "", i = !t || mt(t), a = !r || mt(r);
|
|
452
|
+
if (i && a || t && r && M(t) && M(r) || a) continue;
|
|
460
453
|
return n;
|
|
461
454
|
}
|
|
462
455
|
}
|
|
463
456
|
return -1;
|
|
464
|
-
},
|
|
465
|
-
if (!e.match(
|
|
466
|
-
let t =
|
|
467
|
-
if (t === -1 ||
|
|
457
|
+
}, Dt = (e) => {
|
|
458
|
+
if (!e.match(Je)) return e;
|
|
459
|
+
let t = Et(e);
|
|
460
|
+
if (t === -1 || O(e, t) || k(e, t)) return e;
|
|
468
461
|
let n = e.substring(t + 1);
|
|
469
|
-
return !n ||
|
|
470
|
-
},
|
|
462
|
+
return !n || A.test(n) ? e : _t(e) % 2 == 1 ? `${e}*` : e;
|
|
463
|
+
}, Ot = (e) => {
|
|
471
464
|
let t = !1;
|
|
472
465
|
for (let n = 0; n < e.length; n += 1) {
|
|
473
466
|
if (e[n] === "`" && n + 2 < e.length && e[n + 1] === "`" && e[n + 2] === "`") {
|
|
474
467
|
t = !t, n += 2;
|
|
475
468
|
continue;
|
|
476
469
|
}
|
|
477
|
-
if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !N(e, n) && !
|
|
470
|
+
if (!t && e[n] === "_" && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !N(e, n) && !P(e, n)) {
|
|
478
471
|
let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
|
|
479
|
-
if (t && r &&
|
|
472
|
+
if (t && r && M(t) && M(r)) continue;
|
|
480
473
|
return n;
|
|
481
474
|
}
|
|
482
475
|
}
|
|
483
476
|
return -1;
|
|
484
|
-
},
|
|
477
|
+
}, kt = (e) => {
|
|
485
478
|
let t = e.length;
|
|
486
479
|
for (; t > 0 && e[t - 1] === "\n";) --t;
|
|
487
480
|
return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
|
|
488
|
-
},
|
|
481
|
+
}, At = (e) => {
|
|
489
482
|
if (!e.endsWith("**")) return null;
|
|
490
483
|
let t = e.slice(0, -2);
|
|
491
|
-
if (
|
|
492
|
-
let n = t.indexOf("**"), r =
|
|
484
|
+
if (bt(t) % 2 != 1) return null;
|
|
485
|
+
let n = t.indexOf("**"), r = Ot(t);
|
|
493
486
|
return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
|
|
494
|
-
},
|
|
495
|
-
if (!e.match(
|
|
496
|
-
let t =
|
|
487
|
+
}, jt = (e) => {
|
|
488
|
+
if (!e.match(Ye)) return e;
|
|
489
|
+
let t = Ot(e);
|
|
497
490
|
if (t === -1) return e;
|
|
498
491
|
let n = e.substring(t + 1);
|
|
499
|
-
if (!n ||
|
|
500
|
-
if (
|
|
501
|
-
let t =
|
|
502
|
-
return t === null ?
|
|
492
|
+
if (!n || A.test(n) || O(e, t) || k(e, t)) return e;
|
|
493
|
+
if (yt(e) % 2 == 1) {
|
|
494
|
+
let t = At(e);
|
|
495
|
+
return t === null ? kt(e) : t;
|
|
503
496
|
}
|
|
504
497
|
return e;
|
|
505
|
-
},
|
|
506
|
-
let t =
|
|
498
|
+
}, Mt = (e) => {
|
|
499
|
+
let t = bt(e), n = _t(e);
|
|
507
500
|
return t % 2 == 0 && n % 2 == 0;
|
|
508
|
-
},
|
|
509
|
-
if (
|
|
510
|
-
let t = e.match(
|
|
501
|
+
}, Nt = (e, t, n) => !t || A.test(t) || O(e, n) || k(e, n) ? !0 : dt(e, n, "*"), I = (e) => {
|
|
502
|
+
if (j.test(e)) return e;
|
|
503
|
+
let t = e.match(qe);
|
|
511
504
|
if (!t) return e;
|
|
512
505
|
let n = t[2];
|
|
513
|
-
return
|
|
514
|
-
},
|
|
515
|
-
let t = e.match(
|
|
516
|
-
return !t || t.index === void 0 ||
|
|
517
|
-
},
|
|
518
|
-
let t =
|
|
506
|
+
return Nt(e, n, e.lastIndexOf(t[1])) ? e : F(e) % 2 == 1 ? Mt(e) ? e : `${e}***` : e;
|
|
507
|
+
}, Pt = /<[a-zA-Z/][^>]*$/, Ft = (e) => {
|
|
508
|
+
let t = e.match(Pt);
|
|
509
|
+
return !t || t.index === void 0 || O(e, t.index) ? e : e.substring(0, t.index).trimEnd();
|
|
510
|
+
}, It = (e) => !e.match(et) || e.includes("\n") ? null : e.endsWith("``") && !e.endsWith("```") ? `${e}\`` : e, Lt = (e) => (e.match(/```/g) || []).length % 2 == 1, Rt = (e) => {
|
|
511
|
+
let t = It(e);
|
|
519
512
|
if (t !== null) return t;
|
|
520
|
-
let n = e.match(
|
|
521
|
-
if (n && !
|
|
513
|
+
let n = e.match(Xe);
|
|
514
|
+
if (n && !Lt(e)) {
|
|
522
515
|
let t = n[2];
|
|
523
|
-
if (!t ||
|
|
524
|
-
if (
|
|
516
|
+
if (!t || A.test(t)) return e;
|
|
517
|
+
if (He(e) % 2 == 1) return `${e}\``;
|
|
525
518
|
}
|
|
526
519
|
return e;
|
|
527
|
-
},
|
|
520
|
+
}, zt = (e, t) => t >= 2 && e.substring(t - 2, t + 1) === "```" || t >= 1 && e.substring(t - 1, t + 2) === "```" || t <= e.length - 3 && e.substring(t, t + 3) === "```", Bt = (e) => {
|
|
528
521
|
let t = 0, n = !1;
|
|
529
|
-
for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !
|
|
522
|
+
for (let r = 0; r < e.length - 1; r += 1) e[r] === "`" && !zt(e, r) && (n = !n), !n && e[r] === "$" && e[r + 1] === "$" && (t += 1, r += 1);
|
|
530
523
|
return t;
|
|
531
|
-
},
|
|
524
|
+
}, Vt = (e) => {
|
|
532
525
|
let t = 0, n = !1;
|
|
533
526
|
for (let r = 0; r < e.length; r += 1) {
|
|
534
527
|
if (e[r] === "\\") {
|
|
535
528
|
r += 1;
|
|
536
529
|
continue;
|
|
537
530
|
}
|
|
538
|
-
if (e[r] === "`" && !
|
|
531
|
+
if (e[r] === "`" && !zt(e, r)) {
|
|
539
532
|
n = !n;
|
|
540
533
|
continue;
|
|
541
534
|
}
|
|
542
535
|
!n && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : t += 1);
|
|
543
536
|
}
|
|
544
537
|
return t;
|
|
545
|
-
},
|
|
538
|
+
}, Ht = (e) => {
|
|
546
539
|
if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
|
|
547
540
|
let t = e.indexOf("$$");
|
|
548
541
|
return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
|
|
549
542
|
$$` : `${e}$$`;
|
|
550
|
-
},
|
|
543
|
+
}, Ut = (e) => Bt(e) % 2 == 0 ? e : Ht(e), Wt = (e) => Vt(e) % 2 == 1 ? `${e}$` : e, Gt = (e, t, n) => {
|
|
551
544
|
if (e.substring(t + 2).includes(")")) return null;
|
|
552
|
-
let r =
|
|
553
|
-
if (r === -1 ||
|
|
545
|
+
let r = it(e, t);
|
|
546
|
+
if (r === -1 || O(e, r)) return null;
|
|
554
547
|
let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a);
|
|
555
548
|
if (i) return o;
|
|
556
549
|
let s = e.substring(r + 1, t);
|
|
557
550
|
return n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
|
|
558
|
-
},
|
|
559
|
-
for (let n = 0; n < t; n++) if (e[n] === "[" && !
|
|
551
|
+
}, Kt = (e, t) => {
|
|
552
|
+
for (let n = 0; n < t; n++) if (e[n] === "[" && !O(e, n)) {
|
|
560
553
|
if (n > 0 && e[n - 1] === "!") continue;
|
|
561
|
-
let t =
|
|
554
|
+
let t = at(e, n);
|
|
562
555
|
if (t === -1) return n;
|
|
563
556
|
if (t + 1 < e.length && e[t + 1] === "(") {
|
|
564
557
|
let r = e.indexOf(")", t + 2);
|
|
@@ -566,70 +559,70 @@ $$` : `${e}$$`;
|
|
|
566
559
|
}
|
|
567
560
|
}
|
|
568
561
|
return t;
|
|
569
|
-
},
|
|
562
|
+
}, qt = (e, t, n) => {
|
|
570
563
|
let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
|
|
571
564
|
if (!e.substring(t + 1).includes("]")) {
|
|
572
565
|
let a = e.substring(0, i);
|
|
573
566
|
if (r) return a;
|
|
574
567
|
if (n === "text-only") {
|
|
575
|
-
let n =
|
|
568
|
+
let n = Kt(e, t);
|
|
576
569
|
return e.substring(0, n) + e.substring(n + 1);
|
|
577
570
|
}
|
|
578
571
|
return `${e}](streamdown:incomplete-link)`;
|
|
579
572
|
}
|
|
580
|
-
if (
|
|
573
|
+
if (at(e, t) === -1) {
|
|
581
574
|
let a = e.substring(0, i);
|
|
582
575
|
if (r) return a;
|
|
583
576
|
if (n === "text-only") {
|
|
584
|
-
let n =
|
|
577
|
+
let n = Kt(e, t);
|
|
585
578
|
return e.substring(0, n) + e.substring(n + 1);
|
|
586
579
|
}
|
|
587
580
|
return `${e}](streamdown:incomplete-link)`;
|
|
588
581
|
}
|
|
589
582
|
return null;
|
|
590
|
-
},
|
|
583
|
+
}, Jt = (e, t = "protocol") => {
|
|
591
584
|
let n = e.lastIndexOf("](");
|
|
592
|
-
if (n !== -1 && !
|
|
593
|
-
let r =
|
|
585
|
+
if (n !== -1 && !O(e, n)) {
|
|
586
|
+
let r = Gt(e, n, t);
|
|
594
587
|
if (r !== null) return r;
|
|
595
588
|
}
|
|
596
|
-
for (let n = e.length - 1; n >= 0; --n) if (e[n] === "[" && !
|
|
597
|
-
let r =
|
|
589
|
+
for (let n = e.length - 1; n >= 0; --n) if (e[n] === "[" && !O(e, n)) {
|
|
590
|
+
let r = qt(e, n, t);
|
|
598
591
|
if (r !== null) return r;
|
|
599
592
|
}
|
|
600
593
|
return e;
|
|
601
|
-
},
|
|
594
|
+
}, Yt = /^-{1,2}$/, Xt = /^[\s]*-{1,2}[\s]+$/, Zt = /^={1,2}$/, Qt = /^[\s]*={1,2}[\s]+$/, $t = (e) => {
|
|
602
595
|
if (!e || typeof e != "string") return e;
|
|
603
596
|
let t = e.lastIndexOf("\n");
|
|
604
597
|
if (t === -1) return e;
|
|
605
598
|
let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
|
|
606
|
-
if (
|
|
599
|
+
if (Yt.test(i) && !n.match(Xt)) {
|
|
607
600
|
let t = r.split("\n").at(-1);
|
|
608
601
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
609
602
|
}
|
|
610
|
-
if (
|
|
603
|
+
if (Zt.test(i) && !n.match(Qt)) {
|
|
611
604
|
let t = r.split("\n").at(-1);
|
|
612
605
|
if (t && t.trim().length > 0) return `${e}\u200B`;
|
|
613
606
|
}
|
|
614
607
|
return e;
|
|
615
|
-
},
|
|
616
|
-
let t = e.match(
|
|
608
|
+
}, en = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, tn = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(en, (t, n, r) => O(e, r + n.length) ? t : `${n}\\~`), nn = (e) => {
|
|
609
|
+
let t = e.match(Ze);
|
|
617
610
|
if (t) {
|
|
618
611
|
let n = t[2];
|
|
619
|
-
if (!n ||
|
|
612
|
+
if (!n || A.test(n)) return e;
|
|
620
613
|
let r = e.lastIndexOf(t[1]);
|
|
621
|
-
if (
|
|
622
|
-
if (e.match(
|
|
614
|
+
if (O(e, r) || k(e, r)) return e;
|
|
615
|
+
if (e.match(rt)?.length % 2 == 1) return `${e}~~`;
|
|
623
616
|
} else {
|
|
624
|
-
let t = e.match(
|
|
617
|
+
let t = e.match(nt);
|
|
625
618
|
if (t) {
|
|
626
619
|
let n = e.lastIndexOf(t[0].slice(0, 2));
|
|
627
|
-
if (
|
|
628
|
-
if (e.match(
|
|
620
|
+
if (O(e, n) || k(e, n)) return e;
|
|
621
|
+
if (e.match(rt)?.length % 2 == 1) return `${e}~`;
|
|
629
622
|
}
|
|
630
623
|
}
|
|
631
624
|
return e;
|
|
632
|
-
},
|
|
625
|
+
}, rn = (e) => e !== !1, an = (e) => e === !0, L = {
|
|
633
626
|
SINGLE_TILDE: 0,
|
|
634
627
|
COMPARISON_OPERATORS: 5,
|
|
635
628
|
HTML_TAGS: 10,
|
|
@@ -645,11 +638,11 @@ $$` : `${e}$$`;
|
|
|
645
638
|
KATEX: 70,
|
|
646
639
|
INLINE_KATEX: 75,
|
|
647
640
|
DEFAULT: 100
|
|
648
|
-
},
|
|
641
|
+
}, on = [
|
|
649
642
|
{
|
|
650
643
|
handler: {
|
|
651
644
|
name: "singleTilde",
|
|
652
|
-
handle:
|
|
645
|
+
handle: tn,
|
|
653
646
|
priority: L.SINGLE_TILDE
|
|
654
647
|
},
|
|
655
648
|
optionKey: "singleTilde"
|
|
@@ -657,7 +650,7 @@ $$` : `${e}$$`;
|
|
|
657
650
|
{
|
|
658
651
|
handler: {
|
|
659
652
|
name: "comparisonOperators",
|
|
660
|
-
handle:
|
|
653
|
+
handle: We,
|
|
661
654
|
priority: L.COMPARISON_OPERATORS
|
|
662
655
|
},
|
|
663
656
|
optionKey: "comparisonOperators"
|
|
@@ -665,7 +658,7 @@ $$` : `${e}$$`;
|
|
|
665
658
|
{
|
|
666
659
|
handler: {
|
|
667
660
|
name: "htmlTags",
|
|
668
|
-
handle:
|
|
661
|
+
handle: Ft,
|
|
669
662
|
priority: L.HTML_TAGS
|
|
670
663
|
},
|
|
671
664
|
optionKey: "htmlTags"
|
|
@@ -673,7 +666,7 @@ $$` : `${e}$$`;
|
|
|
673
666
|
{
|
|
674
667
|
handler: {
|
|
675
668
|
name: "setextHeadings",
|
|
676
|
-
handle:
|
|
669
|
+
handle: $t,
|
|
677
670
|
priority: L.SETEXT_HEADINGS
|
|
678
671
|
},
|
|
679
672
|
optionKey: "setextHeadings"
|
|
@@ -681,7 +674,7 @@ $$` : `${e}$$`;
|
|
|
681
674
|
{
|
|
682
675
|
handler: {
|
|
683
676
|
name: "links",
|
|
684
|
-
handle:
|
|
677
|
+
handle: Jt,
|
|
685
678
|
priority: L.LINKS
|
|
686
679
|
},
|
|
687
680
|
optionKey: "links",
|
|
@@ -690,7 +683,7 @@ $$` : `${e}$$`;
|
|
|
690
683
|
{
|
|
691
684
|
handler: {
|
|
692
685
|
name: "boldItalic",
|
|
693
|
-
handle:
|
|
686
|
+
handle: I,
|
|
694
687
|
priority: L.BOLD_ITALIC
|
|
695
688
|
},
|
|
696
689
|
optionKey: "boldItalic"
|
|
@@ -698,7 +691,7 @@ $$` : `${e}$$`;
|
|
|
698
691
|
{
|
|
699
692
|
handler: {
|
|
700
693
|
name: "bold",
|
|
701
|
-
handle:
|
|
694
|
+
handle: Ct,
|
|
702
695
|
priority: L.BOLD
|
|
703
696
|
},
|
|
704
697
|
optionKey: "bold"
|
|
@@ -706,7 +699,7 @@ $$` : `${e}$$`;
|
|
|
706
699
|
{
|
|
707
700
|
handler: {
|
|
708
701
|
name: "italicDoubleUnderscore",
|
|
709
|
-
handle:
|
|
702
|
+
handle: Tt,
|
|
710
703
|
priority: L.ITALIC_DOUBLE_UNDERSCORE
|
|
711
704
|
},
|
|
712
705
|
optionKey: "italic"
|
|
@@ -714,7 +707,7 @@ $$` : `${e}$$`;
|
|
|
714
707
|
{
|
|
715
708
|
handler: {
|
|
716
709
|
name: "italicSingleAsterisk",
|
|
717
|
-
handle:
|
|
710
|
+
handle: Dt,
|
|
718
711
|
priority: L.ITALIC_SINGLE_ASTERISK
|
|
719
712
|
},
|
|
720
713
|
optionKey: "italic"
|
|
@@ -722,7 +715,7 @@ $$` : `${e}$$`;
|
|
|
722
715
|
{
|
|
723
716
|
handler: {
|
|
724
717
|
name: "italicSingleUnderscore",
|
|
725
|
-
handle:
|
|
718
|
+
handle: jt,
|
|
726
719
|
priority: L.ITALIC_SINGLE_UNDERSCORE
|
|
727
720
|
},
|
|
728
721
|
optionKey: "italic"
|
|
@@ -730,7 +723,7 @@ $$` : `${e}$$`;
|
|
|
730
723
|
{
|
|
731
724
|
handler: {
|
|
732
725
|
name: "inlineCode",
|
|
733
|
-
handle:
|
|
726
|
+
handle: Rt,
|
|
734
727
|
priority: L.INLINE_CODE
|
|
735
728
|
},
|
|
736
729
|
optionKey: "inlineCode"
|
|
@@ -738,7 +731,7 @@ $$` : `${e}$$`;
|
|
|
738
731
|
{
|
|
739
732
|
handler: {
|
|
740
733
|
name: "strikethrough",
|
|
741
|
-
handle:
|
|
734
|
+
handle: nn,
|
|
742
735
|
priority: L.STRIKETHROUGH
|
|
743
736
|
},
|
|
744
737
|
optionKey: "strikethrough"
|
|
@@ -746,7 +739,7 @@ $$` : `${e}$$`;
|
|
|
746
739
|
{
|
|
747
740
|
handler: {
|
|
748
741
|
name: "katex",
|
|
749
|
-
handle:
|
|
742
|
+
handle: Ut,
|
|
750
743
|
priority: L.KATEX
|
|
751
744
|
},
|
|
752
745
|
optionKey: "katex"
|
|
@@ -754,24 +747,24 @@ $$` : `${e}$$`;
|
|
|
754
747
|
{
|
|
755
748
|
handler: {
|
|
756
749
|
name: "inlineKatex",
|
|
757
|
-
handle:
|
|
750
|
+
handle: Wt,
|
|
758
751
|
priority: L.INLINE_KATEX
|
|
759
752
|
},
|
|
760
753
|
optionKey: "inlineKatex"
|
|
761
754
|
}
|
|
762
|
-
],
|
|
755
|
+
], sn = (e) => {
|
|
763
756
|
let t = e?.linkMode ?? "protocol";
|
|
764
|
-
return
|
|
765
|
-
handler:
|
|
757
|
+
return on.filter(({ handler: t, optionKey: n }) => t.name === "links" ? rn(e?.links) || rn(e?.images) : t.name === "inlineKatex" ? an(e?.inlineKatex) : rn(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
|
|
758
|
+
handler: Re(Le({}, e), { handle: (e) => Jt(e, t) }),
|
|
766
759
|
earlyReturn: t === "protocol" ? n : void 0
|
|
767
760
|
} : {
|
|
768
761
|
handler: e,
|
|
769
762
|
earlyReturn: n
|
|
770
763
|
});
|
|
771
|
-
},
|
|
764
|
+
}, cn = (e, t) => {
|
|
772
765
|
if (!e || typeof e != "string") return e;
|
|
773
|
-
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r =
|
|
774
|
-
handler:
|
|
766
|
+
let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = sn(t), i = (t?.handlers ?? []).map((e) => ({
|
|
767
|
+
handler: Re(Le({}, e), { priority: e.priority ?? L.DEFAULT }),
|
|
775
768
|
earlyReturn: void 0
|
|
776
769
|
})), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
|
|
777
770
|
for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
|
|
@@ -779,7 +772,7 @@ $$` : `${e}$$`;
|
|
|
779
772
|
};
|
|
780
773
|
//#endregion
|
|
781
774
|
//#region ../../node_modules/.pnpm/marked@18.0.14/node_modules/marked/lib/marked.esm.js
|
|
782
|
-
function
|
|
775
|
+
function ln() {
|
|
783
776
|
return {
|
|
784
777
|
async: !1,
|
|
785
778
|
breaks: !1,
|
|
@@ -793,12 +786,12 @@ function fn() {
|
|
|
793
786
|
walkTokens: null
|
|
794
787
|
};
|
|
795
788
|
}
|
|
796
|
-
var
|
|
797
|
-
function
|
|
798
|
-
|
|
789
|
+
var un = ln();
|
|
790
|
+
function dn(e) {
|
|
791
|
+
un = e;
|
|
799
792
|
}
|
|
800
|
-
var
|
|
801
|
-
function
|
|
793
|
+
var fn = { exec: () => null };
|
|
794
|
+
function pn(e) {
|
|
802
795
|
let t = [];
|
|
803
796
|
return (n) => {
|
|
804
797
|
let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
|
|
@@ -815,7 +808,7 @@ function R(e, t = "") {
|
|
|
815
808
|
};
|
|
816
809
|
return r;
|
|
817
810
|
}
|
|
818
|
-
var
|
|
811
|
+
var mn = ((e = "") => {
|
|
819
812
|
try {
|
|
820
813
|
return !!RegExp("(?<=1)(?<!1)" + e);
|
|
821
814
|
} catch {
|
|
@@ -875,111 +868,111 @@ var _n = ((e = "") => {
|
|
|
875
868
|
notSpaceStart: /^\S*/,
|
|
876
869
|
endingNewline: /\n$/,
|
|
877
870
|
listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
|
|
878
|
-
nextBulletRegex:
|
|
879
|
-
hrRegex:
|
|
880
|
-
fencesBeginRegex:
|
|
881
|
-
headingBeginRegex:
|
|
882
|
-
htmlBeginRegex:
|
|
883
|
-
blockquoteBeginRegex:
|
|
884
|
-
},
|
|
885
|
-
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",
|
|
886
|
-
code:
|
|
887
|
-
def:
|
|
888
|
-
fences:
|
|
889
|
-
heading:
|
|
890
|
-
hr:
|
|
891
|
-
html:
|
|
892
|
-
lheading:
|
|
893
|
-
list:
|
|
894
|
-
newline:
|
|
895
|
-
paragraph:
|
|
896
|
-
table:
|
|
897
|
-
text:
|
|
898
|
-
},
|
|
899
|
-
...
|
|
900
|
-
lheading:
|
|
901
|
-
table:
|
|
902
|
-
paragraph: R(
|
|
903
|
-
},
|
|
904
|
-
...
|
|
905
|
-
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",
|
|
871
|
+
nextBulletRegex: pn((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
|
|
872
|
+
hrRegex: pn((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
|
|
873
|
+
fencesBeginRegex: pn((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
|
|
874
|
+
headingBeginRegex: pn((e) => RegExp(`^ {0,${e}}#`)),
|
|
875
|
+
htmlBeginRegex: pn((e) => RegExp(`^ {0,${e}}(?:</?(?:${kn})(?: +|$|/?>)|<(?:script|pre|style|textarea|!--))`, "i")),
|
|
876
|
+
blockquoteBeginRegex: pn((e) => RegExp(`^ {0,${e}}>`))
|
|
877
|
+
}, hn = /^(?:[ \t]*(?:\n|$))+/, gn = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, _n = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, vn = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, yn = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, bn = / {0,3}(?:[*+-]|\d{1,9}[.)])/, xn = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Sn = R(xn).replace(/bull/g, bn).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(), Cn = R(xn).replace(/bull/g, bn).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(), wn = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Tn = /^[^\n]+/, En = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Dn = R(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", En).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), On = R(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, bn).getRegex(), kn = "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", An = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, jn = 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-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", An).replace("tag", kn).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Mn = (e) => R(wn).replace("hr", vn).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", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", kn).getRegex(), Nn = Mn(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Pn = Mn(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Fn = {
|
|
878
|
+
blockquote: R(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Pn).getRegex(),
|
|
879
|
+
code: gn,
|
|
880
|
+
def: Dn,
|
|
881
|
+
fences: _n,
|
|
882
|
+
heading: yn,
|
|
883
|
+
hr: vn,
|
|
884
|
+
html: jn,
|
|
885
|
+
lheading: Sn,
|
|
886
|
+
list: On,
|
|
887
|
+
newline: hn,
|
|
888
|
+
paragraph: Nn,
|
|
889
|
+
table: fn,
|
|
890
|
+
text: Tn
|
|
891
|
+
}, In = R("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", vn).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", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", kn).getRegex(), Ln = {
|
|
892
|
+
...Fn,
|
|
893
|
+
lheading: Cn,
|
|
894
|
+
table: In,
|
|
895
|
+
paragraph: R(wn).replace("hr", vn).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", In).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", kn).getRegex()
|
|
896
|
+
}, Rn = {
|
|
897
|
+
...Fn,
|
|
898
|
+
html: R("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", An).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(),
|
|
906
899
|
def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
|
|
907
900
|
heading: /^(#{1,6})(.*)(?:\n+|$)/,
|
|
908
|
-
fences:
|
|
901
|
+
fences: fn,
|
|
909
902
|
lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
|
|
910
|
-
paragraph: R(
|
|
911
|
-
},
|
|
912
|
-
_backpedal:
|
|
913
|
-
anyPunctuation:
|
|
914
|
-
autolink:
|
|
915
|
-
blockSkip:
|
|
916
|
-
br:
|
|
917
|
-
code:
|
|
918
|
-
del:
|
|
919
|
-
delLDelim:
|
|
920
|
-
delRDelim:
|
|
921
|
-
emStrongLDelim:
|
|
922
|
-
emStrongRDelimAst:
|
|
923
|
-
emStrongRDelimUnd:
|
|
924
|
-
escape:
|
|
925
|
-
link:
|
|
926
|
-
nolink:
|
|
927
|
-
punctuation:
|
|
928
|
-
reflink:
|
|
929
|
-
reflinkSearch:
|
|
930
|
-
tag:
|
|
931
|
-
text:
|
|
932
|
-
url:
|
|
933
|
-
},
|
|
934
|
-
...
|
|
935
|
-
emStrongLDelim:
|
|
936
|
-
emStrongRDelimAst:
|
|
937
|
-
emStrongRDelimUnd:
|
|
938
|
-
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label",
|
|
939
|
-
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",
|
|
940
|
-
},
|
|
941
|
-
...
|
|
942
|
-
emStrongRDelimAst:
|
|
943
|
-
emStrongLDelim:
|
|
944
|
-
delLDelim:
|
|
945
|
-
delRDelim:
|
|
946
|
-
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol",
|
|
903
|
+
paragraph: R(wn).replace("hr", vn).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Sn).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
|
|
904
|
+
}, zn = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Bn = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Vn = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Hn = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, B = /[\p{P}\p{S}]/u, Un = /[\s\p{P}\p{S}]/u, Wn = /[^\s\p{P}\p{S}]/u, Gn = R(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Un).getRegex(), Kn = /[\p{Pi}\p{Ps}"']/u, qn = /(?!~)[\p{P}\p{S}]/u, Jn = /(?!~)[\s\p{P}\p{S}]/u, Yn = /(?:[^\s\p{P}\p{S}]|~)/u, Xn = R(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", mn ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), Zn = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, Qn = R(Zn, "u").replace(/punct/g, B).getRegex(), $n = R(Zn, "u").replace(/punct/g, qn).getRegex(), er = R(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Kn).replace(/punct/g, B).getRegex(), tr = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", nr = R(tr, "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, Un).replace(/punct/g, B).getRegex(), rr = R(tr, "gu").replace(/notPunctSpace/g, Yn).replace(/punctSpace/g, Jn).replace(/punct/g, qn).getRegex(), ir = R("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, Un).replace(/punct/g, B).getRegex(), ar = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, Un).replace(/punct/g, B).getRegex(), or = R("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, Un).replace(/punct/g, B).getRegex(), sr = R(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, B).getRegex(), cr = R("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Wn).replace(/punctSpace/g, Un).replace(/punct/g, B).getRegex(), lr = R(/\\(punct)/, "gu").replace(/punct/g, B).getRegex(), ur = 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(), dr = R(An).replace("(?:-->|$)", "-->").getRegex(), fr = 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", dr).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), pr = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, mr = R(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", pr).getRegex(), hr = R(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label", mr).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), gr = R(/^!?\[(label)\]\[(ref)\]/).replace("label", mr).replace("ref", En).getRegex(), _r = R(/^!?\[(ref)\](?:\[\])?/).replace("ref", En).getRegex(), vr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, yr = R(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", pr).getRegex(), br = R("reflink|nolink(?!\\()", "g").replace("reflink", R(/^!?\[(label)\]\[(ref)\]/).replace("label", yr).replace("ref", vr).getRegex()).replace("nolink", R(/^!?\[(ref)\](?:\[\])?/).replace("ref", vr).getRegex()).getRegex(), xr = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Sr = 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(), Cr = {
|
|
905
|
+
_backpedal: fn,
|
|
906
|
+
anyPunctuation: lr,
|
|
907
|
+
autolink: ur,
|
|
908
|
+
blockSkip: Xn,
|
|
909
|
+
br: Vn,
|
|
910
|
+
code: Bn,
|
|
911
|
+
del: fn,
|
|
912
|
+
delLDelim: fn,
|
|
913
|
+
delRDelim: fn,
|
|
914
|
+
emStrongLDelim: Qn,
|
|
915
|
+
emStrongRDelimAst: nr,
|
|
916
|
+
emStrongRDelimUnd: ar,
|
|
917
|
+
escape: zn,
|
|
918
|
+
link: hr,
|
|
919
|
+
nolink: _r,
|
|
920
|
+
punctuation: Gn,
|
|
921
|
+
reflink: gr,
|
|
922
|
+
reflinkSearch: br,
|
|
923
|
+
tag: fr,
|
|
924
|
+
text: Hn,
|
|
925
|
+
url: fn
|
|
926
|
+
}, wr = {
|
|
927
|
+
...Cr,
|
|
928
|
+
emStrongLDelim: er,
|
|
929
|
+
emStrongRDelimAst: ir,
|
|
930
|
+
emStrongRDelimUnd: or,
|
|
931
|
+
link: R(/^!?\[(label)\]\((.*?)\)/).replace("label", mr).getRegex(),
|
|
932
|
+
reflink: R(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", mr).getRegex()
|
|
933
|
+
}, Tr = {
|
|
934
|
+
...Cr,
|
|
935
|
+
emStrongRDelimAst: rr,
|
|
936
|
+
emStrongLDelim: $n,
|
|
937
|
+
delLDelim: sr,
|
|
938
|
+
delRDelim: cr,
|
|
939
|
+
url: R(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Sr).replace("protocol", xr).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
|
|
947
940
|
_backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
|
|
948
941
|
del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
|
|
949
|
-
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",
|
|
942
|
+
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", xr).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
|
|
943
|
+
}, Er = {
|
|
944
|
+
...Tr,
|
|
945
|
+
br: R(Vn).replace("{2,}", "*").getRegex(),
|
|
946
|
+
text: R(Tr.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
947
|
+
}, Dr = {
|
|
948
|
+
normal: Fn,
|
|
949
|
+
gfm: Ln,
|
|
950
|
+
pedantic: Rn
|
|
951
|
+
}, Or = {
|
|
952
|
+
normal: Cr,
|
|
953
|
+
gfm: Tr,
|
|
954
|
+
breaks: Er,
|
|
955
|
+
pedantic: wr
|
|
950
956
|
}, kr = {
|
|
951
|
-
...Or,
|
|
952
|
-
br: R(Wn).replace("{2,}", "*").getRegex(),
|
|
953
|
-
text: R(Or.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
|
|
954
|
-
}, Ar = {
|
|
955
|
-
normal: Rn,
|
|
956
|
-
gfm: Bn,
|
|
957
|
-
pedantic: Vn
|
|
958
|
-
}, jr = {
|
|
959
|
-
normal: Er,
|
|
960
|
-
gfm: Or,
|
|
961
|
-
breaks: kr,
|
|
962
|
-
pedantic: Dr
|
|
963
|
-
}, Mr = {
|
|
964
957
|
"&": "&",
|
|
965
958
|
"<": "<",
|
|
966
959
|
">": ">",
|
|
967
960
|
"\"": """,
|
|
968
961
|
"'": "'"
|
|
969
|
-
},
|
|
962
|
+
}, Ar = (e) => kr[e];
|
|
970
963
|
function V(e, t) {
|
|
971
964
|
if (t) {
|
|
972
|
-
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace,
|
|
973
|
-
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode,
|
|
965
|
+
if (z.escapeTest.test(e)) return e.replace(z.escapeReplace, Ar);
|
|
966
|
+
} else if (z.escapeTestNoEncode.test(e)) return e.replace(z.escapeReplaceNoEncode, Ar);
|
|
974
967
|
return e;
|
|
975
968
|
}
|
|
976
|
-
function
|
|
969
|
+
function jr(e) {
|
|
977
970
|
return e.replace(z.numericCharacterReference, (e, t, n) => {
|
|
978
971
|
let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
|
|
979
972
|
return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : String.fromCodePoint(r);
|
|
980
973
|
});
|
|
981
974
|
}
|
|
982
|
-
function
|
|
975
|
+
function Mr(e) {
|
|
983
976
|
try {
|
|
984
977
|
e = encodeURI(e).replace(z.percentDecode, "%");
|
|
985
978
|
} catch {
|
|
@@ -987,7 +980,7 @@ function Fr(e) {
|
|
|
987
980
|
}
|
|
988
981
|
return e;
|
|
989
982
|
}
|
|
990
|
-
function
|
|
983
|
+
function Nr(e, t) {
|
|
991
984
|
let n = e.replace(z.findPipe, (e, t, n) => {
|
|
992
985
|
let r = !1, i = t;
|
|
993
986
|
for (; --i >= 0 && n[i] === "\\";) r = !r;
|
|
@@ -1000,7 +993,7 @@ function Ir(e, t) {
|
|
|
1000
993
|
for (; r < n.length; r++) n[r] = n[r].trim().replace(z.slashPipe, "|");
|
|
1001
994
|
return n;
|
|
1002
995
|
}
|
|
1003
|
-
function
|
|
996
|
+
function Pr(e, t, n) {
|
|
1004
997
|
let r = e.length;
|
|
1005
998
|
if (r === 0) return "";
|
|
1006
999
|
let i = 0;
|
|
@@ -1012,15 +1005,15 @@ function Lr(e, t, n) {
|
|
|
1012
1005
|
}
|
|
1013
1006
|
return e.slice(0, r - i);
|
|
1014
1007
|
}
|
|
1015
|
-
function
|
|
1008
|
+
function Fr(e) {
|
|
1016
1009
|
let t = e.split("\n"), n = t.length - 1;
|
|
1017
1010
|
for (; n >= 0 && z.blankLine.test(t[n]);) n--;
|
|
1018
1011
|
return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
|
|
1019
1012
|
}
|
|
1020
|
-
function
|
|
1013
|
+
function Ir(e) {
|
|
1021
1014
|
return e.trim().toLowerCase().toUpperCase().toLowerCase();
|
|
1022
1015
|
}
|
|
1023
|
-
function
|
|
1016
|
+
function Lr(e, t) {
|
|
1024
1017
|
if (e.indexOf(t[1]) === -1) return -1;
|
|
1025
1018
|
let n = 0;
|
|
1026
1019
|
for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
|
|
@@ -1028,7 +1021,7 @@ function Br(e, t) {
|
|
|
1028
1021
|
else if (e[r] === t[1] && (n--, n < 0)) return r;
|
|
1029
1022
|
return n > 0 ? -2 : -1;
|
|
1030
1023
|
}
|
|
1031
|
-
function
|
|
1024
|
+
function Rr(e, t = 0) {
|
|
1032
1025
|
let n = t, r = "";
|
|
1033
1026
|
for (let t of e) if (t === " ") {
|
|
1034
1027
|
let e = 4 - n % 4;
|
|
@@ -1036,7 +1029,7 @@ function Vr(e, t = 0) {
|
|
|
1036
1029
|
} else r += t, n++;
|
|
1037
1030
|
return r;
|
|
1038
1031
|
}
|
|
1039
|
-
function
|
|
1032
|
+
function zr(e, t, n, r, i) {
|
|
1040
1033
|
let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!";
|
|
1041
1034
|
r.state.inLink = !0;
|
|
1042
1035
|
let l = r.state.linkEmitted, u = r.state.inRawBlock;
|
|
@@ -1058,7 +1051,7 @@ function Hr(e, t, n, r, i) {
|
|
|
1058
1051
|
tokens: d
|
|
1059
1052
|
};
|
|
1060
1053
|
}
|
|
1061
|
-
function
|
|
1054
|
+
function Br(e, t, n) {
|
|
1062
1055
|
let r = e.match(n.other.indentCodeCompensation);
|
|
1063
1056
|
if (r === null) return t;
|
|
1064
1057
|
let i = r[1];
|
|
@@ -1069,7 +1062,7 @@ function Ur(e, t, n) {
|
|
|
1069
1062
|
return e.slice(Math.min(r.length, i.length));
|
|
1070
1063
|
}).join("\n");
|
|
1071
1064
|
}
|
|
1072
|
-
function
|
|
1065
|
+
function Vr(e, t, n, r) {
|
|
1073
1066
|
if (!t.includes("<")) return !1;
|
|
1074
1067
|
for (let i = 0; i < t.length; i++) {
|
|
1075
1068
|
if (t[i] === "\\") {
|
|
@@ -1092,12 +1085,12 @@ function Wr(e, t, n, r) {
|
|
|
1092
1085
|
}
|
|
1093
1086
|
return !1;
|
|
1094
1087
|
}
|
|
1095
|
-
var
|
|
1088
|
+
var Hr = class {
|
|
1096
1089
|
options;
|
|
1097
1090
|
rules;
|
|
1098
1091
|
lexer;
|
|
1099
1092
|
constructor(e) {
|
|
1100
|
-
this.options = e ||
|
|
1093
|
+
this.options = e || un;
|
|
1101
1094
|
}
|
|
1102
1095
|
space(e) {
|
|
1103
1096
|
let t = this.rules.block.newline.exec(e);
|
|
@@ -1109,7 +1102,7 @@ var Gr = class {
|
|
|
1109
1102
|
code(e) {
|
|
1110
1103
|
let t = this.rules.block.code.exec(e);
|
|
1111
1104
|
if (t) {
|
|
1112
|
-
let e = this.options.pedantic ? t[0] :
|
|
1105
|
+
let e = this.options.pedantic ? t[0] : Fr(t[0]);
|
|
1113
1106
|
return {
|
|
1114
1107
|
type: "code",
|
|
1115
1108
|
raw: e,
|
|
@@ -1121,7 +1114,7 @@ var Gr = class {
|
|
|
1121
1114
|
fences(e) {
|
|
1122
1115
|
let t = this.rules.block.fences.exec(e);
|
|
1123
1116
|
if (t) {
|
|
1124
|
-
let e = t[0], n =
|
|
1117
|
+
let e = t[0], n = Br(e, t[3] || "", this.rules);
|
|
1125
1118
|
return {
|
|
1126
1119
|
type: "code",
|
|
1127
1120
|
raw: e,
|
|
@@ -1135,12 +1128,12 @@ var Gr = class {
|
|
|
1135
1128
|
if (t) {
|
|
1136
1129
|
let e = t[2].trim();
|
|
1137
1130
|
if (this.rules.other.endingHash.test(e)) {
|
|
1138
|
-
let t =
|
|
1131
|
+
let t = Pr(e, "#");
|
|
1139
1132
|
(this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
|
|
1140
1133
|
}
|
|
1141
1134
|
return {
|
|
1142
1135
|
type: "heading",
|
|
1143
|
-
raw:
|
|
1136
|
+
raw: Pr(t[0], "\n"),
|
|
1144
1137
|
depth: t[1].length,
|
|
1145
1138
|
text: e,
|
|
1146
1139
|
tokens: this.lexer.inline(e)
|
|
@@ -1151,13 +1144,13 @@ var Gr = class {
|
|
|
1151
1144
|
let t = this.rules.block.hr.exec(e);
|
|
1152
1145
|
if (t) return {
|
|
1153
1146
|
type: "hr",
|
|
1154
|
-
raw:
|
|
1147
|
+
raw: Pr(t[0], "\n")
|
|
1155
1148
|
};
|
|
1156
1149
|
}
|
|
1157
1150
|
blockquote(e) {
|
|
1158
1151
|
let t = this.rules.block.blockquote.exec(e);
|
|
1159
1152
|
if (t) {
|
|
1160
|
-
let e =
|
|
1153
|
+
let e = Pr(t[0], "\n").split("\n"), n = "", r = "", i = [];
|
|
1161
1154
|
for (; e.length > 0;) {
|
|
1162
1155
|
let t = !1, a = [], o = 0;
|
|
1163
1156
|
for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
|
|
@@ -1211,7 +1204,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1211
1204
|
let n = !1, r = "", s = "";
|
|
1212
1205
|
if (!(t = a.exec(e)) || this.rules.block.hr.test(e)) break;
|
|
1213
1206
|
r = t[0], e = e.substring(r.length);
|
|
1214
|
-
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ?
|
|
1207
|
+
let c = t[2].split("\n", 1)[0], l = t[1].length, u = this.options.pedantic ? Rr(c, l) : c.replace(this.rules.other.leadingSpaceTab, (e) => Rr(e, l)), d = e.split("\n", 1)[0], f = !u.trim(), p = 0;
|
|
1215
1208
|
if (this.options.pedantic ? (p = 2, s = u.trimStart()) : f ? p = l + 1 : (p = u.search(this.rules.other.nonSpaceChar), p = p > 4 ? 1 : p, s = u.slice(p), p += l), f && this.rules.other.blankLine.test(d) && (r += d + "\n", e = e.substring(d.length + 1), n = !0), !n) {
|
|
1216
1209
|
let t = this.rules.other.nextBulletRegex(p), n = this.rules.other.hrRegex(p), i = this.rules.other.fencesBeginRegex(p), a = this.rules.other.headingBeginRegex(p), o = this.rules.other.htmlBeginRegex(p), c = this.rules.other.blockquoteBeginRegex(p);
|
|
1217
1210
|
for (; e;) {
|
|
@@ -1276,7 +1269,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1276
1269
|
html(e) {
|
|
1277
1270
|
let t = this.rules.block.html.exec(e);
|
|
1278
1271
|
if (t) {
|
|
1279
|
-
let e =
|
|
1272
|
+
let e = Fr(t[0]);
|
|
1280
1273
|
return {
|
|
1281
1274
|
type: "html",
|
|
1282
1275
|
block: !0,
|
|
@@ -1289,11 +1282,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1289
1282
|
def(e) {
|
|
1290
1283
|
let t = this.rules.block.def.exec(e);
|
|
1291
1284
|
if (t) {
|
|
1292
|
-
let e =
|
|
1285
|
+
let e = Ir(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];
|
|
1293
1286
|
return {
|
|
1294
1287
|
type: "def",
|
|
1295
1288
|
tag: e,
|
|
1296
|
-
raw:
|
|
1289
|
+
raw: Pr(t[0], "\n"),
|
|
1297
1290
|
href: n,
|
|
1298
1291
|
title: r
|
|
1299
1292
|
};
|
|
@@ -1302,9 +1295,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1302
1295
|
table(e) {
|
|
1303
1296
|
let t = this.rules.block.table.exec(e);
|
|
1304
1297
|
if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
|
|
1305
|
-
let n =
|
|
1298
|
+
let n = Nr(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 = {
|
|
1306
1299
|
type: "table",
|
|
1307
|
-
raw:
|
|
1300
|
+
raw: Pr(t[0], "\n"),
|
|
1308
1301
|
header: [],
|
|
1309
1302
|
align: [],
|
|
1310
1303
|
rows: []
|
|
@@ -1317,7 +1310,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1317
1310
|
header: !0,
|
|
1318
1311
|
align: a.align[e]
|
|
1319
1312
|
});
|
|
1320
|
-
for (let e of i) a.rows.push(
|
|
1313
|
+
for (let e of i) a.rows.push(Nr(e, a.header.length).map((e, t) => ({
|
|
1321
1314
|
text: e,
|
|
1322
1315
|
tokens: this.lexer.inline(e),
|
|
1323
1316
|
header: !1,
|
|
@@ -1332,7 +1325,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1332
1325
|
let e = t[1].trim();
|
|
1333
1326
|
return {
|
|
1334
1327
|
type: "heading",
|
|
1335
|
-
raw:
|
|
1328
|
+
raw: Pr(t[0], "\n"),
|
|
1336
1329
|
depth: t[2].charAt(0) === "=" ? 1 : 2,
|
|
1337
1330
|
text: e,
|
|
1338
1331
|
tokens: this.lexer.inline(e)
|
|
@@ -1383,14 +1376,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1383
1376
|
let t = this.rules.inline.link.exec(e);
|
|
1384
1377
|
if (t) {
|
|
1385
1378
|
let n = t[0].charAt(0) === "!" ? 2 : 1;
|
|
1386
|
-
if (!this.options.pedantic &&
|
|
1379
|
+
if (!this.options.pedantic && Vr(e, t[1], n, this.rules)) return;
|
|
1387
1380
|
let r = t[2].trim();
|
|
1388
1381
|
if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
|
|
1389
1382
|
if (!this.rules.other.endAngleBracket.test(r)) return;
|
|
1390
|
-
let e =
|
|
1383
|
+
let e = Pr(r.slice(0, -1), "\\");
|
|
1391
1384
|
if ((r.length - e.length) % 2 == 0) return;
|
|
1392
1385
|
} else {
|
|
1393
|
-
let e =
|
|
1386
|
+
let e = Lr(t[2], "()");
|
|
1394
1387
|
if (e === -2) return;
|
|
1395
1388
|
if (e > -1) {
|
|
1396
1389
|
let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
|
|
@@ -1402,7 +1395,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1402
1395
|
let e = this.rules.other.pedanticHrefTitle.exec(i);
|
|
1403
1396
|
e && (i = e[1], a = e[3]);
|
|
1404
1397
|
} else a = t[3] ? t[3].slice(1, -1) : "";
|
|
1405
|
-
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)),
|
|
1398
|
+
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)), zr(t, {
|
|
1406
1399
|
href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
|
|
1407
1400
|
title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
|
|
1408
1401
|
}, t[0], this.lexer, this.rules);
|
|
@@ -1412,8 +1405,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1412
1405
|
let n;
|
|
1413
1406
|
if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
|
|
1414
1407
|
let r = n[0].charAt(0) === "!" ? 2 : 1;
|
|
1415
|
-
if (!this.options.pedantic &&
|
|
1416
|
-
let i = t[
|
|
1408
|
+
if (!this.options.pedantic && Vr(e, n[1], r, this.rules)) return;
|
|
1409
|
+
let i = t[Ir((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
|
|
1417
1410
|
if (!i) {
|
|
1418
1411
|
let e = n[0].charAt(0);
|
|
1419
1412
|
return {
|
|
@@ -1422,7 +1415,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1422
1415
|
text: e
|
|
1423
1416
|
};
|
|
1424
1417
|
}
|
|
1425
|
-
return
|
|
1418
|
+
return zr(n, i, n[0], this.lexer, this.rules);
|
|
1426
1419
|
}
|
|
1427
1420
|
}
|
|
1428
1421
|
emStrong(e, t, n = "") {
|
|
@@ -1555,7 +1548,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1555
1548
|
return {
|
|
1556
1549
|
type: "text",
|
|
1557
1550
|
raw: t[0],
|
|
1558
|
-
text: e ? t[0] :
|
|
1551
|
+
text: e ? t[0] : jr(t[0]),
|
|
1559
1552
|
escaped: e
|
|
1560
1553
|
};
|
|
1561
1554
|
}
|
|
@@ -1567,7 +1560,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1567
1560
|
inlineQueue;
|
|
1568
1561
|
tokenizer;
|
|
1569
1562
|
constructor(e) {
|
|
1570
|
-
this.tokens = [], this.tokens.links = Object.create(null), this.options = e ||
|
|
1563
|
+
this.tokens = [], this.tokens.links = Object.create(null), this.options = e || un, this.options.tokenizer = this.options.tokenizer || new Hr(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
|
|
1571
1564
|
inLink: !1,
|
|
1572
1565
|
inRawBlock: !1,
|
|
1573
1566
|
linkEmitted: !1,
|
|
@@ -1575,15 +1568,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1575
1568
|
};
|
|
1576
1569
|
let t = {
|
|
1577
1570
|
other: z,
|
|
1578
|
-
block:
|
|
1579
|
-
inline:
|
|
1571
|
+
block: Dr.normal,
|
|
1572
|
+
inline: Or.normal
|
|
1580
1573
|
};
|
|
1581
|
-
this.options.pedantic ? (t.block =
|
|
1574
|
+
this.options.pedantic ? (t.block = Dr.pedantic, t.inline = Or.pedantic) : this.options.gfm && (t.block = Dr.gfm, t.inline = this.options.breaks ? Or.breaks : Or.gfm), this.tokenizer.rules = t;
|
|
1582
1575
|
}
|
|
1583
1576
|
static get rules() {
|
|
1584
1577
|
return {
|
|
1585
|
-
block:
|
|
1586
|
-
inline:
|
|
1578
|
+
block: Dr,
|
|
1579
|
+
inline: Or
|
|
1587
1580
|
};
|
|
1588
1581
|
}
|
|
1589
1582
|
static lex(t, n) {
|
|
@@ -1701,7 +1694,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1701
1694
|
for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
|
|
1702
1695
|
for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
|
|
1703
1696
|
let e = t[0], n = e.lastIndexOf("[");
|
|
1704
|
-
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links,
|
|
1697
|
+
if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Ir(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
|
|
1705
1698
|
}
|
|
1706
1699
|
return !1;
|
|
1707
1700
|
}
|
|
@@ -1711,7 +1704,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1711
1704
|
if (this.tokens.links && e.includes("[")) {
|
|
1712
1705
|
let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
|
|
1713
1706
|
let r = n.lastIndexOf("[");
|
|
1714
|
-
if (!Object.hasOwn(this.tokens.links,
|
|
1707
|
+
if (!Object.hasOwn(this.tokens.links, Ir(n.slice(r + 1, -1)))) return n;
|
|
1715
1708
|
if (r > 1 && n.charAt(0) !== "!") {
|
|
1716
1709
|
let i = n.slice(1, r - 1);
|
|
1717
1710
|
if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
|
|
@@ -1801,11 +1794,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
|
|
|
1801
1794
|
if (this.options.silent) console.error(t);
|
|
1802
1795
|
else throw Error(t);
|
|
1803
1796
|
}
|
|
1804
|
-
},
|
|
1797
|
+
}, Ur = class {
|
|
1805
1798
|
options;
|
|
1806
1799
|
parser;
|
|
1807
1800
|
constructor(e) {
|
|
1808
|
-
this.options = e ||
|
|
1801
|
+
this.options = e || un;
|
|
1809
1802
|
}
|
|
1810
1803
|
space(e) {
|
|
1811
1804
|
return "";
|
|
@@ -1891,7 +1884,7 @@ ${e}</tr>
|
|
|
1891
1884
|
return `<del>${this.parser.parseInline(e)}</del>`;
|
|
1892
1885
|
}
|
|
1893
1886
|
link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
|
|
1894
|
-
let a = i ? V(n, !0) : this.parser.parseInline(r), o =
|
|
1887
|
+
let a = i ? V(n, !0) : this.parser.parseInline(r), o = Mr(e);
|
|
1895
1888
|
if (o === null) return a;
|
|
1896
1889
|
e = V(o, i);
|
|
1897
1890
|
let s = "<a href=\"" + e + "\"";
|
|
@@ -1899,7 +1892,7 @@ ${e}</tr>
|
|
|
1899
1892
|
}
|
|
1900
1893
|
image({ href: e, title: t, text: n, tokens: r }) {
|
|
1901
1894
|
r && (n = this.parser.parseInline(r, this.parser.textRenderer));
|
|
1902
|
-
let i =
|
|
1895
|
+
let i = Mr(e);
|
|
1903
1896
|
if (i === null) return V(n);
|
|
1904
1897
|
e = i;
|
|
1905
1898
|
let a = `<img src="${V(e)}" alt="${V(n)}"`;
|
|
@@ -1908,7 +1901,7 @@ ${e}</tr>
|
|
|
1908
1901
|
text(e) {
|
|
1909
1902
|
return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
|
|
1910
1903
|
}
|
|
1911
|
-
},
|
|
1904
|
+
}, Wr = class {
|
|
1912
1905
|
strong({ text: e }) {
|
|
1913
1906
|
return e;
|
|
1914
1907
|
}
|
|
@@ -1944,7 +1937,7 @@ ${e}</tr>
|
|
|
1944
1937
|
renderer;
|
|
1945
1938
|
textRenderer;
|
|
1946
1939
|
constructor(e) {
|
|
1947
|
-
this.options = e ||
|
|
1940
|
+
this.options = e || un, this.options.renderer = this.options.renderer || new Ur(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Wr();
|
|
1948
1941
|
}
|
|
1949
1942
|
static parse(t, n) {
|
|
1950
1943
|
return new e(n).parse(t);
|
|
@@ -2092,11 +2085,11 @@ ${e}</tr>
|
|
|
2092
2085
|
}
|
|
2093
2086
|
return n;
|
|
2094
2087
|
}
|
|
2095
|
-
},
|
|
2088
|
+
}, Gr = class {
|
|
2096
2089
|
options;
|
|
2097
2090
|
block;
|
|
2098
2091
|
constructor(e) {
|
|
2099
|
-
this.options = e ||
|
|
2092
|
+
this.options = e || un;
|
|
2100
2093
|
}
|
|
2101
2094
|
static passThroughHooks = /* @__PURE__ */ new Set([
|
|
2102
2095
|
"preprocess",
|
|
@@ -2127,17 +2120,17 @@ ${e}</tr>
|
|
|
2127
2120
|
provideParser(e = this.block) {
|
|
2128
2121
|
return e ? U.parse : U.parseInline;
|
|
2129
2122
|
}
|
|
2130
|
-
},
|
|
2131
|
-
defaults =
|
|
2123
|
+
}, Kr = new class {
|
|
2124
|
+
defaults = ln();
|
|
2132
2125
|
options = this.setOptions;
|
|
2133
2126
|
parse = this.parseMarkdown(!0);
|
|
2134
2127
|
parseInline = this.parseMarkdown(!1);
|
|
2135
2128
|
Parser = U;
|
|
2136
|
-
Renderer =
|
|
2137
|
-
TextRenderer =
|
|
2129
|
+
Renderer = Ur;
|
|
2130
|
+
TextRenderer = Wr;
|
|
2138
2131
|
Lexer = H;
|
|
2139
|
-
Tokenizer =
|
|
2140
|
-
Hooks =
|
|
2132
|
+
Tokenizer = Hr;
|
|
2133
|
+
Hooks = Gr;
|
|
2141
2134
|
constructor(...e) {
|
|
2142
2135
|
this.use(...e);
|
|
2143
2136
|
}
|
|
@@ -2188,7 +2181,7 @@ ${e}</tr>
|
|
|
2188
2181
|
}
|
|
2189
2182
|
"childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
|
|
2190
2183
|
}), n.extensions = t), e.renderer) {
|
|
2191
|
-
let t = this.defaults.renderer || new
|
|
2184
|
+
let t = this.defaults.renderer || new Ur(this.defaults);
|
|
2192
2185
|
for (let n in e.renderer) {
|
|
2193
2186
|
if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
|
|
2194
2187
|
if (["options", "parser"].includes(n)) continue;
|
|
@@ -2201,7 +2194,7 @@ ${e}</tr>
|
|
|
2201
2194
|
n.renderer = t;
|
|
2202
2195
|
}
|
|
2203
2196
|
if (e.tokenizer) {
|
|
2204
|
-
let t = this.defaults.tokenizer || new
|
|
2197
|
+
let t = this.defaults.tokenizer || new Hr(this.defaults);
|
|
2205
2198
|
for (let n in e.tokenizer) {
|
|
2206
2199
|
if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
|
|
2207
2200
|
if ([
|
|
@@ -2218,13 +2211,13 @@ ${e}</tr>
|
|
|
2218
2211
|
n.tokenizer = t;
|
|
2219
2212
|
}
|
|
2220
2213
|
if (e.hooks) {
|
|
2221
|
-
let t = this.defaults.hooks || new
|
|
2214
|
+
let t = this.defaults.hooks || new Gr();
|
|
2222
2215
|
for (let n in e.hooks) {
|
|
2223
2216
|
if (!(n in t)) throw Error(`hook '${n}' does not exist`);
|
|
2224
2217
|
if (["options", "block"].includes(n)) continue;
|
|
2225
2218
|
let r = n, i = e.hooks[r], a = t[r];
|
|
2226
|
-
t[r] =
|
|
2227
|
-
if (this.defaults.async &&
|
|
2219
|
+
t[r] = Gr.passThroughHooks.has(n) ? (e) => {
|
|
2220
|
+
if (this.defaults.async && Gr.passThroughHooksRespectAsync.has(n)) return (async () => {
|
|
2228
2221
|
let n = await i.call(t, e);
|
|
2229
2222
|
return a.call(t, n);
|
|
2230
2223
|
})();
|
|
@@ -2304,28 +2297,28 @@ ${e}</tr>
|
|
|
2304
2297
|
}
|
|
2305
2298
|
}();
|
|
2306
2299
|
function W(e, t) {
|
|
2307
|
-
return
|
|
2300
|
+
return Kr.parse(e, t);
|
|
2308
2301
|
}
|
|
2309
2302
|
W.options = W.setOptions = function(e) {
|
|
2310
|
-
return
|
|
2311
|
-
}, W.getDefaults =
|
|
2312
|
-
function
|
|
2313
|
-
return
|
|
2314
|
-
}
|
|
2315
|
-
W.use =
|
|
2316
|
-
return
|
|
2317
|
-
}, W.parseInline =
|
|
2303
|
+
return Kr.setOptions(e), W.defaults = Kr.defaults, dn(W.defaults), W;
|
|
2304
|
+
}, W.getDefaults = ln, W.defaults = un;
|
|
2305
|
+
function qr(...e) {
|
|
2306
|
+
return Kr.use(...e), W.defaults = Kr.defaults, dn(W.defaults), W;
|
|
2307
|
+
}
|
|
2308
|
+
W.use = qr, W.walkTokens = function(e, t) {
|
|
2309
|
+
return Kr.walkTokens(e, t);
|
|
2310
|
+
}, W.parseInline = Kr.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Ur, W.TextRenderer = Wr, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Hr, W.Hooks = Gr, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
|
|
2318
2311
|
//#endregion
|
|
2319
2312
|
//#region ../../node_modules/.pnpm/dompurify@3.4.15/node_modules/dompurify/dist/purify.es.mjs
|
|
2320
|
-
function
|
|
2313
|
+
function Jr(e, t) {
|
|
2321
2314
|
(t == null || t > e.length) && (t = e.length);
|
|
2322
2315
|
for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
|
|
2323
2316
|
return r;
|
|
2324
2317
|
}
|
|
2325
|
-
function
|
|
2318
|
+
function Yr(e) {
|
|
2326
2319
|
if (Array.isArray(e)) return e;
|
|
2327
2320
|
}
|
|
2328
|
-
function
|
|
2321
|
+
function Xr(e, t) {
|
|
2329
2322
|
var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
2330
2323
|
if (n != null) {
|
|
2331
2324
|
var r, i, a, o, s = [], c = !0, l = !1;
|
|
@@ -2343,113 +2336,113 @@ function $r(e, t) {
|
|
|
2343
2336
|
return s;
|
|
2344
2337
|
}
|
|
2345
2338
|
}
|
|
2346
|
-
function
|
|
2339
|
+
function Zr() {
|
|
2347
2340
|
throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2348
2341
|
}
|
|
2349
|
-
function
|
|
2350
|
-
return
|
|
2342
|
+
function Qr(e, t) {
|
|
2343
|
+
return Yr(e) || Xr(e, t) || $r(e, t) || Zr();
|
|
2351
2344
|
}
|
|
2352
|
-
function
|
|
2345
|
+
function $r(e, t) {
|
|
2353
2346
|
if (e) {
|
|
2354
|
-
if (typeof e == "string") return
|
|
2347
|
+
if (typeof e == "string") return Jr(e, t);
|
|
2355
2348
|
var n = {}.toString.call(e).slice(8, -1);
|
|
2356
|
-
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) ?
|
|
2349
|
+
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) ? Jr(e, t) : void 0;
|
|
2357
2350
|
}
|
|
2358
2351
|
}
|
|
2359
|
-
var
|
|
2352
|
+
var ei = Object.entries, ti = Object.setPrototypeOf, ni = Object.isFrozen, ri = Object.getPrototypeOf, ii = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, ai = Object.create, oi = typeof Reflect < "u" && Reflect, si = oi.apply, ci = oi.construct;
|
|
2360
2353
|
G ||= function(e) {
|
|
2361
2354
|
return e;
|
|
2362
2355
|
}, K ||= function(e) {
|
|
2363
2356
|
return e;
|
|
2364
|
-
},
|
|
2357
|
+
}, si ||= function(e, t) {
|
|
2365
2358
|
var n = [...arguments].slice(2);
|
|
2366
2359
|
return e.apply(t, n);
|
|
2367
|
-
},
|
|
2360
|
+
}, ci ||= function(e) {
|
|
2368
2361
|
return new e(...[...arguments].slice(1));
|
|
2369
2362
|
};
|
|
2370
|
-
var
|
|
2363
|
+
var li = Y(Array.prototype.forEach), ui = Y(Array.prototype.lastIndexOf), di = Y(Array.prototype.pop), fi = Y(Array.prototype.push), pi = Y(Array.prototype.splice), mi = Array.isArray, hi = Y(String.prototype.toLowerCase), gi = Y(String.prototype.toString), _i = Y(String.prototype.match), vi = Y(String.prototype.replace), yi = Y(String.prototype.indexOf), bi = Y(String.prototype.trim), xi = Y(Number.prototype.toString), Si = Y(Boolean.prototype.toString), Ci = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), wi = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), Ti = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), Ei = Di(TypeError);
|
|
2371
2364
|
function Y(e) {
|
|
2372
2365
|
return function(t) {
|
|
2373
2366
|
t instanceof RegExp && (t.lastIndex = 0);
|
|
2374
2367
|
var n = [...arguments].slice(1);
|
|
2375
|
-
return
|
|
2368
|
+
return si(e, t, n);
|
|
2376
2369
|
};
|
|
2377
2370
|
}
|
|
2378
|
-
function
|
|
2371
|
+
function Di(e) {
|
|
2379
2372
|
return function() {
|
|
2380
|
-
return
|
|
2373
|
+
return ci(e, [...arguments]);
|
|
2381
2374
|
};
|
|
2382
2375
|
}
|
|
2383
2376
|
function X(e, t) {
|
|
2384
|
-
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
2385
|
-
if (
|
|
2377
|
+
let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : hi;
|
|
2378
|
+
if (ti && ti(e, null), !mi(t)) return e;
|
|
2386
2379
|
let r = t.length;
|
|
2387
2380
|
for (; r--;) {
|
|
2388
2381
|
let i = t[r];
|
|
2389
2382
|
if (typeof i == "string") {
|
|
2390
2383
|
let e = n(i);
|
|
2391
|
-
e !== i && (
|
|
2384
|
+
e !== i && (ni(t) || (t[r] = e), i = e);
|
|
2392
2385
|
}
|
|
2393
2386
|
e[i] = !0;
|
|
2394
2387
|
}
|
|
2395
2388
|
return e;
|
|
2396
2389
|
}
|
|
2397
|
-
function
|
|
2390
|
+
function Oi(e) {
|
|
2398
2391
|
for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
|
|
2399
2392
|
return e;
|
|
2400
2393
|
}
|
|
2401
2394
|
function Z(e) {
|
|
2402
|
-
let t =
|
|
2403
|
-
for (let r of
|
|
2404
|
-
var n =
|
|
2395
|
+
let t = ai(null);
|
|
2396
|
+
for (let r of ei(e)) {
|
|
2397
|
+
var n = Qr(r, 2);
|
|
2405
2398
|
let i = n[0], a = n[1];
|
|
2406
|
-
q(e, i) && (t[i] =
|
|
2399
|
+
q(e, i) && (t[i] = mi(a) ? Oi(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
|
|
2407
2400
|
}
|
|
2408
2401
|
return t;
|
|
2409
2402
|
}
|
|
2410
|
-
function
|
|
2403
|
+
function ki(e) {
|
|
2411
2404
|
switch (typeof e) {
|
|
2412
2405
|
case "string": return e;
|
|
2413
|
-
case "number": return
|
|
2414
|
-
case "boolean": return
|
|
2415
|
-
case "bigint": return
|
|
2416
|
-
case "symbol": return
|
|
2417
|
-
case "undefined": return
|
|
2406
|
+
case "number": return xi(e);
|
|
2407
|
+
case "boolean": return Si(e);
|
|
2408
|
+
case "bigint": return Ci ? Ci(e) : "0";
|
|
2409
|
+
case "symbol": return wi ? wi(e) : "Symbol()";
|
|
2410
|
+
case "undefined": return Ti(e);
|
|
2418
2411
|
case "function":
|
|
2419
2412
|
case "object": {
|
|
2420
|
-
if (e === null) return
|
|
2413
|
+
if (e === null) return Ti(e);
|
|
2421
2414
|
let t = e, n = Q(t, "toString");
|
|
2422
2415
|
if (typeof n == "function") {
|
|
2423
2416
|
let e = n(t);
|
|
2424
|
-
return typeof e == "string" ? e :
|
|
2417
|
+
return typeof e == "string" ? e : Ti(e);
|
|
2425
2418
|
}
|
|
2426
|
-
return
|
|
2419
|
+
return Ti(e);
|
|
2427
2420
|
}
|
|
2428
|
-
default: return
|
|
2421
|
+
default: return Ti(e);
|
|
2429
2422
|
}
|
|
2430
2423
|
}
|
|
2431
2424
|
function Q(e, t) {
|
|
2432
2425
|
for (; e !== null;) {
|
|
2433
|
-
let n =
|
|
2426
|
+
let n = ii(e, t);
|
|
2434
2427
|
if (n) {
|
|
2435
2428
|
if (n.get) return Y(n.get);
|
|
2436
2429
|
if (typeof n.value == "function") return Y(n.value);
|
|
2437
2430
|
}
|
|
2438
|
-
e =
|
|
2431
|
+
e = ri(e);
|
|
2439
2432
|
}
|
|
2440
2433
|
function n() {
|
|
2441
2434
|
return null;
|
|
2442
2435
|
}
|
|
2443
2436
|
return n;
|
|
2444
2437
|
}
|
|
2445
|
-
function
|
|
2438
|
+
function Ai(e) {
|
|
2446
2439
|
try {
|
|
2447
2440
|
return J(e, ""), !0;
|
|
2448
2441
|
} catch {
|
|
2449
2442
|
return !1;
|
|
2450
2443
|
}
|
|
2451
2444
|
}
|
|
2452
|
-
var
|
|
2445
|
+
var ji = 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(".")), Mi = 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(".")), Ni = G([
|
|
2453
2446
|
"feBlend",
|
|
2454
2447
|
"feColorMatrix",
|
|
2455
2448
|
"feComponentTransfer",
|
|
@@ -2475,7 +2468,7 @@ var Pi = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2475
2468
|
"feSpotLight",
|
|
2476
2469
|
"feTile",
|
|
2477
2470
|
"feTurbulence"
|
|
2478
|
-
]),
|
|
2471
|
+
]), Pi = G([
|
|
2479
2472
|
"animate",
|
|
2480
2473
|
"color-profile",
|
|
2481
2474
|
"cursor",
|
|
@@ -2498,7 +2491,7 @@ var Pi = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2498
2491
|
"solidcolor",
|
|
2499
2492
|
"unknown",
|
|
2500
2493
|
"use"
|
|
2501
|
-
]),
|
|
2494
|
+
]), Fi = 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(".")), Ii = G([
|
|
2502
2495
|
"maction",
|
|
2503
2496
|
"maligngroup",
|
|
2504
2497
|
"malignmark",
|
|
@@ -2514,13 +2507,13 @@ var Pi = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2514
2507
|
"annotation-xml",
|
|
2515
2508
|
"mprescripts",
|
|
2516
2509
|
"none"
|
|
2517
|
-
]),
|
|
2510
|
+
]), Li = G(["#text"]), Ri = 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(".")), zi = 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(".")), Bi = 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(".")), Vi = G([
|
|
2518
2511
|
"xlink:href",
|
|
2519
2512
|
"xml:id",
|
|
2520
2513
|
"xlink:title",
|
|
2521
2514
|
"xml:space",
|
|
2522
2515
|
"xmlns:xlink"
|
|
2523
|
-
]),
|
|
2516
|
+
]), Hi = K(/{{[\w\W]*|^[\w\W]*}}/g), Ui = K(/<%[\w\W]*|^[\w\W]*%>/g), Wi = K(/\${[\w\W]*/g), Gi = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), Ki = K(/^aria-[\-\w]+$/), qi = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), Ji = K(/^(?:\w+script|data):/i), Yi = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), Xi = K(/^html$/i), Zi = K(/^[a-z][.\w]*(-[.\w]+)+$/i), Qi = K(/<[/\w!]/g), $i = K(/<[/\w]/g), ea = K(/<\/no(script|embed|frames)/i), ta = K(/\/>/i), $ = {
|
|
2524
2517
|
element: 1,
|
|
2525
2518
|
attribute: 2,
|
|
2526
2519
|
text: 3,
|
|
@@ -2533,7 +2526,7 @@ var Pi = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2533
2526
|
documentType: 10,
|
|
2534
2527
|
documentFragment: 11,
|
|
2535
2528
|
notation: 12
|
|
2536
|
-
},
|
|
2529
|
+
}, na = [
|
|
2537
2530
|
"style",
|
|
2538
2531
|
"script",
|
|
2539
2532
|
"xmp",
|
|
@@ -2542,14 +2535,14 @@ var Pi = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2542
2535
|
"noframes",
|
|
2543
2536
|
"plaintext",
|
|
2544
2537
|
"noscript"
|
|
2545
|
-
],
|
|
2538
|
+
], ra = G(X({}, na)), ia = function() {
|
|
2546
2539
|
let e = {};
|
|
2547
|
-
return
|
|
2540
|
+
return li(na, (t) => {
|
|
2548
2541
|
e[t] = K(RegExp("</" + t + "(?=[\\t\\n\\f\\r />])", "i"));
|
|
2549
2542
|
}), G(e);
|
|
2550
|
-
}(),
|
|
2543
|
+
}(), aa = function() {
|
|
2551
2544
|
return typeof window > "u" ? null : window;
|
|
2552
|
-
},
|
|
2545
|
+
}, oa = function(e, t) {
|
|
2553
2546
|
if (typeof e != "object" || typeof e.createPolicy != "function") return null;
|
|
2554
2547
|
let n = null, r = "data-tt-policy-suffix";
|
|
2555
2548
|
t && t.hasAttribute(r) && (n = t.getAttribute(r));
|
|
@@ -2566,7 +2559,7 @@ var Pi = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2566
2559
|
} catch {
|
|
2567
2560
|
return console.warn("TrustedTypes policy " + i + " could not be created."), null;
|
|
2568
2561
|
}
|
|
2569
|
-
},
|
|
2562
|
+
}, sa = function() {
|
|
2570
2563
|
return {
|
|
2571
2564
|
afterSanitizeAttributes: [],
|
|
2572
2565
|
afterSanitizeElements: [],
|
|
@@ -2578,60 +2571,60 @@ var Pi = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
|
|
|
2578
2571
|
uponSanitizeElement: [],
|
|
2579
2572
|
uponSanitizeShadowNode: []
|
|
2580
2573
|
};
|
|
2581
|
-
},
|
|
2582
|
-
return q(e, t) &&
|
|
2583
|
-
},
|
|
2574
|
+
}, ca = function(e, t, n, r) {
|
|
2575
|
+
return q(e, t) && mi(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
|
|
2576
|
+
}, la = function(e, t, n) {
|
|
2584
2577
|
let r = q(e, t) ? e[t] : void 0;
|
|
2585
2578
|
return r && typeof r == "object" ? Z(r) : n();
|
|
2586
2579
|
};
|
|
2587
|
-
function
|
|
2588
|
-
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] :
|
|
2580
|
+
function ua() {
|
|
2581
|
+
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : aa(), t = (e) => ua(e);
|
|
2589
2582
|
if (t.version = "3.4.15", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
|
|
2590
2583
|
let n = e.document, r = n, i = r.currentScript;
|
|
2591
2584
|
e.DocumentFragment;
|
|
2592
2585
|
let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
|
|
2593
2586
|
e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
|
|
2594
|
-
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), te = Q(d, "nextSibling"), ne = Q(d, "childNodes"), re = Q(d, "parentNode"), ie = Q(d, "shadowRoot"), ae = Q(d, "attributes"), m = o && o.prototype ? Q(o.prototype, "nodeType") : null,
|
|
2587
|
+
let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), te = Q(d, "nextSibling"), ne = Q(d, "childNodes"), re = Q(d, "parentNode"), ie = Q(d, "shadowRoot"), ae = Q(d, "attributes"), m = o && o.prototype ? Q(o.prototype, "nodeType") : null, h = o && o.prototype ? Q(o.prototype, "nodeName") : null, oe = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, g = function(e) {
|
|
2595
2588
|
return m ? m(e) : e.nodeType;
|
|
2596
|
-
},
|
|
2597
|
-
return
|
|
2589
|
+
}, _ = function(e) {
|
|
2590
|
+
return h ? h(e) : e.nodeName;
|
|
2598
2591
|
};
|
|
2599
2592
|
if (typeof a == "function") {
|
|
2600
2593
|
let e = n.createElement("template");
|
|
2601
2594
|
e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
|
|
2602
2595
|
}
|
|
2603
|
-
let
|
|
2604
|
-
if (
|
|
2605
|
-
},
|
|
2606
|
-
|
|
2596
|
+
let v, y = "", se, ce = !1, le = 0, ue = function() {
|
|
2597
|
+
if (le > 0) throw Ei("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.");
|
|
2598
|
+
}, de = function(e) {
|
|
2599
|
+
ue(), le++;
|
|
2607
2600
|
try {
|
|
2608
|
-
return
|
|
2601
|
+
return v.createHTML(e);
|
|
2609
2602
|
} finally {
|
|
2610
|
-
|
|
2603
|
+
le--;
|
|
2611
2604
|
}
|
|
2612
|
-
},
|
|
2613
|
-
|
|
2605
|
+
}, b = function(e) {
|
|
2606
|
+
ue(), le++;
|
|
2614
2607
|
try {
|
|
2615
|
-
return
|
|
2608
|
+
return v.createScriptURL(e);
|
|
2616
2609
|
} finally {
|
|
2617
|
-
|
|
2618
|
-
}
|
|
2619
|
-
},
|
|
2620
|
-
return
|
|
2621
|
-
},
|
|
2622
|
-
t.isSupported = typeof
|
|
2623
|
-
let be =
|
|
2624
|
-
...
|
|
2610
|
+
le--;
|
|
2611
|
+
}
|
|
2612
|
+
}, fe = function() {
|
|
2613
|
+
return ce ||= (se = oa(u, i), !0), se;
|
|
2614
|
+
}, pe = n, me = pe.implementation, he = pe.createNodeIterator, ge = pe.createDocumentFragment, _e = pe.getElementsByTagName, ve = r.importNode, x = sa();
|
|
2615
|
+
t.isSupported = typeof ei == "function" && typeof re == "function" && me && me.createHTMLDocument !== void 0;
|
|
2616
|
+
let ye = Hi, be = Ui, xe = Wi, Se = Gi, Ce = Ki, we = Ji, Te = Yi, Ee = Zi, De = qi, S = null, Oe = X({}, [
|
|
2617
|
+
...ji,
|
|
2618
|
+
...Mi,
|
|
2619
|
+
...Ni,
|
|
2625
2620
|
...Fi,
|
|
2626
|
-
...
|
|
2621
|
+
...Li
|
|
2622
|
+
]), C = null, ke = X({}, [
|
|
2627
2623
|
...Ri,
|
|
2628
|
-
...
|
|
2629
|
-
|
|
2630
|
-
...Vi
|
|
2631
|
-
|
|
2632
|
-
...Ui,
|
|
2633
|
-
...Wi
|
|
2634
|
-
]), C = Object.seal(ci(null, {
|
|
2624
|
+
...zi,
|
|
2625
|
+
...Bi,
|
|
2626
|
+
...Vi
|
|
2627
|
+
]), w = Object.seal(ai(null, {
|
|
2635
2628
|
tagNameCheck: {
|
|
2636
2629
|
writable: !0,
|
|
2637
2630
|
configurable: !1,
|
|
@@ -2650,7 +2643,7 @@ function pa() {
|
|
|
2650
2643
|
enumerable: !0,
|
|
2651
2644
|
value: !1
|
|
2652
2645
|
}
|
|
2653
|
-
})),
|
|
2646
|
+
})), Ae = null, je = null, T = Object.seal(ai(null, {
|
|
2654
2647
|
tagCheck: {
|
|
2655
2648
|
writable: !0,
|
|
2656
2649
|
configurable: !1,
|
|
@@ -2663,14 +2656,14 @@ function pa() {
|
|
|
2663
2656
|
enumerable: !0,
|
|
2664
2657
|
value: null
|
|
2665
2658
|
}
|
|
2666
|
-
})),
|
|
2659
|
+
})), Me = !0, Ne = !0, Pe = !1, Fe = !0, E = !1, Ie = !0, D = !1, Le = !1, Re = null, ze = null, Be = !1, O = !1, Ve = !1, He = !1, k = !0, Ue = !1, We = "user-content-", Ge = !0, Ke = !1, qe = {}, Je = null, Ye = 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(".")), Xe = null, Ze = X({}, [
|
|
2667
2660
|
"audio",
|
|
2668
2661
|
"video",
|
|
2669
2662
|
"img",
|
|
2670
2663
|
"source",
|
|
2671
2664
|
"image",
|
|
2672
2665
|
"track"
|
|
2673
|
-
]),
|
|
2666
|
+
]), A = null, Qe = X({}, [
|
|
2674
2667
|
"alt",
|
|
2675
2668
|
"class",
|
|
2676
2669
|
"for",
|
|
@@ -2685,77 +2678,77 @@ function pa() {
|
|
|
2685
2678
|
"value",
|
|
2686
2679
|
"style",
|
|
2687
2680
|
"xmlns"
|
|
2688
|
-
]),
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2692
|
-
],
|
|
2681
|
+
]), $e = "http://www.w3.org/1998/Math/MathML", et = "http://www.w3.org/2000/svg", j = "http://www.w3.org/1999/xhtml", tt = j, nt = !1, rt = null, M = X({}, [
|
|
2682
|
+
$e,
|
|
2683
|
+
et,
|
|
2684
|
+
j
|
|
2685
|
+
], gi), it = G([
|
|
2693
2686
|
"mi",
|
|
2694
2687
|
"mo",
|
|
2695
2688
|
"mn",
|
|
2696
2689
|
"ms",
|
|
2697
2690
|
"mtext"
|
|
2698
|
-
]),
|
|
2691
|
+
]), at = X({}, it), ot = G(["annotation-xml"]), st = X({}, ot), ct = X({}, [
|
|
2699
2692
|
"title",
|
|
2700
2693
|
"style",
|
|
2701
2694
|
"font",
|
|
2702
2695
|
"a",
|
|
2703
2696
|
"script"
|
|
2704
|
-
]),
|
|
2697
|
+
]), N = null, lt = ["application/xhtml+xml", "text/html"], P = null, ut = null, dt = n.createElement("form"), ft = function(e) {
|
|
2705
2698
|
return e instanceof RegExp || e instanceof Function;
|
|
2706
|
-
},
|
|
2699
|
+
}, pt = function() {
|
|
2707
2700
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
2708
|
-
if (
|
|
2709
|
-
(!e || typeof e != "object") && (e = {}), e = Z(e),
|
|
2710
|
-
transform:
|
|
2711
|
-
base: et
|
|
2712
|
-
}), Ze = da(e, "ADD_DATA_URI_TAGS", Qe, {
|
|
2713
|
-
transform: M,
|
|
2701
|
+
if (ut && ut === e) return;
|
|
2702
|
+
(!e || typeof e != "object") && (e = {}), e = Z(e), N = lt.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, P = N === "application/xhtml+xml" ? gi : hi, S = ca(e, "ALLOWED_TAGS", Oe, { transform: P }), C = ca(e, "ALLOWED_ATTR", ke, { transform: P }), rt = ca(e, "ALLOWED_NAMESPACES", M, { transform: gi }), A = ca(e, "ADD_URI_SAFE_ATTR", Qe, {
|
|
2703
|
+
transform: P,
|
|
2714
2704
|
base: Qe
|
|
2715
|
-
}),
|
|
2716
|
-
|
|
2717
|
-
|
|
2705
|
+
}), Xe = ca(e, "ADD_DATA_URI_TAGS", Ze, {
|
|
2706
|
+
transform: P,
|
|
2707
|
+
base: Ze
|
|
2708
|
+
}), Je = ca(e, "FORBID_CONTENTS", Ye, { transform: P }), Ae = ca(e, "FORBID_TAGS", Z({}), { transform: P }), je = ca(e, "FORBID_ATTR", Z({}), { transform: P }), qe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Me = e.ALLOW_ARIA_ATTR !== !1, Ne = e.ALLOW_DATA_ATTR !== !1, Pe = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Fe = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, E = e.SAFE_FOR_TEMPLATES || !1, Ie = e.SAFE_FOR_XML !== !1, D = e.WHOLE_DOCUMENT || !1, O = e.RETURN_DOM || !1, Ve = e.RETURN_DOM_FRAGMENT || !1, He = e.RETURN_TRUSTED_TYPE || !1, Be = e.FORCE_BODY || !1, k = e.SANITIZE_DOM !== !1, Ue = e.SANITIZE_NAMED_PROPS || !1, Ge = e.KEEP_CONTENT !== !1, Ke = e.IN_PLACE || !1, De = Ai(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : qi, tt = typeof e.NAMESPACE == "string" ? e.NAMESPACE : j, at = la(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, it)), st = la(e, "HTML_INTEGRATION_POINTS", () => X({}, ot));
|
|
2709
|
+
let t = la(e, "CUSTOM_ELEMENT_HANDLING", () => ai(null));
|
|
2710
|
+
if (w = ai(null), q(t, "tagNameCheck") && ft(t.tagNameCheck) && (w.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && ft(t.attributeNameCheck) && (w.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (w.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(w), E && (Ne = !1), Ve && (O = !0), qe && (S = X({}, Li), C = ai(null), qe.html === !0 && (X(S, ji), X(C, Ri)), qe.svg === !0 && (X(S, Mi), X(C, zi), X(C, Vi)), qe.svgFilters === !0 && (X(S, Ni), X(C, zi), X(C, Vi)), qe.mathMl === !0 && (X(S, Fi), X(C, Bi), X(C, Vi))), T.tagCheck = null, T.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? T.tagCheck = e.ADD_TAGS : mi(e.ADD_TAGS) && (S === Oe && (S = Z(S)), X(S, e.ADD_TAGS, P))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? T.attributeCheck = e.ADD_ATTR : mi(e.ADD_ATTR) && (C === ke && (C = Z(C)), X(C, e.ADD_ATTR, P))), q(e, "ADD_FORBID_CONTENTS") && mi(e.ADD_FORBID_CONTENTS) && (Je === Ye && (Je = Z(Je)), X(Je, e.ADD_FORBID_CONTENTS, P)), Ge && (S["#text"] = !0), D && X(S, [
|
|
2718
2711
|
"html",
|
|
2719
2712
|
"head",
|
|
2720
2713
|
"body"
|
|
2721
|
-
]),
|
|
2722
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw
|
|
2723
|
-
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw
|
|
2724
|
-
let t =
|
|
2725
|
-
|
|
2714
|
+
]), S.table && (X(S, ["tbody"]), delete Ae.tbody), e.TRUSTED_TYPES_POLICY) {
|
|
2715
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Ei("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
|
|
2716
|
+
if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Ei("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
|
|
2717
|
+
let t = v;
|
|
2718
|
+
v = e.TRUSTED_TYPES_POLICY;
|
|
2726
2719
|
try {
|
|
2727
|
-
|
|
2720
|
+
y = de("");
|
|
2728
2721
|
} catch (e) {
|
|
2729
|
-
throw
|
|
2730
|
-
}
|
|
2731
|
-
} else e.TRUSTED_TYPES_POLICY === null ? (
|
|
2732
|
-
G && G(e),
|
|
2733
|
-
},
|
|
2734
|
-
...
|
|
2735
|
-
...
|
|
2736
|
-
...
|
|
2737
|
-
]),
|
|
2738
|
-
return t.namespaceURI ===
|
|
2722
|
+
throw v = t, e;
|
|
2723
|
+
}
|
|
2724
|
+
} else e.TRUSTED_TYPES_POLICY === null ? (v = void 0, y = "") : (v === void 0 && (v = fe()), v && typeof y == "string" && (y = de("")));
|
|
2725
|
+
G && G(e), ut = e;
|
|
2726
|
+
}, mt = X({}, [
|
|
2727
|
+
...Mi,
|
|
2728
|
+
...Ni,
|
|
2729
|
+
...Pi
|
|
2730
|
+
]), ht = X({}, [...Fi, ...Ii]), gt = function(e, t, n) {
|
|
2731
|
+
return t.namespaceURI === j ? e === "svg" : t.namespaceURI === $e ? e === "svg" && (n === "annotation-xml" || at[n]) : !!mt[e];
|
|
2732
|
+
}, _t = function(e, t, n) {
|
|
2733
|
+
return t.namespaceURI === j ? e === "math" : t.namespaceURI === et ? e === "math" && st[n] : !!ht[e];
|
|
2739
2734
|
}, vt = function(e, t, n) {
|
|
2740
|
-
return t.namespaceURI ===
|
|
2741
|
-
}, yt = function(e
|
|
2742
|
-
return t.namespaceURI === k && !ct[n] || t.namespaceURI === tt && !st[n] ? !1 : !gt[e] && (lt[e] || !ht[e]);
|
|
2743
|
-
}, bt = function(e) {
|
|
2735
|
+
return t.namespaceURI === et && !st[n] || t.namespaceURI === $e && !at[n] ? !1 : !ht[e] && (ct[e] || !mt[e]);
|
|
2736
|
+
}, yt = function(e) {
|
|
2744
2737
|
let t = re(e);
|
|
2745
2738
|
(!t || !t.tagName) && (t = {
|
|
2746
|
-
namespaceURI:
|
|
2739
|
+
namespaceURI: tt,
|
|
2747
2740
|
tagName: "template"
|
|
2748
2741
|
});
|
|
2749
|
-
let n =
|
|
2750
|
-
return
|
|
2751
|
-
},
|
|
2752
|
-
|
|
2742
|
+
let n = hi(e.tagName), r = hi(t.tagName);
|
|
2743
|
+
return rt[e.namespaceURI] ? e.namespaceURI === et ? gt(n, t, r) : e.namespaceURI === $e ? _t(n, t, r) : e.namespaceURI === j ? vt(n, t, r) : !!(N === "application/xhtml+xml" && rt[e.namespaceURI]) : !1;
|
|
2744
|
+
}, F = function(e) {
|
|
2745
|
+
fi(t.removed, { element: e });
|
|
2753
2746
|
try {
|
|
2754
2747
|
re(e).removeChild(e);
|
|
2755
2748
|
} catch {
|
|
2756
|
-
if (p(e), !re(e)) throw
|
|
2749
|
+
if (p(e), !re(e)) throw Ei("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
|
|
2757
2750
|
}
|
|
2758
|
-
},
|
|
2751
|
+
}, bt = function(e, t, n) {
|
|
2759
2752
|
try {
|
|
2760
2753
|
ee(e, t);
|
|
2761
2754
|
} catch {
|
|
@@ -2763,14 +2756,14 @@ function pa() {
|
|
|
2763
2756
|
e.removeAttribute(n);
|
|
2764
2757
|
} catch {}
|
|
2765
2758
|
}
|
|
2766
|
-
},
|
|
2759
|
+
}, xt = function(e) {
|
|
2767
2760
|
wt(e);
|
|
2768
2761
|
let t = ne(e);
|
|
2769
2762
|
if (t) {
|
|
2770
2763
|
let e = [];
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
}),
|
|
2764
|
+
li(t, (t) => {
|
|
2765
|
+
fi(e, t);
|
|
2766
|
+
}), li(e, (e) => {
|
|
2774
2767
|
try {
|
|
2775
2768
|
p(e);
|
|
2776
2769
|
} catch {}
|
|
@@ -2779,15 +2772,15 @@ function pa() {
|
|
|
2779
2772
|
let n = ae(e);
|
|
2780
2773
|
if (n) for (let t = n.length - 1; t >= 0; --t) {
|
|
2781
2774
|
let r = n[t], i = r && r.name;
|
|
2782
|
-
typeof i == "string" &&
|
|
2775
|
+
typeof i == "string" && bt(e, r, i);
|
|
2783
2776
|
}
|
|
2784
|
-
},
|
|
2777
|
+
}, St = function(e, n, r) {
|
|
2785
2778
|
if (!r) try {
|
|
2786
2779
|
r = n.getAttributeNode(e);
|
|
2787
2780
|
} catch {
|
|
2788
2781
|
r = null;
|
|
2789
2782
|
}
|
|
2790
|
-
|
|
2783
|
+
fi(t.removed, {
|
|
2791
2784
|
attribute: r || null,
|
|
2792
2785
|
from: n
|
|
2793
2786
|
});
|
|
@@ -2799,8 +2792,8 @@ function pa() {
|
|
|
2799
2792
|
} catch {}
|
|
2800
2793
|
}
|
|
2801
2794
|
if (e === "is") {
|
|
2802
|
-
if (
|
|
2803
|
-
|
|
2795
|
+
if (O || Ve) try {
|
|
2796
|
+
F(n);
|
|
2804
2797
|
} catch {}
|
|
2805
2798
|
else try {
|
|
2806
2799
|
n.setAttribute(e, "");
|
|
@@ -2810,31 +2803,31 @@ function pa() {
|
|
|
2810
2803
|
let t = ae(e);
|
|
2811
2804
|
if (t) for (let n = t.length - 1; n >= 0; --n) {
|
|
2812
2805
|
let r = t[n], i = r && r.name;
|
|
2813
|
-
typeof i != "string" ||
|
|
2806
|
+
typeof i != "string" || C[P(i)] || bt(e, r, i);
|
|
2814
2807
|
}
|
|
2815
2808
|
}, wt = function(e) {
|
|
2816
2809
|
let t = [e];
|
|
2817
2810
|
for (; t.length > 0;) {
|
|
2818
2811
|
let e = t.pop();
|
|
2819
|
-
|
|
2812
|
+
g(e) === $.element && Ct(e);
|
|
2820
2813
|
let n = ne(e);
|
|
2821
2814
|
if (n) for (let e = n.length - 1; e >= 0; --e) t.push(n[e]);
|
|
2822
2815
|
}
|
|
2823
2816
|
}, Tt = function(e, t) {
|
|
2824
|
-
return
|
|
2817
|
+
return Ie ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
|
|
2825
2818
|
}, Et = function(e) {
|
|
2826
|
-
if (!
|
|
2819
|
+
if (!Ie) return;
|
|
2827
2820
|
let t = [e];
|
|
2828
2821
|
for (; t.length > 0;) {
|
|
2829
|
-
let e = t.pop(), n =
|
|
2830
|
-
if (n === $.processingInstruction || n === $.comment && J(
|
|
2822
|
+
let e = t.pop(), n = g(e);
|
|
2823
|
+
if (n === $.processingInstruction || n === $.comment && J($i, e.data)) {
|
|
2831
2824
|
try {
|
|
2832
2825
|
p(e);
|
|
2833
2826
|
} catch {}
|
|
2834
2827
|
continue;
|
|
2835
2828
|
}
|
|
2836
2829
|
if (n === $.element) {
|
|
2837
|
-
let t = e, n =
|
|
2830
|
+
let t = e, n = P(_(e));
|
|
2838
2831
|
try {
|
|
2839
2832
|
t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Tt("for", n) && t.removeAttribute("for");
|
|
2840
2833
|
} catch {}
|
|
@@ -2844,40 +2837,40 @@ function pa() {
|
|
|
2844
2837
|
}
|
|
2845
2838
|
}, Dt = function(e) {
|
|
2846
2839
|
let t = null, r = null;
|
|
2847
|
-
if (
|
|
2840
|
+
if (Be) e = "<remove></remove>" + e;
|
|
2848
2841
|
else {
|
|
2849
|
-
let t =
|
|
2842
|
+
let t = _i(e, /^[\r\n\t ]+/);
|
|
2850
2843
|
r = t && t[0];
|
|
2851
2844
|
}
|
|
2852
|
-
|
|
2853
|
-
let i =
|
|
2854
|
-
if (
|
|
2855
|
-
t = new l().parseFromString(i,
|
|
2845
|
+
N === "application/xhtml+xml" && tt === j && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
|
|
2846
|
+
let i = v ? de(e) : e;
|
|
2847
|
+
if (tt === j) try {
|
|
2848
|
+
t = new l().parseFromString(i, N);
|
|
2856
2849
|
} catch {}
|
|
2857
2850
|
if (!t || !t.documentElement) {
|
|
2858
|
-
t =
|
|
2851
|
+
t = me.createDocument(tt, "template", null);
|
|
2859
2852
|
try {
|
|
2860
|
-
t.documentElement.innerHTML =
|
|
2853
|
+
t.documentElement.innerHTML = nt ? y : i;
|
|
2861
2854
|
} catch {}
|
|
2862
2855
|
}
|
|
2863
2856
|
let a = t.body || t.documentElement;
|
|
2864
|
-
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null),
|
|
2857
|
+
return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), tt === j ? _e.call(t, D ? "html" : "body")[0] : D ? t.documentElement : a;
|
|
2865
2858
|
}, Ot = function(e) {
|
|
2866
|
-
let t =
|
|
2867
|
-
return
|
|
2859
|
+
let t = oe ? oe(e) : e.ownerDocument;
|
|
2860
|
+
return he.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
|
|
2868
2861
|
}, kt = function(e) {
|
|
2869
|
-
return e =
|
|
2862
|
+
return e = vi(e, ye, " "), e = vi(e, be, " "), e = vi(e, xe, " "), e;
|
|
2870
2863
|
}, At = function(e) {
|
|
2871
2864
|
e.normalize();
|
|
2872
|
-
let t =
|
|
2865
|
+
let t = oe ? oe(e) : e.ownerDocument, n = he.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
|
|
2873
2866
|
for (; r;) r.data = kt(r.data), r = n.nextNode();
|
|
2874
2867
|
let i = e.querySelectorAll?.call(e, "template");
|
|
2875
|
-
i &&
|
|
2868
|
+
i && li(i, (e) => {
|
|
2876
2869
|
Mt(e.content) && At(e.content);
|
|
2877
2870
|
});
|
|
2878
2871
|
}, jt = function(e) {
|
|
2879
|
-
let t =
|
|
2880
|
-
return typeof t != "string" ||
|
|
2872
|
+
let t = h ? h(e) : null;
|
|
2873
|
+
return typeof t != "string" || P(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ae(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 !== m(e) || e.childNodes !== ne(e);
|
|
2881
2874
|
}, Mt = function(e) {
|
|
2882
2875
|
if (!m || typeof e != "object" || !e) return !1;
|
|
2883
2876
|
try {
|
|
@@ -2894,17 +2887,17 @@ function pa() {
|
|
|
2894
2887
|
}
|
|
2895
2888
|
};
|
|
2896
2889
|
function I(e, n, r) {
|
|
2897
|
-
e.length !== 0 &&
|
|
2898
|
-
e.call(t, n, r,
|
|
2890
|
+
e.length !== 0 && li(e, (e) => {
|
|
2891
|
+
e.call(t, n, r, ut);
|
|
2899
2892
|
});
|
|
2900
2893
|
}
|
|
2901
2894
|
let Pt = function(e, t) {
|
|
2902
|
-
return !!(
|
|
2895
|
+
return !!(Ie && e.hasChildNodes() && !Nt(e.firstElementChild) && J(Qi, e.textContent) && J(Qi, e.innerHTML) || Ie && e.namespaceURI === j && ra[t] && (Nt(e.firstElementChild) || typeof e.textContent == "string" && J(ia[t], e.textContent)) || e.nodeType === $.processingInstruction || Ie && e.nodeType === $.comment && J($i, e.data));
|
|
2903
2896
|
}, Ft = function(e, t) {
|
|
2904
2897
|
return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
|
|
2905
2898
|
}, It = function(e, t, n) {
|
|
2906
|
-
if (!
|
|
2907
|
-
if (
|
|
2899
|
+
if (!Ae[t] && Ht(t) && Ft(w.tagNameCheck, t)) return !1;
|
|
2900
|
+
if (Ge && !Je[t]) {
|
|
2908
2901
|
let t = re(e), r = ne(e);
|
|
2909
2902
|
if (r && t) {
|
|
2910
2903
|
let i = r.length;
|
|
@@ -2914,34 +2907,34 @@ function pa() {
|
|
|
2914
2907
|
}
|
|
2915
2908
|
}
|
|
2916
2909
|
}
|
|
2917
|
-
return
|
|
2910
|
+
return F(e), !0;
|
|
2918
2911
|
}, Lt = function(e, t, n, r) {
|
|
2919
2912
|
return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
|
|
2920
2913
|
}, Rt = function(e, t) {
|
|
2921
|
-
return e === t || re(e) !== null ? !1 : (
|
|
2914
|
+
return e === t || re(e) !== null ? !1 : (Ke && wt(e), !0);
|
|
2922
2915
|
}, zt = function(e, n) {
|
|
2923
|
-
if (I(
|
|
2924
|
-
if (jt(e)) return
|
|
2925
|
-
let r =
|
|
2926
|
-
if (
|
|
2916
|
+
if (I(x.beforeSanitizeElements, e, null), Rt(e, n)) return !0;
|
|
2917
|
+
if (jt(e)) return F(e), !0;
|
|
2918
|
+
let r = P(_(e));
|
|
2919
|
+
if (S = Lt(x.uponSanitizeElement, S, Oe, Re), I(x.uponSanitizeElement, e, {
|
|
2927
2920
|
tagName: r,
|
|
2928
|
-
allowedTags:
|
|
2921
|
+
allowedTags: S
|
|
2929
2922
|
}), Rt(e, n)) return !0;
|
|
2930
|
-
if (Pt(e, r)) return
|
|
2931
|
-
if (
|
|
2923
|
+
if (Pt(e, r)) return F(e), !0;
|
|
2924
|
+
if (Ae[r] || !(T.tagCheck instanceof Function && T.tagCheck(r)) && !S[r]) {
|
|
2932
2925
|
let t = It(e, r, n);
|
|
2933
|
-
return t === !1 && I(
|
|
2926
|
+
return t === !1 && I(x.afterSanitizeElements, e, null), t;
|
|
2934
2927
|
}
|
|
2935
|
-
if (
|
|
2936
|
-
if (
|
|
2928
|
+
if (g(e) === $.element && !yt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(ea, e.innerHTML)) return F(e), !0;
|
|
2929
|
+
if (E && e.nodeType === $.text) {
|
|
2937
2930
|
let n = kt(e.textContent);
|
|
2938
|
-
e.textContent !== n && (
|
|
2931
|
+
e.textContent !== n && (fi(t.removed, { element: e.cloneNode() }), e.textContent = n);
|
|
2939
2932
|
}
|
|
2940
|
-
return I(
|
|
2933
|
+
return I(x.afterSanitizeElements, e, null), !1;
|
|
2941
2934
|
}, Bt = function(e, t, r) {
|
|
2942
|
-
if (
|
|
2943
|
-
let i =
|
|
2944
|
-
return
|
|
2935
|
+
if (je[t] || Tt(t, e) || k && (t === "id" || t === "name") && (r in n || r in dt)) return !1;
|
|
2936
|
+
let i = C[t] || T.attributeCheck instanceof Function && T.attributeCheck(t, e);
|
|
2937
|
+
return Ne && J(Se, t) || Me && J(Ce, t) ? !0 : i ? A[t] || J(De, vi(r, Te, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && yi(r, "data:") === 0 && Xe[e] || Pe && !J(we, vi(r, Te, "")) ? !0 : !r : Ht(e) && Ft(w.tagNameCheck, e) && Ft(w.attributeNameCheck, t, e) || t === "is" && w.allowCustomizedBuiltInElements && Ft(w.tagNameCheck, r);
|
|
2945
2938
|
}, Vt = X({}, [
|
|
2946
2939
|
"annotation-xml",
|
|
2947
2940
|
"color-profile",
|
|
@@ -2952,65 +2945,65 @@ function pa() {
|
|
|
2952
2945
|
"font-face-uri",
|
|
2953
2946
|
"missing-glyph"
|
|
2954
2947
|
]), Ht = function(e) {
|
|
2955
|
-
return !Vt[
|
|
2948
|
+
return !Vt[hi(e)] && J(Ee, e);
|
|
2956
2949
|
}, Ut = function(e, t, n, r) {
|
|
2957
|
-
if (
|
|
2958
|
-
case "TrustedHTML": return
|
|
2959
|
-
case "TrustedScriptURL": return
|
|
2950
|
+
if (v && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
|
|
2951
|
+
case "TrustedHTML": return de(r);
|
|
2952
|
+
case "TrustedScriptURL": return b(r);
|
|
2960
2953
|
}
|
|
2961
2954
|
return r;
|
|
2962
2955
|
}, Wt = function(e, t, n, r) {
|
|
2963
2956
|
try {
|
|
2964
|
-
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !jt(e) || (
|
|
2957
|
+
return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !jt(e) || (F(e), !1);
|
|
2965
2958
|
} catch {
|
|
2966
|
-
return
|
|
2959
|
+
return St(t, e), !1;
|
|
2967
2960
|
}
|
|
2968
2961
|
}, Gt = function(e) {
|
|
2969
|
-
I(
|
|
2962
|
+
I(x.beforeSanitizeAttributes, e, null);
|
|
2970
2963
|
let n = e.attributes;
|
|
2971
2964
|
if (!n || jt(e)) return;
|
|
2972
|
-
|
|
2965
|
+
C = Lt(x.uponSanitizeAttribute, C, ke, ze);
|
|
2973
2966
|
let r = {
|
|
2974
2967
|
attrName: "",
|
|
2975
2968
|
attrValue: "",
|
|
2976
2969
|
keepAttr: !0,
|
|
2977
|
-
allowedAttributes:
|
|
2970
|
+
allowedAttributes: C,
|
|
2978
2971
|
forceKeepAttr: void 0
|
|
2979
|
-
}, i = n.length, a =
|
|
2972
|
+
}, i = n.length, a = P(e.nodeName);
|
|
2980
2973
|
for (; i--;) {
|
|
2981
|
-
let o = n[i], s = o.name, c = o.namespaceURI, l = o.value, u =
|
|
2982
|
-
if (r.attrName = u, r.attrValue = f, r.keepAttr = !0, r.forceKeepAttr = void 0, I(
|
|
2983
|
-
|
|
2974
|
+
let o = n[i], s = o.name, c = o.namespaceURI, l = o.value, u = P(s), d = l, f = s === "value" ? d : bi(d), p = !1;
|
|
2975
|
+
if (r.attrName = u, r.attrValue = f, r.keepAttr = !0, r.forceKeepAttr = void 0, I(x.uponSanitizeAttribute, e, r), f = r.attrValue, Ue && (u === "id" || u === "name") && yi(f, We) !== 0 && (St(s, e, o), f = We + f, p = !0), Ie && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, f)) {
|
|
2976
|
+
St(s, e, o);
|
|
2984
2977
|
continue;
|
|
2985
2978
|
}
|
|
2986
|
-
if (u === "attributename" &&
|
|
2987
|
-
|
|
2979
|
+
if (u === "attributename" && _i(f, "href")) {
|
|
2980
|
+
St(s, e, o);
|
|
2988
2981
|
continue;
|
|
2989
2982
|
}
|
|
2990
2983
|
if (!r.forceKeepAttr) {
|
|
2991
2984
|
if (!r.keepAttr) {
|
|
2992
|
-
|
|
2985
|
+
St(s, e, o);
|
|
2993
2986
|
continue;
|
|
2994
2987
|
}
|
|
2995
|
-
if (!
|
|
2996
|
-
|
|
2988
|
+
if (!Fe && J(ta, f)) {
|
|
2989
|
+
St(s, e, o);
|
|
2997
2990
|
continue;
|
|
2998
2991
|
}
|
|
2999
|
-
if (
|
|
3000
|
-
|
|
2992
|
+
if (E && (f = kt(f)), !Bt(a, u, f)) {
|
|
2993
|
+
St(s, e, o);
|
|
3001
2994
|
continue;
|
|
3002
2995
|
}
|
|
3003
|
-
f = Ut(a, u, c, f), f !== d && Wt(e, s, c, f) && p &&
|
|
2996
|
+
f = Ut(a, u, c, f), f !== d && Wt(e, s, c, f) && p && di(t.removed);
|
|
3004
2997
|
}
|
|
3005
2998
|
}
|
|
3006
|
-
I(
|
|
2999
|
+
I(x.afterSanitizeAttributes, e, null);
|
|
3007
3000
|
}, Kt = function(e) {
|
|
3008
3001
|
let t = null, n = Ot(e);
|
|
3009
|
-
for (I(
|
|
3002
|
+
for (I(x.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (I(x.uponSanitizeShadowNode, t, null), zt(t, e), Gt(t), Mt(t.content) && Kt(t.content), g(t) === $.element) {
|
|
3010
3003
|
let e = ie(t);
|
|
3011
3004
|
Mt(e) && (qt(e), Kt(e));
|
|
3012
3005
|
}
|
|
3013
|
-
I(
|
|
3006
|
+
I(x.afterSanitizeShadowDOM, e, null);
|
|
3014
3007
|
}, qt = function(e) {
|
|
3015
3008
|
let t = [{
|
|
3016
3009
|
node: e,
|
|
@@ -3022,14 +3015,14 @@ function pa() {
|
|
|
3022
3015
|
Kt(e.shadow);
|
|
3023
3016
|
continue;
|
|
3024
3017
|
}
|
|
3025
|
-
let n = e.node, r =
|
|
3018
|
+
let n = e.node, r = g(n) === $.element, i = ne(n);
|
|
3026
3019
|
if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
|
|
3027
3020
|
node: i[e],
|
|
3028
3021
|
shadow: null
|
|
3029
3022
|
});
|
|
3030
3023
|
if (r) {
|
|
3031
|
-
let e =
|
|
3032
|
-
if (typeof e == "string" &&
|
|
3024
|
+
let e = h ? h(n) : null;
|
|
3025
|
+
if (typeof e == "string" && P(e) === "template") {
|
|
3033
3026
|
let e = n.content;
|
|
3034
3027
|
Mt(e) && t.push({
|
|
3035
3028
|
node: e,
|
|
@@ -3051,93 +3044,93 @@ function pa() {
|
|
|
3051
3044
|
};
|
|
3052
3045
|
return t.sanitize = function(e) {
|
|
3053
3046
|
let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
|
|
3054
|
-
if (
|
|
3047
|
+
if (nt = !e, nt && (e = "<!-->"), typeof e != "string" && !Nt(e) && (e = ki(e), typeof e != "string")) throw Ei("dirty is not a string, aborting");
|
|
3055
3048
|
if (!t.isSupported) return e;
|
|
3056
|
-
|
|
3057
|
-
let c =
|
|
3049
|
+
Le ? (S = Re, C = ze) : pt(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (S = Z(S)), x.uponSanitizeAttribute.length > 0 && (C = Z(C)), t.removed = [];
|
|
3050
|
+
let c = Ke && typeof e != "string" && Nt(e);
|
|
3058
3051
|
if (c) {
|
|
3059
3052
|
Et(e);
|
|
3060
|
-
let t =
|
|
3053
|
+
let t = _(e);
|
|
3061
3054
|
if (typeof t == "string") {
|
|
3062
|
-
let n =
|
|
3063
|
-
if (!
|
|
3055
|
+
let n = P(t);
|
|
3056
|
+
if (!S[n] || Ae[n]) throw xt(e), Ei("root node is forbidden and cannot be sanitized in-place");
|
|
3064
3057
|
}
|
|
3065
|
-
if (jt(e)) throw
|
|
3058
|
+
if (jt(e)) throw xt(e), Ei("root node is clobbered and cannot be sanitized in-place");
|
|
3066
3059
|
try {
|
|
3067
3060
|
qt(e);
|
|
3068
3061
|
} catch (t) {
|
|
3069
|
-
throw
|
|
3062
|
+
throw xt(e), t;
|
|
3070
3063
|
}
|
|
3071
3064
|
} else if (Nt(e)) i = Dt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), qt(i);
|
|
3072
3065
|
else {
|
|
3073
|
-
if (!
|
|
3074
|
-
if (i = Dt(e), !i) return
|
|
3066
|
+
if (!O && !E && !D && e.indexOf("<") === -1) return v && He ? de(e) : e;
|
|
3067
|
+
if (i = Dt(e), !i) return O ? null : He ? y : "";
|
|
3075
3068
|
}
|
|
3076
|
-
i &&
|
|
3069
|
+
i && Be && F(i.firstChild);
|
|
3077
3070
|
let l = c ? e : i;
|
|
3078
3071
|
try {
|
|
3079
3072
|
let e = Ot(l);
|
|
3080
3073
|
for (; o = e.nextNode();) zt(o, l), Gt(o), Mt(o.content) && Kt(o.content);
|
|
3081
3074
|
} catch (n) {
|
|
3082
|
-
throw c && (
|
|
3075
|
+
throw c && (xt(e), li(t.removed, (e) => {
|
|
3083
3076
|
e.element && wt(e.element);
|
|
3084
3077
|
})), n;
|
|
3085
3078
|
}
|
|
3086
|
-
if (c) return
|
|
3079
|
+
if (c) return li(t.removed, (e) => {
|
|
3087
3080
|
e.element && wt(e.element);
|
|
3088
|
-
}),
|
|
3089
|
-
if (
|
|
3090
|
-
if (
|
|
3081
|
+
}), E && At(e), e;
|
|
3082
|
+
if (O) {
|
|
3083
|
+
if (E && At(i), Ve) for (s = ge.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
|
|
3091
3084
|
else s = i;
|
|
3092
|
-
return (
|
|
3085
|
+
return (C.shadowroot || C.shadowrootmode) && (s = ve.call(r, s, !0)), s;
|
|
3093
3086
|
}
|
|
3094
|
-
let u =
|
|
3095
|
-
return
|
|
3087
|
+
let u = D ? i.outerHTML : i.innerHTML;
|
|
3088
|
+
return D && S["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(Xi, i.ownerDocument.doctype.name) && (u = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + u), E && (u = kt(u)), v && He ? de(u) : u;
|
|
3096
3089
|
}, t.setConfig = function() {
|
|
3097
3090
|
let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
3098
|
-
|
|
3091
|
+
pt(e), Le = !0, Re = S, ze = C;
|
|
3099
3092
|
}, t.clearConfig = function() {
|
|
3100
|
-
|
|
3093
|
+
ut = null, Le = !1, Re = null, ze = null, v = se, y = "";
|
|
3101
3094
|
}, t.isValidAttribute = function(e, t, n) {
|
|
3102
|
-
|
|
3103
|
-
let r =
|
|
3095
|
+
ut || pt({});
|
|
3096
|
+
let r = P(e), i = P(t);
|
|
3104
3097
|
return Bt(r, i, n);
|
|
3105
3098
|
}, t.addHook = function(e, t) {
|
|
3106
|
-
typeof t == "function" && q(
|
|
3099
|
+
typeof t == "function" && q(x, e) && fi(x[e], t);
|
|
3107
3100
|
}, t.removeHook = function(e, t) {
|
|
3108
|
-
if (q(
|
|
3101
|
+
if (q(x, e)) {
|
|
3109
3102
|
if (t !== void 0) {
|
|
3110
|
-
let n =
|
|
3111
|
-
return n === -1 ? void 0 :
|
|
3103
|
+
let n = ui(x[e], t);
|
|
3104
|
+
return n === -1 ? void 0 : pi(x[e], n, 1)[0];
|
|
3112
3105
|
}
|
|
3113
|
-
return
|
|
3106
|
+
return di(x[e]);
|
|
3114
3107
|
}
|
|
3115
3108
|
}, t.removeHooks = function(e) {
|
|
3116
|
-
q(
|
|
3109
|
+
q(x, e) && (x[e] = []);
|
|
3117
3110
|
}, t.removeAllHooks = function() {
|
|
3118
|
-
|
|
3111
|
+
x = sa();
|
|
3119
3112
|
}, t;
|
|
3120
3113
|
}
|
|
3121
|
-
var
|
|
3114
|
+
var da = ua();
|
|
3122
3115
|
//#endregion
|
|
3123
3116
|
//#region ../../packages/components/src/chat/markdownHtml.ts
|
|
3124
|
-
function
|
|
3117
|
+
function fa(e) {
|
|
3125
3118
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">");
|
|
3126
3119
|
}
|
|
3127
|
-
function
|
|
3120
|
+
function pa(e, t) {
|
|
3128
3121
|
return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
|
|
3129
3122
|
}
|
|
3130
|
-
var
|
|
3123
|
+
var ma = {
|
|
3131
3124
|
ADD_ATTR: ["target"],
|
|
3132
3125
|
ALLOW_UNKNOWN_PROTOCOLS: !0,
|
|
3133
3126
|
FORBID_TAGS: ["style", "form"],
|
|
3134
3127
|
FORBID_ATTR: ["style"]
|
|
3135
3128
|
};
|
|
3136
|
-
function
|
|
3137
|
-
return
|
|
3129
|
+
function ha(e) {
|
|
3130
|
+
return da.sanitize(e, ma);
|
|
3138
3131
|
}
|
|
3139
3132
|
a(), l();
|
|
3140
|
-
var
|
|
3133
|
+
var ga = ["innerHTML"], _a = 100, va = /*#__PURE__*/ ie(/* @__PURE__ */ e({
|
|
3141
3134
|
__name: "PkStreamingMarkdown",
|
|
3142
3135
|
props: {
|
|
3143
3136
|
markdown: {
|
|
@@ -3166,15 +3159,15 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3166
3159
|
}
|
|
3167
3160
|
},
|
|
3168
3161
|
setup(e) {
|
|
3169
|
-
let a = e, { t: l } = f({ useScope: "global" }),
|
|
3162
|
+
let a = e, { t: l } = f({ useScope: "global" }), ie = null;
|
|
3170
3163
|
function ae() {
|
|
3171
|
-
return
|
|
3164
|
+
return ie ||= import("./dist-CsXLeGNF.js"), ie;
|
|
3172
3165
|
}
|
|
3173
3166
|
let m = null;
|
|
3174
|
-
function
|
|
3167
|
+
function h() {
|
|
3175
3168
|
return m ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), m;
|
|
3176
3169
|
}
|
|
3177
|
-
let
|
|
3170
|
+
let g = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, _ = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
|
|
3178
3171
|
W.use({ extensions: [{
|
|
3179
3172
|
name: "inlineKatex",
|
|
3180
3173
|
level: "inline",
|
|
@@ -3183,7 +3176,7 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3183
3176
|
if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
|
|
3184
3177
|
},
|
|
3185
3178
|
tokenizer(e) {
|
|
3186
|
-
let t = e.match(
|
|
3179
|
+
let t = e.match(g);
|
|
3187
3180
|
if (t) return {
|
|
3188
3181
|
type: "inlineKatex",
|
|
3189
3182
|
raw: t[0],
|
|
@@ -3192,13 +3185,13 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3192
3185
|
};
|
|
3193
3186
|
},
|
|
3194
3187
|
renderer(e) {
|
|
3195
|
-
return
|
|
3188
|
+
return pa(e.text, e.displayMode);
|
|
3196
3189
|
}
|
|
3197
3190
|
}, {
|
|
3198
3191
|
name: "blockKatex",
|
|
3199
3192
|
level: "block",
|
|
3200
3193
|
tokenizer(e) {
|
|
3201
|
-
let t = e.match(
|
|
3194
|
+
let t = e.match(_);
|
|
3202
3195
|
if (t) return {
|
|
3203
3196
|
type: "blockKatex",
|
|
3204
3197
|
raw: t[0],
|
|
@@ -3207,7 +3200,7 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3207
3200
|
};
|
|
3208
3201
|
},
|
|
3209
3202
|
renderer(e) {
|
|
3210
|
-
return
|
|
3203
|
+
return pa(e.text, e.displayMode) + "\n";
|
|
3211
3204
|
}
|
|
3212
3205
|
}] }), W.use({ extensions: [{
|
|
3213
3206
|
name: "thinking",
|
|
@@ -3228,30 +3221,21 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3228
3221
|
return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
|
|
3229
3222
|
}
|
|
3230
3223
|
}] });
|
|
3231
|
-
let
|
|
3232
|
-
|
|
3233
|
-
let
|
|
3234
|
-
if (!
|
|
3235
|
-
let
|
|
3236
|
-
return `<a href="${
|
|
3237
|
-
},
|
|
3238
|
-
|
|
3239
|
-
try {
|
|
3240
|
-
let t = e.header.map((e) => _(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
|
|
3241
|
-
let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
|
|
3242
|
-
return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
|
|
3243
|
-
}).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
|
|
3244
|
-
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`;
|
|
3245
|
-
} finally {
|
|
3246
|
-
ue = !1;
|
|
3247
|
-
}
|
|
3224
|
+
let v = new W.Renderer(), y = (e) => e.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<").replace(/>/g, ">"), se = /^(?:javascript|data|vbscript|file):/i;
|
|
3225
|
+
v.link = function({ href: e, title: t, tokens: n }) {
|
|
3226
|
+
let r = this.parser.parseInline(n), i = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
|
|
3227
|
+
if (!i || se.test(i)) return r;
|
|
3228
|
+
let a = t ? ` title="${y(t)}"` : "", o = te(i) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
|
|
3229
|
+
return `<a href="${y(i)}"${a}${o}>${r}</a>`;
|
|
3230
|
+
}, v.table = function(e) {
|
|
3231
|
+
return `<div class="table-wrapper">${W.Renderer.prototype.table.call(this, e)}</div>`;
|
|
3248
3232
|
};
|
|
3249
|
-
let
|
|
3250
|
-
|
|
3251
|
-
function
|
|
3233
|
+
let ce = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
|
|
3234
|
+
v.code = ({ text: e }) => ce.test(e) ? `<pre class="mermaid">${fa(e)}</pre>` : `<pre><code>${fa(e)}</code></pre>`;
|
|
3235
|
+
function le(e) {
|
|
3252
3236
|
return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
|
|
3253
3237
|
}
|
|
3254
|
-
function
|
|
3238
|
+
function ue(e) {
|
|
3255
3239
|
let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
|
|
3256
3240
|
for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
|
|
3257
3241
|
return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
|
|
@@ -3263,23 +3247,23 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3263
3247
|
}
|
|
3264
3248
|
}).replace(/\n{3,}/g, "\n\n");
|
|
3265
3249
|
}
|
|
3266
|
-
let
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
],
|
|
3272
|
-
let e =
|
|
3273
|
-
return
|
|
3250
|
+
let de = [
|
|
3251
|
+
oe,
|
|
3252
|
+
ue,
|
|
3253
|
+
cn,
|
|
3254
|
+
le
|
|
3255
|
+
], b = n("container"), fe = ne(c(a, "markdown"), _a), me = u(() => a.tailLength ? pe(fe.value, a.tailLength) : fe.value), { resolveText: he } = re(), ge = he(me), _e = u(() => {
|
|
3256
|
+
let e = de.reduce((e, t) => t(e), ge.value);
|
|
3257
|
+
return ha(W.parse(e, {
|
|
3274
3258
|
async: !1,
|
|
3275
3259
|
breaks: !0,
|
|
3276
|
-
renderer:
|
|
3260
|
+
renderer: v
|
|
3277
3261
|
}));
|
|
3278
3262
|
});
|
|
3279
|
-
async function
|
|
3263
|
+
async function ve() {
|
|
3280
3264
|
if (a.loading) return;
|
|
3281
3265
|
await i();
|
|
3282
|
-
let e =
|
|
3266
|
+
let e = b.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
|
|
3283
3267
|
if (!e?.length) return;
|
|
3284
3268
|
let { renderMermaidSVG: t, THEMES: n } = await ae(), r = a.isDark ? n["github-dark"] : n["github-light"];
|
|
3285
3269
|
for (let n of Array.from(e)) {
|
|
@@ -3291,19 +3275,19 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3291
3275
|
} catch {}
|
|
3292
3276
|
}
|
|
3293
3277
|
}
|
|
3294
|
-
async function
|
|
3278
|
+
async function x() {
|
|
3295
3279
|
await i();
|
|
3296
|
-
let e =
|
|
3280
|
+
let e = b.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
|
|
3297
3281
|
if (!e?.length) return;
|
|
3298
3282
|
let t = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
|
|
3299
3283
|
for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
|
|
3300
3284
|
}
|
|
3301
|
-
async function
|
|
3285
|
+
async function ye() {
|
|
3302
3286
|
await i();
|
|
3303
|
-
let e =
|
|
3287
|
+
let e = b.value?.querySelectorAll(".katex-pending");
|
|
3304
3288
|
if (!e?.length) return;
|
|
3305
|
-
let t = await
|
|
3306
|
-
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(
|
|
3289
|
+
let t = await h();
|
|
3290
|
+
p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(b.value));
|
|
3307
3291
|
for (let n of Array.from(e)) {
|
|
3308
3292
|
if (!n.isConnected) continue;
|
|
3309
3293
|
let e = n.dataset.katex;
|
|
@@ -3317,9 +3301,9 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3317
3301
|
} catch {}
|
|
3318
3302
|
}
|
|
3319
3303
|
}
|
|
3320
|
-
async function
|
|
3304
|
+
async function be() {
|
|
3321
3305
|
await i();
|
|
3322
|
-
let e =
|
|
3306
|
+
let e = b.value?.querySelectorAll("pre.mermaid[data-rendered]");
|
|
3323
3307
|
if (!e?.length) return;
|
|
3324
3308
|
let { renderMermaidSVG: t, THEMES: n } = await ae(), r = a.isDark ? n["github-dark"] : n["github-light"];
|
|
3325
3309
|
for (let n of Array.from(e)) {
|
|
@@ -3330,7 +3314,7 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3330
3314
|
} catch {}
|
|
3331
3315
|
}
|
|
3332
3316
|
}
|
|
3333
|
-
function
|
|
3317
|
+
function xe(e) {
|
|
3334
3318
|
let t = e.target;
|
|
3335
3319
|
if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
|
|
3336
3320
|
t.dataset.broken = "true";
|
|
@@ -3338,65 +3322,65 @@ var ya = ["innerHTML"], ba = 100, xa = /*#__PURE__*/ ae(/* @__PURE__ */ e({
|
|
|
3338
3322
|
n.className = "markdown-broken-image", n.textContent = t.alt || l("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
|
|
3339
3323
|
}
|
|
3340
3324
|
t(() => {
|
|
3341
|
-
|
|
3325
|
+
b.value?.addEventListener("error", xe, !0);
|
|
3342
3326
|
}), o(() => {
|
|
3343
|
-
|
|
3344
|
-
}), s([
|
|
3345
|
-
let
|
|
3346
|
-
function
|
|
3327
|
+
b.value?.removeEventListener("error", xe, !0);
|
|
3328
|
+
}), s([_e, () => a.loading], ve, { immediate: !0 }), s(() => a.isDark, be), s(_e, x, { immediate: !0 }), s(_e, ye, { immediate: !0 });
|
|
3329
|
+
let Se = 0;
|
|
3330
|
+
function Ce(e, t) {
|
|
3347
3331
|
let n = document.createElement("span");
|
|
3348
3332
|
return n.style.cssText = `animation:ft-${a.animation} ${a.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
|
|
3349
3333
|
let t = n.parentNode;
|
|
3350
3334
|
t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
|
|
3351
3335
|
}, { once: !0 }), n;
|
|
3352
3336
|
}
|
|
3353
|
-
function
|
|
3337
|
+
function we(e, t, n, r) {
|
|
3354
3338
|
let i = r, a = e.split(/(\s+)/);
|
|
3355
3339
|
for (let e of a) if (e) {
|
|
3356
3340
|
if (/^\s+$/.test(e)) {
|
|
3357
3341
|
t.insertBefore(document.createTextNode(e), n);
|
|
3358
3342
|
continue;
|
|
3359
3343
|
}
|
|
3360
|
-
t.insertBefore(
|
|
3344
|
+
t.insertBefore(Ce(e, i * 30), n), i++;
|
|
3361
3345
|
}
|
|
3362
3346
|
return i;
|
|
3363
3347
|
}
|
|
3364
|
-
function
|
|
3348
|
+
function Te(e) {
|
|
3365
3349
|
let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
|
|
3366
3350
|
return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
3367
3351
|
} }), n = [];
|
|
3368
3352
|
for (; t.nextNode();) n.push(t.currentNode);
|
|
3369
3353
|
return n;
|
|
3370
3354
|
}
|
|
3371
|
-
function
|
|
3372
|
-
if (!
|
|
3373
|
-
let e =
|
|
3355
|
+
function Ee() {
|
|
3356
|
+
if (!b.value || !a.loading || !a.animation) return;
|
|
3357
|
+
let e = Te(b.value), t = 0, n = 0;
|
|
3374
3358
|
for (let r of e) {
|
|
3375
3359
|
let e = r.textContent || "", i = t, a = t + e.length;
|
|
3376
|
-
if (t = a, a <=
|
|
3360
|
+
if (t = a, a <= Se) continue;
|
|
3377
3361
|
let o = r.parentNode;
|
|
3378
3362
|
if (!o) continue;
|
|
3379
|
-
if (i >=
|
|
3363
|
+
if (i >= Se) {
|
|
3380
3364
|
let t = r.nextSibling;
|
|
3381
|
-
o.removeChild(r), n =
|
|
3365
|
+
o.removeChild(r), n = we(e, o, t, n);
|
|
3382
3366
|
continue;
|
|
3383
3367
|
}
|
|
3384
|
-
let s =
|
|
3385
|
-
o.removeChild(c), n =
|
|
3368
|
+
let s = Se - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
|
|
3369
|
+
o.removeChild(c), n = we(l, o, u, n);
|
|
3386
3370
|
}
|
|
3387
|
-
|
|
3371
|
+
Se = t;
|
|
3388
3372
|
}
|
|
3389
|
-
return s(
|
|
3390
|
-
await i(),
|
|
3373
|
+
return s(_e, async () => {
|
|
3374
|
+
await i(), Ee();
|
|
3391
3375
|
}, { immediate: !0 }), s(() => a.markdown, (e, t) => {
|
|
3392
|
-
(!e || t && e.length < t.length) && (
|
|
3376
|
+
(!e || t && e.length < t.length) && (Se = 0);
|
|
3393
3377
|
}), (e, t) => (r(), d("div", {
|
|
3394
3378
|
ref: "container",
|
|
3395
|
-
innerHTML:
|
|
3396
|
-
}, null, 8,
|
|
3379
|
+
innerHTML: _e.value
|
|
3380
|
+
}, null, 8, ga));
|
|
3397
3381
|
}
|
|
3398
3382
|
}), [["styles", [".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)}}"]]]);
|
|
3399
3383
|
//#endregion
|
|
3400
|
-
export {
|
|
3384
|
+
export { le as C, g as D, ce as E, _ as O, se as S, y as T, de as _, Te as a, xe as b, Se as c, x as d, T as f, ve as g, C as h, S as i, je as l, we as m, ge as n, De as o, Ae as p, b as r, Ee as s, va as t, ye as u, _e as v, v as w, Ce as x, ue as y };
|
|
3401
3385
|
|
|
3402
|
-
//# sourceMappingURL=PkStreamingMarkdown-
|
|
3386
|
+
//# sourceMappingURL=PkStreamingMarkdown-C1sANAr5.js.map
|