@telia-ace/widget-conversation-flamingo 1.1.116-rc.1 → 1.1.116-rc.3

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 (3) hide show
  1. package/index.js +3 -3
  2. package/index.mjs +17 -23
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -760,7 +760,7 @@
760
760
  object-fit: contain;
761
761
  }
762
762
  `];let ut=In;nl([w({attribute:!1})],ut.prototype,"message");function mn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let le=mn();function Pr(n){le=n}const Te={exec:()=>null};function y(n,e=""){let t=typeof n=="string"?n:n.source;const s={replace:(r,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(A.caret,"$1"),t=t.replace(r,o),s},getRegex:()=>new RegExp(t,e)};return s}const A={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},sl=/^(?:[ \t]*(?:\n|$))+/,rl=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,il=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Ge=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ol=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,vn=/(?:[*+-]|\d{1,9}[.)])/,Or=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Ir=y(Or).replace(/bull/g,vn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),al=y(Or).replace(/bull/g,vn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),bn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,ll=/^[^\n]+/,yn=/(?!\s*\])(?:\\.|[^\[\]\\])+/,cl=y(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",yn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),hl=y(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,vn).getRegex(),St="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",$n=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ul=y("^ {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",$n).replace("tag",St).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Mr=y(bn).replace("hr",Ge).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",St).getRegex(),dl=y(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Mr).getRegex(),xn={blockquote:dl,code:rl,def:cl,fences:il,heading:ol,hr:Ge,html:ul,lheading:Ir,list:hl,newline:sl,paragraph:Mr,table:Te,text:ll},Cs=y("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ge).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\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",St).getRegex(),pl={...xn,lheading:al,table:Cs,paragraph:y(bn).replace("hr",Ge).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Cs).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",St).getRegex()},fl={...xn,html:y(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",$n).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:Te,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:y(bn).replace("hr",Ge).replace("heading",` *#{1,6} *[^
