@changerawr/markdown 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,193 @@
1
+ "use strict";var ChangerawrMarkdown=(()=>{var He=Object.defineProperty;var bn=Object.getOwnPropertyDescriptor;var yn=Object.getOwnPropertyNames;var Tn=Object.prototype.hasOwnProperty;var xn=(n,e)=>()=>(n&&(e=n(n=0)),e);var At=(n,e)=>{for(var r in e)He(n,r,{get:e[r],enumerable:!0})},En=(n,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yn(e))!Tn.call(n,i)&&i!==r&&He(n,i,{get:()=>e[i],enumerable:!(o=bn(e,i))||o.enumerable});return n};var wn=n=>En(He({},"__esModule",{value:!0}),n);var Ft={};At(Ft,{default:()=>Gn});function C(n){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return Ye(n,e,o)}}function Cn(n){return function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return je(n,r)}}function d(n,e){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:we;kt&&kt(n,null);let o=e.length;for(;o--;){let i=e[o];if(typeof i=="string"){let c=r(i);c!==i&&(vn(e)||(e[o]=c),i=c)}n[i]=!0}return n}function On(n){for(let e=0;e<n.length;e++)I(n,e)||(n[e]=null);return n}function z(n){let e=$t(null);for(let[r,o]of Pt(n))I(n,r)&&(Array.isArray(o)?e[r]=On(o):o&&typeof o=="object"&&o.constructor===Object?e[r]=z(o):e[r]=o);return e}function le(n,e){for(;n!==null;){let o=Rn(n,e);if(o){if(o.get)return C(o.get);if(typeof o.value=="function")return C(o.value)}n=_n(n)}function r(){return null}return r}function zt(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Bn(),e=l=>zt(l);if(e.version="3.2.6",e.removed=[],!n||!n.document||n.document.nodeType!==ce.document||!n.Element)return e.isSupported=!1,e;let{document:r}=n,o=r,i=o.currentScript,{DocumentFragment:c,HTMLTemplateElement:u,Node:R,Element:N,NodeFilter:g,NamedNodeMap:b=n.NamedNodeMap||n.MozNamedAttrMap,HTMLFormElement:w,DOMParser:L,trustedTypes:x}=n,B=N.prototype,J=le(B,"cloneNode"),Zt=le(B,"remove"),Jt=le(B,"nextSibling"),Qt=le(B,"childNodes"),pe=le(B,"parentNode");if(typeof u=="function"){let l=r.createElement("template");l.content&&l.content.ownerDocument&&(r=l.content.ownerDocument)}let A,Q="",{implementation:_e,createNodeIterator:en,createDocumentFragment:tn,getElementsByTagName:nn}=r,{importNode:rn}=o,k=Nt();e.isSupported=typeof Pt=="function"&&typeof pe=="function"&&_e&&_e.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:Re,ERB_EXPR:Ae,TMPLIT_EXPR:ke,DATA_ATTR:on,ARIA_ATTR:sn,IS_SCRIPT_OR_DATA:an,ATTR_WHITESPACE:tt,CUSTOM_ELEMENT:ln}=It,{IS_ALLOWED_URI:nt}=It,y=null,rt=d({},[...Ct,...Fe,...Be,...We,...Ot]),E=null,ot=d({},[...Lt,...Ge,...Dt,...Ee]),m=Object.seal($t(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ee=null,Se=null,it=!0,Me=!0,st=!1,at=!0,G=!1,fe=!0,W=!1,Ce=!1,Oe=!1,Y=!1,me=!1,ge=!1,lt=!0,ct=!1,cn="user-content-",Le=!0,te=!1,j={},V=null,dt=d({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),ut=null,pt=d({},["audio","video","img","source","image","track"]),De=null,ft=d({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",be="http://www.w3.org/2000/svg",$="http://www.w3.org/1999/xhtml",X=$,Ie=!1,Ne=null,dn=d({},[he,be,$],ze),ye=d({},["mi","mo","mn","ms","mtext"]),Te=d({},["annotation-xml"]),un=d({},["title","style","font","a","script"]),ne=null,pn=["application/xhtml+xml","text/html"],fn="text/html",T=null,q=null,mn=r.createElement("form"),mt=function(t){return t instanceof RegExp||t instanceof Function},Pe=function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(q&&q===t)){if((!t||typeof t!="object")&&(t={}),t=z(t),ne=pn.indexOf(t.PARSER_MEDIA_TYPE)===-1?fn:t.PARSER_MEDIA_TYPE,T=ne==="application/xhtml+xml"?ze:we,y=I(t,"ALLOWED_TAGS")?d({},t.ALLOWED_TAGS,T):rt,E=I(t,"ALLOWED_ATTR")?d({},t.ALLOWED_ATTR,T):ot,Ne=I(t,"ALLOWED_NAMESPACES")?d({},t.ALLOWED_NAMESPACES,ze):dn,De=I(t,"ADD_URI_SAFE_ATTR")?d(z(ft),t.ADD_URI_SAFE_ATTR,T):ft,ut=I(t,"ADD_DATA_URI_TAGS")?d(z(pt),t.ADD_DATA_URI_TAGS,T):pt,V=I(t,"FORBID_CONTENTS")?d({},t.FORBID_CONTENTS,T):dt,ee=I(t,"FORBID_TAGS")?d({},t.FORBID_TAGS,T):z({}),Se=I(t,"FORBID_ATTR")?d({},t.FORBID_ATTR,T):z({}),j=I(t,"USE_PROFILES")?t.USE_PROFILES:!1,it=t.ALLOW_ARIA_ATTR!==!1,Me=t.ALLOW_DATA_ATTR!==!1,st=t.ALLOW_UNKNOWN_PROTOCOLS||!1,at=t.ALLOW_SELF_CLOSE_IN_ATTR!==!1,G=t.SAFE_FOR_TEMPLATES||!1,fe=t.SAFE_FOR_XML!==!1,W=t.WHOLE_DOCUMENT||!1,Y=t.RETURN_DOM||!1,me=t.RETURN_DOM_FRAGMENT||!1,ge=t.RETURN_TRUSTED_TYPE||!1,Oe=t.FORCE_BODY||!1,lt=t.SANITIZE_DOM!==!1,ct=t.SANITIZE_NAMED_PROPS||!1,Le=t.KEEP_CONTENT!==!1,te=t.IN_PLACE||!1,nt=t.ALLOWED_URI_REGEXP||Ut,X=t.NAMESPACE||$,ye=t.MATHML_TEXT_INTEGRATION_POINTS||ye,Te=t.HTML_INTEGRATION_POINTS||Te,m=t.CUSTOM_ELEMENT_HANDLING||{},t.CUSTOM_ELEMENT_HANDLING&&mt(t.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(m.tagNameCheck=t.CUSTOM_ELEMENT_HANDLING.tagNameCheck),t.CUSTOM_ELEMENT_HANDLING&&mt(t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(m.attributeNameCheck=t.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),t.CUSTOM_ELEMENT_HANDLING&&typeof t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(m.allowCustomizedBuiltInElements=t.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),G&&(Me=!1),me&&(Y=!0),j&&(y=d({},Ot),E=[],j.html===!0&&(d(y,Ct),d(E,Lt)),j.svg===!0&&(d(y,Fe),d(E,Ge),d(E,Ee)),j.svgFilters===!0&&(d(y,Be),d(E,Ge),d(E,Ee)),j.mathMl===!0&&(d(y,We),d(E,Dt),d(E,Ee))),t.ADD_TAGS&&(y===rt&&(y=z(y)),d(y,t.ADD_TAGS,T)),t.ADD_ATTR&&(E===ot&&(E=z(E)),d(E,t.ADD_ATTR,T)),t.ADD_URI_SAFE_ATTR&&d(De,t.ADD_URI_SAFE_ATTR,T),t.FORBID_CONTENTS&&(V===dt&&(V=z(V)),d(V,t.FORBID_CONTENTS,T)),Le&&(y["#text"]=!0),W&&d(y,["html","head","body"]),y.table&&(d(y,["tbody"]),delete ee.tbody),t.TRUSTED_TYPES_POLICY){if(typeof t.TRUSTED_TYPES_POLICY.createHTML!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof t.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw ae('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=t.TRUSTED_TYPES_POLICY,Q=A.createHTML("")}else A===void 0&&(A=Wn(x,i)),A!==null&&typeof Q=="string"&&(Q=A.createHTML(""));M&&M(t),q=t}},gt=d({},[...Fe,...Be,...Ln]),ht=d({},[...We,...Dn]),gn=function(t){let s=pe(t);(!s||!s.tagName)&&(s={namespaceURI:X,tagName:"template"});let a=we(t.tagName),f=we(s.tagName);return Ne[t.namespaceURI]?t.namespaceURI===be?s.namespaceURI===$?a==="svg":s.namespaceURI===he?a==="svg"&&(f==="annotation-xml"||ye[f]):!!gt[a]:t.namespaceURI===he?s.namespaceURI===$?a==="math":s.namespaceURI===be?a==="math"&&Te[f]:!!ht[a]:t.namespaceURI===$?s.namespaceURI===be&&!Te[f]||s.namespaceURI===he&&!ye[f]?!1:!ht[a]&&(un[a]||!gt[a]):!!(ne==="application/xhtml+xml"&&Ne[t.namespaceURI]):!1},P=function(t){ie(e.removed,{element:t});try{pe(t).removeChild(t)}catch{Zt(t)}},K=function(t,s){try{ie(e.removed,{attribute:s.getAttributeNode(t),from:s})}catch{ie(e.removed,{attribute:null,from:s})}if(s.removeAttribute(t),t==="is")if(Y||me)try{P(s)}catch{}else try{s.setAttribute(t,"")}catch{}},bt=function(t){let s=null,a=null;if(Oe)t="<remove></remove>"+t;else{let h=Mt(t,/^[\r\n\t ]+/);a=h&&h[0]}ne==="application/xhtml+xml"&&X===$&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");let f=A?A.createHTML(t):t;if(X===$)try{s=new L().parseFromString(f,ne)}catch{}if(!s||!s.documentElement){s=_e.createDocument(X,"template",null);try{s.documentElement.innerHTML=Ie?Q:f}catch{}}let v=s.body||s.documentElement;return t&&a&&v.insertBefore(r.createTextNode(a),v.childNodes[0]||null),X===$?nn.call(s,W?"html":"body")[0]:W?s.documentElement:v},yt=function(t){return en.call(t.ownerDocument||t,t,g.SHOW_ELEMENT|g.SHOW_COMMENT|g.SHOW_TEXT|g.SHOW_PROCESSING_INSTRUCTION|g.SHOW_CDATA_SECTION,null)},$e=function(t){return t instanceof w&&(typeof t.nodeName!="string"||typeof t.textContent!="string"||typeof t.removeChild!="function"||!(t.attributes instanceof b)||typeof t.removeAttribute!="function"||typeof t.setAttribute!="function"||typeof t.namespaceURI!="string"||typeof t.insertBefore!="function"||typeof t.hasChildNodes!="function")},Tt=function(t){return typeof R=="function"&&t instanceof R};function U(l,t,s){xe(l,a=>{a.call(e,t,s,q)})}let xt=function(t){let s=null;if(U(k.beforeSanitizeElements,t,null),$e(t))return P(t),!0;let a=T(t.nodeName);if(U(k.uponSanitizeElement,t,{tagName:a,allowedTags:y}),fe&&t.hasChildNodes()&&!Tt(t.firstElementChild)&&S(/<[/\w!]/g,t.innerHTML)&&S(/<[/\w!]/g,t.textContent)||t.nodeType===ce.progressingInstruction||fe&&t.nodeType===ce.comment&&S(/<[/\w]/g,t.data))return P(t),!0;if(!y[a]||ee[a]){if(!ee[a]&&wt(a)&&(m.tagNameCheck instanceof RegExp&&S(m.tagNameCheck,a)||m.tagNameCheck instanceof Function&&m.tagNameCheck(a)))return!1;if(Le&&!V[a]){let f=pe(t)||t.parentNode,v=Qt(t)||t.childNodes;if(v&&f){let h=v.length;for(let O=h-1;O>=0;--O){let H=J(v[O],!0);H.__removalCount=(t.__removalCount||0)+1,f.insertBefore(H,Jt(t))}}}return P(t),!0}return t instanceof N&&!gn(t)||(a==="noscript"||a==="noembed"||a==="noframes")&&S(/<\/no(script|embed|frames)/i,t.innerHTML)?(P(t),!0):(G&&t.nodeType===ce.text&&(s=t.textContent,xe([Re,Ae,ke],f=>{s=se(s,f," ")}),t.textContent!==s&&(ie(e.removed,{element:t.cloneNode()}),t.textContent=s)),U(k.afterSanitizeElements,t,null),!1)},Et=function(t,s,a){if(lt&&(s==="id"||s==="name")&&(a in r||a in mn))return!1;if(!(Me&&!Se[s]&&S(on,s))){if(!(it&&S(sn,s))){if(!E[s]||Se[s]){if(!(wt(t)&&(m.tagNameCheck instanceof RegExp&&S(m.tagNameCheck,t)||m.tagNameCheck instanceof Function&&m.tagNameCheck(t))&&(m.attributeNameCheck instanceof RegExp&&S(m.attributeNameCheck,s)||m.attributeNameCheck instanceof Function&&m.attributeNameCheck(s))||s==="is"&&m.allowCustomizedBuiltInElements&&(m.tagNameCheck instanceof RegExp&&S(m.tagNameCheck,a)||m.tagNameCheck instanceof Function&&m.tagNameCheck(a))))return!1}else if(!De[s]){if(!S(nt,se(a,tt,""))){if(!((s==="src"||s==="xlink:href"||s==="href")&&t!=="script"&&Sn(a,"data:")===0&&ut[t])){if(!(st&&!S(an,se(a,tt,"")))){if(a)return!1}}}}}}return!0},wt=function(t){return t!=="annotation-xml"&&Mt(t,ln)},vt=function(t){U(k.beforeSanitizeAttributes,t,null);let{attributes:s}=t;if(!s||$e(t))return;let a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:E,forceKeepAttr:void 0},f=s.length;for(;f--;){let v=s[f],{name:h,namespaceURI:O,value:H}=v,re=T(h),Ue=H,_=h==="value"?Ue:Mn(Ue);if(a.attrName=re,a.attrValue=_,a.keepAttr=!0,a.forceKeepAttr=void 0,U(k.uponSanitizeAttribute,t,a),_=a.attrValue,ct&&(re==="id"||re==="name")&&(K(h,t),_=cn+_),fe&&S(/((--!?|])>)|<\/(style|title)/i,_)){K(h,t);continue}if(a.forceKeepAttr)continue;if(!a.keepAttr){K(h,t);continue}if(!at&&S(/\/>/i,_)){K(h,t);continue}G&&xe([Re,Ae,ke],Rt=>{_=se(_,Rt," ")});let _t=T(t.nodeName);if(!Et(_t,re,_)){K(h,t);continue}if(A&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!O)switch(x.getAttributeType(_t,re)){case"TrustedHTML":{_=A.createHTML(_);break}case"TrustedScriptURL":{_=A.createScriptURL(_);break}}if(_!==Ue)try{O?t.setAttributeNS(O,h,_):t.setAttribute(h,_),$e(t)?P(t):St(e.removed)}catch{K(h,t)}}U(k.afterSanitizeAttributes,t,null)},hn=function l(t){let s=null,a=yt(t);for(U(k.beforeSanitizeShadowDOM,t,null);s=a.nextNode();)U(k.uponSanitizeShadowNode,s,null),xt(s),vt(s),s.content instanceof c&&l(s.content);U(k.afterSanitizeShadowDOM,t,null)};return e.sanitize=function(l){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=null,a=null,f=null,v=null;if(Ie=!l,Ie&&(l="<!-->"),typeof l!="string"&&!Tt(l))if(typeof l.toString=="function"){if(l=l.toString(),typeof l!="string")throw ae("dirty is not a string, aborting")}else throw ae("toString is not a function");if(!e.isSupported)return l;if(Ce||Pe(t),e.removed=[],typeof l=="string"&&(te=!1),te){if(l.nodeName){let H=T(l.nodeName);if(!y[H]||ee[H])throw ae("root node is forbidden and cannot be sanitized in-place")}}else if(l instanceof R)s=bt("<!---->"),a=s.ownerDocument.importNode(l,!0),a.nodeType===ce.element&&a.nodeName==="BODY"||a.nodeName==="HTML"?s=a:s.appendChild(a);else{if(!Y&&!G&&!W&&l.indexOf("<")===-1)return A&&ge?A.createHTML(l):l;if(s=bt(l),!s)return Y?null:ge?Q:""}s&&Oe&&P(s.firstChild);let h=yt(te?l:s);for(;f=h.nextNode();)xt(f),vt(f),f.content instanceof c&&hn(f.content);if(te)return l;if(Y){if(me)for(v=tn.call(s.ownerDocument);s.firstChild;)v.appendChild(s.firstChild);else v=s;return(E.shadowroot||E.shadowrootmode)&&(v=rn.call(o,v,!0)),v}let O=W?s.outerHTML:s.innerHTML;return W&&y["!doctype"]&&s.ownerDocument&&s.ownerDocument.doctype&&s.ownerDocument.doctype.name&&S(Ht,s.ownerDocument.doctype.name)&&(O="<!DOCTYPE "+s.ownerDocument.doctype.name+`>
2
+ `+O),G&&xe([Re,Ae,ke],H=>{O=se(O,H," ")}),A&&ge?A.createHTML(O):O},e.setConfig=function(){let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Pe(l),Ce=!0},e.clearConfig=function(){q=null,Ce=!1},e.isValidAttribute=function(l,t,s){q||Pe({});let a=T(l),f=T(t);return Et(a,f,s)},e.addHook=function(l,t){typeof t=="function"&&ie(k[l],t)},e.removeHook=function(l,t){if(t!==void 0){let s=An(k[l],t);return s===-1?void 0:kn(k[l],s,1)[0]}return St(k[l])},e.removeHooks=function(l){k[l]=[]},e.removeAllHooks=function(){k=Nt()},e}var Pt,kt,vn,_n,Rn,M,D,$t,Ye,je,xe,An,St,ie,kn,we,ze,Mt,se,Sn,Mn,I,S,ae,Ct,Fe,Be,Ln,We,Dn,Ot,Lt,Ge,Dt,Ee,In,Nn,Pn,$n,Un,Ut,Hn,zn,Ht,Fn,It,ce,Bn,Wn,Nt,Gn,Bt=xn(()=>{"use strict";({entries:Pt,setPrototypeOf:kt,isFrozen:vn,getPrototypeOf:_n,getOwnPropertyDescriptor:Rn}=Object),{freeze:M,seal:D,create:$t}=Object,{apply:Ye,construct:je}=typeof Reflect<"u"&&Reflect;M||(M=function(e){return e});D||(D=function(e){return e});Ye||(Ye=function(e,r,o){return e.apply(r,o)});je||(je=function(e,r){return new e(...r)});xe=C(Array.prototype.forEach),An=C(Array.prototype.lastIndexOf),St=C(Array.prototype.pop),ie=C(Array.prototype.push),kn=C(Array.prototype.splice),we=C(String.prototype.toLowerCase),ze=C(String.prototype.toString),Mt=C(String.prototype.match),se=C(String.prototype.replace),Sn=C(String.prototype.indexOf),Mn=C(String.prototype.trim),I=C(Object.prototype.hasOwnProperty),S=C(RegExp.prototype.test),ae=Cn(TypeError);Ct=M(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Fe=M(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Be=M(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),Ln=M(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),We=M(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),Dn=M(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ot=M(["#text"]),Lt=M(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),Ge=M(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Dt=M(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Ee=M(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),In=D(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Nn=D(/<%[\w\W]*|[\w\W]*%>/gm),Pn=D(/\$\{[\w\W]*/gm),$n=D(/^data-[\-\w.\u00B7-\uFFFF]+$/),Un=D(/^aria-[\-\w]+$/),Ut=D(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Hn=D(/^(?:\w+script|data):/i),zn=D(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ht=D(/^html$/i),Fn=D(/^[a-z][.\w]*(-[.\w]+)+$/i),It=Object.freeze({__proto__:null,ARIA_ATTR:Un,ATTR_WHITESPACE:zn,CUSTOM_ELEMENT:Fn,DATA_ATTR:$n,DOCTYPE_NAME:Ht,ERB_EXPR:Nn,IS_ALLOWED_URI:Ut,IS_SCRIPT_OR_DATA:Hn,MUSTACHE_EXPR:In,TMPLIT_EXPR:Pn}),ce={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Bn=function(){return typeof window>"u"?null:window},Wn=function(e,r){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let o=null,i="data-tt-policy-suffix";r&&r.hasAttribute(i)&&(o=r.getAttribute(i));let c="dompurify"+(o?"#"+o:"");try{return e.createPolicy(c,{createHTML(u){return u},createScriptURL(u){return u}})}catch{return console.warn("TrustedTypes policy "+c+" could not be created."),null}},Nt=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};Gn=zt()});var ar={};At(ar,{ChangerawrMarkdown:()=>F,createCumEngine:()=>Ze,default:()=>sr,parseCum:()=>ue,parseMarkdown:()=>qe,renderCum:()=>Z,renderCumToHtml:()=>Je,renderCumToJson:()=>et,renderCumToTailwind:()=>Qe,renderMarkdown:()=>Ke});var oe=class{constructor(e){this.rules=[];this.warnings=[];this.config=e||{}}addRule(e){this.rules.push(e),this.rules.sort((r,o)=>r.name.includes("alert")||r.name.includes("embed")||r.name.includes("button")?-1:o.name.includes("alert")||o.name.includes("embed")||o.name.includes("button")?1:r.name==="task-list"?-1:o.name==="task-list"||r.name==="list"&&o.name==="task-list"?1:o.name==="list"&&r.name==="task-list"?-1:r.name.localeCompare(o.name))}setupDefaultRulesIfEmpty(){this.rules.some(r=>!["alert","button","embed"].includes(r.name))||this.setupDefaultRules()}hasRule(e){return this.rules.some(r=>r.name===e)}parse(e){this.warnings=[],this.setupDefaultRulesIfEmpty();let r=this.preprocessMarkdown(e),o=[],i=r,c=0,u=this.config.maxIterations||e.length*2;for(;i.length>0&&c<u;){c++;let N=!1,g=null;for(let b of this.rules)try{let w=new RegExp(b.pattern.source,b.pattern.flags.replace("g","")),L=i.match(w);if(L&&L.index!==void 0){let x=L.index===0?1e3:1e3-L.index;(!g||x>g.priority||x===g.priority&&L.index<(g.match.index||0))&&(g={rule:b,match:L,priority:x})}}catch(w){this.config.debugMode&&console.warn(`Error in rule "${b.name}":`,w)}if(g&&g.match.index!==void 0){let{rule:b,match:w}=g,L=w.index;if(L>0){let x=i.slice(0,L);o.push({type:"text",content:x,raw:x}),i=i.slice(L);continue}try{let x=b.render(w);o.push({...x,raw:w[0]||""}),i=i.slice(w[0]?.length||0),N=!0}catch(x){let B=x instanceof Error?x.message:String(x);this.warnings.push(`Failed to render ${b.name}: ${B}`);let J=i[0];J&&(o.push({type:"text",content:J,raw:J}),i=i.slice(1))}}if(!N){let b=i[0];b&&(o.push({type:"text",content:b,raw:b}),i=i.slice(1))}}return c>=u&&this.warnings.push("Parser hit maximum iterations - possible infinite loop detected"),this.postProcessTokens(o)}getWarnings(){return[...this.warnings]}getConfig(){return{...this.config}}updateConfig(e){this.config={...this.config,...e}}setDebugMode(e){this.config.debugMode=e}clearWarnings(){this.warnings=[]}getIterationCount(){return 0}preprocessMarkdown(e){return this.config.validateMarkdown&&this.validateMarkdown(e),e.replace(/\r\n/g,`
3
+ `).replace(/\r/g,`
4
+ `)}validateMarkdown(e){let r=e.match(/\*\*/g);r&&r.length%2!==0&&this.warnings.push("Unclosed bold markers (**) detected - some bold formatting may not work");let o=e.match(/(?<!\*)\*(?!\*)/g);o&&o.length%2!==0&&this.warnings.push("Unclosed italic markers (*) detected - some italic formatting may not work");let i=e.match(/```/g);i&&i.length%2!==0&&this.warnings.push("Unclosed code blocks (```) detected - some code formatting may not work");let c=e.match(/`/g);c&&c.length%2!==0&&this.warnings.push("Unclosed inline code markers (`) detected - some code formatting may not work")}postProcessTokens(e){let r=[],o=0;for(;o<e.length;){let i=e[o];if(i&&i.type==="text"){let c=i.content||i.raw||"",u=o+1;for(;u<e.length&&e[u]&&e[u].type==="text";){let R=e[u];c+=R.content||R.raw||"",u++}(c.trim().length>0||c.includes(`
5
+ `))&&r.push({type:"text",content:c,raw:c}),o=u}else i&&r.push(i),o++}return r}setupDefaultRules(){this.addRule({name:"heading",pattern:/^(#{1,6})\s+(.+)$/m,render:e=>({type:"heading",content:e[2]?.trim()||"",raw:e[0]||"",attributes:{level:String(e[1]?.length||1)}})}),this.addRule({name:"codeblock",pattern:/```(\w+)?\s*\n([\s\S]*?)\n```/,render:e=>({type:"codeblock",content:e[2]||"",raw:e[0]||"",attributes:{language:e[1]||"text"}})}),this.addRule({name:"hard-break-backslash",pattern:/\\\s*\n/,render:e=>({type:"line-break",content:"",raw:e[0]||""})}),this.addRule({name:"hard-break-spaces",pattern:/ +\n/,render:e=>({type:"line-break",content:"",raw:e[0]||""})}),this.addRule({name:"paragraph-break",pattern:/\n\s*\n/,render:e=>({type:"paragraph-break",content:"",raw:e[0]||""})}),this.addRule({name:"bold",pattern:/\*\*((?:(?!\*\*).)+)\*\*/,render:e=>({type:"bold",content:e[1]||"",raw:e[0]||""})}),this.addRule({name:"italic",pattern:/\*((?:(?!\*).)+)\*/,render:e=>({type:"italic",content:e[1]||"",raw:e[0]||""})}),this.addRule({name:"code",pattern:/`([^`]+)`/,render:e=>({type:"code",content:e[1]||"",raw:e[0]||""})}),this.addRule({name:"image",pattern:/!\[([^\]]*)\]\(([^)]+?)(?:\s+"([^"]+)")?\)/,render:e=>({type:"image",content:e[1]||"",raw:e[0]||"",attributes:{alt:e[1]||"",src:e[2]||"",title:e[3]||""}})}),this.addRule({name:"link",pattern:/\[([^\]]+)\]\(([^)]+)\)/,render:e=>({type:"link",content:e[1]||"",raw:e[0]||"",attributes:{href:e[2]||""}})}),this.addRule({name:"task-list",pattern:/^(\s*)-\s*\[([ xX])\]\s*(.+)$/m,render:e=>({type:"task-item",content:e[3]||"",raw:e[0]||"",attributes:{checked:String((e[2]||"").toLowerCase()==="x")}})}),this.addRule({name:"list",pattern:/^(\s*)[-*+]\s+(.+)$/m,render:e=>({type:"list-item",content:e[2]||"",raw:e[0]||""})}),this.addRule({name:"blockquote",pattern:/^>\s+(.+)$/m,render:e=>({type:"blockquote",content:e[1]||"",raw:e[0]||""})}),this.addRule({name:"hr",pattern:/^---$/m,render:e=>({type:"hr",content:"",raw:e[0]||""})}),this.addRule({name:"soft-break",pattern:/\n/,render:e=>({type:"soft-break",content:" ",raw:e[0]||""})})}};var Xe={sanitize:n=>n};typeof window<"u"&&Promise.resolve().then(()=>(Bt(),Ft)).then(n=>{Xe=n.default}).catch(n=>{console.error("Failed to load DOMPurify",n)});var Yn=["h1","h2","h3","h4","h5","h6","p","br","strong","em","del","ins","a","img","ul","ol","li","blockquote","pre","code","table","thead","tbody","tr","th","td","div","span","sup","sub","hr","input","iframe","embed","object","param","video","audio","source","svg","path","polyline","line","circle","rect","g","defs","use","form","fieldset","legend","label","select","option","textarea","button"],jn=["href","title","alt","src","class","id","target","rel","type","checked","disabled","loading","width","height","style","role","frameborder","allowfullscreen","allow","sandbox","scrolling","allowtransparency","name","seamless","srcdoc","data-*","viewBox","fill","stroke","stroke-width","stroke-linecap","stroke-linejoin","d","points","x1","y1","x2","y2","cx","cy","r","rx","ry","autoplay","controls","loop","muted","preload","poster","value","placeholder","required","readonly","maxlength","minlength","max","min","step","pattern","autocomplete","autofocus"];function p(n){let e={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return n.replace(/[&<>"']/g,r=>e[r]||r)}function Wt(n){return n.toLowerCase().replace(/[^\w\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"").trim()}function Gt(n){try{if(n.includes("codepen.io/")||n.includes("youtube.com/embed/"))return n;if(typeof Xe?.sanitize=="function"){let e=Xe.sanitize(n,{ALLOWED_TAGS:Yn,ALLOWED_ATTR:jn,ALLOW_DATA_ATTR:!0,ALLOW_UNKNOWN_PROTOCOLS:!1,SAFE_FOR_TEMPLATES:!1,WHOLE_DOCUMENT:!1,RETURN_DOM:!1,RETURN_DOM_FRAGMENT:!1,FORCE_BODY:!1,SANITIZE_DOM:!1,SANITIZE_NAMED_PROPS:!1,FORBID_ATTR:["onload","onerror","onclick","onmouseover","onmouseout","onfocus","onblur"],ADD_TAGS:["iframe","embed","object","param"],ADD_ATTR:["allow","allowfullscreen","frameborder","scrolling","allowtransparency","sandbox","loading","style","title","name","seamless","srcdoc"],ALLOWED_URI_REGEXP:/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp|xxx):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i});return e.length<n.length*.7?Ve(n):e}return Ve(n)}catch(e){return console.error("Sanitization failed:",e),Ve(n)}}function Ve(n){return n.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,"").replace(/on\w+\s*=\s*"[^"]*"/gi,"").replace(/on\w+\s*=\s*'[^']*'/gi,"").replace(/javascript:/gi,"")}function Yt(n){try{return new URL(n).hostname}catch{return n}}function jt(n){let e={};return n&&n.split(",").forEach(r=>{let[o,i]=r.split(":").map(c=>c.trim());o&&i&&(e[o]=i)}),e}var de=class{constructor(e){this.rules=new Map;this.warnings=[];this.config={format:"tailwind",sanitize:!0,allowUnsafeHtml:!1,debugMode:!1,...e},this.setupDefaultRules()}addRule(e){this.rules.set(e.type,e)}hasRule(e){return this.rules.has(e)}render(e){this.warnings=[];let o=e.map(i=>this.renderToken(i)).join("");return this.config.sanitize&&!this.config.allowUnsafeHtml?Gt(o):o}getWarnings(){return[...this.warnings]}getConfig(){return{...this.config}}updateConfig(e){this.config={...this.config,...e}}setDebugMode(e){this.config.debugMode=e}clearWarnings(){this.warnings=[]}renderToken(e){let r=this.rules.get(e.type);if(r)try{return r.render(e)}catch(o){let i=o instanceof Error?o.message:String(o);return this.warnings.push(`Render error for ${e.type}: ${i}`),this.createErrorBlock(`Render error for ${e.type}: ${i}`)}return e.type==="text"?p(e.content||e.raw||""):this.config.debugMode?this.createDebugBlock(e):p(e.content||e.raw||"")}createErrorBlock(e){return this.config.format==="html"?`<div style="background-color: #fee; border: 1px solid #fcc; color: #c66; padding: 8px; border-radius: 4px; margin: 8px 0; font-size: 14px;">
6
+ <strong>Render Error:</strong> ${p(e)}
7
+ </div>`:`<div class="bg-red-100 border border-red-300 text-red-800 p-2 rounded text-sm mb-2">
8
+ <strong>Render Error:</strong> ${p(e)}
9
+ </div>`}createDebugBlock(e){return this.config.format==="html"?`<div style="background-color: #fffbf0; border: 1px solid #fed; color: #b8860b; padding: 8px; border-radius: 4px; margin: 8px 0; font-size: 14px;">
10
+ <strong>Unknown token type:</strong> ${p(e.type)}<br>
11
+ <strong>Content:</strong> ${p(e.content||e.raw||"")}
12
+ </div>`:`<div class="bg-yellow-100 border border-yellow-300 text-yellow-800 p-2 rounded text-sm mb-2">
13
+ <strong>Unknown token type:</strong> ${p(e.type)}<br>
14
+ <strong>Content:</strong> ${p(e.content||e.raw||"")}
15
+ </div>`}setupDefaultRules(){this.addRule({type:"heading",render:e=>{let r=parseInt(e.attributes?.level||"1"),o=e.content,i=Wt(o),c=p(o);if(this.config.format==="html")return`<h${r} id="${i}">${c}</h${r}>`;let u="group relative flex items-center gap-2";switch(r){case 1:u+=" text-3xl font-bold mt-8 mb-4";break;case 2:u+=" text-2xl font-semibold mt-6 mb-3";break;case 3:u+=" text-xl font-medium mt-5 mb-3";break;case 4:u+=" text-lg font-medium mt-4 mb-2";break;case 5:u+=" text-base font-medium mt-3 mb-2";break;case 6:u+=" text-sm font-medium mt-3 mb-2";break}return`<h${r} id="${i}" class="${u}">
16
+ ${c}
17
+ <a href="#${i}" class="opacity-0 group-hover:opacity-100 text-muted-foreground transition-opacity">
18
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
19
+ <path d="M7.5 4H5.75A3.75 3.75 0 002 7.75v.5a3.75 3.75 0 003.75 3.75h1.5m-1.5-4h3m1.5-4h1.75A3.75 3.75 0 0114 7.75v.5a3.75 3.75 0 01-3.75 3.75H8.5"/>
20
+ </svg>
21
+ </a>
22
+ </h${r}>`}}),this.addRule({type:"bold",render:e=>{let r=p(e.content);return this.config.format==="html"?`<strong>${r}</strong>`:`<strong class="font-bold">${r}</strong>`}}),this.addRule({type:"italic",render:e=>{let r=p(e.content);return this.config.format==="html"?`<em>${r}</em>`:`<em class="italic">${r}</em>`}}),this.addRule({type:"code",render:e=>{let r=p(e.content);return this.config.format==="html"?`<code style="background-color: #f3f4f6; padding: 2px 6px; border-radius: 4px; font-family: monospace; font-size: 0.875rem;">${r}</code>`:`<code class="bg-muted px-1.5 py-0.5 rounded text-sm font-mono">${r}</code>`}}),this.addRule({type:"codeblock",render:e=>{let r=e.attributes?.language||"text",o=p(e.content);return this.config.format==="html"?`<pre style="background-color: #f3f4f6; padding: 16px; border-radius: 6px; overflow-x: auto; margin: 16px 0;"><code class="language-${p(r)}">${o}</code></pre>`:`<pre class="bg-muted p-4 rounded-md overflow-x-auto my-4"><code class="language-${p(r)}">${o}</code></pre>`}}),this.addRule({type:"link",render:e=>{let r=e.attributes?.href||"#",o=p(r),i=p(e.content);return this.config.format==="html"?`<a href="${o}" target="_blank" rel="noopener noreferrer">${i}</a>`:`<a href="${o}" class="text-primary hover:underline inline-flex items-center gap-1" target="_blank" rel="noopener noreferrer">
23
+ ${i}
24
+ <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-external-link">
25
+ <path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path>
26
+ <polyline points="15 3 21 3 21 9"></polyline>
27
+ <line x1="10" y1="14" x2="21" y2="3"></line>
28
+ </svg>
29
+ </a>`}}),this.addRule({type:"list-item",render:e=>`<li>${p(e.content)}</li>`}),this.addRule({type:"blockquote",render:e=>{let r=p(e.content);return this.config.format==="html"?`<blockquote style="border-left: 2px solid #d1d5db; padding: 8px 0 8px 16px; margin: 16px 0; font-style: italic; color: #6b7280;">${r}</blockquote>`:`<blockquote class="pl-4 py-2 border-l-2 border-border italic text-muted-foreground my-4">${r}</blockquote>`}}),this.addRule({type:"text",render:e=>e.content?p(e.content):""}),this.addRule({type:"paragraph",render:e=>{if(!e.content)return"";let r=e.content.trim();if(!r)return"";let o=r.includes("<br>")?r:p(r);return this.config.format==="html"?`<p style="line-height: 1.75; margin-bottom: 16px;">${o}</p>`:`<p class="leading-7 mb-4">${o}</p>`}}),this.addRule({type:"task-item",render:e=>{let r=e.attributes?.checked==="true",o=p(e.content);return this.config.format==="html"?`<div style="display: flex; align-items: center; gap: 8px; margin: 8px 0;">
30
+ <input type="checkbox" ${r?"checked":""} disabled style="margin: 0;" />
31
+ <span${r?' style="text-decoration: line-through; color: #6b7280;"':""}>${o}</span>
32
+ </div>`:`<div class="flex items-center gap-2 my-2 task-list-item">
33
+ <input type="checkbox" ${r?"checked":""} disabled
34
+ class="form-checkbox h-4 w-4 rounded border-gray-300 text-primary focus:ring-primary" />
35
+ <span${r?' class="line-through text-muted-foreground"':""}>${o}</span>
36
+ </div>`}}),this.addRule({type:"image",render:e=>{let r=e.attributes?.src||"",o=e.attributes?.alt||"",i=e.attributes?.title||"",c=i?` title="${p(i)}"`:"";return this.config.format==="html"?`<img src="${p(r)}" alt="${p(o)}"${c} style="max-width: 100%; height: auto; border-radius: 8px; margin: 16px 0;" loading="lazy" />`:`<img src="${p(r)}" alt="${p(o)}"${c} class="max-w-full h-auto rounded-lg my-4" loading="lazy" />`}}),this.addRule({type:"hr",render:()=>this.config.format==="html"?'<hr style="margin: 24px 0; border: none; border-top: 1px solid #d1d5db;">':'<hr class="my-6 border-t border-border">'}),this.addRule({type:"line-break",render:()=>"<br>"}),this.addRule({type:"paragraph-break",render:()=>"</p><p>"}),this.addRule({type:"soft-break",render:e=>e.content||" "})}};var Vt={name:"alert",parseRules:[{name:"alert",pattern:/:::(\w+)(?:\s+(.*?))?\s*\n([\s\S]*?)\n:::/,render:n=>({type:"alert",content:n[3]?.trim()||"",raw:n[0]||"",attributes:{type:n[1]||"info",title:n[2]||""}})}],renderRules:[{type:"alert",render:n=>{let e=n.attributes?.type||"info",r=n.attributes?.title||"",o={info:{icon:"\u2139\uFE0F",classes:"bg-blue-500/10 border-blue-500/30 text-blue-600 border-l-blue-500"},warning:{icon:"\u26A0\uFE0F",classes:"bg-amber-500/10 border-amber-500/30 text-amber-600 border-l-amber-500"},error:{icon:"\u274C",classes:"bg-red-500/10 border-red-500/30 text-red-600 border-l-red-500"},success:{icon:"\u2705",classes:"bg-green-500/10 border-green-500/30 text-green-600 border-l-green-500"},tip:{icon:"\u{1F4A1}",classes:"bg-purple-500/10 border-purple-500/30 text-purple-600 border-l-purple-500"},note:{icon:"\u{1F4DD}",classes:"bg-gray-500/10 border-gray-500/30 text-gray-600 border-l-gray-500"}},i=o[e]||o.info,u=`border-l-4 p-4 mb-4 rounded-md transition-colors duration-200 ${i?.classes}`,R=r?`<div class="font-medium mb-2 flex items-center gap-2">
37
+ <span class="text-lg" role="img" aria-label="${e}">${i?.icon}</span>
38
+ <span>${r}</span>
39
+ </div>`:`<div class="font-medium mb-2 flex items-center gap-2">
40
+ <span class="text-lg" role="img" aria-label="${e}">${i?.icon}</span>
41
+ <span>${e.charAt(0).toUpperCase()+e.slice(1)}</span>
42
+ </div>`;return`<div class="${u}" role="alert" aria-live="polite">
43
+ ${R}
44
+ <div class="leading-relaxed">${n.content}</div>
45
+ </div>`}}]};var Xt={name:"button",parseRules:[{name:"button",pattern:/\[button:([^\]]+)\]\(([^)]+)\)(?:\{([^}]+)\})?/,render:n=>{let e=n[1]||"",r=n[2]||"",i=(n[3]||"").split(",").map(w=>w.trim()).filter(Boolean),c=["default","primary","secondary","success","danger","outline","ghost"],u=i.find(w=>c.includes(w))||"primary",R=["sm","md","lg"],N=i.find(w=>R.includes(w))||"md",g=i.includes("disabled"),b=i.includes("self")?"_self":"_blank";return{type:"button",content:e,raw:n[0]||"",attributes:{href:r,style:u,size:N,disabled:g.toString(),target:b}}}}],renderRules:[{type:"button",render:n=>{let e=n.attributes?.href||"#",r=n.attributes?.style||"primary",o=n.attributes?.size||"md",i=n.attributes?.disabled==="true",c=n.attributes?.target||"_blank",u=n.content,R=Vn(r,o);return`<a href="${e}" class="${R}"${c==="_blank"?' target="_blank" rel="noopener noreferrer"':c==="_self"?' target="_self"':""}${i?' aria-disabled="true" tabindex="-1"':""}>
46
+ ${u}${c==="_blank"&&!i?'<svg class="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/></svg>':""}
47
+ </a>`}}]};function Vn(n,e){let r=["inline-flex","items-center","justify-center","font-medium","rounded-lg","transition-colors","focus:outline-none","focus:ring-2","focus:ring-offset-2","disabled:opacity-50","disabled:cursor-not-allowed"],o={sm:["px-3","py-1.5","text-sm"],md:["px-4","py-2","text-base"],lg:["px-6","py-3","text-lg"]},i={default:["bg-slate-600","text-white","hover:bg-slate-700","focus:ring-slate-500"],primary:["bg-blue-600","text-white","hover:bg-blue-700","focus:ring-blue-500"],secondary:["bg-gray-600","text-white","hover:bg-gray-700","focus:ring-gray-500"],success:["bg-green-600","text-white","hover:bg-green-700","focus:ring-green-500"],danger:["bg-red-600","text-white","hover:bg-red-700","focus:ring-red-500"],outline:["border","border-blue-600","text-blue-600","hover:bg-blue-50","focus:ring-blue-500"],ghost:["text-gray-700","hover:bg-gray-100","focus:ring-gray-500"]};return[...r,...o[e]??o.md??[],...i[n]??i.primary??[]].join(" ")}var qt={name:"embed",parseRules:[{name:"embed",pattern:/\[embed:(\w+)\]\(([^)]+)\)(?:\{([^}]+)\})?/,render:n=>({type:"embed",content:n[2]||"",raw:n[0]||"",attributes:{provider:n[1]||"generic",url:n[2]||"",options:n[3]||""}})}],renderRules:[{type:"embed",render:n=>{let e=n.attributes?.provider||"generic",r=n.attributes?.url||"",o=n.attributes?.options||"";return Xn(e,r,o)}}]};function Xn(n,e,r){let o="rounded-lg border bg-card text-card-foreground shadow-sm mb-6 overflow-hidden",i=jt(r);switch(n.toLowerCase()){case"youtube":return qn(e,i,o);case"codepen":return Kn(e,i,o);case"figma":return er(e,i,o);case"twitter":case"tweet":return tr(e,i,o);case"github":return nr(e,i,o);case"vimeo":return Zn(e,i,o);case"spotify":return Jn(e,i,o);case"codesandbox":return Qn(e,i,o);default:return rr(e,i,o)}}function qn(n,e,r){let o=or(n);if(!o)return ve("Invalid YouTube URL",n,r);let i=new URLSearchParams;e.autoplay==="1"&&i.set("autoplay","1"),e.mute==="1"&&i.set("mute","1"),e.loop==="1"&&(i.set("loop","1"),i.set("playlist",o)),e.controls==="0"&&i.set("controls","0"),e.start&&i.set("start",e.start),i.set("rel","0"),i.set("modestbranding","1");let c=`https://www.youtube.com/embed/${o}?${i.toString()}`;return`
48
+ <div class="${r}">
49
+ <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
50
+ <iframe
51
+ style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;"
52
+ src="${c}"
53
+ title="YouTube video player"
54
+ frameborder="0"
55
+ allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
56
+ allowfullscreen>
57
+ </iframe>
58
+ </div>
59
+ </div>`}function Kn(n,e,r){let o=n.match(/codepen\.io\/([^\/]+)\/(?:pen|embed)\/([^\/\?#]+)/);if(!o)return ve("Invalid CodePen URL",n,r);let[,i,c]=o,u=e.height||"400",R=e.theme==="light"?"light":"dark",N=e.tab||"result",g=new URLSearchParams({"default-tab":N,"theme-id":R,editable:"true"}),b=`https://codepen.io/${i}/embed/${c}?${g.toString()}`;return`
60
+ <div class="${r}">
61
+ <iframe
62
+ height="${u}"
63
+ style="width: 100%; border: 0;"
64
+ scrolling="no"
65
+ title="CodePen Embed - ${c}"
66
+ src="${b}"
67
+ frameborder="0"
68
+ loading="lazy"
69
+ allowtransparency="true"
70
+ allowfullscreen="true">
71
+ </iframe>
72
+ </div>`}function Zn(n,e,r){let o=ir(n);if(!o)return ve("Invalid Vimeo URL",n,r);let i=new URLSearchParams;e.autoplay==="1"&&i.set("autoplay","1"),e.mute==="1"&&i.set("muted","1"),e.loop==="1"&&i.set("loop","1");let c=`https://player.vimeo.com/video/${o}?${i.toString()}`;return`
73
+ <div class="${r}">
74
+ <div style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;">
75
+ <iframe
76
+ style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0;"
77
+ src="${c}"
78
+ title="Vimeo video player"
79
+ frameborder="0"
80
+ allow="autoplay; fullscreen; picture-in-picture"
81
+ allowfullscreen>
82
+ </iframe>
83
+ </div>
84
+ </div>`}function Jn(n,e,r){let o=n.replace("open.spotify.com","open.spotify.com/embed"),i=e.height||"380";return`
85
+ <div class="${r}">
86
+ <iframe
87
+ style="border-radius: 12px;"
88
+ src="${o}"
89
+ width="100%"
90
+ height="${i}"
91
+ frameborder="0"
92
+ allowfullscreen=""
93
+ allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
94
+ loading="lazy">
95
+ </iframe>
96
+ </div>`}function Qn(n,e,r){let o=n;n.includes("/s/")&&(o=n.replace("/s/","/embed/"));let i=e.height||"500",c=e.view||"preview";return o.includes("?")||(o+=`?view=${c}`),`
97
+ <div class="${r}">
98
+ <iframe
99
+ src="${o}"
100
+ style="width: 100%; height: ${i}px; border: 0; border-radius: 4px; overflow: hidden;"
101
+ title="CodeSandbox Embed"
102
+ allow="accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking"
103
+ sandbox="allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts">
104
+ </iframe>
105
+ </div>`}function er(n,e,r){let o=`https://www.figma.com/embed?embed_host=share&url=${encodeURIComponent(n)}`,i=e.height||"450";return`
106
+ <div class="${r}">
107
+ <iframe
108
+ style="border: none;"
109
+ width="100%"
110
+ height="${i}"
111
+ src="${o}"
112
+ allowfullscreen>
113
+ </iframe>
114
+ </div>`}function tr(n,e,r){return`
115
+ <div class="${r}">
116
+ <div class="p-4">
117
+ <div class="flex items-center gap-3 mb-3">
118
+ <svg class="w-6 h-6 fill-current text-blue-500" viewBox="0 0 24 24">
119
+ <path d="M23.953 4.57a10 10 0 01-2.825.775 4.958 4.958 0 002.163-2.723c-.951.555-2.005.959-3.127 1.184a4.92 4.92 0 00-8.384 4.482C7.69 8.095 4.067 6.13 1.64 3.162a4.822 4.822 0 00-.666 2.475c0 1.71.87 3.213 2.188 4.096a4.904 4.904 0 01-2.228-.616v.06a4.923 4.923 0 003.946 4.827 4.996 4.996 0 01-2.212.085 4.936 4.936 0 004.604 3.417 9.867 9.867 0 01-6.102 2.105c-.39 0-.779-.023-1.17-.067a13.995 13.995 0 007.557 2.209c9.053 0 13.998-7.496 13.998-13.985 0-.21 0-.42-.015-.63A9.935 9.935 0 0024 4.59z"/>
120
+ </svg>
121
+ <div>
122
+ <div class="font-semibold text-foreground">Twitter Post</div>
123
+ <div class="text-sm text-muted-foreground">External Link</div>
124
+ </div>
125
+ </div>
126
+ <a href="${n}" target="_blank"
127
+ class="inline-flex items-center gap-2 text-primary hover:text-primary/80 font-medium transition-colors">
128
+ View on Twitter
129
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
130
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
131
+ </svg>
132
+ </a>
133
+ </div>
134
+ </div>`}function nr(n,e,r){let o=n.replace("https://github.com/","").split("/"),i=o[0],c=o[1];return!i||!c?ve("Invalid GitHub URL",n,r):`
135
+ <div class="${r}">
136
+ <div class="p-4">
137
+ <div class="flex items-center gap-3 mb-3">
138
+ <svg class="w-6 h-6 fill-current" viewBox="0 0 24 24">
139
+ <path d="M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"/>
140
+ </svg>
141
+ <div>
142
+ <div class="font-semibold text-foreground text-lg">${i}/${c}</div>
143
+ <div class="text-sm text-muted-foreground">GitHub Repository</div>
144
+ </div>
145
+ </div>
146
+ <a href="${n}" target="_blank"
147
+ class="inline-flex items-center gap-2 text-primary hover:text-primary/80 font-medium transition-colors">
148
+ View on GitHub
149
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
150
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
151
+ </svg>
152
+ </a>
153
+ </div>
154
+ </div>`}function rr(n,e,r){let o=Yt(n);return`
155
+ <div class="${r}">
156
+ <div class="p-4">
157
+ <div class="flex items-center gap-3 mb-3">
158
+ <div class="w-10 h-10 rounded-lg bg-muted flex items-center justify-center">
159
+ <svg class="w-5 h-5 text-muted-foreground" fill="none" stroke="currentColor" viewBox="0 0 24 24">
160
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.828 10.172a4 4 0 00-5.656 0l-4 4a4 4 0 105.656 5.656l1.102-1.101m-.758-4.899a4 4 0 005.656 0l4-4a4 4 0 00-5.656-5.656l-1.1 1.1"/>
161
+ </svg>
162
+ </div>
163
+ <div>
164
+ <div class="font-semibold text-foreground">External Link</div>
165
+ <div class="text-sm text-muted-foreground">${o}</div>
166
+ </div>
167
+ </div>
168
+ <a href="${n}" target="_blank"
169
+ class="inline-flex items-center gap-2 text-primary hover:text-primary/80 font-medium transition-colors break-all">
170
+ ${n}
171
+ <svg class="w-4 h-4 flex-shrink-0" fill="none" stroke="currentColor" viewBox="0 0 24 24">
172
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14"/>
173
+ </svg>
174
+ </a>
175
+ </div>
176
+ </div>`}function ve(n,e,r){return`
177
+ <div class="${r}">
178
+ <div class="p-4 text-destructive">
179
+ <div class="font-medium flex items-center gap-2">
180
+ <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
181
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"/>
182
+ </svg>
183
+ ${n}
184
+ </div>
185
+ <div class="text-sm text-muted-foreground mt-1 break-all">${e}</div>
186
+ </div>
187
+ </div>`}function or(n){let e=[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/|youtube\.com\/shorts\/)([^&\n?#]+)/,/youtube\.com\/watch\?.*v=([^&\n?#]+)/];for(let r of e){let o=n.match(r);if(o)return o[1]||null}return null}function ir(n){return n.match(/vimeo\.com\/(?:.*\/)?(\d+)/)?.[1]??null}var F=class{constructor(e){this.extensions=new Map;this.parser=new oe(e?.parser),this.renderer=new de(e?.renderer),this.registerBuiltInExtensions(),e?.extensions&&e.extensions.forEach(r=>{this.registerExtension(r)}),this.parser.setupDefaultRulesIfEmpty()}registerExtension(e){try{return this.extensions.set(e.name,e),e.parseRules.forEach(r=>{this.parser.addRule(r)}),e.renderRules.forEach(r=>{this.renderer.addRule(r)}),{success:!0,extensionName:e.name}}catch(r){let o=r instanceof Error?r.message:String(r);return{success:!1,extensionName:e.name,error:o}}}unregisterExtension(e){if(!this.extensions.get(e))return!1;try{return this.extensions.delete(e),this.rebuildParserAndRenderer(),!0}catch{return!1}}parse(e){return this.parser.parse(e)}render(e){return this.renderer.render(e)}toHtml(e){let r=this.parse(e);return this.render(r)}getExtensions(){return Array.from(this.extensions.keys())}hasExtension(e){return this.extensions.has(e)}getWarnings(){return[...this.parser.getWarnings(),...this.renderer.getWarnings()]}getDebugInfo(){return{warnings:this.getWarnings(),parseTime:0,renderTime:0,tokenCount:0,iterationCount:0}}getPerformanceMetrics(){return{parseTime:0,renderTime:0,totalTime:0,tokenCount:0}}registerBuiltInExtensions(){this.registerExtension(Vt),this.registerExtension(Xt),this.registerExtension(qt)}rebuildParserAndRenderer(){let e=this.parser.getConfig(),r=this.renderer.getConfig();this.parser=new oe(e),this.renderer=new de(r);let o=Array.from(this.extensions.values());this.extensions.clear(),o.forEach(i=>{this.registerExtension(i)}),this.parser.setupDefaultRulesIfEmpty()}},Kt=new F;function qe(n){return Kt.parse(n)}function Ke(n){return Kt.toHtml(n)}function Z(n,e){return new F(e).toHtml(n)}function ue(n,e){return new F(e).parse(n)}function Ze(n){return new F(n)}function Je(n){return Z(n,{renderer:{format:"html"}})}function Qe(n){return Z(n,{renderer:{format:"tailwind"}})}function et(n){return ue(n)}typeof window<"u"&&(window.ChangerawrMarkdown={renderCum:Z,parseCum:ue,createCumEngine:Ze,renderCumToHtml:Je,renderCumToTailwind:Qe,renderCumToJson:et,render:Z,parse:ue});var sr={renderCum:Z,parseCum:ue,createCumEngine:Ze,renderCumToHtml:Je,renderCumToTailwind:Qe,renderCumToJson:et,ChangerawrMarkdown:F,parseMarkdown:qe,renderMarkdown:Ke};return wn(ar);})();
188
+ /*! Bundled license information:
189
+
190
+ dompurify/dist/purify.es.mjs:
191
+ (*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE *)
192
+ */
193
+ //# sourceMappingURL=standalone.global.js.map