(()=>{"use strict";var t={d:(e,o)=>{for(var r in o)t.o(o,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:o[r]})}};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,{ColorArrayItem:()=>g,ColortblConfiguration:()=>b});const o=("undefined"!=typeof window?window:t.g).MathJax._.components.global,r=(o.GLOBAL,o.isObject,o.combineConfig,o.combineDefaults,o.combineWithMathJax),n=(o.MathJax,MathJax._.input.tex.HandlerTypes),a=n.ConfigurationType,l=n.HandlerType,i=MathJax._.input.tex.base.BaseItems,s=(i.StartItem,i.StopItem,i.OpenItem,i.CloseItem,i.NullItem,i.PrimeItem,i.SubsupItem,i.OverItem,i.LeftItem,i.Middle,i.RightItem,i.BreakItem,i.BeginItem,i.EndItem,i.StyleItem,i.PositionItem,i.CellItem,i.MmlItem,i.FnItem,i.NotItem,i.NonscriptItem,i.DotsItem,i.ArrayItem),c=(i.EqnArrayItem,i.MstyleItem,i.EquationItem,MathJax._.input.tex.Configuration),m=c.Configuration,u=c.ConfigurationHandler,h=(c.ParserConfiguration,MathJax._.input.tex.TokenMap),p=(h.parseResult,h.AbstractTokenMap,h.RegExpMap,h.AbstractParseMap,h.CharacterMap,h.DelimiterMap,h.MacroMap,h.CommandMap),d=(h.EnvironmentMap,MathJax._.input.tex.TexError.default);class g extends s{constructor(){super(...arguments),this.color={cell:"",row:"",col:[]},this.hasColor=!1}EndEntry(){super.EndEntry();const t=this.row[this.row.length-1],e=this.color.cell||this.color.row||this.color.col[this.row.length-1];e&&(t.attributes.set("mathbackground",e),this.color.cell="",this.hasColor=!0)}EndRow(){super.EndRow(),this.color.row=""}createMml(){const t=super.createMml();let e=t.isKind("mrow")?t.childNodes[1]:t;if(e.isKind("mstyle")&&(e=e.childNodes[0].childNodes[0]),e.isKind("menclose")&&(e=e.childNodes[0].childNodes[0]),this.hasColor){const t=e.attributes;"none"===t.get("frame")&&void 0===t.get("data-frame-styles")&&t.set("data-frame-styles","")}return t}}function f(t,e,o){const r=t.configuration.packageData.get("color").model,n=t.GetBrackets(e,""),a=r.getColor(n,t.GetArgument(e)),l=t.stack.Top();if(!(l instanceof g))throw new d("UnsupportedTableColor","Unsupported use of %1",t.currentCS);if("col"===o){if(l.table.length&&l.color.col[l.row.length]!==a)throw new d("ColumnColorNotTop","%1 must be in the top row or preamble",e);l.color.col[l.row.length]=a,t.GetBrackets(e,"")&&t.GetBrackets(e,"")}else if(l.color[o]=a,"row"===o&&(l.Size()||l.row.length))throw new d("RowColorNotFirst","%1 must be at the beginning of a row",e)}new p("colortbl",{cellcolor:[f,"cell"],rowcolor:[f,"row"],columncolor:[f,"col"]});const b=m.create("colortbl",{[a.HANDLER]:{[l.MACRO]:["colortbl"]},[a.ITEMS]:{array:g},[a.PRIORITY]:10,[a.CONFIG]:[function(t,e){e.parseOptions.packageData.has("color")||u.get("color").config(t,e)},10]});MathJax.loader&&MathJax.loader.checkVersion("[tex]/colortbl","4.1.3","tex-extension"),r({_:{input:{tex:{colortbl:{ColortblConfiguration:e}}}}})})();