text: "use strict";var JSWidgets=window.JSWidgets||{};JSWidgets.markdown=JSWidgets.markdown||{},JSWidgets.markdown.converter=function(){function e(){h={h1:s.h1||"md-h1",h2:s.h2||"md-h2",h3:s.h3||"md-h3",h4:s.h4||"md-h4",h5:s.h5||"md-h5",h6:s.h6||"md-h6",hr:s.hr||"md-hr",mark:s.mark||"md-mark",underline:s.underline||"md-underline",blockquote:s.blockquote||"md-blockquote",em:s.em||"md-em",image:s.image||"md-image",link:s.link||"md-link",code:s.code||"md-code",strong:s.strong||"md-strong",bold:s.bold||"md-bold",table:s.table||"md-table",ul:s.ul||"md-ul",line:s.line||"md-line",highLight:s.highLight||"md-high-light",pre:s.pre||"md-pre",backlog:s.backlog||"md-backlog",completed:s.completed||"md-completed"},g=[{name:"h1",pattern:/^#{1} (.*)/gm,HTML:"<h1 class='"+h.h1+"'>$1</h1>"},{name:"h2",pattern:/^#{2} (.*)/gm,HTML:"<h2 class='"+h.h2+"'>$1</h2>"},{name:"h3",pattern:/^#{3} (.*)/gm,HTML:"<h3 class='"+h.h3+"'>$1</h3>"},{name:"h4",pattern:/^#{4} (.*)/gm,HTML:"<h4 class='"+h.h4+"'>$1</h4>"},{name:"h5",pattern:/^#{5} (.*)/gm,HTML:"<h5 class='"+h.h5+"'>$1</h5>"},{name:"h6",pattern:/^#{6} (.*)/gm,HTML:"<h6 class='"+h.h6+"'>$1</h6>"},{name:"blockquote",pattern:/^>(.*)/gm,HTML:"<blockquote class='"+h.blockquote+"'>$1</blockquote>"},{name:"hr",pattern:/^---$/gm,HTML:"<hr class='"+h.hr+"'>"}],u=[{name:"image",pattern:/\!\[(.*)\]\((.*)\)/g,HTML:"<img class='"+h.image+"' src='$2' alt='$1' title='$1'>"},{name:"link",pattern:/\[(.*)\]\((.*)\)/g,HTML:"<a href='$2' target='_blank' class='"+h.link+"'>$1</a>"},{name:"bold",pattern:/\*{2}([^\*]*?)\*{2}/g,HTML:"<strong class='"+h.bold+"'>$1</strong>"},{name:"italic",pattern:/\*{1}(.*)\*{1}/g,HTML:"<em class='"+h.em+"'>$1</em>"},{name:"code",pattern:/`(.*?)`/g,HTML:"<code class='"+h.code+"'>$1</code>"},{name:"mark",pattern:/==(.*)==/gm,HTML:"<span class='"+h.mark+"'>$1</span>"},{name:"underline",pattern:/\+\+(.*)\+\+/gm,HTML:"<span class='"+h.underline+"'>$1</span>"},{name:"backlog",pattern:/- \[ \](.*)/gm,HTML:"<div class='"+h.backlog+"'><input type='checkbox' disabled>$1</div>"},{name:"completed",pattern:/- \[x\](.*)/gm,HTML:"<div class='"+h.completed+"'><input type='checkbox' disabled checked>$1</div>"}]}function t(e){return e=e.replace(/^(?!(<.+>)).*/gm,function(e,t){for(var n=0,r=u.length;n<r;n++){var a=u[n];e=e.replace(a.pattern,a.HTML)}return e})}function n(e){for(var t=0,n=g.length;t<n;t++){var r=g[t];e=e.replace(r.pattern,r.HTML)}return e}function r(e){return e.replace(/(.*)\|(.*)(\|(.*))*\n(---\|---(\|---)*)\n((.*)\|(.*)(\|(.*))*[\n]{0,})+/gm,function(e,t,n){e=e.split(/[\|\n]/);var r="<table class='"+h.table+"'>",a="<thead><tr>",l="<tbody>",c=e.indexOf("---");return e.length%c==1&&(e.length=e.length-1),e.filter(function(e,t,n){if("---"!=e)return!0}).forEach(function(e,t){t<c?a+="<th>"+e+"</th>":t==c?(l+="<tr>",l+="<td>"+e+"</td>"):t%c==0?(l+="</tr><tr>",l+="<td>"+e+"</td>"):l+="<td>"+e+"</td>"}),a+="</tr></thead>",l+="</tr></tbody>",r+=a+l+"</table>"})}function a(e){return e=e.replace(/^`{3}[\n]{1,}((?:(.)|\n)*?)`{3}$/gm,function(e,t){var n=l(t);return"<pre class='"+h.pre+"'><code>"+n+"</code></pre>"})}function l(e){return e=e.replace(/(.*)\n/g,"<p class='"+h.highLight+"'>$1</p>")}function c(e){return e=e.replace(/</g,function(e){switch(e){case"<":return"&lt;";case">":return"&gt;";case"/":return"&frasl;"}})}function m(e){return e.replace(/\t/g,"    ")}function d(e){return e=e.replace(/^([ ]*(?:[-+*]|\d\.)[ ]+(.+)[\r\n]{0,})+/gm,function(e,t,n,r){var a=i(e);return"<ul class='"+h.ul+"'>"+a+"</ul>\n"})}function i(e){return e=e.replace(/((?:(?:^[-+*])|(?:\d.)) (.+))|(([ ]{2,}(?:(?:[-+*])|(?:\d\.))[ ]+(.+)[\r\n]{0,})+)/gm,function(e,t,n,r){return t?"<li>"+n+"</li>":(e=e.replace(/^[ ]{1,2}/gm,""),"<li style='list-style:none;'>"+d(e)+"</li>")})}function o(e){return e=e.replace(/(^[^\n<].*)/gm,"<p class='"+h.line+"'>$1</p>")}var s={},h={};this.setHTMLClass=function(e){"object"==typeof e&&(s=e)},this.buildToHTML=function(l){return"string"!=typeof l?"":(e(),l=c(l),l=m(l),l=a(l),l=t(l),l=d(l),l=n(l),l=r(l),"<div class='md-body'>"+(l=o(l))+"</div>")};var g=[],u=[]};