define(["require","exports","tslib","remarkable","./FormDefinition"],function(e,t,n,r,o){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),o=n.__importStar(o);var a=document.createElement("div"),i=document.createElement("div"),s=document.createTextNode("");a.appendChild(s);var c=document.createElement("span"),d=/[\\`*_{}[\]()#+\-.!>~]/g,l=/^[ ]{4}/gm,u=/^[ ]{0,3}[	]{1}/gm,m=/[ ]{2}$/gm,f=new r.Remarkable("commonmark",{html:!1,linkTarget:"_blank"});function g(e){return s.data=e,a.innerHTML}t.escapeTextForMarkdown=function(e){return e=(e=(e=(e=e.replace(d,"\\$&")).replace(l," ")).replace(u," ")).replace(m," ")},t.isMarkdown=function(e){return null!=e&&"string"==typeof e.markdown},t.isStatus=function(e){return null!=e&&"string"==typeof e.status},t.textToHtml=g;var p=["abbr","audio","b","bdo","br","button","canvas","cite","code","command","data","datalist","dfn","em","embed","i","iframe","img","input","kbd","keygen","label","mark","math","meter","noscript","object","output","progress","q","ruby","samp","script","select","small","span","strong","sub","sup","svg","textarea","time","const","video","wbr"];function b(e){var t,n,r,o="",a="";r=!1,(n=e)instanceof Text?r=""!==n.textContent.trim():n instanceof HTMLElement&&(n=n.tagName.toLowerCase(),r=-1!==p.indexOf(n)),r&&(e instanceof Text?o+=g(e.textContent):e instanceof HTMLElement&&(o+=n=(t=e.outerHTML).substring(0,t.indexOf(">")+1),a=(r=t.lastIndexOf("<"))<n.length?"":t.substring(r)));for(var i=0;i<e.childNodes.length;i++)o+=b(e.childNodes[i]);return o+=a}function T(e,t){void 0===t&&(t=o.HTMLContentCategory.Flow);e=f.render(e);return e=t===o.HTMLContentCategory.Phrasing?function(e){c.innerHTML=e;for(var t="",n=0;n<c.childNodes.length;n++)t+=b(c.childNodes[n]);return t}(e):e}t.markdownToHtml=T,t.markdownToText=function(e){return i.innerHTML=T(e,o.HTMLContentCategory.Flow),i.innerText}});