763
- ]`).replace("lheading",Ir).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ml=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,zr=/^( {2,}|\\)\n(?!\s*$)/,vl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_t=/[\p{P}\p{S}]/u,wn=/[\s\p{P}\p{S}]/u,Ur=/[^\s\p{P}\p{S}]/u,bl=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wn).getRegex(),Br=/(?!~)[\p{P}\p{S}]/u,yl=/(?!~)[\s\p{P}\p{S}]/u,$l=/(?:[^\s\p{P}\p{S}]|~)/u,xl=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,jr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,wl=y(jr,"u").replace(/punct/g,_t).getRegex(),kl=y(jr,"u").replace(/punct/g,Br).getRegex(),Nr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Sl=y(Nr,"gu").replace(/notPunctSpace/g,Ur).replace(/punctSpace/g,wn).replace(/punct/g,_t).getRegex(),_l=y(Nr,"gu").replace(/notPunctSpace/g,$l).replace(/punctSpace/g,yl).replace(/punct/g,Br).getRegex(),Cl=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ur).replace(/punctSpace/g,wn).replace(/punct/g,_t).getRegex(),Al=y(/\\(punct)/,"gu").replace(/punct/g,_t).getRegex(),El=y(/^<(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(),Ll=y($n).replace("(?:-->|$)","-->").getRegex(),Tl=y("^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",Ll).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),dt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Rl=y(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",dt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Hr=y(/^!?\[(label)\]\[(ref)\]/).replace("label",dt).replace("ref",yn).getRegex(),Dr=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",yn).getRegex(),Pl=y("reflink|nolink(?!\\()","g").replace("reflink",Hr).replace("nolink",Dr).getRegex(),kn={_backpedal:Te,anyPunctuation:Al,autolink:El,blockSkip:xl,br:zr,code:ml,del:Te,emStrongLDelim:wl,emStrongRDelimAst:Sl,emStrongRDelimUnd:Cl,escape:gl,link:Rl,nolink:Dr,punctuation:bl,reflink:Hr,reflinkSearch:Pl,tag:Tl,text:vl,url:Te},Ol={...kn,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",dt).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",dt).getRegex()},Yt={...kn,emStrongRDelimAst:_l,emStrongLDelim:kl,url:y(/^((?: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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Il={...Yt,br:y(zr).replace("{2,}","*").getRegex(),text:y(Yt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Qe={normal:xn,gfm:pl,pedantic:fl},_e={normal:kn,gfm:Yt,breaks:Il,pedantic:Ol},Ml={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},As=n=>Ml[n];function B(n,e){if(e){if(A.escapeTest.test(n))return n.replace(A.escapeReplace,As)}else if(A.escapeTestNoEncode.test(n))return n.replace(A.escapeReplaceNoEncode,As);return n}function Es(n){try{n=encodeURI(n).replace(A.percentDecode,"%")}catch{return null}return n}function Ls(n,e){var i;const t=n.replace(A.findPipe,(o,a,l)=>{let c=!1,h=a;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),s=t.split(A.splitPipe);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(A.slashPipe,"|");return s}function Ce(n,e,t){const s=n.length;if(s===0)return"";let r=0;for(;r<s&&n.charAt(s-r-1)===e;)r++;return n.slice(0,s-r)}function zl(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return-1}function Ts(n,e,t,s,r){const i=e.href,o=e.title||null,a=n[1].replace(r.other.outputLinkReplace,"$1");if(n[0].charAt(0)!=="!"){s.state.inLink=!0;const l={type:"link",raw:t,href:i,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}return{type:"image",raw:t,href:i,title:o,text:a}}function Ul(n,e,t){const s=n.match(t.other.indentCodeCompensation);if(s===null)return e;const r=s[1];return e.split(`
763
+ ]`).replace("lheading",Ir).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},gl=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,ml=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,zr=/^( {2,}|\\)\n(?!\s*$)/,vl=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,_t=/[\p{P}\p{S}]/u,wn=/[\s\p{P}\p{S}]/u,Ur=/[^\s\p{P}\p{S}]/u,bl=y(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,wn).getRegex(),Br=/(?!~)[\p{P}\p{S}]/u,yl=/(?!~)[\s\p{P}\p{S}]/u,$l=/(?:[^\s\p{P}\p{S}]|~)/u,xl=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,jr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,wl=y(jr,"u").replace(/punct/g,_t).getRegex(),kl=y(jr,"u").replace(/punct/g,Br).getRegex(),Nr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Sl=y(Nr,"gu").replace(/notPunctSpace/g,Ur).replace(/punctSpace/g,wn).replace(/punct/g,_t).getRegex(),_l=y(Nr,"gu").replace(/notPunctSpace/g,$l).replace(/punctSpace/g,yl).replace(/punct/g,Br).getRegex(),Cl=y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ur).replace(/punctSpace/g,wn).replace(/punct/g,_t).getRegex(),Al=y(/\\(punct)/,"gu").replace(/punct/g,_t).getRegex(),El=y(/^<(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(),Ll=y($n).replace("(?:-->|$)","-->").getRegex(),Tl=y("^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",Ll).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),dt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Rl=y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",dt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Hr=y(/^!?\[(label)\]\[(ref)\]/).replace("label",dt).replace("ref",yn).getRegex(),Dr=y(/^!?\[(ref)\](?:\[\])?/).replace("ref",yn).getRegex(),Pl=y("reflink|nolink(?!\\()","g").replace("reflink",Hr).replace("nolink",Dr).getRegex(),kn={_backpedal:Te,anyPunctuation:Al,autolink:El,blockSkip:xl,br:zr,code:ml,del:Te,emStrongLDelim:wl,emStrongRDelimAst:Sl,emStrongRDelimUnd:Cl,escape:gl,link:Rl,nolink:Dr,punctuation:bl,reflink:Hr,reflinkSearch:Pl,tag:Tl,text:vl,url:Te},Ol={...kn,link:y(/^!?\[(label)\]\((.*?)\)/).replace("label",dt).getRegex(),reflink:y(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",dt).getRegex()},Yt={...kn,emStrongRDelimAst:_l,emStrongLDelim:kl,url:y(/^((?: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~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},Il={...Yt,br:y(zr).replace("{2,}","*").getRegex(),text:y(Yt.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Qe={normal:xn,gfm:pl,pedantic:fl},_e={normal:kn,gfm:Yt,breaks:Il,pedantic:Ol},Ml={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},As=n=>Ml[n];function B(n,e){if(e){if(A.escapeTest.test(n))return n.replace(A.escapeReplace,As)}else if(A.escapeTestNoEncode.test(n))return n.replace(A.escapeReplaceNoEncode,As);return n}function Es(n){try{n=encodeURI(n).replace(A.percentDecode,"%")}catch{return null}return n}function Ls(n,e){var i;const t=n.replace(A.findPipe,(o,a,l)=>{let c=!1,h=a;for(;--h>=0&&l[h]==="\\";)c=!c;return c?"|":" |"}),s=t.split(A.splitPipe);let r=0;if(s[0].trim()||s.shift(),s.length>0&&!((i=s.at(-1))!=null&&i.trim())&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;r<s.length;r++)s[r]=s[r].trim().replace(A.slashPipe,"|");return s}function Ce(n,e,t){const s=n.length;if(s===0)return"";let r=0;for(;r<s&&n.charAt(s-r-1)===e;)r++;return n.slice(0,s-r)}function zl(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])t++;else if(n[s]===e[1]&&(t--,t<0))return s;return t>0?-2:-1}function Ts(n,e,t,s,r){const i=e.href,o=e.title||null,a=n[1].replace(r.other.outputLinkReplace,"$1");s.state.inLink=!0;const l={type:n[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,l}function Ul(n,e,t){const s=n.match(t.other.indentCodeCompensation);if(s===null)return e;const r=s[1];return e.split(`
764
764
  `).map(i=>{const o=i.match(t.other.beginningSpace);if(o===null)return i;const[a]=o;return a.length>=r.length?i.slice(r.length):i}).join(`
