@runtypelabs/persona 4.30.0 → 4.31.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/README.md +22 -1
  2. package/dist/activity-ui.d.cts +3 -3
  3. package/dist/activity-ui.d.ts +3 -3
  4. package/dist/animations/glyph-cycle.d.cts +1 -1
  5. package/dist/animations/glyph-cycle.d.ts +1 -1
  6. package/dist/animations/wipe.d.cts +1 -1
  7. package/dist/animations/wipe.d.ts +1 -1
  8. package/dist/approval-ui.d.cts +2 -2
  9. package/dist/approval-ui.d.ts +2 -2
  10. package/dist/artifacts-ui.d.cts +3 -3
  11. package/dist/artifacts-ui.d.ts +3 -3
  12. package/dist/background-runtime.d.cts +1 -1
  13. package/dist/background-runtime.d.ts +1 -1
  14. package/dist/{chunk-gayfbmEU.js → chunk-BBtVdcKU.js} +1 -1
  15. package/dist/chunk-C2IbR39s.js +1 -0
  16. package/dist/chunk-CjhA_5Jk.js +1 -0
  17. package/dist/{chunk-n96BB0YH.js → chunk-Co4LmTFv.js} +1 -1
  18. package/dist/chunk-DABqu7C3.js +2 -0
  19. package/dist/chunk-DbD5qyBw.js +3 -0
  20. package/dist/{chunk-UyZbbbz3.js → chunk-MdlQetfC.js} +2 -2
  21. package/dist/{chunk-CqEWCkJt.js → chunk-WA9UucGf.js} +1 -1
  22. package/dist/client-dispatch.js +1 -1
  23. package/dist/client-history.js +1 -1
  24. package/dist/codegen.cjs +1 -1
  25. package/dist/codegen.js +1 -1
  26. package/dist/composer-actions-runtime.d.cts +2 -2
  27. package/dist/composer-actions-runtime.d.ts +2 -2
  28. package/dist/{composer-input-C76gfIoK.d.cts → composer-input-C2_WizXV.d.cts} +1 -1
  29. package/dist/{composer-input-C76gfIoK.d.ts → composer-input-C2_WizXV.d.ts} +1 -1
  30. package/dist/{composer-store-C7tvaz90.d.cts → composer-store-BV6kTlKv.d.cts} +1 -1
  31. package/dist/{composer-store-C7tvaz90.d.ts → composer-store-BV6kTlKv.d.ts} +1 -1
  32. package/dist/{context-mention-manager-IfT4JHma.d.cts → context-mention-manager-BfZzcydV.d.cts} +2 -2
  33. package/dist/{context-mention-manager-IfT4JHma.d.ts → context-mention-manager-BfZzcydV.d.ts} +2 -2
  34. package/dist/context-mentions-inline.d.cts +2 -2
  35. package/dist/context-mentions-inline.d.ts +2 -2
  36. package/dist/context-mentions.d.cts +3 -3
  37. package/dist/context-mentions.d.ts +3 -3
  38. package/dist/{defaults-Cc_p0PGM.d.cts → defaults-DiTeXyr3.d.cts} +1 -1
  39. package/dist/{defaults-Cc_p0PGM.d.ts → defaults-DiTeXyr3.d.ts} +1 -1
  40. package/dist/dictation-runtime.d.cts +2 -2
  41. package/dist/dictation-runtime.d.ts +2 -2
  42. package/dist/event-stream-view.d.cts +1 -1
  43. package/dist/event-stream-view.d.ts +1 -1
  44. package/dist/{fallback-speech-engine-CSxWpG0A.d.cts → fallback-speech-engine-DZ6Of7VU.d.cts} +1 -1
  45. package/dist/{fallback-speech-engine-CSxWpG0A.d.ts → fallback-speech-engine-DZ6Of7VU.d.ts} +1 -1
  46. package/dist/{feature-preferences-eeSOmDxg.d.cts → feature-preferences-BT549D_E.d.cts} +1 -1
  47. package/dist/{feature-preferences-eeSOmDxg.d.ts → feature-preferences-BT549D_E.d.ts} +1 -1
  48. package/dist/forms-ui.d.cts +2 -2
  49. package/dist/forms-ui.d.ts +2 -2
  50. package/dist/{history-confirm-dialog-DXkuAgh-.d.cts → history-confirm-dialog-Cm4oK4am.d.cts} +1 -1
  51. package/dist/{history-confirm-dialog-DXkuAgh-.d.ts → history-confirm-dialog-Cm4oK4am.d.ts} +1 -1
  52. package/dist/history-shell.d.cts +6 -6
  53. package/dist/history-shell.d.ts +6 -6
  54. package/dist/history-view.d.cts +1 -1
  55. package/dist/history-view.d.ts +1 -1
  56. package/dist/index.cjs +48 -47
  57. package/dist/index.cjs.map +1 -1
  58. package/dist/index.d.cts +9 -9
  59. package/dist/index.d.ts +9 -9
  60. package/dist/index.global.js +1 -1
  61. package/dist/index.global.js.map +1 -1
  62. package/dist/index.js +42 -41
  63. package/dist/index.js.map +1 -1
  64. package/dist/{loading-label-runtime-loader-C53YyPJ-.d.cts → loading-label-runtime-loader-DmiPDkBu.d.cts} +1 -1
  65. package/dist/{loading-label-runtime-loader-C53YyPJ-.d.ts → loading-label-runtime-loader-DmiPDkBu.d.ts} +1 -1
  66. package/dist/loading-label-runtime.d.cts +1 -1
  67. package/dist/loading-label-runtime.d.ts +1 -1
  68. package/dist/markdown-parsers.js +18 -15
  69. package/dist/{message-bubble-Cg_sTXUN.d.cts → message-bubble-D0rosKuK.d.cts} +1 -1
  70. package/dist/{message-bubble-Cg_sTXUN.d.ts → message-bubble-D0rosKuK.d.ts} +1 -1
  71. package/dist/preferences-runtime.d.cts +1 -1
  72. package/dist/preferences-runtime.d.ts +1 -1
  73. package/dist/{preview-BeMKALry.d.cts → preview-DRU27q-X.d.cts} +2 -2
  74. package/dist/{preview-BeMKALry.d.ts → preview-DRU27q-X.d.ts} +2 -2
  75. package/dist/{registry-BBe-Lesw.d.ts → registry-DRk3VMFc.d.cts} +3 -1
  76. package/dist/{registry-BBe-Lesw.d.cts → registry-DRk3VMFc.d.ts} +3 -1
  77. package/dist/{session-C0fSteA4.d.cts → session-Dj4bOm5y.d.cts} +18 -9
  78. package/dist/{session-C0fSteA4.d.ts → session-Dj4bOm5y.d.ts} +18 -9
  79. package/dist/session-reconnect.d.cts +2 -2
  80. package/dist/session-reconnect.d.ts +2 -2
  81. package/dist/smart-dom-reader.d.cts +1 -1
  82. package/dist/smart-dom-reader.d.ts +1 -1
  83. package/dist/theme-editor-preview.cjs +46 -45
  84. package/dist/theme-editor-preview.d.cts +1 -1
  85. package/dist/theme-editor-preview.d.ts +1 -1
  86. package/dist/theme-editor-preview.js +17 -19
  87. package/dist/theme-editor.d.cts +2 -2
  88. package/dist/theme-editor.d.ts +2 -2
  89. package/dist/theme-reference.d.cts +2 -2
  90. package/dist/theme-reference.d.ts +2 -2
  91. package/dist/{tool-loading-animation-BvdaZfwh.d.cts → tool-loading-animation-D1MS5Ace.d.cts} +1 -1
  92. package/dist/{tool-loading-animation-BvdaZfwh.d.ts → tool-loading-animation-D1MS5Ace.d.ts} +1 -1
  93. package/dist/{turn-activity-ui-BYBlInZQ.d.cts → turn-activity-ui-CorwdlI0.d.cts} +2 -2
  94. package/dist/{turn-activity-ui-BYBlInZQ.d.ts → turn-activity-ui-CorwdlI0.d.ts} +2 -2
  95. package/dist/turn-activity-ui.d.cts +1 -1
  96. package/dist/turn-activity-ui.d.ts +1 -1
  97. package/dist/{types-CiXi4ICM.d.cts → types-CSXHl5cN.d.cts} +5 -0
  98. package/dist/{types-CiXi4ICM.d.ts → types-CSXHl5cN.d.ts} +5 -0
  99. package/dist/voice-client-tools.d.cts +1 -1
  100. package/dist/voice-client-tools.d.ts +1 -1
  101. package/dist/voice-runtime.cjs +1 -1
  102. package/dist/voice-runtime.d.cts +2 -2
  103. package/dist/voice-runtime.d.ts +2 -2
  104. package/dist/voice-runtime.js +1 -1
  105. package/dist/voice-worklet-player.d.cts +2 -2
  106. package/dist/voice-worklet-player.d.ts +2 -2
  107. package/dist/{webmcp-runtime-entry-BTbOg3Au.d.cts → webmcp-runtime-entry-DpDN6k-6.d.cts} +1 -1
  108. package/dist/{webmcp-runtime-entry-BTbOg3Au.d.ts → webmcp-runtime-entry-DpDN6k-6.d.ts} +1 -1
  109. package/dist/webmcp-runtime.d.cts +1 -1
  110. package/dist/webmcp-runtime.d.ts +1 -1
  111. package/package.json +2 -2
  112. package/src/index-core.ts +1 -0
  113. package/src/markdown-parsers-eager.ts +2 -1
  114. package/src/markdown-parsers-entry.ts +1 -0
  115. package/src/markdown-parsers-loader.ts +2 -0
  116. package/src/postprocessors.ts +14 -0
  117. package/src/session.ts +3 -0
  118. package/src/types.ts +5 -0
  119. package/src/ui.background-conversations.test.ts +6 -0
  120. package/src/ui.page-cache.test.ts +268 -0
  121. package/src/ui.postprocess.test.ts +80 -1
  122. package/src/ui.ts +95 -27
  123. package/src/utils/actions.ts +3 -0
  124. package/src/utils/streaming-markdown.test.ts +103 -0
  125. package/src/utils/streaming-markdown.ts +186 -0
  126. package/dist/chunk-18tPmsiJ.js +0 -1
  127. package/dist/chunk-Dp2vWE9V.js +0 -1
  128. package/dist/chunk-VloQ2dnh.js +0 -1
@@ -1,4 +1,4 @@
1
- import { n as createLoadingLabelLifecycle, r as applyLoadingLabel, t as applyLoadingAnimation } from "./tool-loading-animation-BvdaZfwh.cjs";
1
+ import { n as createLoadingLabelLifecycle, r as applyLoadingLabel, t as applyLoadingAnimation } from "./tool-loading-animation-D1MS5Ace.cjs";
2
2
  //#region src/loading-label-runtime-loader.d.ts
