@8wave/ai-elements 0.114.0-beta.8 → 0.114.0

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