@8wave/ai-elements 0.121.0-beta.15 → 0.121.0-beta.17

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 (143) hide show
  1. package/README.md +125 -54
  2. package/dist/_chunks/{Agent-7rbrjWzu.js → Agent-wt8Vi99H.js} +7 -5
  3. package/dist/_chunks/Agent-wt8Vi99H.js.map +1 -0
  4. package/dist/_chunks/{PkStreamingMarkdown-BnClGp-3.js → PkStreamingMarkdown-Br7Z60Vm.js} +787 -777
  5. package/dist/_chunks/PkStreamingMarkdown-Br7Z60Vm.js.map +1 -0
  6. package/dist/_chunks/{PkToolEditSpreadsheet-D4M6BUKx.js → PkToolEditSpreadsheet-Di9czFTy.js} +2 -2
  7. package/dist/_chunks/{PkToolEditSpreadsheet-D4M6BUKx.js.map → PkToolEditSpreadsheet-Di9czFTy.js.map} +1 -1
  8. package/dist/_chunks/{PkToolRequestGeolocation-DmOoFghZ.js → PkToolRequestGeolocation-dUTqHsV-.js} +2 -2
  9. package/dist/_chunks/{PkToolRequestGeolocation-DmOoFghZ.js.map → PkToolRequestGeolocation-dUTqHsV-.js.map} +1 -1
  10. package/dist/_chunks/{PkToolRequestOAuthConnection-DV0sfojC.js → PkToolRequestOAuthConnection-cNDld72U.js} +2 -2
  11. package/dist/_chunks/{PkToolRequestOAuthConnection-DV0sfojC.js.map → PkToolRequestOAuthConnection-cNDld72U.js.map} +1 -1
  12. package/dist/_chunks/{PkToolShowArtifact-V0a8zhdO.js → PkToolShowArtifact-DtstlRsL.js} +2 -2
  13. package/dist/_chunks/{PkToolShowArtifact-V0a8zhdO.js.map → PkToolShowArtifact-DtstlRsL.js.map} +1 -1
  14. package/dist/_chunks/{PkToolShowContactForm-sLhBxf9e.js → PkToolShowContactForm-BKaKlYGJ.js} +2 -2
  15. package/dist/_chunks/{PkToolShowContactForm-sLhBxf9e.js.map → PkToolShowContactForm-BKaKlYGJ.js.map} +1 -1
  16. package/dist/_chunks/{PkToolShowForm-Dl2k9jqk.js → PkToolShowForm-OxANKx0g.js} +3 -3
  17. package/dist/_chunks/{PkToolShowForm-Dl2k9jqk.js.map → PkToolShowForm-OxANKx0g.js.map} +1 -1
  18. package/dist/_chunks/{PkToolShowImageGallery-CTsq_DPb.js → PkToolShowImageGallery-DRePOmUx.js} +2 -2
  19. package/dist/_chunks/{PkToolShowImageGallery-CTsq_DPb.js.map → PkToolShowImageGallery-DRePOmUx.js.map} +1 -1
  20. package/dist/_chunks/{PkToolShowProductList-CpdKWQkP.js → PkToolShowProductList-Y9HR_RJ4.js} +2 -2
  21. package/dist/_chunks/{PkToolShowProductList-CpdKWQkP.js.map → PkToolShowProductList-Y9HR_RJ4.js.map} +1 -1
  22. package/dist/_chunks/{PkToolShowSources-WFm2JF0r.js → PkToolShowSources-BQnaaL2a.js} +3 -3
  23. package/dist/_chunks/{PkToolShowSources-WFm2JF0r.js.map → PkToolShowSources-BQnaaL2a.js.map} +1 -1
  24. package/dist/_chunks/{PkToolShowSuggestedReply-RcL_3RAz.js → PkToolShowSuggestedReply-ghiXQuDz.js} +2 -2
  25. package/dist/_chunks/{PkToolShowSuggestedReply-RcL_3RAz.js.map → PkToolShowSuggestedReply-ghiXQuDz.js.map} +1 -1
  26. package/dist/_chunks/{PkToolShowVideo-Ua5heyl1.js → PkToolShowVideo-BcNWgJD7.js} +2 -2
  27. package/dist/_chunks/{PkToolShowVideo-Ua5heyl1.js.map → PkToolShowVideo-BcNWgJD7.js.map} +1 -1
  28. package/dist/_chunks/{PkToolShowWebPages-STOCnsKm.js → PkToolShowWebPages-Ba6DkV0V.js} +2 -2
  29. package/dist/_chunks/{PkToolShowWebPages-STOCnsKm.js.map → PkToolShowWebPages-Ba6DkV0V.js.map} +1 -1
  30. package/dist/_chunks/{chatImagePolicy-C8X_GMnS.js → chatImagePolicy-P0TZW1on.js} +2 -2
  31. package/dist/_chunks/{chatImagePolicy-C8X_GMnS.js.map → chatImagePolicy-P0TZW1on.js.map} +1 -1
  32. package/dist/_chunks/{markdown-EqEd3eyd.js → markdown-DLplFIBU.js} +2 -2
  33. package/dist/_chunks/{markdown-EqEd3eyd.js.map → markdown-DLplFIBU.js.map} +1 -1
  34. package/dist/ai-elements.es.js +4051 -3492
  35. package/dist/ai-elements.es.js.map +1 -1
  36. package/dist-vue/PkChatbot.js +1 -1
  37. package/dist-vue/PkChatbotEmptyState.js +1 -1
  38. package/dist-vue/PkChatbotInput.js +1 -1
  39. package/dist-vue/PkChatbotMessages.js +1 -1
  40. package/dist-vue/PkChatbotStepPayload.js +1 -1
  41. package/dist-vue/PkChatbotStepToolDetail.js +1 -1
  42. package/dist-vue/PkChatbotSteps.js +1 -1
  43. package/dist-vue/PkChatbotViewChat.js +1 -1
  44. package/dist-vue/PkChatbotViewConversations.js +1 -1
  45. package/dist-vue/PkChatbotViewFiles.js +1 -1
  46. package/dist-vue/PkChatbotViewProfile.js +1 -1
  47. package/dist-vue/_chunks/{Agent-SH2vEFKs.js → Agent-DcoF75y8.js} +7 -5
  48. package/dist-vue/_chunks/Agent-DcoF75y8.js.map +1 -0
  49. package/dist-vue/_chunks/{Document-fmCxsccF.js → Document-C1bD6VNU.js} +2 -2
  50. package/dist-vue/_chunks/{Document-fmCxsccF.js.map → Document-C1bD6VNU.js.map} +1 -1
  51. package/dist-vue/_chunks/{PkChatbot-DlIEIjKJ.js → PkChatbot-wyaH2IgV.js} +9 -9
  52. package/dist-vue/_chunks/PkChatbot-wyaH2IgV.js.map +1 -0
  53. package/dist-vue/_chunks/{PkChatbotEmptyState-Bcozn56E.js → PkChatbotEmptyState-h2qZ0JOD.js} +2 -2
  54. package/dist-vue/_chunks/{PkChatbotEmptyState-Bcozn56E.js.map → PkChatbotEmptyState-h2qZ0JOD.js.map} +1 -1
  55. package/dist-vue/_chunks/{PkChatbotInput-DQVpDLNp.js → PkChatbotInput-C-bMNHC-.js} +87 -80
  56. package/dist-vue/_chunks/PkChatbotInput-C-bMNHC-.js.map +1 -0
  57. package/dist-vue/_chunks/{PkChatbotMessages-BYFozlwC.js → PkChatbotMessages-DU8qnlVX.js} +17 -17
  58. package/dist-vue/_chunks/{PkChatbotMessages-BYFozlwC.js.map → PkChatbotMessages-DU8qnlVX.js.map} +1 -1
  59. package/dist-vue/_chunks/{PkChatbotStepPayload-DjntsSlX.js → PkChatbotStepPayload-BOxfKD1b.js} +2 -2
  60. package/dist-vue/_chunks/{PkChatbotStepPayload-DjntsSlX.js.map → PkChatbotStepPayload-BOxfKD1b.js.map} +1 -1
  61. package/dist-vue/_chunks/{PkChatbotStepToolDetail-If9goNdY.js → PkChatbotStepToolDetail-Df6EOYxj.js} +3 -3
  62. package/dist-vue/_chunks/{PkChatbotStepToolDetail-If9goNdY.js.map → PkChatbotStepToolDetail-Df6EOYxj.js.map} +1 -1
  63. package/dist-vue/_chunks/{PkChatbotSteps-DUFfniZn.js → PkChatbotSteps-DnDtN4Q7.js} +5 -5
  64. package/dist-vue/_chunks/{PkChatbotSteps-DUFfniZn.js.map → PkChatbotSteps-DnDtN4Q7.js.map} +1 -1
  65. package/dist-vue/_chunks/{PkChatbotViewChat-BGoltDr9.js → PkChatbotViewChat-D4iupq1A.js} +7 -7
  66. package/dist-vue/_chunks/{PkChatbotViewChat-BGoltDr9.js.map → PkChatbotViewChat-D4iupq1A.js.map} +1 -1
  67. package/dist-vue/_chunks/{PkChatbotViewConversations-WUpRm6GG.js → PkChatbotViewConversations-dKZScKD9.js} +3 -3
  68. package/dist-vue/_chunks/{PkChatbotViewConversations-WUpRm6GG.js.map → PkChatbotViewConversations-dKZScKD9.js.map} +1 -1
  69. package/dist-vue/_chunks/{PkChatbotViewFiles-CpG_LRg6.js → PkChatbotViewFiles-CQC3rInD.js} +3 -3
  70. package/dist-vue/_chunks/{PkChatbotViewFiles-CpG_LRg6.js.map → PkChatbotViewFiles-CQC3rInD.js.map} +1 -1
  71. package/dist-vue/_chunks/{PkChatbotViewProfile-DetQJa7E.js → PkChatbotViewProfile-CkZyWh4V.js} +2 -2
  72. package/dist-vue/_chunks/{PkChatbotViewProfile-DetQJa7E.js.map → PkChatbotViewProfile-CkZyWh4V.js.map} +1 -1
  73. package/dist-vue/_chunks/{PkStreamingMarkdown-DLKEIMcZ.js → PkStreamingMarkdown-BYV68skc.js} +3 -3
  74. package/dist-vue/_chunks/{PkStreamingMarkdown-DLKEIMcZ.js.map → PkStreamingMarkdown-BYV68skc.js.map} +1 -1
  75. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D2JtjXef.js → PkToolEditSpreadsheet-DQxJQIY0.js} +2 -2
  76. package/dist-vue/_chunks/{PkToolEditSpreadsheet-D2JtjXef.js.map → PkToolEditSpreadsheet-DQxJQIY0.js.map} +1 -1
  77. package/dist-vue/_chunks/{PkToolRequestGeolocation--MTT__Vu.js → PkToolRequestGeolocation-BpjglRbg.js} +2 -2
  78. package/dist-vue/_chunks/{PkToolRequestGeolocation--MTT__Vu.js.map → PkToolRequestGeolocation-BpjglRbg.js.map} +1 -1
  79. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Gb_qfvlN.js → PkToolRequestOAuthConnection-CD3M5DWj.js} +2 -2
  80. package/dist-vue/_chunks/{PkToolRequestOAuthConnection-Gb_qfvlN.js.map → PkToolRequestOAuthConnection-CD3M5DWj.js.map} +1 -1
  81. package/dist-vue/_chunks/{PkToolShowArtifact-BWVntj9H.js → PkToolShowArtifact-Bm5VBF_n.js} +2 -2
  82. package/dist-vue/_chunks/{PkToolShowArtifact-BWVntj9H.js.map → PkToolShowArtifact-Bm5VBF_n.js.map} +1 -1
  83. package/dist-vue/_chunks/{PkToolShowContactForm-BbBt3ha0.js → PkToolShowContactForm-CMQTQsU-.js} +2 -2
  84. package/dist-vue/_chunks/{PkToolShowContactForm-BbBt3ha0.js.map → PkToolShowContactForm-CMQTQsU-.js.map} +1 -1
  85. package/dist-vue/_chunks/{PkToolShowDiagram-CE6KHz1M.js → PkToolShowDiagram-adGuj4AF.js} +2 -2
  86. package/dist-vue/_chunks/{PkToolShowDiagram-CE6KHz1M.js.map → PkToolShowDiagram-adGuj4AF.js.map} +1 -1
  87. package/dist-vue/_chunks/{PkToolShowForm-CNm8HSUW.js → PkToolShowForm-Cx5KdTlZ.js} +4 -4
  88. package/dist-vue/_chunks/{PkToolShowForm-CNm8HSUW.js.map → PkToolShowForm-Cx5KdTlZ.js.map} +1 -1
  89. package/dist-vue/_chunks/{PkToolShowImageGallery-6k3ituoi.js → PkToolShowImageGallery-BtQ0gnGB.js} +2 -2
  90. package/dist-vue/_chunks/{PkToolShowImageGallery-6k3ituoi.js.map → PkToolShowImageGallery-BtQ0gnGB.js.map} +1 -1
  91. package/dist-vue/_chunks/{PkToolShowProductList-Bu-pUg5d.js → PkToolShowProductList-Dvatk6p-.js} +2 -2
  92. package/dist-vue/_chunks/{PkToolShowProductList-Bu-pUg5d.js.map → PkToolShowProductList-Dvatk6p-.js.map} +1 -1
  93. package/dist-vue/_chunks/{PkToolShowSources-DTWNZqWu.js → PkToolShowSources-DKkIYQ9r.js} +3 -3
  94. package/dist-vue/_chunks/{PkToolShowSources-DTWNZqWu.js.map → PkToolShowSources-DKkIYQ9r.js.map} +1 -1
  95. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DSXhqWhx.js → PkToolShowSuggestedReply-BbAfjJP9.js} +2 -2
  96. package/dist-vue/_chunks/{PkToolShowSuggestedReply-DSXhqWhx.js.map → PkToolShowSuggestedReply-BbAfjJP9.js.map} +1 -1
  97. package/dist-vue/_chunks/{PkToolShowVideo-C0ycBiOI.js → PkToolShowVideo-DTNszfdU.js} +2 -2
  98. package/dist-vue/_chunks/{PkToolShowVideo-C0ycBiOI.js.map → PkToolShowVideo-DTNszfdU.js.map} +1 -1
  99. package/dist-vue/_chunks/{PkToolShowWebPages-CWWv1tr5.js → PkToolShowWebPages-euov57FB.js} +2 -2
  100. package/dist-vue/_chunks/{PkToolShowWebPages-CWWv1tr5.js.map → PkToolShowWebPages-euov57FB.js.map} +1 -1
  101. package/dist-vue/_chunks/{createChatbotApiClient-MbfcTdwY.js → createChatbotApiClient-qHjpFqPL.js} +8 -8
  102. package/dist-vue/_chunks/{createChatbotApiClient-MbfcTdwY.js.map → createChatbotApiClient-qHjpFqPL.js.map} +1 -1
  103. package/dist-vue/_chunks/{useChatbotStore-DDSgrRzg.js → useChatbotStore-CBjfSN69.js} +3 -3
  104. package/dist-vue/_chunks/{useChatbotStore-DDSgrRzg.js.map → useChatbotStore-CBjfSN69.js.map} +1 -1
  105. package/dist-vue/_chunks/{utils-B9-Vt10H.js → utils-BCGK2AFl.js} +2 -2
  106. package/dist-vue/_chunks/utils-BCGK2AFl.js.map +1 -0
  107. package/dist-vue/api.js +1 -1
  108. package/dist-vue/apps/web-component/src/components/EmbeddedChatWidget.ce.d.ts +12 -4
  109. package/dist-vue/apps/web-component/src/components/FloatingChatWidget.ce.d.ts +4 -3
  110. package/dist-vue/apps/web-component/src/composables/useChatbotAgent.d.ts +11 -5
  111. package/dist-vue/apps/web-component/src/composables/useChatbotProfileProvider.d.ts +3 -2
  112. package/dist-vue/apps/web-component/src/composables/useCopilotPageCss.d.ts +12 -4
  113. package/dist-vue/apps/web-component/src/composables/usePageModal.d.ts +19 -0
  114. package/dist-vue/apps/web-component/src/lib.d.ts +10 -3
  115. package/dist-vue/apps/web-component/src/pageTools/actions.d.ts +33 -0
  116. package/dist-vue/apps/web-component/src/pageTools/navigation.d.ts +27 -0
  117. package/dist-vue/apps/web-component/src/pageTools/snapshot.d.ts +18 -2
  118. package/dist-vue/apps/web-component/src/utils/emitWidgetEvent.d.ts +8 -0
  119. package/dist-vue/apps/web-component/src/utils/layout.d.ts +3 -3
  120. package/dist-vue/composables.js +41 -19
  121. package/dist-vue/composables.js.map +1 -1
  122. package/dist-vue/index.js +342 -323
  123. package/dist-vue/index.js.map +1 -1
  124. package/dist-vue/locales.js +40 -14
  125. package/dist-vue/packages/components/src/chat/PkAgentSettingsPanel.d.ts +8 -5
  126. package/dist-vue/packages/components/src/chat/PkHostCallConfirmDialog.d.ts +19 -0
  127. package/dist-vue/packages/components/src/chat/utils.d.ts +5 -0
  128. package/dist-vue/packages/composable/src/chatbot/useChatbotStore.d.ts +13 -7
  129. package/dist-vue/packages/models/src/schema/Agent.d.ts +31 -18
  130. package/dist-vue/packages/models/src/schema/Member.d.ts +11 -0
  131. package/dist-vue/packages/models/src/schema/OrganizationExternalAuth.d.ts +8 -2
  132. package/dist-vue/packages/models/src/schema/OrganizationIdentityProvider.d.ts +4 -1
  133. package/dist-vue/packages/models/src/schema/ReasoningChat.d.ts +5 -3
  134. package/dist-vue/packages/models/src/schema/SubAgent.d.ts +5 -3
  135. package/dist-vue/style.css +1 -1
  136. package/package.json +1 -1
  137. package/dist/_chunks/Agent-7rbrjWzu.js.map +0 -1
  138. package/dist/_chunks/PkStreamingMarkdown-BnClGp-3.js.map +0 -1
  139. package/dist-vue/_chunks/Agent-SH2vEFKs.js.map +0 -1
  140. package/dist-vue/_chunks/PkChatbot-DlIEIjKJ.js.map +0 -1
  141. package/dist-vue/_chunks/PkChatbotInput-DQVpDLNp.js.map +0 -1
  142. package/dist-vue/_chunks/utils-B9-Vt10H.js.map +0 -1
  143. package/dist-vue/apps/web-component/src/composables/useCopilotPush.d.ts +0 -25
@@ -1,51 +1,51 @@
1
1
  import { F as e, I as t, P as n, R as r, Y as i, Z as a, at as o, h as s, k as c, w as l, y as u, yt as d } from "./vue.runtime.esm-bundler-BkvITeKg.js";
2
2
  import { r as f } from "./vue-i18n-BoTyYk8j.js";
3
3
  import { n as p, t as ee } from "./cdn-css-JUUNhyQ6.js";
4
- import { N as m, _ as te, f as ne, g as re, t as ie, u as ae } from "./Agent-7rbrjWzu.js";
4
+ import { N as m, _ as h, f as te, g as ne, t as re, u as ie } from "./Agent-wt8Vi99H.js";
5
5
  import "./src-Ra4oUpUU.js";
6
- import { n as h, t as oe } from "./text-BHCGblDQ.js";
7
- import { n as g } from "./url-validation-9DstIfq2.js";
8
- import { b as se } from "./dist---RigjU4.js";
9
- import { n as ce } from "./useShortUrlResolver-BGoPo6JO.js";
10
- import { t as le } from "./_plugin-vue_export-helper-B3ysoDQm.js";
11
- import { n as _ } from "./chatImagePolicy-C8X_GMnS.js";
6
+ import { n as g, t as _ } from "./text-BHCGblDQ.js";
7
+ import { n as v } from "./url-validation-9DstIfq2.js";
8
+ import { b as ae } from "./dist---RigjU4.js";
9
+ import { n as oe } from "./useShortUrlResolver-BGoPo6JO.js";
10
+ import { t as se } from "./_plugin-vue_export-helper-B3ysoDQm.js";
11
+ import { n as y } from "./chatImagePolicy-P0TZW1on.js";
12
12
  //#region ../../packages/utils/src/citations.ts