3
3
  /** Internal contract: resolve/decorate fresh labels, then manage committed hooks.
4
4
  * A future renderer replacement must preserve this lifecycle and readiness boundary.
@@ -1,4 +1,4 @@
1
- import { n as createLoadingLabelLifecycle, r as applyLoadingLabel, t as applyLoadingAnimation } from "./tool-loading-animation-BvdaZfwh.js";
1
+ import { n as createLoadingLabelLifecycle, r as applyLoadingLabel, t as applyLoadingAnimation } from "./tool-loading-animation-D1MS5Ace.js";
2
2
  //#region src/loading-label-runtime-loader.d.ts
3
3
  /** Internal contract: resolve/decorate fresh labels, then manage committed hooks.
4
4
  * A future renderer replacement must preserve this lifecycle and readiness boundary.
@@ -1,3 +1,3 @@
1
- import { n as createLoadingLabelLifecycle, r as applyLoadingLabel, t as applyLoadingAnimation } from "./tool-loading-animation-BvdaZfwh.cjs";
1
+ import { n as createLoadingLabelLifecycle, r as applyLoadingLabel, t as applyLoadingAnimation } from "./tool-loading-animation-D1MS5Ace.cjs";
2
2
  export { applyLoadingAnimation, applyLoadingLabel, createLoadingLabelLifecycle };
3
3
  export {}
@@ -1,3 +1,3 @@
1
- import { n as createLoadingLabelLifecycle, r as applyLoadingLabel, t as applyLoadingAnimation } from "./tool-loading-animation-BvdaZfwh.js";
1
+ import { n as createLoadingLabelLifecycle, r as applyLoadingLabel, t as applyLoadingAnimation } from "./tool-loading-animation-D1MS5Ace.js";
2
2
  export { applyLoadingAnimation, applyLoadingLabel, createLoadingLabelLifecycle };
3
3
  export {}
@@ -1,8 +1,8 @@
1
- function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let t=e();function n(e){t=e}const r=/[&<>"']/,i=new RegExp(r.source,`g`),a=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,o=new RegExp(a.source,`g`),s={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},c=e=>s[e];function l(e,t){if(t){if(r.test(e))return e.replace(i,c)}else if(a.test(e))return e.replace(o,c);return e}const u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(u,(e,t)=>(t=t.toLowerCase(),t===`colon`?`:`:t.charAt(0)===`#`?t.charAt(1)===`x`?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):``))}const ee=/(^|[^\[])\^/g;function f(e,t){let n=typeof e==`string`?e:e.source;t||=``;let r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(ee,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function te(e){try{e=encodeURI(e).replace(/%25/g,`%`)}catch{return null}return e}const p={exec:()=>null};function m(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,`|`);return n}function ne(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function re(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function h(e,t,n,r){let i=t.href,a=t.title?l(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;let e={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:`image`,raw:n,href:i,title:a,text:l(o)}}function g(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(`
1
+ function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let t=e();function n(e){t=e}const r=/[&<>"']/,i=new RegExp(r.source,`g`),a=/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,o=new RegExp(a.source,`g`),s={"&":`&amp;`,"<":`&lt;`,">":`&gt;`,'"':`&quot;`,"'":`&#39;`},c=e=>s[e];function l(e,t){if(t){if(r.test(e))return e.replace(i,c)}else if(a.test(e))return e.replace(o,c);return e}const u=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi;function d(e){return e.replace(u,(e,t)=>(t=t.toLowerCase(),t===`colon`?`:`:t.charAt(0)===`#`?t.charAt(1)===`x`?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):``))}const f=/(^|[^\[])\^/g;function p(e,t){let n=typeof e==`string`?e:e.source;t||=``;let r={replace:(e,t)=>{let i=typeof t==`string`?t:t.source;return i=i.replace(f,`$1`),n=n.replace(e,i),r},getRegex:()=>new RegExp(n,t)};return r}function ee(e){try{e=encodeURI(e).replace(/%25/g,`%`)}catch{return null}return e}const m={exec:()=>null};function h(e,t){let n=e.replace(/\|/g,(e,t,n)=>{let r=!1,i=t;for(;--i>=0&&n[i]===`\\`;)r=!r;return r?`|`:` |`}).split(/ \|/),r=0;if(n[0].trim()||n.shift(),n.length>0&&!n[n.length-1].trim()&&n.pop(),t){if(n.length>t)n.splice(t);else for(;n.length<t;)n.push(``)}for(;r<n.length;r++)n[r]=n[r].trim().replace(/\\\|/g,`|`);return n}function te(e,t,n){let r=e.length;if(r===0)return``;let i=0;for(;i<r;){let a=e.charAt(r-i-1);if(a===t&&!n)i++;else if(a!==t&&n)i++;else break}return e.slice(0,r-i)}function ne(e,t){if(e.indexOf(t[1])===-1)return-1;let n=0;for(let r=0;r<e.length;r++)if(e[r]===`\\`)r++;else if(e[r]===t[0])n++;else if(e[r]===t[1]&&(n--,n<0))return r;return-1}function g(e,t,n,r){let i=t.href,a=t.title?l(t.title):null,o=e[1].replace(/\\([\[\]])/g,`$1`);if(e[0].charAt(0)!==`!`){r.state.inLink=!0;let e={type:`link`,raw:n,href:i,title:a,text:o,tokens:r.inlineTokens(o)};return r.state.inLink=!1,e}return{type:`image`,raw:n,href:i,title:a,text:l(o)}}function _(e,t){let n=e.match(/^(\s+)(?:```)/);if(n===null)return t;let r=n[1];return t.split(`
2
2
  `).map(e=>{let t=e.match(/^\s+/);if(t===null)return e;let[n]=t;return n.length>=r.length?e.slice(r.length):e}).join(`
3
- `)}var _=class{options;rules;lexer;constructor(e){this.options=e||t}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:ne(e,`
4
- `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=g(e,t[3]||``);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=ne(e,`#`);(this.options.pedantic||!t||/ $/.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
5
- $1`);e=ne(e.replace(/^ *>[ \t]?/gm,``),`
3
+ `)}var v=class{options;rules;lexer;constructor(e){this.options=e||t}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:`space`,raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(/^ {1,4}/gm,``);return{type:`code`,raw:t[0],codeBlockStyle:`indented`,text:this.options.pedantic?e:te(e,`
4
+ `)}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=_(e,t[3]||``);return{type:`code`,raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,`$1`):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(/#$/.test(e)){let t=te(e,`#`);(this.options.pedantic||!t||/ $/.test(t))&&(e=t.trim())}return{type:`heading`,raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:`hr`,raw:t[0]}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=t[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,`
5
+ $1`);e=te(e.replace(/^ *>[ \t]?/gm,``),`
6
6
  `);let n=this.lexer.state.top;this.lexer.state.top=!0;let r=this.lexer.blockTokens(e);return this.lexer.state.top=n,{type:`blockquote`,raw:t[0],tokens:r,text:e}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),r=n.length>1,i={type:`list`,raw:``,ordered:r,start:r?+n.slice(0,-1):``,loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:`[*+-]`);let a=RegExp(`^( {0,3}${n})((?:[\t ][^\\n]*)?(?:\\n|$))`),o=``,s=``,c=!1;for(;e;){let n=!1;if(!(t=a.exec(e))||this.rules.block.hr.test(e))break;o=t[0],e=e.substring(o.length);let r=t[2].split(`
7
7
  `,1)[0].replace(/^\t+/,e=>` `.repeat(3*e.length)),l=e.split(`
8
8
  `,1)[0],u=0;this.options.pedantic?(u=2,s=r.trimStart()):(u=t[2].search(/[^ ]/),u=u>4?1:u,s=r.slice(u),u+=t[1].length);let d=!1;if(!r&&/^ *$/.test(l)&&(o+=l+`
@@ -10,10 +10,10 @@ function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedanti
10
10
  `,1)[0];if(l=c,this.options.pedantic&&(l=l.replace(/^ {1,4}(?=( {4})*[^ ])/g,` `)),i.test(l)||a.test(l)||t.test(l)||n.test(e))break;if(l.search(/[^ ]/)>=u||!l.trim())s+=`
11
11
  `+l.slice(u);else{if(d||r.search(/[^ ]/)>=4||i.test(r)||a.test(r)||n.test(r))break;s+=`
12
12
  `+l}!d&&!l.trim()&&(d=!0),o+=c+`
13
- `,e=e.substring(c.length+1),r=l.slice(u)}}i.loose||(c?i.loose=!0:/\n *\n *$/.test(o)&&(c=!0));let ee=null,f;this.options.gfm&&(ee=/^\[[ xX]\] /.exec(s),ee&&(f=ee[0]!==`[ ] `,s=s.replace(/^\[[ xX]\] +/,``))),i.items.push({type:`list_item`,raw:o,task:!!ee,checked:f,loose:!1,text:s,tokens:[]}),i.raw+=o}i.items[i.items.length-1].raw=o.trimEnd(),i.items[i.items.length-1].text=s.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g,` `),n=t[2]?t[2].replace(/^<(.*)>$/,`$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];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=m(t[1]),r=t[2].replace(/^\||\| *$/g,``).split(`|`),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,``).split(`
14
- `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)/^ *-+: *$/.test(e)?a.align.push(`right`):/^ *:-+: *$/.test(e)?a.align.push(`center`):/^ *:-+ *$/.test(e)?a.align.push(`left`):a.align.push(null);for(let e of n)a.header.push({text:e,tokens:this.lexer.inline(e)});for(let e of i)a.rows.push(m(e,a.header.length).map(e=>({text:e,tokens:this.lexer.inline(e)})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
15
- `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:l(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=ne(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=re(t[2],`()`);if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),h(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(/\s+/g,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return h(n,e,n[0],this.lexer)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(/[\p{L}\p{N}]/u))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g,` `),n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=l(e,!0),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=l(t[1]),n=`mailto:`+e):(e=l(t[1]),n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=l(t[0]),n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=l(t[0]),n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:l(t[0]),{type:`text`,raw:t[0],text:e}}}};const v=/^(?: *(?:\n|$))+/,y=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,ie=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ae=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,oe=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,se=/(?:[*+-]|\d{1,9}[.)])/,b=f(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,se).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),ce=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,le=/^[^\n]+/,ue=/(?!\s*\])(?:\\.|[^\[\]\\])+/,de=f(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace(`label`,ue).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),fe=f(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,se).getRegex(),pe=`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`,me=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,he=f(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))`,`i`).replace(`comment`,me).replace(`tag`,pe).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),x=f(ce).replace(`hr`,ae).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,pe).getRegex(),ge={blockquote:f(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,x).getRegex(),code:y,def:de,fences:ie,heading:oe,hr:ae,html:he,lheading:b,list:fe,newline:v,paragraph:x,table:p,text:le},_e=f(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,ae).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,` {4}[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,pe).getRegex(),ve={...ge,table:_e,paragraph:f(ce).replace(`hr`,ae).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,_e).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,pe).getRegex()},ye={...ge,html:f(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,me).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(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:p,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:f(ce).replace(`hr`,ae).replace(`heading`,` *#{1,6} *[^
16
- ]`).replace(`lheading`,b).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},be=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,xe=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Se=/^( {2,}|\\)\n(?!\s*$)/,Ce=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,we=`\\p{P}\\p{S}`,S=f(/^((?![*_])[\spunctuation])/,`u`).replace(/punctuation/g,we).getRegex(),Te=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,C=f(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,`u`).replace(/punct/g,we).getRegex(),Ee=f(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])`,`gu`).replace(/punct/g,we).getRegex(),w=f(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])`,`gu`).replace(/punct/g,we).getRegex(),De=f(/\\([punct])/,`gu`).replace(/punct/g,we).getRegex(),Oe=f(/^<(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(),T=f(me).replace(`(?:-->|$)`,`-->`).getRegex(),ke=f(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,T).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Ae=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,je=f(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace(`label`,Ae).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Me=f(/^!?\[(label)\]\[(ref)\]/).replace(`label`,Ae).replace(`ref`,ue).getRegex(),E=f(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,ue).getRegex(),D={_backpedal:p,anyPunctuation:De,autolink:Oe,blockSkip:Te,br:Se,code:xe,del:p,emStrongLDelim:C,emStrongRDelimAst:Ee,emStrongRDelimUnd:w,escape:be,link:je,nolink:E,punctuation:S,reflink:Me,reflinkSearch:f(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,Me).replace(`nolink`,E).getRegex(),tag:ke,text:Ce,url:p},O={...D,link:f(/^!?\[(label)\]\((.*?)\)/).replace(`label`,Ae).getRegex(),reflink:f(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,Ae).getRegex()},Ne={...D,escape:f(be).replace(`])`,`~|])`).getRegex(),url:f(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Pe={...Ne,br:f(Se).replace(`{2,}`,`*`).getRegex(),text:f(Ne.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},k={normal:ge,gfm:ve,pedantic:ye},A={normal:D,gfm:Ne,breaks:Pe,pedantic:O};var j=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new _,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={block:k.normal,inline:A.normal};this.options.pedantic?(n.block=k.pedantic,n.inline=A.pedantic):this.options.gfm&&(n.block=k.gfm,n.inline=this.options.breaks?A.breaks:A.gfm),this.tokenizer.rules=n}static get rules(){return{block:k,inline:A}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(/\r\n|\r/g,`
13
+ `,e=e.substring(c.length+1),r=l.slice(u)}}i.loose||(c?i.loose=!0:/\n *\n *$/.test(o)&&(c=!0));let f=null,p;this.options.gfm&&(f=/^\[[ xX]\] /.exec(s),f&&(p=f[0]!==`[ ] `,s=s.replace(/^\[[ xX]\] +/,``))),i.items.push({type:`list_item`,raw:o,task:!!f,checked:p,loose:!1,text:s,tokens:[]}),i.raw+=o}i.items[i.items.length-1].raw=o.trimEnd(),i.items[i.items.length-1].text=s.trimEnd(),i.raw=i.raw.trimEnd();for(let e=0;e<i.items.length;e++)if(this.lexer.state.top=!1,i.items[e].tokens=this.lexer.blockTokens(i.items[e].text,[]),!i.loose){let t=i.items[e].tokens.filter(e=>e.type===`space`);i.loose=t.length>0&&t.some(e=>/\n.*\n/.test(e.raw))}if(i.loose)for(let e=0;e<i.items.length;e++)i.items[e].loose=!0;return i}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:`html`,block:!0,raw:t[0],pre:t[1]===`pre`||t[1]===`script`||t[1]===`style`,text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(/\s+/g,` `),n=t[2]?t[2].replace(/^<(.*)>$/,`$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];return{type:`def`,tag:e,raw:t[0],href:n,title:r}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!/[:|]/.test(t[2]))return;let n=h(t[1]),r=t[2].replace(/^\||\| *$/g,``).split(`|`),i=t[3]&&t[3].trim()?t[3].replace(/\n[ \t]*$/,``).split(`
14
+ `):[],a={type:`table`,raw:t[0],header:[],align:[],rows:[]};if(n.length===r.length){for(let e of r)/^ *-+: *$/.test(e)?a.align.push(`right`):/^ *:-+: *$/.test(e)?a.align.push(`center`):/^ *:-+ *$/.test(e)?a.align.push(`left`):a.align.push(null);for(let e of n)a.header.push({text:e,tokens:this.lexer.inline(e)});for(let e of i)a.rows.push(h(e,a.header.length).map(e=>({text:e,tokens:this.lexer.inline(e)})));return a}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:`heading`,raw:t[0],depth:t[2].charAt(0)===`=`?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e=t[1].charAt(t[1].length-1)===`
15
+ `?t[1].slice(0,-1):t[1];return{type:`paragraph`,raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:`text`,raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:`escape`,raw:t[0],text:l(t[1])}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&/^<a /i.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&/^<\/a>/i.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&/^<(pre|code|kbd|script)(\s|>)/i.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:`html`,raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&/^</.test(e)){if(!/>$/.test(e))return;let t=te(e.slice(0,-1),`\\`);if((e.length-t.length)%2==0)return}else{let e=ne(t[2],`()`);if(e>-1){let n=(t[0].indexOf(`!`)===0?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=``}}let n=t[2],r=``;if(this.options.pedantic){let e=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(n);e&&(n=e[1],r=e[3])}else r=t[3]?t[3].slice(1,-1):``;return n=n.trim(),/^</.test(n)&&(n=this.options.pedantic&&!/>$/.test(e)?n.slice(1):n.slice(1,-1)),g(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,`$1`),title:r&&r.replace(this.rules.inline.anyPunctuation,`$1`)},t[0],this.lexer)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(/\s+/g,` `).toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:`text`,raw:e,text:e}}return g(n,e,n[0],this.lexer)}}emStrong(e,t,n=``){let r=this.rules.inline.emStrongLDelim.exec(e);if(r&&!(r[3]&&n.match(/[\p{L}\p{N}]/u))&&(!(r[1]||r[2])||!n||this.rules.inline.punctuation.exec(n))){let n=[...r[0]].length-1,i,a,o=n,s=0,c=r[0][0]===`*`?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,t=t.slice(-1*e.length+n);(r=c.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(a=[...i].length,r[3]||r[4]){o+=a;continue}if((r[5]||r[6])&&n%3&&!((n+a)%3)){s+=a;continue}if(o-=a,o>0)continue;a=Math.min(a,a+o+s);let t=[...r[0]][0].length,c=e.slice(0,n+r.index+t+a);if(Math.min(n,a)%2){let e=c.slice(1,-1);return{type:`em`,raw:c,text:e,tokens:this.lexer.inlineTokens(e)}}let l=c.slice(2,-2);return{type:`strong`,raw:c,text:l,tokens:this.lexer.inlineTokens(l)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(/\n/g,` `),n=/[^ ]/.test(e),r=/^ /.test(e)&&/ $/.test(e);return n&&r&&(e=e.substring(1,e.length-1)),e=l(e,!0),{type:`codespan`,raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:`br`,raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:`del`,raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return t[2]===`@`?(e=l(t[1]),n=`mailto:`+e):(e=l(t[1]),n=e),{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if(t[2]===`@`)e=l(t[0]),n=`mailto:`+e;else{let r;do r=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??``;while(r!==t[0]);e=l(t[0]),n=t[1]===`www.`?`http://`+t[0]:t[0]}return{type:`link`,raw:t[0],text:e,href:n,tokens:[{type:`text`,raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e;return e=this.lexer.state.inRawBlock?t[0]:l(t[0]),{type:`text`,raw:t[0],text:e}}}};const y=/^(?: *(?:\n|$))+/,b=/^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/,re=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ie=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ae=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,oe=/(?:[*+-]|\d{1,9}[.)])/,x=p(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,oe).replace(/blockCode/g,/ {4}/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),se=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ce=/^[^\n]+/,le=/(?!\s*\])(?:\\.|[^\[\]\\])+/,ue=p(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace(`label`,le).replace(`title`,/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),de=p(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,oe).getRegex(),fe=`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`,pe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,me=p(`^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))`,`i`).replace(`comment`,pe).replace(`tag`,fe).replace(`attribute`,/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),S=p(se).replace(`hr`,ie).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,fe).getRegex(),he={blockquote:p(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace(`paragraph`,S).getRegex(),code:b,def:ue,fences:re,heading:ae,hr:ie,html:me,lheading:x,list:de,newline:y,paragraph:S,table:m,text:ce},ge=p(`^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)`).replace(`hr`,ie).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`blockquote`,` {0,3}>`).replace(`code`,` {4}[^\\n]`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,fe).getRegex(),_e={...he,table:ge,paragraph:p(se).replace(`hr`,ie).replace(`heading`,` {0,3}#{1,6}(?:\\s|$)`).replace(`|lheading`,``).replace(`table`,ge).replace(`blockquote`,` {0,3}>`).replace(`fences`," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace(`list`,` {0,3}(?:[*+-]|1[.)]) `).replace(`html`,`</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)`).replace(`tag`,fe).getRegex()},ve={...he,html:p(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace(`comment`,pe).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(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:m,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:p(se).replace(`hr`,ie).replace(`heading`,` *#{1,6} *[^
16
+ ]`).replace(`lheading`,x).replace(`|table`,``).replace(`blockquote`,` {0,3}>`).replace(`|fences`,``).replace(`|list`,``).replace(`|html`,``).replace(`|tag`,``).getRegex()},ye=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,be=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,xe=/^( {2,}|\\)\n(?!\s*$)/,Se=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Ce=`\\p{P}\\p{S}`,C=p(/^((?![*_])[\spunctuation])/,`u`).replace(/punctuation/g,Ce).getRegex(),we=/\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g,w=p(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/,`u`).replace(/punct/g,Ce).getRegex(),Te=p(`^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])`,`gu`).replace(/punct/g,Ce).getRegex(),T=p(`^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])`,`gu`).replace(/punct/g,Ce).getRegex(),Ee=p(/\\([punct])/,`gu`).replace(/punct/g,Ce).getRegex(),De=p(/^<(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(),E=p(pe).replace(`(?:-->|$)`,`-->`).getRegex(),Oe=p(`^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>`).replace(`comment`,E).replace(`attribute`,/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ke=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Ae=p(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace(`label`,ke).replace(`href`,/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace(`title`,/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),je=p(/^!?\[(label)\]\[(ref)\]/).replace(`label`,ke).replace(`ref`,le).getRegex(),D=p(/^!?\[(ref)\](?:\[\])?/).replace(`ref`,le).getRegex(),O={_backpedal:m,anyPunctuation:Ee,autolink:De,blockSkip:we,br:xe,code:be,del:m,emStrongLDelim:w,emStrongRDelimAst:Te,emStrongRDelimUnd:T,escape:ye,link:Ae,nolink:D,punctuation:C,reflink:je,reflinkSearch:p(`reflink|nolink(?!\\()`,`g`).replace(`reflink`,je).replace(`nolink`,D).getRegex(),tag:Oe,text:Se,url:m},k={...O,link:p(/^!?\[(label)\]\((.*?)\)/).replace(`label`,ke).getRegex(),reflink:p(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace(`label`,ke).getRegex()},Me={...O,escape:p(ye).replace(`])`,`~|])`).getRegex(),url:p(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,`i`).replace(`email`,/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Ne={...Me,br:p(xe).replace(`{2,}`,`*`).getRegex(),text:p(Me.text).replace(`\\b_`,`\\b_| {2,}\\n`).replace(/\{2,\}/g,`*`).getRegex()},Pe={normal:he,gfm:_e,pedantic:ve},Fe={normal:O,gfm:Me,breaks:Ne,pedantic:k};var A=class e{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||t,this.options.tokenizer=this.options.tokenizer||new v,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={block:Pe.normal,inline:Fe.normal};this.options.pedantic?(n.block=Pe.pedantic,n.inline=Fe.pedantic):this.options.gfm&&(n.block=Pe.gfm,n.inline=this.options.breaks?Fe.breaks:Fe.gfm),this.tokenizer.rules=n}static get rules(){return{block:Pe,inline:Fe}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(/\r\n|\r/g,`
17
17
  `),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[]){e=this.options.pedantic?e.replace(/\t/g,` `).replace(/^ +$/gm,``):e.replace(/^( *)(\t+)/gm,(e,t,n)=>t+` `.repeat(n.length));let n,r,i,a;for(;e;)if(!(this.options.extensions&&this.options.extensions.block&&this.options.extensions.block.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.space(e))e=e.substring(n.raw.length),n.raw.length===1&&t.length>0?t[t.length-1].raw+=`
18
18
  `:t.push(n);else if(n=this.tokenizer.code(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&(r.type===`paragraph`||r.type===`text`)?(r.raw+=`
19
19
  `+n.raw,r.text+=`
@@ -23,7 +23,7 @@ function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedanti
23
23
  `+n.raw,r.text+=`
24
24
  `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n),a=i.length!==e.length,e=e.substring(n.raw.length);else if(n=this.tokenizer.text(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&r.type===`text`?(r.raw+=`
25
25
  `+n.raw,r.text+=`
26
- `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,a=e,o,s,c;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)e.includes(o[0].slice(o[0].lastIndexOf(`[`)+1,-1))&&(a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+`++`+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(c=``),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,c))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(!this.state.inLink&&(n=this.tokenizer.url(e)))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))e=e.substring(n.raw.length),n.raw.slice(-1)!==`_`&&(c=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}}return t}},M=class{options;constructor(e){this.options=e||t}code(e,t,n){let r=(t||``).match(/^\S*/)?.[0];return e=e.replace(/\n$/,``)+`
26
+ `+n.text,this.inlineQueue.pop(),this.inlineQueue[this.inlineQueue.length-1].src=r.text):t.push(n);else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,r,i,a=e,o,s,c;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)e.includes(o[0].slice(o[0].lastIndexOf(`[`)+1,-1))&&(a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)a=a.slice(0,o.index)+`[`+`a`.repeat(o[0].length-2)+`]`+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+`++`+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;e;)if(s||(c=``),s=!1,!(this.options.extensions&&this.options.extensions.inline&&this.options.extensions.inline.some(r=>(n=r.call({lexer:this},e,t))?(e=e.substring(n.raw.length),t.push(n),!0):!1))){if(n=this.tokenizer.escape(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.tag(e))e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.link(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.reflink(e,this.tokens.links))e=e.substring(n.raw.length),r=t[t.length-1],r&&n.type===`text`&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(n=this.tokenizer.emStrong(e,a,c))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.codespan(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.br(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.del(e))e=e.substring(n.raw.length),t.push(n);else if(n=this.tokenizer.autolink(e))e=e.substring(n.raw.length),t.push(n);else if(!this.state.inLink&&(n=this.tokenizer.url(e)))e=e.substring(n.raw.length),t.push(n);else{if(i=e,this.options.extensions&&this.options.extensions.startInline){let t=1/0,n=e.slice(1),r;this.options.extensions.startInline.forEach(e=>{r=e.call({lexer:this},n),typeof r==`number`&&r>=0&&(t=Math.min(t,r))}),t<1/0&&t>=0&&(i=e.substring(0,t+1))}if(n=this.tokenizer.inlineText(i))e=e.substring(n.raw.length),n.raw.slice(-1)!==`_`&&(c=n.raw.slice(-1)),s=!0,r=t[t.length-1],r&&r.type===`text`?(r.raw+=n.raw,r.text+=n.text):t.push(n);else if(e){let t=`Infinite loop on byte: `+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw Error(t)}}}return t}},Ie=class{options;constructor(e){this.options=e||t}code(e,t,n){let r=(t||``).match(/^\S*/)?.[0];return e=e.replace(/\n$/,``)+`
27
27
  `,r?`<pre><code class="language-`+l(r)+`">`+(n?e:l(e,!0))+`</code></pre>
28
28
  `:`<pre><code>`+(n?e:l(e,!0))+`</code></pre>
29
29
  `}blockquote(e){return`<blockquote>\n${e}</blockquote>\n`}html(e,t){return e}heading(e,t,n){return`<h${t}>${e}</h${t}>\n`}hr(){return`<hr>
@@ -33,10 +33,13 @@ function e(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedanti
33
33
  <thead>
34
34
  `+e+`</thead>
35
35
  `+t+`</table>
36
- `}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){let n=t.header?`th`:`td`;return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return`<br>`}del(e){return`<del>${e}</del>`}link(e,t,n){let r=te(e);if(r===null)return n;e=r;let i=`<a href="`+e+`"`;return t&&(i+=` title="`+t+`"`),i+=`>`+n+`</a>`,i}image(e,t,n){let r=te(e);if(r===null)return n;e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=`>`,i}text(e){return e}},Fe=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return``+n}image(e,t,n){return``+n}br(){return``}},N=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new M,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Fe}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}switch(i.type){case`space`:continue;case`hr`:n+=this.renderer.hr();continue;case`heading`:{let e=i;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,d(this.parseInline(e.tokens,this.textRenderer)));continue}case`code`:{let e=i;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case`table`:{let e=i,t=``,r=``;for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let a=``;for(let t=0;t<e.rows.length;t++){let n=e.rows[t];r=``;for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});a+=this.renderer.tablerow(r)}n+=this.renderer.table(t,a);continue}case`blockquote`:{let e=i,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case`list`:{let e=i,t=e.ordered,r=e.start,a=e.loose,o=``;for(let t=0;t<e.items.length;t++){let n=e.items[t],r=n.checked,i=n.task,s=``;if(n.task){let e=this.renderer.checkbox(!!r);a?n.tokens.length>0&&n.tokens[0].type===`paragraph`?(n.tokens[0].text=e+` `+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type===`text`&&(n.tokens[0].tokens[0].text=e+` `+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:`text`,text:e+` `}):s+=e+` `}s+=this.parse(n.tokens,a),o+=this.renderer.listitem(s,i,!!r)}n+=this.renderer.list(o,t,r);continue}case`html`:{let e=i;n+=this.renderer.html(e.text,e.block);continue}case`paragraph`:{let e=i;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case`text`:{let a=i,o=a.tokens?this.parseInline(a.tokens):a.text;for(;r+1<e.length&&e[r+1].type===`text`;)a=e[++r],o+=`
37
- `+(a.tokens?this.parseInline(a.tokens):a.text);n+=t?this.renderer.paragraph(o):o;continue}default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t){t||=this.renderer;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}switch(i.type){case`escape`:{let e=i;n+=t.text(e.text);break}case`html`:{let e=i;n+=t.html(e.text);break}case`link`:{let e=i;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case`image`:{let e=i;n+=t.image(e.href,e.title,e.text);break}case`strong`:{let e=i;n+=t.strong(this.parseInline(e.tokens,t));break}case`em`:{let e=i;n+=t.em(this.parseInline(e.tokens,t));break}case`codespan`:{let e=i;n+=t.codespan(e.text);break}case`br`:n+=t.br();break;case`del`:{let e=i;n+=t.del(this.parseInline(e.tokens,t));break}case`text`:{let e=i;n+=t.text(e.text);break}default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Ie=class{options;constructor(e){this.options=e||t}static passThroughHooks=/* @__PURE__ */ new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}},Le=class{defaults=e();options=this.setOptions;parse=this.#e(j.lex,N.parse);parseInline=this.#e(j.lexInline,N.parseInline);Parser=N;Renderer=M;TextRenderer=Fe;Lexer=j;Tokenizer=_;Hooks=Ie;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new M(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if(n===`options`)continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new _(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Ie;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if(n===`options`)continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Ie.passThroughHooks.has(n)?e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return j.lex(e,t??this.defaults)}parser(e,t){return N.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{let i={...r},a={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(a.silent||console.warn(`marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.`),a.async=!0);let o=this.#t(!!a.silent,!!a.async);if(n==null)return o(/* @__PURE__ */ Error(`marked(): input parameter is undefined or null`));if(typeof n!=`string`)return o(/* @__PURE__ */ Error(`marked(): input parameter is of type `+Object.prototype.toString.call(n)+`, string expected`));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(t=>e(t,a)).then(e=>a.hooks?a.hooks.processAllTokens(e):e).then(e=>a.walkTokens?Promise.all(this.walkTokens(e,a.walkTokens)).then(()=>e):e).then(e=>t(e,a)).then(e=>a.hooks?a.hooks.postprocess(e):e).catch(o);try{a.hooks&&(n=a.hooks.preprocess(n));let r=e(n,a);a.hooks&&(r=a.hooks.processAllTokens(r)),a.walkTokens&&this.walkTokens(r,a.walkTokens);let i=t(r,a);return a.hooks&&(i=a.hooks.postprocess(i)),i}catch(e){return o(e)}}}#t(e,t){return n=>{if(n.message+=`
38
- Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+l(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};const P=new Le;function F(e,t){return P.parse(e,t)}F.options=F.setOptions=function(e){return P.setOptions(e),F.defaults=P.defaults,n(F.defaults),F},F.getDefaults=e,F.defaults=t,F.use=function(...e){return P.use(...e),F.defaults=P.defaults,n(F.defaults),F},F.walkTokens=function(e,t){return P.walkTokens(e,t)},F.parseInline=P.parseInline,F.Parser=N,F.parser=N.parse,F.Renderer=M,F.TextRenderer=Fe,F.Lexer=j,F.lexer=j.lex,F.Tokenizer=_,F.Hooks=Ie,F.parse=F,F.options,F.setOptions,F.use,F.walkTokens,F.parseInline,N.parse,j.lex;
36
+ `}tablerow(e){return`<tr>\n${e}</tr>\n`}tablecell(e,t){let n=t.header?`th`:`td`;return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>\n`}strong(e){return`<strong>${e}</strong>`}em(e){return`<em>${e}</em>`}codespan(e){return`<code>${e}</code>`}br(){return`<br>`}del(e){return`<del>${e}</del>`}link(e,t,n){let r=ee(e);if(r===null)return n;e=r;let i=`<a href="`+e+`"`;return t&&(i+=` title="`+t+`"`),i+=`>`+n+`</a>`,i}image(e,t,n){let r=ee(e);if(r===null)return n;e=r;let i=`<img src="${e}" alt="${n}"`;return t&&(i+=` title="${t}"`),i+=`>`,i}text(e){return e}},Le=class{strong(e){return e}em(e){return e}codespan(e){return e}del(e){return e}html(e){return e}text(e){return e}link(e,t,n){return``+n}image(e,t,n){return``+n}br(){return``}},j=class e{options;renderer;textRenderer;constructor(e){this.options=e||t,this.options.renderer=this.options.renderer||new Ie,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Le}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e,t=!0){let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=i,t=this.options.extensions.renderers[e.type].call({parser:this},e);if(t!==!1||![`space`,`hr`,`heading`,`code`,`table`,`blockquote`,`list`,`html`,`paragraph`,`text`].includes(e.type)){n+=t||``;continue}}switch(i.type){case`space`:continue;case`hr`:n+=this.renderer.hr();continue;case`heading`:{let e=i;n+=this.renderer.heading(this.parseInline(e.tokens),e.depth,d(this.parseInline(e.tokens,this.textRenderer)));continue}case`code`:{let e=i;n+=this.renderer.code(e.text,e.lang,!!e.escaped);continue}case`table`:{let e=i,t=``,r=``;for(let t=0;t<e.header.length;t++)r+=this.renderer.tablecell(this.parseInline(e.header[t].tokens),{header:!0,align:e.align[t]});t+=this.renderer.tablerow(r);let a=``;for(let t=0;t<e.rows.length;t++){let n=e.rows[t];r=``;for(let t=0;t<n.length;t++)r+=this.renderer.tablecell(this.parseInline(n[t].tokens),{header:!1,align:e.align[t]});a+=this.renderer.tablerow(r)}n+=this.renderer.table(t,a);continue}case`blockquote`:{let e=i,t=this.parse(e.tokens);n+=this.renderer.blockquote(t);continue}case`list`:{let e=i,t=e.ordered,r=e.start,a=e.loose,o=``;for(let t=0;t<e.items.length;t++){let n=e.items[t],r=n.checked,i=n.task,s=``;if(n.task){let e=this.renderer.checkbox(!!r);a?n.tokens.length>0&&n.tokens[0].type===`paragraph`?(n.tokens[0].text=e+` `+n.tokens[0].text,n.tokens[0].tokens&&n.tokens[0].tokens.length>0&&n.tokens[0].tokens[0].type===`text`&&(n.tokens[0].tokens[0].text=e+` `+n.tokens[0].tokens[0].text)):n.tokens.unshift({type:`text`,text:e+` `}):s+=e+` `}s+=this.parse(n.tokens,a),o+=this.renderer.listitem(s,i,!!r)}n+=this.renderer.list(o,t,r);continue}case`html`:{let e=i;n+=this.renderer.html(e.text,e.block);continue}case`paragraph`:{let e=i;n+=this.renderer.paragraph(this.parseInline(e.tokens));continue}case`text`:{let a=i,o=a.tokens?this.parseInline(a.tokens):a.text;for(;r+1<e.length&&e[r+1].type===`text`;)a=e[++r],o+=`
37
+ `+(a.tokens?this.parseInline(a.tokens):a.text);n+=t?this.renderer.paragraph(o):o;continue}default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}parseInline(e,t){t||=this.renderer;let n=``;for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions&&this.options.extensions.renderers&&this.options.extensions.renderers[i.type]){let e=this.options.extensions.renderers[i.type].call({parser:this},i);if(e!==!1||![`escape`,`html`,`link`,`image`,`strong`,`em`,`codespan`,`br`,`del`,`text`].includes(i.type)){n+=e||``;continue}}switch(i.type){case`escape`:{let e=i;n+=t.text(e.text);break}case`html`:{let e=i;n+=t.html(e.text);break}case`link`:{let e=i;n+=t.link(e.href,e.title,this.parseInline(e.tokens,t));break}case`image`:{let e=i;n+=t.image(e.href,e.title,e.text);break}case`strong`:{let e=i;n+=t.strong(this.parseInline(e.tokens,t));break}case`em`:{let e=i;n+=t.em(this.parseInline(e.tokens,t));break}case`codespan`:{let e=i;n+=t.codespan(e.text);break}case`br`:n+=t.br();break;case`del`:{let e=i;n+=t.del(this.parseInline(e.tokens,t));break}case`text`:{let e=i;n+=t.text(e.text);break}default:{let e=`Token with "`+i.type+`" type was not found.`;if(this.options.silent)return console.error(e),``;throw Error(e)}}}return n}},Re=class{options;constructor(e){this.options=e||t}static passThroughHooks=/* @__PURE__ */ new Set([`preprocess`,`postprocess`,`processAllTokens`]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}},ze=class{defaults=e();options=this.setOptions;parse=this.#e(A.lex,j.parse);parseInline=this.#e(A.lexInline,j.parseInline);Parser=j;Renderer=Ie;TextRenderer=Le;Lexer=A;Tokenizer=v;Hooks=Re;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case`table`:{let e=r;for(let r of e.header)n=n.concat(this.walkTokens(r.tokens,t));for(let r of e.rows)for(let e of r)n=n.concat(this.walkTokens(e.tokens,t));break}case`list`:{let e=r;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=r;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(r=>{let i=e[r].flat(1/0);n=n.concat(this.walkTokens(i,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw Error(`extension name required`);if(`renderer`in e){let n=t.renderers[e.name];n?t.renderers[e.name]=function(...t){let r=e.renderer.apply(this,t);return r===!1&&(r=n.apply(this,t)),r}:t.renderers[e.name]=e.renderer}if(`tokenizer`in e){if(!e.level||e.level!==`block`&&e.level!==`inline`)throw Error(`extension level must be 'block' or 'inline'`);let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&(e.level===`block`?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:e.level===`inline`&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}`childTokens`in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Ie(this.defaults);for(let n in e.renderer){if(!(n in t))throw Error(`renderer '${n}' does not exist`);if(n===`options`)continue;let r=n,i=e.renderer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n||``}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new v(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw Error(`tokenizer '${n}' does not exist`);if([`options`,`rules`,`lexer`].includes(n))continue;let r=n,i=e.tokenizer[r],a=t[r];t[r]=(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Re;for(let n in e.hooks){if(!(n in t))throw Error(`hook '${n}' does not exist`);if(n===`options`)continue;let r=n,i=e.hooks[r],a=t[r];t[r]=Re.passThroughHooks.has(n)?e=>{if(this.defaults.async)return Promise.resolve(i.call(t,e)).then(e=>a.call(t,e));let n=i.call(t,e);return a.call(t,n)}:(...e)=>{let n=i.apply(t,e);return n===!1&&(n=a.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,r=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(r.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return A.lex(e,t??this.defaults)}parser(e,t){return j.parse(e,t??this.defaults)}#e(e,t){return(n,r)=>{let i={...r},a={...this.defaults,...i};this.defaults.async===!0&&i.async===!1&&(a.silent||console.warn(`marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored.`),a.async=!0);let o=this.#t(!!a.silent,!!a.async);if(n==null)return o(/* @__PURE__ */ Error(`marked(): input parameter is undefined or null`));if(typeof n!=`string`)return o(/* @__PURE__ */ Error(`marked(): input parameter is of type `+Object.prototype.toString.call(n)+`, string expected`));if(a.hooks&&(a.hooks.options=a),a.async)return Promise.resolve(a.hooks?a.hooks.preprocess(n):n).then(t=>e(t,a)).then(e=>a.hooks?a.hooks.processAllTokens(e):e).then(e=>a.walkTokens?Promise.all(this.walkTokens(e,a.walkTokens)).then(()=>e):e).then(e=>t(e,a)).then(e=>a.hooks?a.hooks.postprocess(e):e).catch(o);try{a.hooks&&(n=a.hooks.preprocess(n));let r=e(n,a);a.hooks&&(r=a.hooks.processAllTokens(r)),a.walkTokens&&this.walkTokens(r,a.walkTokens);let i=t(r,a);return a.hooks&&(i=a.hooks.postprocess(i)),i}catch(e){return o(e)}}}#t(e,t){return n=>{if(n.message+=`
38
+ Please report this to https://github.com/markedjs/marked.`,e){let e=`<p>An error occurred:</p><pre>`+l(n.message+``,!0)+`</pre>`;return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};const M=new ze;function N(e,t){return M.parse(e,t)}N.options=N.setOptions=function(e){return M.setOptions(e),N.defaults=M.defaults,n(N.defaults),N},N.getDefaults=e,N.defaults=t,N.use=function(...e){return M.use(...e),N.defaults=M.defaults,n(N.defaults),N},N.walkTokens=function(e,t){return M.walkTokens(e,t)},N.parseInline=M.parseInline,N.Parser=j,N.parser=j.parse,N.Renderer=Ie,N.TextRenderer=Le,N.Lexer=A,N.lexer=A.lex,N.Tokenizer=v,N.Hooks=Re,N.parse=N,N.options,N.setOptions,N.use,N.walkTokens,N.parseInline,j.parse,A.lex;
39
39
  /*! @license DOMPurify 3.4.13 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.13/LICENSE */
40
- function I(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function L(e){if(Array.isArray(e))return e}function Re(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function ze(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
41
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Be(e,t){return L(e)||Re(e,t)||Ve(e,t)||ze()}function Ve(e,t){if(e){if(typeof e==`string`)return I(e,t);var n={}.toString.call(e).slice(8,-1);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)?I(e,t):void 0}}const He=Object.entries,Ue=Object.setPrototypeOf,We=Object.isFrozen,Ge=Object.getPrototypeOf,R=Object.getOwnPropertyDescriptor;let z=Object.freeze,B=Object.seal,Ke=Object.create,V=typeof Reflect<`u`&&Reflect,qe=V.apply,Je=V.construct;z||=function(e){return e},B||=function(e){return e},qe||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Je||=function(e){return new e(...[...arguments].slice(1))};const Ye=K(Array.prototype.forEach),Xe=K(Array.prototype.lastIndexOf),Ze=K(Array.prototype.pop),Qe=K(Array.prototype.push),$e=K(Array.prototype.splice),H=Array.isArray,et=K(String.prototype.toLowerCase),tt=K(String.prototype.toString),nt=K(String.prototype.match),rt=K(String.prototype.replace),it=K(String.prototype.indexOf),at=K(String.prototype.trim),ot=K(Number.prototype.toString),st=K(Boolean.prototype.toString),ct=typeof BigInt>`u`?null:K(BigInt.prototype.toString),lt=typeof Symbol>`u`?null:K(Symbol.prototype.toString),U=K(Object.prototype.hasOwnProperty),W=K(Object.prototype.toString),G=K(RegExp.prototype.test),ut=dt(TypeError);function K(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return qe(e,t,n)}}function dt(e){return function(){return Je(e,[...arguments])}}function q(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:et;if(Ue&&Ue(e,null),!H(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(We(t)||(t[r]=e),i=e)}e[i]=!0}return e}function ft(e){for(let t=0;t<e.length;t++)U(e,t)||(e[t]=null);return e}function J(e){let t=Ke(null);for(let r of He(e)){var n=Be(r,2);let i=n[0],a=n[1];U(e,i)&&(t[i]=H(a)?ft(a):a&&typeof a==`object`&&a.constructor===Object?J(a):a)}return t}function pt(e){switch(typeof e){case`string`:return e;case`number`:return ot(e);case`boolean`:return st(e);case`bigint`:return ct?ct(e):`0`;case`symbol`:return lt?lt(e):`Symbol()`;case`undefined`:return W(e);case`function`:case`object`:{if(e===null)return W(e);let t=e,n=Y(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:W(e)}return W(e)}default:return W(e)}}function Y(e,t){for(;e!==null;){let n=R(e,t);if(n){if(n.get)return K(n.get);if(typeof n.value==`function`)return K(n.value)}e=Ge(e)}function n(){return null}return n}function mt(e){try{return G(e,``),!0}catch{return!1}}const ht=z(/* @__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(`.`)),gt=z(/* @__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(`.`)),_t=z([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),vt=z([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),yt=z(/* @__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(`.`)),bt=z([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),xt=z([`#text`]),St=z(/* @__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(`.`)),Ct=z(/* @__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.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.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(`.`)),wt=z(/* @__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(`.`)),Tt=z([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Et=B(/{{[\w\W]*|^[\w\W]*}}/g),Dt=B(/<%[\w\W]*|^[\w\W]*%>/g),Ot=B(/\${[\w\W]*/g),kt=B(/^data-[\-\w.\u00B7-\uFFFF]+$/),At=B(/^aria-[\-\w]+$/),jt=B(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Mt=B(/^(?:\w+script|data):/i),Nt=B(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Pt=B(/^html$/i),Ft=B(/^[a-z][.\w]*(-[.\w]+)+$/i),It=B(/<[/\w!]/g),Lt=B(/<[/\w]/g),Rt=B(/<\/no(script|embed|frames)/i),zt=B(/\/>/i),X={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Bt=function(){return typeof window>`u`?null:window},Vt=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Ht=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Z=function(e,t,n,r){return U(e,t)&&H(e[t])?q(r.base?J(r.base):{},e[t],r.transform):n};function Ut(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bt(),t=e=>Ut(e);if(t.version=`3.4.13`,t.removed=[],!e||!e.document||e.document.nodeType!==X.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,ee=Y(d,`cloneNode`),f=Y(d,`remove`),te=Y(d,`nextSibling`),p=Y(d,`childNodes`),m=Y(d,`parentNode`),ne=Y(d,`shadowRoot`),re=Y(d,`attributes`),h=o&&o.prototype?Y(o.prototype,`nodeType`):null,g=o&&o.prototype?Y(o.prototype,`nodeName`):null,_=o&&o.prototype?Y(o.prototype,`ownerDocument`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let v,y=``,ie,ae=!1,oe=0,se=function(){if(oe>0)throw ut(`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.`)},b=function(e){se(),oe++;try{return v.createHTML(e)}finally{oe--}},ce=function(e){se(),oe++;try{return v.createScriptURL(e)}finally{oe--}},le=function(){return ae||=(ie=Vt(u,i),!0),ie},ue=n,de=ue.implementation,fe=ue.createNodeIterator,pe=ue.createDocumentFragment,me=ue.getElementsByTagName,he=r.importNode,x=Ht();t.isSupported=typeof He==`function`&&typeof m==`function`&&de&&de.createHTMLDocument!==void 0;let ge=Et,_e=Dt,ve=Ot,ye=kt,be=At,xe=Mt,Se=Nt,Ce=Ft,we=jt,S=null,Te=q({},[...ht,...gt,..._t,...yt,...xt]),C=null,Ee=q({},[...St,...Ct,...wt,...Tt]),w=Object.seal(Ke(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),De=null,Oe=null,T=Object.seal(Ke(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),ke=!0,Ae=!0,je=!1,Me=!0,E=!1,D=!0,O=!1,Ne=!1,Pe=null,k=null,A=!1,j=!1,M=!1,Fe=!1,N=!0,Ie=!1,Le=`user-content-`,P=!0,F=!1,I={},L=null,Re=q({},/* @__PURE__ */ `annotation-xml.audio.colgroup.desc.foreignobject.head.iframe.math.mi.mn.mo.ms.mtext.noembed.noframes.noscript.plaintext.script.selectedcontent.style.svg.template.thead.title.video.xmp`.split(`.`)),ze=null,Be=q({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ve=null,Ue=q({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),We=`http://www.w3.org/1998/Math/MathML`,Ge=`http://www.w3.org/2000/svg`,R=`http://www.w3.org/1999/xhtml`,V=R,qe=!1,Je=null,ot=q({},[We,Ge,R],tt),st=z([`mi`,`mo`,`mn`,`ms`,`mtext`]),ct=q({},st),lt=z([`annotation-xml`]),W=q({},lt),K=q({},[`title`,`style`,`font`,`a`,`script`]),dt=null,ft=[`application/xhtml+xml`,`text/html`],Q=null,Wt=null,Gt=n.createElement(`form`),Kt=function(e){return e instanceof RegExp||e instanceof Function},qt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Wt&&Wt===e)return;(!e||typeof e!=`object`)&&(e={}),e=J(e),dt=ft.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Q=dt===`application/xhtml+xml`?tt:et,S=Z(e,`ALLOWED_TAGS`,Te,{transform:Q}),C=Z(e,`ALLOWED_ATTR`,Ee,{transform:Q}),Je=Z(e,`ALLOWED_NAMESPACES`,ot,{transform:tt}),Ve=Z(e,`ADD_URI_SAFE_ATTR`,Ue,{transform:Q,base:Ue}),ze=Z(e,`ADD_DATA_URI_TAGS`,Be,{transform:Q,base:Be}),L=Z(e,`FORBID_CONTENTS`,Re,{transform:Q}),De=Z(e,`FORBID_TAGS`,J({}),{transform:Q}),Oe=Z(e,`FORBID_ATTR`,J({}),{transform:Q}),I=U(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?J(e.USE_PROFILES):e.USE_PROFILES:!1,ke=e.ALLOW_ARIA_ATTR!==!1,Ae=e.ALLOW_DATA_ATTR!==!1,je=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Me=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,E=e.SAFE_FOR_TEMPLATES||!1,D=e.SAFE_FOR_XML!==!1,O=e.WHOLE_DOCUMENT||!1,j=e.RETURN_DOM||!1,M=e.RETURN_DOM_FRAGMENT||!1,Fe=e.RETURN_TRUSTED_TYPE||!1,A=e.FORCE_BODY||!1,N=e.SANITIZE_DOM!==!1,Ie=e.SANITIZE_NAMED_PROPS||!1,P=e.KEEP_CONTENT!==!1,F=e.IN_PLACE||!1,we=mt(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:jt,V=typeof e.NAMESPACE==`string`?e.NAMESPACE:R,ct=U(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?J(e.MATHML_TEXT_INTEGRATION_POINTS):q({},st),W=U(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?J(e.HTML_INTEGRATION_POINTS):q({},lt);let t=U(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?J(e.CUSTOM_ELEMENT_HANDLING):Ke(null);if(w=Ke(null),U(t,`tagNameCheck`)&&Kt(t.tagNameCheck)&&(w.tagNameCheck=t.tagNameCheck),U(t,`attributeNameCheck`)&&Kt(t.attributeNameCheck)&&(w.attributeNameCheck=t.attributeNameCheck),U(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(w.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),B(w),E&&(Ae=!1),M&&(j=!0),I&&(S=q({},xt),C=Ke(null),I.html===!0&&(q(S,ht),q(C,St)),I.svg===!0&&(q(S,gt),q(C,Ct),q(C,Tt)),I.svgFilters===!0&&(q(S,_t),q(C,Ct),q(C,Tt)),I.mathMl===!0&&(q(S,yt),q(C,wt),q(C,Tt))),T.tagCheck=null,T.attributeCheck=null,U(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?T.tagCheck=e.ADD_TAGS:H(e.ADD_TAGS)&&(S===Te&&(S=J(S)),q(S,e.ADD_TAGS,Q))),U(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?T.attributeCheck=e.ADD_ATTR:H(e.ADD_ATTR)&&(C===Ee&&(C=J(C)),q(C,e.ADD_ATTR,Q))),U(e,`ADD_URI_SAFE_ATTR`)&&H(e.ADD_URI_SAFE_ATTR)&&q(Ve,e.ADD_URI_SAFE_ATTR,Q),U(e,`FORBID_CONTENTS`)&&H(e.FORBID_CONTENTS)&&(L===Re&&(L=J(L)),q(L,e.FORBID_CONTENTS,Q)),U(e,`ADD_FORBID_CONTENTS`)&&H(e.ADD_FORBID_CONTENTS)&&(L===Re&&(L=J(L)),q(L,e.ADD_FORBID_CONTENTS,Q)),P&&(S[`#text`]=!0),O&&q(S,[`html`,`head`,`body`]),S.table&&(q(S,[`tbody`]),delete De.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ut(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ut(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=v;v=e.TRUSTED_TYPES_POLICY;try{y=b(``)}catch(e){throw v=t,e}}else e.TRUSTED_TYPES_POLICY===null?(v=void 0,y=``):(v===void 0&&(v=le()),v&&typeof y==`string`&&(y=b(``)));z&&z(e),Wt=e},Jt=q({},[...gt,..._t,...vt]),Yt=q({},[...yt,...bt]),Xt=function(e,t,n){return t.namespaceURI===R?e===`svg`:t.namespaceURI===We?e===`svg`&&(n===`annotation-xml`||ct[n]):!!Jt[e]},Zt=function(e,t,n){return t.namespaceURI===R?e===`math`:t.namespaceURI===Ge?e===`math`&&W[n]:!!Yt[e]},Qt=function(e,t,n){return t.namespaceURI===Ge&&!W[n]||t.namespaceURI===We&&!ct[n]?!1:!Yt[e]&&(K[e]||!Jt[e])},$t=function(e){let t=m(e);(!t||!t.tagName)&&(t={namespaceURI:V,tagName:`template`});let n=et(e.tagName),r=et(t.tagName);return Je[e.namespaceURI]?e.namespaceURI===Ge?Xt(n,t,r):e.namespaceURI===We?Zt(n,t,r):e.namespaceURI===R?Qt(n,t,r):!!(dt===`application/xhtml+xml`&&Je[e.namespaceURI]):!1},en=function(e){Qe(t.removed,{element:e});try{m(e).removeChild(e)}catch{if(f(e),!m(e))throw ut(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},tn=function(e){an(e);let t=p(e);if(t){let e=[];Ye(t,t=>{Qe(e,t)}),Ye(e,e=>{try{f(e)}catch{}})}let n=re(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},nn=function(e,n){try{Qe(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{Qe(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(j||M)try{en(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},rn=function(e){let t=re(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||C[Q(i)]))try{e.removeAttribute(i)}catch{}}},an=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(h?h(e):e.nodeType)===X.element&&rn(e);let n=p(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},on=function(e){if(!D)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=h?h(e):e.nodeType;if(n===X.processingInstruction||n===X.comment&&G(Lt,e.data)){try{f(e)}catch{}continue}if(n===X.element){let t=e,n=Q(g?g(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=p(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},sn=function(e){let t=null,r=null;if(A)e=`<remove></remove>`+e;else{let t=nt(e,/^[\r\n\t ]+/);r=t&&t[0]}dt===`application/xhtml+xml`&&V===R&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=v?b(e):e;if(V===R)try{t=new l().parseFromString(i,dt)}catch{}if(!t||!t.documentElement){t=de.createDocument(V,`template`,null);try{t.documentElement.innerHTML=qe?y:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),V===R?me.call(t,O?`html`:`body`)[0]:O?t.documentElement:a},cn=function(e){let t=_?_(e):e.ownerDocument;return fe.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ln=function(e){return e=rt(e,ge,` `),e=rt(e,_e,` `),e=rt(e,ve,` `),e},un=function(e){e.normalize();let t=_?_(e):e.ownerDocument,n=fe.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=ln(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Ye(i,e=>{fn(e.content)&&un(e.content)})},dn=function(e){let t=g?g(e):null;return typeof t!=`string`||Q(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.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==h(e)||e.childNodes!==p(e)},fn=function(e){if(!h||typeof e!=`object`||!e)return!1;try{return h(e)===X.documentFragment}catch{return!1}},pn=function(e){if(!h||typeof e!=`object`||!e)return!1;try{return typeof h(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&Ye(e,e=>{e.call(t,n,r,Wt)})}let mn=function(e,t){return!!(D&&e.hasChildNodes()&&!pn(e.firstElementChild)&&G(It,e.textContent)&&G(It,e.innerHTML)||D&&e.namespaceURI===R&&t===`style`&&pn(e.firstElementChild)||e.nodeType===X.processingInstruction||D&&e.nodeType===X.comment&&G(Lt,e.data))},hn=function(e,t,n){if(!De[t]&&bn(t)&&(w.tagNameCheck instanceof RegExp&&G(w.tagNameCheck,t)||w.tagNameCheck instanceof Function&&w.tagNameCheck(t)))return!1;if(P&&!L[t]){let t=m(e),r=p(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?ee(r[a],!0):r[a];t.insertBefore(i,te(e))}}}return en(e),!0},gn=function(e,t,n,r){return e.length===0?t:t===n||t===r?J(t):t},_n=function(e,n){if($(x.beforeSanitizeElements,e,null),e!==n&&m(e)===null)return F&&an(e),!0;if(dn(e))return en(e),!0;let r=Q(g?g(e):e.nodeName);if(S=gn(x.uponSanitizeElement,S,Te,Pe),$(x.uponSanitizeElement,e,{tagName:r,allowedTags:S}),e!==n&&m(e)===null)return F&&an(e),!0;if(mn(e,r))return en(e),!0;if(De[r]||!(T.tagCheck instanceof Function&&T.tagCheck(r))&&!S[r]){let t=hn(e,r,n);return t===!1&&$(x.afterSanitizeElements,e,null),t}if((h?h(e):e.nodeType)===X.element&&!$t(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&G(Rt,e.innerHTML))return en(e),!0;if(E&&e.nodeType===X.text){let n=ln(e.textContent);e.textContent!==n&&(Qe(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(x.afterSanitizeElements,e,null),!1},vn=function(e,t,r){if(Oe[t]||D&&t===`patchsrc`||D&&t===`for`&&e!==`label`&&e!==`output`||N&&(t===`id`||t===`name`)&&(r in n||r in Gt))return!1;let i=C[t]||T.attributeCheck instanceof Function&&T.attributeCheck(t,e);if(!(Ae&&G(ye,t))&&!(ke&&G(be,t))){if(!i){if(!(bn(e)&&(w.tagNameCheck instanceof RegExp&&G(w.tagNameCheck,e)||w.tagNameCheck instanceof Function&&w.tagNameCheck(e))&&(w.attributeNameCheck instanceof RegExp&&G(w.attributeNameCheck,t)||w.attributeNameCheck instanceof Function&&w.attributeNameCheck(t,e))||t===`is`&&w.allowCustomizedBuiltInElements&&(w.tagNameCheck instanceof RegExp&&G(w.tagNameCheck,r)||w.tagNameCheck instanceof Function&&w.tagNameCheck(r))))return!1}else if(!Ve[t]&&!G(we,rt(r,Se,``))&&(t!==`src`&&t!==`xlink:href`&&t!==`href`||e===`script`||it(r,`data:`)!==0||!ze[e])&&(!je||G(xe,rt(r,Se,``)))&&r)return!1}return!0},yn=q({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),bn=function(e){return!yn[et(e)]&&G(Ce,e)},xn=function(e,t,n,r){if(v&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return b(r);case`TrustedScriptURL`:return ce(r)}return r},Sn=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),dn(e)?en(e):Ze(t.removed)}catch{nn(n,e)}},Cn=function(e){$(x.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||dn(e))return;C=gn(x.uponSanitizeAttribute,C,Ee,k);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:C,forceKeepAttr:void 0},r=t.length,i=Q(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=Q(o),u=c,d=o===`value`?u:at(u);n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,$(x.uponSanitizeAttribute,e,n),d=n.attrValue,Ie&&(l===`id`||l===`name`)&&it(d,Le)!==0&&(nn(o,e),d=Le+d),D&&G(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||l===`attributename`&&nt(d,`href`)?nn(o,e):n.forceKeepAttr||(n.keepAttr?!Me&&G(zt,d)?nn(o,e):(E&&(d=ln(d)),vn(i,l,d)?(d=xn(i,l,s,d),d!==u&&Sn(e,o,s,d)):nn(o,e)):nn(o,e))}$(x.afterSanitizeAttributes,e,null)},wn=function(e){let t=null,n=cn(e);for($(x.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(x.uponSanitizeShadowNode,t,null),_n(t,e),Cn(t),fn(t.content)&&wn(t.content),(h?h(t):t.nodeType)===X.element){let e=ne(t);fn(e)&&(Tn(e),wn(e))}$(x.afterSanitizeShadowDOM,e,null)},Tn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){wn(e.shadow);continue}let n=e.node,r=(h?h(n):n.nodeType)===X.element,i=p(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=g?g(n):null;if(typeof e==`string`&&Q(e)===`template`){let e=n.content;fn(e)&&t.push({node:e,shadow:null})}}if(r){let e=ne(n);fn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(qe=!e,qe&&(e=`<!-->`),typeof e!=`string`&&!pn(e)&&(e=pt(e),typeof e!=`string`))throw ut(`dirty is not a string, aborting`);if(!t.isSupported)return e;Ne?(S=Pe,C=k):qt(n),(x.uponSanitizeElement.length>0||x.uponSanitizeAttribute.length>0)&&(S=J(S)),x.uponSanitizeAttribute.length>0&&(C=J(C)),t.removed=[];let c=F&&typeof e!=`string`&&pn(e);if(c){on(e);let t=g?g(e):e.nodeName;if(typeof t==`string`){let n=Q(t);if(!S[n]||De[n])throw tn(e),ut(`root node is forbidden and cannot be sanitized in-place`)}if(dn(e))throw tn(e),ut(`root node is clobbered and cannot be sanitized in-place`);try{Tn(e)}catch(t){throw tn(e),t}}else if(pn(e))i=sn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===X.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Tn(a);else{if(!j&&!E&&!O&&e.indexOf(`<`)===-1)return v&&Fe?b(e):e;if(i=sn(e),!i)return j?null:Fe?y:``}i&&A&&en(i.firstChild);let l=c?e:i;try{let e=cn(l);for(;o=e.nextNode();)_n(o,l),Cn(o),fn(o.content)&&wn(o.content)}catch(n){throw c&&(tn(e),Ye(t.removed,e=>{e.element&&an(e.element)})),n}if(c)return Ye(t.removed,e=>{e.element&&an(e.element)}),E&&un(e),e;if(j){if(E&&un(i),M)for(s=pe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(C.shadowroot||C.shadowrootmode)&&(s=he.call(r,s,!0)),s}let u=O?i.outerHTML:i.innerHTML;return O&&S[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&G(Pt,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
42
- `+u),E&&(u=ln(u)),v&&Fe?b(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};qt(e),Ne=!0,Pe=S,k=C},t.clearConfig=function(){Wt=null,Ne=!1,Pe=null,k=null,v=ie,y=``},t.isValidAttribute=function(e,t,n){Wt||qt({});let r=Q(e),i=Q(t);return vn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&U(x,e)&&Qe(x[e],t)},t.removeHook=function(e,t){if(U(x,e)){if(t!==void 0){let n=Xe(x[e],t);return n===-1?void 0:$e(x[e],n,1)[0]}return Ze(x[e])}},t.removeHooks=function(e){U(x,e)&&(x[e]=[])},t.removeAllHooks=function(){x=Ht()},t}var Q=Ut();export{Q as DOMPurify,Le as Marked};
40
+ function P(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function F(e){if(Array.isArray(e))return e}function Be(e,t){var n=e==null?null:typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(n!=null){var r,i,a,o,s=[],c=!0,l=!1;try{if(a=(n=n.call(e)).next,t!==0)for(;!(c=(r=a.call(n)).done)&&(s.push(r.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&n.return!=null&&(o=n.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}function Ve(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
41
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function He(e,t){return F(e)||Be(e,t)||Ue(e,t)||Ve()}function Ue(e,t){if(e){if(typeof e==`string`)return P(e,t);var n={}.toString.call(e).slice(8,-1);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)?P(e,t):void 0}}const We=Object.entries,Ge=Object.setPrototypeOf,Ke=Object.isFrozen,qe=Object.getPrototypeOf,I=Object.getOwnPropertyDescriptor;let L=Object.freeze,R=Object.seal,Je=Object.create,z=typeof Reflect<`u`&&Reflect,Ye=z.apply,Xe=z.construct;L||=function(e){return e},R||=function(e){return e},Ye||=function(e,t){var n=[...arguments].slice(2);return e.apply(t,n)},Xe||=function(e){return new e(...[...arguments].slice(1))};const Ze=W(Array.prototype.forEach),Qe=W(Array.prototype.lastIndexOf),$e=W(Array.prototype.pop),et=W(Array.prototype.push),tt=W(Array.prototype.splice),B=Array.isArray,nt=W(String.prototype.toLowerCase),rt=W(String.prototype.toString),it=W(String.prototype.match),at=W(String.prototype.replace),ot=W(String.prototype.indexOf),st=W(String.prototype.trim),ct=W(Number.prototype.toString),lt=W(Boolean.prototype.toString),ut=typeof BigInt>`u`?null:W(BigInt.prototype.toString),dt=typeof Symbol>`u`?null:W(Symbol.prototype.toString),V=W(Object.prototype.hasOwnProperty),H=W(Object.prototype.toString),U=W(RegExp.prototype.test),ft=pt(TypeError);function W(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);var n=[...arguments].slice(1);return Ye(e,t,n)}}function pt(e){return function(){return Xe(e,[...arguments])}}function G(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:nt;if(Ge&&Ge(e,null),!B(t))return e;let r=t.length;for(;r--;){let i=t[r];if(typeof i==`string`){let e=n(i);e!==i&&(Ke(t)||(t[r]=e),i=e)}e[i]=!0}return e}function mt(e){for(let t=0;t<e.length;t++)V(e,t)||(e[t]=null);return e}function K(e){let t=Je(null);for(let r of We(e)){var n=He(r,2);let i=n[0],a=n[1];V(e,i)&&(t[i]=B(a)?mt(a):a&&typeof a==`object`&&a.constructor===Object?K(a):a)}return t}function ht(e){switch(typeof e){case`string`:return e;case`number`:return ct(e);case`boolean`:return lt(e);case`bigint`:return ut?ut(e):`0`;case`symbol`:return dt?dt(e):`Symbol()`;case`undefined`:return H(e);case`function`:case`object`:{if(e===null)return H(e);let t=e,n=q(t,`toString`);if(typeof n==`function`){let e=n(t);return typeof e==`string`?e:H(e)}return H(e)}default:return H(e)}}function q(e,t){for(;e!==null;){let n=I(e,t);if(n){if(n.get)return W(n.get);if(typeof n.value==`function`)return W(n.value)}e=qe(e)}function n(){return null}return n}function gt(e){try{return U(e,``),!0}catch{return!1}}const _t=L(/* @__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(`.`)),vt=L(/* @__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(`.`)),yt=L([`feBlend`,`feColorMatrix`,`feComponentTransfer`,`feComposite`,`feConvolveMatrix`,`feDiffuseLighting`,`feDisplacementMap`,`feDistantLight`,`feDropShadow`,`feFlood`,`feFuncA`,`feFuncB`,`feFuncG`,`feFuncR`,`feGaussianBlur`,`feImage`,`feMerge`,`feMergeNode`,`feMorphology`,`feOffset`,`fePointLight`,`feSpecularLighting`,`feSpotLight`,`feTile`,`feTurbulence`]),bt=L([`animate`,`color-profile`,`cursor`,`discard`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`foreignobject`,`hatch`,`hatchpath`,`mesh`,`meshgradient`,`meshpatch`,`meshrow`,`missing-glyph`,`script`,`set`,`solidcolor`,`unknown`,`use`]),xt=L(/* @__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(`.`)),St=L([`maction`,`maligngroup`,`malignmark`,`mlongdiv`,`mscarries`,`mscarry`,`msgroup`,`mstack`,`msline`,`msrow`,`semantics`,`annotation`,`annotation-xml`,`mprescripts`,`none`]),Ct=L([`#text`]),wt=L(/* @__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(`.`)),Tt=L(/* @__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.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.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(`.`)),Et=L(/* @__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(`.`)),Dt=L([`xlink:href`,`xml:id`,`xlink:title`,`xml:space`,`xmlns:xlink`]),Ot=R(/{{[\w\W]*|^[\w\W]*}}/g),kt=R(/<%[\w\W]*|^[\w\W]*%>/g),At=R(/\${[\w\W]*/g),jt=R(/^data-[\-\w.\u00B7-\uFFFF]+$/),Mt=R(/^aria-[\-\w]+$/),Nt=R(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Pt=R(/^(?:\w+script|data):/i),Ft=R(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),It=R(/^html$/i),Lt=R(/^[a-z][.\w]*(-[.\w]+)+$/i),Rt=R(/<[/\w!]/g),zt=R(/<[/\w]/g),Bt=R(/<\/no(script|embed|frames)/i),Vt=R(/\/>/i),J={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ht=function(){return typeof window>`u`?null:window},Ut=function(e,t){if(typeof e!=`object`||typeof e.createPolicy!=`function`)return null;let n=null,r=`data-tt-policy-suffix`;t&&t.hasAttribute(r)&&(n=t.getAttribute(r));let i=`dompurify`+(n?`#`+n:``);try{return e.createPolicy(i,{createHTML(e){return e},createScriptURL(e){return e}})}catch{return console.warn(`TrustedTypes policy `+i+` could not be created.`),null}},Wt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Gt=function(e,t,n,r){return V(e,t)&&B(e[t])?G(r.base?K(r.base):{},e[t],r.transform):n};function Kt(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ht(),t=e=>Kt(e);if(t.version=`3.4.13`,t.removed=[],!e||!e.document||e.document.nodeType!==J.document||!e.Element)return t.isSupported=!1,t;let n=e.document,r=n,i=r.currentScript;e.DocumentFragment;let a=e.HTMLTemplateElement,o=e.Node,s=e.Element,c=e.NodeFilter;e.NamedNodeMap===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let l=e.DOMParser,u=e.trustedTypes,d=s.prototype,f=q(d,`cloneNode`),p=q(d,`remove`),ee=q(d,`nextSibling`),m=q(d,`childNodes`),h=q(d,`parentNode`),te=q(d,`shadowRoot`),ne=q(d,`attributes`),g=o&&o.prototype?q(o.prototype,`nodeType`):null,_=o&&o.prototype?q(o.prototype,`nodeName`):null,v=o&&o.prototype?q(o.prototype,`ownerDocument`):null;if(typeof a==`function`){let e=n.createElement(`template`);e.content&&e.content.ownerDocument&&(n=e.content.ownerDocument)}let y,b=``,re,ie=!1,ae=0,oe=function(){if(ae>0)throw ft(`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.`)},x=function(e){oe(),ae++;try{return y.createHTML(e)}finally{ae--}},se=function(e){oe(),ae++;try{return y.createScriptURL(e)}finally{ae--}},ce=function(){return ie||=(re=Ut(u,i),!0),re},le=n,ue=le.implementation,de=le.createNodeIterator,fe=le.createDocumentFragment,pe=le.getElementsByTagName,me=r.importNode,S=Wt();t.isSupported=typeof We==`function`&&typeof h==`function`&&ue&&ue.createHTMLDocument!==void 0;let he=Ot,ge=kt,_e=At,ve=jt,ye=Mt,be=Pt,xe=Ft,Se=Lt,Ce=Nt,C=null,we=G({},[..._t,...vt,...yt,...xt,...Ct]),w=null,Te=G({},[...wt,...Tt,...Et,...Dt]),T=Object.seal(Je(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ee=null,De=null,E=Object.seal(Je(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Oe=!0,ke=!0,Ae=!1,je=!0,D=!1,O=!0,k=!1,Me=!1,Ne=null,Pe=null,Fe=!1,A=!1,Ie=!1,Le=!1,j=!0,Re=!1,ze=`user-content-`,M=!0,N=!1,P={},F=null,Be=G({},/* @__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(`.`)),Ve=null,He=G({},[`audio`,`video`,`img`,`source`,`image`,`track`]),Ue=null,Ge=G({},[`alt`,`class`,`for`,`id`,`label`,`name`,`pattern`,`placeholder`,`role`,`summary`,`title`,`value`,`style`,`xmlns`]),Ke=`http://www.w3.org/1998/Math/MathML`,qe=`http://www.w3.org/2000/svg`,I=`http://www.w3.org/1999/xhtml`,z=I,Ye=!1,Xe=null,ct=G({},[Ke,qe,I],rt),lt=L([`mi`,`mo`,`mn`,`ms`,`mtext`]),ut=G({},lt),dt=L([`annotation-xml`]),H=G({},dt),W=G({},[`title`,`style`,`font`,`a`,`script`]),pt=null,mt=[`application/xhtml+xml`,`text/html`],Y=null,X=null,qt=n.createElement(`form`),Jt=function(e){return e instanceof RegExp||e instanceof Function},Yt=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(X&&X===e)return;(!e||typeof e!=`object`)&&(e={}),e=K(e),pt=mt.indexOf(e.PARSER_MEDIA_TYPE)===-1?`text/html`:e.PARSER_MEDIA_TYPE,Y=pt===`application/xhtml+xml`?rt:nt,C=Gt(e,`ALLOWED_TAGS`,we,{transform:Y}),w=Gt(e,`ALLOWED_ATTR`,Te,{transform:Y}),Xe=Gt(e,`ALLOWED_NAMESPACES`,ct,{transform:rt}),Ue=Gt(e,`ADD_URI_SAFE_ATTR`,Ge,{transform:Y,base:Ge}),Ve=Gt(e,`ADD_DATA_URI_TAGS`,He,{transform:Y,base:He}),F=Gt(e,`FORBID_CONTENTS`,Be,{transform:Y}),Ee=Gt(e,`FORBID_TAGS`,K({}),{transform:Y}),De=Gt(e,`FORBID_ATTR`,K({}),{transform:Y}),P=V(e,`USE_PROFILES`)?e.USE_PROFILES&&typeof e.USE_PROFILES==`object`?K(e.USE_PROFILES):e.USE_PROFILES:!1,Oe=e.ALLOW_ARIA_ATTR!==!1,ke=e.ALLOW_DATA_ATTR!==!1,Ae=e.ALLOW_UNKNOWN_PROTOCOLS||!1,je=e.ALLOW_SELF_CLOSE_IN_ATTR!==!1,D=e.SAFE_FOR_TEMPLATES||!1,O=e.SAFE_FOR_XML!==!1,k=e.WHOLE_DOCUMENT||!1,A=e.RETURN_DOM||!1,Ie=e.RETURN_DOM_FRAGMENT||!1,Le=e.RETURN_TRUSTED_TYPE||!1,Fe=e.FORCE_BODY||!1,j=e.SANITIZE_DOM!==!1,Re=e.SANITIZE_NAMED_PROPS||!1,M=e.KEEP_CONTENT!==!1,N=e.IN_PLACE||!1,Ce=gt(e.ALLOWED_URI_REGEXP)?e.ALLOWED_URI_REGEXP:Nt,z=typeof e.NAMESPACE==`string`?e.NAMESPACE:I,ut=V(e,`MATHML_TEXT_INTEGRATION_POINTS`)&&e.MATHML_TEXT_INTEGRATION_POINTS&&typeof e.MATHML_TEXT_INTEGRATION_POINTS==`object`?K(e.MATHML_TEXT_INTEGRATION_POINTS):G({},lt),H=V(e,`HTML_INTEGRATION_POINTS`)&&e.HTML_INTEGRATION_POINTS&&typeof e.HTML_INTEGRATION_POINTS==`object`?K(e.HTML_INTEGRATION_POINTS):G({},dt);let t=V(e,`CUSTOM_ELEMENT_HANDLING`)&&e.CUSTOM_ELEMENT_HANDLING&&typeof e.CUSTOM_ELEMENT_HANDLING==`object`?K(e.CUSTOM_ELEMENT_HANDLING):Je(null);if(T=Je(null),V(t,`tagNameCheck`)&&Jt(t.tagNameCheck)&&(T.tagNameCheck=t.tagNameCheck),V(t,`attributeNameCheck`)&&Jt(t.attributeNameCheck)&&(T.attributeNameCheck=t.attributeNameCheck),V(t,`allowCustomizedBuiltInElements`)&&typeof t.allowCustomizedBuiltInElements==`boolean`&&(T.allowCustomizedBuiltInElements=t.allowCustomizedBuiltInElements),R(T),D&&(ke=!1),Ie&&(A=!0),P&&(C=G({},Ct),w=Je(null),P.html===!0&&(G(C,_t),G(w,wt)),P.svg===!0&&(G(C,vt),G(w,Tt),G(w,Dt)),P.svgFilters===!0&&(G(C,yt),G(w,Tt),G(w,Dt)),P.mathMl===!0&&(G(C,xt),G(w,Et),G(w,Dt))),E.tagCheck=null,E.attributeCheck=null,V(e,`ADD_TAGS`)&&(typeof e.ADD_TAGS==`function`?E.tagCheck=e.ADD_TAGS:B(e.ADD_TAGS)&&(C===we&&(C=K(C)),G(C,e.ADD_TAGS,Y))),V(e,`ADD_ATTR`)&&(typeof e.ADD_ATTR==`function`?E.attributeCheck=e.ADD_ATTR:B(e.ADD_ATTR)&&(w===Te&&(w=K(w)),G(w,e.ADD_ATTR,Y))),V(e,`ADD_URI_SAFE_ATTR`)&&B(e.ADD_URI_SAFE_ATTR)&&G(Ue,e.ADD_URI_SAFE_ATTR,Y),V(e,`FORBID_CONTENTS`)&&B(e.FORBID_CONTENTS)&&(F===Be&&(F=K(F)),G(F,e.FORBID_CONTENTS,Y)),V(e,`ADD_FORBID_CONTENTS`)&&B(e.ADD_FORBID_CONTENTS)&&(F===Be&&(F=K(F)),G(F,e.ADD_FORBID_CONTENTS,Y)),M&&(C[`#text`]=!0),k&&G(C,[`html`,`head`,`body`]),C.table&&(G(C,[`tbody`]),delete Ee.tbody),e.TRUSTED_TYPES_POLICY){if(typeof e.TRUSTED_TYPES_POLICY.createHTML!=`function`)throw ft(`TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.`);if(typeof e.TRUSTED_TYPES_POLICY.createScriptURL!=`function`)throw ft(`TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.`);let t=y;y=e.TRUSTED_TYPES_POLICY;try{b=x(``)}catch(e){throw y=t,e}}else e.TRUSTED_TYPES_POLICY===null?(y=void 0,b=``):(y===void 0&&(y=ce()),y&&typeof b==`string`&&(b=x(``)));L&&L(e),X=e},Xt=G({},[...vt,...yt,...bt]),Zt=G({},[...xt,...St]),Qt=function(e,t,n){return t.namespaceURI===I?e===`svg`:t.namespaceURI===Ke?e===`svg`&&(n===`annotation-xml`||ut[n]):!!Xt[e]},Z=function(e,t,n){return t.namespaceURI===I?e===`math`:t.namespaceURI===qe?e===`math`&&H[n]:!!Zt[e]},$t=function(e,t,n){return t.namespaceURI===qe&&!H[n]||t.namespaceURI===Ke&&!ut[n]?!1:!Zt[e]&&(W[e]||!Xt[e])},en=function(e){let t=h(e);(!t||!t.tagName)&&(t={namespaceURI:z,tagName:`template`});let n=nt(e.tagName),r=nt(t.tagName);return Xe[e.namespaceURI]?e.namespaceURI===qe?Qt(n,t,r):e.namespaceURI===Ke?Z(n,t,r):e.namespaceURI===I?$t(n,t,r):!!(pt===`application/xhtml+xml`&&Xe[e.namespaceURI]):!1},Q=function(e){et(t.removed,{element:e});try{h(e).removeChild(e)}catch{if(p(e),!h(e))throw ft(`a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place`)}},tn=function(e){an(e);let t=m(e);if(t){let e=[];Ze(t,t=>{et(e,t)}),Ze(e,e=>{try{p(e)}catch{}})}let n=ne(e);if(n)for(let t=n.length-1;t>=0;--t){let r=n[t],i=r&&r.name;if(typeof i==`string`)try{e.removeAttribute(i)}catch{}}},nn=function(e,n){try{et(t.removed,{attribute:n.getAttributeNode(e),from:n})}catch{et(t.removed,{attribute:null,from:n})}if(n.removeAttribute(e),e===`is`){if(A||Ie)try{Q(n)}catch{}else try{n.setAttribute(e,``)}catch{}}},rn=function(e){let t=ne(e);if(t)for(let n=t.length-1;n>=0;--n){let r=t[n],i=r&&r.name;if(!(typeof i!=`string`||w[Y(i)]))try{e.removeAttribute(i)}catch{}}},an=function(e){let t=[e];for(;t.length>0;){let e=t.pop();(g?g(e):e.nodeType)===J.element&&rn(e);let n=m(e);if(n)for(let e=n.length-1;e>=0;--e)t.push(n[e])}},on=function(e){if(!O)return;let t=[e];for(;t.length>0;){let e=t.pop(),n=g?g(e):e.nodeType;if(n===J.processingInstruction||n===J.comment&&U(zt,e.data)){try{p(e)}catch{}continue}if(n===J.element){let t=e,n=Y(_?_(e):e.nodeName);try{t.hasAttribute&&t.hasAttribute(`patchsrc`)&&t.removeAttribute(`patchsrc`),t.hasAttribute&&t.hasAttribute(`for`)&&n!==`label`&&n!==`output`&&t.removeAttribute(`for`)}catch{}}let r=m(e);if(r)for(let e=r.length-1;e>=0;--e)t.push(r[e])}},sn=function(e){let t=null,r=null;if(Fe)e=`<remove></remove>`+e;else{let t=it(e,/^[\r\n\t ]+/);r=t&&t[0]}pt===`application/xhtml+xml`&&z===I&&(e=`<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>`+e+`</body></html>`);let i=y?x(e):e;if(z===I)try{t=new l().parseFromString(i,pt)}catch{}if(!t||!t.documentElement){t=ue.createDocument(z,`template`,null);try{t.documentElement.innerHTML=Ye?b:i}catch{}}let a=t.body||t.documentElement;return e&&r&&a.insertBefore(n.createTextNode(r),a.childNodes[0]||null),z===I?pe.call(t,k?`html`:`body`)[0]:k?t.documentElement:a},cn=function(e){let t=v?v(e):e.ownerDocument;return de.call(t||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},ln=function(e){return e=at(e,he,` `),e=at(e,ge,` `),e=at(e,_e,` `),e},un=function(e){e.normalize();let t=v?v(e):e.ownerDocument,n=de.call(t||e,e,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),r=n.nextNode();for(;r;)r.data=ln(r.data),r=n.nextNode();let i=e.querySelectorAll?.call(e,`template`);i&&Ze(i,e=>{fn(e.content)&&un(e.content)})},dn=function(e){let t=_?_(e):null;return typeof t!=`string`||Y(t)!==`form`?!1:typeof e.nodeName!=`string`||typeof e.textContent!=`string`||typeof e.removeChild!=`function`||e.attributes!==ne(e)||typeof e.removeAttribute!=`function`||typeof e.setAttribute!=`function`||typeof e.namespaceURI!=`string`||typeof e.insertBefore!=`function`||typeof e.hasChildNodes!=`function`||e.nodeType!==g(e)||e.childNodes!==m(e)},fn=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return g(e)===J.documentFragment}catch{return!1}},pn=function(e){if(!g||typeof e!=`object`||!e)return!1;try{return typeof g(e)==`number`}catch{return!1}};function $(e,n,r){e.length!==0&&Ze(e,e=>{e.call(t,n,r,X)})}let mn=function(e,t){return!!(O&&e.hasChildNodes()&&!pn(e.firstElementChild)&&U(Rt,e.textContent)&&U(Rt,e.innerHTML)||O&&e.namespaceURI===I&&t===`style`&&pn(e.firstElementChild)||e.nodeType===J.processingInstruction||O&&e.nodeType===J.comment&&U(zt,e.data))},hn=function(e,t,n){if(!Ee[t]&&bn(t)&&(T.tagNameCheck instanceof RegExp&&U(T.tagNameCheck,t)||T.tagNameCheck instanceof Function&&T.tagNameCheck(t)))return!1;if(M&&!F[t]){let t=h(e),r=m(e);if(r&&t){let i=r.length;for(let a=i-1;a>=0;--a){let i=e===n?f(r[a],!0):r[a];t.insertBefore(i,ee(e))}}}return Q(e),!0},gn=function(e,t,n,r){return e.length===0?t:t===n||t===r?K(t):t},_n=function(e,n){if($(S.beforeSanitizeElements,e,null),e!==n&&h(e)===null)return N&&an(e),!0;if(dn(e))return Q(e),!0;let r=Y(_?_(e):e.nodeName);if(C=gn(S.uponSanitizeElement,C,we,Ne),$(S.uponSanitizeElement,e,{tagName:r,allowedTags:C}),e!==n&&h(e)===null)return N&&an(e),!0;if(mn(e,r))return Q(e),!0;if(Ee[r]||!(E.tagCheck instanceof Function&&E.tagCheck(r))&&!C[r]){let t=hn(e,r,n);return t===!1&&$(S.afterSanitizeElements,e,null),t}if((g?g(e):e.nodeType)===J.element&&!en(e)||(r===`noscript`||r===`noembed`||r===`noframes`)&&U(Bt,e.innerHTML))return Q(e),!0;if(D&&e.nodeType===J.text){let n=ln(e.textContent);e.textContent!==n&&(et(t.removed,{element:e.cloneNode()}),e.textContent=n)}return $(S.afterSanitizeElements,e,null),!1},vn=function(e,t,r){if(De[t]||O&&t===`patchsrc`||O&&t===`for`&&e!==`label`&&e!==`output`||j&&(t===`id`||t===`name`)&&(r in n||r in qt))return!1;let i=w[t]||E.attributeCheck instanceof Function&&E.attributeCheck(t,e);if(!(ke&&U(ve,t))&&!(Oe&&U(ye,t))){if(!i){if(!(bn(e)&&(T.tagNameCheck instanceof RegExp&&U(T.tagNameCheck,e)||T.tagNameCheck instanceof Function&&T.tagNameCheck(e))&&(T.attributeNameCheck instanceof RegExp&&U(T.attributeNameCheck,t)||T.attributeNameCheck instanceof Function&&T.attributeNameCheck(t,e))||t===`is`&&T.allowCustomizedBuiltInElements&&(T.tagNameCheck instanceof RegExp&&U(T.tagNameCheck,r)||T.tagNameCheck instanceof Function&&T.tagNameCheck(r))))return!1}else if(!Ue[t]&&!U(Ce,at(r,xe,``))&&(t!==`src`&&t!==`xlink:href`&&t!==`href`||e===`script`||ot(r,`data:`)!==0||!Ve[e])&&(!Ae||U(be,at(r,xe,``)))&&r)return!1}return!0},yn=G({},[`annotation-xml`,`color-profile`,`font-face`,`font-face-format`,`font-face-name`,`font-face-src`,`font-face-uri`,`missing-glyph`]),bn=function(e){return!yn[nt(e)]&&U(Se,e)},xn=function(e,t,n,r){if(y&&typeof u==`object`&&typeof u.getAttributeType==`function`&&!n)switch(u.getAttributeType(e,t)){case`TrustedHTML`:return x(r);case`TrustedScriptURL`:return se(r)}return r},Sn=function(e,n,r,i){try{r?e.setAttributeNS(r,n,i):e.setAttribute(n,i),dn(e)?Q(e):$e(t.removed)}catch{nn(n,e)}},Cn=function(e){$(S.beforeSanitizeAttributes,e,null);let t=e.attributes;if(!t||dn(e))return;w=gn(S.uponSanitizeAttribute,w,Te,Pe);let n={attrName:``,attrValue:``,keepAttr:!0,allowedAttributes:w,forceKeepAttr:void 0},r=t.length,i=Y(e.nodeName);for(;r--;){let a=t[r],o=a.name,s=a.namespaceURI,c=a.value,l=Y(o),u=c,d=o===`value`?u:st(u);n.attrName=l,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,$(S.uponSanitizeAttribute,e,n),d=n.attrValue,Re&&(l===`id`||l===`name`)&&ot(d,ze)!==0&&(nn(o,e),d=ze+d),O&&U(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||l===`attributename`&&it(d,`href`)?nn(o,e):n.forceKeepAttr||(n.keepAttr?!je&&U(Vt,d)?nn(o,e):(D&&(d=ln(d)),vn(i,l,d)?(d=xn(i,l,s,d),d!==u&&Sn(e,o,s,d)):nn(o,e)):nn(o,e))}$(S.afterSanitizeAttributes,e,null)},wn=function(e){let t=null,n=cn(e);for($(S.beforeSanitizeShadowDOM,e,null);t=n.nextNode();)if($(S.uponSanitizeShadowNode,t,null),_n(t,e),Cn(t),fn(t.content)&&wn(t.content),(g?g(t):t.nodeType)===J.element){let e=te(t);fn(e)&&(Tn(e),wn(e))}$(S.afterSanitizeShadowDOM,e,null)},Tn=function(e){let t=[{node:e,shadow:null}];for(;t.length>0;){let e=t.pop();if(e.shadow){wn(e.shadow);continue}let n=e.node,r=(g?g(n):n.nodeType)===J.element,i=m(n);if(i)for(let e=i.length-1;e>=0;--e)t.push({node:i[e],shadow:null});if(r){let e=_?_(n):null;if(typeof e==`string`&&Y(e)===`template`){let e=n.content;fn(e)&&t.push({node:e,shadow:null})}}if(r){let e=te(n);fn(e)&&t.push({node:null,shadow:e},{node:e,shadow:null})}}};return t.sanitize=function(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=null,a=null,o=null,s=null;if(Ye=!e,Ye&&(e=`<!-->`),typeof e!=`string`&&!pn(e)&&(e=ht(e),typeof e!=`string`))throw ft(`dirty is not a string, aborting`);if(!t.isSupported)return e;Me?(C=Ne,w=Pe):Yt(n),(S.uponSanitizeElement.length>0||S.uponSanitizeAttribute.length>0)&&(C=K(C)),S.uponSanitizeAttribute.length>0&&(w=K(w)),t.removed=[];let c=N&&typeof e!=`string`&&pn(e);if(c){on(e);let t=_?_(e):e.nodeName;if(typeof t==`string`){let n=Y(t);if(!C[n]||Ee[n])throw tn(e),ft(`root node is forbidden and cannot be sanitized in-place`)}if(dn(e))throw tn(e),ft(`root node is clobbered and cannot be sanitized in-place`);try{Tn(e)}catch(t){throw tn(e),t}}else if(pn(e))i=sn(`<!---->`),a=i.ownerDocument.importNode(e,!0),a.nodeType===J.element&&a.nodeName===`BODY`||a.nodeName===`HTML`?i=a:i.appendChild(a),Tn(a);else{if(!A&&!D&&!k&&e.indexOf(`<`)===-1)return y&&Le?x(e):e;if(i=sn(e),!i)return A?null:Le?b:``}i&&Fe&&Q(i.firstChild);let l=c?e:i;try{let e=cn(l);for(;o=e.nextNode();)_n(o,l),Cn(o),fn(o.content)&&wn(o.content)}catch(n){throw c&&(tn(e),Ze(t.removed,e=>{e.element&&an(e.element)})),n}if(c)return Ze(t.removed,e=>{e.element&&an(e.element)}),D&&un(e),e;if(A){if(D&&un(i),Ie)for(s=fe.call(i.ownerDocument);i.firstChild;)s.appendChild(i.firstChild);else s=i;return(w.shadowroot||w.shadowrootmode)&&(s=me.call(r,s,!0)),s}let u=k?i.outerHTML:i.innerHTML;return k&&C[`!doctype`]&&i.ownerDocument&&i.ownerDocument.doctype&&i.ownerDocument.doctype.name&&U(It,i.ownerDocument.doctype.name)&&(u=`<!DOCTYPE `+i.ownerDocument.doctype.name+`>
42
+ `+u),D&&(u=ln(u)),y&&Le?x(u):u},t.setConfig=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Yt(e),Me=!0,Ne=C,Pe=w},t.clearConfig=function(){X=null,Me=!1,Ne=null,Pe=null,y=re,b=``},t.isValidAttribute=function(e,t,n){X||Yt({});let r=Y(e),i=Y(t);return vn(r,i,n)},t.addHook=function(e,t){typeof t==`function`&&V(S,e)&&et(S[e],t)},t.removeHook=function(e,t){if(V(S,e)){if(t!==void 0){let n=Qe(S[e],t);return n===-1?void 0:tt(S[e],n,1)[0]}return $e(S[e])}},t.removeHooks=function(e){V(S,e)&&(S[e]=[])},t.removeAllHooks=function(){S=Wt()},t}var Y=Kt();const X=/^\s*\|?[\s:|-]*-[\s:|-]*$/,qt=e=>e.includes(`|`),Jt=e=>{let t=e.trim();return t.startsWith(`|`)&&(t=t.slice(1)),t.endsWith(`|`)&&(t=t.slice(0,-1)),t.split(`|`).map(e=>e.trim())},Yt=e=>`| ${e.join(` | `)} |`,Xt=e=>`| ${Array.from({length:e},()=>`---`).join(` | `)} |`,Zt=(e,t)=>e.length>=t?e.slice(0,t):e.concat(Array.from({length:t-e.length},()=>``)),Qt=e=>{if(!e||!e.includes(`|`))return e;let t=e.split(`
43
+ `),n=!1;for(let e=0;e<t.length-1;e++){let r=t[e],i=t[e+1];if(!qt(r)||X.test(r)||!X.test(i))continue;let a=Jt(r).length;if(a<1)continue;let o=Xt(a);t[e+1]!==o&&(t[e+1]=o,n=!0);let s=e+2;for(;s<t.length;s++){let e=t[s];if(e.trim()===``||!qt(e))break;let r=Yt(Zt(Jt(e),a));t[s]!==r&&(t[s]=r,n=!0)}e=s-1}return n?t.join(`
44
+ `):e},Z=e=>!e||/\s/.test(e),$t=e=>!!e&&/[\p{P}\p{S}]/u.test(e),en=(e,t,n)=>{let r=e.slice(t,n),i=n;for(;(i=e.indexOf(r,i))!==-1;){if(e[i-1]!=="`"&&e[i+r.length]!=="`")return i+r.length;i+=r.length}return-1},Q=(e,t=!0)=>{let n=[],r=/* @__PURE__ */ new Set,i=``;for(let a=0;a<e.length;){let o=e[a];if(o===`\\`)i+=e.slice(a,a+2),a+=2;else if(o==="`"){let t=a+1;for(;e[t]==="`";)t++;let n=e.slice(a,t),r=en(e,a,t);if(r!==-1)i+=e.slice(a,r),a=r;else{let r=e.slice(t);i+=r?`${n}${r}${r.endsWith("`")?` `:``}${n}`:``,a=e.length}}else if(o===`<`){let t=e.indexOf(`>`,a+1);i+=e.slice(a,t<0?e.length:t+1),a=t<0?e.length:t+1}else if(t&&(o===`[`||o===`!`&&e[a+1]===`[`)){let t=o===`!`,n=a+(t?2:1),r=1,s=n;for(;s<e.length;s++)if(e[s]===`\\`)s++;else if(e[s]==="`"){let t=s+1;for(;e[t]==="`";)t++;let n=en(e,s,t);s=(n<0?t:n)-1}else if(e[s]===`[`&&r++,e[s]===`]`&&--r===0)break;if(s>=e.length){i+=t?``:Q(e.slice(n),!1);break}if(e[s+1]===`(`){let r=1,o=``,c=!1,l=s+2;for(;l<e.length;l++){let t=e[l];if(t===`\\`)l++;else if(o)t===o&&(o=``);else if((t===`"`||t===`'`)&&Z(e[l-1]))o=t;else if(t===`<`&&(c=!0),t===`>`&&(c=!1),!c&&t===`(`&&r++,!c&&t===`)`&&--r===0)break}if(l>=e.length){i+=t?``:Q(e.slice(n,s),!1);break}i+=e.slice(a,l+1),a=l+1;continue}if(s===e.length-1){i+=t?``:Q(e.slice(n,s),!1);break}i+=e.slice(a,s+1),a=s+1}else if(o===`*`||o===`_`){let t=a+1;for(;e[t]===o;)t++;let s=e.slice(a,t),c=e[a-1]??``,l=e[t]??``,u=!Z(l)&&(!$t(l)||Z(c)||$t(c)),d=!Z(c)&&(!$t(c)||Z(l)||$t(l)),f=s.length;if(d&&(o!==`_`||!u||$t(l)))for(;f&&n[n.length-1]?.marker[0]===o;){let e=n[n.length-1],t=Math.min(f,e.marker.length);f-=t,e.marker=e.marker.slice(t),e.marker||n.pop()}if(f&&s.length<=3&&u&&!d)n.push({marker:o.repeat(f)});else if(f===s.length&&t===e.length&&Z(c)&&e.slice(e.lastIndexOf(`
45
+ `,a)+1,a).trim()&&(n.length>0||!r.has(o))){a=t;continue}Z(c)&&Z(l)&&t<e.length&&r.add(o),i+=s,a=t}else i+=o,a++}let a=i.match(/\s*$/)?.[0]??``;i=i.slice(0,i.length-a.length),n.length&&(i.match(/\\+$/)?.[0].length??0)%2&&(i+=`\\`);for(let e=n.length-1;e>=0;e--)i+=n[e].marker;return i+a},tn=e=>{let t=``,n=``,r=``,i=()=>{t+=Qt(n).split(/(\n\s*\n)/).map(e=>/^\n\s*\n$/.test(e)?e:Q(e)).join(``),n=``};for(let a of e.match(/[^\n]*\n|[^\n]+$/g)??[]){let e=/^(?: {0,3}> ?)* {0,3}(?:[-+*] )?(`{3,}|~{3,})(.*)/.exec(a);r?(t+=a,e&&e[1][0]===r[0]&&e[1].length>=r.length&&!e[2].trim()&&(r=``)):e?(i(),r=e[1],t+=a):/^(?: {4}|\t)/.test(a)?(i(),t+=a):n+=a}return i(),t};export{Y as DOMPurify,ze as Marked,tn as stabilizeStreamingMarkdown};
@@ -1,4 +1,4 @@
1
- import { Ct as AgentWidgetMessage, Et as AgentWidgetMessageLayoutConfig, Tt as AgentWidgetMessageFeedback, hi as LoadingIndicatorRenderContext, k as AgentWidgetConfig, mo as MessageGeometryTokens, wt as AgentWidgetMessageActionsConfig } from "./types-CiXi4ICM.cjs";
1
+ import { Ct as AgentWidgetMessage, Et as AgentWidgetMessageLayoutConfig, Tt as AgentWidgetMessageFeedback, hi as LoadingIndicatorRenderContext, k as AgentWidgetConfig, mo as MessageGeometryTokens, wt as AgentWidgetMessageActionsConfig } from "./types-CSXHl5cN.cjs";
2
2
  //#region src/components/message-bubble.d.ts
3
3
  type LoadingIndicatorRenderer = (context: LoadingIndicatorRenderContext) => HTMLElement | null;
4
4
  type MessageTransform = (context: {
@@ -1,4 +1,4 @@
1
- import { Ct as AgentWidgetMessage, Et as AgentWidgetMessageLayoutConfig, Tt as AgentWidgetMessageFeedback, hi as LoadingIndicatorRenderContext, k as AgentWidgetConfig, mo as MessageGeometryTokens, wt as AgentWidgetMessageActionsConfig } from "./types-CiXi4ICM.js";
1
+ import { Ct as AgentWidgetMessage, Et as AgentWidgetMessageLayoutConfig, Tt as AgentWidgetMessageFeedback, hi as LoadingIndicatorRenderContext, k as AgentWidgetConfig, mo as MessageGeometryTokens, wt as AgentWidgetMessageActionsConfig } from "./types-CSXHl5cN.js";
2
2
  //#region src/components/message-bubble.d.ts
3
3
  type LoadingIndicatorRenderer = (context: LoadingIndicatorRenderContext) => HTMLElement | null;
4
4
  type MessageTransform = (context: {
@@ -1,3 +1,3 @@
1
- import { i as applyFeaturePreferences } from "./feature-preferences-eeSOmDxg.cjs";
1
+ import { i as applyFeaturePreferences } from "./feature-preferences-BT549D_E.cjs";
2
2
  export { applyFeaturePreferences };
3
3
  export {}
@@ -1,3 +1,3 @@
1
- import { i as applyFeaturePreferences } from "./feature-preferences-eeSOmDxg.js";
1
+ import { i as applyFeaturePreferences } from "./feature-preferences-BT549D_E.js";
2
2
  export { applyFeaturePreferences };
3
3
  export {}
@@ -1,5 +1,5 @@
1
- import { Ct as AgentWidgetMessage, do as DeepPartial, ho as PersonaTheme, k as AgentWidgetConfig } from "./types-CiXi4ICM.cjs";
2
- import { wn as AgentWidgetController } from "./session-C0fSteA4.cjs";
1
+ import { Ct as AgentWidgetMessage, do as DeepPartial, ho as PersonaTheme, k as AgentWidgetConfig } from "./types-CSXHl5cN.cjs";
2
+ import { Tn as AgentWidgetController } from "./session-Dj4bOm5y.cjs";
3
3
  //#region src/theme-editor/preview-utils.d.ts
4
4
  declare const DEVICE_DIMENSIONS: Record<string, {
5
5
  w: number;
@@ -1,5 +1,5 @@
1
- import { Ct as AgentWidgetMessage, do as DeepPartial, ho as PersonaTheme, k as AgentWidgetConfig } from "./types-CiXi4ICM.js";
2
- import { wn as AgentWidgetController } from "./session-C0fSteA4.js";
1
+ import { Ct as AgentWidgetMessage, do as DeepPartial, ho as PersonaTheme, k as AgentWidgetConfig } from "./types-CSXHl5cN.js";
2
+ import { Tn as AgentWidgetController } from "./session-Dj4bOm5y.js";
3
3
  //#region src/theme-editor/preview-utils.d.ts
4
4
  declare const DEVICE_DIMENSIONS: Record<string, {
5
5
  w: number;
@@ -1,4 +1,4 @@
1
- import { D as AgentWidgetComponentRenderer, T as AgentWidgetComponentRenderContext } from "./types-CiXi4ICM.js";
1
+ import { D as AgentWidgetComponentRenderer, T as AgentWidgetComponentRenderContext } from "./types-CSXHl5cN.cjs";
2
2
  import { Marked } from "marked";
3
3
  import DOMPurify from "dompurify";
4
4
  //#endregion
@@ -6,6 +6,8 @@ import DOMPurify from "dompurify";
6
6
  type MarkdownParsersModule = {
7
7
  Marked: typeof Marked;
8
8
  DOMPurify: typeof DOMPurify;
9
+ /** Optional for compatibility with custom parser loaders. Display-only repairs. */
10
+ stabilizeStreamingMarkdown?: (source: string) => string;
9
11
  };
10
12
  declare const loadMarkdownParsers: () => Promise<MarkdownParsersModule>;
11
13
  /**
@@ -1,4 +1,4 @@
1
- import { D as AgentWidgetComponentRenderer, T as AgentWidgetComponentRenderContext } from "./types-CiXi4ICM.cjs";
1
+ import { D as AgentWidgetComponentRenderer, T as AgentWidgetComponentRenderContext } from "./types-CSXHl5cN.js";
2
2
  import { Marked } from "marked";
3
3
  import DOMPurify from "dompurify";
4
4
  //#endregion
@@ -6,6 +6,8 @@ import DOMPurify from "dompurify";
6
6
  type MarkdownParsersModule = {
7
7
  Marked: typeof Marked;
8
8
  DOMPurify: typeof DOMPurify;
9
+ /** Optional for compatibility with custom parser loaders. Display-only repairs. */
10
+ stabilizeStreamingMarkdown?: (source: string) => string;
9
11
  };
10
12
  declare const loadMarkdownParsers: () => Promise<MarkdownParsersModule>;
11
13
  /**
@@ -1,11 +1,11 @@
1
- import { t as ComponentContext } from "./registry-BBe-Lesw.cjs";
2
- import { $ as AgentWidgetEvent, $r as HistoryConversationPage, $t as AgentWidgetStateSnapshot, A as AgentWidgetConfigPatch, Ar as ComposerQuote, B as AgentWidgetContextMentionRef, Bn as AttachmentPreviewRenderContext, Bt as AgentWidgetRunStartedEvent, C as AgentWidgetAttachmentsConfig, Ct as AgentWidgetMessage, Dn as AgentWidgetWebMcpConfig, Dr as ComposerOptionsPayload, E as AgentWidgetComponentRenderHandle, Hi as SpeechCallbacks, I as AgentWidgetContextMentionItem, Ja as RuntypeExecutionStreamEvent, Ki as StreamAnimationPlugin, Kn as ClientFeedbackRequest, Li as ResumableHandle, Ln as AskUserQuestionPayload, Lr as ContentPart, Mr as ComposerState, N as AgentWidgetContextMentionCommandContext, Ni as PreparedClientSession, Oa as HistoryListResult, Ot as AgentWidgetOpenConversationOptions, Pi as ReadAloudState, Q as AgentWidgetDockConfig, Qr as HistoryConversationDetail, Rr as ConversationExecutionState, U as AgentWidgetContextMentionSource, Ui as SpeechEngine, Ur as DictationState, Vn as AttachmentPreviewRenderHandle, Wi as SpeechRequest, Yn as ClientSession, Zi as VoiceClientTools, Zn as ClientToolDefinition, _a as WebMcpToolResult, _t as AgentWidgetMarkdownConfig, ai as HistoryReturnSurface, ao as BrandConfig, cn as AgentWidgetStreamCheckpoint, da as VoiceResult, di as InjectComponentDirectiveOptions, dn as AgentWidgetSuggestion, do as DeepPartial, ei as HistoryConversationPatch, en as AgentWidgetStorageAdapter, f as AgentWidgetActionParser, fa as VoiceSessionBridge, fi as InjectMessageOptions, g as AgentWidgetApprovalDecisionOptions, ga as WebMcpConfirmInfo, go as PersonaThemePlugin, ha as WebMcpConfirmHandler, ho as PersonaTheme, it as AgentWidgetHeaderLayoutConfig, j as AgentWidgetContentSegment, ji as PersonaArtifactRecord, jo as AgentWidgetPlugin, jr as ComposerResubmitOptions, k as AgentWidgetConfig, ki as PersonaArtifactManualUpsert, la as VoicePriorToolResult, li as ImageContentPart, ln as AgentWidgetStreamParser, m as AgentWidgetApproval, ma as VoiceTranscriptMetadata, mi as InjectUserMessageOptions, n as AgentExecutionState, ni as HistoryDisplayProjection, oi as HistoryScope, pa as VoiceStatus, pi as InjectSystemMessageOptions, q as AgentWidgetControllerEventMap, qi as TextContentPart, ri as HistoryIdentityStatus, sa as VoiceMetrics, ta as VoiceConfig, ti as HistoryConversationSummary, u as AgentWidgetActionHandler, ua as VoiceProvider, ui as InjectAssistantMessageOptions, ut as AgentWidgetInitOptions, vi as MessageContent, vt as AgentWidgetMarkdownOptions, x as AgentWidgetAttachmentAdapter, ya as WidgetHistoryInternals, yt as AgentWidgetMarkdownRendererOverrides, zt as AgentWidgetRunFinishedEvent } from "./types-CiXi4ICM.cjs";
3
- import { n as MentionSubmitBundle } from "./context-mention-manager-IfT4JHma.cjs";
4
- import { i as MessageTransform } from "./message-bubble-Cg_sTXUN.cjs";
5
- import "./feature-preferences-eeSOmDxg.cjs";
6
- import { t as WebMcpBridge$1 } from "./webmcp-runtime-entry-BTbOg3Au.cjs";
7
- import "./fallback-speech-engine-CSxWpG0A.cjs";
8
- import "./defaults-Cc_p0PGM.cjs";
1
+ import { t as ComponentContext } from "./registry-DRk3VMFc.cjs";
2
+ import { $ as AgentWidgetEvent, $r as HistoryConversationPage, $t as AgentWidgetStateSnapshot, A as AgentWidgetConfigPatch, Ar as ComposerQuote, B as AgentWidgetContextMentionRef, Bn as AttachmentPreviewRenderContext, Bt as AgentWidgetRunStartedEvent, C as AgentWidgetAttachmentsConfig, Ct as AgentWidgetMessage, Dn as AgentWidgetWebMcpConfig, Dr as ComposerOptionsPayload, E as AgentWidgetComponentRenderHandle, Hi as SpeechCallbacks, I as AgentWidgetContextMentionItem, Ja as RuntypeExecutionStreamEvent, Ki as StreamAnimationPlugin, Kn as ClientFeedbackRequest, Li as ResumableHandle, Ln as AskUserQuestionPayload, Lr as ContentPart, Mr as ComposerState, N as AgentWidgetContextMentionCommandContext, Ni as PreparedClientSession, Oa as HistoryListResult, Ot as AgentWidgetOpenConversationOptions, Pi as ReadAloudState, Q as AgentWidgetDockConfig, Qr as HistoryConversationDetail, Rr as ConversationExecutionState, U as AgentWidgetContextMentionSource, Ui as SpeechEngine, Ur as DictationState, Vn as AttachmentPreviewRenderHandle, Wi as SpeechRequest, Yn as ClientSession, Zi as VoiceClientTools, Zn as ClientToolDefinition, _a as WebMcpToolResult, _t as AgentWidgetMarkdownConfig, ai as HistoryReturnSurface, ao as BrandConfig, cn as AgentWidgetStreamCheckpoint, da as VoiceResult, di as InjectComponentDirectiveOptions, dn as AgentWidgetSuggestion, do as DeepPartial, ei as HistoryConversationPatch, en as AgentWidgetStorageAdapter, f as AgentWidgetActionParser, fa as VoiceSessionBridge, fi as InjectMessageOptions, g as AgentWidgetApprovalDecisionOptions, ga as WebMcpConfirmInfo, go as PersonaThemePlugin, ha as WebMcpConfirmHandler, ho as PersonaTheme, it as AgentWidgetHeaderLayoutConfig, j as AgentWidgetContentSegment, ji as PersonaArtifactRecord, jo as AgentWidgetPlugin, jr as ComposerResubmitOptions, k as AgentWidgetConfig, ki as PersonaArtifactManualUpsert, la as VoicePriorToolResult, li as ImageContentPart, ln as AgentWidgetStreamParser, m as AgentWidgetApproval, ma as VoiceTranscriptMetadata, mi as InjectUserMessageOptions, n as AgentExecutionState, ni as HistoryDisplayProjection, oi as HistoryScope, pa as VoiceStatus, pi as InjectSystemMessageOptions, q as AgentWidgetControllerEventMap, qi as TextContentPart, ri as HistoryIdentityStatus, sa as VoiceMetrics, ta as VoiceConfig, ti as HistoryConversationSummary, u as AgentWidgetActionHandler, ua as VoiceProvider, ui as InjectAssistantMessageOptions, ut as AgentWidgetInitOptions, vi as MessageContent, vt as AgentWidgetMarkdownOptions, x as AgentWidgetAttachmentAdapter, ya as WidgetHistoryInternals, yt as AgentWidgetMarkdownRendererOverrides, zt as AgentWidgetRunFinishedEvent } from "./types-CSXHl5cN.cjs";
3
+ import { n as MentionSubmitBundle } from "./context-mention-manager-BfZzcydV.cjs";
4
+ import { i as MessageTransform } from "./message-bubble-D0rosKuK.cjs";
5
+ import "./feature-preferences-BT549D_E.cjs";
6
+ import { t as WebMcpBridge$1 } from "./webmcp-runtime-entry-DpDN6k-6.cjs";
7
+ import "./fallback-speech-engine-DZ6Of7VU.cjs";
8
+ import "./defaults-DiTeXyr3.cjs";
9
9
  import { IconNode as IconNode$1 } from "lucide";
10
10
  import "marked";
11
11
  //#region src/utils/legacy-diagnostics.d.ts
@@ -30,6 +30,7 @@ type ActionManagerOptions = {
30
30
  updateSessionMetadata: (updater: (prev: Record<string, unknown>) => Record<string, unknown>) => void;
31
31
  emit: <K extends keyof AgentWidgetControllerEventMap>(event: K, payload: AgentWidgetControllerEventMap[K]) => void;
32
32
  documentRef: Document | null;
33
+ captureResubmitGuard?: () => () => boolean;
33
34
  };
34
35
  declare const defaultJsonActionParser: AgentWidgetActionParser;
35
36
  declare const defaultActionHandlers: Record<string, AgentWidgetActionHandler>;
@@ -886,6 +887,14 @@ declare class AgentWidgetClient {
886
887
  declare const createLocalStorageAdapter: (key?: string) => AgentWidgetStorageAdapter;
887
888
  //#endregion
888
889
  //#region src/postprocessors.d.ts
890
+ /**
891
+ * Repair incomplete Markdown for a streaming display before parsing it as HTML.
892
+ * Apply custom text transforms first, then pass the result and the callback's
893
+ * `streaming` flag here. Completed text is returned unchanged. This never
894
+ * mutates message content or raw payloads and does not load the parser chunk;
895
+ * until that chunk is ready, only the lightweight table repairs are available.
896
+ */
897
+ declare const preprocessStreamingMarkdown: (text: string, streaming: boolean) => string;
889
898
  /**
890
899
  * Options for creating a markdown processor
891
900
  */
@@ -2546,5 +2555,5 @@ declare class AgentWidgetSession {
2546
2555
  private upsertMessage;
2547
2556
  }
2548
2557
  //#endregion
2549
- export { BrowserVoiceProvider as $, createLocalStorageAdapter as $t, extractComponentDirectiveFromMessage as A, createActionManager as An, createImagePart as At, getColorScheme as B, createPlainTextParser as Bt, PRESETS as C, initAgentWidget as Cn, AttachmentManager as Ct, WidgetPreset as D, NPSFeedbackOptions as Dn, createSlashCommandsSource as Dt, PRESET_SHOP as E, CSATFeedbackOptions as En, SlashCommandDefinition as Et, isComponentDirectiveType as F, hasImages as Ft, ReadAloudController as G, resolveSanitizer as Gt, RovingTablistOptions as H, createXmlParser as Ht, applyThemeVariables as I, normalizeContent as It, BrowserSpeechEngineOptions as J, createMarkdownProcessor as Jt, ReadAloudListener as K, MarkdownProcessorOptions as Kt, createThemeObserver as L, validateImageFile as Lt, renderComponentDirective as M, defaultJsonActionParser as Mn, fileToImagePart as Mt, ComponentDirective as N, getDisplayText as Nt, getPreset as O, createCSATFeedback as On, createStaticMentionSource as Ot, createComponentStreamParser as P, getImageParts as Pt, isVoiceSupported as Q, markdownPostprocessor as Qt, detectColorScheme as R, createFlexibleJsonStreamParser as Rt, buildHeader as S, getAgentWidgetHandles as Sn, generateUserMessageId as St, PRESET_MINIMAL as T, createAgentExperience as Tn, PendingAttachment as Tt, createRovingTablist as U, SanitizeFunction as Ut, RovingTablistController as V, createRegexJsonParser as Vt, WebMcpBridge as W, createDefaultSanitizer as Wt, createBestAvailableVoiceProvider as X, directivePostprocessor as Xt, pickBestVoice as Y, createMarkdownProcessorFromConfig as Yt, createVoiceProvider as Z, escapeHtml as Zt, ComposerElements as _, ensureAskUserQuestionSheet as _n, VERSION as _t, SessionRunActivity as a, createWidgetHostLayout as an, accessibilityPlugin as at, HeaderElements as b, removeAskUserQuestionSheet as bn, generateAssistantMessageId as bt, HeaderLayoutContext as c, SUGGEST_REPLIES_TOOL_NAME as cn, createPlugin as ct, buildHeaderWithLayout as d, parseSuggestRepliesPayload as dn, InstallLoadingContext as dt, AgentWidgetClient as en, RuntypeVoiceProvider as et, buildMinimalHeader as f, ASK_USER_QUESTION_CLIENT_TOOL as fn, InstallLoadingRenderer as ft, ComposerBuildContext as g, createAskUserQuestionBubble as gn, pluginRegistry as gt, PanelElements as h, ASK_USER_QUESTION_TOOL_NAME as hn, unregisterStreamAnimationPlugin as ht, SessionHistoryState as i, WidgetHostLayoutMode as in, createDemoCarousel as it, hasComponentDirective as j, defaultActionHandlers as jn, createTextPart as jt, createComponentMiddleware as k, createNPSFeedback as kn, defaultMentionFilter as kt, HeaderLayoutRenderer as l, isSuggestRepliesMessage as ln, highContrastPlugin as lt, headerLayouts as m, builtInClientToolsForDispatch as mn, registerStreamAnimationPlugin as mt, AgentWidgetSessionStatus as n, SSEEventCallback as nn, DemoCarouselItem as nt, IconNode$1 as o, SUGGEST_REPLIES_CLIENT_TOOL as on, animationsPlugin as ot, getHeaderLayout as p, ASK_USER_QUESTION_PARAMETERS_SCHEMA as pn, listRegisteredStreamAnimations as pt, BrowserSpeechEngine as q, createDirectivePostprocessor as qt, SessionHistoryError as r, WidgetHostLayout as rn, DemoCarouselOptions as rt, RuntypeFlowSSEEvent as s, SUGGEST_REPLIES_PARAMETERS_SCHEMA as sn, brandPlugin as st, AgentWidgetSession as t, HistoryClientError as tn, DemoCarouselHandle as tt, buildDefaultHeader as u, latestAgentSuggestions as un, reducedMotionPlugin as ut, buildComposer as v, isAskUserQuestionMessage as vn, isDockedMountMode as vt, PRESET_FULLSCREEN as w, AgentWidgetController as wn, AttachmentManagerConfig as wt, attachHeaderToContainer as x, AgentWidgetInitHandle as xn, generateMessageId as xt, HeaderBuildContext as y, parseAskUserQuestionPayload as yn, resolveDockConfig as yt, getActiveTheme as z, createJsonStreamParser as zt };
2558
+ export { BrowserVoiceProvider as $, preprocessStreamingMarkdown as $t, extractComponentDirectiveFromMessage as A, createNPSFeedback as An, createImagePart as At, getColorScheme as B, createPlainTextParser as Bt, PRESETS as C, getAgentWidgetHandles as Cn, AttachmentManager as Ct, WidgetPreset as D, CSATFeedbackOptions as Dn, createSlashCommandsSource as Dt, PRESET_SHOP as E, createAgentExperience as En, SlashCommandDefinition as Et, isComponentDirectiveType as F, hasImages as Ft, ReadAloudController as G, resolveSanitizer as Gt, RovingTablistOptions as H, createXmlParser as Ht, applyThemeVariables as I, normalizeContent as It, BrowserSpeechEngineOptions as J, createMarkdownProcessor as Jt, ReadAloudListener as K, MarkdownProcessorOptions as Kt, createThemeObserver as L, validateImageFile as Lt, renderComponentDirective as M, defaultActionHandlers as Mn, fileToImagePart as Mt, ComponentDirective as N, defaultJsonActionParser as Nn, getDisplayText as Nt, getPreset as O, NPSFeedbackOptions as On, createStaticMentionSource as Ot, createComponentStreamParser as P, getImageParts as Pt, isVoiceSupported as Q, markdownPostprocessor as Qt, detectColorScheme as R, createFlexibleJsonStreamParser as Rt, buildHeader as S, AgentWidgetInitHandle as Sn, generateUserMessageId as St, PRESET_MINIMAL as T, AgentWidgetController as Tn, PendingAttachment as Tt, createRovingTablist as U, SanitizeFunction as Ut, RovingTablistController as V, createRegexJsonParser as Vt, WebMcpBridge as W, createDefaultSanitizer as Wt, createBestAvailableVoiceProvider as X, directivePostprocessor as Xt, pickBestVoice as Y, createMarkdownProcessorFromConfig as Yt, createVoiceProvider as Z, escapeHtml as Zt, ComposerElements as _, createAskUserQuestionBubble as _n, VERSION as _t, SessionRunActivity as a, WidgetHostLayoutMode as an, accessibilityPlugin as at, HeaderElements as b, parseAskUserQuestionPayload as bn, generateAssistantMessageId as bt, HeaderLayoutContext as c, SUGGEST_REPLIES_PARAMETERS_SCHEMA as cn, createPlugin as ct, buildHeaderWithLayout as d, latestAgentSuggestions as dn, InstallLoadingContext as dt, createLocalStorageAdapter as en, RuntypeVoiceProvider as et, buildMinimalHeader as f, parseSuggestRepliesPayload as fn, InstallLoadingRenderer as ft, ComposerBuildContext as g, ASK_USER_QUESTION_TOOL_NAME as gn, pluginRegistry as gt, PanelElements as h, builtInClientToolsForDispatch as hn, unregisterStreamAnimationPlugin as ht, SessionHistoryState as i, WidgetHostLayout as in, createDemoCarousel as it, hasComponentDirective as j, createActionManager as jn, createTextPart as jt, createComponentMiddleware as k, createCSATFeedback as kn, defaultMentionFilter as kt, HeaderLayoutRenderer as l, SUGGEST_REPLIES_TOOL_NAME as ln, highContrastPlugin as lt, headerLayouts as m, ASK_USER_QUESTION_PARAMETERS_SCHEMA as mn, registerStreamAnimationPlugin as mt, AgentWidgetSessionStatus as n, HistoryClientError as nn, DemoCarouselItem as nt, IconNode$1 as o, createWidgetHostLayout as on, animationsPlugin as ot, getHeaderLayout as p, ASK_USER_QUESTION_CLIENT_TOOL as pn, listRegisteredStreamAnimations as pt, BrowserSpeechEngine as q, createDirectivePostprocessor as qt, SessionHistoryError as r, SSEEventCallback as rn, DemoCarouselOptions as rt, RuntypeFlowSSEEvent as s, SUGGEST_REPLIES_CLIENT_TOOL as sn, brandPlugin as st, AgentWidgetSession as t, AgentWidgetClient as tn, DemoCarouselHandle as tt, buildDefaultHeader as u, isSuggestRepliesMessage as un, reducedMotionPlugin as ut, buildComposer as v, ensureAskUserQuestionSheet as vn, isDockedMountMode as vt, PRESET_FULLSCREEN as w, initAgentWidget as wn, AttachmentManagerConfig as wt, attachHeaderToContainer as x, removeAskUserQuestionSheet as xn, generateMessageId as xt, HeaderBuildContext as y, isAskUserQuestionMessage as yn, resolveDockConfig as yt, getActiveTheme as z, createJsonStreamParser as zt };
2550
2559
  export {}