765
765
  `)}class pt{constructor(e){$(this,"options");$(this,"rules");$(this,"lexer");this.options=e||le}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const s=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?s:Ce(s,`
766
766
  `)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const s=t[0],r=Ul(s,t[3]||"",this.rules);return{type:"code",raw:s,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let s=t[2].trim();if(this.rules.other.endingHash.test(s)){const r=Ce(s,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(s=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:s,tokens:this.lexer.inline(s)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Ce(t[0],`
@@ -784,7 +784,7 @@ ${u}`:u;const d=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
784
784
  `+p}!g&&!p.trim()&&(g=!0),h+=Ct+`
785
785
  `,e=e.substring(Ct.length+1),d=ke.slice(f)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(a=!0));let k=null,W;this.options.gfm&&(k=this.rules.other.listIsTask.exec(u),k&&(W=k[0]!=="[ ] ",u=u.replace(this.rules.other.listReplaceTask,""))),i.items.push({type:"list_item",raw:h,task:!!k,checked:W,loose:!1,text:u,tokens:[]}),i.raw+=h}const l=i.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let c=0;c<i.items.length;c++)if(this.lexer.state.top=!1,i.items[c].tokens=this.lexer.blockTokens(i.items[c].text,[]),!i.loose){const h=i.items[c].tokens.filter(d=>d.type==="space"),u=h.length>0&&h.some(d=>this.rules.other.anyLine.test(d.raw));i.loose=u}if(i.loose)for(let c=0;c<i.items.length;c++)i.items[c].loose=!0;return i}}html(e){const 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){const t=this.rules.block.def.exec(e);if(t){const s=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:s,raw:t[0],href:r,title:i}}}table(e){var a;const t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;const s=Ls(t[1]),r=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(a=t[3])!=null&&a.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split(`
786
786
  `):[],o={type:"table",raw:t[0],header:[],align:[],rows:[]};if(s.length===r.length){for(const l of r)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<s.length;l++)o.header.push({text:s[l],tokens:this.lexer.inline(s[l]),header:!0,align:o.align[l]});for(const l of i)o.rows.push(Ls(l,o.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[h]})));return o}}lheading(e){const 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){const t=this.rules.block.paragraph.exec(e);if(t){const s=t[1].charAt(t[1].length-1)===`
787
- `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const 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){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.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){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const o=Ce(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{const o=zl(t[2],"()");if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),Ts(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){const o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return Ts(s,i,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const o=[...r[0]].length-1;let a,l,c=o,h=0;const u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+o);(r=u.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=[...a].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&o%3&&!((o+l)%3)){h+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+h);const d=[...r[0]][0].length,p=e.slice(0,o+r.index+d+l);if(Math.min(o,l)%2){const f=p.slice(1,-1);return{type:"em",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}const g=p.slice(2,-2);return{type:"strong",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(s),i=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&i&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const 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){const t=this.rules.inline.autolink.exec(e);if(t){let s,r;return t[2]==="@"?(s=t[1],r="mailto:"+s):(s=t[1],r=s),{type:"link",raw:t[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:s}}}}class O{constructor(e){$(this,"tokens");$(this,"options");$(this,"state");$(this,"tokenizer");$(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||le,this.options.tokenizer=this.options.tokenizer||new pt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:A,block:Qe.normal,inline:_e.normal};this.options.pedantic?(t.block=Qe.pedantic,t.inline=_e.pedantic):this.options.gfm&&(t.block=Qe.gfm,this.options.breaks?t.inline=_e.breaks:t.inline=_e.gfm),this.tokenizer.rules=t}static get rules(){return{block:Qe,inline:_e}}static lex(e,t){return new O(t).lex(e)}static lexInline(e,t){return new O(t).inlineTokens(e)}lex(e){e=e.replace(A.carriageReturn,`
787
+ `?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:s,tokens:this.lexer.inline(s)}}}text(e){const 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){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.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){const t=this.rules.inline.link.exec(e);if(t){const s=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(s)){if(!this.rules.other.endAngleBracket.test(s))return;const o=Ce(s.slice(0,-1),"\\");if((s.length-o.length)%2===0)return}else{const o=zl(t[2],"()");if(o===-2)return;if(o>-1){const l=(t[0].indexOf("!")===0?5:4)+t[1].length+o;t[2]=t[2].substring(0,o),t[0]=t[0].substring(0,l).trim(),t[3]=""}}let r=t[2],i="";if(this.options.pedantic){const o=this.rules.other.pedanticHrefTitle.exec(r);o&&(r=o[1],i=o[3])}else i=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(s)?r=r.slice(1):r=r.slice(1,-1)),Ts(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let s;if((s=this.rules.inline.reflink.exec(e))||(s=this.rules.inline.nolink.exec(e))){const r=(s[2]||s[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=t[r.toLowerCase()];if(!i){const o=s[0].charAt(0);return{type:"text",raw:o,text:o}}return Ts(s,i,s[0],this.lexer,this.rules)}}emStrong(e,t,s=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!r||r[3]&&s.match(this.rules.other.unicodeAlphaNumeric))return;if(!(r[1]||r[2]||"")||!s||this.rules.inline.punctuation.exec(s)){const o=[...r[0]].length-1;let a,l,c=o,h=0;const u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,t=t.slice(-1*e.length+o);(r=u.exec(t))!=null;){if(a=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!a)continue;if(l=[...a].length,r[3]||r[4]){c+=l;continue}else if((r[5]||r[6])&&o%3&&!((o+l)%3)){h+=l;continue}if(c-=l,c>0)continue;l=Math.min(l,l+c+h);const d=[...r[0]][0].length,p=e.slice(0,o+r.index+d+l);if(Math.min(o,l)%2){const f=p.slice(1,-1);return{type:"em",raw:p,text:f,tokens:this.lexer.inlineTokens(f)}}const g=p.slice(2,-2);return{type:"strong",raw:p,text:g,tokens:this.lexer.inlineTokens(g)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let s=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(s),i=this.rules.other.startingSpaceChar.test(s)&&this.rules.other.endingSpaceChar.test(s);return r&&i&&(s=s.substring(1,s.length-1)),{type:"codespan",raw:t[0],text:s}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const 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){const t=this.rules.inline.autolink.exec(e);if(t){let s,r;return t[2]==="@"?(s=t[1],r="mailto:"+s):(s=t[1],r=s),{type:"link",raw:t[0],text:s,href:r,tokens:[{type:"text",raw:s,text:s}]}}}url(e){var s;let t;if(t=this.rules.inline.url.exec(e)){let r,i;if(t[2]==="@")r=t[0],i="mailto:"+r;else{let o;do o=t[0],t[0]=((s=this.rules.inline._backpedal.exec(t[0]))==null?void 0:s[0])??"";while(o!==t[0]);r=t[0],t[1]==="www."?i="http://"+t[0]:i=t[0]}return{type:"link",raw:t[0],text:r,href:i,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const s=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:s}}}}class O{constructor(e){$(this,"tokens");$(this,"options");$(this,"state");$(this,"tokenizer");$(this,"inlineQueue");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||le,this.options.tokenizer=this.options.tokenizer||new pt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:A,block:Qe.normal,inline:_e.normal};this.options.pedantic?(t.block=Qe.pedantic,t.inline=_e.pedantic):this.options.gfm&&(t.block=Qe.gfm,this.options.breaks?t.inline=_e.breaks:t.inline=_e.gfm),this.tokenizer.rules=t}static get rules(){return{block:Qe,inline:_e}}static lex(e,t){return new O(t).lex(e)}static lexInline(e,t){return new O(t).inlineTokens(e)}lex(e){e=e.replace(A.carriageReturn,`
788
788
  `),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const s=this.inlineQueue[t];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],s=!1){var r,i,o;for(this.options.pedantic&&(e=e.replace(A.tabCharGlobal," ").replace(A.spaceLine,""));e;){let a;if((i=(r=this.options.extensions)==null?void 0:r.block)!=null&&i.some(c=>(a=c.call({lexer:this},e,t))?(e=e.substring(a.raw.length),t.push(a),!0):!1))continue;if(a=this.tokenizer.space(e)){e=e.substring(a.raw.length);const c=t.at(-1);a.raw.length===1&&c!==void 0?c.raw+=`
789
789
  `:t.push(a);continue}if(a=this.tokenizer.code(e)){e=e.substring(a.raw.length);const c=t.at(-1);(c==null?void 0:c.type)==="paragraph"||(c==null?void 0:c.type)==="text"?(c.raw+=`
790
790
  `+a.raw,c.text+=`
@@ -812,7 +812,7 @@ ${this.parser.parse(e)}</blockquote>
812
812
  `}tablerow({text:e}){return`<tr>
813
813
  ${e}</tr>
814
814
  `}tablecell(e){const t=this.parser.parseInline(e.tokens),s=e.header?"th":"td";return(e.align?`<${s} align="${e.align}">`:`<${s}>`)+t+`</${s}>
815
- `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${B(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:s}){const r=this.parser.parseInline(s),i=Es(e);if(i===null)return r;e=i;let o='<a href="'+e+'"';return t&&(o+=' title="'+B(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:s}){const r=Es(e);if(r===null)return B(s);e=r;let i=`<img src="${e}" alt="${s}"`;return t&&(i+=` title="${B(t)}"`),i+=">",i}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:B(e.text)}}class Sn{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class I{constructor(e){$(this,"options");$(this,"renderer");$(this,"textRenderer");this.options=e||le,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Sn}static parse(e,t){return new I(t).parse(e)}static parseInline(e,t){return new I(t).parseInline(e)}parse(e,t=!0){var r,i;let s="";for(let o=0;o<e.length;o++){const a=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){const c=a,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){s+=h||"";continue}}const l=a;switch(l.type){case"space":{s+=this.renderer.space(l);continue}case"hr":{s+=this.renderer.hr(l);continue}case"heading":{s+=this.renderer.heading(l);continue}case"code":{s+=this.renderer.code(l);continue}case"table":{s+=this.renderer.table(l);continue}case"blockquote":{s+=this.renderer.blockquote(l);continue}case"list":{s+=this.renderer.list(l);continue}case"html":{s+=this.renderer.html(l);continue}case"paragraph":{s+=this.renderer.paragraph(l);continue}case"text":{let c=l,h=this.renderer.text(c);for(;o+1<e.length&&e[o+1].type==="text";)c=e[++o],h+=`
815
+ `}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${B(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:s}){const r=this.parser.parseInline(s),i=Es(e);if(i===null)return r;e=i;let o='<a href="'+e+'"';return t&&(o+=' title="'+B(t)+'"'),o+=">"+r+"</a>",o}image({href:e,title:t,text:s,tokens:r}){r&&(s=this.parser.parseInline(r,this.parser.textRenderer));const i=Es(e);if(i===null)return B(s);e=i;let o=`<img src="${e}" alt="${s}"`;return t&&(o+=` title="${B(t)}"`),o+=">",o}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:B(e.text)}}class Sn{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class I{constructor(e){$(this,"options");$(this,"renderer");$(this,"textRenderer");this.options=e||le,this.options.renderer=this.options.renderer||new Be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Sn}static parse(e,t){return new I(t).parse(e)}static parseInline(e,t){return new I(t).parseInline(e)}parse(e,t=!0){var r,i;let s="";for(let o=0;o<e.length;o++){const a=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){const c=a,h=this.options.extensions.renderers[c.type].call({parser:this},c);if(h!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){s+=h||"";continue}}const l=a;switch(l.type){case"space":{s+=this.renderer.space(l);continue}case"hr":{s+=this.renderer.hr(l);continue}case"heading":{s+=this.renderer.heading(l);continue}case"code":{s+=this.renderer.code(l);continue}case"table":{s+=this.renderer.table(l);continue}case"blockquote":{s+=this.renderer.blockquote(l);continue}case"list":{s+=this.renderer.list(l);continue}case"html":{s+=this.renderer.html(l);continue}case"paragraph":{s+=this.renderer.paragraph(l);continue}case"text":{let c=l,h=this.renderer.text(c);for(;o+1<e.length&&e[o+1].type==="text";)c=e[++o],h+=`
816
816
  `+this.renderer.text(c);t?s+=this.renderer.paragraph({type:"paragraph",raw:h,text:h,tokens:[{type:"text",raw:h,text:h,escaped:!0}]}):s+=h;continue}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}parseInline(e,t=this.renderer){var r,i;let s="";for(let o=0;o<e.length;o++){const a=e[o];if((i=(r=this.options.extensions)==null?void 0:r.renderers)!=null&&i[a.type]){const c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(a.type)){s+=c||"";continue}}const l=a;switch(l.type){case"escape":{s+=t.text(l);break}case"html":{s+=t.html(l);break}case"link":{s+=t.link(l);break}case"image":{s+=t.image(l);break}case"strong":{s+=t.strong(l);break}case"em":{s+=t.em(l);break}case"codespan":{s+=t.codespan(l);break}case"br":{s+=t.br(l);break}case"del":{s+=t.del(l);break}case"text":{s+=t.text(l);break}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return s}}class Re{constructor(e){$(this,"options");$(this,"block");this.options=e||le}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?O.lex:O.lexInline}provideParser(){return this.block?I.parse:I.parseInline}}$(Re,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class Bl{constructor(...e){$(this,"defaults",mn());$(this,"options",this.setOptions);$(this,"parse",this.parseMarkdown(!0));$(this,"parseInline",this.parseMarkdown(!1));$(this,"Parser",I);$(this,"Renderer",Be);$(this,"TextRenderer",Sn);$(this,"Lexer",O);$(this,"Tokenizer",pt);$(this,"Hooks",Re);this.use(...e)}walkTokens(e,t){var r,i;let s=[];for(const o of e)switch(s=s.concat(t.call(this,o)),o.type){case"table":{const a=o;for(const l of a.header)s=s.concat(this.walkTokens(l.tokens,t));for(const l of a.rows)for(const c of l)s=s.concat(this.walkTokens(c.tokens,t));break}case"list":{const a=o;s=s.concat(this.walkTokens(a.items,t));break}default:{const a=o;(i=(r=this.defaults.extensions)==null?void 0:r.childTokens)!=null&&i[a.type]?this.defaults.extensions.childTokens[a.type].forEach(l=>{const c=a[l].flat(1/0);s=s.concat(this.walkTokens(c,t))}):a.tokens&&(s=s.concat(this.walkTokens(a.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(s=>{const r={...s};if(r.async=this.defaults.async||r.async||!1,s.extensions&&(s.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){const o=t.renderers[i.name];o?t.renderers[i.name]=function(...a){let l=i.renderer.apply(this,a);return l===!1&&(l=o.apply(this,a)),l}:t.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const o=t[i.level];o?o.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens)}),r.extensions=t),s.renderer){const i=this.defaults.renderer||new Be(this.defaults);for(const o in s.renderer){if(!(o in i))throw new Error(`renderer '${o}' does not exist`);if(["options","parser"].includes(o))continue;const a=o,l=s.renderer[a],c=i[a];i[a]=(...h)=>{let u=l.apply(i,h);return u===!1&&(u=c.apply(i,h)),u||""}}r.renderer=i}if(s.tokenizer){const i=this.defaults.tokenizer||new pt(this.defaults);for(const o in s.tokenizer){if(!(o in i))throw new Error(`tokenizer '${o}' does not exist`);if(["options","rules","lexer"].includes(o))continue;const a=o,l=s.tokenizer[a],c=i[a];i[a]=(...h)=>{let u=l.apply(i,h);return u===!1&&(u=c.apply(i,h)),u}}r.tokenizer=i}if(s.hooks){const i=this.defaults.hooks||new Re;for(const o in s.hooks){if(!(o in i))throw new Error(`hook '${o}' does not exist`);if(["options","block"].includes(o))continue;const a=o,l=s.hooks[a],c=i[a];Re.passThroughHooks.has(o)?i[a]=h=>{if(this.defaults.async)return Promise.resolve(l.call(i,h)).then(d=>c.call(i,d));const u=l.call(i,h);return c.call(i,u)}:i[a]=(...h)=>{let u=l.apply(i,h);return u===!1&&(u=c.apply(i,h)),u}}r.hooks=i}if(s.walkTokens){const i=this.defaults.walkTokens,o=s.walkTokens;r.walkTokens=function(a){let l=[];return l.push(o.call(this,a)),i&&(l=l.concat(i.call(this,a))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return O.lex(e,t??this.defaults)}parser(e,t){return I.parse(e,t??this.defaults)}parseMarkdown(e){return(s,r)=>{const i={...r},o={...this.defaults,...i},a=this.onError(!!o.silent,!!o.async);if(this.defaults.async===!0&&i.async===!1)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof s>"u"||s===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof s!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(s)+", string expected"));o.hooks&&(o.hooks.options=o,o.hooks.block=e);const l=o.hooks?o.hooks.provideLexer():e?O.lex:O.lexInline,c=o.hooks?o.hooks.provideParser():e?I.parse:I.parseInline;if(o.async)return Promise.resolve(o.hooks?o.hooks.preprocess(s):s).then(h=>l(h,o)).then(h=>o.hooks?o.hooks.processAllTokens(h):h).then(h=>o.walkTokens?Promise.all(this.walkTokens(h,o.walkTokens)).then(()=>h):h).then(h=>c(h,o)).then(h=>o.hooks?o.hooks.postprocess(h):h).catch(a);try{o.hooks&&(s=o.hooks.preprocess(s));let h=l(s,o);o.hooks&&(h=o.hooks.processAllTokens(h)),o.walkTokens&&this.walkTokens(h,o.walkTokens);let u=c(h,o);return o.hooks&&(u=o.hooks.postprocess(u)),u}catch(h){return a(h)}}}onError(e,t){return s=>{if(s.message+=`
817
817
  Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+B(s.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(s);throw s}}}const ae=new Bl;function b(n,e){return ae.parse(n,e)}b.options=b.setOptions=function(n){return ae.setOptions(n),b.defaults=ae.defaults,Pr(b.defaults),b};b.getDefaults=mn;b.defaults=le;b.use=function(...n){return ae.use(...n),b.defaults=ae.defaults,Pr(b.defaults),b};b.walkTokens=function(n,e){return ae.walkTokens(n,e)};b.parseInline=ae.parseInline;b.Parser=I;b.parser=I.parse;b.Renderer=Be;b.TextRenderer=Sn;b.Lexer=O;b.lexer=O.lex;b.Tokenizer=pt;b.Hooks=Re;b.parse=b;b.options;b.setOptions;b.use;b.walkTokens;b.parseInline;I.parse;O.lex;var jl=Object.defineProperty,Fr=(n,e,t,s)=>{for(var r=void 0,i=n.length-1,o;i>=0;i--)(o=n[i])&&(r=o(e,t,r)||r);return r&&jl(e,t,r),r};const qr=new Be;qr.link=function({href:n,title:e,text:t}){return e||(e=t),`<a target="_blank" href="${n}" title="${e}">${t}</a>`};b.use({renderer:qr});const Mn=class Mn extends S{constructor(){super(...arguments),this.showLightbox=!1,this.imageUrl="",this.altText="",this.scrollRef=j(),this.contentRef=j(),this.autoScroll=!0,this.buffer="",this.pointer=0,this.imageRegexp=new RegExp(/!\[[^[]*\([^)]*\)/gm),this.includesImage=e=>this.imageRegexp.test(e)}handleAutoscroll(){this.addEventListener("wheel",()=>{this.autoScroll=!1},{passive:!0}),this.addEventListener("click",()=>{this.autoScroll=!1})}handleLightboxClose(){this.addEventListener("action",e=>{e.detail.key==="close-lightbox"&&(this.showLightbox=!1)})}handleLightboxOpen(){this.contentRef.value.addEventListener("click",e=>{e.target.tagName==="IMG"&&(this.showLightbox=!0,this.imageUrl=e.target.src,this.altText=e.target.alt)})}getLastChunk(){const e=this.message.content.length-this.pointer;return e===0?"":(this.pointer=this.message.content.length,this.message.content.slice(-e))}async firstUpdated(){this.handleAutoscroll(),this.handleLightboxOpen(),this.handleLightboxClose()}updated(){var r,i;const e=this.getLastChunk();if(!e)return;this.buffer+=e;const t=b.parse(this.buffer),s=(r=this.contentRef.value)==null?void 0:r.querySelector("div:last-of-type");if(this.includesImage(this.buffer))(i=this.contentRef.value)==null||i.appendChild(document.createElement("div")),this.buffer="";else if(this.buffer.includes("!["))return;s.innerHTML=Js(t),this.applyCodeStyles(s),this.autoScroll&&this.scrollRef.value.scrollIntoView()}applyCodeStyles(e){if(!e)return;e.querySelectorAll("code").forEach(s=>{s.style.whiteSpace="pre-wrap"})}render(){return v`
818
818
  <div class="message-type-markdown" ${N(this.contentRef)}>
package/index.mjs CHANGED
@@ -4737,7 +4737,7 @@ const A = {
4737
4737
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
4738
4738
  paragraph: y(vn).replace("hr", Ze).replace("heading", ` *#{1,6} *[^
4739
4739
  ]`).replace("lheading", Rr).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
4740
- }, dl = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, pl = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Or = /^( {2,}|\\)\n(?!\s*$)/, fl = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, _t = /[\p{P}\p{S}]/u, xn = /[\s\p{P}\p{S}]/u, Ir = /[^\s\p{P}\p{S}]/u, gl = y(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, xn).getRegex(), Mr = /(?!~)[\p{P}\p{S}]/u, ml = /(?!~)[\s\p{P}\p{S}]/u, vl = /(?:[^\s\p{P}\p{S}]|~)/u, bl = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, zr = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, yl = y(zr, "u").replace(/punct/g, _t).getRegex(), $l = y(zr, "u").replace(/punct/g, Mr).getRegex(), Ur = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", xl = y(Ur, "gu").replace(/notPunctSpace/g, Ir).replace(/punctSpace/g, xn).replace(/punct/g, _t).getRegex(), wl = y(Ur, "gu").replace(/notPunctSpace/g, vl).replace(/punctSpace/g, ml).replace(/punct/g, Mr).getRegex(), kl = y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Ir).replace(/punctSpace/g, xn).replace(/punct/g, _t).getRegex(), Sl = y(/\\(punct)/, "gu").replace(/punct/g, _t).getRegex(), _l = y(/^<(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(), Cl = y(yn).replace("(?:-->|$)", "-->").getRegex(), Al = y("^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", Cl).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), ut = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, El = y(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", ut).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Br = y(/^!?\[(label)\]\[(ref)\]/).replace("label", ut).replace("ref", bn).getRegex(), jr = y(/^!?\[(ref)\](?:\[\])?/).replace("ref", bn).getRegex(), Ll = y("reflink|nolink(?!\\()", "g").replace("reflink", Br).replace("nolink", jr).getRegex(), wn = {
4740
+ }, dl = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, pl = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, Or = /^( {2,}|\\)\n(?!\s*$)/, fl = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, _t = /[\p{P}\p{S}]/u, xn = /[\s\p{P}\p{S}]/u, Ir = /[^\s\p{P}\p{S}]/u, gl = y(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, xn).getRegex(), Mr = /(?!~)[\p{P}\p{S}]/u, ml = /(?!~)[\s\p{P}\p{S}]/u, vl = /(?:[^\s\p{P}\p{S}]|~)/u, bl = /\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g, zr = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, yl = y(zr, "u").replace(/punct/g, _t).getRegex(), $l = y(zr, "u").replace(/punct/g, Mr).getRegex(), Ur = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", xl = y(Ur, "gu").replace(/notPunctSpace/g, Ir).replace(/punctSpace/g, xn).replace(/punct/g, _t).getRegex(), wl = y(Ur, "gu").replace(/notPunctSpace/g, vl).replace(/punctSpace/g, ml).replace(/punct/g, Mr).getRegex(), kl = y("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, Ir).replace(/punctSpace/g, xn).replace(/punct/g, _t).getRegex(), Sl = y(/\\(punct)/, "gu").replace(/punct/g, _t).getRegex(), _l = y(/^<(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(), Cl = y(yn).replace("(?:-->|$)", "-->").getRegex(), Al = y("^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", Cl).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), ut = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, El = y(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", ut).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), Br = y(/^!?\[(label)\]\[(ref)\]/).replace("label", ut).replace("ref", bn).getRegex(), jr = y(/^!?\[(ref)\](?:\[\])?/).replace("ref", bn).getRegex(), Ll = y("reflink|nolink(?!\\()", "g").replace("reflink", Br).replace("nolink", jr).getRegex(), wn = {
4741
4741
  _backpedal: Te,
4742
4742
  // only used for GFM url
4743
4743
  anyPunctuation: Sl,
@@ -4845,29 +4845,20 @@ function Ol(n, e) {
4845
4845
  t++;
4846
4846
  else if (n[s] === e[1] && (t--, t < 0))
4847
4847
  return s;
4848
- return -1;
4848
+ return t > 0 ? -2 : -1;
4849
4849
  }
4850
4850
  function Ls(n, e, t, s, r) {
4851
4851
  const i = e.href, o = e.title || null, a = n[1].replace(r.other.outputLinkReplace, "$1");
4852
- if (n[0].charAt(0) !== "!") {
4853
- s.state.inLink = !0;
4854
- const l = {
4855
- type: "link",
4856
- raw: t,
4857
- href: i,
4858
- title: o,
4859
- text: a,
4860
- tokens: s.inlineTokens(a)
4861
- };
4862
- return s.state.inLink = !1, l;
4863
- }
4864
- return {
4865
- type: "image",
4852
+ s.state.inLink = !0;
4853
+ const l = {
4854
+ type: n[0].charAt(0) === "!" ? "image" : "link",
4866
4855
  raw: t,
4867
4856
  href: i,
4868
4857
  title: o,
4869
- text: a
4858
+ text: a,
4859
+ tokens: s.inlineTokens(a)
4870
4860
  };
4861
+ return s.state.inLink = !1, l;
4871
4862
  }
4872
4863
  function Il(n, e, t) {
4873
4864
  const s = n.match(t.other.indentCodeCompensation);
@@ -5204,6 +5195,8 @@ ${u}` : u;
5204
5195
  return;
5205
5196
  } else {
5206
5197
  const o = Ol(t[2], "()");
5198
+ if (o === -2)
5199
+ return;
5207
5200
  if (o > -1) {
5208
5201
  const l = (t[0].indexOf("!") === 0 ? 5 : 4) + t[1].length + o;
5209
5202
  t[2] = t[2].substring(0, o), t[0] = t[0].substring(0, l).trim(), t[3] = "";
@@ -5736,13 +5729,14 @@ ${e}</tr>
5736
5729
  let o = '<a href="' + e + '"';
5737
5730
  return t && (o += ' title="' + B(t) + '"'), o += ">" + r + "</a>", o;
5738
5731
  }
5739
- image({ href: e, title: t, text: s }) {
5740
- const r = As(e);
5741
- if (r === null)
5732
+ image({ href: e, title: t, text: s, tokens: r }) {
5733
+ r && (s = this.parser.parseInline(r, this.parser.textRenderer));
5734
+ const i = As(e);
5735
+ if (i === null)
5742
5736
  return B(s);
5743
- e = r;
5744
- let i = `<img src="${e}" alt="${s}"`;
5745
- return t && (i += ` title="${B(t)}"`), i += ">", i;
5737
+ e = i;
5738
+ let o = `<img src="${e}" alt="${s}"`;
5739
+ return t && (o += ` title="${B(t)}"`), o += ">", o;
5746
5740
  }
5747
5741
  text(e) {
5748
5742
  return "tokens" in e && e.tokens ? this.parser.parseInline(e.tokens) : "escaped" in e && e.escaped ? e.text : B(e.text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@telia-ace/widget-conversation-flamingo",
3
- "version": "1.1.116-rc.1",
3
+ "version": "1.1.116-rc.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org"
6
6
  },
@@ -9,7 +9,7 @@
9
9
  "@lit-labs/motion": "^1.0.8",
10
10
  "@teliads/icons": "^8.4.0",
11
11
  "@teliads/components": "^22.1.1",
12
- "@telia-ace/widget-core-flamingo": "1.1.116-rc.1",
12
+ "@telia-ace/widget-core-flamingo": "1.1.116-rc.3",
13
13
  "lit-html": "^3.0.2",
14
14
  "rxjs": "^7.8.2",
15
15
  "marked": "^15.0.2"