UNPKG

mathjax

Version:

Beautiful and accessible math in all browsers. MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all browsers. This package includes the packaged components (install mathjax-full to get the source

1 lines 3.73 kB
(()=>{"use strict";var t={d:(e,o)=>{for(var a in o)t.o(o,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:o[a]})}};t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),t.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var e={};t.r(e),t.d(e,{SetOptionsConfiguration:()=>T,SetOptionsUtil:()=>m});const o=("undefined"!=typeof window?window:t.g).MathJax._.components.global,a=(o.GLOBAL,o.isObject,o.combineConfig,o.combineDefaults,o.combineWithMathJax),n=(o.MathJax,MathJax._.input.tex.HandlerTypes),i=n.ConfigurationType,r=n.HandlerType,s=MathJax._.input.tex.Configuration,l=s.Configuration,p=s.ConfigurationHandler,u=(s.ParserConfiguration,MathJax._.input.tex.TokenMap),c=(u.parseResult,u.AbstractTokenMap,u.RegExpMap,u.AbstractParseMap,u.CharacterMap,u.DelimiterMap,u.MacroMap,u.CommandMap),f=(u.EnvironmentMap,MathJax._.input.tex.TexError.default),O=MathJax._.input.tex.ParseUtil,d=(O.KeyValueDef,O.KeyValueTypes,O.ParseUtil),g=MathJax._.input.tex.Token,x=(g.Token,g.Macro),w=MathJax._.input.tex.base.BaseMethods,b=(w.splitAlignArray,w.default),h=MathJax._.util.Options,M=h.isObject,y=(h.APPEND,h.REMOVE,h.OPTIONS,h.Expandable,h.expandable),k=(h.makeArray,h.keys,h.copy,h.insert,h.defaultOptions,h.userOptions,h.selectOptions,h.selectOptionsFromKeys,h.separateOptions,h.lookup,MathJax._.util.PrioritizedList.PrioritizedList),m={filterPackage(t,e){if("tex"!==e&&!p.get(e))throw new f("NotAPackage","Not a defined package: %1",e);const o=t.options.setoptions,a=o.allowOptions[e];if(void 0===a&&!o.allowPackageDefault||!1===a)throw new f("PackageNotSettable",'Options can\'t be set for package "%1"',e);return!0},filterOption(t,e,o){const a=t.options.setoptions,n=a.allowOptions[e]||{},i="tex"===e,r=Object.hasOwn(n,o)&&!M(n[o])?n[o]:null;if(!1===r||null===r&&!a.allowOptionsDefault)throw i?new f("TeXOptionNotSettable",'Option "%1" is not allowed to be set',o):new f("OptionNotSettable",'Option "%1" is not allowed to be set for package %2',o,e);const s=i?t.options:t.options[e];if(!s||!Object.hasOwn(s,o))throw i?new f("InvalidTexOption",'Invalid TeX option "%1"',o):new f("InvalidOptionKey",'Invalid option "%1" for package "%2"',o,e);return!0},filterValue(t,e,o,a){if("string"!=typeof a)return a;const n=a.match(/^\/(.*)\/([dgimsuvy]*)$/);return n?new RegExp(n[1],n[2]):a}};function P(t,e){const o=t.GetBrackets(e)||"tex",a=d.keyvalOptions(t.GetArgument(e)),n=t.options.setoptions;if(n.filterPackage(t,o)){for(const e of Object.keys(a))n.filterOption(t,o,e)&&(("tex"===o?t.options:t.options[o])[e]=n.filterValue(t,o,e,a[e]));t.Push(t.itemFactory.create("null"))}}const T=l.create("setoptions",{[i.CONFIG]:function(t,e){const o=new c("setoptions",{setOptions:P}),a=e.parseOptions.handlers.get(r.MACRO);a.add(["setoptions"],null,k.DEFAULTPRIORITY-1);const n=a.lookup("require");n&&(o.add("Require",new x("Require",n._func)),o.add("require",new x("require",b.Macro,["\\Require{#2}\\setOptions[#2]{#1}",2,""])))},[i.PRIORITY]:3,[i.OPTIONS]:{setoptions:{filterPackage:m.filterPackage,filterOption:m.filterOption,filterValue:m.filterValue,allowPackageDefault:!0,allowOptionsDefault:!0,allowOptions:y({tex:{FindTeX:!1,formatError:!1,package:!1,baseURL:!1,tags:!1,maxBuffer:!1,maxMaxros:!1,macros:!1,environments:!1},setoptions:!1,autoload:!1,require:!1,configmacros:!1,tagformat:!1})}}});MathJax.loader&&MathJax.loader.checkVersion("[tex]/setoptions","4.1.0","tex-extension"),a({_:{input:{tex:{setoptions:{SetOptionsConfiguration:e}}}}})})();