{"ast":null,"code":"\"use strict\";\n\nvar __extends = this && this.__extends || function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar __importDefault = this && this.__importDefault || function (mod) {\n return mod && mod.__esModule ? mod : {\n \"default\": mod\n };\n};\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.ColortblConfiguration = exports.ColorArrayItem = void 0;\nvar BaseItems_js_1 = require(\"../base/BaseItems.js\");\nvar Configuration_js_1 = require(\"../Configuration.js\");\nvar SymbolMap_js_1 = require(\"../SymbolMap.js\");\nvar TexError_js_1 = __importDefault(require(\"../TexError.js\"));\nvar ColorArrayItem = function (_super) {\n __extends(ColorArrayItem, _super);\n function ColorArrayItem() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.color = {\n cell: '',\n row: '',\n col: []\n };\n _this.hasColor = false;\n return _this;\n }\n ColorArrayItem.prototype.EndEntry = function () {\n _super.prototype.EndEntry.call(this);\n var cell = this.row[this.row.length - 1];\n var color = this.color.cell || this.color.row || this.color.col[this.row.length - 1];\n if (color) {\n cell.attributes.set('mathbackground', color);\n this.color.cell = '';\n this.hasColor = true;\n }\n };\n ColorArrayItem.prototype.EndRow = function () {\n _super.prototype.EndRow.call(this);\n this.color.row = '';\n };\n ColorArrayItem.prototype.createMml = function () {\n var mml = _super.prototype.createMml.call(this);\n var table = mml.isKind('mrow') ? mml.childNodes[1] : mml;\n if (table.isKind('menclose')) {\n table = table.childNodes[0].childNodes[0];\n }\n if (this.hasColor && table.attributes.get('frame') === 'none') {\n table.attributes.set('frame', '');\n }\n return mml;\n };\n return ColorArrayItem;\n}(BaseItems_js_1.ArrayItem);\nexports.ColorArrayItem = ColorArrayItem;\nnew SymbolMap_js_1.CommandMap('colortbl', {\n cellcolor: ['TableColor', 'cell'],\n rowcolor: ['TableColor', 'row'],\n columncolor: ['TableColor', 'col']\n}, {\n TableColor: function (parser, name, type) {\n var lookup = parser.configuration.packageData.get('color').model;\n var model = parser.GetBrackets(name, '');\n var color = lookup.getColor(model, parser.GetArgument(name));\n var top = parser.stack.Top();\n if (!(top instanceof ColorArrayItem)) {\n throw new TexError_js_1.default('UnsupportedTableColor', 'Unsupported use of %1', parser.currentCS);\n }\n if (type === 'col') {\n if (top.table.length) {\n throw new TexError_js_1.default('ColumnColorNotTop', '%1 must be in the top row', name);\n }\n top.color.col[top.row.length] = color;\n if (parser.GetBrackets(name, '')) {\n parser.GetBrackets(name, '');\n }\n } else {\n top.color[type] = color;\n if (type === 'row' && (top.Size() || top.row.length)) {\n throw new TexError_js_1.default('RowColorNotFirst', '%1 must be at the beginning of a row', name);\n }\n }\n }\n});\nvar config = function (config, jax) {\n if (!jax.parseOptions.packageData.has('color')) {\n Configuration_js_1.ConfigurationHandler.get('color').config(config, jax);\n }\n};\nexports.ColortblConfiguration = Configuration_js_1.Configuration.create('colortbl', {\n handler: {\n macro: ['colortbl']\n },\n items: {\n 'array': ColorArrayItem\n },\n priority: 10,\n config: [config, 10]\n});","map":{"version":3,"names":["__extends","extendStatics","d","b","Object","setPrototypeOf","__proto__","Array","p","prototype","hasOwnProperty","call","TypeError","String","__","constructor","create","__importDefault","mod","__esModule","defineProperty","exports","value","ColortblConfiguration","ColorArrayItem","BaseItems_js_1","require","Configuration_js_1","SymbolMap_js_1","TexError_js_1","_super","_this","apply","arguments","color","cell","row","col","hasColor","EndEntry","length","attributes","set","EndRow","createMml","mml","table","isKind","childNodes","get","ArrayItem","CommandMap","cellcolor","rowcolor","columncolor","TableColor","parser","name","type","lookup","configuration","packageData","model","GetBrackets","getColor","GetArgument","top","stack","Top","default","currentCS","Size","config","jax","parseOptions","has","ConfigurationHandler","Configuration","handler","macro","items","priority"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/mathjax-full/js/input/tex/colortbl/ColortblConfiguration.js"],"sourcesContent":["\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ColortblConfiguration = exports.ColorArrayItem = void 0;\nvar BaseItems_js_1 = require(\"../base/BaseItems.js\");\nvar Configuration_js_1 = require(\"../Configuration.js\");\nvar SymbolMap_js_1 = require(\"../SymbolMap.js\");\nvar TexError_js_1 = __importDefault(require(\"../TexError.js\"));\nvar ColorArrayItem = (function (_super) {\n __extends(ColorArrayItem, _super);\n function ColorArrayItem() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.color = {\n cell: '',\n row: '',\n col: []\n };\n _this.hasColor = false;\n return _this;\n }\n ColorArrayItem.prototype.EndEntry = function () {\n _super.prototype.EndEntry.call(this);\n var cell = this.row[this.row.length - 1];\n var color = this.color.cell || this.color.row || this.color.col[this.row.length - 1];\n if (color) {\n cell.attributes.set('mathbackground', color);\n this.color.cell = '';\n this.hasColor = true;\n }\n };\n ColorArrayItem.prototype.EndRow = function () {\n _super.prototype.EndRow.call(this);\n this.color.row = '';\n };\n ColorArrayItem.prototype.createMml = function () {\n var mml = _super.prototype.createMml.call(this);\n var table = (mml.isKind('mrow') ? mml.childNodes[1] : mml);\n if (table.isKind('menclose')) {\n table = table.childNodes[0].childNodes[0];\n }\n if (this.hasColor && table.attributes.get('frame') === 'none') {\n table.attributes.set('frame', '');\n }\n return mml;\n };\n return ColorArrayItem;\n}(BaseItems_js_1.ArrayItem));\nexports.ColorArrayItem = ColorArrayItem;\nnew SymbolMap_js_1.CommandMap('colortbl', {\n cellcolor: ['TableColor', 'cell'],\n rowcolor: ['TableColor', 'row'],\n columncolor: ['TableColor', 'col']\n}, {\n TableColor: function (parser, name, type) {\n var lookup = parser.configuration.packageData.get('color').model;\n var model = parser.GetBrackets(name, '');\n var color = lookup.getColor(model, parser.GetArgument(name));\n var top = parser.stack.Top();\n if (!(top instanceof ColorArrayItem)) {\n throw new TexError_js_1.default('UnsupportedTableColor', 'Unsupported use of %1', parser.currentCS);\n }\n if (type === 'col') {\n if (top.table.length) {\n throw new TexError_js_1.default('ColumnColorNotTop', '%1 must be in the top row', name);\n }\n top.color.col[top.row.length] = color;\n if (parser.GetBrackets(name, '')) {\n parser.GetBrackets(name, '');\n }\n }\n else {\n top.color[type] = color;\n if (type === 'row' && (top.Size() || top.row.length)) {\n throw new TexError_js_1.default('RowColorNotFirst', '%1 must be at the beginning of a row', name);\n }\n }\n }\n});\nvar config = function (config, jax) {\n if (!jax.parseOptions.packageData.has('color')) {\n Configuration_js_1.ConfigurationHandler.get('color').config(config, jax);\n }\n};\nexports.ColortblConfiguration = Configuration_js_1.Configuration.create('colortbl', {\n handler: { macro: ['colortbl'] },\n items: { 'array': ColorArrayItem },\n priority: 10,\n config: [config, 10]\n});\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAI,IAAI,IAAI,IAAI,CAACA,SAAS,IAAM,YAAY;EACrD,IAAIC,aAAa,GAAG,SAAAA,CAAUC,CAAC,EAAEC,CAAC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