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