@descope/web-components-ui 1.0.304 → 1.0.306
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +43 -98
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +43 -98
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1612.js +1 -1
- package/dist/umd/1621.js +2 -2
- package/dist/umd/3951.js +1 -1
- package/dist/umd/4024.js +1 -1
- package/dist/umd/4052.js +1 -1
- package/dist/umd/4569.js +1 -0
- package/dist/umd/4746.js +1 -1
- package/dist/umd/5806.js +1 -1
- package/dist/umd/6770.js +1 -1
- package/dist/umd/7056.js +1 -1
- package/dist/umd/7531.js +1 -1
- package/dist/umd/7911.js +1 -1
- package/dist/umd/9092.js +2 -2
- package/dist/umd/9314.js +1 -1
- package/dist/umd/9423.js +2 -2
- package/dist/umd/9562.js +1 -1
- package/dist/umd/DescopeDev.js +1 -1
- package/dist/umd/descope-button-index-js.js +1 -1
- package/dist/umd/descope-email-field-index-js.js +1 -1
- package/dist/umd/descope-enriched-text-index-js.js +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/mapping-fields-descope-mappings-field-index-js.js +1 -1
- package/dist/umd/mapping-fields-descope-saml-group-mappings-index-js.js +1 -1
- package/package.json +3 -3
- package/src/components/descope-enriched-text/EnrichedTextClass.js +33 -27
- package/src/components/descope-enriched-text/consts.js +11 -72
- package/dist/umd/9927.js +0 -1
@@ -1,74 +1,13 @@
|
|
1
|
-
export const ruleSet = {
|
2
|
-
custom: ['image'],
|
3
|
-
core: [
|
4
|
-
'block',
|
5
|
-
'inline',
|
6
|
-
'abbr', // Parse abbreviation definitions, i.e. `*[abbr]: description`
|
7
|
-
'abbr2', // Enclose abbreviations in <abbr> tags
|
8
|
-
'references',
|
9
|
-
'footnote_tail',
|
10
|
-
'replacements', // Simple typographical replacements
|
11
|
-
'smartquotes', // Convert straight quotation marks to typographic ones
|
12
|
-
],
|
13
|
-
inline: [
|
14
|
-
'text',
|
15
|
-
'newline', // Proceess '\n'
|
16
|
-
'backticks', // Parse backticks
|
17
|
-
'del', // Process ~~deleted text~~
|
18
|
-
'emphasis', // Process *this* and _that_
|
19
|
-
'sub', // Process ~subscript~
|
20
|
-
'sup', // Process ^superscript^
|
21
|
-
'links', // Process [links](<to> "stuff")
|
22
|
-
'escape', // Proceess escaped chars and hardbreaks
|
23
|
-
'ins', // Process ++inserted text++
|
24
|
-
'mark', // Process ==highlighted text==
|
25
|
-
'footnote_inline', // Process inline footnotes (^[...])
|
26
|
-
'footnote_ref', // Process footnote references ([^...])
|
27
|
-
'autolink', // Process autolinks '<protocol:...>'
|
28
|
-
'htmltag', // Process html tags
|
29
|
-
'entity', // Process html entity - {, ¯, ", ...
|
30
|
-
],
|
31
|
-
block: [
|
32
|
-
'code', // Code block (4 spaces padded)
|
33
|
-
'fences', // fences (``` lang, ~~~ lang)
|
34
|
-
'blockquote', // Block quotes
|
35
|
-
'list',
|
36
|
-
'heading', // heading (#, ##, ...)
|
37
|
-
'paragraph',
|
38
|
-
'hr', // Horizontal rule
|
39
|
-
'footnote', // Process footnote reference list
|
40
|
-
'lheading', // lheading (---, ===)
|
41
|
-
'htmlblock', // HTML block
|
42
|
-
'table', // GFM table, non-standard
|
43
|
-
'deflist', // Definition lists
|
44
|
-
],
|
45
|
-
};
|
46
|
-
|
47
1
|
export const textRuleSet = {
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
'ins', // Process ++inserted text++
|
60
|
-
'footnote_inline', // Process inline footnotes (^[...])
|
61
|
-
'footnote_ref', // Process footnote references ([^...])
|
62
|
-
'autolink', // Process autolinks '<protocol:...>'
|
63
|
-
],
|
64
|
-
block: [
|
65
|
-
'code', // Code block (4 spaces padded)
|
66
|
-
'fences', // fences (``` lang, ~~~ lang)
|
67
|
-
'blockquote', // Block quotes
|
68
|
-
'list',
|
69
|
-
'heading', // heading (#, ##, ...)
|
70
|
-
'paragraph',
|
71
|
-
'footnote', // Process footnote reference list
|
72
|
-
'htmlblock', // HTML block
|
73
|
-
],
|
2
|
+
components: {
|
3
|
+
core: {
|
4
|
+
rules: ['block', 'inline'],
|
5
|
+
},
|
6
|
+
block: {
|
7
|
+
rules: ['blockquote', 'code', 'heading', 'list', 'paragraph', 'list'],
|
8
|
+
},
|
9
|
+
inline: {
|
10
|
+
rules: ['backticks', 'strikethrough', 'link', 'emphasis', 'strikethrough', 'newline', 'text'],
|
11
|
+
},
|
12
|
+
},
|
74
13
|
};
|
package/dist/umd/9927.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
"use strict";(self.webpackChunk_descope_web_components_ui=self.webpackChunk_descope_web_components_ui||[]).push([[9927],{9927:(e,t,n)=>{var r;function o(e){return(r=r||document.createElement("textarea")).innerHTML="&"+e+";",r.value}n.d(t,{_:()=>Se});var s=Object.prototype.hasOwnProperty;function i(e){return[].slice.call(arguments,1).forEach((function(t){if(t){if("object"!=typeof t)throw new TypeError(t+"must be object");Object.keys(t).forEach((function(n){e[n]=t[n]}))}})),e}var l=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;function a(e){return e.indexOf("\\")<0?e:e.replace(l,"$1")}function c(e){return!(e>=55296&&e<=57343||e>=64976&&e<=65007||65535==(65535&e)||65534==(65535&e)||e>=0&&e<=8||11===e||e>=14&&e<=31||e>=127&&e<=159||e>1114111)}function p(e){if(e>65535){var t=55296+((e-=65536)>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}var h=/&([a-z#][a-z0-9]{1,31});/gi,u=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i;function f(e,t){var n=0,r=o(t);return t!==r?r:35===t.charCodeAt(0)&&u.test(t)&&c(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10))?p(n):e}function d(e){return e.indexOf("&")<0?e:e.replace(h,f)}var k=/[&<>"]/,v=/[&<>"]/g,g={"&":"&","<":"<",">":">",'"':"""};function b(e){return g[e]}function _(e){return k.test(e)?e.replace(v,b):e}var m={};function y(e,t){return++t>=e.length-2?t:"paragraph_open"===e[t].type&&e[t].tight&&"inline"===e[t+1].type&&0===e[t+1].content.length&&"paragraph_close"===e[t+2].type&&e[t+2].tight?y(e,t+2):t}m.blockquote_open=function(){return"<blockquote>\n"},m.blockquote_close=function(e,t){return"</blockquote>"+C(e,t)},m.code=function(e,t){return e[t].block?"<pre><code>"+_(e[t].content)+"</code></pre>"+C(e,t):"<code>"+_(e[t].content)+"</code>"},m.fence=function(e,t,n,r,o){var i,l,c,p,h=e[t],u="",f=n.langPrefix;if(h.params){if(l=(i=h.params.split(/\s+/g)).join(" "),c=o.rules.fence_custom,p=i[0],c&&s.call(c,p))return o.rules.fence_custom[i[0]](e,t,n,r,o);u=' class="'+f+_(d(a(l)))+'"'}return"<pre><code"+u+">"+(n.highlight&&n.highlight.apply(n.highlight,[h.content].concat(i))||_(h.content))+"</code></pre>"+C(e,t)},m.fence_custom={},m.heading_open=function(e,t){return"<h"+e[t].hLevel+">"},m.heading_close=function(e,t){return"</h"+e[t].hLevel+">\n"},m.hr=function(e,t,n){return(n.xhtmlOut?"<hr />":"<hr>")+C(e,t)},m.bullet_list_open=function(){return"<ul>\n"},m.bullet_list_close=function(e,t){return"</ul>"+C(e,t)},m.list_item_open=function(){return"<li>"},m.list_item_close=function(){return"</li>\n"},m.ordered_list_open=function(e,t){var n=e[t];return"<ol"+(n.order>1?' start="'+n.order+'"':"")+">\n"},m.ordered_list_close=function(e,t){return"</ol>"+C(e,t)},m.paragraph_open=function(e,t){return e[t].tight?"":"<p>"},m.paragraph_close=function(e,t){var n=!(e[t].tight&&t&&"inline"===e[t-1].type&&!e[t-1].content);return(e[t].tight?"":"</p>")+(n?C(e,t):"")},m.link_open=function(e,t,n){var r=e[t].title?' title="'+_(d(e[t].title))+'"':"",o=n.linkTarget?' target="'+n.linkTarget+'"':"";return'<a href="'+_(e[t].href)+'"'+r+o+">"},m.link_close=function(){return"</a>"},m.image=function(e,t,n){var r=' src="'+_(e[t].src)+'"',o=e[t].title?' title="'+_(d(e[t].title))+'"':"";return"<img"+r+' alt="'+(e[t].alt?_(d(a(e[t].alt))):"")+'"'+o+(n.xhtmlOut?" /":"")+">"},m.table_open=function(){return"<table>\n"},m.table_close=function(){return"</table>\n"},m.thead_open=function(){return"<thead>\n"},m.thead_close=function(){return"</thead>\n"},m.tbody_open=function(){return"<tbody>\n"},m.tbody_close=function(){return"</tbody>\n"},m.tr_open=function(){return"<tr>"},m.tr_close=function(){return"</tr>\n"},m.th_open=function(e,t){var n=e[t];return"<th"+(n.align?' style="text-align:'+n.align+'"':"")+">"},m.th_close=function(){return"</th>"},m.td_open=function(e,t){var n=e[t];return"<td"+(n.align?' style="text-align:'+n.align+'"':"")+">"},m.td_close=function(){return"</td>"},m.strong_open=function(){return"<strong>"},m.strong_close=function(){return"</strong>"},m.em_open=function(){return"<em>"},m.em_close=function(){return"</em>"},m.del_open=function(){return"<del>"},m.del_close=function(){return"</del>"},m.ins_open=function(){return"<ins>"},m.ins_close=function(){return"</ins>"},m.mark_open=function(){return"<mark>"},m.mark_close=function(){return"</mark>"},m.sub=function(e,t){return"<sub>"+_(e[t].content)+"</sub>"},m.sup=function(e,t){return"<sup>"+_(e[t].content)+"</sup>"},m.hardbreak=function(e,t,n){return n.xhtmlOut?"<br />\n":"<br>\n"},m.softbreak=function(e,t,n){return n.breaks?n.xhtmlOut?"<br />\n":"<br>\n":"\n"},m.text=function(e,t){return _(e[t].content)},m.htmlblock=function(e,t){return e[t].content},m.htmltag=function(e,t){return e[t].content},m.abbr_open=function(e,t){return'<abbr title="'+_(d(e[t].title))+'">'},m.abbr_close=function(){return"</abbr>"},m.footnote_ref=function(e,t){var n=Number(e[t].id+1).toString(),r="fnref"+n;return e[t].subId>0&&(r+=":"+e[t].subId),'<sup class="footnote-ref"><a href="#fn'+n+'" id="'+r+'">['+n+"]</a></sup>"},m.footnote_block_open=function(e,t,n){return(n.xhtmlOut?'<hr class="footnotes-sep" />\n':'<hr class="footnotes-sep">\n')+'<section class="footnotes">\n<ol class="footnotes-list">\n'},m.footnote_block_close=function(){return"</ol>\n</section>\n"},m.footnote_open=function(e,t){return'<li id="fn'+Number(e[t].id+1).toString()+'" class="footnote-item">'},m.footnote_close=function(){return"</li>\n"},m.footnote_anchor=function(e,t){var n="fnref"+Number(e[t].id+1).toString();return e[t].subId>0&&(n+=":"+e[t].subId),' <a href="#'+n+'" class="footnote-backref">↩</a>'},m.dl_open=function(){return"<dl>\n"},m.dt_open=function(){return"<dt>"},m.dd_open=function(){return"<dd>"},m.dl_close=function(){return"</dl>\n"},m.dt_close=function(){return"</dt>\n"},m.dd_close=function(){return"</dd>\n"};var C=m.getBreak=function(e,t){return(t=y(e,t))<e.length&&"list_item_close"===e[t].type?"":"\n"};function x(){this.rules=i({},m),this.getBreak=m.getBreak}function A(){this.__rules__=[],this.__cache__=null}function M(e,t,n,r,o){this.src=e,this.env=r,this.options=n,this.parser=t,this.tokens=o,this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache=[],this.isInLabel=!1,this.linkLevel=0,this.linkContent="",this.labelUnmatchedScopes=0}function S(e,t){var n,r,o,s=-1,i=e.posMax,l=e.pos,a=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos<i;){if(91===(o=e.src.charCodeAt(e.pos)))n++;else if(93===o&&0==--n){r=!0;break}e.parser.skipToken(e)}return r?(s=e.pos,e.labelUnmatchedScopes=0):e.labelUnmatchedScopes=n-1,e.pos=l,e.isInLabel=a,s}function I(e,t,n,r){var o,s,i,l,a,c;if(42!==e.charCodeAt(0))return-1;if(91!==e.charCodeAt(1))return-1;if(-1===e.indexOf("]:"))return-1;if((s=S(o=new M(e,t,n,r,[]),1))<0||58!==e.charCodeAt(s+1))return-1;for(l=o.posMax,i=s+2;i<l&&10!==o.src.charCodeAt(i);i++);return a=e.slice(2,s),0===(c=e.slice(s+2,i).trim()).length?-1:(r.abbreviations||(r.abbreviations={}),void 0===r.abbreviations[":"+a]&&(r.abbreviations[":"+a]=c),i)}function w(e){var t=d(e);try{t=decodeURI(t)}catch(e){}return encodeURI(t)}function E(e,t){var n,r,o,s=t,i=e.posMax;if(60===e.src.charCodeAt(t)){for(t++;t<i;){if(10===(n=e.src.charCodeAt(t)))return!1;if(62===n)return o=w(a(e.src.slice(s+1,t))),!!e.parser.validateLink(o)&&(e.pos=t+1,e.linkContent=o,!0);92===n&&t+1<i?t+=2:t++}return!1}for(r=0;t<i&&32!==(n=e.src.charCodeAt(t))&&!(n<32||127===n);)if(92===n&&t+1<i)t+=2;else{if(40===n&&++r>1)break;if(41===n&&--r<0)break;t++}return s!==t&&(o=a(e.src.slice(s,t)),!!e.parser.validateLink(o)&&(e.linkContent=o,e.pos=t,!0))}function z(e,t){var n,r=t,o=e.posMax,s=e.src.charCodeAt(t);if(34!==s&&39!==s&&40!==s)return!1;for(t++,40===s&&(s=41);t<o;){if((n=e.src.charCodeAt(t))===s)return e.pos=t+1,e.linkContent=a(e.src.slice(r+1,t)),!0;92===n&&t+1<o?t+=2:t++}return!1}function L(e){return e.trim().replace(/\s+/g," ").toUpperCase()}function q(e,t,n,r){var o,s,i,l,a,c,p,h,u;if(91!==e.charCodeAt(0))return-1;if(-1===e.indexOf("]:"))return-1;if((s=S(o=new M(e,t,n,r,[]),0))<0||58!==e.charCodeAt(s+1))return-1;for(l=o.posMax,i=s+2;i<l&&(32===(a=o.src.charCodeAt(i))||10===a);i++);if(!E(o,i))return-1;for(p=o.linkContent,c=i=o.pos,i+=1;i<l&&(32===(a=o.src.charCodeAt(i))||10===a);i++);for(i<l&&c!==i&&z(o,i)?(h=o.linkContent,i=o.pos):(h="",i=c);i<l&&32===o.src.charCodeAt(i);)i++;return i<l&&10!==o.src.charCodeAt(i)?-1:(u=L(e.slice(1,s)),void 0===r.references[u]&&(r.references[u]={title:h,href:p}),i)}x.prototype.renderInline=function(e,t,n){for(var r=this.rules,o=e.length,s=0,i="";o--;)i+=r[e[s].type](e,s++,t,n,this);return i},x.prototype.render=function(e,t,n){for(var r=this.rules,o=e.length,s=-1,i="";++s<o;)"inline"===e[s].type?i+=this.renderInline(e[s].children,t,n):i+=r[e[s].type](e,s,t,n,this);return i},A.prototype.__find__=function(e){for(var t=this.__rules__.length,n=-1;t--;)if(this.__rules__[++n].name===e)return n;return-1},A.prototype.__compile__=function(){var e=this,t=[""];e.__rules__.forEach((function(e){e.enabled&&e.alt.forEach((function(e){t.indexOf(e)<0&&t.push(e)}))})),e.__cache__={},t.forEach((function(t){e.__cache__[t]=[],e.__rules__.forEach((function(n){n.enabled&&(t&&n.alt.indexOf(t)<0||e.__cache__[t].push(n.fn))}))}))},A.prototype.at=function(e,t,n){var r=this.__find__(e),o=n||{};if(-1===r)throw new Error("Parser rule not found: "+e);this.__rules__[r].fn=t,this.__rules__[r].alt=o.alt||[],this.__cache__=null},A.prototype.before=function(e,t,n,r){var o=this.__find__(e),s=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},A.prototype.after=function(e,t,n,r){var o=this.__find__(e),s=r||{};if(-1===o)throw new Error("Parser rule not found: "+e);this.__rules__.splice(o+1,0,{name:t,enabled:!0,fn:n,alt:s.alt||[]}),this.__cache__=null},A.prototype.push=function(e,t,n){var r=n||{};this.__rules__.push({name:e,enabled:!0,fn:t,alt:r.alt||[]}),this.__cache__=null},A.prototype.enable=function(e,t){e=Array.isArray(e)?e:[e],t&&this.__rules__.forEach((function(e){e.enabled=!1})),e.forEach((function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!0}),this),this.__cache__=null},A.prototype.disable=function(e){(e=Array.isArray(e)?e:[e]).forEach((function(e){var t=this.__find__(e);if(t<0)throw new Error("Rules manager: invalid rule name "+e);this.__rules__[t].enabled=!1}),this),this.__cache__=null},A.prototype.getRules=function(e){return null===this.__cache__&&this.__compile__(),this.__cache__[e]||[]},M.prototype.pushPending=function(){this.tokens.push({type:"text",content:this.pending,level:this.pendingLevel}),this.pending=""},M.prototype.push=function(e){this.pending&&this.pushPending(),this.tokens.push(e),this.pendingLevel=this.level},M.prototype.cacheSet=function(e,t){for(var n=this.cache.length;n<=e;n++)this.cache.push(0);this.cache[e]=t},M.prototype.cacheGet=function(e){return e<this.cache.length?this.cache[e]:0};var T=" \n()[]'\".,!?-";function O(e){return e.replace(/([-()\[\]{}+?*.$\^|,:#<!\\])/g,"\\$1")}var $=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,N=/\((c|tm|r|p)\)/gi,R={c:"©",r:"®",p:"§",tm:"™"},j=/['"]/,Z=/['"]/g,P=/[-\s()\[\]]/;function U(e,t){return!(t<0||t>=e.length||P.test(e[t]))}function B(e,t,n){return e.substr(0,t)+n+e.substr(t+1)}var G=[["block",function(e){e.inlineMode?e.tokens.push({type:"inline",content:e.src.replace(/\n/g," ").trim(),level:0,lines:[0,1],children:[]}):e.block.parse(e.src,e.options,e.env,e.tokens)}],["abbr",function(e){var t,n,r,o,s=e.tokens;if(!e.inlineMode)for(t=1,n=s.length-1;t<n;t++)if("paragraph_open"===s[t-1].type&&"inline"===s[t].type&&"paragraph_close"===s[t+1].type){for(r=s[t].content;r.length&&!((o=I(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();s[t].content=r,r.length||(s[t-1].tight=!0,s[t+1].tight=!0)}}],["references",function(e){var t,n,r,o,s=e.tokens;if(e.env.references=e.env.references||{},!e.inlineMode)for(t=1,n=s.length-1;t<n;t++)if("inline"===s[t].type&&"paragraph_open"===s[t-1].type&&"paragraph_close"===s[t+1].type){for(r=s[t].content;r.length&&!((o=q(r,e.inline,e.options,e.env))<0);)r=r.slice(o).trim();s[t].content=r,r.length||(s[t-1].tight=!0,s[t+1].tight=!0)}}],["inline",function(e){var t,n,r,o=e.tokens;for(n=0,r=o.length;n<r;n++)"inline"===(t=o[n]).type&&e.inline.parse(t.content,e.options,e.env,t.children)}],["footnote_tail",function(e){var t,n,r,o,s,i,l,a,c,p=0,h=!1,u={};if(e.env.footnotes&&(e.tokens=e.tokens.filter((function(e){return"footnote_reference_open"===e.type?(h=!0,a=[],c=e.label,!1):"footnote_reference_close"===e.type?(h=!1,u[":"+c]=a,!1):(h&&a.push(e),!h)})),e.env.footnotes.list)){for(i=e.env.footnotes.list,e.tokens.push({type:"footnote_block_open",level:p++}),t=0,n=i.length;t<n;t++){for(e.tokens.push({type:"footnote_open",id:t,level:p++}),i[t].tokens?((l=[]).push({type:"paragraph_open",tight:!1,level:p++}),l.push({type:"inline",content:"",level:p,children:i[t].tokens}),l.push({type:"paragraph_close",tight:!1,level:--p})):i[t].label&&(l=u[":"+i[t].label]),e.tokens=e.tokens.concat(l),s="paragraph_close"===e.tokens[e.tokens.length-1].type?e.tokens.pop():null,o=i[t].count>0?i[t].count:1,r=0;r<o;r++)e.tokens.push({type:"footnote_anchor",id:t,subId:r,level:p});s&&e.tokens.push(s),e.tokens.push({type:"footnote_close",level:--p})}e.tokens.push({type:"footnote_block_close",level:--p})}}],["abbr2",function(e){var t,n,r,o,s,i,l,a,c,p,h,u,f=e.tokens;if(e.env.abbreviations)for(e.env.abbrRegExp||(u="(^|["+T.split("").map(O).join("")+"])("+Object.keys(e.env.abbreviations).map((function(e){return e.substr(1)})).sort((function(e,t){return t.length-e.length})).map(O).join("|")+")($|["+T.split("").map(O).join("")+"])",e.env.abbrRegExp=new RegExp(u,"g")),p=e.env.abbrRegExp,n=0,r=f.length;n<r;n++)if("inline"===f[n].type)for(t=(o=f[n].children).length-1;t>=0;t--)if("text"===(s=o[t]).type){for(a=0,i=s.content,p.lastIndex=0,c=s.level,l=[];h=p.exec(i);)p.lastIndex>a&&l.push({type:"text",content:i.slice(a,h.index+h[1].length),level:c}),l.push({type:"abbr_open",title:e.env.abbreviations[":"+h[2]],level:c++}),l.push({type:"text",content:h[2],level:c}),l.push({type:"abbr_close",level:--c}),a=p.lastIndex-h[3].length;l.length&&(a<i.length&&l.push({type:"text",content:i.slice(a),level:c}),f[n].children=o=[].concat(o.slice(0,t),l,o.slice(t+1)))}}],["replacements",function(e){var t,n,r,o,s,i;if(e.options.typographer)for(s=e.tokens.length-1;s>=0;s--)if("inline"===e.tokens[s].type)for(t=(o=e.tokens[s].children).length-1;t>=0;t--)"text"===(n=o[t]).type&&(r=(i=r=n.content).indexOf("(")<0?i:i.replace(N,(function(e,t){return R[t.toLowerCase()]})),$.test(r)&&(r=r.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---([^-]|$)/gm,"$1—$2").replace(/(^|\s)--(\s|$)/gm,"$1–$2").replace(/(^|[^-\s])--([^-\s]|$)/gm,"$1–$2")),n.content=r)}],["smartquotes",function(e){var t,n,r,o,s,i,l,a,c,p,h,u,f,d,k,v,g;if(e.options.typographer)for(g=[],k=e.tokens.length-1;k>=0;k--)if("inline"===e.tokens[k].type)for(v=e.tokens[k].children,g.length=0,t=0;t<v.length;t++)if("text"===(n=v[t]).type&&!j.test(n.text)){for(l=v[t].level,f=g.length-1;f>=0&&!(g[f].level<=l);f--);g.length=f+1,s=0,i=(r=n.content).length;e:for(;s<i&&(Z.lastIndex=s,o=Z.exec(r));)if(a=!U(r,o.index-1),s=o.index+1,d="'"===o[0],(c=!U(r,s))||a){if(h=!c,u=!a)for(f=g.length-1;f>=0&&(p=g[f],!(g[f].level<l));f--)if(p.single===d&&g[f].level===l){p=g[f],d?(v[p.token].content=B(v[p.token].content,p.pos,e.options.quotes[2]),n.content=B(n.content,o.index,e.options.quotes[3])):(v[p.token].content=B(v[p.token].content,p.pos,e.options.quotes[0]),n.content=B(n.content,o.index,e.options.quotes[1])),g.length=f;continue e}h?g.push({token:t,pos:o.index,single:d,level:l}):u&&d&&(n.content=B(n.content,o.index,"’"))}else d&&(n.content=B(n.content,o.index,"’"))}}]];function D(){this.options={},this.ruler=new A;for(var e=0;e<G.length;e++)this.ruler.push(G[e][0],G[e][1])}function H(e,t,n,r,o){var s,i,l,a,c,p,h;for(this.src=e,this.parser=t,this.options=n,this.env=r,this.tokens=o,this.bMarks=[],this.eMarks=[],this.tShift=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.parentType="root",this.ddIndent=-1,this.level=0,this.result="",p=0,h=!1,l=a=p=0,c=(i=this.src).length;a<c;a++){if(s=i.charCodeAt(a),!h){if(32===s){p++;continue}h=!0}10!==s&&a!==c-1||(10!==s&&a++,this.bMarks.push(l),this.eMarks.push(a),this.tShift.push(p),h=!1,p=0,l=a+1)}this.bMarks.push(i.length),this.eMarks.push(i.length),this.tShift.push(0),this.lineMax=this.bMarks.length-1}function W(e,t){var n,r,o;return(r=e.bMarks[t]+e.tShift[t])>=(o=e.eMarks[t])||42!==(n=e.src.charCodeAt(r++))&&45!==n&&43!==n||r<o&&32!==e.src.charCodeAt(r)?-1:r}function F(e,t){var n,r=e.bMarks[t]+e.tShift[t],o=e.eMarks[t];if(r+1>=o)return-1;if((n=e.src.charCodeAt(r++))<48||n>57)return-1;for(;;){if(r>=o)return-1;if(!((n=e.src.charCodeAt(r++))>=48&&n<=57)){if(41===n||46===n)break;return-1}}return r<o&&32!==e.src.charCodeAt(r)?-1:r}D.prototype.process=function(e){var t,n,r;for(t=0,n=(r=this.ruler.getRules("")).length;t<n;t++)r[t](e)},H.prototype.isEmpty=function(e){return this.bMarks[e]+this.tShift[e]>=this.eMarks[e]},H.prototype.skipEmptyLines=function(e){for(var t=this.lineMax;e<t&&!(this.bMarks[e]+this.tShift[e]<this.eMarks[e]);e++);return e},H.prototype.skipSpaces=function(e){for(var t=this.src.length;e<t&&32===this.src.charCodeAt(e);e++);return e},H.prototype.skipChars=function(e,t){for(var n=this.src.length;e<n&&this.src.charCodeAt(e)===t;e++);return e},H.prototype.skipCharsBack=function(e,t,n){if(e<=n)return e;for(;e>n;)if(t!==this.src.charCodeAt(--e))return e+1;return e},H.prototype.getLines=function(e,t,n,r){var o,s,i,l,a,c=e;if(e>=t)return"";if(c+1===t)return s=this.bMarks[c]+Math.min(this.tShift[c],n),i=r?this.eMarks[c]+1:this.eMarks[c],this.src.slice(s,i);for(l=new Array(t-e),o=0;c<t;c++,o++)(a=this.tShift[c])>n&&(a=n),a<0&&(a=0),s=this.bMarks[c]+a,i=c+1<t||r?this.eMarks[c]+1:this.eMarks[c],l[o]=this.src.slice(s,i);return l.join("")};var J={};["article","aside","button","blockquote","body","canvas","caption","col","colgroup","dd","div","dl","dt","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","iframe","li","map","object","ol","output","p","pre","progress","script","section","style","table","tbody","td","textarea","tfoot","th","tr","thead","ul","video"].forEach((function(e){J[e]=!0}));var K=/^<([a-zA-Z]{1,15})[\s\/>]/,Q=/^<\/([a-zA-Z]{1,15})[\s>]/;function V(e,t){var n=e.bMarks[t]+e.blkIndent,r=e.eMarks[t];return e.src.substr(n,r-n)}function X(e,t){var n,r,o=e.bMarks[t]+e.tShift[t],s=e.eMarks[t];return o>=s||126!==(r=e.src.charCodeAt(o++))&&58!==r||o===(n=e.skipSpaces(o))||n>=s?-1:n}var Y=[["code",function(e,t,n){var r,o;if(e.tShift[t]-e.blkIndent<4)return!1;for(o=r=t+1;r<n;)if(e.isEmpty(r))r++;else{if(!(e.tShift[r]-e.blkIndent>=4))break;o=++r}return e.line=r,e.tokens.push({type:"code",content:e.getLines(t,o,4+e.blkIndent,!0),block:!0,lines:[t,e.line],level:e.level}),!0}],["fences",function(e,t,n,r){var o,s,i,l,a,c=!1,p=e.bMarks[t]+e.tShift[t],h=e.eMarks[t];if(p+3>h)return!1;if(126!==(o=e.src.charCodeAt(p))&&96!==o)return!1;if(a=p,(s=(p=e.skipChars(p,o))-a)<3)return!1;if((i=e.src.slice(p,h).trim()).indexOf("`")>=0)return!1;if(r)return!0;for(l=t;!(++l>=n||(p=a=e.bMarks[l]+e.tShift[l])<(h=e.eMarks[l])&&e.tShift[l]<e.blkIndent);)if(e.src.charCodeAt(p)===o&&!(e.tShift[l]-e.blkIndent>=4||(p=e.skipChars(p,o))-a<s||(p=e.skipSpaces(p))<h)){c=!0;break}return s=e.tShift[t],e.line=l+(c?1:0),e.tokens.push({type:"fence",params:i,content:e.getLines(t+1,l,s,!0),lines:[t,e.line],level:e.level}),!0},["paragraph","blockquote","list"]],["blockquote",function(e,t,n,r){var o,s,i,l,a,c,p,h,u,f,d,k=e.bMarks[t]+e.tShift[t],v=e.eMarks[t];if(k>v)return!1;if(62!==e.src.charCodeAt(k++))return!1;if(e.level>=e.options.maxNesting)return!1;if(r)return!0;for(32===e.src.charCodeAt(k)&&k++,a=e.blkIndent,e.blkIndent=0,l=[e.bMarks[t]],e.bMarks[t]=k,s=(k=k<v?e.skipSpaces(k):k)>=v,i=[e.tShift[t]],e.tShift[t]=k-e.bMarks[t],h=e.parser.ruler.getRules("blockquote"),o=t+1;o<n&&!((k=e.bMarks[o]+e.tShift[o])>=(v=e.eMarks[o]));o++)if(62!==e.src.charCodeAt(k++)){if(s)break;for(d=!1,u=0,f=h.length;u<f;u++)if(h[u](e,o,n,!0)){d=!0;break}if(d)break;l.push(e.bMarks[o]),i.push(e.tShift[o]),e.tShift[o]=-1337}else 32===e.src.charCodeAt(k)&&k++,l.push(e.bMarks[o]),e.bMarks[o]=k,s=(k=k<v?e.skipSpaces(k):k)>=v,i.push(e.tShift[o]),e.tShift[o]=k-e.bMarks[o];for(c=e.parentType,e.parentType="blockquote",e.tokens.push({type:"blockquote_open",lines:p=[t,0],level:e.level++}),e.parser.tokenize(e,t,o),e.tokens.push({type:"blockquote_close",level:--e.level}),e.parentType=c,p[1]=e.line,u=0;u<i.length;u++)e.bMarks[u+t]=l[u],e.tShift[u+t]=i[u];return e.blkIndent=a,!0},["paragraph","blockquote","list"]],["hr",function(e,t,n,r){var o,s,i,l=e.bMarks[t],a=e.eMarks[t];if((l+=e.tShift[t])>a)return!1;if(42!==(o=e.src.charCodeAt(l++))&&45!==o&&95!==o)return!1;for(s=1;l<a;){if((i=e.src.charCodeAt(l++))!==o&&32!==i)return!1;i===o&&s++}return!(s<3||(r||(e.line=t+1,e.tokens.push({type:"hr",lines:[t,e.line],level:e.level})),0))},["paragraph","blockquote","list"]],["list",function(e,t,n,r){var o,s,i,l,a,c,p,h,u,f,d,k,v,g,b,_,m,y,C,x,A,M=!0;if((h=F(e,t))>=0)k=!0;else{if(!((h=W(e,t))>=0))return!1;k=!1}if(e.level>=e.options.maxNesting)return!1;if(d=e.src.charCodeAt(h-1),r)return!0;for(g=e.tokens.length,k?(p=e.bMarks[t]+e.tShift[t],f=Number(e.src.substr(p,h-p-1)),e.tokens.push({type:"ordered_list_open",order:f,lines:_=[t,0],level:e.level++})):e.tokens.push({type:"bullet_list_open",lines:_=[t,0],level:e.level++}),o=t,b=!1,y=e.parser.ruler.getRules("list");!(!(o<n)||((u=(v=e.skipSpaces(h))>=e.eMarks[o]?1:v-h)>4&&(u=1),u<1&&(u=1),s=h-e.bMarks[o]+u,e.tokens.push({type:"list_item_open",lines:m=[t,0],level:e.level++}),l=e.blkIndent,a=e.tight,i=e.tShift[t],c=e.parentType,e.tShift[t]=v-e.bMarks[t],e.blkIndent=s,e.tight=!0,e.parentType="list",e.parser.tokenize(e,t,n,!0),e.tight&&!b||(M=!1),b=e.line-t>1&&e.isEmpty(e.line-1),e.blkIndent=l,e.tShift[t]=i,e.tight=a,e.parentType=c,e.tokens.push({type:"list_item_close",level:--e.level}),o=t=e.line,m[1]=o,v=e.bMarks[t],o>=n)||e.isEmpty(o)||e.tShift[o]<e.blkIndent);){for(A=!1,C=0,x=y.length;C<x;C++)if(y[C](e,o,n,!0)){A=!0;break}if(A)break;if(k){if((h=F(e,o))<0)break}else if((h=W(e,o))<0)break;if(d!==e.src.charCodeAt(h-1))break}return e.tokens.push({type:k?"ordered_list_close":"bullet_list_close",level:--e.level}),_[1]=o,e.line=o,M&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,g),!0},["paragraph","blockquote"]],["footnote",function(e,t,n,r){var o,s,i,l,a,c=e.bMarks[t]+e.tShift[t],p=e.eMarks[t];if(c+4>p)return!1;if(91!==e.src.charCodeAt(c))return!1;if(94!==e.src.charCodeAt(c+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(l=c+2;l<p;l++){if(32===e.src.charCodeAt(l))return!1;if(93===e.src.charCodeAt(l))break}return!(l===c+2||l+1>=p||58!==e.src.charCodeAt(++l)||(r||(l++,e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.refs||(e.env.footnotes.refs={}),a=e.src.slice(c+2,l-2),e.env.footnotes.refs[":"+a]=-1,e.tokens.push({type:"footnote_reference_open",label:a,level:e.level++}),o=e.bMarks[t],s=e.tShift[t],i=e.parentType,e.tShift[t]=e.skipSpaces(l)-l,e.bMarks[t]=l,e.blkIndent+=4,e.parentType="footnote",e.tShift[t]<e.blkIndent&&(e.tShift[t]+=e.blkIndent,e.bMarks[t]-=e.blkIndent),e.parser.tokenize(e,t,n,!0),e.parentType=i,e.blkIndent-=4,e.tShift[t]=s,e.bMarks[t]=o,e.tokens.push({type:"footnote_reference_close",level:--e.level})),0))},["paragraph"]],["heading",function(e,t,n,r){var o,s,i,l=e.bMarks[t]+e.tShift[t],a=e.eMarks[t];if(l>=a)return!1;if(35!==(o=e.src.charCodeAt(l))||l>=a)return!1;for(s=1,o=e.src.charCodeAt(++l);35===o&&l<a&&s<=6;)s++,o=e.src.charCodeAt(++l);return!(s>6||l<a&&32!==o||(r||(a=e.skipCharsBack(a,32,l),(i=e.skipCharsBack(a,35,l))>l&&32===e.src.charCodeAt(i-1)&&(a=i),e.line=t+1,e.tokens.push({type:"heading_open",hLevel:s,lines:[t,e.line],level:e.level}),l<a&&e.tokens.push({type:"inline",content:e.src.slice(l,a).trim(),level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"heading_close",hLevel:s,level:e.level})),0))},["paragraph","blockquote"]],["lheading",function(e,t,n){var r,o,s,i=t+1;return!(i>=n||e.tShift[i]<e.blkIndent||e.tShift[i]-e.blkIndent>3||(o=e.bMarks[i]+e.tShift[i])>=(s=e.eMarks[i])||45!==(r=e.src.charCodeAt(o))&&61!==r||(o=e.skipChars(o,r),(o=e.skipSpaces(o))<s||(o=e.bMarks[t]+e.tShift[t],e.line=i+1,e.tokens.push({type:"heading_open",hLevel:61===r?1:2,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:e.src.slice(o,e.eMarks[t]).trim(),level:e.level+1,lines:[t,e.line-1],children:[]}),e.tokens.push({type:"heading_close",hLevel:61===r?1:2,level:e.level}),0)))}],["htmlblock",function(e,t,n,r){var o,s,i,l=e.bMarks[t],a=e.eMarks[t],c=e.tShift[t];if(l+=c,!e.options.html)return!1;if(c>3||l+2>=a)return!1;if(60!==e.src.charCodeAt(l))return!1;if(33===(o=e.src.charCodeAt(l+1))||63===o){if(r)return!0}else{if(47!==o&&!function(e){var t=32|e;return t>=97&&t<=122}(o))return!1;if(47===o){if(!(s=e.src.slice(l,a).match(Q)))return!1}else if(!(s=e.src.slice(l,a).match(K)))return!1;if(!0!==J[s[1].toLowerCase()])return!1;if(r)return!0}for(i=t+1;i<e.lineMax&&!e.isEmpty(i);)i++;return e.line=i,e.tokens.push({type:"htmlblock",level:e.level,lines:[t,e.line],content:e.getLines(t,i,0,!0)}),!0},["paragraph","blockquote"]],["table",function(e,t,n,r){var o,s,i,l,a,c,p,h,u,f,d;if(t+2>n)return!1;if(a=t+1,e.tShift[a]<e.blkIndent)return!1;if((i=e.bMarks[a]+e.tShift[a])>=e.eMarks[a])return!1;if(124!==(o=e.src.charCodeAt(i))&&45!==o&&58!==o)return!1;if(s=V(e,t+1),!/^[-:| ]+$/.test(s))return!1;if((c=s.split("|"))<=2)return!1;for(h=[],l=0;l<c.length;l++){if(!(u=c[l].trim())){if(0===l||l===c.length-1)continue;return!1}if(!/^:?-+:?$/.test(u))return!1;58===u.charCodeAt(u.length-1)?h.push(58===u.charCodeAt(0)?"center":"right"):58===u.charCodeAt(0)?h.push("left"):h.push("")}if(-1===(s=V(e,t).trim()).indexOf("|"))return!1;if(c=s.replace(/^\||\|$/g,"").split("|"),h.length!==c.length)return!1;if(r)return!0;for(e.tokens.push({type:"table_open",lines:f=[t,0],level:e.level++}),e.tokens.push({type:"thead_open",lines:[t,t+1],level:e.level++}),e.tokens.push({type:"tr_open",lines:[t,t+1],level:e.level++}),l=0;l<c.length;l++)e.tokens.push({type:"th_open",align:h[l],lines:[t,t+1],level:e.level++}),e.tokens.push({type:"inline",content:c[l].trim(),lines:[t,t+1],level:e.level,children:[]}),e.tokens.push({type:"th_close",level:--e.level});for(e.tokens.push({type:"tr_close",level:--e.level}),e.tokens.push({type:"thead_close",level:--e.level}),e.tokens.push({type:"tbody_open",lines:d=[t+2,0],level:e.level++}),a=t+2;a<n&&!(e.tShift[a]<e.blkIndent)&&-1!==(s=V(e,a).trim()).indexOf("|");a++){for(c=s.replace(/^\||\|$/g,"").split("|"),e.tokens.push({type:"tr_open",level:e.level++}),l=0;l<c.length;l++)e.tokens.push({type:"td_open",align:h[l],level:e.level++}),p=c[l].substring(124===c[l].charCodeAt(0)?1:0,124===c[l].charCodeAt(c[l].length-1)?c[l].length-1:c[l].length).trim(),e.tokens.push({type:"inline",content:p,level:e.level,children:[]}),e.tokens.push({type:"td_close",level:--e.level});e.tokens.push({type:"tr_close",level:--e.level})}return e.tokens.push({type:"tbody_close",level:--e.level}),e.tokens.push({type:"table_close",level:--e.level}),f[1]=d[1]=a,e.line=a,!0},["paragraph"]],["deflist",function(e,t,n,r){var o,s,i,l,a,c,p,h,u,f,d,k,v,g;if(r)return!(e.ddIndent<0)&&X(e,t)>=0;if(p=t+1,e.isEmpty(p)&&++p>n)return!1;if(e.tShift[p]<e.blkIndent)return!1;if((o=X(e,p))<0)return!1;if(e.level>=e.options.maxNesting)return!1;c=e.tokens.length,e.tokens.push({type:"dl_open",lines:a=[t,0],level:e.level++}),i=t,s=p;e:for(;;){for(g=!0,v=!1,e.tokens.push({type:"dt_open",lines:[i,i],level:e.level++}),e.tokens.push({type:"inline",content:e.getLines(i,i+1,e.blkIndent,!1).trim(),level:e.level+1,lines:[i,i],children:[]}),e.tokens.push({type:"dt_close",level:--e.level});;){if(e.tokens.push({type:"dd_open",lines:l=[p,0],level:e.level++}),k=e.tight,u=e.ddIndent,h=e.blkIndent,d=e.tShift[s],f=e.parentType,e.blkIndent=e.ddIndent=e.tShift[s]+2,e.tShift[s]=o-e.bMarks[s],e.tight=!0,e.parentType="deflist",e.parser.tokenize(e,s,n,!0),e.tight&&!v||(g=!1),v=e.line-s>1&&e.isEmpty(e.line-1),e.tShift[s]=d,e.tight=k,e.parentType=f,e.blkIndent=h,e.ddIndent=u,e.tokens.push({type:"dd_close",level:--e.level}),l[1]=p=e.line,p>=n)break e;if(e.tShift[p]<e.blkIndent)break e;if((o=X(e,p))<0)break;s=p}if(p>=n)break;if(i=p,e.isEmpty(i))break;if(e.tShift[i]<e.blkIndent)break;if((s=i+1)>=n)break;if(e.isEmpty(s)&&s++,s>=n)break;if(e.tShift[s]<e.blkIndent)break;if((o=X(e,s))<0)break}return e.tokens.push({type:"dl_close",level:--e.level}),a[1]=p,e.line=p,g&&function(e,t){var n,r,o=e.level+2;for(n=t+2,r=e.tokens.length-2;n<r;n++)e.tokens[n].level===o&&"paragraph_open"===e.tokens[n].type&&(e.tokens[n+2].tight=!0,e.tokens[n].tight=!0,n+=2)}(e,c),!0},["paragraph"]],["paragraph",function(e,t){var n,r,o,s,i,l,a=t+1;if(a<(n=e.lineMax)&&!e.isEmpty(a))for(l=e.parser.ruler.getRules("paragraph");a<n&&!e.isEmpty(a);a++)if(!(e.tShift[a]-e.blkIndent>3)){for(o=!1,s=0,i=l.length;s<i;s++)if(l[s](e,a,n,!0)){o=!0;break}if(o)break}return r=e.getLines(t,a,e.blkIndent,!1).trim(),e.line=a,r.length&&(e.tokens.push({type:"paragraph_open",tight:!1,lines:[t,e.line],level:e.level}),e.tokens.push({type:"inline",content:r,level:e.level+1,lines:[t,e.line],children:[]}),e.tokens.push({type:"paragraph_close",tight:!1,level:e.level})),!0}]];function ee(){this.ruler=new A;for(var e=0;e<Y.length;e++)this.ruler.push(Y[e][0],Y[e][1],{alt:(Y[e][2]||[]).slice()})}ee.prototype.tokenize=function(e,t,n){for(var r,o=this.ruler.getRules(""),s=o.length,i=t,l=!1;i<n&&(e.line=i=e.skipEmptyLines(i),!(i>=n))&&!(e.tShift[i]<e.blkIndent);){for(r=0;r<s&&!o[r](e,i,n,!1);r++);if(e.tight=!l,e.isEmpty(e.line-1)&&(l=!0),(i=e.line)<n&&e.isEmpty(i)){if(l=!0,++i<n&&"list"===e.parentType&&e.isEmpty(i))break;e.line=i}}};var te=/[\n\t]/g,ne=/\r[\n\u0085]|[\u2424\u2028\u0085]/g,re=/\u00a0/g;function oe(e){switch(e){case 10:case 92:case 96:case 42:case 95:case 94:case 91:case 93:case 33:case 38:case 60:case 62:case 123:case 125:case 36:case 37:case 64:case 126:case 43:case 61:case 58:return!0;default:return!1}}ee.prototype.parse=function(e,t,n,r){var o,s=0,i=0;if(!e)return[];(e=(e=e.replace(re," ")).replace(ne,"\n")).indexOf("\t")>=0&&(e=e.replace(te,(function(t,n){var r;return 10===e.charCodeAt(n)?(s=n+1,i=0,t):(r=" ".slice((n-s-i)%4),i=n-s+1,r)}))),o=new H(e,this,t,n,r),this.tokenize(o,o.line,o.lineMax)};for(var se=[],ie=0;ie<256;ie++)se.push(0);function le(e){return e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122}function ae(e,t){var n,r,o,s=t,i=!0,l=!0,a=e.posMax,c=e.src.charCodeAt(t);for(n=t>0?e.src.charCodeAt(t-1):-1;s<a&&e.src.charCodeAt(s)===c;)s++;return s>=a&&(i=!1),(o=s-t)>=4?i=l=!1:(32!==(r=s<a?e.src.charCodeAt(s):-1)&&10!==r||(i=!1),32!==n&&10!==n||(l=!1),95===c&&(le(n)&&(i=!1),le(r)&&(l=!1))),{can_open:i,can_close:l,delims:o}}"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach((function(e){se[e.charCodeAt(0)]=1}));var ce=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,pe=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,he=["coap","doi","javascript","aaa","aaas","about","acap","cap","cid","crid","data","dav","dict","dns","file","ftp","geo","go","gopher","h323","http","https","iax","icap","im","imap","info","ipp","iris","iris.beep","iris.xpc","iris.xpcs","iris.lwz","ldap","mailto","mid","msrp","msrps","mtqp","mupdate","news","nfs","ni","nih","nntp","opaquelocktoken","pop","pres","rtsp","service","session","shttp","sieve","sip","sips","sms","snmp","soap.beep","soap.beeps","tag","tel","telnet","tftp","thismessage","tn3270","tip","tv","urn","vemmi","ws","wss","xcon","xcon-userid","xmlrpc.beep","xmlrpc.beeps","xmpp","z39.50r","z39.50s","adiumxtra","afp","afs","aim","apt","attachment","aw","beshare","bitcoin","bolo","callto","chrome","chrome-extension","com-eventbrite-attendee","content","cvs","dlna-playsingle","dlna-playcontainer","dtn","dvb","ed2k","facetime","feed","finger","fish","gg","git","gizmoproject","gtalk","hcp","icon","ipn","irc","irc6","ircs","itms","jar","jms","keyparc","lastfm","ldaps","magnet","maps","market","message","mms","ms-help","msnim","mumble","mvn","notes","oid","palm","paparazzi","platform","proxy","psyc","query","res","resource","rmi","rsync","rtmp","secondlife","sftp","sgn","skype","smb","soldat","spotify","ssh","steam","svn","teamspeak","things","udp","unreal","ut2004","ventrilo","view-source","webcal","wtai","wyciwyg","xfire","xri","ymsgr"],ue=/^<([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])?)*)>/,fe=/^<([a-zA-Z.\-]{1,25}):([^<>\x00-\x20]*)>/;function de(e,t){return e=e.source,t=t||"",function n(r,o){return r?(o=o.source||o,e=e.replace(r,o),n):new RegExp(e,t)}}var ke=de(/(?:unquoted|single_quoted|double_quoted)/)("unquoted",/[^"'=<>`\x00-\x20]+/)("single_quoted",/'[^']*'/)("double_quoted",/"[^"]*"/)(),ve=de(/(?:\s+attr_name(?:\s*=\s*attr_value)?)/)("attr_name",/[a-zA-Z_:][a-zA-Z0-9:._-]*/)("attr_value",ke)(),ge=de(/<[A-Za-z][A-Za-z0-9]*attribute*\s*\/?>/)("attribute",ve)(),be=de(/^(?:open_tag|close_tag|comment|processing|declaration|cdata)/)("open_tag",ge)("close_tag",/<\/[A-Za-z][A-Za-z0-9]*\s*>/)("comment",/<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->/)("processing",/<[?].*?[?]>/)("declaration",/<![A-Z]+\s+[^>]*>/)("cdata",/<!\[CDATA\[[\s\S]*?\]\]>/)(),_e=/^&#((?:x[a-f0-9]{1,8}|[0-9]{1,8}));/i,me=/^&([a-z][a-z0-9]{1,31});/i,ye=[["text",function(e,t){for(var n=e.pos;n<e.posMax&&!oe(e.src.charCodeAt(n));)n++;return n!==e.pos&&(t||(e.pending+=e.src.slice(e.pos,n)),e.pos=n,!0)}],["newline",function(e,t){var n,r,o=e.pos;if(10!==e.src.charCodeAt(o))return!1;if(n=e.pending.length-1,r=e.posMax,!t)if(n>=0&&32===e.pending.charCodeAt(n))if(n>=1&&32===e.pending.charCodeAt(n-1)){for(var s=n-2;s>=0;s--)if(32!==e.pending.charCodeAt(s)){e.pending=e.pending.substring(0,s+1);break}e.push({type:"hardbreak",level:e.level})}else e.pending=e.pending.slice(0,-1),e.push({type:"softbreak",level:e.level});else e.push({type:"softbreak",level:e.level});for(o++;o<r&&32===e.src.charCodeAt(o);)o++;return e.pos=o,!0}],["escape",function(e,t){var n,r=e.pos,o=e.posMax;if(92!==e.src.charCodeAt(r))return!1;if(++r<o){if((n=e.src.charCodeAt(r))<256&&0!==se[n])return t||(e.pending+=e.src[r]),e.pos+=2,!0;if(10===n){for(t||e.push({type:"hardbreak",level:e.level}),r++;r<o&&32===e.src.charCodeAt(r);)r++;return e.pos=r,!0}}return t||(e.pending+="\\"),e.pos++,!0}],["backticks",function(e,t){var n,r,o,s,i,l=e.pos;if(96!==e.src.charCodeAt(l))return!1;for(n=l,l++,r=e.posMax;l<r&&96===e.src.charCodeAt(l);)l++;for(o=e.src.slice(n,l),s=i=l;-1!==(s=e.src.indexOf("`",i));){for(i=s+1;i<r&&96===e.src.charCodeAt(i);)i++;if(i-s===o.length)return t||e.push({type:"code",content:e.src.slice(l,s).replace(/[ \n]+/g," ").trim(),block:!1,level:e.level}),e.pos=i,!0}return t||(e.pending+=o),e.pos+=o.length,!0}],["del",function(e,t){var n,r,o,s,i,l=e.posMax,a=e.pos;if(126!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(126!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(s=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),126===s)return!1;if(126===i)return!1;if(32===i||10===i)return!1;for(r=a+2;r<l&&126===e.src.charCodeAt(r);)r++;if(r>a+3)return e.pos+=r-a,t||(e.pending+=e.src.slice(a,r)),!0;for(e.pos=a+2,o=1;e.pos+1<l;){if(126===e.src.charCodeAt(e.pos)&&126===e.src.charCodeAt(e.pos+1)&&(s=e.src.charCodeAt(e.pos-1),126!==(i=e.pos+2<l?e.src.charCodeAt(e.pos+2):-1)&&126!==s&&(32!==s&&10!==s?o--:32!==i&&10!==i&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"del_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"del_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}],["ins",function(e,t){var n,r,o,s,i,l=e.posMax,a=e.pos;if(43!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(43!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(s=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),43===s)return!1;if(43===i)return!1;if(32===i||10===i)return!1;for(r=a+2;r<l&&43===e.src.charCodeAt(r);)r++;if(r!==a+2)return e.pos+=r-a,t||(e.pending+=e.src.slice(a,r)),!0;for(e.pos=a+2,o=1;e.pos+1<l;){if(43===e.src.charCodeAt(e.pos)&&43===e.src.charCodeAt(e.pos+1)&&(s=e.src.charCodeAt(e.pos-1),43!==(i=e.pos+2<l?e.src.charCodeAt(e.pos+2):-1)&&43!==s&&(32!==s&&10!==s?o--:32!==i&&10!==i&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"ins_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"ins_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}],["mark",function(e,t){var n,r,o,s,i,l=e.posMax,a=e.pos;if(61!==e.src.charCodeAt(a))return!1;if(t)return!1;if(a+4>=l)return!1;if(61!==e.src.charCodeAt(a+1))return!1;if(e.level>=e.options.maxNesting)return!1;if(s=a>0?e.src.charCodeAt(a-1):-1,i=e.src.charCodeAt(a+2),61===s)return!1;if(61===i)return!1;if(32===i||10===i)return!1;for(r=a+2;r<l&&61===e.src.charCodeAt(r);)r++;if(r!==a+2)return e.pos+=r-a,t||(e.pending+=e.src.slice(a,r)),!0;for(e.pos=a+2,o=1;e.pos+1<l;){if(61===e.src.charCodeAt(e.pos)&&61===e.src.charCodeAt(e.pos+1)&&(s=e.src.charCodeAt(e.pos-1),61!==(i=e.pos+2<l?e.src.charCodeAt(e.pos+2):-1)&&61!==s&&(32!==s&&10!==s?o--:32!==i&&10!==i&&o++,o<=0))){n=!0;break}e.parser.skipToken(e)}return n?(e.posMax=e.pos,e.pos=a+2,t||(e.push({type:"mark_open",level:e.level++}),e.parser.tokenize(e),e.push({type:"mark_close",level:--e.level})),e.pos=e.posMax+2,e.posMax=l,!0):(e.pos=a,!1)}],["emphasis",function(e,t){var n,r,o,s,i,l,a,c=e.posMax,p=e.pos,h=e.src.charCodeAt(p);if(95!==h&&42!==h)return!1;if(t)return!1;if(n=(a=ae(e,p)).delims,!a.can_open)return e.pos+=n,t||(e.pending+=e.src.slice(p,e.pos)),!0;if(e.level>=e.options.maxNesting)return!1;for(e.pos=p+n,l=[n];e.pos<c;)if(e.src.charCodeAt(e.pos)!==h)e.parser.skipToken(e);else{if(r=(a=ae(e,e.pos)).delims,a.can_close){for(s=l.pop(),i=r;s!==i;){if(i<s){l.push(s-i);break}if(i-=s,0===l.length)break;e.pos+=s,s=l.pop()}if(0===l.length){n=s,o=!0;break}e.pos+=r;continue}a.can_open&&l.push(r),e.pos+=r}return o?(e.posMax=e.pos,e.pos=p+n,t||(2!==n&&3!==n||e.push({type:"strong_open",level:e.level++}),1!==n&&3!==n||e.push({type:"em_open",level:e.level++}),e.parser.tokenize(e),1!==n&&3!==n||e.push({type:"em_close",level:--e.level}),2!==n&&3!==n||e.push({type:"strong_close",level:--e.level})),e.pos=e.posMax+n,e.posMax=c,!0):(e.pos=p,!1)}],["sub",function(e,t){var n,r,o=e.posMax,s=e.pos;if(126!==e.src.charCodeAt(s))return!1;if(t)return!1;if(s+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=s+1;e.pos<o;){if(126===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&s+1!==e.pos?(r=e.src.slice(s+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=s,!1):(e.posMax=e.pos,e.pos=s+1,t||e.push({type:"sub",level:e.level,content:r.replace(ce,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0):(e.pos=s,!1)}],["sup",function(e,t){var n,r,o=e.posMax,s=e.pos;if(94!==e.src.charCodeAt(s))return!1;if(t)return!1;if(s+2>=o)return!1;if(e.level>=e.options.maxNesting)return!1;for(e.pos=s+1;e.pos<o;){if(94===e.src.charCodeAt(e.pos)){n=!0;break}e.parser.skipToken(e)}return n&&s+1!==e.pos?(r=e.src.slice(s+1,e.pos)).match(/(^|[^\\])(\\\\)*\s/)?(e.pos=s,!1):(e.posMax=e.pos,e.pos=s+1,t||e.push({type:"sup",level:e.level,content:r.replace(pe,"$1")}),e.pos=e.posMax+1,e.posMax=o,!0):(e.pos=s,!1)}],["links",function(e,t){var n,r,o,s,i,l,a,c,p=!1,h=e.pos,u=e.posMax,f=e.pos,d=e.src.charCodeAt(f);if(33===d&&(p=!0,d=e.src.charCodeAt(++f)),91!==d)return!1;if(e.level>=e.options.maxNesting)return!1;if(n=f+1,(r=S(e,f))<0)return!1;if((l=r+1)<u&&40===e.src.charCodeAt(l)){for(l++;l<u&&(32===(c=e.src.charCodeAt(l))||10===c);l++);if(l>=u)return!1;for(f=l,E(e,l)?(s=e.linkContent,l=e.pos):s="",f=l;l<u&&(32===(c=e.src.charCodeAt(l))||10===c);l++);if(l<u&&f!==l&&z(e,l))for(i=e.linkContent,l=e.pos;l<u&&(32===(c=e.src.charCodeAt(l))||10===c);l++);else i="";if(l>=u||41!==e.src.charCodeAt(l))return e.pos=h,!1;l++}else{if(e.linkLevel>0)return!1;for(;l<u&&(32===(c=e.src.charCodeAt(l))||10===c);l++);if(l<u&&91===e.src.charCodeAt(l)&&(f=l+1,(l=S(e,l))>=0?o=e.src.slice(f,l++):l=f-1),o||(void 0===o&&(l=r+1),o=e.src.slice(n,r)),!(a=e.env.references[L(o)]))return e.pos=h,!1;s=a.href,i=a.title}return t||(e.pos=n,e.posMax=r,p?e.push({type:"image",src:s,title:i,alt:e.src.substr(n,r-n),level:e.level}):(e.push({type:"link_open",href:s,title:i,level:e.level++}),e.linkLevel++,e.parser.tokenize(e),e.linkLevel--,e.push({type:"link_close",level:--e.level}))),e.pos=l,e.posMax=u,!0}],["footnote_inline",function(e,t){var n,r,o,s,i=e.posMax,l=e.pos;return!(l+2>=i||94!==e.src.charCodeAt(l)||91!==e.src.charCodeAt(l+1)||e.level>=e.options.maxNesting||(n=l+2,(r=S(e,l+1))<0||(t||(e.env.footnotes||(e.env.footnotes={}),e.env.footnotes.list||(e.env.footnotes.list=[]),o=e.env.footnotes.list.length,e.pos=n,e.posMax=r,e.push({type:"footnote_ref",id:o,level:e.level}),e.linkLevel++,s=e.tokens.length,e.parser.tokenize(e),e.env.footnotes.list[o]={tokens:e.tokens.splice(s)},e.linkLevel--),e.pos=r+1,e.posMax=i,0)))}],["footnote_ref",function(e,t){var n,r,o,s,i=e.posMax,l=e.pos;if(l+3>i)return!1;if(!e.env.footnotes||!e.env.footnotes.refs)return!1;if(91!==e.src.charCodeAt(l))return!1;if(94!==e.src.charCodeAt(l+1))return!1;if(e.level>=e.options.maxNesting)return!1;for(r=l+2;r<i;r++){if(32===e.src.charCodeAt(r))return!1;if(10===e.src.charCodeAt(r))return!1;if(93===e.src.charCodeAt(r))break}return!(r===l+2||r>=i||(r++,n=e.src.slice(l+2,r-1),void 0===e.env.footnotes.refs[":"+n]||(t||(e.env.footnotes.list||(e.env.footnotes.list=[]),e.env.footnotes.refs[":"+n]<0?(o=e.env.footnotes.list.length,e.env.footnotes.list[o]={label:n,count:0},e.env.footnotes.refs[":"+n]=o):o=e.env.footnotes.refs[":"+n],s=e.env.footnotes.list[o].count,e.env.footnotes.list[o].count++,e.push({type:"footnote_ref",id:o,subId:s,level:e.level})),e.pos=r,e.posMax=i,0)))}],["autolink",function(e,t){var n,r,o,s,i,l=e.pos;return!(60!==e.src.charCodeAt(l)||(n=e.src.slice(l)).indexOf(">")<0||((r=n.match(fe))?he.indexOf(r[1].toLowerCase())<0||(i=w(s=r[0].slice(1,-1)),!e.parser.validateLink(s)||(t||(e.push({type:"link_open",href:i,level:e.level}),e.push({type:"text",content:s,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=r[0].length,0)):!(o=n.match(ue))||(i=w("mailto:"+(s=o[0].slice(1,-1))),!e.parser.validateLink(i)||(t||(e.push({type:"link_open",href:i,level:e.level}),e.push({type:"text",content:s,level:e.level+1}),e.push({type:"link_close",level:e.level})),e.pos+=o[0].length,0))))}],["htmltag",function(e,t){var n,r,o,s=e.pos;return!(!e.options.html||(o=e.posMax,60!==e.src.charCodeAt(s)||s+2>=o||33!==(n=e.src.charCodeAt(s+1))&&63!==n&&47!==n&&!function(e){var t=32|e;return t>=97&&t<=122}(n)||!(r=e.src.slice(s).match(be))||(t||e.push({type:"htmltag",content:e.src.slice(s,s+r[0].length),level:e.level}),e.pos+=r[0].length,0)))}],["entity",function(e,t){var n,r,s=e.pos,i=e.posMax;if(38!==e.src.charCodeAt(s))return!1;if(s+1<i)if(35===e.src.charCodeAt(s+1)){if(r=e.src.slice(s).match(_e))return t||(n="x"===r[1][0].toLowerCase()?parseInt(r[1].slice(1),16):parseInt(r[1],10),e.pending+=c(n)?p(n):p(65533)),e.pos+=r[0].length,!0}else if(r=e.src.slice(s).match(me)){var l=o(r[1]);if(r[1]!==l)return t||(e.pending+=l),e.pos+=r[0].length,!0}return t||(e.pending+="&"),e.pos++,!0}]];function Ce(){this.ruler=new A;for(var e=0;e<ye.length;e++)this.ruler.push(ye[e][0],ye[e][1]);this.validateLink=xe}function xe(e){var t=e.trim().toLowerCase();return-1===(t=d(t)).indexOf(":")||-1===["vbscript","javascript","file","data"].indexOf(t.split(":")[0])}Ce.prototype.skipToken=function(e){var t,n,r=this.ruler.getRules(""),o=r.length,s=e.pos;if((n=e.cacheGet(s))>0)e.pos=n;else{for(t=0;t<o;t++)if(r[t](e,!0))return void e.cacheSet(s,e.pos);e.pos++,e.cacheSet(s,e.pos)}},Ce.prototype.tokenize=function(e){for(var t,n,r=this.ruler.getRules(""),o=r.length,s=e.posMax;e.pos<s;){for(n=0;n<o&&!(t=r[n](e,!1));n++);if(t){if(e.pos>=s)break}else e.pending+=e.src[e.pos++]}e.pending&&e.pushPending()},Ce.prototype.parse=function(e,t,n,r){var o=new M(e,this,t,n,r);this.tokenize(o)};var Ae={default:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","replacements","smartquotes","references","abbr2","footnote_tail"]},block:{rules:["blockquote","code","fences","footnote","heading","hr","htmlblock","lheading","list","paragraph","table"]},inline:{rules:["autolink","backticks","del","emphasis","entity","escape","footnote_ref","htmltag","links","newline","text"]}}},full:{options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{},block:{},inline:{}}},commonmark:{options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkTarget:"",typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["block","inline","references","abbr2"]},block:{rules:["blockquote","code","fences","heading","hr","htmlblock","lheading","list","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","htmltag","links","newline","text"]}}}};function Me(e,t,n){this.src=t,this.env=n,this.options=e.options,this.tokens=[],this.inlineMode=!1,this.inline=e.inline,this.block=e.block,this.renderer=e.renderer,this.typographer=e.typographer}function Se(e,t){"string"!=typeof e&&(t=e,e="default"),t&&null!=t.linkify&&console.warn("linkify option is removed. Use linkify plugin instead:\n\nimport Remarkable from 'remarkable';\nimport linkify from 'remarkable/linkify';\nnew Remarkable().use(linkify)\n"),this.inline=new Ce,this.block=new ee,this.core=new D,this.renderer=new x,this.ruler=new A,this.options={},this.configure(Ae[e]),this.set(t||{})}Se.prototype.set=function(e){i(this.options,e)},Se.prototype.configure=function(e){var t=this;if(!e)throw new Error("Wrong `remarkable` preset, check name/content");e.options&&t.set(e.options),e.components&&Object.keys(e.components).forEach((function(n){e.components[n].rules&&t[n].ruler.enable(e.components[n].rules,!0)}))},Se.prototype.use=function(e,t){return e(this,t),this},Se.prototype.parse=function(e,t){var n=new Me(this,e,t);return this.core.process(n),n.tokens},Se.prototype.render=function(e,t){return t=t||{},this.renderer.render(this.parse(e,t),this.options,t)},Se.prototype.parseInline=function(e,t){var n=new Me(this,e,t);return n.inlineMode=!0,this.core.process(n),n.tokens},Se.prototype.renderInline=function(e,t){return t=t||{},this.renderer.render(this.parseInline(e,t),this.options,t)}}}]);
|