(function(d,p){typeof exports=="object"&&typeof module<"u"?module.exports=p():typeof define=="function"&&define.amd?define(p):(d=typeof globalThis<"u"?globalThis:d||self,d.RevealMath=p())})(this,(function(){"use strict";const d=()=>{let n,s={version:"latest",delimiters:[{left:"$$",right:"$$",display:!0},{left:"$",right:"$",display:!1},{left:"\\(",right:"\\)",display:!1},{left:"\\[",right:"\\]",display:!0}],ignoredTags:["script","noscript","style","textarea","pre","code"]};const r=t=>{let a=document.createElement("link");a.rel="stylesheet",a.href=t,document.head.appendChild(a)},o=t=>new Promise((a,i)=>{const l=document.createElement("script");l.type="text/javascript",l.onload=a,l.onerror=i,l.src=t,document.head.append(l)});async function e(t){for(const a of t)await o(a)}return{id:"katex",init:function(t){n=t;let a=n.getConfig().katex||{},i={...s,...a};const{local:l,version:x,extensions:$,...g}=i;let c=i.local||"https://cdn.jsdelivr.net/npm/katex",u=i.local?"":"@"+i.version,M=c+u+"/dist/katex.min.css",J=c+u+"/dist/katex.min.js",v=c+u+"/dist/contrib/mhchem.min.js",S=c+u+"/dist/contrib/auto-render.min.js",h=[J];i.extensions&&i.extensions.includes("mhchem")&&h.push(v),h.push(S);const m=()=>{renderMathInElement(t.getSlidesElement(),g),n.layout()};r(M),e(h).then(()=>{n.isReady()?m():n.on("ready",m.bind(this))})}}},p=()=>{let n,s={messageStyle:"none",tex2jax:{inlineMath:[["$","$"],["\\(","\\)"]],skipTags:["script","noscript","style","textarea","pre","code"]},skipStartupTypeset:!0};function r(o,e){let t=document.querySelector("head"),a=document.createElement("script");a.type="text/javascript",a.src=o;let i=()=>{typeof e=="function"&&(e.call(),e=null)};a.onload=i,a.onreadystatechange=()=>{this.readyState==="loaded"&&i()},t.appendChild(a)}return{id:"mathjax2",init:function(o){n=o;let e=n.getConfig().mathjax2||n.getConfig().math||{},t={...s,...e},a=t.mathjax||"https://cdn.jsdelivr.net/npm/mathjax@2/MathJax.js",i=t.config||"TeX-AMS_HTML-full",l=a+"?config="+i;t.tex2jax={...s.tex2jax,...e.tex2jax},t.mathjax=t.config=null,r(l,function(){MathJax.Hub.Config(t),MathJax.Hub.Queue(["Typeset",MathJax.Hub,n.getRevealElement()]),MathJax.Hub.Queue(n.layout),n.on("slidechanged",function(x){MathJax.Hub.Queue(["Typeset",MathJax.Hub,x.currentSlide])})})}}},f=()=>{let n,s={tex:{inlineMath:[["$","$"],["\\(","\\)"]]},options:{skipHtmlTags:["script","noscript","style","textarea","pre","code"]},startup:{ready:()=>{MathJax.startup.defaultReady(),MathJax.startup.promise.then(()=>{n.layout()})}}};function r(o,e){let t=document.createElement("script");t.type="text/javascript",t.id="MathJax-script",t.src=o,t.async=!0,t.onload=()=>{typeof e=="function"&&(e.call(),e=null)},document.head.appendChild(t)}return{id:"mathjax3",init:function(o){n=o;let e=n.getConfig().mathjax3||{},t={...s,...e};t.tex={...s.tex,...e.tex},t.options={...s.options,...e.options},t.startup={...s.startup,...e.startup};let a=t.mathjax||"https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js";t.mathjax=null,window.MathJax=t,r(a,function(){n.addEventListener("slidechanged",function(i){MathJax.typeset()})})}}},y=()=>{let n,s={tex:{inlineMath:[["$","$"],["\\(","\\)"]]},options:{skipHtmlTags:["script","noscript","style","textarea","pre","code"]},startup:{ready:()=>{MathJax.startup.defaultReady(),MathJax.startup.promise.then(()=>{n.layout()})}}};function r(o,e){let t=document.createElement("script");t.type="text/javascript",t.id="MathJax-script",t.src=o,t.async=!0,t.onload=()=>{typeof e=="function"&&(e.call(),e=null)},document.head.appendChild(t)}return{id:"mathjax4",init:function(o){n=o;let e=n.getConfig().mathjax4||{},t={...s,...e};t.tex={...s.tex,...e.tex},t.options={...s.options,...e.options},t.startup={...s.startup,...e.startup};let a=t.mathjax||"https://cdn.jsdelivr.net/npm/mathjax@4/tex-mml-chtml.js";t.mathjax=null,window.MathJax=t,r(a,function(){MathJax.startup.promise.then(()=>{MathJax.typeset(),n.addEventListener("slidechanged",function(i){MathJax.typeset()})})})}}},j=p;return Plugin=Object.assign(j(),{KaTeX:d,MathJax2:p,MathJax3:f,MathJax4:y})}));