13
- var v = /[ \t]*\uE200[^\uE201]*\uE201/g, ue = /(?<![ \t])[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, de = /[\uE200-\uE20F]/g;
14
- function fe(e) {
15
- return e && e.replace(v, "").replace(ue, "").replace(de, "");
13
+ var b = /[ \t]*\uE200[^\uE201]*\uE201/g, ce = /(?<![ \t])[ \t]*(?:cite|filecite|videocite|audiocite|imagecite|screenshot)(?:turn\d+[a-z]+\d+)+/gi, le = /[\uE200-\uE20F]/g;
14
+ function ue(e) {
15
+ return e && e.replace(b, "").replace(ce, "").replace(le, "");
16
16
  }
17
17
  //#endregion
18
18
  //#region ../../packages/utils/src/message.ts
19
- function pe(e) {
19
+ function de(e) {
20
20
  return e ? e.type === "text" : !1;
21
21
  }
22
- function y(e) {
22
+ function x(e) {
23
23
  return e ? e.type.startsWith("tool-") : !1;
24
24
  }
25
- function me(e) {
26
- return y(e) ? e.type.slice(5) : "";
25
+ function fe(e) {
26
+ return x(e) ? e.type.slice(5) : "";
27
27
  }
28
- function b(e) {
28
+ function S(e) {
29
29
  return e ? e.type === "file" : !1;
30
30
  }
31
- function he(e) {
32
- if (!b(e)) return;
31
+ function pe(e) {
32
+ if (!S(e)) return;
33
33
  let t = e.providerMetadata?.["8bot"]?.media;
34
34
  return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
35
35
  }
36
- function ge(e) {
37
- if (!b(e)) return;
36
+ function me(e) {
37
+ if (!S(e)) return;
38
38
  let t = e.providerMetadata?.["8bot"]?.transcript;
39
39
  return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
40
40
  }
41
- function _e(e, t) {
41
+ function he(e, t) {
42
42
  return e.map((e) => {
43
43
  let n = t.filter((t) => t.messageId === e.id);
44
44
  return n.length === 0 ? e : {
45
45
  ...e,
46
46
  parts: e.parts.map((e) => {
47
- let t = n.find(({ storedFileName: t }) => t === he(e)?.storedFileName);
48
- return t && b(e) ? {
47
+ let t = n.find(({ storedFileName: t }) => t === pe(e)?.storedFileName);
48
+ return t && S(e) ? {
49
49
  ...e,
50
50
  providerMetadata: {
51
51
  ...e.providerMetadata,
@@ -59,53 +59,53 @@ function _e(e, t) {
59
59
  };
60
60
  });
61
61
  }
62
- function ve(e) {
62
+ function ge(e) {
63
63
  return e ? e.type === "reasoning" : !1;
64
64
  }
65
- function ye(e) {
66
- return e ? e.parts.some((e) => pe(e)) : !1;
65
+ function _e(e) {
66
+ return e ? e.parts.some((e) => de(e)) : !1;
67
67
  }
68
- function be(e) {
68
+ function ve(e) {
69
69
  if (!e) return;
70
70
  let t = e.parts;
71
- if (Array.isArray(t)) return t.find((e) => pe(e))?.text;
71
+ if (Array.isArray(t)) return t.find((e) => de(e))?.text;
72
72
  }
73
73
  //#endregion
74
74
  //#region ../../packages/components/src/chat/utils.ts
75
- function x(e) {
75
+ function C(e) {
76
76
  let t = [];
77
77
  for (let n of e) {
78
- if (!pe(n)) {
78
+ if (!de(n)) {
79
79
  t.push(n);
80
80
  continue;
81
81
  }
82
82
  let e = t[t.length - 1];
83
- e && pe(e) ? t[t.length - 1] = {
83
+ e && de(e) ? t[t.length - 1] = {
84
84
  ...e,
85
85
  text: e.text + n.text
86
86
  } : t.push(n);
87
87
  }
88
88
  return t;
89
89
  }
90
- var xe = (e) => y(e) && te(me(e));
91
- function Se(e) {
90
+ var ye = (e) => x(e) && h(fe(e));
91
+ function be(e) {
92
92
  let t = /* @__PURE__ */ new Map();
93
- for (let [n, r] of e.entries()) xe(r) && r.state !== "output-error" && !ke(r) && t.set(r.type, n);
94
- return e.filter((e, n) => !(xe(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
93
+ for (let [n, r] of e.entries()) ye(r) && r.state !== "output-error" && !Oe(r) && t.set(r.type, n);
94
+ return e.filter((e, n) => !(ye(e) && e.state === "output-error" && (t.get(e.type) ?? -1) > n));
95
95
  }
96
- var Ce = /* @__PURE__ */ new Set(["tool-editSpreadsheet"]);
97
- function we(e) {
98
- let t = e.filter((e) => Ce.has(e.type));
99
- return t.length > 0 ? [...e.filter((e) => !Ce.has(e.type)), ...t] : e;
96
+ var xe = /* @__PURE__ */ new Set(["tool-editSpreadsheet"]);
97
+ function Se(e) {
98
+ let t = e.filter((e) => xe.has(e.type));
99
+ return t.length > 0 ? [...e.filter((e) => !xe.has(e.type)), ...t] : e;
100
100
  }
101
- function Te(e, t) {
101
+ function Ce(e, t) {
102
102
  let n = e.toolCallId;
103
- return Ce.has(e.type) && n ? `file-${n}` : t;
103
+ return xe.has(e.type) && n ? `file-${n}` : t;
104
104
  }
105
- function S(e) {
105
+ function we(e) {
106
106
  return m(e) ? e : void 0;
107
107
  }
108
- var Ee = {
108
+ var Te = {
109
109
  page_snapshot: {
110
110
  icon: "ri:pages-line",
111
111
  label: "messagePart.pageTool.snapshot"
@@ -126,21 +126,21 @@ var Ee = {
126
126
  icon: "ri:arrow-up-down-line",
127
127
  label: "messagePart.pageTool.scroll"
128
128
  }
129
- }, De = {
129
+ }, Ee = {
130
130
  icon: "ri:survey-line",
131
131
  label: "messagePart.pageTool.form"
132
- }, Oe = (e) => e.toolMetadata?.provider === "page" ? Ee[e.toolName] ?? (e.toolName.startsWith("form_") ? De : void 0) : void 0;
133
- function C(e) {
134
- return S(e)?.toolMetadata?.readOnly === !1;
132
+ }, De = (e) => e.toolMetadata?.provider === "page" ? Te[e.toolName] ?? (e.toolName.startsWith("form_") ? Ee : void 0) : void 0;
133
+ function w(e) {
134
+ return we(e)?.toolMetadata?.readOnly === !1;
135
135
  }
136
- function ke(e) {
136
+ function Oe(e) {
137
137
  return e && "state" in e ? e.state === "streaming" || e.state === "input-streaming" : !1;
138
138
  }
139
- var w = 4e3, Ae = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
140
- function T(e, t) {
139
+ var T = 4e3, ke = /^[ \t]*(?:(?:[-*+]|\d{1,9}[.)])[ \t]+|>[ \t]?)*(`{3,}|~{3,})(.*)$/gm;
140
+ function E(e, t) {
141
141
  if (e.length <= t) return e;
142
142
  let n = e.length - t, r = n + t / 2, i = (e, t) => e !== -1 && e < r ? e + t : void 0, a = i(e.indexOf("\n\n", n), 2) ?? i(e.indexOf("\n", n), 1) ?? n, o;
143
- for (let t of e.matchAll(Ae)) {
143
+ for (let t of e.matchAll(ke)) {
144
144
  if (t.index >= a) break;
145
145
  let [, e, n] = t;
146
146
  if (o) e[0] === o[0] && e.length >= o.length && !n.trim() && (o = void 0);
@@ -151,35 +151,45 @@ function T(e, t) {
151
151
  }
152
152
  return `…\n\n${o ? `${o}\n` : ""}${e.slice(a)}`;
153
153
  }
154
- var je = /* @__PURE__ */ new Set([
154
+ var Ae = /* @__PURE__ */ new Set([
155
155
  "approval-requested",
156
156
  "approval-responded",
157
157
  "output-denied"
158
158
  ]);
159
- function Me(e) {
160
- return y(e) ? je.has(e.state) ? !0 : e.approval != null : !1;
159
+ function je(e) {
160
+ return x(e) ? Ae.has(e.state) ? !0 : e.approval != null : !1;
161
+ }
162
+ var Me = "requestConfirm";
163
+ function Ne(e) {
164
+ return x(e) && e.type === "tool-requestConfirm";
161
165
  }
162
- var Ne = "requestConfirm";
163
166
  function Pe(e) {
164
- return y(e) && e.type === "tool-requestConfirm";
167
+ return je(e) || Ne(e);
165
168
  }
166
169
  function Fe(e) {
167
- return Me(e) || Pe(e);
170
+ if (x(e)) return e.approval?.id;
168
171
  }
169
172
  function Ie(e) {
170
- if (y(e)) return e.approval?.id;
171
- }
172
- function Le(e) {
173
173
  if (e && "state" in e) return e.state;
174
174
  }
175
- function E(e = "000000") {
175
+ function D(e = "000000") {
176
176
  let t = e.replace("#", "");
177
177
  t.length === 3 && (t = t.split("").map((e) => e + e).join(""));
178
178
  let n = parseInt(t.substring(0, 2), 16) / 255, r = parseInt(t.substring(2, 4), 16) / 255, i = parseInt(t.substring(4, 6), 16) / 255, a = (e) => e <= .03928 ? e / 12.92 : ((e + .055) / 1.055) ** 2.4;
179
179
  return .2126 * a(n) + .7152 * a(r) + .0722 * a(i) > .179 ? "black" : "white";
180
180
  }
181
+ function Le(e) {
182
+ let t = e?.trim().replace("#", "") ?? "";
183
+ if (/^[0-9a-f]{3}$/i.test(t) && (t = t.split("").map((e) => e + e).join("")), !/^[0-9a-f]{6}$/i.test(t)) return !1;
184
+ let n = [
185
+ 0,
186
+ 2,
187
+ 4
188
+ ].map((e) => parseInt(t.substring(e, e + 2), 16));
189
+ return Math.max(...n) - Math.min(...n) < 32;
190
+ }
181
191
  function Re(e, t) {
182
- return e === "white" || e === "black" ? e : E(t);
192
+ return e === "white" || e === "black" ? e : D(t);
183
193
  }
184
194
  function ze(e, t) {
185
195
  if (e) return {
@@ -242,7 +252,7 @@ function Ge(e, t) {
242
252
  for (let [e, n] of Object.entries(t)) n !== void 0 && r(e, n);
243
253
  return n;
244
254
  }
245
- var Ke = re.map((e) => `tool-${e}`), qe = /* @__PURE__ */ new Set([
255
+ var Ke = ne.map((e) => `tool-${e}`), qe = /* @__PURE__ */ new Set([
246
256
  "tool-searchInKnowledgeBase",
247
257
  "tool-retrieveRevisedAnswers",
248
258
  "tool-expandChunkContext",
@@ -254,16 +264,16 @@ var Ke = re.map((e) => `tool-${e}`), qe = /* @__PURE__ */ new Set([
254
264
  ...Ke
255
265
  ]);
256
266
  function Je(e) {
257
- return y(e) && qe.has(e.type);
267
+ return x(e) && qe.has(e.type);
258
268
  }
259
- var Ye = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, D = (e, ...t) => {
269
+ var Ye = (e) => e && typeof e == "object" && !Array.isArray(e) ? e : void 0, O = (e, ...t) => {
260
270
  for (let n of t) {
261
271
  let t = e?.[n];
262
272
  if (typeof t == "string" && t.trim()) return t;
263
273
  }
264
274
  };
265
275
  function Xe(e) {
266
- if (!y(e)) return;
276
+ if (!x(e)) return;
267
277
  let t = Ye("input" in e ? e.input : void 0), n = Ye("output" in e ? e.output : void 0);
268
278
  if (e.type === "tool-searchInKnowledgeBase" || Ke.includes(e.type)) {
269
279
  let e = t?.queries;
@@ -271,40 +281,40 @@ function Xe(e) {
271
281
  let t = e.filter((e) => typeof e == "string" && !!e.trim());
272
282
  return t.length ? t.join(" · ") : void 0;
273
283
  }
274
- return D(t, "query", "objective");
284
+ return O(t, "query", "objective");
275
285
  }
276
- if (e.type === "tool-retrieveRevisedAnswers") return D(t, "query");
277
- if (e.type === "tool-getWeather") return D(n, "location") ?? D(t, "locationName");
278
- if (e.type === "tool-geocode") return D(t, "locationName");
279
- if (e.type === "tool-expandChunkContext") return D(n, "documentName");
280
- if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment") return D(n, "name");
286
+ if (e.type === "tool-retrieveRevisedAnswers") return O(t, "query");
287
+ if (e.type === "tool-getWeather") return O(n, "location") ?? O(t, "locationName");
288
+ if (e.type === "tool-geocode") return O(t, "locationName");
289
+ if (e.type === "tool-expandChunkContext") return O(n, "documentName");
290
+ if (e.type === "tool-readDocumentFile" || e.type === "tool-readChatAttachment") return O(n, "name");
281
291
  if (e.type === "tool-readSpreadsheet") {
282
- let e = D(t, "sheet"), n = D(t, "range");
292
+ let e = O(t, "sheet"), n = O(t, "range");
283
293
  return e && n ? `${e}!${n}` : e;
284
294
  }
285
- if (e.type === "tool-editSpreadsheet") return D(n, "filename");
286
- if (e.type === "tool-querySpreadsheet") return D(n, "file");
287
- if (e.type === "tool-recallUserMemory") return D(t, "query");
288
- if (e.type === "tool-saveUserMemory") return D(t, "content", "query");
295
+ if (e.type === "tool-editSpreadsheet") return O(n, "filename");
296
+ if (e.type === "tool-querySpreadsheet") return O(n, "file");
297
+ if (e.type === "tool-recallUserMemory") return O(t, "query");
298
+ if (e.type === "tool-saveUserMemory") return O(t, "content", "query");
289
299
  }
290
300
  function Ze(e) {
291
- let t = S(e);
292
- if (t) return Oe(t)?.icon ?? "ri:apps-line";
293
- if (y(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-scheduleWakeup" ? "ri:alarm-line" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-readEarlierMessages" ? "ri:history-line" : e.type === "tool-readChatAttachment" ? "ri:attachment-line" : e.type === "tool-enableTools" ? "ri:toggle-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-requestAccountLink" ? "ri:link" : e.type === "tool-unlinkAccount" ? "ri:link-unlink" : Ke.includes(e.type) ? "ri:global-line" : "ri:tools-line";
294
- if (ve(e)) return "ri:lightbulb-line";
295
- if (pe(e)) return "ri:double-quotes-r";
301
+ let t = we(e);
302
+ if (t) return De(t)?.icon ?? "ri:apps-line";
303
+ if (x(e)) return e.type.includes("tool-subagent") ? "ri:robot-2-line" : e.type === "tool-runWorker" ? "ri:flow-chart" : e.type === "tool-scheduleWakeup" ? "ri:alarm-line" : e.type === "tool-fetchTeamsChannelHistory" ? "ri:chat-history-line" : e.type === "tool-readEarlierMessages" ? "ri:history-line" : e.type === "tool-readChatAttachment" ? "ri:attachment-line" : e.type === "tool-enableTools" ? "ri:toggle-line" : e.type.includes("tool-mcp") ? "mcp" : e.type === "tool-retrieveRevisedAnswers" ? "ri:file-edit-line" : e.type === "tool-searchInKnowledgeBase" ? "ri:search-line" : e.type === "tool-expandChunkContext" ? "ri:file-search-line" : e.type === "tool-readDocumentFile" ? "ri:file-text-line" : e.type === "tool-readSpreadsheet" ? "ri:table-line" : e.type === "tool-editSpreadsheet" ? "ri:file-excel-2-line" : e.type === "tool-querySpreadsheet" ? "ri:database-2-line" : e.type === "tool-geocode" ? "ri:map-2-line" : e.type === "tool-getWeather" ? "ri:sun-cloudy-line" : e.type === "tool-recallUserMemory" ? "ri:brain-line" : e.type === "tool-saveUserMemory" ? "ri:save-3-line" : e.type === "tool-showWeather" ? "ri:sun-line" : e.type === "tool-showDiagram" ? "ri:flow-chart" : e.type === "tool-showSources" ? "ri:book-2-line" : e.type === "tool-showForm" ? "ri:survey-line" : e.type === "tool-showMultipleChoice" ? "ri:checkbox-multiple-line" : e.type === "tool-showArtifact" ? "ri:file-code-line" : e.type === "tool-showEmail" ? "ri:mail-line" : e.type === "tool-showMessage" ? "ri:chat-1-line" : e.type === "tool-showWebPages" ? "ri:pages-line" : e.type === "tool-showProductList" ? "ri:shopping-bag-line" : e.type === "tool-showContactForm" ? "ri:send-plane-2-line" : e.type === "tool-showCalendarEvent" ? "ri:calendar-event-line" : e.type === "tool-showComparison" ? "ri:scales-line" : e.type === "tool-showLocation" ? "ri:map-pin-line" : e.type === "tool-showQrCode" ? "ri:qr-code-line" : e.type === "tool-showImageGallery" ? "ri:image-line" : e.type === "tool-showVideo" ? "ri:film-line" : e.type === "tool-showSuggestedReply" ? "ri:corner-down-right-line" : e.type === "tool-requestGeolocation" ? "ri:map-pin-user-line" : e.type === "tool-disconnectOAuthConnection" ? "ri:link-unlink" : e.type === "tool-requestAccountLink" ? "ri:link" : e.type === "tool-unlinkAccount" ? "ri:link-unlink" : Ke.includes(e.type) ? "ri:global-line" : "ri:tools-line";
304
+ if (ge(e)) return "ri:lightbulb-line";
305
+ if (de(e)) return "ri:double-quotes-r";
296
306
  }
297
307
  var Qe = [
308
+ re,
298
309
  ie,
299
- ae,
300
- ne
310
+ te
301
311
  ];
302
- function O(e, { t, te: n }) {
312
+ function $e(e, { t, te: n }) {
303
313
  if (n(`agent.tool.${e}`)) return t(`agent.tool.${e}`);
304
314
  let r = Qe.find((t) => e.startsWith(t)), i = r ? e.slice(r.length) : e;
305
- return oe(h(i).trim().toLowerCase());
315
+ return _(g(i).trim().toLowerCase());
306
316
  }
307
- var $e = {
317
+ var et = {
308
318
  custom: (e) => e("messagePart.type.custom"),
309
319
  data: (e) => e("messagePart.type.data"),
310
320
  file: (e) => e("messagePart.type.file"),
@@ -314,13 +324,13 @@ var $e = {
314
324
  "step-start": (e) => e("messagePart.type.stepStart"),
315
325
  text: (e) => e("messagePart.type.text")
316
326
  };
317
- function et(e, t) {
318
- if (y(e)) return O(me(e), t);
319
- if (e.type === "dynamic-tool") return O(e.toolName, t);
320
- let n = $e[e.type.startsWith("data-") ? "data" : e.type];
321
- return n ? n(t.t) : oe(h(e.type));
322
- }
323
327
  function tt(e, t) {
328
+ if (x(e)) return $e(fe(e), t);
329
+ if (e.type === "dynamic-tool") return $e(e.toolName, t);
330
+ let n = et[e.type.startsWith("data-") ? "data" : e.type];
331
+ return n ? n(t.t) : _(g(e.type));
332
+ }
333
+ function nt(e, t) {
324
334
  if (!e) return e;
325
335
  let n = {
326
336
  Intent: t("conversationSummary.intent"),
@@ -330,42 +340,42 @@ function tt(e, t) {
330
340
  };
331
341
  return e.replace(/\*\*(Intent|Topics covered|Key facts|Open questions)(:?)\*\*/g, (e, t, r) => `**${n[t]}${r}**`);
332
342
  }
333
- function nt(e, t) {
334
- let n = S(t);
343
+ function rt(e, t) {
344
+ let n = we(t);
335
345
  if (n) {
336
- let t = Oe(n);
346
+ let t = De(n);
337
347
  return t ? e(t.label) : n.title || n.toolName;
338
348
  }
339
- return y(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-scheduleWakeup" ? e("messagePart.scheduleWakeup") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-readEarlierMessages" ? e("messagePart.readEarlierMessages") : t.type === "tool-readChatAttachment" ? e("messagePart.readChatAttachment") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : t.type === "tool-requestAccountLink" ? e("messagePart.requestAccountLink") : t.type === "tool-unlinkAccount" ? e("messagePart.unlinkAccount") : Ke.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : ve(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
349
+ return x(t) ? t.type.includes("tool-subagent") ? e("messagePart.runSubagent") : t.type === "tool-runWorker" ? e("messagePart.runWorker") : t.type === "tool-scheduleWakeup" ? e("messagePart.scheduleWakeup") : t.type === "tool-fetchTeamsChannelHistory" ? e("messagePart.fetchTeamsChannelHistory") : t.type === "tool-readEarlierMessages" ? e("messagePart.readEarlierMessages") : t.type === "tool-readChatAttachment" ? e("messagePart.readChatAttachment") : t.type === "tool-enableTools" ? e("messagePart.enableTools") : t.type === "tool-retrieveRevisedAnswers" ? e("messagePart.revisedAnswers") : t.type === "tool-searchInKnowledgeBase" ? e("messagePart.searchingDocuments") : t.type === "tool-expandChunkContext" ? e("messagePart.expandChunkContext") : t.type === "tool-readDocumentFile" ? e("messagePart.readDocumentFile") : t.type === "tool-readSpreadsheet" ? e("messagePart.readSpreadsheet") : t.type === "tool-editSpreadsheet" ? e("messagePart.editSpreadsheet") : t.type === "tool-querySpreadsheet" ? e("messagePart.querySpreadsheet") : t.type === "tool-geocode" ? e("messagePart.geocode") : t.type === "tool-getWeather" ? e("messagePart.getWeather") : t.type === "tool-recallUserMemory" ? e("messagePart.recallUserMemory") : t.type === "tool-saveUserMemory" ? e("messagePart.saveUserMemory") : t.type === "tool-showWeather" ? e("messagePart.showWeather") : t.type === "tool-showForm" ? e("messagePart.showForm") : t.type === "tool-showDiagram" ? e("messagePart.showDiagram") : t.type === "tool-showSources" ? e("messagePart.showSources") : t.type === "tool-showMultipleChoice" ? e("messagePart.showMultipleChoice") : t.type === "tool-showArtifact" ? e("messagePart.showArtifact") : t.type === "tool-showEmail" ? e("messagePart.showEmail") : t.type === "tool-showMessage" ? e("messagePart.showMessage") : t.type === "tool-showWebPages" ? e("messagePart.showWebPages") : t.type === "tool-showProducts" ? e("messagePart.showProducts") : t.type === "tool-showContactForm" ? e("messagePart.showContactForm") : t.type === "tool-showCalendarEvent" ? e("messagePart.showCalendarEvent") : t.type === "tool-showComparison" ? e("messagePart.showComparison") : t.type === "tool-showLocation" ? e("messagePart.showLocation") : t.type === "tool-showQrCode" ? e("messagePart.showQrCode") : t.type === "tool-showImageGallery" ? e("messagePart.showImageGallery") : t.type === "tool-showVideo" ? e("messagePart.showVideo") : t.type === "tool-showSuggestedReply" ? e("messagePart.showSuggestedReply") : t.type === "tool-requestGeolocation" ? e("messagePart.requestGeolocation") : t.type === "tool-disconnectOAuthConnection" ? e("messagePart.disconnectOAuthConnection") : t.type === "tool-requestAccountLink" ? e("messagePart.requestAccountLink") : t.type === "tool-unlinkAccount" ? e("messagePart.unlinkAccount") : Ke.includes(t.type) ? e("messagePart.webSearch") : e("messagePart.tool") : ge(t) ? e("messagePart.reasoning") : e("messagePart.streaming");
340
350
  }
341
351
  //#endregion
342
352
  //#region ../../node_modules/.pnpm/remend@1.4.0/node_modules/remend/dist/index.js
343
- var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwnPropertyDescriptors, k = Object.getOwnPropertySymbols, ot = Object.prototype.hasOwnProperty, st = Object.prototype.propertyIsEnumerable, ct = (e, t, n) => t in e ? rt(e, t, {
353
+ var it = Object.defineProperty, at = Object.defineProperties, k = Object.getOwnPropertyDescriptors, ot = Object.getOwnPropertySymbols, st = Object.prototype.hasOwnProperty, ct = Object.prototype.propertyIsEnumerable, lt = (e, t, n) => t in e ? it(e, t, {
344
354
  enumerable: !0,
345
355
  configurable: !0,
346
356
  writable: !0,
347
357
  value: n
348
- }) : e[t] = n, lt = (e, t) => {
349
- for (var n in t ||= {}) ot.call(t, n) && ct(e, n, t[n]);
350
- if (k) for (var n of k(t)) st.call(t, n) && ct(e, n, t[n]);
358
+ }) : e[t] = n, ut = (e, t) => {
359
+ for (var n in t ||= {}) st.call(t, n) && lt(e, n, t[n]);
360
+ if (ot) for (var n of ot(t)) ct.call(t, n) && lt(e, n, t[n]);
351
361
  return e;
352
- }, ut = (e, t) => it(e, at(t)), A = {
362
+ }, dt = (e, t) => at(e, k(t)), A = {
353
363
  PROSE: 0,
354
364
  FENCE_MARKER: 1,
355
365
  FENCE_INFO: 2,
356
366
  FENCE_BODY: 3,
357
367
  CODE_SPAN: 4,
358
368
  CODE_SPAN_OPEN: 5
359
- }, dt = /^(`{3,}|~{3,})(.*)$/, ft = (e) => e !== void 0 && e >= "0" && e <= "9", pt = (e, t) => {
369
+ }, ft = /^(`{3,}|~{3,})(.*)$/, pt = (e) => e !== void 0 && e >= "0" && e <= "9", mt = (e, t) => {
360
370
  let n = t;
361
371
  if (e[n] === "-" || e[n] === "*" || e[n] === "+") n += 1;
362
372
  else {
363
- for (; ft(e[n]) && n - t < 9;) n += 1;
373
+ for (; pt(e[n]) && n - t < 9;) n += 1;
364
374
  if (n === t || e[n] !== "." && e[n] !== ")") return -1;
365
375
  n += 1;
366
376
  }
367
377
  return e[n] === " " ? n + 1 : -1;
368
- }, mt = (e, t, n) => {
378
+ }, ht = (e, t, n) => {
369
379
  let r = 0, i = t, a = !1, o = t;
370
380
  for (;;) {
371
381
  for (; o < n && e[o] === " ";) o += 1;
@@ -373,7 +383,7 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
373
383
  r += 1, o += e[o + 1] === " " ? 2 : 1, i = o, a = !1;
374
384
  continue;
375
385
  }
376
- let t = o < n ? pt(e, o) : -1;
386
+ let t = o < n ? mt(e, o) : -1;
377
387
  if (t === -1) return {
378
388
  contentStart: o,
379
389
  listIndent: a ? o - i : 0,
@@ -381,7 +391,7 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
381
391
  };
382
392
  o = t, a = !0;
383
393
  }
384
- }, ht = (e, t, n, r) => {
394
+ }, j = (e, t, n, r) => {
385
395
  let i = t;
386
396
  for (let t = 0; t < r; t += 1) {
387
397
  for (; i < n && e[i] === " ";) i += 1;
@@ -389,10 +399,10 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
389
399
  i += 1, e[i] === " " && (i += 1);
390
400
  }
391
401
  return i;
392
- }, j = (e, t, n, r, i) => {
402
+ }, gt = (e, t, n, r, i) => {
393
403
  let a = t + r;
394
404
  e.fill(A.FENCE_MARKER, a, a + i), e.fill(A.FENCE_INFO, a + i, Math.min(n + 1, e.length));
395
- }, gt = (e, t, n, r) => {
405
+ }, _t = (e, t, n, r) => {
396
406
  let i = t;
397
407
  for (; i < n && e[i] === " ";) i += 1;
398
408
  let a = 0;
@@ -403,40 +413,40 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
403
413
  i += 1;
404
414
  }
405
415
  return !0;
406
- }, _t = (e, t, n, r) => {
407
- let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = mt(e, n, i), o = e.slice(a.contentStart, i).match(dt);
416
+ }, vt = (e, t, n, r) => {
417
+ let i = r > n && e[r - 1] === "\r" ? r - 1 : r, a = ht(e, n, i), o = e.slice(a.contentStart, i).match(ft);
408
418
  if (!o) return null;
409
419
  let [, s, c] = o, l = s[0];
410
- return l === "`" && c.includes("`") ? null : (j(t, n, r, a.contentStart - n, s.length), {
420
+ return l === "`" && c.includes("`") ? null : (gt(t, n, r, a.contentStart - n, s.length), {
411
421
  char: l,
412
422
  length: s.length,
413
423
  listIndent: a.listIndent,
414
424
  quoteDepth: a.quoteDepth
415
425
  });
416
- }, vt = (e, t, n, r) => {
417
- let i = ht(e, t, n, r.quoteDepth);
426
+ }, yt = (e, t, n, r) => {
427
+ let i = j(e, t, n, r.quoteDepth);
418
428
  if (i === -1 || r.listIndent === 0) return i;
419
429
  let a = i;
420
430
  for (; a < n && e[a] === " ";) a += 1;
421
431
  return a === n || e[a] === "\r" && a + 1 === n || a - i >= r.listIndent ? i : -1;
422
- }, yt = (e, t) => {
432
+ }, bt = (e, t) => {
423
433
  let n = e.length, r = null, i = 0;
424
434
  for (; i < n;) {
425
435
  let a = e.indexOf("\n", i);
426
436
  a === -1 && (a = n);
427
- let o = r ? vt(e, i, a, r) : -1;
428
- r && o === -1 && (r = null), r ? gt(e, o, a, r) ? (t.fill(A.FENCE_MARKER, i, a), r = null) : t.fill(A.FENCE_BODY, i, Math.min(a + 1, n)) : r = _t(e, t, i, a), i = a + 1;
437
+ let o = r ? yt(e, i, a, r) : -1;
438
+ r && o === -1 && (r = null), r ? _t(e, o, a, r) ? (t.fill(A.FENCE_MARKER, i, a), r = null) : t.fill(A.FENCE_BODY, i, Math.min(a + 1, n)) : r = vt(e, t, i, a), i = a + 1;
429
439
  }
430
440
  return r;
431
- }, bt = (e, t) => {
441
+ }, xt = (e, t) => {
432
442
  let n = t + 1;
433
443
  for (; n < e.length && e[n] === "`";) n += 1;
434
444
  return n;
435
- }, xt = (e, t) => {
445
+ }, St = (e, t) => {
436
446
  let n = t + 1;
437
447
  for (; n < e.length && (e[n] === " " || e[n] === " " || e[n] === "\r");) n += 1;
438
448
  return n < e.length && e[n] === "\n";
439
- }, St = (e, t, n) => {
449
+ }, Ct = (e, t, n) => {
440
450
  let r = n;
441
451
  for (;;) {
442
452
  let n = e.indexOf("`", r);
@@ -445,12 +455,12 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
445
455
  if (t[n] === A.PROSE && !i) return n;
446
456
  r = n + 1;
447
457
  }
448
- }, Ct = (e, t) => {
458
+ }, wt = (e, t) => {
449
459
  let n = e.length, r = -1, i = 0, a = 0;
450
460
  for (; a < n;) {
451
461
  if (r < 0) {
452
- if (a = St(e, t, a), a === -1) break;
453
- let n = bt(e, a);
462
+ if (a = Ct(e, t, a), a === -1) break;
463
+ let n = xt(e, a);
454
464
  r = a, i = n - a, a = n;
455
465
  continue;
456
466
  }
@@ -458,7 +468,7 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
458
468
  t.fill(A.CODE_SPAN_OPEN, r, a), r = -1, a += 1;
459
469
  continue;
460
470
  }
461
- if (e[a] === "\n" && xt(e, a)) {
471
+ if (e[a] === "\n" && St(e, a)) {
462
472
  r = -1, a += 1;
463
473
  continue;
464
474
  }
@@ -466,76 +476,76 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
466
476
  a += 1;
467
477
  continue;
468
478
  }
469
- let n = bt(e, a);
479
+ let n = xt(e, a);
470
480
  n - a === i && (t.fill(A.CODE_SPAN, r, n), r = -1), a = n;
471
481
  }
472
482
  return r >= 0 ? (t.fill(A.CODE_SPAN_OPEN, r, n), {
473
483
  start: r,
474
484
  runLength: i
475
485
  }) : null;
476
- }, wt = (e) => {
486
+ }, Tt = (e) => {
477
487
  let t = new Uint8Array(e.length);
478
488
  return {
479
489
  text: e,
480
490
  regions: t,
481
- openFence: yt(e, t),
482
- openSpan: Ct(e, t),
491
+ openFence: bt(e, t),
492
+ openSpan: wt(e, t),
483
493
  mathMask: null,
484
494
  linkUrlMask: null,
485
495
  htmlTagMask: null
486
496
  };
487
- }, Tt = null, M = null, N = (e) => {
488
- if (M !== null && e === Tt) return M;
489
- let t = wt(e);
490
- return Tt = e, M = t, t;
491
- }, Et = () => {
492
- Tt = null, M = null;
493
- }, Dt = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== A.PROSE, Ot = (e, t) => e.regions[t] === A.CODE_SPAN, kt = (e, t) => {
497
+ }, M = null, Et = null, N = (e) => {
498
+ if (Et !== null && e === M) return Et;
499
+ let t = Tt(e);
500
+ return M = e, Et = t, t;
501
+ }, Dt = () => {
502
+ M = null, Et = null;
503
+ }, Ot = (e, t) => t >= e.regions.length ? e.openFence !== null || e.openSpan !== null : t < 0 ? !1 : e.regions[t] !== A.PROSE, kt = (e, t) => e.regions[t] === A.CODE_SPAN, At = (e, t) => {
494
504
  let n = N(e), r = t + t, i = 0;
495
505
  for (let t = e.indexOf(r); t !== -1; t = e.indexOf(r, t)) n.regions[t] === A.PROSE ? (i += 1, t += 2) : t += 1;
496
506
  return i;
497
- }, At = /* @__PURE__ */ new Uint8Array(), jt = (e) => e === "inlineLatex" || e === "blockLatex", Mt = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Nt = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", Pt = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Ft = (e, t, n) => {
507
+ }, jt = /* @__PURE__ */ new Uint8Array(), Mt = (e) => e === "inlineLatex" || e === "blockLatex", Nt = (e, t) => t === "[" && e === "none" ? "blockLatex" : t === "]" && e === "blockLatex" ? "none" : t === "(" && e === "none" ? "inlineLatex" : t === ")" && e === "inlineLatex" ? "none" : null, Pt = (e, t) => t ? e === "blockDollar" ? "none" : "blockDollar" : e === "blockDollar" ? e : e === "inlineDollar" ? "none" : "inlineDollar", Ft = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), It = (e, t, n) => {
498
508
  let r = e[t + 1];
499
509
  if (e[t] === "\\") {
500
510
  if (r === "$") return {
501
511
  context: n,
502
512
  length: 2
503
513
  };
504
- let e = Mt(n, r);
514
+ let e = Nt(n, r);
505
515
  return e === null ? null : {
506
516
  context: e,
507
517
  length: 2
508
518
  };
509
519
  }
510
- if (e[t] === "$" && !jt(n)) {
520
+ if (e[t] === "$" && !Mt(n)) {
511
521
  let e = r === "$";
512
522
  return {
513
- context: Nt(n, e),
523
+ context: Pt(n, e),
514
524
  length: e ? 2 : 1
515
525
  };
516
526
  }
517
527
  return null;
518
- }, It = (e) => {
528
+ }, Lt = (e) => {
519
529
  let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = "none", o = 0;
520
530
  for (; o < r;) {
521
531
  i[o] = a === "none" ? 0 : 1;
522
- let e = n[o] === A.PROSE ? Ft(t, o, a) : null;
532
+ let e = n[o] === A.PROSE ? It(t, o, a) : null;
523
533
  e === null ? o += 1 : (a = e.context, e.length === 2 && (i[o + 1] = a === "none" ? 0 : 1), o += e.length);
524
534
  }
525
535
  return i;
526
- }, Lt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = Pt(e.text) ? It(e) : At), e.mathMask[t] === 1), Rt = (e, t, n, r) => {
536
+ }, Rt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.mathMask === null && (e.mathMask = Ft(e.text) ? Lt(e) : jt), e.mathMask[t] === 1), zt = (e, t, n, r) => {
527
537
  let { text: i, regions: a } = e, o = new Uint8Array(n - t), s = 0;
528
538
  for (let e = n - 1; e >= t; --e) i[e] === ")" && a[e] === A.PROSE && (s = 1), o[e - t] = s;
529
539
  let c = !1;
530
540
  for (let e = t; e < n; e += 1) c && o[e - t] === 1 && (r[e] = 1), a[e] === A.PROSE && (i[e] === ")" ? c = !1 : i[e] === "(" && (c = e > 0 && i[e - 1] === "]"));
531
- }, zt = (e) => {
541
+ }, Bt = (e) => {
532
542
  let { text: t } = e, n = t.length, r = new Uint8Array(n), i = 0;
533
543
  for (; i < n;) {
534
544
  let a = t.indexOf("\n", i);
535
- a === -1 && (a = n), Rt(e, i, a, r), i = a + 1;
545
+ a === -1 && (a = n), zt(e, i, a, r), i = a + 1;
536
546
  }
537
547
  return r;
538
- }, Bt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? zt(e) : At), e.linkUrlMask[t] === 1), Vt = (e) => {
548
+ }, Vt = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.linkUrlMask === null && (e.linkUrlMask = e.text.includes("](") ? Bt(e) : jt), e.linkUrlMask[t] === 1), Ht = (e) => {
539
549
  let { text: t, regions: n } = e, r = t.length, i = new Uint8Array(r), a = !1;
540
550
  for (let e = 0; e < r; e += 1) if (t[e] === "\n") a = !1;
541
551
  else if (i[e] = +!!a, n[e] === A.PROSE) {
@@ -546,56 +556,56 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
546
556
  }
547
557
  }
548
558
  return i;
549
- }, Ht = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Vt(e) : At), e.htmlTagMask[t] === 1), P = (e, t) => Dt(N(e), t), F = (e, t) => Ot(N(e), t), Ut = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, Wt = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Ut, (t, n, r, i) => P(e, i) ? t : `${n}\\>${r}`), I = (e, { delimiter: t, markerLength: n, regex: r }) => {
559
+ }, Ut = (e, t) => t < 0 || t >= e.text.length ? !1 : (e.htmlTagMask === null && (e.htmlTagMask = e.text.includes("<") ? Ht(e) : jt), e.htmlTagMask[t] === 1), P = (e, t) => Ot(N(e), t), F = (e, t) => kt(N(e), t), Wt = /^(\s*(?:[-*+]|\d+[.)]) +)>(=?\s*[$]?\d)/gm, I = (e) => !e || typeof e != "string" || !e.includes(">") ? e : e.replace(Wt, (t, n, r, i) => P(e, i) ? t : `${n}\\>${r}`), Gt = (e, { delimiter: t, markerLength: n, regex: r }) => {
550
560
  let i = e.lastIndexOf(t, e.length - 2), a = i === -1 ? e.length - 1 : i;
551
561
  return e.slice(Math.max(0, a - n + 1)).match(r);
552
- }, Gt = {
562
+ }, Kt = {
553
563
  delimiter: "*",
554
564
  markerLength: 2,
555
565
  regex: /(\*\*)([^*]*\*?)$/
556
- }, Kt = {
566
+ }, qt = {
557
567
  delimiter: "_",
558
568
  markerLength: 2,
559
569
  regex: /(__)([^_]*?)$/
560
- }, qt = {
570
+ }, Jt = {
561
571
  delimiter: "*",
562
572
  markerLength: 3,
563
573
  regex: /(\*\*\*)([^*]*?)$/
564
- }, Jt = {
574
+ }, Yt = {
565
575
  delimiter: "*",
566
576
  markerLength: 1,
567
577
  regex: /(\*)([^*]*?)$/
568
- }, Yt = {
578
+ }, Xt = {
569
579
  delimiter: "_",
570
580
  markerLength: 1,
571
581
  regex: /(_)([^_]*?)$/
572
- }, Xt = {
582
+ }, Zt = {
573
583
  delimiter: "~",
574
584
  markerLength: 2,
575
585
  regex: /(~~)([^~]*?)$/
576
- }, Zt = {
586
+ }, Qt = {
577
587
  delimiter: "_",
578
588
  markerLength: 2,
579
589
  regex: /(__)([^_]+)_$/
580
- }, Qt = {
590
+ }, $t = {
581
591
  delimiter: "~",
582
592
  markerLength: 2,
583
593
  regex: /(~~)([^~]+)~$/
584
- }, $t = /^[\s_~*`]*$/, en = /^[\s]*[-*+][\s]+$/, tn = /[\p{L}\p{N}_]/u, nn = /^\*{4,}$/, L = (e) => {
594
+ }, en = /^[\s_~*`]*$/, tn = /^[\s]*[-*+][\s]+$/, nn = /[\p{L}\p{N}_]/u, rn = /^\*{4,}$/, L = (e) => {
585
595
  if (!e) return !1;
586
596
  let t = e.charCodeAt(0);
587
- return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || tn.test(e);
588
- }, rn = (e, t) => {
597
+ return t >= 48 && t <= 57 || t >= 65 && t <= 90 || t >= 97 && t <= 122 || t === 95 || nn.test(e);
598
+ }, an = (e, t) => {
589
599
  let n = 1;
590
600
  for (let r = t - 1; r >= 0; --r) if (e[r] === "]") n += 1;
591
601
  else if (e[r] === "[" && (--n, n === 0)) return r;
592
602
  return -1;
593
- }, an = (e, t) => {
603
+ }, on = (e, t) => {
594
604
  let n = 1;
595
605
  for (let r = t + 1; r < e.length; r += 1) if (e[r] === "[") n += 1;
596
606
  else if (e[r] === "]" && (--n, n === 0)) return r;
597
607
  return -1;
598
- }, on = (e, t) => Lt(N(e), t), sn = (e, t, n) => {
608
+ }, sn = (e, t) => Rt(N(e), t), cn = (e, t, n) => {
599
609
  let r = 0;
600
610
  for (let n = t - 1; n >= 0; --n) if (e[n] === "\n") {
601
611
  r = n + 1;
@@ -613,13 +623,13 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
613
623
  break;
614
624
  }
615
625
  return o >= 3 && !s;
616
- }, cn = (e, t, n, r) => n === "\\" || Lt(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.text.length - 2 ? e.text[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), ln = (e) => e === " " || e === " " || e === "\n", un = (e, t) => !!(e && t && L(e) && L(t)), dn = (e, t, n, r) => {
617
- let i = un(e, t), a = !!t && !ln(t), o = !!e && !ln(e);
626
+ }, ln = (e, t, n, r) => n === "\\" || Rt(e, t) ? !0 : n !== "*" && r === "*" ? (t < e.text.length - 2 ? e.text[t + 2] : "") !== "*" : n === "*" || (!n || n === " " || n === " " || n === "\n") && (!r || r === " " || r === " " || r === "\n"), un = (e) => e === " " || e === " " || e === "\n", dn = (e, t) => !!(e && t && L(e) && L(t)), fn = (e, t, n, r) => {
627
+ let i = dn(e, t), a = !!t && !un(t), o = !!e && !un(e);
618
628
  return i && n % 2 == 0 && !r ? { count: !1 } : o && n % 2 == 1 || a ? {
619
629
  count: !0,
620
630
  inWordAsteriskChain: i
621
631
  } : { count: !1 };
622
- }, fn = (e) => {
632
+ }, pn = (e) => {
623
633
  let t = N(e), n = 0, r = !1, i = e.length;
624
634
  for (let a = 0; a < i; a += 1) {
625
635
  if (e[a] !== "*" || t.regions[a] !== A.PROSE) {
@@ -627,38 +637,38 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
627
637
  continue;
628
638
  }
629
639
  let o = a > 0 ? e[a - 1] : "", s = a < i - 1 ? e[a + 1] : "";
630
- if (cn(t, a, o, s)) continue;
631
- let c = dn(o, s, n, r);
640
+ if (ln(t, a, o, s)) continue;
641
+ let c = fn(o, s, n, r);
632
642
  c.count && (n += 1, r = c.inWordAsteriskChain);
633
643
  }
634
644
  return n;
635
- }, pn = (e, t, n, r) => !!(n === "\\" || Lt(e, t) || Bt(e, t) || Ht(e, t) || n === "_" || r === "_" || n && r && L(n) && L(r)), mn = (e) => {
645
+ }, mn = (e, t, n, r) => !!(n === "\\" || Rt(e, t) || Vt(e, t) || Ut(e, t) || n === "_" || r === "_" || n && r && L(n) && L(r)), hn = (e) => {
636
646
  let t = N(e), n = 0, r = e.length;
637
647
  for (let i = 0; i < r; i += 1) {
638
648
  if (e[i] !== "_" || t.regions[i] !== A.PROSE) continue;
639
649
  let a = i > 0 ? e[i - 1] : "", o = i < r - 1 ? e[i + 1] : "";
640
- pn(t, i, a, o) || (n += 1);
650
+ mn(t, i, a, o) || (n += 1);
641
651
  }
642
652
  return n;
643
- }, hn = (e) => {
653
+ }, gn = (e) => {
644
654
  let t = N(e), n = 0, r = 0;
645
655
  for (let i = 0; i < e.length; i += 1) e[i] === "*" && t.regions[i] === A.PROSE ? r += 1 : (r >= 3 && (n += Math.floor(r / 3)), r = 0);
646
656
  return r >= 3 && (n += Math.floor(r / 3)), n;
647
- }, gn = (e) => kt(e, "*"), _n = (e) => e === "" || e === " " || e === " " || e === "\n", vn = (e, t, n, r, i) => {
648
- if (!(_n(n) && _n(r))) return !1;
657
+ }, _n = (e) => At(e, "*"), vn = (e) => e === "" || e === " " || e === " " || e === "\n", yn = (e, t, n, r, i) => {
658
+ if (!(vn(n) && vn(r))) return !1;
649
659
  if (t > i.lineEnd) {
650
660
  let n = e.indexOf("\n", t);
651
- i.lineEnd = n === -1 ? e.length : n, i.result = sn(e, t, "_");
661
+ i.lineEnd = n === -1 ? e.length : n, i.result = cn(e, t, "_");
652
662
  }
653
663
  return i.result;
654
- }, yn = (e, t, n, r) => {
664
+ }, bn = (e, t, n, r) => {
655
665
  let i = e.text, a = t, o = !1;
656
666
  a > 0 && i[a - 1] === "\\" && (a += 1, o = !0);
657
667
  let s = n - a;
658
668
  if (s < 2) return !1;
659
669
  let c = a > 0 ? i[a - 1] : "", l = o ? "\\" : c, u = n < i.length ? i[n] : "";
660
- return L(l) && L(u) || vn(i, a, l, u, r) || Lt(e, a) || Bt(e, a) || Ht(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
661
- }, bn = (e) => {
670
+ return L(l) && L(u) || yn(i, a, l, u, r) || Rt(e, a) || Vt(e, a) || Ut(e, a) ? !1 : Math.floor(s / 2) % 2 == 1;
671
+ }, xn = (e) => {
662
672
  let t = N(e), n = e.length, r = {
663
673
  lineEnd: -1,
664
674
  result: !1
@@ -670,127 +680,127 @@ var rt = Object.defineProperty, it = Object.defineProperties, at = Object.getOwn
670
680
  }
671
681
  let o = a, s = a + 1;
672
682
  for (; s < n && e[s] === "_" && t.regions[s] === A.PROSE;) s += 1;
673
- a = s, yn(t, o, s, r) && (i = !i);
683
+ a = s, bn(t, o, s, r) && (i = !i);
674
684
  }
675
685
  return i;
676
- }, xn = (e, t, n) => {
677
- if (!t || $t.test(t)) return !0;
686
+ }, Sn = (e, t, n) => {
687
+ if (!t || en.test(t)) return !0;
678
688
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
679
- return en.test(a) && t.includes("\n") ? !0 : sn(e, n, "*");
680
- }, Sn = (e) => {
681
- let t = I(e, Gt);
689
+ return tn.test(a) && t.includes("\n") ? !0 : cn(e, n, "*");
690
+ }, Cn = (e) => {
691
+ let t = Gt(e, Kt);
682
692
  if (!t) return e;
683
693
  let n = t[2], r = e.lastIndexOf(t[1]);
684
- return P(e, r) || F(e, r) || xn(e, n, r) ? e : gn(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
685
- }, Cn = (e, t, n) => {
686
- if (!t || $t.test(t)) return !0;
694
+ return P(e, r) || F(e, r) || Sn(e, n, r) ? e : _n(e) % 2 == 1 ? n.endsWith("*") ? `${e}*` : `${e}**` : e;
695
+ }, wn = (e, t, n) => {
696
+ if (!t || en.test(t)) return !0;
687
697
  let r = e.substring(0, n).lastIndexOf("\n"), i = r === -1 ? 0 : r + 1, a = e.substring(i, n);
688
- return en.test(a) && t.includes("\n") ? !0 : sn(e, n, "_");
689
- }, wn = (e) => {
690
- let t = I(e, Kt);
698
+ return tn.test(a) && t.includes("\n") ? !0 : cn(e, n, "_");
699
+ }, Tn = (e) => {
700
+ let t = Gt(e, qt);
691
701
  if (!t) {
692
- let t = I(e, Zt);
702
+ let t = Gt(e, Qt);
693
703
  if (t) {
694
704
  let n = e.lastIndexOf(t[1]);
695
- if (!(P(e, n) || F(e, n)) && bn(e)) return `${e}_`;
705
+ if (!(P(e, n) || F(e, n)) && xn(e)) return `${e}_`;
696
706
  }
697
707
  return e;
698
708
  }
699
709
  let n = t[2], r = e.lastIndexOf(t[1]);
700
- return P(e, r) || F(e, r) || Cn(e, n, r) ? e : bn(e) ? `${e}__` : e;
701
- }, Tn = (e, t) => {
710
+ return P(e, r) || F(e, r) || wn(e, n, r) ? e : xn(e) ? `${e}__` : e;
711
+ }, En = (e, t) => {
702
712
  let { text: n } = e;
703
- return n[t] === "*" && e.regions[t] === A.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !Lt(e, t);
704
- }, En = (e) => {
713
+ return n[t] === "*" && e.regions[t] === A.PROSE && n[t - 1] !== "*" && n[t + 1] !== "*" && n[t - 1] !== "\\" && !Rt(e, t);
714
+ }, Dn = (e) => {
705
715
  let t = N(e);
706
716
  for (let n = e.indexOf("*"); n !== -1; n = e.indexOf("*", n + 1)) {
707
- if (!Tn(t, n)) continue;
708
- let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || ln(r), o = !i || ln(i);
717
+ if (!En(t, n)) continue;
718
+ let r = n > 0 ? e[n - 1] : "", i = n < e.length - 1 ? e[n + 1] : "", a = !r || un(r), o = !i || un(i);
709
719
  if (!(a && o) && !(r && i && L(r) && L(i)) && !o) return n;
710
720
  }
711
721
  return -1;
712
- }, Dn = (e) => {
713
- if (!I(e, Jt)) return e;
714
- let t = En(e);
722
+ }, On = (e) => {
723
+ if (!Gt(e, Yt)) return e;
724
+ let t = Dn(e);
715
725
  if (t === -1 || P(e, t) || F(e, t)) return e;
716
726
  let n = e.substring(t + 1);
717
- return !n || $t.test(n) ? e : fn(e) % 2 == 1 ? `${e}*` : e;
718
- }, On = (e) => {
727
+ return !n || en.test(n) ? e : pn(e) % 2 == 1 ? `${e}*` : e;
728
+ }, kn = (e) => {
719
729
  let t = N(e);
720
- for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === A.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !Lt(t, n) && !Bt(t, n)) {
730
+ for (let n = e.indexOf("_"); n !== -1; n = e.indexOf("_", n + 1)) if (t.regions[n] === A.PROSE && e[n - 1] !== "_" && e[n + 1] !== "_" && e[n - 1] !== "\\" && !Rt(t, n) && !Vt(t, n)) {
721
731
  let t = n > 0 ? e[n - 1] : "", r = n < e.length - 1 ? e[n + 1] : "";
722
732
  if (t && r && L(t) && L(r)) continue;
723
733
  return n;
724
734
  }
725
735
  return -1;
726
- }, kn = (e) => {
736
+ }, An = (e) => {
727
737
  let t = e.length;
728
738
  for (; t > 0 && e[t - 1] === "\n";) --t;
729
739
  return t < e.length ? `${e.slice(0, t)}_${e.slice(t)}` : `${e}_`;
730
- }, An = (e) => {
740
+ }, jn = (e) => {
731
741
  if (!e.endsWith("**")) return null;
732
742
  let t = e.slice(0, -2);
733
- if (gn(t) % 2 != 1) return null;
734
- let n = t.indexOf("**"), r = On(t);
743
+ if (_n(t) % 2 != 1) return null;
744
+ let n = t.indexOf("**"), r = kn(t);
735
745
  return n !== -1 && r !== -1 && n < r ? `${t}_**` : null;
736
- }, jn = (e) => {
737
- if (!I(e, Yt)) return e;
738
- let t = On(e);
746
+ }, Mn = (e) => {
747
+ if (!Gt(e, Xt)) return e;
748
+ let t = kn(e);
739
749
  if (t === -1) return e;
740
750
  let n = e.substring(t + 1);
741
- if (!n || $t.test(n) || P(e, t) || F(e, t)) return e;
742
- if (mn(e) % 2 == 1) {
743
- let t = An(e);
744
- return t === null ? kn(e) : t;
751
+ if (!n || en.test(n) || P(e, t) || F(e, t)) return e;
752
+ if (hn(e) % 2 == 1) {
753
+ let t = jn(e);
754
+ return t === null ? An(e) : t;
745
755
  }
746
756
  return e;
747
- }, Mn = (e) => {
748
- let t = gn(e), n = fn(e);
757
+ }, Nn = (e) => {
758
+ let t = _n(e), n = pn(e);
749
759
  return t % 2 == 0 && n % 2 == 0;
750
- }, Nn = (e, t, n) => !t || $t.test(t) || P(e, n) || F(e, n) ? !0 : sn(e, n, "*"), Pn = (e) => {
751
- if (nn.test(e)) return e;
752
- let t = I(e, qt);
760
+ }, Pn = (e, t, n) => !t || en.test(t) || P(e, n) || F(e, n) ? !0 : cn(e, n, "*"), Fn = (e) => {
761
+ if (rn.test(e)) return e;
762
+ let t = Gt(e, Jt);
753
763
  if (!t) return e;
754
764
  let n = t[2];
755
- return Nn(e, n, e.lastIndexOf(t[1])) ? e : hn(e) % 2 == 1 ? Mn(e) ? e : `${e}***` : e;
756
- }, Fn = /<[a-zA-Z/][^>]*$/, In = /[a-zA-Z/]/, Ln = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), Rn = (e, t) => {
765
+ return Pn(e, n, e.lastIndexOf(t[1])) ? e : gn(e) % 2 == 1 ? Nn(e) ? e : `${e}***` : e;
766
+ }, In = /<[a-zA-Z/][^>]*$/, Ln = /[a-zA-Z/]/, Rn = (e) => e.includes("$") || e.includes("\\(") || e.includes("\\["), zn = (e, t) => {
757
767
  let n = e[t + 1];
758
- return n !== void 0 && In.test(n);
759
- }, zn = (e) => {
760
- let t = e.match(Fn);
768
+ return n !== void 0 && Ln.test(n);
769
+ }, Bn = (e) => {
770
+ let t = e.match(In);
761
771
  if (!t || t.index === void 0) return e;
762
- let n = Ln(e);
763
- for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && Rn(e, r) && !P(e, r) && !(n && on(e, r))) return e.substring(0, r).trimEnd();
772
+ let n = Rn(e);
773
+ for (let r = t.index; r < e.length; r += 1) if (e[r] === "<" && zn(e, r) && !P(e, r) && !(n && sn(e, r))) return e.substring(0, r).trimEnd();
764
774
  return e;
765
- }, Bn = (e) => {
775
+ }, Vn = (e) => {
766
776
  let t = N(e);
767
777
  if (t.openFence) return e;
768
778
  let n = t.openSpan;
769
779
  if (!n) return e;
770
780
  let r = e.slice(n.start + n.runLength);
771
- if (!r || $t.test(r)) return e;
781
+ if (!r || en.test(r)) return e;
772
782
  let i = 0, a = e.length - 1;
773
783
  for (; a >= 0 && e[a] === "`";) i += 1, --a;
774
784
  return i >= n.runLength ? e : e + "`".repeat(n.runLength - i);
775
- }, Vn = (e) => kt(e, "$"), Hn = (e) => {
785
+ }, Hn = (e) => At(e, "$"), Un = (e) => {
776
786
  let t = N(e), n = 0;
777
787
  for (let r = 0; r < e.length; r += 1) e[r] === "\\" ? r += 1 : t.regions[r] === A.PROSE && e[r] === "$" && (r + 1 < e.length && e[r + 1] === "$" ? r += 1 : n += 1);
778
788
  return n;
779
- }, Un = (e) => {
789
+ }, Wn = (e) => {
780
790
  if (e.endsWith("$") && !e.endsWith("$$")) return `${e}$`;
781
791
  let t = e.indexOf("$$");
782
792
  return t !== -1 && e.indexOf("\n", t) !== -1 && !e.endsWith("\n") ? `${e}
783
793
  $$` : `${e}$$`;
784
- }, Wn = (e) => Vn(e) % 2 == 0 ? e : Un(e), Gn = (e) => Hn(e) % 2 == 1 ? `${e}$` : e, Kn = "streamdown:incomplete-image", qn = (e, t, n) => {
794
+ }, Gn = (e) => Hn(e) % 2 == 0 ? e : Wn(e), Kn = (e) => Un(e) % 2 == 1 ? `${e}$` : e, qn = "streamdown:incomplete-image", Jn = (e, t, n) => {
785
795
  if (e.substring(t + 2).includes(")")) return null;
786
- let r = rn(e, t);
796
+ let r = an(e, t);
787
797
  if (r === -1 || P(e, r)) return null;
788
798
  let i = r > 0 && e[r - 1] === "!", a = i ? r - 1 : r, o = e.substring(0, a), s = e.substring(r + 1, t);
789
- return i ? `${o}![${s}](${Kn})` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
790
- }, Jn = (e, t) => {
799
+ return i ? `${o}![${s}](${qn})` : n === "text-only" ? `${o}${s}` : `${o}[${s}](streamdown:incomplete-link)`;
800
+ }, Yn = (e, t) => {
791
801
  for (let n = 0; n < t; n++) if (e[n] === "[" && !P(e, n)) {
792
802
  if (n > 0 && e[n - 1] === "!") continue;
793
- let t = an(e, n);
803
+ let t = on(e, n);
794
804
  if (t === -1) return n;
795
805
  if (t + 1 < e.length && e[t + 1] === "(") {
796
806
  let r = e.indexOf(")", t + 2);
@@ -798,69 +808,69 @@ $$` : `${e}$$`;
798
808
  }
799
809
  }
800
810
  return t;
801
- }, Yn = (e, t, n) => {
811
+ }, Xn = (e, t, n) => {
802
812
  let r = t > 0 && e[t - 1] === "!", i = r ? t - 1 : t;
803
- if (!e.substring(t + 1).includes("]") || an(e, t) === -1) {
813
+ if (!e.substring(t + 1).includes("]") || on(e, t) === -1) {
804
814
  let a = e.substring(0, i);
805
- if (r) return `${a}![${e.substring(t + 1)}](${Kn})`;
815
+ if (r) return `${a}![${e.substring(t + 1)}](${qn})`;
806
816
  if (n === "text-only") {
807
- let n = Jn(e, t);
817
+ let n = Yn(e, t);
808
818
  return e.substring(0, n) + e.substring(n + 1);
809
819
  }
810
820
  return `${e}](streamdown:incomplete-link)`;
811
821
  }
812
822
  return null;
813
- }, Xn = (e, t) => {
823
+ }, Zn = (e, t) => {
814
824
  let n = e.lastIndexOf("](");
815
825
  if (n !== -1 && !P(e, n)) {
816
- let r = qn(e, n, t);
826
+ let r = Jn(e, n, t);
817
827
  if (r !== null) return r;
818
828
  }
819
829
  for (let n = e.lastIndexOf("["); n !== -1; n = n === 0 ? -1 : e.lastIndexOf("[", n - 1)) if (!P(e, n)) {
820
- let r = Yn(e, n, t);
830
+ let r = Xn(e, n, t);
821
831
  if (r !== null) return r;
822
832
  }
823
833
  return e;
824
- }, Zn = 32, Qn = (e, t = "protocol") => {
834
+ }, Qn = 32, $n = (e, t = "protocol") => {
825
835
  let n = e;
826
- for (let e = 0; e < Zn; e += 1) {
827
- let e = Xn(n, t);
836
+ for (let e = 0; e < Qn; e += 1) {
837
+ let e = Zn(n, t);
828
838
  if (e.length >= n.length) return e;
829
839
  n = e;
830
840
  }
831
841
  return n;
832
- }, $n = /^-{1,2}$/, er = /^[\s]*-{1,2}[\s]+$/, tr = /^={1,2}$/, nr = /^[\s]*={1,2}[\s]+$/, rr = (e) => {
842
+ }, er = /^-{1,2}$/, tr = /^[\s]*-{1,2}[\s]+$/, nr = /^={1,2}$/, rr = /^[\s]*={1,2}[\s]+$/, ir = (e) => {
833
843
  if (!e || typeof e != "string") return e;
834
844
  let t = e.lastIndexOf("\n");
835
845
  if (t === -1) return e;
836
846
  let n = e.substring(t + 1), r = e.substring(0, t), i = n.trim();
837
- if ($n.test(i) && !n.match(er)) {
847
+ if (er.test(i) && !n.match(tr)) {
838
848
  let t = r.split("\n").at(-1);
839
849
  if (t && t.trim().length > 0) return `${e}\u200B`;
840
850
  }
841
- if (tr.test(i) && !n.match(nr)) {
851
+ if (nr.test(i) && !n.match(rr)) {
842
852
  let t = r.split("\n").at(-1);
843
853
  if (t && t.trim().length > 0) return `${e}\u200B`;
844
854
  }
845
855
  return e;
846
- }, ir = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, ar = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(ir, (t, n, r) => P(e, r + n.length) ? t : `${n}\\~`), or = (e) => kt(e, "~"), sr = (e) => {
847
- let t = I(e, Xt);
856
+ }, ar = /([\p{L}\p{N}_])~(?!~)(?=[\p{L}\p{N}_])/gu, or = (e) => !e || typeof e != "string" || !e.includes("~") ? e : e.replace(ar, (t, n, r) => P(e, r + n.length) ? t : `${n}\\~`), sr = (e) => At(e, "~"), cr = (e) => {
857
+ let t = Gt(e, Zt);
848
858
  if (t) {
849
859
  let n = t[2];
850
- if (!n || $t.test(n)) return e;
860
+ if (!n || en.test(n)) return e;
851
861
  let r = e.lastIndexOf(t[1]);
852
862
  if (P(e, r) || F(e, r)) return e;
853
- if (or(e) % 2 == 1) return `${e}~~`;
863
+ if (sr(e) % 2 == 1) return `${e}~~`;
854
864
  } else {
855
- let t = I(e, Qt);
865
+ let t = Gt(e, $t);
856
866
  if (t) {
857
867
  let n = e.lastIndexOf(t[0].slice(0, 2));
858
868
  if (P(e, n) || F(e, n)) return e;
859
- if (or(e) % 2 == 1) return `${e}~`;
869
+ if (sr(e) % 2 == 1) return `${e}~`;
860
870
  }
861
871
  }
862
872
  return e;
863
- }, cr = (e) => e !== !1, lr = (e) => e === !0, R = {
873
+ }, lr = (e) => e !== !1, ur = (e) => e === !0, R = {
864
874
  SINGLE_TILDE: 0,
865
875
  COMPARISON_OPERATORS: 5,
866
876
  HTML_TAGS: 10,
@@ -876,11 +886,11 @@ $$` : `${e}$$`;
876
886
  KATEX: 70,
877
887
  INLINE_KATEX: 75,
878
888
  DEFAULT: 100
879
- }, ur = [
889
+ }, dr = [
880
890
  {
881
891
  handler: {
882
892
  name: "singleTilde",
883
- handle: ar,
893
+ handle: or,
884
894
  priority: R.SINGLE_TILDE
885
895
  },
886
896
  optionKey: "singleTilde"
@@ -888,7 +898,7 @@ $$` : `${e}$$`;
888
898
  {
889
899
  handler: {
890
900
  name: "comparisonOperators",
891
- handle: Wt,
901
+ handle: I,
892
902
  priority: R.COMPARISON_OPERATORS
893
903
  },
894
904
  optionKey: "comparisonOperators"
@@ -896,7 +906,7 @@ $$` : `${e}$$`;
896
906
  {
897
907
  handler: {
898
908
  name: "htmlTags",
899
- handle: zn,
909
+ handle: Bn,
900
910
  priority: R.HTML_TAGS
901
911
  },
902
912
  optionKey: "htmlTags"
@@ -904,7 +914,7 @@ $$` : `${e}$$`;
904
914
  {
905
915
  handler: {
906
916
  name: "setextHeadings",
907
- handle: rr,
917
+ handle: ir,
908
918
  priority: R.SETEXT_HEADINGS
909
919
  },
910
920
  optionKey: "setextHeadings"
@@ -912,7 +922,7 @@ $$` : `${e}$$`;
912
922
  {
913
923
  handler: {
914
924
  name: "links",
915
- handle: Qn,
925
+ handle: $n,
916
926
  priority: R.LINKS
917
927
  },
918
928
  optionKey: "links",
@@ -921,7 +931,7 @@ $$` : `${e}$$`;
921
931
  {
922
932
  handler: {
923
933
  name: "boldItalic",
924
- handle: Pn,
934
+ handle: Fn,
925
935
  priority: R.BOLD_ITALIC
926
936
  },
927
937
  optionKey: "boldItalic"
@@ -929,7 +939,7 @@ $$` : `${e}$$`;
929
939
  {
930
940
  handler: {
931
941
  name: "bold",
932
- handle: Sn,
942
+ handle: Cn,
933
943
  priority: R.BOLD
934
944
  },
935
945
  optionKey: "bold"
@@ -937,7 +947,7 @@ $$` : `${e}$$`;
937
947
  {
938
948
  handler: {
939
949
  name: "italicDoubleUnderscore",
940
- handle: wn,
950
+ handle: Tn,
941
951
  priority: R.ITALIC_DOUBLE_UNDERSCORE
942
952
  },
943
953
  optionKey: "italic"
@@ -945,7 +955,7 @@ $$` : `${e}$$`;
945
955
  {
946
956
  handler: {
947
957
  name: "italicSingleAsterisk",
948
- handle: Dn,
958
+ handle: On,
949
959
  priority: R.ITALIC_SINGLE_ASTERISK
950
960
  },
951
961
  optionKey: "italic"
@@ -953,7 +963,7 @@ $$` : `${e}$$`;
953
963
  {
954
964
  handler: {
955
965
  name: "italicSingleUnderscore",
956
- handle: jn,
966
+ handle: Mn,
957
967
  priority: R.ITALIC_SINGLE_UNDERSCORE
958
968
  },
959
969
  optionKey: "italic"
@@ -961,7 +971,7 @@ $$` : `${e}$$`;
961
971
  {
962
972
  handler: {
963
973
  name: "inlineCode",
964
- handle: Bn,
974
+ handle: Vn,
965
975
  priority: R.INLINE_CODE
966
976
  },
967
977
  optionKey: "inlineCode"
@@ -969,7 +979,7 @@ $$` : `${e}$$`;
969
979
  {
970
980
  handler: {
971
981
  name: "strikethrough",
972
- handle: sr,
982
+ handle: cr,
973
983
  priority: R.STRIKETHROUGH
974
984
  },
975
985
  optionKey: "strikethrough"
@@ -977,7 +987,7 @@ $$` : `${e}$$`;
977
987
  {
978
988
  handler: {
979
989
  name: "katex",
980
- handle: Wn,
990
+ handle: Gn,
981
991
  priority: R.KATEX
982
992
  },
983
993
  optionKey: "katex"
@@ -985,36 +995,36 @@ $$` : `${e}$$`;
985
995
  {
986
996
  handler: {
987
997
  name: "inlineKatex",
988
- handle: Gn,
998
+ handle: Kn,
989
999
  priority: R.INLINE_KATEX
990
1000
  },
991
1001
  optionKey: "inlineKatex"
992
1002
  }
993
- ], dr = (e) => {
1003
+ ], fr = (e) => {
994
1004
  let t = e?.linkMode ?? "protocol";
995
- return ur.filter(({ handler: t, optionKey: n }) => t.name === "links" ? cr(e?.links) || cr(e?.images) : t.name === "inlineKatex" ? lr(e?.inlineKatex) : cr(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
996
- handler: ut(lt({}, e), { handle: (e) => Qn(e, t) }),
1005
+ return dr.filter(({ handler: t, optionKey: n }) => t.name === "links" ? lr(e?.links) || lr(e?.images) : t.name === "inlineKatex" ? ur(e?.inlineKatex) : lr(e?.[n])).map(({ handler: e, earlyReturn: n }) => e.name === "links" ? {
1006
+ handler: dt(ut({}, e), { handle: (e) => $n(e, t) }),
997
1007
  earlyReturn: t === "protocol" ? n : void 0
998
1008
  } : {
999
1009
  handler: e,
1000
1010
  earlyReturn: n
1001
1011
  });
1002
- }, fr = (e, t) => {
1012
+ }, pr = (e, t) => {
1003
1013
  if (!e || typeof e != "string") return e;
1004
- let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = dr(t), i = (t?.handlers ?? []).map((e) => ({
1005
- handler: ut(lt({}, e), { priority: e.priority ?? R.DEFAULT }),
1014
+ let n = e.endsWith(" ") && !e.endsWith(" ") ? e.slice(0, -1) : e, r = fr(t), i = (t?.handlers ?? []).map((e) => ({
1015
+ handler: dt(ut({}, e), { priority: e.priority ?? R.DEFAULT }),
1006
1016
  earlyReturn: void 0
1007
1017
  })), a = [...r, ...i].sort((e, t) => (e.handler.priority ?? 0) - (t.handler.priority ?? 0));
1008
1018
  try {
1009
1019
  for (let { handler: e, earlyReturn: t } of a) if (n = e.handle(n), t != null && t(n)) return n;
1010
1020
  return n.endsWith(" ") && !n.endsWith(" ") ? n.slice(0, -1) : n;
1011
1021
  } finally {
1012
- Et();
1022
+ Dt();
1013
1023
  }
1014
1024
  };
1015
1025
  //#endregion
1016
1026
  //#region ../../node_modules/.pnpm/marked@18.1.1/node_modules/marked/lib/marked.esm.js
1017
- function pr() {
1027
+ function mr() {
1018
1028
  return {
1019
1029
  async: !1,
1020
1030
  breaks: !1,
@@ -1028,12 +1038,12 @@ function pr() {
1028
1038
  walkTokens: null
1029
1039
  };
1030
1040
  }
1031
- var mr = pr();
1032
- function hr(e) {
1033
- mr = e;
1041
+ var hr = mr();
1042
+ function gr(e) {
1043
+ hr = e;
1034
1044
  }
1035
- var gr = { exec: () => null };
1036
- function _r(e) {
1045
+ var _r = { exec: () => null };
1046
+ function vr(e) {
1037
1047
  let t = [];
1038
1048
  return (n) => {
1039
1049
  let r = Math.max(0, Math.min(3, n - 1)), i = t[r];
@@ -1050,7 +1060,7 @@ function z(e, t = "") {
1050
1060
  };
1051
1061
  return r;
1052
1062
  }
1053
- var vr = ((e = "") => {
1063
+ var yr = ((e = "") => {
1054
1064
  try {
1055
1065
  return !!RegExp("(?<=1)(?<!1)" + e);
1056
1066
  } catch {
@@ -1111,113 +1121,113 @@ var vr = ((e = "") => {
1111
1121
  notSpaceStart: /^\S*/,
1112
1122
  endingNewline: /\n$/,
1113
1123
  listItemRegex: (e) => RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),
1114
- nextBulletRegex: _r((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
1115
- hrRegex: _r((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
1116
- fencesBeginRegex: _r((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
1117
- headingBeginRegex: _r((e) => RegExp(`^ {0,${e}}#`)),
1118
- htmlBeginRegex: _r((e) => RegExp(`^ {0,${e}}(?:</?(?:${Nr})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
1119
- blockquoteBeginRegex: _r((e) => RegExp(`^ {0,${e}}>`))
1120
- }, yr = /^(?:[ \t]*(?:\n|$))+/, br = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, xr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Sr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, Cr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, wr = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Tr = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Er = z(Tr).replace(/bull/g, wr).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(), Dr = z(Tr).replace(/bull/g, wr).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(), Or = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, kr = /^[^\n]+/, Ar = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, jr = z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", Ar).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Mr = z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, wr).getRegex(), Nr = "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", Pr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Fr = z("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Pr).replace("tag", Nr).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Ir = (e) => z(Or).replace("hr", Sr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Nr).getRegex(), Lr = Ir(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), Rr = Ir(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), zr = {
1121
- blockquote: z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", Rr).getRegex(),
1122
- code: br,
1123
- def: jr,
1124
- fences: xr,
1125
- heading: Cr,
1126
- hr: Sr,
1127
- html: Fr,
1128
- lheading: Er,
1129
- list: Mr,
1130
- newline: yr,
1131
- paragraph: Lr,
1132
- table: gr,
1133
- text: kr
1134
- }, Br = z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Sr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Nr).getRegex(), Vr = {
1135
- ...zr,
1124
+ nextBulletRegex: vr((e) => RegExp(`^ {0,${e}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),
1125
+ hrRegex: vr((e) => RegExp(`^ {0,${e}}((?:-[ ]*){3,}|(?:_[ ]*){3,}|(?:\\*[ ]*){3,})(?:\\n+|$)`)),
1126
+ fencesBeginRegex: vr((e) => RegExp(`^ {0,${e}}(?:\`\`\`|~~~)`)),
1127
+ headingBeginRegex: vr((e) => RegExp(`^ {0,${e}}#`)),
1128
+ htmlBeginRegex: vr((e) => RegExp(`^ {0,${e}}(?:</?(?:${Pr})(?: +|$|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)`, "i")),
1129
+ blockquoteBeginRegex: vr((e) => RegExp(`^ {0,${e}}>`))
1130
+ }, br = /^(?:[ \t]*(?:\n|$))+/, xr = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Sr = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Cr = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, wr = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Tr = / {0,3}(?:[*+-]|\d{1,9}[.)])/, Er = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |fences|blockquote|heading|hr|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, Dr = z(Er).replace(/bull/g, Tr).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(), Or = z(Er).replace(/bull/g, Tr).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(), kr = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/, Ar = /^[^\n]+/, jr = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Mr = z(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", jr).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Nr = z(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g, Tr).getRegex(), Pr = "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", Fr = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Ir = z("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!(?:script|pre|style|textarea)(?![a-z0-9-]))([a-z][a-z0-9-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</[a-z][a-z0-9-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", Fr).replace("tag", Pr).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), Lr = (e) => z(kr).replace("hr", Cr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", e).replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Pr).getRegex(), Rr = Lr(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/), zr = Lr(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/), Br = {
1131
+ blockquote: z(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", zr).getRegex(),
1132
+ code: xr,
1133
+ def: Mr,
1134
+ fences: Sr,
1135
+ heading: wr,
1136
+ hr: Cr,
1137
+ html: Ir,
1136
1138
  lheading: Dr,
1137
- table: Br,
1138
- paragraph: z(Or).replace("hr", Sr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Br).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Nr).getRegex()
1139
- }, Hr = {
1140
- ...zr,
1141
- html: z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Pr).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(),
1139
+ list: Nr,
1140
+ newline: br,
1141
+ paragraph: Rr,
1142
+ table: _r,
1143
+ text: Ar
1144
+ }, Vr = z("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Cr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Pr).getRegex(), Hr = {
1145
+ ...Br,
1146
+ lheading: Or,
1147
+ table: Vr,
1148
+ paragraph: z(kr).replace("hr", Cr).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", Vr).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list", " {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html", " {0,3}(?:</?(?:tag)(?: +|\\n|/?>)|<(?:(?:script|pre|style|textarea)(?:[\\s>]|$)|!--)|<\\?|<![A-Za-z]|<!\\[CDATA\\[)").replace("tag", Pr).getRegex()
1149
+ }, Ur = {
1150
+ ...Br,
1151
+ html: z("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment", Fr).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(),
1142
1152
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
1143
1153
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
1144
- fences: gr,
1154
+ fences: _r,
1145
1155
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
1146
- paragraph: z(Or).replace("hr", Sr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Er).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
1147
- }, Ur = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Wr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Gr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, Kr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, qr = /[\p{P}\p{S}]/u, Jr = /[\s\p{P}\p{S}]/u, Yr = /[^\s\p{P}\p{S}]/u, Xr = z(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Jr).getRegex(), Zr = /[\p{Pi}\p{Ps}"']/u, Qr = /(?!~)[\p{P}\p{S}]/u, $r = /(?!~)[\s\p{P}\p{S}]/u, ei = /(?:[^\s\p{P}\p{S}]|~)/u, ti = z(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", vr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ni = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ri = z(ni, "u").replace(/punct/g, qr).getRegex(), ii = z(ni, "u").replace(/punct/g, Qr).getRegex(), ai = z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Zr).replace(/punct/g, qr).getRegex(), oi = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", si = z(oi, "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), ci = z(oi, "gu").replace(/notPunctSpace/g, ei).replace(/punctSpace/g, $r).replace(/punct/g, Qr).getRegex(), li = z("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), ui = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), di = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), fi = z(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, qr).getRegex(), pi = z("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Yr).replace(/punctSpace/g, Jr).replace(/punct/g, qr).getRegex(), mi = z(/\\(punct)/, "gu").replace(/punct/g, qr).getRegex(), hi = z(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, qr).getRegex(), gi = z(/^<(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(), _i = z(Pr).replace("(?:-->|$)", "-->").getRegex(), vi = z("^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", _i).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), yi = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, bi = z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", yi).getRegex(), xi = z(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", bi).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Si = z(/^!?\[(label)\]\[(ref)\]/).replace("label", bi).replace("ref", Ar).getRegex(), Ci = z(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ar).getRegex(), wi = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Ti = z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", yi).getRegex(), Ei = z("reflink|nolink(?!\\()", "g").replace("reflink", z(/^!?\[(label)\]\[(ref)\]/).replace("label", Ti).replace("ref", wi).getRegex()).replace("nolink", z(/^!?\[(ref)\](?:\[\])?/).replace("ref", wi).getRegex()).getRegex(), Di = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, Oi = z(/(?: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(), ki = {
1148
- _backpedal: gr,
1149
- anyPunctuation: mi,
1150
- anyPunctuationOutsideCode: hi,
1151
- autolink: gi,
1152
- blockSkip: ti,
1153
- br: Gr,
1154
- code: Wr,
1155
- del: gr,
1156
- delLDelim: gr,
1157
- delRDelim: gr,
1158
- emStrongLDelim: ri,
1159
- emStrongRDelimAst: si,
1160
- emStrongRDelimUnd: ui,
1161
- escape: Ur,
1162
- link: xi,
1163
- nolink: Ci,
1164
- punctuation: Xr,
1165
- reflink: Si,
1166
- reflinkSearch: Ei,
1167
- tag: vi,
1168
- text: Kr,
1169
- url: gr
1170
- }, Ai = {
1171
- ...ki,
1172
- emStrongLDelim: ai,
1173
- emStrongRDelimAst: li,
1156
+ paragraph: z(kr).replace("hr", Cr).replace("heading", " *#{1,6} *[^\n]").replace("lheading", Dr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
1157
+ }, Wr = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Gr = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Kr = /^( {2,}|\\)\n(?!\s*$)[ \t]*/, qr = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Jr = /[\p{P}\p{S}]/u, Yr = /[\s\p{P}\p{S}]/u, Xr = /[^\s\p{P}\p{S}]/u, Zr = z(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, Yr).getRegex(), Qr = /[\p{Pi}\p{Ps}"']/u, $r = /(?!~)[\p{P}\p{S}]/u, ei = /(?!~)[\s\p{P}\p{S}]/u, ti = /(?:[^\s\p{P}\p{S}]|~)/u, ni = z(/link|precode-code|html/, "g").replace("link", /\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-", yr ? "(?<!`)()" : "(^^|[^`])").replace("code", /(?<b>`+)[^`]+\k<b>(?!`)/).replace("html", /<(?! )[^<>]*?>/).getRegex(), ri = /^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/, ii = z(ri, "u").replace(/punct/g, Jr).getRegex(), ai = z(ri, "u").replace(/punct/g, $r).getRegex(), oi = z(/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/, "u").replace(/openQuote/g, Qr).replace(/punct/g, Jr).getRegex(), si = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", ci = z(si, "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), li = z(si, "gu").replace(/notPunctSpace/g, ti).replace(/punctSpace/g, ei).replace(/punct/g, $r).getRegex(), ui = z("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), di = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), fi = z("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), pi = z(/^~~?(?:((?!~)punct)|[^\s~])/, "u").replace(/punct/g, Jr).getRegex(), mi = z("^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)", "gu").replace(/notPunctSpace/g, Xr).replace(/punctSpace/g, Yr).replace(/punct/g, Jr).getRegex(), hi = z(/\\(punct)/, "gu").replace(/punct/g, Jr).getRegex(), gi = z(/(`+)(?:[^`]|[^`][\s\S]*?[^`])\1(?!`)|`+|\\(punct)/, "gu").replace(/punct/g, Jr).getRegex(), _i = z(/^<(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(), vi = z(Fr).replace("(?:-->|$)", "-->").getRegex(), yi = z("^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", vi).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), bi = /\[(?:\\[\s\S]|[^\[\]\\])*\]/, xi = z(/(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/).replace("brackets", bi).getRegex(), Si = z(/^!?\[(label)\]\([ \t\n]*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?[ \t\n]*\)/).replace("label", xi).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Ci = z(/^!?\[(label)\]\[(ref)\]/).replace("label", xi).replace("ref", jr).getRegex(), wi = z(/^!?\[(ref)\](?:\[\])?/).replace("ref", jr).getRegex(), Ti = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\]){1,999}/, Ei = z(/(?:[^\[\]\\`]*(?:\[(?:brackets|\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\]))){0,999}?[^\[\]\\`]*?/).replace("brackets", bi).getRegex(), Di = z("reflink|nolink(?!\\()", "g").replace("reflink", z(/^!?\[(label)\]\[(ref)\]/).replace("label", Ei).replace("ref", Ti).getRegex()).replace("nolink", z(/^!?\[(ref)\](?:\[\])?/).replace("ref", Ti).getRegex()).getRegex(), Oi = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, ki = z(/(?: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(), Ai = {
1158
+ _backpedal: _r,
1159
+ anyPunctuation: hi,
1160
+ anyPunctuationOutsideCode: gi,
1161
+ autolink: _i,
1162
+ blockSkip: ni,
1163
+ br: Kr,
1164
+ code: Gr,
1165
+ del: _r,
1166
+ delLDelim: _r,
1167
+ delRDelim: _r,
1168
+ emStrongLDelim: ii,
1169
+ emStrongRDelimAst: ci,
1174
1170
  emStrongRDelimUnd: di,
1175
- link: z(/^!?\[(label)\]\((.*?)\)/).replace("label", bi).getRegex(),
1176
- reflink: z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", bi).getRegex()
1171
+ escape: Wr,
1172
+ link: Si,
1173
+ nolink: wi,
1174
+ punctuation: Zr,
1175
+ reflink: Ci,
1176
+ reflinkSearch: Di,
1177
+ tag: yi,
1178
+ text: qr,
1179
+ url: _r
1177
1180
  }, ji = {
1178
- ...ki,
1179
- emStrongRDelimAst: ci,
1180
- emStrongLDelim: ii,
1181
- delLDelim: fi,
1182
- delRDelim: pi,
1183
- url: z(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", Oi).replace("protocol", Di).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
1181
+ ...Ai,
1182
+ emStrongLDelim: oi,
1183
+ emStrongRDelimAst: ui,
1184
+ emStrongRDelimUnd: fi,
1185
+ link: z(/^!?\[(label)\]\((.*?)\)/).replace("label", xi).getRegex(),
1186
+ reflink: z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", xi).getRegex()
1187
+ }, Mi = {
1188
+ ...Ai,
1189
+ emStrongRDelimAst: li,
1190
+ emStrongLDelim: ai,
1191
+ delLDelim: pi,
1192
+ delRDelim: mi,
1193
+ url: z(/^emailProtocol|^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("emailProtocol", ki).replace("protocol", Oi).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![\w-])/).getRegex(),
1184
1194
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
1185
1195
  del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,
1186
- text: z(/^(?:[^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", Di).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
1187
- }, Mi = {
1188
- ...ji,
1189
- br: z(Gr).replace("{2,}", "*").getRegex(),
1190
- text: z(ji.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1196
+ text: z(/^(?:[^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", Oi).replace(/emailProtocol/g, /(?:mailto|xmpp):/).getRegex()
1191
1197
  }, Ni = {
1192
- normal: zr,
1193
- gfm: Vr,
1194
- pedantic: Hr
1198
+ ...Mi,
1199
+ br: z(Kr).replace("{2,}", "*").getRegex(),
1200
+ text: z(Mi.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
1195
1201
  }, Pi = {
1196
- normal: ki,
1197
- gfm: ji,
1198
- breaks: Mi,
1199
- pedantic: Ai
1202
+ normal: Br,
1203
+ gfm: Hr,
1204
+ pedantic: Ur
1200
1205
  }, Fi = {
1206
+ normal: Ai,
1207
+ gfm: Mi,
1208
+ breaks: Ni,
1209
+ pedantic: ji
1210
+ }, Ii = {
1201
1211
  "&": "&amp;",
1202
1212
  "<": "&lt;",
1203
1213
  ">": "&gt;",
1204
1214
  "\"": "&quot;",
1205
1215
  "'": "&#39;"
1206
- }, Ii = (e) => Fi[e];
1216
+ }, Li = (e) => Ii[e];
1207
1217
  function V(e, t) {
1208
1218
  if (t) {
1209
- if (B.escapeTest.test(e)) return e.replace(B.escapeReplace, Ii);
1210
- } else if (B.escapeTestNoEncode.test(e)) return e.replace(B.escapeReplaceNoEncode, Ii);
1219
+ if (B.escapeTest.test(e)) return e.replace(B.escapeReplace, Li);
1220
+ } else if (B.escapeTestNoEncode.test(e)) return e.replace(B.escapeReplaceNoEncode, Li);
1211
1221
  return e;
1212
1222
  }
1213
- function Li(e) {
1223
+ function Ri(e) {
1214
1224
  return B.numericCharacterReference.test(e) ? e.replace(B.numericCharacterReferenceOrAmpersand, (e, t, n) => {
1215
1225
  if (t === void 0 && n === void 0) return "&amp;";
1216
1226
  let r = t === void 0 ? Number.parseInt(n, 16) : Number.parseInt(t, 10);
1217
1227
  return r === 0 || r > 1114111 || r >= 55296 && r <= 57343 ? "�" : r === 38 ? "&amp;" : String.fromCodePoint(r);
1218
1228
  }) : e;
1219
1229
  }
1220
- function Ri(e) {
1230
+ function zi(e) {
1221
1231
  try {
1222
1232
  e = encodeURI(e).replace(B.percentDecode, "%");
1223
1233
  } catch {
@@ -1225,7 +1235,7 @@ function Ri(e) {
1225
1235
  }
1226
1236
  return e;
1227
1237
  }
1228
- function zi(e, t) {
1238
+ function Bi(e, t) {
1229
1239
  let n = e.replace(B.findPipe, (e, t, n) => {
1230
1240
  let r = !1, i = t;
1231
1241
  for (; --i >= 0 && n[i] === "\\";) r = !r;
@@ -1238,7 +1248,7 @@ function zi(e, t) {
1238
1248
  for (; r < n.length; r++) n[r] = n[r].trim().replace(B.slashPipe, "|");
1239
1249
  return n;
1240
1250
  }
1241
- function Bi(e, t, n) {
1251
+ function Vi(e, t, n) {
1242
1252
  let r = e.length;
1243
1253
  if (r === 0) return "";
1244
1254
  let i = 0;
@@ -1250,15 +1260,15 @@ function Bi(e, t, n) {
1250
1260
  }
1251
1261
  return e.slice(0, r - i);
1252
1262
  }
1253
- function Vi(e) {
1263
+ function Hi(e) {
1254
1264
  let t = e.split("\n"), n = t.length - 1;
1255
1265
  for (; n >= 0 && B.blankLine.test(t[n]);) n--;
1256
1266
  return t.length - n <= 2 ? e : t.slice(0, n + 1).join("\n");
1257
1267
  }
1258
- function Hi(e) {
1268
+ function Ui(e) {
1259
1269
  return e.trim().toLowerCase().toUpperCase().toLowerCase();
1260
1270
  }
1261
- function Ui(e, t) {
1271
+ function Wi(e, t) {
1262
1272
  if (e.indexOf(t[0]) === -1 && e.indexOf(t[1]) === -1) return -1;
1263
1273
  let n = 0;
1264
1274
  for (let r = 0; r < e.length; r++) if (e[r] === "\\") r++;
@@ -1266,7 +1276,7 @@ function Ui(e, t) {
1266
1276
  else if (e[r] === t[1] && (n--, n < 0)) return r;
1267
1277
  return n > 0 ? -2 : -1;
1268
1278
  }
1269
- function Wi(e, t = 0) {
1279
+ function Gi(e, t = 0) {
1270
1280
  let n = t, r = "";
1271
1281
  for (let t of e) if (t === " ") {
1272
1282
  let e = 4 - n % 4;
@@ -1274,7 +1284,7 @@ function Wi(e, t = 0) {
1274
1284
  } else r += t, n++;
1275
1285
  return r;
1276
1286
  }
1277
- function Gi(e, t, n, r, i) {
1287
+ function Ki(e, t, n, r, i) {
1278
1288
  let a = t.href, o = t.title || null, s = e[1].replace(i.other.outputLinkReplace, "$1"), c = e[0].charAt(0) === "!", l = r.state.inLink, u = r.state.linkEmitted, d = r.state.inRawBlock;
1279
1289
  r.state.inLink = !0, r.state.linkEmitted = !1;
1280
1290
  let f = r.inlineTokens(s), p = r.state.linkEmitted;
@@ -1294,7 +1304,7 @@ function Gi(e, t, n, r, i) {
1294
1304
  tokens: f
1295
1305
  };
1296
1306
  }
1297
- function Ki(e, t, n) {
1307
+ function qi(e, t, n) {
1298
1308
  let r = e.match(n.other.indentCodeCompensation);
1299
1309
  if (r === null) return t;
1300
1310
  let i = r[1];
@@ -1305,7 +1315,7 @@ function Ki(e, t, n) {
1305
1315
  return e.slice(Math.min(r.length, i.length));
1306
1316
  }).join("\n");
1307
1317
  }
1308
- function qi(e, t, n, r) {
1318
+ function Ji(e, t, n, r) {
1309
1319
  if (!t.includes("<")) return !1;
1310
1320
  for (let i = 0; i < t.length; i++) {
1311
1321
  if (t[i] === "\\") {
@@ -1328,12 +1338,12 @@ function qi(e, t, n, r) {
1328
1338
  }
1329
1339
  return !1;
1330
1340
  }
1331
- var Ji = class {
1341
+ var Yi = class {
1332
1342
  options;
1333
1343
  rules;
1334
1344
  lexer;
1335
1345
  constructor(e) {
1336
- this.options = e || mr;
1346
+ this.options = e || hr;
1337
1347
  }
1338
1348
  space(e) {
1339
1349
  let t = this.rules.block.newline.exec(e);
@@ -1345,7 +1355,7 @@ var Ji = class {
1345
1355
  code(e) {
1346
1356
  let t = this.rules.block.code.exec(e);
1347
1357
  if (t) {
1348
- let e = this.options.pedantic ? t[0] : Vi(t[0]);
1358
+ let e = this.options.pedantic ? t[0] : Hi(t[0]);
1349
1359
  return {
1350
1360
  type: "code",
1351
1361
  raw: e,
@@ -1357,7 +1367,7 @@ var Ji = class {
1357
1367
  fences(e) {
1358
1368
  let t = this.rules.block.fences.exec(e);
1359
1369
  if (t) {
1360
- let e = t[0], n = Ki(e, t[3] || "", this.rules);
1370
+ let e = t[0], n = qi(e, t[3] || "", this.rules);
1361
1371
  return {
1362
1372
  type: "code",
1363
1373
  raw: e,
@@ -1371,12 +1381,12 @@ var Ji = class {
1371
1381
  if (t) {
1372
1382
  let e = t[2].trim();
1373
1383
  if (this.rules.other.endingHash.test(e)) {
1374
- let t = Bi(e, "#");
1384
+ let t = Vi(e, "#");
1375
1385
  (this.options.pedantic || !t || this.rules.other.endingSpaceTabChar.test(t)) && (e = t.trim());
1376
1386
  }
1377
1387
  return {
1378
1388
  type: "heading",
1379
- raw: Bi(t[0], "\n"),
1389
+ raw: Vi(t[0], "\n"),
1380
1390
  depth: t[1].length,
1381
1391
  text: e,
1382
1392
  tokens: this.lexer.inline(e)
@@ -1387,13 +1397,13 @@ var Ji = class {
1387
1397
  let t = this.rules.block.hr.exec(e);
1388
1398
  if (t) return {
1389
1399
  type: "hr",
1390
- raw: Bi(t[0], "\n")
1400
+ raw: Vi(t[0], "\n")
1391
1401
  };
1392
1402
  }
1393
1403
  blockquote(e) {
1394
1404
  let t = this.rules.block.blockquote.exec(e);
1395
1405
  if (t) {
1396
- let e = Bi(t[0], "\n").split("\n"), n = "", r = "", i = [];
1406
+ let e = Vi(t[0], "\n").split("\n"), n = "", r = "", i = [];
1397
1407
  for (; e.length > 0;) {
1398
1408
  let t = !1, a = [], o = 0;
1399
1409
  for (; o < e.length; o++) if (this.rules.other.blockquoteStart.test(e[o])) a.push(e[o]), t = !0;
@@ -1447,12 +1457,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1447
1457
  if (!(t = s.exec(e)) || this.rules.block.hr.test(e)) break;
1448
1458
  let l = r();
1449
1459
  e = e.substring(t[0].length);
1450
- let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ? Wi(u, d) : u.replace(this.rules.other.leadingSpaceTab, (e) => Wi(e, d)), p = e.split("\n", 1)[0], ee = !f.trim(), m = 0;
1460
+ let u = t[2].split("\n", 1)[0], d = t[1].length, f = this.options.pedantic ? Gi(u, d) : u.replace(this.rules.other.leadingSpaceTab, (e) => Gi(e, d)), p = e.split("\n", 1)[0], ee = !f.trim(), m = 0;
1451
1461
  if (this.options.pedantic ? (m = 2, a = f.trimStart()) : ee ? m = d + 1 : (m = f.search(this.rules.other.nonSpaceChar), m = m > 4 ? 1 : m, a = f.slice(m), m += d), ee && this.rules.other.blankLine.test(p) && (e = e.substring(p.length + 1), i = !0), !i) {
1452
1462
  let t = this.rules.other.nextBulletRegex(m), n = this.rules.other.hrRegex(m), r = this.rules.other.fencesBeginRegex(m), i = this.rules.other.headingBeginRegex(m), o = this.rules.other.htmlBeginRegex(m), s = this.rules.other.blockquoteBeginRegex(m);
1453
1463
  for (; e;) {
1454
1464
  let c = e.split("\n", 1)[0], l;
1455
- if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) => Wi(e)), r.test(p) || i.test(p) || o.test(p) || s.test(p) || t.test(p) || n.test(p)) break;
1465
+ if (p = c, this.options.pedantic ? (p = p.replace(this.rules.other.listReplaceNesting, " "), l = p) : l = p.replace(this.rules.other.leadingSpaceTab, (e) => Gi(e)), r.test(p) || i.test(p) || o.test(p) || s.test(p) || t.test(p) || n.test(p)) break;
1456
1466
  if (l.search(this.rules.other.nonSpaceChar) >= m || !p.trim()) a += "\n" + l.slice(m);
1457
1467
  else {
1458
1468
  if (ee || f.replace(this.rules.other.tabCharGlobal, " ").search(this.rules.other.nonSpaceChar) >= 4 || r.test(f) || i.test(f) || n.test(f)) break;
@@ -1461,10 +1471,10 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1461
1471
  ee = !p.trim(), e = e.substring(c.length + 1), f = l.slice(m);
1462
1472
  }
1463
1473
  }
1464
- let te = n.slice(l, r());
1465
- o.loose || (c ? o.loose = !0 : this.rules.other.doubleBlankLine.test(te) && (c = !0)), o.items.push({
1474
+ let h = n.slice(l, r());
1475
+ o.loose || (c ? o.loose = !0 : this.rules.other.doubleBlankLine.test(h) && (c = !0)), o.items.push({
1466
1476
  type: "list_item",
1467
- raw: te,
1477
+ raw: h,
1468
1478
  task: !!this.options.gfm && this.rules.other.listIsTask.test(a),
1469
1479
  loose: !1,
1470
1480
  text: a,
@@ -1513,7 +1523,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1513
1523
  html(e) {
1514
1524
  let t = this.rules.block.html.exec(e);
1515
1525
  if (t) {
1516
- let e = Vi(t[0]);
1526
+ let e = Hi(t[0]);
1517
1527
  return {
1518
1528
  type: "html",
1519
1529
  block: !0,
@@ -1526,12 +1536,12 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1526
1536
  def(e) {
1527
1537
  let t = this.rules.block.def.exec(e);
1528
1538
  if (t) {
1529
- if (!this.rules.other.startAngleBracket.test(t[2]) && Ui(t[2], "()") !== -1) return;
1530
- let e = Hi(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];
1539
+ if (!this.rules.other.startAngleBracket.test(t[2]) && Wi(t[2], "()") !== -1) return;
1540
+ let e = Ui(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];
1531
1541
  return {
1532
1542
  type: "def",
1533
1543
  tag: e,
1534
- raw: Bi(t[0], "\n"),
1544
+ raw: Vi(t[0], "\n"),
1535
1545
  href: n,
1536
1546
  title: r
1537
1547
  };
@@ -1540,9 +1550,9 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1540
1550
  table(e) {
1541
1551
  let t = this.rules.block.table.exec(e);
1542
1552
  if (!t || !this.rules.other.tableDelimiter.test(t[2])) return;
1543
- let n = zi(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 = {
1553
+ let n = Bi(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 = {
1544
1554
  type: "table",
1545
- raw: Bi(t[0], "\n"),
1555
+ raw: Vi(t[0], "\n"),
1546
1556
  header: [],
1547
1557
  align: [],
1548
1558
  rows: []
@@ -1555,7 +1565,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1555
1565
  header: !0,
1556
1566
  align: a.align[e]
1557
1567
  });
1558
- for (let e of i) a.rows.push(zi(e, a.header.length).map((e, t) => ({
1568
+ for (let e of i) a.rows.push(Bi(e, a.header.length).map((e, t) => ({
1559
1569
  text: e,
1560
1570
  tokens: this.lexer.inline(e),
1561
1571
  header: !1,
@@ -1570,7 +1580,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1570
1580
  let e = t[1].trim();
1571
1581
  return {
1572
1582
  type: "heading",
1573
- raw: Bi(t[0], "\n"),
1583
+ raw: Vi(t[0], "\n"),
1574
1584
  depth: t[2].charAt(0) === "=" ? 1 : 2,
1575
1585
  text: e,
1576
1586
  tokens: this.lexer.inline(e)
@@ -1622,14 +1632,14 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1622
1632
  let t = this.rules.inline.link.exec(e);
1623
1633
  if (t) {
1624
1634
  let n = t[0].charAt(0) === "!" ? 2 : 1;
1625
- if (!this.options.pedantic && qi(e, t[1], n, this.rules)) return;
1635
+ if (!this.options.pedantic && Ji(e, t[1], n, this.rules)) return;
1626
1636
  let r = t[2].trim();
1627
1637
  if (!this.options.pedantic && this.rules.other.startAngleBracket.test(r)) {
1628
1638
  if (!this.rules.other.endAngleBracket.test(r)) return;
1629
- let e = Bi(r.slice(0, -1), "\\");
1639
+ let e = Vi(r.slice(0, -1), "\\");
1630
1640
  if ((r.length - e.length) % 2 == 0) return;
1631
1641
  } else {
1632
- let e = Ui(t[2], "()");
1642
+ let e = Wi(t[2], "()");
1633
1643
  if (e === -2) return;
1634
1644
  if (e > -1) {
1635
1645
  let n = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + e;
@@ -1641,7 +1651,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1641
1651
  let e = this.rules.other.pedanticHrefTitle.exec(i);
1642
1652
  e && (i = e[1], a = e[3]);
1643
1653
  } else a = t[3] ? t[3].slice(1, -1) : "";
1644
- 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)), Gi(t, {
1654
+ return i = i.trim(), this.rules.other.startAngleBracket.test(i) && (i = this.options.pedantic && !this.rules.other.endAngleBracket.test(r) ? i.slice(1) : i.slice(1, -1)), Ki(t, {
1645
1655
  href: i && i.replace(this.rules.inline.anyPunctuation, "$1"),
1646
1656
  title: a && a.replace(this.rules.inline.anyPunctuation, "$1")
1647
1657
  }, t[0], this.lexer, this.rules);
@@ -1651,8 +1661,8 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1651
1661
  let n;
1652
1662
  if ((n = this.rules.inline.reflink.exec(e)) || (n = this.rules.inline.nolink.exec(e))) {
1653
1663
  let r = n[0].charAt(0) === "!" ? 2 : 1;
1654
- if (!this.options.pedantic && qi(e, n[1], r, this.rules)) return;
1655
- let i = t[Hi((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
1664
+ if (!this.options.pedantic && Ji(e, n[1], r, this.rules)) return;
1665
+ let i = t[Ui((n[2] || n[1]).replace(this.rules.other.multipleSpaceGlobal, " "))];
1656
1666
  if (!i) {
1657
1667
  let e = n[0].charAt(0);
1658
1668
  return {
@@ -1661,7 +1671,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1661
1671
  text: e
1662
1672
  };
1663
1673
  }
1664
- return Gi(n, i, n[0], this.lexer, this.rules);
1674
+ return Ki(n, i, n[0], this.lexer, this.rules);
1665
1675
  }
1666
1676
  }
1667
1677
  emStrong(e, t, n = "") {
@@ -1794,7 +1804,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1794
1804
  return {
1795
1805
  type: "text",
1796
1806
  raw: t[0],
1797
- text: e ? t[0] : Li(t[0]),
1807
+ text: e ? t[0] : Ri(t[0]),
1798
1808
  escaped: e
1799
1809
  };
1800
1810
  }
@@ -1806,7 +1816,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1806
1816
  inlineQueue;
1807
1817
  tokenizer;
1808
1818
  constructor(e) {
1809
- this.tokens = [], this.tokens.links = Object.create(null), this.options = e || mr, this.options.tokenizer = this.options.tokenizer || new Ji(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1819
+ this.tokens = [], this.tokens.links = Object.create(null), this.options = e || hr, this.options.tokenizer = this.options.tokenizer || new Yi(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
1810
1820
  inLink: !1,
1811
1821
  inRawBlock: !1,
1812
1822
  linkEmitted: !1,
@@ -1815,15 +1825,15 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1815
1825
  };
1816
1826
  let t = {
1817
1827
  other: B,
1818
- block: Ni.normal,
1819
- inline: Pi.normal
1828
+ block: Pi.normal,
1829
+ inline: Fi.normal
1820
1830
  };
1821
- this.options.pedantic ? (t.block = Ni.pedantic, t.inline = Pi.pedantic) : this.options.gfm && (t.block = Ni.gfm, t.inline = this.options.breaks ? Pi.breaks : Pi.gfm), this.tokenizer.rules = t;
1831
+ this.options.pedantic ? (t.block = Pi.pedantic, t.inline = Fi.pedantic) : this.options.gfm && (t.block = Pi.gfm, t.inline = this.options.breaks ? Fi.breaks : Fi.gfm), this.tokenizer.rules = t;
1822
1832
  }
1823
1833
  static get rules() {
1824
1834
  return {
1825
- block: Ni,
1826
- inline: Pi
1835
+ block: Pi,
1836
+ inline: Fi
1827
1837
  };
1828
1838
  }
1829
1839
  static lex(t, n) {
@@ -1913,7 +1923,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1913
1923
  for (let n of e.matchAll(this.tokenizer.rules.inline.blockSkip)) if (t.test(n[0]) && e.charAt(n.index - 1) !== "!") return !0;
1914
1924
  for (let t of e.matchAll(this.tokenizer.rules.inline.reflinkSearch)) {
1915
1925
  let e = t[0], n = e.lastIndexOf("[");
1916
- if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Hi(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
1926
+ if (e.charAt(0) !== "!" && Object.hasOwn(this.tokens.links, Ui(e.slice(n + 1, -1))) && !(n > 1 && this.linkInText(e.slice(1, n - 1)))) return !0;
1917
1927
  }
1918
1928
  return !1;
1919
1929
  }
@@ -1932,7 +1942,7 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1932
1942
  if (this.tokens.links && e.includes("[")) {
1933
1943
  let e = this.tokenizer.rules.inline.reflinkSearch, t = (n) => {
1934
1944
  let r = n.lastIndexOf("[");
1935
- if (!Object.hasOwn(this.tokens.links, Hi(n.slice(r + 1, -1)))) return n;
1945
+ if (!Object.hasOwn(this.tokens.links, Ui(n.slice(r + 1, -1)))) return n;
1936
1946
  if (r > 1 && n.charAt(0) !== "!") {
1937
1947
  let i = n.slice(1, r - 1);
1938
1948
  if (this.linkInText(i)) return "[" + i.replace(e, t) + "][" + "a".repeat(n.length - r - 2) + "]";
@@ -1992,11 +2002,11 @@ ${d.join("\n")}`), r = r.substring(0, r.length - t.text.length) + s.text;
1992
2002
  if (this.options.silent) console.error(t);
1993
2003
  else throw Error(t);
1994
2004
  }
1995
- }, Yi = class {
2005
+ }, Xi = class {
1996
2006
  options;
1997
2007
  parser;
1998
2008
  constructor(e) {
1999
- this.options = e || mr;
2009
+ this.options = e || hr;
2000
2010
  }
2001
2011
  space(e) {
2002
2012
  return "";
@@ -2082,7 +2092,7 @@ ${e}</tr>
2082
2092
  return `<del>${this.parser.parseInline(e)}</del>`;
2083
2093
  }
2084
2094
  link({ href: e, title: t, text: n, tokens: r, autolink: i }) {
2085
- let a = i ? V(n, !0) : this.parser.parseInline(r), o = Ri(e);
2095
+ let a = i ? V(n, !0) : this.parser.parseInline(r), o = zi(e);
2086
2096
  if (o === null) return a;
2087
2097
  e = V(o, i);
2088
2098
  let s = "<a href=\"" + e + "\"";
@@ -2090,7 +2100,7 @@ ${e}</tr>
2090
2100
  }
2091
2101
  image({ href: e, title: t, text: n, tokens: r }) {
2092
2102
  r && (n = this.parser.parseInline(r, this.parser.textRenderer));
2093
- let i = Ri(e);
2103
+ let i = zi(e);
2094
2104
  if (i === null) return V(n);
2095
2105
  e = i;
2096
2106
  let a = `<img src="${V(e)}" alt="${V(n)}"`;
@@ -2099,7 +2109,7 @@ ${e}</tr>
2099
2109
  text(e) {
2100
2110
  return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : V(e.text);
2101
2111
  }
2102
- }, Xi = class {
2112
+ }, Zi = class {
2103
2113
  strong({ text: e }) {
2104
2114
  return e;
2105
2115
  }
@@ -2135,7 +2145,7 @@ ${e}</tr>
2135
2145
  renderer;
2136
2146
  textRenderer;
2137
2147
  constructor(e) {
2138
- this.options = e || mr, this.options.renderer = this.options.renderer || new Yi(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Xi();
2148
+ this.options = e || hr, this.options.renderer = this.options.renderer || new Xi(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.renderer.parser = this, this.textRenderer = new Zi();
2139
2149
  }
2140
2150
  static parse(t, n) {
2141
2151
  return new e(n).parse(t);
@@ -2283,11 +2293,11 @@ ${e}</tr>
2283
2293
  }
2284
2294
  return n;
2285
2295
  }
2286
- }, Zi = class {
2296
+ }, Qi = class {
2287
2297
  options;
2288
2298
  block;
2289
2299
  constructor(e) {
2290
- this.options = e || mr;
2300
+ this.options = e || hr;
2291
2301
  }
2292
2302
  static passThroughHooks = /* @__PURE__ */ new Set([
2293
2303
  "preprocess",
@@ -2319,44 +2329,44 @@ ${e}</tr>
2319
2329
  return e ? U.parse : U.parseInline;
2320
2330
  }
2321
2331
  };
2322
- function Qi(e, t) {
2332
+ function $i(e, t) {
2323
2333
  if (Array.isArray(t)) for (let n = 0; n < t.length; n++) e.push(t[n]);
2324
2334
  else e.push(t);
2325
2335
  }
2326
- var $i = new class {
2327
- defaults = pr();
2336
+ var ea = new class {
2337
+ defaults = mr();
2328
2338
  options = this.setOptions;
2329
2339
  parse = this.parseMarkdown(!0);
2330
2340
  parseInline = this.parseMarkdown(!1);
2331
2341
  Parser = U;
2332
- Renderer = Yi;
2333
- TextRenderer = Xi;
2342
+ Renderer = Xi;
2343
+ TextRenderer = Zi;
2334
2344
  Lexer = H;
2335
- Tokenizer = Ji;
2336
- Hooks = Zi;
2345
+ Tokenizer = Yi;
2346
+ Hooks = Qi;
2337
2347
  constructor(...e) {
2338
2348
  this.use(...e);
2339
2349
  }
2340
2350
  walkTokens(e, t) {
2341
2351
  let n = [];
2342
- for (let r of e) switch (Qi(n, t.call(this, r)), r.type) {
2352
+ for (let r of e) switch ($i(n, t.call(this, r)), r.type) {
2343
2353
  case "table": {
2344
2354
  let e = r;
2345
- for (let r of e.header) Qi(n, this.walkTokens(r.tokens, t));
2346
- for (let r of e.rows) for (let e of r) Qi(n, this.walkTokens(e.tokens, t));
2355
+ for (let r of e.header) $i(n, this.walkTokens(r.tokens, t));
2356
+ for (let r of e.rows) for (let e of r) $i(n, this.walkTokens(e.tokens, t));
2347
2357
  break;
2348
2358
  }
2349
2359
  case "list": {
2350
2360
  let e = r;
2351
- Qi(n, this.walkTokens(e.items, t));
2361
+ $i(n, this.walkTokens(e.items, t));
2352
2362
  break;
2353
2363
  }
2354
2364
  default: {
2355
2365
  let e = r;
2356
2366
  this.defaults.extensions?.childTokens?.[e.type] ? this.defaults.extensions.childTokens[e.type].forEach((r) => {
2357
2367
  let i = e[r].flat(1 / 0);
2358
- Qi(n, this.walkTokens(i, t));
2359
- }) : e.tokens && Qi(n, this.walkTokens(e.tokens, t));
2368
+ $i(n, this.walkTokens(i, t));
2369
+ }) : e.tokens && $i(n, this.walkTokens(e.tokens, t));
2360
2370
  }
2361
2371
  }
2362
2372
  return n;
@@ -2384,7 +2394,7 @@ var $i = new class {
2384
2394
  }
2385
2395
  "childTokens" in e && e.childTokens && (t.childTokens[e.name] = e.childTokens);
2386
2396
  }), n.extensions = t), e.renderer) {
2387
- let t = this.defaults.renderer || new Yi(this.defaults);
2397
+ let t = this.defaults.renderer || new Xi(this.defaults);
2388
2398
  for (let n in e.renderer) {
2389
2399
  if (!(n in t)) throw Error(`renderer '${n}' does not exist`);
2390
2400
  if (["options", "parser"].includes(n)) continue;
@@ -2397,7 +2407,7 @@ var $i = new class {
2397
2407
  n.renderer = t;
2398
2408
  }
2399
2409
  if (e.tokenizer) {
2400
- let t = this.defaults.tokenizer || new Ji(this.defaults);
2410
+ let t = this.defaults.tokenizer || new Yi(this.defaults);
2401
2411
  for (let n in e.tokenizer) {
2402
2412
  if (!(n in t)) throw Error(`tokenizer '${n}' does not exist`);
2403
2413
  if ([
@@ -2414,13 +2424,13 @@ var $i = new class {
2414
2424
  n.tokenizer = t;
2415
2425
  }
2416
2426
  if (e.hooks) {
2417
- let t = this.defaults.hooks || new Zi();
2427
+ let t = this.defaults.hooks || new Qi();
2418
2428
  for (let n in e.hooks) {
2419
2429
  if (!(n in t)) throw Error(`hook '${n}' does not exist`);
2420
2430
  if (["options", "block"].includes(n)) continue;
2421
2431
  let r = n, i = e.hooks[r], a = t[r];
2422
- t[r] = Zi.passThroughHooks.has(n) ? (e) => {
2423
- if (this.defaults.async && Zi.passThroughHooksRespectAsync.has(n)) return (async () => {
2432
+ t[r] = Qi.passThroughHooks.has(n) ? (e) => {
2433
+ if (this.defaults.async && Qi.passThroughHooksRespectAsync.has(n)) return (async () => {
2424
2434
  let n = await i.call(t, e);
2425
2435
  return a.call(t, n);
2426
2436
  })();
@@ -2441,7 +2451,7 @@ var $i = new class {
2441
2451
  let t = this.defaults.walkTokens, r = e.walkTokens;
2442
2452
  n.walkTokens = function(e) {
2443
2453
  let n = [];
2444
- return n.push(r.call(this, e)), t && Qi(n, t.call(this, e)), n;
2454
+ return n.push(r.call(this, e)), t && $i(n, t.call(this, e)), n;
2445
2455
  };
2446
2456
  }
2447
2457
  this.defaults = {
@@ -2500,31 +2510,31 @@ var $i = new class {
2500
2510
  }
2501
2511
  }();
2502
2512
  function W(e, t) {
2503
- return $i.parse(e, t);
2513
+ return ea.parse(e, t);
2504
2514
  }
2505
2515
  W.options = W.setOptions = function(e) {
2506
- return $i.setOptions(e), W.defaults = $i.defaults, hr(W.defaults), W;
2507
- }, W.getDefaults = pr, W.defaults = mr;
2508
- function ea(...e) {
2509
- return $i.use(...e), W.defaults = $i.defaults, hr(W.defaults), W;
2510
- }
2511
- W.use = ea, W.walkTokens = function(e, t) {
2512
- return $i.walkTokens(e, t);
2513
- }, W.parseInline = $i.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Yi, W.TextRenderer = Xi, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Ji, W.Hooks = Zi, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
2516
+ return ea.setOptions(e), W.defaults = ea.defaults, gr(W.defaults), W;
2517
+ }, W.getDefaults = mr, W.defaults = hr;
2518
+ function ta(...e) {
2519
+ return ea.use(...e), W.defaults = ea.defaults, gr(W.defaults), W;
2520
+ }
2521
+ W.use = ta, W.walkTokens = function(e, t) {
2522
+ return ea.walkTokens(e, t);
2523
+ }, W.parseInline = ea.parseInline, W.Parser = U, W.parser = U.parse, W.Renderer = Xi, W.TextRenderer = Zi, W.Lexer = H, W.lexer = H.lex, W.Tokenizer = Yi, W.Hooks = Qi, W.parse = W, W.options, W.setOptions, W.walkTokens, W.parseInline, U.parse, H.lex;
2514
2524
  //#endregion
2515
2525
  //#region ../../node_modules/.pnpm/dompurify@3.4.17/node_modules/dompurify/dist/purify.es.mjs
2516
- function ta(e, t) {
2526
+ function na(e, t) {
2517
2527
  this.v = e, this.k = t;
2518
2528
  }
2519
- function na(e, t) {
2529
+ function ra(e, t) {
2520
2530
  (t == null || t > e.length) && (t = e.length);
2521
2531
  for (var n = 0, r = Array(t); n < t; n++) r[n] = e[n];
2522
2532
  return r;
2523
2533
  }
2524
- function ra(e) {
2534
+ function ia(e) {
2525
2535
  if (Array.isArray(e)) return e;
2526
2536
  }
2527
- function ia(e, t) {
2537
+ function aa(e, t) {
2528
2538
  var n = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
2529
2539
  if (n != null) {
2530
2540
  var r, i, a, o, s = [], c = !0, l = !1;
@@ -2545,24 +2555,24 @@ function ia(e, t) {
2545
2555
  return s;
2546
2556
  }
2547
2557
  }
2548
- function aa() {
2558
+ function oa() {
2549
2559
  throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
2550
2560
  }
2551
- function oa(e, t) {
2552
- return ra(e) || ia(e, t) || sa(e, t) || aa();
2553
- }
2554
2561
  function sa(e, t) {
2562
+ return ia(e) || aa(e, t) || ca(e, t) || oa();
2563
+ }
2564
+ function ca(e, t) {
2555
2565
  if (e) {
2556
- if (typeof e == "string") return na(e, t);
2566
+ if (typeof e == "string") return ra(e, t);
2557
2567
  var n = {}.toString.call(e).slice(8, -1);
2558
- 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) ? na(e, t) : void 0;
2568
+ return n === "Object" && e.constructor && (n = e.constructor.name), n === "Map" || n === "Set" ? Array.from(e) : n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n) ? ra(e, t) : void 0;
2559
2569
  }
2560
2570
  }
2561
- function ca(e) {
2571
+ function la(e) {
2562
2572
  var t, n;
2563
2573
  function r(t, n) {
2564
2574
  try {
2565
- var a = e[t](n), o = a.value, s = o instanceof ta;
2575
+ var a = e[t](n), o = a.value, s = o instanceof na;
2566
2576
  Promise.resolve(s ? o.v : o).then(function(n) {
2567
2577
  if (s) {
2568
2578
  var c = t === "return" && o.k ? t : "next";
@@ -2596,119 +2606,119 @@ function ca(e) {
2596
2606
  });
2597
2607
  }, typeof e.return != "function" && (this.return = void 0);
2598
2608
  }
2599
- ca.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
2609
+ la.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
2600
2610
  return this;
2601
- }, ca.prototype.next = function(e) {
2611
+ }, la.prototype.next = function(e) {
2602
2612
  return this._invoke("next", e);
2603
- }, ca.prototype.throw = function(e) {
2613
+ }, la.prototype.throw = function(e) {
2604
2614
  return this._invoke("throw", e);
2605
- }, ca.prototype.return = function(e) {
2615
+ }, la.prototype.return = function(e) {
2606
2616
  return this._invoke("return", e);
2607
2617
  };
2608
- var la = Object.entries, ua = Object.setPrototypeOf, da = Object.isFrozen, fa = Object.getPrototypeOf, pa = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, ma = Object.create, ha = typeof Reflect < "u" && Reflect, ga = ha.apply, _a = ha.construct;
2618
+ var ua = Object.entries, da = Object.setPrototypeOf, fa = Object.isFrozen, pa = Object.getPrototypeOf, ma = Object.getOwnPropertyDescriptor, G = Object.freeze, K = Object.seal, ha = Object.create, ga = typeof Reflect < "u" && Reflect, _a = ga.apply, va = ga.construct;
2609
2619
  G ||= function(e) {
2610
2620
  return e;
2611
2621
  }, K ||= function(e) {
2612
2622
  return e;
2613
- }, ga ||= function(e, t) {
2623
+ }, _a ||= function(e, t) {
2614
2624
  var n = [...arguments].slice(2);
2615
2625
  return e.apply(t, n);
2616
- }, _a ||= function(e) {
2626
+ }, va ||= function(e) {
2617
2627
  return new e(...[...arguments].slice(1));
2618
2628
  };
2619
- var va = Y(Array.prototype.forEach);
2629
+ var ya = Y(Array.prototype.forEach);
2620
2630
  Array.prototype.indexOf;
2621
- var ya = Y(Array.prototype.lastIndexOf), ba = Y(Array.prototype.pop), xa = Y(Array.prototype.push), Sa = Y(Array.prototype.slice), Ca = Y(Array.prototype.splice), wa = Array.isArray, Ta = Ba(Set), Ea = Y(Set.prototype.add), Da = Y(Set.prototype.has), Oa = Y(String.prototype.toLowerCase), ka = Y(String.prototype.toString), Aa = Y(String.prototype.match), ja = Y(String.prototype.replace), Ma = Y(String.prototype.indexOf), Na = Y(String.prototype.trim), Pa = Y(Number.prototype.toString), Fa = Y(Boolean.prototype.toString), Ia = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), La = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), Ra = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), za = Ba(TypeError);
2631
+ var ba = Y(Array.prototype.lastIndexOf), xa = Y(Array.prototype.pop), Sa = Y(Array.prototype.push), Ca = Y(Array.prototype.slice), wa = Y(Array.prototype.splice), Ta = Array.isArray, Ea = Va(Set), Da = Y(Set.prototype.add), Oa = Y(Set.prototype.has), ka = Y(String.prototype.toLowerCase), Aa = Y(String.prototype.toString), ja = Y(String.prototype.match), Ma = Y(String.prototype.replace), Na = Y(String.prototype.indexOf), Pa = Y(String.prototype.trim), Fa = Y(Number.prototype.toString), Ia = Y(Boolean.prototype.toString), La = typeof BigInt > "u" ? null : Y(BigInt.prototype.toString), Ra = typeof Symbol > "u" ? null : Y(Symbol.prototype.toString), q = Y(Object.prototype.hasOwnProperty), za = Y(Object.prototype.toString), J = Y(RegExp.prototype.test), Ba = Va(TypeError);
2622
2632
  function Y(e) {
2623
2633
  return function(t) {
2624
2634
  t instanceof RegExp && (t.lastIndex = 0);
2625
2635
  var n = [...arguments].slice(1);
2626
- return ga(e, t, n);
2636
+ return _a(e, t, n);
2627
2637
  };
2628
2638
  }
2629
- function Ba(e) {
2639
+ function Va(e) {
2630
2640
  return function() {
2631
- return _a(e, [...arguments]);
2641
+ return va(e, [...arguments]);
2632
2642
  };
2633
2643
  }
2634
2644
  function X(e, t) {
2635
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : Oa;
2636
- if (ua && ua(e, null), !wa(t)) return e;
2645
+ let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ka;
2646
+ if (da && da(e, null), !Ta(t)) return e;
2637
2647
  let r = t.length;
2638
2648
  for (; r--;) {
2639
2649
  let i = t[r];
2640
2650
  if (typeof i == "string") {
2641
2651
  let e = n(i);
2642
- e !== i && (da(t) || (t[r] = e), i = e);
2652
+ e !== i && (fa(t) || (t[r] = e), i = e);
2643
2653
  }
2644
2654
  e[i] = !0;
2645
2655
  }
2646
2656
  return e;
2647
2657
  }
2648
- function Va(e) {
2658
+ function Ha(e) {
2649
2659
  for (let t = 0; t < e.length; t++) q(e, t) || (e[t] = null);
2650
2660
  return e;
2651
2661
  }
2652
2662
  function Z(e) {
2653
- let t = ma(null);
2654
- for (let r of la(e)) {
2655
- var n = oa(r, 2);
2663
+ let t = ha(null);
2664
+ for (let r of ua(e)) {
2665
+ var n = sa(r, 2);
2656
2666
  let i = n[0], a = n[1];
2657
- q(e, i) && (t[i] = wa(a) ? Va(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
2667
+ q(e, i) && (t[i] = Ta(a) ? Ha(a) : a && typeof a == "object" && a.constructor === Object ? Z(a) : a);
2658
2668
  }
2659
2669
  return t;
2660
2670
  }
2661
- function Ha(e) {
2671
+ function Ua(e) {
2662
2672
  switch (typeof e) {
2663
2673
  case "string": return e;
2664
- case "number": return Pa(e);
2665
- case "boolean": return Fa(e);
2666
- case "bigint": return Ia ? Ia(e) : "0";
2667
- case "symbol": return La ? La(e) : "Symbol()";
2668
- case "undefined": return Ra(e);
2674
+ case "number": return Fa(e);
2675
+ case "boolean": return Ia(e);
2676
+ case "bigint": return La ? La(e) : "0";
2677
+ case "symbol": return Ra ? Ra(e) : "Symbol()";
2678
+ case "undefined": return za(e);
2669
2679
  case "function":
2670
2680
  case "object": {
2671
- if (e === null) return Ra(e);
2681
+ if (e === null) return za(e);
2672
2682
  let t = e, n = Q(t, "toString");
2673
2683
  if (typeof n == "function") {
2674
2684
  let e = n(t);
2675
- return typeof e == "string" ? e : Ra(e);
2685
+ return typeof e == "string" ? e : za(e);
2676
2686
  }
2677
- return Ra(e);
2687
+ return za(e);
2678
2688
  }
2679
- default: return Ra(e);
2689
+ default: return za(e);
2680
2690
  }
2681
2691
  }
2682
2692
  function Q(e, t) {
2683
2693
  for (; e !== null;) {
2684
- let n = pa(e, t);
2694
+ let n = ma(e, t);
2685
2695
  if (n) {
2686
2696
  if (n.get) return Y(n.get);
2687
2697
  if (typeof n.value == "function") return Y(n.value);
2688
2698
  }
2689
- e = fa(e);
2699
+ e = pa(e);
2690
2700
  }
2691
2701
  function n() {
2692
2702
  return null;
2693
2703
  }
2694
2704
  return n;
2695
2705
  }
2696
- function Ua(e, t) {
2706
+ function Wa(e, t) {
2697
2707
  for (; e !== null;) {
2698
- let n = pa(e, t);
2708
+ let n = ma(e, t);
2699
2709
  if (n) return n.get ? Y(n.get) : null;
2700
- e = fa(e);
2710
+ e = pa(e);
2701
2711
  }
2702
2712
  return null;
2703
2713
  }
2704
- function Wa(e) {
2714
+ function Ga(e) {
2705
2715
  try {
2706
2716
  return J(e, ""), !0;
2707
2717
  } catch {
2708
2718
  return !1;
2709
2719
  }
2710
2720
  }
2711
- var Ga = 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(".")), Ka = 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(".")), qa = G([
2721
+ var Ka = 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(".")), qa = 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(".")), Ja = G([
2712
2722
  "feBlend",
2713
2723
  "feColorMatrix",
2714
2724
  "feComponentTransfer",
@@ -2734,7 +2744,7 @@ var Ga = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2734
2744
  "feSpotLight",
2735
2745
  "feTile",
2736
2746
  "feTurbulence"
2737
- ]), Ja = G([
2747
+ ]), Ya = G([
2738
2748
  "animate",
2739
2749
  "color-profile",
2740
2750
  "cursor",
@@ -2757,7 +2767,7 @@ var Ga = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2757
2767
  "solidcolor",
2758
2768
  "unknown",
2759
2769
  "use"
2760
- ]), Ya = 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(".")), Xa = G([
2770
+ ]), Xa = 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(".")), Za = G([
2761
2771
  "maction",
2762
2772
  "maligngroup",
2763
2773
  "malignmark",
@@ -2773,13 +2783,13 @@ var Ga = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2773
2783
  "annotation-xml",
2774
2784
  "mprescripts",
2775
2785
  "none"
2776
- ]), Za = G(["#text"]), Qa = 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(".")), $a = 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(".")), eo = 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(".")), to = G([
2786
+ ]), Qa = G(["#text"]), $a = 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(".")), eo = 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(".")), to = 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(".")), no = G([
2777
2787
  "xlink:href",
2778
2788
  "xml:id",
2779
2789
  "xlink:title",
2780
2790
  "xml:space",
2781
2791
  "xmlns:xlink"
2782
- ]), no = K(/{{[\w\W]*|^[\w\W]*}}/g), ro = K(/<%[\w\W]*|^[\w\W]*%>/g), io = K(/\${[\w\W]*/g), ao = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), oo = K(/^aria-[\-\w]+$/), so = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), co = K(/^(?:\w+script|data):/i), lo = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), uo = K(/^html$/i), fo = K(/^[a-z][.\w]*(-[.\w]+)+$/i), po = K(/<[/\w!]/g), mo = K(/<[/\w]/g), ho = K(/<\/no(script|embed|frames)/i), go = K(/\/>/i), $ = {
2792
+ ]), ro = K(/{{[\w\W]*|^[\w\W]*}}/g), io = K(/<%[\w\W]*|^[\w\W]*%>/g), ao = K(/\${[\w\W]*/g), oo = K(/^data-[\-\w.\u00B7-\uFFFF]+$/), so = K(/^aria-[\-\w]+$/), co = K(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i), lo = K(/^(?:\w+script|data):/i), uo = K(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g), fo = K(/^html$/i), po = K(/^[a-z][.\w]*(-[.\w]+)+$/i), mo = K(/<[/\w!]/g), ho = K(/<[/\w]/g), go = K(/<\/no(script|embed|frames)/i), _o = K(/\/>/i), $ = {
2783
2793
  element: 1,
2784
2794
  attribute: 2,
2785
2795
  text: 3,
@@ -2792,7 +2802,7 @@ var Ga = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2792
2802
  documentType: 10,
2793
2803
  documentFragment: 11,
2794
2804
  notation: 12
2795
- }, _o = G(X({}, [
2805
+ }, vo = G(X({}, [
2796
2806
  "style",
2797
2807
  "script",
2798
2808
  "xmp",
@@ -2801,9 +2811,9 @@ var Ga = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2801
2811
  "noframes",
2802
2812
  "plaintext",
2803
2813
  "noscript"
2804
- ])), vo = function() {
2814
+ ])), yo = function() {
2805
2815
  return typeof window > "u" ? null : window;
2806
- }, yo = function(e, t) {
2816
+ }, bo = function(e, t) {
2807
2817
  if (typeof e != "object" || typeof e.createPolicy != "function") return null;
2808
2818
  let n = null, r = "data-tt-policy-suffix";
2809
2819
  t && t.hasAttribute(r) && (n = t.getAttribute(r));
@@ -2820,7 +2830,7 @@ var Ga = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2820
2830
  } catch {
2821
2831
  return console.warn("TrustedTypes policy " + i + " could not be created."), null;
2822
2832
  }
2823
- }, bo = function() {
2833
+ }, xo = function() {
2824
2834
  return {
2825
2835
  afterSanitizeAttributes: [],
2826
2836
  afterSanitizeElements: [],
@@ -2832,62 +2842,62 @@ var Ga = G(/* @__PURE__ */ "a.abbr.acronym.address.area.article.aside.audio.b.bd
2832
2842
  uponSanitizeElement: [],
2833
2843
  uponSanitizeShadowNode: []
2834
2844
  };
2835
- }, xo = function(e, t, n, r) {
2836
- return q(e, t) && wa(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
2837
- }, So = function(e, t, n) {
2845
+ }, So = function(e, t, n, r) {
2846
+ return q(e, t) && Ta(e[t]) ? X(r.base ? Z(r.base) : {}, e[t], r.transform) : n;
2847
+ }, Co = function(e, t, n) {
2838
2848
  let r = q(e, t) ? e[t] : void 0;
2839
2849
  return r && typeof r == "object" ? Z(r) : n();
2840
2850
  };
2841
- function Co() {
2842
- let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : vo(), t = (e) => Co(e);
2851
+ function wo() {
2852
+ let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : yo(), t = (e) => wo(e);
2843
2853
  if (t.version = "3.4.17", t.removed = [], !e || !e.document || e.document.nodeType !== $.document || !e.Element) return t.isSupported = !1, t;
2844
2854
  let n = e.document, r = n, i = r.currentScript;
2845
2855
  e.DocumentFragment;
2846
2856
  let a = e.HTMLTemplateElement, o = e.Node, s = e.Element, c = e.NodeFilter;
2847
2857
  e.NamedNodeMap === void 0 && (e.NamedNodeMap || e.MozNamedAttrMap), e.HTMLFormElement;
2848
- let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), te = Q(d, "childNodes"), ne = Q(d, "parentNode"), re = Q(d, "shadowRoot"), ie = Q(d, "attributes"), ae = o && o.prototype ? Q(o.prototype, "nodeType") : null, h = o && o.prototype ? Q(o.prototype, "nodeName") : null, oe = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, g = function(e) {
2849
- return ae ? ae(e) : e.nodeType;
2850
- }, se = function(e) {
2851
- return h ? h(e) : e.nodeName;
2852
- }, ce = Ua(d, "namespaceURI"), le = function(e) {
2853
- return ce ? ce(e) : e.namespaceURI;
2858
+ let l = e.DOMParser, u = e.trustedTypes, d = s.prototype, f = Q(d, "cloneNode"), p = Q(d, "remove"), ee = Q(d, "removeAttributeNode"), m = Q(d, "nextSibling"), h = Q(d, "childNodes"), te = Q(d, "parentNode"), ne = Q(d, "shadowRoot"), re = Q(d, "attributes"), ie = o && o.prototype ? Q(o.prototype, "nodeType") : null, g = o && o.prototype ? Q(o.prototype, "nodeName") : null, _ = o && o.prototype ? Q(o.prototype, "ownerDocument") : null, v = function(e) {
2859
+ return ie ? ie(e) : e.nodeType;
2860
+ }, ae = function(e) {
2861
+ return g ? g(e) : e.nodeName;
2862
+ }, oe = Wa(d, "namespaceURI"), se = function(e) {
2863
+ return oe ? oe(e) : e.namespaceURI;
2854
2864
  };
2855
2865
  if (typeof a == "function") {
2856
2866
  let e = n.createElement("template");
2857
2867
  e.content && e.content.ownerDocument && (n = e.content.ownerDocument);
2858
2868
  }
2859
- let _, v = "", ue, de = !1, fe = 0, pe = function() {
2860
- if (fe > 0) throw za("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.");
2861
- }, y = function(e) {
2862
- pe(), fe++;
2869
+ let y, b = "", ce, le = !1, ue = 0, de = function() {
2870
+ if (ue > 0) throw Ba("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.");
2871
+ }, x = function(e) {
2872
+ de(), ue++;
2863
2873
  try {
2864
- return _.createHTML(e);
2874
+ return y.createHTML(e);
2865
2875
  } finally {
2866
- fe--;
2876
+ ue--;
2867
2877
  }
2868
- }, me = function(e) {
2869
- pe(), fe++;
2878
+ }, fe = function(e) {
2879
+ de(), ue++;
2870
2880
  try {
2871
- return _.createScriptURL(e);
2881
+ return y.createScriptURL(e);
2872
2882
  } finally {
2873
- fe--;
2874
- }
2875
- }, b = function() {
2876
- return de ||= (ue = yo(u, i), !0), ue;
2877
- }, he = n, ge = he.implementation, _e = he.createNodeIterator, ve = he.createDocumentFragment, ye = he.getElementsByTagName, be = r.importNode, x = bo();
2878
- t.isSupported = typeof la == "function" && typeof ne == "function" && ge && ge.createHTMLDocument !== void 0;
2879
- let xe = no, Se = ro, Ce = io, we = ao, Te = oo, S = co, Ee = lo, De = fo, Oe = so, C = null, ke = X({}, [
2880
- ...Ga,
2883
+ ue--;
2884
+ }
2885
+ }, S = function() {
2886
+ return le ||= (ce = bo(u, i), !0), ce;
2887
+ }, pe = n, me = pe.implementation, he = pe.createNodeIterator, ge = pe.createDocumentFragment, _e = pe.getElementsByTagName, ve = r.importNode, C = xo();
2888
+ t.isSupported = typeof ua == "function" && typeof te == "function" && me && me.createHTMLDocument !== void 0;
2889
+ let ye = ro, be = io, xe = ao, Se = oo, Ce = so, we = lo, Te = uo, Ee = po, De = co, w = null, Oe = X({}, [
2881
2890
  ...Ka,
2882
2891
  ...qa,
2883
- ...Ya,
2884
- ...Za
2885
- ]), w = null, Ae = X({}, [
2886
- ...Qa,
2892
+ ...Ja,
2893
+ ...Xa,
2894
+ ...Qa
2895
+ ]), T = null, ke = X({}, [
2887
2896
  ...$a,
2888
2897
  ...eo,
2889
- ...to
2890
- ]), T = Object.seal(ma(null, {
2898
+ ...to,
2899
+ ...no
2900
+ ]), E = Object.seal(ha(null, {
2891
2901
  tagNameCheck: {
2892
2902
  writable: !0,
2893
2903
  configurable: !1,
@@ -2906,7 +2916,7 @@ function Co() {
2906
2916
  enumerable: !0,
2907
2917
  value: !1
2908
2918
  }
2909
- })), je = null, Me = null, Ne = Object.seal(ma(null, {
2919
+ })), Ae = null, je = null, Me = Object.seal(ha(null, {
2910
2920
  tagCheck: {
2911
2921
  writable: !0,
2912
2922
  configurable: !1,
@@ -2919,7 +2929,7 @@ function Co() {
2919
2929
  enumerable: !0,
2920
2930
  value: null
2921
2931
  }
2922
- })), Pe = !0, Fe = !0, Ie = !1, Le = !0, E = !1, Re = !0, ze = !1, Be = !1, Ve = null, He = null, Ue = !1, We = !1, Ge = !1, Ke = !1, qe = !0, Je = !1, Ye = "user-content-", D = !0, Xe = !1, Ze = null, Qe = {}, O = null, $e = 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(".")), et = null, tt = X({}, [
2932
+ })), Ne = !0, Pe = !0, Fe = !1, Ie = !0, D = !1, Le = !0, Re = !1, ze = !1, Be = null, Ve = null, He = !1, Ue = !1, We = !1, Ge = !1, Ke = !0, qe = !1, Je = "user-content-", Ye = !0, O = !1, Xe = null, Ze = {}, Qe = null, $e = 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(".")), et = null, tt = X({}, [
2923
2933
  "audio",
2924
2934
  "video",
2925
2935
  "img",
@@ -2945,13 +2955,13 @@ function Co() {
2945
2955
  it,
2946
2956
  at,
2947
2957
  k
2948
- ], ka), ut = G([
2958
+ ], Aa), ut = G([
2949
2959
  "mi",
2950
2960
  "mo",
2951
2961
  "mn",
2952
2962
  "ms",
2953
2963
  "mtext"
2954
- ]), A = X({}, ut), dt = G(["annotation-xml"]), ft = X({}, dt), pt = X({}, [
2964
+ ]), dt = X({}, ut), A = G(["annotation-xml"]), ft = X({}, A), pt = X({}, [
2955
2965
  "title",
2956
2966
  "style",
2957
2967
  "font",
@@ -2962,51 +2972,51 @@ function Co() {
2962
2972
  }, yt = function() {
2963
2973
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2964
2974
  if (gt && gt === e) return;
2965
- (!e || typeof e != "object") && (e = {}), e = Z(e), mt = ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, j = mt === "application/xhtml+xml" ? ka : Oa, C = xo(e, "ALLOWED_TAGS", ke, { transform: j }), w = xo(e, "ALLOWED_ATTR", Ae, { transform: j }), ct = xo(e, "ALLOWED_NAMESPACES", lt, { transform: ka }), nt = xo(e, "ADD_URI_SAFE_ATTR", rt, {
2975
+ (!e || typeof e != "object") && (e = {}), e = Z(e), mt = ht.indexOf(e.PARSER_MEDIA_TYPE) === -1 ? "text/html" : e.PARSER_MEDIA_TYPE, j = mt === "application/xhtml+xml" ? Aa : ka, w = So(e, "ALLOWED_TAGS", Oe, { transform: j }), T = So(e, "ALLOWED_ATTR", ke, { transform: j }), ct = So(e, "ALLOWED_NAMESPACES", lt, { transform: Aa }), nt = So(e, "ADD_URI_SAFE_ATTR", rt, {
2966
2976
  transform: j,
2967
2977
  base: rt
2968
- }), et = xo(e, "ADD_DATA_URI_TAGS", tt, {
2978
+ }), et = So(e, "ADD_DATA_URI_TAGS", tt, {
2969
2979
  transform: j,
2970
2980
  base: tt
2971
- }), O = xo(e, "FORBID_CONTENTS", $e, { transform: j }), je = xo(e, "FORBID_TAGS", Z({}), { transform: j }), Me = xo(e, "FORBID_ATTR", Z({}), { transform: j }), Qe = q(e, "USE_PROFILES") ? e.USE_PROFILES && typeof e.USE_PROFILES == "object" ? Z(e.USE_PROFILES) : e.USE_PROFILES : !1, Pe = e.ALLOW_ARIA_ATTR !== !1, Fe = e.ALLOW_DATA_ATTR !== !1, Ie = e.ALLOW_UNKNOWN_PROTOCOLS || !1, Le = e.ALLOW_SELF_CLOSE_IN_ATTR !== !1, E = e.SAFE_FOR_TEMPLATES || !1, Re = e.SAFE_FOR_XML !== !1, ze = e.WHOLE_DOCUMENT || !1, We = e.RETURN_DOM || !1, Ge = e.RETURN_DOM_FRAGMENT || !1, Ke = e.RETURN_TRUSTED_TYPE || !1, Ue = e.FORCE_BODY || !1, qe = e.SANITIZE_DOM !== !1, Je = e.SANITIZE_NAMED_PROPS || !1, D = e.KEEP_CONTENT !== !1, Xe = e.IN_PLACE || !1, Oe = Wa(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : so, ot = typeof e.NAMESPACE == "string" ? e.NAMESPACE : k, A = So(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, ut)), ft = So(e, "HTML_INTEGRATION_POINTS", () => X({}, dt));
2972
- let t = So(e, "CUSTOM_ELEMENT_HANDLING", () => ma(null));
2973
- if (T = ma(null), q(t, "tagNameCheck") && vt(t.tagNameCheck) && (T.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && vt(t.attributeNameCheck) && (T.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (T.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(T), E && (Fe = !1), Ge && (We = !0), Qe && (C = X({}, Za), w = ma(null), Qe.html === !0 && (X(C, Ga), X(w, Qa)), Qe.svg === !0 && (X(C, Ka), X(w, $a), X(w, to)), Qe.svgFilters === !0 && (X(C, qa), X(w, $a), X(w, to)), Qe.mathMl === !0 && (X(C, Ya), X(w, eo), X(w, to))), Ne.tagCheck = null, Ne.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Ne.tagCheck = e.ADD_TAGS : wa(e.ADD_TAGS) && (C === ke && (C = Z(C)), X(C, e.ADD_TAGS, j))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Ne.attributeCheck = e.ADD_ATTR : wa(e.ADD_ATTR) && (w === Ae && (w = Z(w)), X(w, e.ADD_ATTR, j))), q(e, "ADD_FORBID_CONTENTS") && wa(e.ADD_FORBID_CONTENTS) && (O === $e && (O = Z(O)), X(O, e.ADD_FORBID_CONTENTS, j)), D && (C["#text"] = !0), ze && X(C, [
2981
+ }), Qe = So(e, "FORBID_CONTENTS", $e, { transform: j }), Ae = So(e, "FORBID_TAGS", Z({}), { transform: j }), je = So(e, "FORBID_ATTR", Z({}), { transform: j }), Ze = 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, D = e.SAFE_FOR_TEMPLATES || !1, Le = e.SAFE_FOR_XML !== !1, Re = e.WHOLE_DOCUMENT || !1, Ue = e.RETURN_DOM || !1, We = e.RETURN_DOM_FRAGMENT || !1, Ge = e.RETURN_TRUSTED_TYPE || !1, He = e.FORCE_BODY || !1, Ke = e.SANITIZE_DOM !== !1, qe = e.SANITIZE_NAMED_PROPS || !1, Ye = e.KEEP_CONTENT !== !1, O = e.IN_PLACE || !1, De = Ga(e.ALLOWED_URI_REGEXP) ? e.ALLOWED_URI_REGEXP : co, ot = typeof e.NAMESPACE == "string" ? e.NAMESPACE : k, dt = Co(e, "MATHML_TEXT_INTEGRATION_POINTS", () => X({}, ut)), ft = Co(e, "HTML_INTEGRATION_POINTS", () => X({}, A));
2982
+ let t = Co(e, "CUSTOM_ELEMENT_HANDLING", () => ha(null));
2983
+ if (E = ha(null), q(t, "tagNameCheck") && vt(t.tagNameCheck) && (E.tagNameCheck = t.tagNameCheck), q(t, "attributeNameCheck") && vt(t.attributeNameCheck) && (E.attributeNameCheck = t.attributeNameCheck), q(t, "allowCustomizedBuiltInElements") && typeof t.allowCustomizedBuiltInElements == "boolean" && (E.allowCustomizedBuiltInElements = t.allowCustomizedBuiltInElements), K(E), D && (Pe = !1), We && (Ue = !0), Ze && (w = X({}, Qa), T = ha(null), Ze.html === !0 && (X(w, Ka), X(T, $a)), Ze.svg === !0 && (X(w, qa), X(T, eo), X(T, no)), Ze.svgFilters === !0 && (X(w, Ja), X(T, eo), X(T, no)), Ze.mathMl === !0 && (X(w, Xa), X(T, to), X(T, no))), Me.tagCheck = null, Me.attributeCheck = null, q(e, "ADD_TAGS") && (typeof e.ADD_TAGS == "function" ? Me.tagCheck = e.ADD_TAGS : Ta(e.ADD_TAGS) && (w === Oe && (w = Z(w)), X(w, e.ADD_TAGS, j))), q(e, "ADD_ATTR") && (typeof e.ADD_ATTR == "function" ? Me.attributeCheck = e.ADD_ATTR : Ta(e.ADD_ATTR) && (T === ke && (T = Z(T)), X(T, e.ADD_ATTR, j))), q(e, "ADD_FORBID_CONTENTS") && Ta(e.ADD_FORBID_CONTENTS) && (Qe === $e && (Qe = Z(Qe)), X(Qe, e.ADD_FORBID_CONTENTS, j)), Ye && (w["#text"] = !0), Re && X(w, [
2974
2984
  "html",
2975
2985
  "head",
2976
2986
  "body"
2977
- ]), C.table && (X(C, ["tbody"]), delete je.tbody), e.TRUSTED_TYPES_POLICY) {
2978
- if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw za("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
2979
- if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw za("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
2980
- let t = _;
2981
- _ = e.TRUSTED_TYPES_POLICY;
2987
+ ]), w.table && (X(w, ["tbody"]), delete Ae.tbody), e.TRUSTED_TYPES_POLICY) {
2988
+ if (typeof e.TRUSTED_TYPES_POLICY.createHTML != "function") throw Ba("TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.");
2989
+ if (typeof e.TRUSTED_TYPES_POLICY.createScriptURL != "function") throw Ba("TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.");
2990
+ let t = y;
2991
+ y = e.TRUSTED_TYPES_POLICY;
2982
2992
  try {
2983
- v = y("");
2993
+ b = x("");
2984
2994
  } catch (e) {
2985
- throw _ = t, e;
2995
+ throw y = t, e;
2986
2996
  }
2987
- } else e.TRUSTED_TYPES_POLICY === null ? (_ = void 0, v = "") : (_ === void 0 && (_ = b()), _ && typeof v == "string" && (v = y("")));
2997
+ } else e.TRUSTED_TYPES_POLICY === null ? (y = void 0, b = "") : (y === void 0 && (y = S()), y && typeof b == "string" && (b = x("")));
2988
2998
  G && G(e), gt = e;
2989
2999
  }, bt = X({}, [
2990
- ...Ka,
2991
3000
  ...qa,
2992
- ...Ja
2993
- ]), xt = X({}, [...Ya, ...Xa]), St = function(e, t, n) {
2994
- return t.namespaceURI === k ? e === "svg" : t.namespaceURI === it ? e === "svg" && (n === "annotation-xml" || A[n]) : !!bt[e];
3001
+ ...Ja,
3002
+ ...Ya
3003
+ ]), xt = X({}, [...Xa, ...Za]), St = function(e, t, n) {
3004
+ return t.namespaceURI === k ? e === "svg" : t.namespaceURI === it ? e === "svg" && (n === "annotation-xml" || dt[n]) : !!bt[e];
2995
3005
  }, Ct = function(e, t, n) {
2996
3006
  return t.namespaceURI === k ? e === "math" : t.namespaceURI === at ? e === "math" && ft[n] : !!xt[e];
2997
3007
  }, wt = function(e, t, n) {
2998
- return t.namespaceURI === at && !ft[n] || t.namespaceURI === it && !A[n] ? !1 : !xt[e] && (pt[e] || !bt[e]);
3008
+ return t.namespaceURI === at && !ft[n] || t.namespaceURI === it && !dt[n] ? !1 : !xt[e] && (pt[e] || !bt[e]);
2999
3009
  }, Tt = function(e) {
3000
- let t = le(e), n = Oa(se(e)), r = ne(e), i, a;
3001
- return r && g(r) === $.element ? (i = { namespaceURI: le(r) }, a = Oa(se(r))) : (i = { namespaceURI: ot }, a = "template"), ct[t] ? t === at ? St(n, i, a) : t === it ? Ct(n, i, a) : t === k ? wt(n, i, a) : !!(mt === "application/xhtml+xml" && ct[t]) : !1;
3010
+ let t = se(e), n = ka(ae(e)), r = te(e), i, a;
3011
+ return r && v(r) === $.element ? (i = { namespaceURI: se(r) }, a = ka(ae(r))) : (i = { namespaceURI: ot }, a = "template"), ct[t] ? t === at ? St(n, i, a) : t === it ? Ct(n, i, a) : t === k ? wt(n, i, a) : !!(mt === "application/xhtml+xml" && ct[t]) : !1;
3002
3012
  }, M = function(e) {
3003
- xa(t.removed, { element: e });
3013
+ Sa(t.removed, { element: e });
3004
3014
  try {
3005
- ne(e).removeChild(e);
3015
+ te(e).removeChild(e);
3006
3016
  } catch {
3007
- if (p(e), !ne(e)) throw za("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
3017
+ if (p(e), !te(e)) throw Ba("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place");
3008
3018
  }
3009
- }, N = function(e, t, n) {
3019
+ }, Et = function(e, t, n) {
3010
3020
  try {
3011
3021
  ee(e, t);
3012
3022
  } catch {
@@ -3014,18 +3024,18 @@ function Co() {
3014
3024
  e.removeAttribute(n);
3015
3025
  } catch {}
3016
3026
  }
3017
- }, Et = function(e) {
3027
+ }, N = function(e) {
3018
3028
  At(e);
3019
- let t = te(e);
3020
- t && va(Sa(t), (e) => {
3029
+ let t = h(e);
3030
+ t && ya(Ca(t), (e) => {
3021
3031
  try {
3022
3032
  p(e);
3023
3033
  } catch {}
3024
3034
  });
3025
- let n = g(e) === $.element ? ie(e) : null;
3035
+ let n = v(e) === $.element ? re(e) : null;
3026
3036
  if (n) for (let t = n.length - 1; t >= 0; --t) {
3027
3037
  let r = n[t], i = r && r.name;
3028
- typeof i == "string" && N(e, r, i);
3038
+ typeof i == "string" && Et(e, r, i);
3029
3039
  }
3030
3040
  }, Dt = function(e, n, r) {
3031
3041
  if (!r) try {
@@ -3033,7 +3043,7 @@ function Co() {
3033
3043
  } catch {
3034
3044
  r = null;
3035
3045
  }
3036
- xa(t.removed, {
3046
+ Sa(t.removed, {
3037
3047
  attribute: r || null,
3038
3048
  from: n
3039
3049
  });
@@ -3045,7 +3055,7 @@ function Co() {
3045
3055
  } catch {}
3046
3056
  }
3047
3057
  if (e === "is") {
3048
- if (We || Ge) try {
3058
+ if (Ue || We) try {
3049
3059
  M(n);
3050
3060
  } catch {}
3051
3061
  else try {
@@ -3053,26 +3063,26 @@ function Co() {
3053
3063
  } catch {}
3054
3064
  }
3055
3065
  }, Ot = function(e) {
3056
- let t = ie(e);
3066
+ let t = re(e);
3057
3067
  if (t) for (let n = t.length - 1; n >= 0; --n) {
3058
3068
  let r = t[n], i = r && r.name;
3059
- typeof i != "string" || w[j(i)] || N(e, r, i);
3069
+ typeof i != "string" || T[j(i)] || Et(e, r, i);
3060
3070
  }
3061
3071
  }, kt = function(e, t) {
3062
3072
  let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], r = [e];
3063
3073
  for (; r.length > 0;) {
3064
3074
  let e = r.pop();
3065
3075
  if (t(e) === !1) continue;
3066
- if (n && g(e) === $.element) {
3067
- let t = re(e);
3068
- Ut(t) && r.push(t);
3076
+ if (n && v(e) === $.element) {
3077
+ let t = ne(e);
3078
+ F(t) && r.push(t);
3069
3079
  }
3070
- let i = te(e);
3080
+ let i = h(e);
3071
3081
  if (i) for (let e = i.length - 1; e >= 0; --e) r.push(i[e]);
3072
3082
  }
3073
3083
  }, At = function(e) {
3074
3084
  kt(e, (e) => {
3075
- g(e) === $.element && Ot(e);
3085
+ v(e) === $.element && Ot(e);
3076
3086
  });
3077
3087
  }, jt = function(e) {
3078
3088
  let t = [];
@@ -3080,49 +3090,49 @@ function Co() {
3080
3090
  t.push(e);
3081
3091
  }, !0), t;
3082
3092
  }, Mt = function(e, t) {
3083
- let n = Ta();
3084
- va(jt(e), (e) => {
3085
- g(e) === $.element && Ea(n, e);
3086
- }), va(t, (e) => {
3087
- g(e) === $.element && !Da(n, e) && Ot(e);
3093
+ let n = Ea();
3094
+ ya(jt(e), (e) => {
3095
+ v(e) === $.element && Da(n, e);
3096
+ }), ya(t, (e) => {
3097
+ v(e) === $.element && !Oa(n, e) && Ot(e);
3088
3098
  });
3089
3099
  }, Nt = function(e, n) {
3090
3100
  let r = !1;
3091
- return va(t.removed, (t) => {
3101
+ return ya(t.removed, (t) => {
3092
3102
  t.element && (r ||= t.element === e, At(t.element));
3093
3103
  }), Mt(e, n), r;
3094
3104
  }, Pt = function(e, t) {
3095
- let n = Ze, r = null, i = () => (r || (r = Ta(), va(t, (e) => {
3096
- Ea(r, e);
3105
+ let n = Xe, r = null, i = () => (r || (r = Ea(), ya(t, (e) => {
3106
+ Da(r, e);
3097
3107
  })), r);
3098
3108
  for (let t = 0;; t++) {
3099
3109
  let r = jt(e), a = [e], o = !1;
3100
- if (va(r, (e) => {
3101
- g(e) === $.documentFragment ? xa(a, e) : !o && !Da(n, e) && (o = Da(i(), e));
3110
+ if (ya(r, (e) => {
3111
+ v(e) === $.documentFragment ? Sa(a, e) : !o && !Oa(n, e) && (o = Oa(i(), e));
3102
3112
  }), !o) return;
3103
- if (t >= 8) throw za("the tree kept changing during in-place sanitization; refusing to return it");
3104
- va(a, (t, n) => {
3113
+ if (t >= 8) throw Ba("the tree kept changing during in-place sanitization; refusing to return it");
3114
+ ya(a, (t, n) => {
3105
3115
  Ft(t, n > 0, e, i());
3106
3116
  });
3107
3117
  }
3108
3118
  }, Ft = function(e, t, n, r) {
3109
3119
  let i = Bt(e), a;
3110
- for (; a = i.nextNode();) Da(r, a) && !Da(Ze, a) && (t && I(x.uponSanitizeShadowNode, a, null), Xt(a, n), L(a, n), Ut(a.content) && rn(a.content));
3120
+ for (; a = i.nextNode();) Oa(r, a) && !Oa(Xe, a) && (t && I(C.uponSanitizeShadowNode, a, null), Xt(a, n), rn(a, n), F(a.content) && L(a.content));
3111
3121
  }, It = function(e) {
3112
- Ze && Ea(Ze, e);
3122
+ Xe && Da(Xe, e);
3113
3123
  }, Lt = function(e, t) {
3114
- return Re ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
3124
+ return Le ? e === "patchsrc" || e === "for" && t !== "label" && t !== "output" : !1;
3115
3125
  }, Rt = function(e) {
3116
- Re && kt(e, (e) => {
3117
- let t = g(e);
3118
- if (t === $.processingInstruction || t === $.comment && J(mo, e.data)) {
3126
+ Le && kt(e, (e) => {
3127
+ let t = v(e);
3128
+ if (t === $.processingInstruction || t === $.comment && J(ho, e.data)) {
3119
3129
  try {
3120
3130
  p(e);
3121
3131
  } catch {}
3122
3132
  return !1;
3123
3133
  }
3124
3134
  if (t === $.element) {
3125
- let t = e, n = j(se(e));
3135
+ let t = e, n = j(ae(e));
3126
3136
  try {
3127
3137
  t.hasAttribute && t.hasAttribute("patchsrc") && t.removeAttribute("patchsrc"), t.hasAttribute && t.hasAttribute("for") && Lt("for", n) && t.removeAttribute("for");
3128
3138
  } catch {}
@@ -3131,70 +3141,70 @@ function Co() {
3131
3141
  });
3132
3142
  }, zt = function(e) {
3133
3143
  let t = null, r = null;
3134
- if (Ue) e = "<remove></remove>" + e;
3144
+ if (He) e = "<remove></remove>" + e;
3135
3145
  else {
3136
- let t = Aa(e, /^[\r\n\t ]+/);
3146
+ let t = ja(e, /^[\r\n\t ]+/);
3137
3147
  r = t && t[0];
3138
3148
  }
3139
3149
  mt === "application/xhtml+xml" && ot === k && (e = "<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>" + e + "</body></html>");
3140
- let i = _ ? y(e) : e;
3150
+ let i = y ? x(e) : e;
3141
3151
  if (ot === k) try {
3142
3152
  t = new l().parseFromString(i, mt);
3143
3153
  } catch {}
3144
3154
  if (!t || !t.documentElement) {
3145
- t = ge.createDocument(ot, "template", null);
3155
+ t = me.createDocument(ot, "template", null);
3146
3156
  try {
3147
- t.documentElement.innerHTML = st ? v : i;
3157
+ t.documentElement.innerHTML = st ? b : i;
3148
3158
  } catch {}
3149
3159
  }
3150
3160
  let a = t.body || t.documentElement;
3151
- return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ot === k ? ye.call(t, ze ? "html" : "body")[0] : ze ? t.documentElement : a;
3161
+ return e && r && a.insertBefore(n.createTextNode(r), a.childNodes[0] || null), ot === k ? _e.call(t, Re ? "html" : "body")[0] : Re ? t.documentElement : a;
3152
3162
  }, Bt = function(e) {
3153
- let t = oe ? oe(e) : e.ownerDocument;
3154
- return _e.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
3163
+ let t = _ ? _(e) : e.ownerDocument;
3164
+ return he.call(t || e, e, c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION, null);
3155
3165
  }, Vt = function(e) {
3156
- return e = ja(e, xe, " "), e = ja(e, Se, " "), e = ja(e, Ce, " "), e;
3166
+ return e = Ma(e, ye, " "), e = Ma(e, be, " "), e = Ma(e, xe, " "), e;
3157
3167
  }, Ht = function(e) {
3158
- P(e);
3168
+ Ut(e);
3159
3169
  let t = e.querySelectorAll?.call(e, "template");
3160
- t && va(t, (e) => {
3161
- Ut(e.content) && Ht(e.content);
3170
+ t && ya(t, (e) => {
3171
+ F(e.content) && Ht(e.content);
3162
3172
  });
3163
- }, P = function(e) {
3173
+ }, Ut = function(e) {
3164
3174
  e.normalize();
3165
- let t = oe ? oe(e) : e.ownerDocument, n = _e.call(t || e, e, c.SHOW_TEXT | c.SHOW_COMMENT | c.SHOW_CDATA_SECTION | c.SHOW_PROCESSING_INSTRUCTION, null), r = n.nextNode();
3175
+ let t = _ ? _(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();
3166
3176
  for (; r;) r.data = Vt(r.data), r = n.nextNode();
3177
+ }, P = function(e) {
3178
+ let t = g ? g(e) : null;
3179
+ return typeof t != "string" || j(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== re(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 !== ie(e) || e.childNodes !== h(e);
3167
3180
  }, F = function(e) {
3168
- let t = h ? h(e) : null;
3169
- return typeof t != "string" || j(t) !== "form" ? !1 : typeof e.nodeName != "string" || typeof e.textContent != "string" || typeof e.removeChild != "function" || e.attributes !== ie(e) || typeof e.removeAttribute != "function" || typeof e.removeAttributeNode != "function" || typeof e.getAttributeNode != "function" || typeof e.setAttribute != "function" || typeof e.namespaceURI != "string" || typeof e.insertBefore != "function" || typeof e.hasChildNodes != "function" || e.nodeType !== ae(e) || e.childNodes !== te(e);
3170
- }, Ut = function(e) {
3171
- if (!ae || typeof e != "object" || !e) return !1;
3181
+ if (!ie || typeof e != "object" || !e) return !1;
3172
3182
  try {
3173
- return ae(e) === $.documentFragment;
3183
+ return ie(e) === $.documentFragment;
3174
3184
  } catch {
3175
3185
  return !1;
3176
3186
  }
3177
3187
  }, Wt = function(e) {
3178
- if (!ae || typeof e != "object" || !e) return !1;
3188
+ if (!ie || typeof e != "object" || !e) return !1;
3179
3189
  try {
3180
- return typeof ae(e) == "number";
3190
+ return typeof ie(e) == "number";
3181
3191
  } catch {
3182
3192
  return !1;
3183
3193
  }
3184
3194
  };
3185
3195
  function I(e, n, r) {
3186
- e.length !== 0 && va(e, (e) => {
3196
+ e.length !== 0 && ya(e, (e) => {
3187
3197
  e.call(t, n, r, gt);
3188
3198
  });
3189
3199
  }
3190
3200
  let Gt = function(e, t) {
3191
- return !!(Re && e.hasChildNodes() && !Wt(e.firstElementChild) && J(po, e.textContent) && J(po, e.innerHTML) || Re && _o[t] && g(e) === $.element && le(e) === k && (Wt(e.firstElementChild) || typeof e.textContent == "string" && J(po, e.textContent)) || e.nodeType === $.processingInstruction || Re && e.nodeType === $.comment && J(mo, e.data));
3201
+ return !!(Le && e.hasChildNodes() && !Wt(e.firstElementChild) && J(mo, e.textContent) && J(mo, e.innerHTML) || Le && vo[t] && v(e) === $.element && se(e) === k && (Wt(e.firstElementChild) || typeof e.textContent == "string" && J(mo, e.textContent)) || e.nodeType === $.processingInstruction || Le && e.nodeType === $.comment && J(ho, e.data));
3192
3202
  }, Kt = function(e, t) {
3193
3203
  return e instanceof RegExp ? J(e, t) : e instanceof Function && !!e(t, ...[...arguments].slice(2));
3194
3204
  }, qt = function(e, t, n) {
3195
- if (!je[t] && $t(t) && Kt(T.tagNameCheck, t)) return !1;
3196
- if (D && !O[t] && !O[Oa(t)]) {
3197
- let t = ne(e), r = te(e);
3205
+ if (!Ae[t] && $t(t) && Kt(E.tagNameCheck, t)) return !1;
3206
+ if (Ye && !Qe[t] && !Qe[ka(t)]) {
3207
+ let t = te(e), r = h(e);
3198
3208
  if (r && t) {
3199
3209
  let i = r.length;
3200
3210
  for (let a = i - 1; a >= 0; --a) {
@@ -3207,30 +3217,30 @@ function Co() {
3207
3217
  }, Jt = function(e, t, n, r) {
3208
3218
  return e.length === 0 ? t : t === n || t === r ? Z(t) : t;
3209
3219
  }, Yt = function(e, t) {
3210
- return e === t || ne(e) !== null ? !1 : (Xe && At(e), !0);
3220
+ return e === t || te(e) !== null ? !1 : (O && At(e), !0);
3211
3221
  }, Xt = function(e, n) {
3212
- if (It(e), I(x.beforeSanitizeElements, e, null), Yt(e, n)) return !0;
3213
- if (F(e)) return M(e), !0;
3214
- let r = j(se(e));
3215
- if (C = Jt(x.uponSanitizeElement, C, ke, Ve), I(x.uponSanitizeElement, e, {
3222
+ if (It(e), I(C.beforeSanitizeElements, e, null), Yt(e, n)) return !0;
3223
+ if (P(e)) return M(e), !0;
3224
+ let r = j(ae(e));
3225
+ if (w = Jt(C.uponSanitizeElement, w, Oe, Be), I(C.uponSanitizeElement, e, {
3216
3226
  tagName: r,
3217
- allowedTags: C
3227
+ allowedTags: w
3218
3228
  }), Yt(e, n)) return !0;
3219
3229
  if (Gt(e, r)) return M(e), !0;
3220
- if (je[r] || !(Ne.tagCheck instanceof Function && Ne.tagCheck(r)) && !C[r]) {
3230
+ if (Ae[r] || !(Me.tagCheck instanceof Function && Me.tagCheck(r)) && !w[r]) {
3221
3231
  let t = qt(e, r, n);
3222
- return t === !1 && (I(x.afterSanitizeElements, e, null), Yt(e, n)) ? !0 : t;
3232
+ return t === !1 && (I(C.afterSanitizeElements, e, null), Yt(e, n)) ? !0 : t;
3223
3233
  }
3224
- if (g(e) === $.element && !Tt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(ho, e.innerHTML)) return M(e), !0;
3225
- if (E && e.nodeType === $.text) {
3234
+ if (v(e) === $.element && !Tt(e) || (r === "noscript" || r === "noembed" || r === "noframes") && J(go, e.innerHTML)) return M(e), !0;
3235
+ if (D && e.nodeType === $.text) {
3226
3236
  let n = Vt(e.textContent);
3227
- e.textContent !== n && (xa(t.removed, { element: e.cloneNode() }), e.textContent = n);
3237
+ e.textContent !== n && (Sa(t.removed, { element: e.cloneNode() }), e.textContent = n);
3228
3238
  }
3229
- return I(x.afterSanitizeElements, e, null), Yt(e, n);
3239
+ return I(C.afterSanitizeElements, e, null), Yt(e, n);
3230
3240
  }, Zt = function(e, t, r) {
3231
- if (Me[t] || Lt(t, e) || qe && (t === "id" || t === "name") && (r in n || r in _t)) return !1;
3232
- let i = w[t] || Ne.attributeCheck instanceof Function && Ne.attributeCheck(t, e);
3233
- return Fe && J(we, t) || Pe && J(Te, t) ? !0 : i ? nt[t] || J(Oe, ja(r, Ee, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Ma(r, "data:") === 0 && et[e] || Ie && !J(S, ja(r, Ee, "")) ? !0 : !r : $t(e) && Kt(T.tagNameCheck, e) && Kt(T.attributeNameCheck, t, e) || t === "is" && T.allowCustomizedBuiltInElements && Kt(T.tagNameCheck, r);
3241
+ if (je[t] || Lt(t, e) || Ke && (t === "id" || t === "name") && (r in n || r in _t)) return !1;
3242
+ let i = T[t] || Me.attributeCheck instanceof Function && Me.attributeCheck(t, e);
3243
+ return Pe && J(Se, t) || Ne && J(Ce, t) ? !0 : i ? nt[t] || J(De, Ma(r, Te, "")) || (t === "src" || t === "xlink:href" || t === "href") && e !== "script" && Na(r, "data:") === 0 && et[e] || Fe && !J(we, Ma(r, Te, "")) ? !0 : !r : $t(e) && Kt(E.tagNameCheck, e) && Kt(E.attributeNameCheck, t, e) || t === "is" && E.allowCustomizedBuiltInElements && Kt(E.tagNameCheck, r);
3234
3244
  }, Qt = X({}, [
3235
3245
  "annotation-xml",
3236
3246
  "color-profile",
@@ -3241,45 +3251,45 @@ function Co() {
3241
3251
  "font-face-uri",
3242
3252
  "missing-glyph"
3243
3253
  ]), $t = function(e) {
3244
- return !Qt[Oa(e)] && J(De, e);
3254
+ return !Qt[ka(e)] && J(Ee, e);
3245
3255
  }, en = function(e, t, n, r) {
3246
- if (_ && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
3247
- case "TrustedHTML": return y(r);
3248
- case "TrustedScriptURL": return me(r);
3256
+ if (y && typeof u == "object" && typeof u.getAttributeType == "function" && !n) switch (u.getAttributeType(e, t)) {
3257
+ case "TrustedHTML": return x(r);
3258
+ case "TrustedScriptURL": return fe(r);
3249
3259
  }
3250
3260
  return r;
3251
3261
  }, tn = function(e, t, n, r) {
3252
3262
  try {
3253
- return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !F(e) || (M(e), !1);
3263
+ return n ? e.setAttributeNS(n, t, r) : e.setAttribute(t, r), !P(e) || (M(e), !1);
3254
3264
  } catch {
3255
3265
  return Dt(t, e), !1;
3256
3266
  }
3257
3267
  }, nn = function(e, t) {
3258
- return Re && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : Oa(e) === "attributename" && Aa(t, "href") !== null;
3259
- }, L = function(e, n) {
3260
- if (I(x.beforeSanitizeAttributes, e, null), Yt(e, n)) return;
3268
+ return Le && J(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i, t) ? !0 : ka(e) === "attributename" && ja(t, "href") !== null;
3269
+ }, rn = function(e, n) {
3270
+ if (I(C.beforeSanitizeAttributes, e, null), Yt(e, n)) return;
3261
3271
  let r = e.attributes;
3262
- if (!r || F(e)) return;
3263
- w = Jt(x.uponSanitizeAttribute, w, Ae, He);
3272
+ if (!r || P(e)) return;
3273
+ T = Jt(C.uponSanitizeAttribute, T, ke, Ve);
3264
3274
  let i = {
3265
3275
  attrName: "",
3266
3276
  attrValue: "",
3267
3277
  keepAttr: !0,
3268
- allowedAttributes: w,
3278
+ allowedAttributes: T,
3269
3279
  forceKeepAttr: void 0
3270
3280
  }, a = r.length, o = j(e.nodeName);
3271
3281
  for (; a--;) {
3272
- let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = j(s), d = l, f = s === "value" ? d : Na(d), p = !1;
3273
- i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(x.uponSanitizeAttribute, e, i), f = i.attrValue, Je && (u === "id" || u === "name") && Ma(f, Ye) !== 0 && (Dt(s, e, n), f = Ye + f, p = !0), nn(s, f) ? Dt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Le && J(go, f) ? Dt(s, e, n) : (E && (f = Vt(f)), Zt(o, u, f) ? (f = en(o, u, c, f), f !== d && tn(e, s, c, f) && p && ba(t.removed)) : Dt(s, e, n)) : Dt(s, e, n));
3282
+ let n = r[a], s = n.name, c = n.namespaceURI, l = n.value, u = j(s), d = l, f = s === "value" ? d : Pa(d), p = !1;
3283
+ i.attrName = u, i.attrValue = f, i.keepAttr = !0, i.forceKeepAttr = void 0, I(C.uponSanitizeAttribute, e, i), f = i.attrValue, qe && (u === "id" || u === "name") && Na(f, Je) !== 0 && (Dt(s, e, n), f = Je + f, p = !0), nn(s, f) ? Dt(s, e, n) : i.forceKeepAttr || (i.keepAttr ? !Ie && J(_o, f) ? Dt(s, e, n) : (D && (f = Vt(f)), Zt(o, u, f) ? (f = en(o, u, c, f), f !== d && tn(e, s, c, f) && p && xa(t.removed)) : Dt(s, e, n)) : Dt(s, e, n));
3274
3284
  }
3275
- I(x.afterSanitizeAttributes, e, null), Yt(e, n);
3276
- }, rn = function(e) {
3285
+ I(C.afterSanitizeAttributes, e, null), Yt(e, n);
3286
+ }, L = function(e) {
3277
3287
  let t = null, n = Bt(e);
3278
- for (I(x.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (I(x.uponSanitizeShadowNode, t, null), Xt(t, e), L(t, e), Ut(t.content) && rn(t.content), g(t) === $.element) {
3279
- let e = re(t);
3280
- Ut(e) && (an(e), rn(e));
3288
+ for (I(C.beforeSanitizeShadowDOM, e, null); t = n.nextNode();) if (I(C.uponSanitizeShadowNode, t, null), Xt(t, e), rn(t, e), F(t.content) && L(t.content), v(t) === $.element) {
3289
+ let e = ne(t);
3290
+ F(e) && (an(e), L(e));
3281
3291
  }
3282
- E && P(e), I(x.afterSanitizeShadowDOM, e, null);
3292
+ D && Ut(e), I(C.afterSanitizeShadowDOM, e, null);
3283
3293
  }, an = function(e) {
3284
3294
  let t = [{
3285
3295
  node: e,
@@ -3288,27 +3298,27 @@ function Co() {
3288
3298
  for (; t.length > 0;) {
3289
3299
  let e = t.pop();
3290
3300
  if (e.shadow) {
3291
- rn(e.shadow);
3301
+ L(e.shadow);
3292
3302
  continue;
3293
3303
  }
3294
- let n = e.node, r = g(n) === $.element, i = te(n);
3304
+ let n = e.node, r = v(n) === $.element, i = h(n);
3295
3305
  if (i) for (let e = i.length - 1; e >= 0; --e) t.push({
3296
3306
  node: i[e],
3297
3307
  shadow: null
3298
3308
  });
3299
3309
  if (r) {
3300
- let e = h ? h(n) : null;
3310
+ let e = g ? g(n) : null;
3301
3311
  if (typeof e == "string" && j(e) === "template") {
3302
3312
  let e = n.content;
3303
- Ut(e) && t.push({
3313
+ F(e) && t.push({
3304
3314
  node: e,
3305
3315
  shadow: null
3306
3316
  });
3307
3317
  }
3308
3318
  }
3309
3319
  if (r) {
3310
- let e = re(n);
3311
- Ut(e) && t.push({
3320
+ let e = ne(n);
3321
+ F(e) && t.push({
3312
3322
  node: null,
3313
3323
  shadow: e
3314
3324
  }, {
@@ -3320,82 +3330,82 @@ function Co() {
3320
3330
  };
3321
3331
  return t.sanitize = function(e) {
3322
3332
  let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = null, a = null, o = null, s = null;
3323
- if (st = !e, st && (e = "<!-->"), typeof e != "string" && !Wt(e) && (e = Ha(e), typeof e != "string")) throw za("dirty is not a string, aborting");
3333
+ if (st = !e, st && (e = "<!-->"), typeof e != "string" && !Wt(e) && (e = Ua(e), typeof e != "string")) throw Ba("dirty is not a string, aborting");
3324
3334
  if (!t.isSupported) return e;
3325
- Be ? (C = Ve, w = He) : yt(n), (x.uponSanitizeElement.length > 0 || x.uponSanitizeAttribute.length > 0) && (C = Z(C)), x.uponSanitizeAttribute.length > 0 && (w = Z(w)), t.removed = [];
3326
- let c = Xe && typeof e != "string" && Wt(e), l = [], u = Ze;
3335
+ ze ? (w = Be, T = Ve) : yt(n), (C.uponSanitizeElement.length > 0 || C.uponSanitizeAttribute.length > 0) && (w = Z(w)), C.uponSanitizeAttribute.length > 0 && (T = Z(T)), t.removed = [];
3336
+ let c = O && typeof e != "string" && Wt(e), l = [], u = Xe;
3327
3337
  if (c) {
3328
3338
  Rt(e);
3329
- let t = se(e);
3339
+ let t = ae(e);
3330
3340
  if (typeof t == "string") {
3331
3341
  let n = j(t);
3332
- if (!C[n] || je[n]) throw Et(e), za("root node is forbidden and cannot be sanitized in-place");
3342
+ if (!w[n] || Ae[n]) throw N(e), Ba("root node is forbidden and cannot be sanitized in-place");
3333
3343
  }
3334
- if (F(e)) throw Et(e), za("root node is clobbered and cannot be sanitized in-place");
3335
- l = jt(e), Ze = Ta();
3344
+ if (P(e)) throw N(e), Ba("root node is clobbered and cannot be sanitized in-place");
3345
+ l = jt(e), Xe = Ea();
3336
3346
  } else if (Wt(e)) i = zt("<!---->"), a = i.ownerDocument.importNode(e, !0), a.nodeType === $.element && a.nodeName === "BODY" || a.nodeName === "HTML" ? i = a : i.appendChild(a), an(i);
3337
3347
  else {
3338
- if (!We && !E && !ze && e.indexOf("<") === -1) return _ && Ke ? y(e) : e;
3339
- if (i = zt(e), !i) return We ? null : Ke ? v : "";
3348
+ if (!Ue && !D && !Re && e.indexOf("<") === -1) return y && Ge ? x(e) : e;
3349
+ if (i = zt(e), !i) return Ue ? null : Ge ? b : "";
3340
3350
  }
3341
- i && Ue && M(i.firstChild);
3351
+ i && He && M(i.firstChild);
3342
3352
  let d = c ? e : i;
3343
3353
  try {
3344
3354
  c && an(e);
3345
3355
  let t = Bt(d);
3346
- for (; o = t.nextNode();) Xt(o, d), L(o, d), Ut(o.content) && rn(o.content);
3356
+ for (; o = t.nextNode();) Xt(o, d), rn(o, d), F(o.content) && L(o.content);
3347
3357
  c && Pt(e, l);
3348
3358
  } catch (t) {
3349
- throw c && (Et(e), Nt(e, l)), t;
3359
+ throw c && (N(e), Nt(e, l)), t;
3350
3360
  } finally {
3351
- Ze = u;
3361
+ Xe = u;
3352
3362
  }
3353
3363
  if (c) {
3354
- if (Nt(e, l)) throw za("a node selected for removal could not be safely returned; refusing to sanitize in place");
3355
- return E && Ht(e), e;
3364
+ if (Nt(e, l)) throw Ba("a node selected for removal could not be safely returned; refusing to sanitize in place");
3365
+ return D && Ht(e), e;
3356
3366
  }
3357
- if (We) {
3358
- if (E && Ht(i), Ge) for (s = ve.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
3367
+ if (Ue) {
3368
+ if (D && Ht(i), We) for (s = ge.call(i.ownerDocument); i.firstChild;) s.appendChild(i.firstChild);
3359
3369
  else s = i;
3360
- return (w.shadowroot || w.shadowrootmode) && (s = be.call(r, s, !0)), s;
3370
+ return (T.shadowroot || T.shadowrootmode) && (s = ve.call(r, s, !0)), s;
3361
3371
  }
3362
- let f = ze ? i.outerHTML : i.innerHTML;
3363
- return ze && C["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(uo, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), E && (f = Vt(f)), _ && Ke ? y(f) : f;
3372
+ let f = Re ? i.outerHTML : i.innerHTML;
3373
+ return Re && w["!doctype"] && i.ownerDocument && i.ownerDocument.doctype && i.ownerDocument.doctype.name && J(fo, i.ownerDocument.doctype.name) && (f = "<!DOCTYPE " + i.ownerDocument.doctype.name + ">\n" + f), D && (f = Vt(f)), y && Ge ? x(f) : f;
3364
3374
  }, t.setConfig = function() {
3365
3375
  let e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3366
- yt(e), Be = !0, Ve = C, He = w;
3376
+ yt(e), ze = !0, Be = w, Ve = T;
3367
3377
  }, t.clearConfig = function() {
3368
- gt = null, Be = !1, Ve = null, He = null, _ = ue, v = "";
3378
+ gt = null, ze = !1, Be = null, Ve = null, y = ce, b = "";
3369
3379
  }, t.isValidAttribute = function(e, t, n) {
3370
3380
  gt || yt({});
3371
3381
  let r = j(e), i = j(t);
3372
- return typeof n == "string" && (nn(t, n) || !Le && J(go, n)) ? !1 : Zt(r, i, n);
3382
+ return typeof n == "string" && (nn(t, n) || !Ie && J(_o, n)) ? !1 : Zt(r, i, n);
3373
3383
  }, t.addHook = function(e, t) {
3374
- typeof t == "function" && q(x, e) && xa(x[e], t);
3384
+ typeof t == "function" && q(C, e) && Sa(C[e], t);
3375
3385
  }, t.removeHook = function(e, t) {
3376
- if (q(x, e)) {
3386
+ if (q(C, e)) {
3377
3387
  if (t !== void 0) {
3378
- let n = ya(x[e], t);
3379
- return n === -1 ? void 0 : Ca(x[e], n, 1)[0];
3388
+ let n = ba(C[e], t);
3389
+ return n === -1 ? void 0 : wa(C[e], n, 1)[0];
3380
3390
  }
3381
- return ba(x[e]);
3391
+ return xa(C[e]);
3382
3392
  }
3383
3393
  }, t.removeHooks = function(e) {
3384
- q(x, e) && (x[e] = []);
3394
+ q(C, e) && (C[e] = []);
3385
3395
  }, t.removeAllHooks = function() {
3386
- x = bo();
3396
+ C = xo();
3387
3397
  }, t;
3388
3398
  }
3389
- var wo = Co();
3399
+ var To = wo();
3390
3400
  //#endregion
3391
3401
  //#region ../../packages/components/src/chat/markdownHtml.ts
3392
- function To(e) {
3402
+ function Eo(e) {
3393
3403
  return e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
3394
3404
  }
3395
- function Eo(e, t) {
3405
+ function Do(e, t) {
3396
3406
  return `<span class="katex-pending" data-katex="${encodeURIComponent(e)}" data-display="${t}"></span>`;
3397
3407
  }
3398
- var Do = {
3408
+ var Oo = {
3399
3409
  ADD_ATTR: ["target"],
3400
3410
  ALLOW_UNKNOWN_PROTOCOLS: !0,
3401
3411
  FORBID_TAGS: [
@@ -3416,21 +3426,21 @@ var Do = {
3416
3426
  "background"
3417
3427
  ]
3418
3428
  };
3419
- wo.addHook("uponSanitizeAttribute", (e, t) => {
3429
+ To.addHook("uponSanitizeAttribute", (e, t) => {
3420
3430
  t.attrName === "src" && e.nodeName !== "IMG" && (t.keepAttr = !1);
3421
3431
  });
3422
- var Oo = "data-held-src";
3423
- function ko(e, t) {
3424
- if (!t) return wo.sanitize(e, Do);
3425
- let n = wo.sanitize(e, {
3426
- ...Do,
3432
+ var ko = "data-held-src";
3433
+ function Ao(e, t) {
3434
+ if (!t) return To.sanitize(e, Oo);
3435
+ let n = To.sanitize(e, {
3436
+ ...Oo,
3427
3437
  RETURN_DOM_FRAGMENT: !0
3428
3438
  });
3429
3439
  for (let e of Array.from(n.querySelectorAll("img"))) {
3430
3440
  let n = e.getAttribute("src") ?? "";
3431
3441
  if (t.canLoad(n)) continue;
3432
3442
  let r = e.ownerDocument.createElement("button");
3433
- r.type = "button", r.className = "markdown-held-image", r.setAttribute(Oo, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
3443
+ r.type = "button", r.className = "markdown-held-image", r.setAttribute(ko, n), r.textContent = t.label(t.hostOf(n) ?? n), e.replaceWith(r);
3434
3444
  }
3435
3445
  let r = n.ownerDocument.createElement("div");
3436
3446
  return r.append(n), r.innerHTML;
@@ -3438,7 +3448,7 @@ function ko(e, t) {
3438
3448
  //#endregion
3439
3449
  //#region ../../packages/components/src/chat/PkStreamingMarkdown.vue?vue&type=script&setup=true&lang.ts
3440
3450
  c(), o();
3441
- var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3451
+ var jo = ["innerHTML"], Mo = 100, No = /*#__PURE__*/ se(/* @__PURE__ */ l({
3442
3452
  __name: "PkStreamingMarkdown",
3443
3453
  props: {
3444
3454
  markdown: {
@@ -3468,14 +3478,14 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3468
3478
  },
3469
3479
  setup(o) {
3470
3480
  let c = o, { t: l } = f({ useScope: "global" }), m = null;
3471
- function te() {
3481
+ function h() {
3472
3482
  return m ||= import("./dist-BK6ru3gS.js"), m;
3473
3483
  }
3474
- let ne = null;
3475
- function re() {
3476
- return ne ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), ne;
3484
+ let te = null;
3485
+ function ne() {
3486
+ return te ||= import("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.mjs").then((e) => e.default), te;
3477
3487
  }
3478
- let ie = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, ae = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
3488
+ let re = /^(\${1,2})(?!\$)((?:\\.|[^\\\n])*?(?:\\.|[^\\\n$]))\1(?=[\s?!.,:\uFF1F\uFF01\u3002\uFF0C\uFF1A]|$)/, ie = /^(\${1,2})\n((?:\\[^]|[^\\])+?)\n\1(?:\n|$)/;
3479
3489
  W.use({ extensions: [{
3480
3490
  name: "inlineKatex",
3481
3491
  level: "inline",
@@ -3484,7 +3494,7 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3484
3494
  if (t !== -1 && (t === 0 || e.charAt(t - 1) === " ")) return t;
3485
3495
  },
3486
3496
  tokenizer(e) {
3487
- let t = e.match(ie);
3497
+ let t = e.match(re);
3488
3498
  if (t) return {
3489
3499
  type: "inlineKatex",
3490
3500
  raw: t[0],
@@ -3493,13 +3503,13 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3493
3503
  };
3494
3504
  },
3495
3505
  renderer(e) {
3496
- return Eo(e.text, e.displayMode);
3506
+ return Do(e.text, e.displayMode);
3497
3507
  }
3498
3508
  }, {
3499
3509
  name: "blockKatex",
3500
3510
  level: "block",
3501
3511
  tokenizer(e) {
3502
- let t = e.match(ae);
3512
+ let t = e.match(ie);
3503
3513
  if (t) return {
3504
3514
  type: "blockKatex",
3505
3515
  raw: t[0],
@@ -3508,7 +3518,7 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3508
3518
  };
3509
3519
  },
3510
3520
  renderer(e) {
3511
- return Eo(e.text, e.displayMode) + "\n";
3521
+ return Do(e.text, e.displayMode) + "\n";
3512
3522
  }
3513
3523
  }] }), W.use({ extensions: [{
3514
3524
  name: "thinking",
@@ -3529,30 +3539,30 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3529
3539
  return `<div class="thinking-block">${this.parser.parse(e.tokens ?? [])}</div>`;
3530
3540
  }
3531
3541
  }] });
3532
- let h = new W.Renderer(), oe = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), le = /^(?:javascript|data|vbscript|file):/i, v = !1, ue = (e) => oe(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
3533
- h.link = function({ href: e, title: t, text: n, tokens: r }) {
3542
+ let g = new W.Renderer(), _ = (e) => e.replace(/&/g, "&amp;").replace(/"/g, "&quot;").replace(/</g, "&lt;").replace(/>/g, "&gt;"), se = /^(?:javascript|data|vbscript|file):/i, b = !1, ce = (e) => _(e.replace(/^https?:\/\/(?:www\.)?/i, "").replace(/\/$/, "")).replace(/\//g, "/<wbr>");
3543
+ g.link = function({ href: e, title: t, text: n, tokens: r }) {
3534
3544
  let i = this.parser.parseInline(r), a = (e ?? "").trim().replace(/[\x00-\x1f]/g, "");
3535
- if (!a || le.test(a)) return i;
3536
- let o = v && n === a, s = t || (o ? a : ""), c = s ? ` title="${oe(s)}"` : "", l = g(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
3537
- return `<a href="${oe(a)}"${c}${l}>${o ? ue(a) : i}</a>`;
3538
- }, h.table = function(e) {
3539
- v = !0;
3545
+ if (!a || se.test(a)) return i;
3546
+ let o = b && n === a, s = t || (o ? a : ""), c = s ? ` title="${_(s)}"` : "", l = v(a) ? "" : " target=\"_blank\" rel=\"noopener noreferrer\"";
3547
+ return `<a href="${_(a)}"${c}${l}>${o ? ce(a) : i}</a>`;
3548
+ }, g.table = function(e) {
3549
+ b = !0;
3540
3550
  try {
3541
- let t = e.header.map((e) => oe(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
3551
+ let t = e.header.map((e) => _(this.parser.parseInline(e.tokens, this.parser.textRenderer))), n = (e) => `<tr role="row">${e.map((e, n) => {
3542
3552
  let r = this.parser.parseInline(e.tokens), i = e.align ? ` align="${e.align}"` : "";
3543
3553
  return e.header ? `<th role="columnheader"${i}>${r}</th>` : `<td role="cell" data-label="${t[n] ?? ""}"${i}><span>${r}</span></td>`;
3544
3554
  }).join("")}</tr>`, r = e.rows.length ? `<tbody role="rowgroup">${e.rows.map(n).join("")}</tbody>` : "";
3545
3555
  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`;
3546
3556
  } finally {
3547
- v = !1;
3557
+ b = !1;
3548
3558
  }
3549
3559
  };
3550
- let de = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
3551
- h.code = ({ text: e }) => de.test(e) ? `<pre class="mermaid">${To(e)}</pre>` : `<pre><code>${To(e)}</code></pre>`;
3552
- function pe(e) {
3560
+ let le = /^(sequenceDiagram|graph|classDiagram|stateDiagram|erDiagram|flowchart|xychart-beta)/;
3561
+ g.code = ({ text: e }) => le.test(e) ? `<pre class="mermaid">${Eo(e)}</pre>` : `<pre><code>${Eo(e)}</code></pre>`;
3562
+ function de(e) {
3553
3563
  return e.replace(/\\\[([\s\S]*?)\\\]/g, (e, t) => `$$${t}$$`).replace(/\\\(([\s\S]*?)\\\)/g, (e, t) => `$${t}$`).replace(/^(\d+)\.(?!\s)/gm, "$1\\.");
3554
3564
  }
3555
- function y(e) {
3565
+ function x(e) {
3556
3566
  let t = /* @__PURE__ */ new Set(), n = /^(`{3,}|~{3,})[^\n]*\n([\s\S]*?)\n\1/gm, r;
3557
3567
  for (; (r = n.exec(e)) !== null;) for (let e = r.index; e < r.index + r[0].length; e++) t.add(e);
3558
3568
  return e.replace(/[{[]([\s\S]*?)[}\]]/g, (e, n, r) => {
@@ -3564,33 +3574,33 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3564
3574
  }
3565
3575
  }).replace(/\n{3,}/g, "\n\n");
3566
3576
  }
3567
- let me = [
3568
- fe,
3569
- y,
3570
- fr,
3571
- pe
3572
- ], b = i("container"), he = se(d(c, "markdown"), jo), ge = s(() => c.tailLength ? T(he.value, c.tailLength) : he.value), { resolveText: _e } = ce(), ve = _e(ge), ye = _(), be = s(() => {
3573
- let e = me.reduce((e, t) => t(e), ve.value);
3574
- return ko(W.parse(e, {
3577
+ let fe = [
3578
+ ue,
3579
+ x,
3580
+ pr,
3581
+ de
3582
+ ], S = i("container"), pe = ae(d(c, "markdown"), Mo), me = s(() => c.tailLength ? E(pe.value, c.tailLength) : pe.value), { resolveText: he } = oe(), ge = he(me), _e = y(), ve = s(() => {
3583
+ let e = fe.reduce((e, t) => t(e), ge.value);
3584
+ return Ao(W.parse(e, {
3575
3585
  async: !1,
3576
3586
  breaks: !0,
3577
- renderer: h
3578
- }), ye.isGated.value ? {
3579
- canLoad: ye.canLoad,
3580
- hostOf: ye.hostOf,
3587
+ renderer: g
3588
+ }), _e.isGated.value ? {
3589
+ canLoad: _e.canLoad,
3590
+ hostOf: _e.hostOf,
3581
3591
  label: (e) => l("label.imageHeld", { host: e })
3582
3592
  } : void 0);
3583
3593
  });
3584
- function x(e) {
3585
- let t = (e.target?.closest?.(`[${Oo}]`))?.getAttribute(Oo);
3586
- t && (e.preventDefault(), e.stopPropagation(), ye.release(t));
3594
+ function C(e) {
3595
+ let t = (e.target?.closest?.(`[${ko}]`))?.getAttribute(ko);
3596
+ t && (e.preventDefault(), e.stopPropagation(), _e.release(t));
3587
3597
  }
3588
- async function xe() {
3598
+ async function ye() {
3589
3599
  if (c.loading) return;
3590
3600
  await n();
3591
- let e = b.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
3601
+ let e = S.value?.querySelectorAll("pre.mermaid:not([data-rendered])");
3592
3602
  if (!e?.length) return;
3593
- let { renderMermaidSVG: t, THEMES: r } = await te(), i = c.isDark ? r["github-dark"] : r["github-light"];
3603
+ let { renderMermaidSVG: t, THEMES: r } = await h(), i = c.isDark ? r["github-dark"] : r["github-light"];
3594
3604
  for (let n of Array.from(e)) {
3595
3605
  if (!n.isConnected) continue;
3596
3606
  let e = n.textContent?.trim();
@@ -3600,19 +3610,19 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3600
3610
  } catch {}
3601
3611
  }
3602
3612
  }
3603
- async function Se() {
3613
+ async function be() {
3604
3614
  await n();
3605
- let e = b.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
3615
+ let e = S.value?.querySelectorAll("pre:not(.mermaid) > code:not([data-highlighted])");
3606
3616
  if (!e?.length) return;
3607
3617
  let t = (await import("https://cdn.jsdelivr.net/npm/highlight.js@11/es/common.js")).default;
3608
3618
  for (let n of e) t.highlightElement(n), n.setAttribute("data-highlighted", "true");
3609
3619
  }
3610
- async function Ce() {
3620
+ async function xe() {
3611
3621
  await n();
3612
- let e = b.value?.querySelectorAll(".katex-pending");
3622
+ let e = S.value?.querySelectorAll(".katex-pending");
3613
3623
  if (!e?.length) return;
3614
- let t = await re();
3615
- p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(b.value));
3624
+ let t = await ne();
3625
+ p("https://cdn.jsdelivr.net/npm/katex@0.18/dist/katex.min.css", ee(S.value));
3616
3626
  for (let n of Array.from(e)) {
3617
3627
  if (!n.isConnected) continue;
3618
3628
  let e = n.dataset.katex;
@@ -3626,11 +3636,11 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3626
3636
  } catch {}
3627
3637
  }
3628
3638
  }
3629
- async function we() {
3639
+ async function Se() {
3630
3640
  await n();
3631
- let e = b.value?.querySelectorAll("pre.mermaid[data-rendered]");
3641
+ let e = S.value?.querySelectorAll("pre.mermaid[data-rendered]");
3632
3642
  if (!e?.length) return;
3633
- let { renderMermaidSVG: t, THEMES: r } = await te(), i = c.isDark ? r["github-dark"] : r["github-light"];
3643
+ let { renderMermaidSVG: t, THEMES: r } = await h(), i = c.isDark ? r["github-dark"] : r["github-light"];
3634
3644
  for (let n of Array.from(e)) {
3635
3645
  if (!n.isConnected) continue;
3636
3646
  let e = n.dataset.code;
@@ -3639,7 +3649,7 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3639
3649
  } catch {}
3640
3650
  }
3641
3651
  }
3642
- function Te(e) {
3652
+ function Ce(e) {
3643
3653
  let t = e.target;
3644
3654
  if (!(t instanceof HTMLImageElement) || t.dataset.broken) return;
3645
3655
  t.dataset.broken = "true";
@@ -3647,60 +3657,60 @@ var Ao = ["innerHTML"], jo = 100, Mo = /*#__PURE__*/ le(/* @__PURE__ */ l({
3647
3657
  n.className = "markdown-broken-image", n.textContent = t.alt || l("label.imageLoadError"), n.title = t.src, t.replaceWith(n);
3648
3658
  }
3649
3659
  t(() => {
3650
- b.value?.addEventListener("error", Te, !0);
3660
+ S.value?.addEventListener("error", Ce, !0);
3651
3661
  }), e(() => {
3652
- b.value?.removeEventListener("error", Te, !0);
3653
- }), a([be, () => c.loading], xe, { immediate: !0 }), a(() => c.isDark, we), a(be, Se, { immediate: !0 }), a(be, Ce, { immediate: !0 });
3654
- let S = 0;
3655
- function Ee(e, t) {
3662
+ S.value?.removeEventListener("error", Ce, !0);
3663
+ }), a([ve, () => c.loading], ye, { immediate: !0 }), a(() => c.isDark, Se), a(ve, be, { immediate: !0 }), a(ve, xe, { immediate: !0 });
3664
+ let we = 0;
3665
+ function Te(e, t) {
3656
3666
  let n = document.createElement("span");
3657
3667
  return n.style.cssText = `animation:ft-${c.animation} ${c.animationDuration} ease-out ${t}ms both;display:inline-block`, n.textContent = e, n.addEventListener("animationend", () => {
3658
3668
  let t = n.parentNode;
3659
3669
  t && (t.replaceChild(document.createTextNode(e), n), t.normalize());
3660
3670
  }, { once: !0 }), n;
3661
3671
  }
3662
- function De(e, t, n, r) {
3672
+ function Ee(e, t, n, r) {
3663
3673
  let i = r, a = e.split(/(\s+)/);
3664
- for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(Ee(e, i * 30), n), i++));
3674
+ for (let e of a) e && (/^\s+$/.test(e) ? t.insertBefore(document.createTextNode(e), n) : (t.insertBefore(Te(e, i * 30), n), i++));
3665
3675
  return i;
3666
3676
  }
3667
- function Oe(e) {
3677
+ function De(e) {
3668
3678
  let t = document.createTreeWalker(e, NodeFilter.SHOW_TEXT, { acceptNode(e) {
3669
3679
  return e.parentElement?.closest("pre, code, .katex-pending, .markdown-broken-image") ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
3670
3680
  } }), n = [];
3671
3681
  for (; t.nextNode();) n.push(t.currentNode);
3672
3682
  return n;
3673
3683
  }
3674
- function C() {
3675
- if (!b.value || !c.loading || !c.animation) return;
3676
- let e = Oe(b.value), t = 0, n = 0;
3684
+ function w() {
3685
+ if (!S.value || !c.loading || !c.animation) return;
3686
+ let e = De(S.value), t = 0, n = 0;
3677
3687
  for (let r of e) {
3678
3688
  let e = r.textContent || "", i = t, a = t + e.length;
3679
- if (t = a, a <= S) continue;
3689
+ if (t = a, a <= we) continue;
3680
3690
  let o = r.parentNode;
3681
3691
  if (!o) continue;
3682
- if (i >= S) {
3692
+ if (i >= we) {
3683
3693
  let t = r.nextSibling;
3684
- o.removeChild(r), n = De(e, o, t, n);
3694
+ o.removeChild(r), n = Ee(e, o, t, n);
3685
3695
  continue;
3686
3696
  }
3687
- let s = S - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
3688
- o.removeChild(c), n = De(l, o, u, n);
3697
+ let s = we - i, c = r.splitText(s), l = c.textContent || "", u = c.nextSibling;
3698
+ o.removeChild(c), n = Ee(l, o, u, n);
3689
3699
  }
3690
- S = t;
3700
+ we = t;
3691
3701
  }
3692
- return a(be, async () => {
3693
- await n(), C();
3702
+ return a(ve, async () => {
3703
+ await n(), w();
3694
3704
  }, { immediate: !0 }), a(() => c.markdown, (e, t) => {
3695
- (!e || t && e.length < t.length) && (S = 0);
3705
+ (!e || t && e.length < t.length) && (we = 0);
3696
3706
  }), (e, t) => (r(), u("div", {
3697
3707
  ref: "container",
3698
- onClick: x,
3699
- innerHTML: be.value
3700
- }, null, 8, Ao));
3708
+ onClick: C,
3709
+ innerHTML: ve.value
3710
+ }, null, 8, jo));
3701
3711
  }
3702
3712
  }), [["styles", [".markdown-held-image{max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-3);font:inherit;font-size:var(--text-12);vertical-align:middle;cursor:pointer;align-items:center;display:inline-flex}.markdown-held-image:hover,.markdown-held-image:focus-visible{background-color:var(--color-surface-2);color:var(--color-word-2)}.markdown-broken-image{align-items:center;gap:var(--spacing-4);max-width:100%;padding:var(--spacing-4) var(--spacing-8);border:var(--border) dashed var(--color-surface-4);border-radius:var(--rounded-md);background-color:var(--color-surface-1);color:var(--color-word-4);font-size:var(--text-12);vertical-align:middle;display:inline-flex}@keyframes ft-fadeIn{0%{opacity:0}to{opacity:1}}@keyframes ft-blurIn{0%{opacity:0;filter:blur(4px)}to{opacity:1;filter:blur()}}@keyframes ft-dropIn{0%{opacity:0;transform:translateY(-8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-slideUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes ft-fadeAndScale{0%{opacity:0;transform:scale(.85)}to{opacity:1;transform:scale(1)}}"]]]);
3703
3713
  //#endregion
3704
- export { O as A, _e as B, ke as C, we as D, x as E, ye as F, b as I, ve as L, ge as M, be as N, Re as O, me as P, pe as R, C as S, tt as T, nt as _, ze as a, Je as b, Ue as c, Be as d, S as f, Ie as g, et as h, Ke as i, he as j, Ve as k, Ge as l, Le as m, Ne as n, Se as o, Ze as p, w as r, Te as s, Mo as t, We as u, Xe as v, Pe as w, Fe as x, He as y, y as z };
3714
+ export { Ve as A, x as B, w as C, C as D, nt as E, fe as F, _e as I, S as L, pe as M, me as N, Se as O, ve as P, ge as R, Pe as S, Ne as T, he as V, rt as _, ze as a, Je as b, Ue as c, Be as d, we as f, Fe as g, tt as h, Ke as i, $e as j, Re as k, Ge as l, Ie as m, Me as n, be as o, Ze as p, T as r, Ce as s, No as t, We as u, Xe as v, Oe as w, Le as x, He as y, de as z };
3705
3715
 
3706
- //# sourceMappingURL=PkStreamingMarkdown-BnClGp-3.js.map
3716
+ //# sourceMappingURL=PkStreamingMarkdown-Br7Z60Vm.js.map